Weight calculation method and device, fire vehicle dispatch recommendation method and device
By optimizing the extraction principle and weight calculation method of reference samples in the fire vehicle dispatch technology, the problems of uneven sample distribution and insufficient number of samples are solved, and the accuracy of feature attribute weights and the accuracy of search results are improved.
Patent Information
- Application Number
- CN202111434149.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-29
- Publication Date
- 2025-02-11
- Estimated Expiration
- 2041-11-29
AI Technical Summary
In the existing fire vehicle dispatching technology, traditional weight calculation methods fail to effectively consider the problems of uneven sample distribution and insufficient sample number, resulting in deviations in feature weight calculations and affecting the accuracy of the search results.
By extracting reference samples in the case library according to the principle that the probability of good cases being selected in the same type of cases is higher than that of poor cases, forming a first sample set and a second sample set, and calculating the first average difference value and the first characteristic attribute of the first characteristic property Two mean difference values, update the weight of feature attributes.
It improves the accuracy and rationality of feature attribute weights, reduces the weight calculation deviation caused by uneven sample distribution, and improves the accuracy of search results.
Smart Images

Figure CN114064881B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of fire truck dispatching, and in particular to a method and device for calculating the weight of characteristic attributes, and a method and device for recommending fire truck dispatching. Background Art
[0002] Urban fires can easily cause a large number of casualties and property losses. In recent years, as the probability of urban fires continues to increase, society and the people have put forward higher requirements for firefighting and rescue.
[0003] The traditional method for dispatching fire trucks during fire rescue operations relies on manual decision-making based on experience. However, manual decision-making based on experience is somewhat arbitrary and blind, and is time-consuming. Currently, there is a method for searching historical cases to find similar cases and use them to help decision-makers quickly develop solutions.
[0004] Initially, most historical case retrieval research used the KNN weighted retrieval strategy, which failed to consider the impact of feature attributes on weights. This resulted in a certain bias in the search results. Subsequent considerations focused on differences in feature attribute weights, such as in the patent "Method, Apparatus, and Terminal Device for Calculating Feature Attribute Weights" (CN110059118A). This patent calculates feature weights by randomly sampling n times from each class of samples in the training set and then takes the average. This reduces the impact of sample distribution differences on feature weights, resulting in more effective feature weights and thus improving the accuracy of search results.
[0005] However, the weight calculation method in this patent fundamentally requires that samples be evenly distributed. It does not consider the weight differences between reasonable and unreasonable samples, and does not differentiate between good and bad cases. In practical applications, case samples often have an uneven distribution of samples across categories, and the number of reasonable samples is low. If the selected samples do not effectively represent the actual situation, for example, if there are too many bad cases, the calculated weights can easily deviate. Therefore, it is necessary to further optimize the weight calculation of feature attributes. Summary of the Invention
[0006] One of the purposes of the present invention is to address the problems existing in the prior art and provide a method and device for calculating the weight of characteristic attributes, and a method and device for recommending the dispatch of fire trucks.
[0007] The technical solutions provided by the present invention are as follows:
[0008] A method for calculating the weight of a characteristic attribute includes: extracting a reference sample from a case library according to the principle that a good case has a higher probability of being selected than a bad case among similar cases;
[0009] Forming a first sample set and a second sample set of the reference sample, wherein the first sample set consists of k samples taken from samples of the same type as the reference sample and having the smallest distance to the reference sample, and the second sample set consists of k samples taken from samples of a different type from the reference sample and having the smallest distance to the reference sample;
[0010] Calculating, based on the reference sample and all samples in the first sample set and the second sample set of the reference sample, a first average difference value and a second average difference value of each feature attribute corresponding to the reference sample;
[0011] Extracting the next reference sample from the case library and repeating the above process until the number of extracted reference samples reaches a preset number;
[0012] Obtaining a weight update amount of the corresponding feature attribute according to the first average difference value and the second average difference value of each feature attribute corresponding to all reference samples;
[0013] Update the weight of the corresponding feature attribute according to the weight update amount of each feature attribute.
[0014] In some embodiments, extracting a reference sample from the case library according to the principle that good cases are more likely to be selected than bad cases among similar cases includes:
[0015] according to A reference sample is randomly drawn from the case base with a probability of
[0016] Among them, p(I(x i )) represents sample x i For category I(x i ), Represents sample x i From category I(x i ) is selected; Satisfaction: Among samples of the same category, samples with higher evaluation scores have a higher probability of being selected.
[0017] In some embodiments, calculating an evaluation score of a sample vehicle dispatch solution includes:
[0018] Obtaining a vehicle dispatch plan for the sample and a corresponding expert recommendation plan;
[0019] The evaluation score of the vehicle dispatching solution of the sample is calculated using the following formula:
[0020]
[0021] Among them, s(y i (β) ,zi (β) ) is the sample x i Vehicle dispatch plan y i With sample x i Experts' suggestions i The difference score on the fire truck type β, w(z i ) is the weight of the expert solution, and L is the total number of fire truck types.
[0022] In some embodiments, the step of calculating, based on the reference sample, all samples in the first sample set and the second sample set of the reference sample, a first average difference value and a second average difference value of each feature attribute corresponding to the reference sample includes:
[0023] Calculating a first average difference value of the characteristic attribute corresponding to the reference sample based on the difference between all samples in the first sample set and the reference sample in each characteristic attribute;
[0024] According to the difference between all samples in the second sample set and the reference sample in each characteristic attribute, a second average difference value of the characteristic attribute corresponding to the reference sample is calculated.
[0025] In some embodiments, the first average difference value of the characteristic attribute corresponding to the reference sample is calculated using the following formula:
[0026]
[0027] in, Represents sample x p From category I(x p ) is selected, is the reference sample x i With sample x p The difference in feature attribute α, N i H is the reference sample x i The first sample set of
[0028] The second average difference value of the characteristic attribute corresponding to the reference sample is calculated using the following formula:
[0029]
[0030] Among them, p(I(x q )) represents sample x q For category I(x q ), Represents sample x q From category I(x q ) is selected, Represents the reference sample x i With sample x q The difference in feature attribute α, p(I(x i )) represents the reference sample x i For category I(x i ), N i M is the reference sample x i The second sample set.
[0031] In some embodiments, the following formula is used to calculate the weight update amount of the feature attribute:
[0032]
[0033] Among them, the set T is the reference sample set selected in n operations, p(I(x i )) represents the reference sample x i For category I(x i ), Represents the reference sample x i From category I(x i ) is selected, is the reference sample x i The second average difference value of the corresponding feature attribute α, is the reference sample x i The first average difference value of the corresponding feature attribute α.
[0034] The present invention also provides a device for calculating the weight of characteristic attributes, comprising: an extraction module for extracting a reference sample from a case library according to the principle that the probability of selecting a good case is higher than that of selecting a bad case among similar cases;
[0035] a difference calculation module, configured to form a first sample set and a second sample set of the reference sample, wherein the first sample set is composed of k samples taken from samples of the same type as the reference sample and having the smallest distance from the reference sample, and the second sample set is composed of k samples taken from samples of a different type from the reference sample and having the smallest distance from the reference sample; and calculate, based on the reference sample and all samples in the first sample set and the second sample set of the reference sample, a first average difference value and a second average difference value of each feature attribute corresponding to the reference sample;
[0036] A repeat execution module is used to extract the next reference sample from the case library and repeat the above process until the number of reference samples extracted reaches a preset number;
[0037] The weight updating module is used to obtain the weight update amount of the corresponding feature attribute based on the first average difference value and the second average difference value of each feature attribute corresponding to all reference samples; and update the weight of the corresponding feature attribute according to the weight update amount of each feature attribute.
[0038] The present invention also provides a method for recommending fire truck dispatch, comprising:
[0039] According to the aforementioned characteristic attribute weight calculation method, the weight of each characteristic attribute is obtained; based on the weight of each characteristic attribute, the similarity between the target case and the existing cases in the case library is calculated respectively; based on the similarity, the fire truck dispatch plan of the case most similar to the target case is selected from the case library as the recommendation for the target case.
[0040] In some embodiments, calculating the similarity between the target case and existing cases in the case library includes:
[0041] Calculate the target case x according to the following formula goal Same as case x in the case library j Distance between:
[0042]
[0043] Among them, diff(x goal (α) -x j (α) ) is the target case x goa l and case x j The difference in feature attribute α, W α is the weight of the feature attribute α, ε(·) is the Heaviside function, θ is the attribute weight threshold, and N is the total number of feature attributes;
[0044] Determine the target case x based on the distance goa l and the case x j The similarity between them.
[0045] The present invention also provides a fire truck dispatch recommendation device, comprising:
[0046] A weight calculation module, used to obtain the weight of each feature attribute according to the aforementioned feature attribute weight calculation method;
[0047] A similarity calculation module is used to calculate the similarity between the target case and the existing cases in the case library according to the weights of the various feature attributes;
[0048] A recommendation module is used to select, from the case library, a fire truck dispatching plan of a case that is most similar to the target case according to the similarity as a recommendation for the target case.
[0049] The method and device for calculating the weights of characteristic attributes and the method and device for recommending the dispatch of fire trucks provided by the present invention can at least bring about the following beneficial effects: by redefining the sample screening method in the method for calculating the weights of characteristic attributes, the weight influence of reasonable samples is focused on, the weight calculation deviation problem caused by uneven sample distribution is avoided, and the accuracy and rationality of the weight are improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] The preferred implementation scheme will be described below in a clear and understandable manner with reference to the accompanying drawings, further illustrating the above-mentioned characteristics, technical features, advantages and implementation methods of the method and device for calculating the weight of characteristic attributes and the recommended method and device for dispatching fire trucks.
[0051] Figure 1 It is a flow chart of an embodiment of a method for calculating weights of feature attributes of the present invention;
[0052] Figure 2 It is a structural diagram of an embodiment of a device for calculating weights of characteristic attributes of the present invention;
[0053] Figure 3 is a flow chart of an embodiment of a recommended method for dispatching a fire truck according to the present invention;
[0054] Figure 4 It is a structural schematic diagram of an embodiment of a recommended device for dispatching fire trucks according to the present invention. DETAILED DESCRIPTION
[0055] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the specific embodiments of the present invention will be described below with reference to the accompanying drawings. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings and other embodiments can be obtained based on these drawings without inventive work.
[0056] To simplify the drawings, only the parts relevant to the present invention are schematically depicted in each figure. These parts do not represent the actual structure of the product. Furthermore, to simplify the drawings and facilitate understanding, in some figures, only one component with the same structure or function is schematically depicted or labeled. As used herein, "one" not only means "only one" but also "more than one."
[0057] As mentioned above, the current weight calculation method randomly extracts n reference samples from each category of samples in the case library and calculates the weights of the feature attributes based on these reference samples. Due to the uneven distribution of samples across categories in real applications and the limited number of reasonable samples, the reference samples obtained by this method tend to contain a high number of poor examples, which can lead to deviations in the calculated feature weights.
[0058] In order to solve the above problems, the present invention optimizes the extraction principle of reference samples so that the probability of good cases being extracted is higher than that of bad cases, thereby improving the accuracy and rationality of the weights of feature attributes.
[0059] The following describes in detail the method and device for calculating the weights of characteristic attributes provided by the present invention from the perspective of the application of fire truck dispatch in fire rescue. However, it should be noted that the method and device for calculating the weights of characteristic attributes provided by the present invention are not limited to the field of firefighting, but can also be applied to other fields.
[0060] In one embodiment, Figure 1 As shown, a method for calculating the weight of a feature attribute includes:
[0061] Step S100 extracts a reference sample from the case library according to the principle that the probability of selecting good cases is higher than that of selecting bad cases among similar cases;
[0062] Step S200 forms a first sample set and a second sample set of the reference sample, wherein the first sample set is composed of k samples taken from samples of the same type as the reference sample and having the smallest distance to the reference sample, and the second sample set is composed of k samples taken from samples of a different type from the reference sample and having the smallest distance to the reference sample;
[0063] Step S300 calculates a first average difference value and a second average difference value of each feature attribute corresponding to the reference sample based on the reference sample, the first sample set of the reference sample, and all samples in the second sample set;
[0064] Step S400 determines whether the number of reference samples extracted reaches a preset number; if not, jump to step S100 and repeat the above steps;
[0065] Step S500 obtains a weight update amount of the corresponding feature attribute according to the first average difference value and the second average difference value of each feature attribute corresponding to all reference samples;
[0066] Step S600 updates the weight of the corresponding feature attribute according to the weight update amount of each feature attribute.
[0067] Specifically, a case library can be constructed based on existing cases in the fire alarm database and corresponding vehicle dispatch plans. Cases are described using alarm characteristic information. Alarm characteristic information includes case type, case level, incident location, weather information, case filing time, caller description, burning material, and burning floor. As needed, several items in the alarm characteristic information that influence vehicle dispatch plans can be selected as characteristic attributes in the present invention.
[0068] Good and bad cases can be determined according to certain rules. For example, cases with an evaluation score above a first threshold are considered good cases. Each case in the case library is labeled, and the case library of similar cases is further divided into a good case sample set and a bad case sample set. When extracting reference samples, priority is given to the good case sample set, or the frequency of extraction from the good case sample set is higher than that of the bad case sample set. Assuming that the extraction operation is performed n times, this ensures that the number of good cases in the n reference samples extracted is higher than the number of bad cases, thereby achieving a higher probability of extracting good cases than bad cases.
[0069] In one embodiment, step S100 includes:
[0070] Step S110 extracts a reference sample from the case library according to the principle that samples with higher evaluation scores among similar cases have a higher probability of being selected.
[0071] In one embodiment, step S100 includes: A reference sample is randomly drawn from the case base with a probability of
[0072] Among them, p(I(x i )) represents sample x i For category I(x i ), Represents sample x i From category I(x i ) is selected; I(x i ) is the sample x i Category.
[0073] The following conditions must be met:
[0074] 1) When I(x i )=I(x j )=c, if S(y(x i ))≥S(y(x j )),but This condition indicates that among samples of the same category, samples with higher evaluation scores have a higher probability of being selected.
[0075] 2) For all c-th class samples x i , Satisfy the normalization condition, that is
[0076] Among them, y(x i ) represents the sample x i Vehicle dispatch plan, S(y(x i )) represents sample x i The evaluation score of the vehicle dispatch plan.
[0077] according to The probability of selecting reference samples increases, on the one hand, the probability of valid and reasonable samples in various types of samples being selected in the weight calculation, and on the other hand, it solves the problem of unbalanced number of samples in each category.
[0078] Further explanation of the probability concepts involved above:
[0079] Suppose there are two types of cases, Class A and Class B. Class A has 10 case samples, of which 3 are scored as Level 1, 3 are scored as Level 2, and 4 are scored as Level 3. Class B has 2 case samples, 1 is scored as Level 2, and 1 is scored as Level 3. A higher score indicates a higher evaluation score.
[0080] p(I(x i )) includes two types, namely the probability of Class A cases p(Class A) and the probability of Class B cases p(Class B), p(Class A) = 10 / 12; p(Class B) = 2 / 12.
[0081] It contains two categories, namely the probability of selecting a reference sample from category A cases and the probability of selecting a reference sample from category B cases.
[0082] The probability of selecting a reference sample in case A can be set as follows:
[0083] The samples with higher evaluation scores in the same category have a higher probability of being selected, which meets the above condition 1.
[0084] The above condition 2 is met. So the case of type A Meet the above requirements.
[0085] The probability of selecting a reference sample in case B can be set as follows, which also meets the above requirements:
[0086]
[0087] because It can be seen that the order in which the samples were extracted is: Class A case level 3, Class A case level 2, Class B case level 3, Class A case level 1, Class B case level 2.
[0088] It should be noted that there are multiple ways to set the above, and it is sufficient to meet the above conditions 1 and 2. It can be flexibly designed according to the usage scenario and needs.
[0089] In step S200, k samples with the smallest distance to the reference sample (referred to as k nearest neighbor samples of the same type) are selected from the samples of the same type as the reference sample and combined into a first sample set N i H ={H i1 ,H i2 ,...,H ik}; Take k samples with the smallest distance to the reference sample from the samples that are different from the reference sample (referred to as k different nearest neighbor samples) and combine them into the second sample set N i M ={M i1 ,M i2 ,...,M ik}.
[0090] The distance between two samples can be measured using Euclidean distance or Manhattan distance.
[0091] In one embodiment, the calculation of the first average difference value and the second average difference value of a feature attribute in step S300 includes:
[0092] Step S310 calculates a first average difference value of the characteristic attribute corresponding to the reference sample based on the difference in each characteristic attribute between all samples in the first sample set and the reference sample;
[0093] Step S320 calculates a second average difference value of the characteristic attribute corresponding to the reference sample based on the difference between all samples in the second sample set and the reference sample in each characteristic attribute.
[0094] In one embodiment, step S310 calculates the first average difference value of the characteristic attribute α corresponding to the reference sample using the following formula:
[0095]
[0096] in, Represents sample x p From category I(x p ) is selected, is the reference sample x i With sample x p The difference in feature attribute α, N i H is the reference sample xi The first sample set.
[0097] In step S320, the second average difference value of the characteristic attribute α corresponding to the reference sample is calculated using the following formula:
[0098]
[0099] Among them, p(I(x q )) represents sample x q For category I(x q ), Represents sample x q From category I(x q ) is selected, Represents the reference sample x i With sample x q The difference in feature attribute α, p(I(x i )) represents the reference sample x i For category I(x i ), N i M is the reference sample x i The second sample set.
[0100] The attribute difference function It can be defined as:
[0101] If the αth attribute value is a continuous value, then
[0102] If the αth attribute value is a discrete value, then
[0103]
[0104] in, Represents sample x i The value of the characteristic attribute α, max(α) represents the maximum value of the characteristic attribute α in the case library, and min(α) represents the minimum value of the characteristic attribute α in the case library. Represents sample x i With sample x j The difference in feature attribute α.
[0105] The first average difference value D iH (α) The existing method is to directly take the attribute difference function The arithmetic mean of This makes the attribute difference value of the more accurate similar nearest neighbor samples in D iH (α)The greater the contribution of , the more accurate and reasonable the weight factor will be.
[0106] In the above preferred embodiment, the second average difference value D iM (α) The probability factor is also introduced in the calculation of This makes it possible that after multiple iterations of learning, the more accurate the heterogeneous nearest neighbor samples (whose feature attribute values are more representative of the characteristics of their categories) are in D iM (α) The greater the contribution of , the more accurate and reasonable the weight factor will be.
[0107] Step S400 determines whether the number of reference samples extracted reaches a preset number n. If not, the process jumps to step S100 and repeats the above steps until n reference samples are extracted from the case library.
[0108] Step S500 calculates the weight update amount ΔW(α) of each feature attribute.
[0109] In one embodiment, the weight update amount of the feature attribute α is calculated using the following formula:
[0110]
[0111] Among them, set T is the reference sample set selected in n operations, Represents the reference sample x i From category I(x i ) is selected, is the reference sample x i The second average difference value of the corresponding feature attribute α, is the reference sample x i The first average difference value of the corresponding feature attribute α.
[0112] Step S600: Update the weight of the feature attribute α according to W(α)←W(α)+ΔW(α).
[0113] The initial value of W(α) can be set to 0, and ΔW(α) is added to obtain the weight of the updated feature attribute α.
[0114] In one embodiment, calculating an evaluation score of a sample vehicle dispatch solution includes:
[0115] Step S111 obtains the sample vehicle dispatch plan and the corresponding expert recommendation plan;
[0116] Step S112 evaluates and scores the vehicle dispatch plan of the sample based on the difference between the vehicle dispatch plan and the expert recommendation plan.
[0117] In one embodiment, the evaluation score of the sample vehicle dispatch solution is calculated using the following formula:
[0118]
[0119] Among them, y i For sample x i Vehicle dispatch plan, z i For sample x i Expert advice, y i (β) Vehicle dispatch plan y i The number of fire trucks of type β dispatched, z i (β) Recommend solutions to experts i The number of fire trucks of type β dispatched, s(y i (β) ,z i (β) ) is the vehicle dispatch plan y i Expert advice i The difference score on the fire truck type β, w(z i ) is the weight of the expert solution, and L is the total number of fire truck types.
[0120] In one embodiment, s(y i (β) ,z i (β) )for
[0121] And s0 (β) ≥s + (β) ≥s - (β) .
[0122] If the vehicle dispatch plan dispatches the same number of type β fire trucks as the expert-recommended plan, the plan is considered appropriate. Points are awarded for appropriate responses. If the vehicle dispatch plan dispatches more type β fire trucks than the expert-recommended plan, the plan is considered over-dispatched. Over-dispatching results in wasted resources, and points are deducted accordingly. If the vehicle dispatch plan dispatches fewer type β fire trucks than the expert-recommended plan, the plan is considered under-dispatched. Under-dispatching can result in suboptimal firefighting and rescue efforts, or even casualties and property damage, and therefore, additional points are deducted.
[0123] The vehicle dispatching scores are calculated based on the appropriateness, over-dispatching, and under-dispatching of vehicles, as shown in the following table. and The value range can be set flexibly according to the actual situation. Positive, usually is negative, for example
[0124]
[0125] This embodiment redefines the sample screening method in the feature attribute weight calculation method, focuses on the weight influence of reasonable samples, avoids the weight calculation deviation problem caused by uneven sample distribution, and improves the accuracy and rationality of the weight.
[0126] In one embodiment, Figure 2 As shown, a device for calculating the weight of a feature attribute includes:
[0127] An extraction module 100 is used to extract a reference sample from the case library according to the principle that the probability of selecting good cases is higher than that of selecting bad cases among similar cases;
[0128] The difference calculation module 200 is configured to form a first sample set and a second sample set for the reference sample, wherein the first sample set is composed of k samples taken from samples of the same type as the reference sample and having the smallest distance from the reference sample, and the second sample set is composed of k samples taken from samples of a different type from the reference sample and having the smallest distance from the reference sample; and calculate, based on the reference sample, all samples in the first sample set and the second sample set of the reference sample, a first average difference value and a second average difference value for each feature attribute corresponding to the reference sample;
[0129] Repeating module 300 is used to determine whether the number of reference samples extracted reaches a preset number. If not, the next reference sample is extracted from the case library and the above process is repeated until the number of reference samples extracted reaches the preset number.
[0130] The weight updating module 400 is used to obtain the weight update amount of the corresponding feature attribute based on the first average difference value and the second average difference value of each feature attribute corresponding to all reference samples; and update the weight of the corresponding feature attribute based on the weight update amount of each feature attribute.
[0131] In one embodiment, the extraction module 100 is further configured to:
[0132] Among samples of the same category, samples with higher evaluation scores have a higher probability of being selected; the evaluation score of a sample is the evaluation score of the vehicle dispatch plan of the sample.
[0133] In one embodiment, the difference calculation module 200 is further configured to:
[0134] Calculate a first average difference value of the characteristic attribute corresponding to the reference sample based on the difference between all samples in the first sample set and the reference sample in each characteristic attribute;
[0135] According to the difference between all samples in the second sample set and the reference sample in each characteristic attribute, a second average difference value of the characteristic attribute corresponding to the reference sample is calculated.
[0136] In one embodiment, the first average difference value of the characteristic attribute α corresponding to the reference sample is calculated using the following formula:
[0137]
[0138] in, Represents sample x p From category I(x p ) is selected, is the reference sample x i With sample x p The difference in feature attribute α, N i H is the reference sample x i The first sample set.
[0139] The second average difference value of the characteristic attribute α corresponding to the reference sample is calculated using the following formula:
[0140]
[0141] Among them, p(I(x q )) represents sample x q For category I(x q ), Represents sample x q From category I(x q ) is selected, Represents the reference sample x i With sample x q The difference in feature attribute α, p(I(x i )) represents the reference sample x i For category I(x i ), N i M is the reference sample x i The second sample set.
[0142] In one embodiment, the weight updating module is further configured to:
[0143] The following formula is used to calculate the weight update of the feature attribute α:
[0144]
[0145] Among them, set T is the reference sample set selected in n operations, Represents the reference sample x i From category I(x i ) is selected, is the reference sample x i The second average difference value of the corresponding feature attribute α, is the reference sample x i The first average difference value of the corresponding characteristic attribute α, n is a preset number.
[0146] In one embodiment, the weight calculation device further includes:
[0147] The scoring module is used to calculate the evaluation score of a sample vehicle dispatch plan.
[0148] The scoring module is also used to obtain the vehicle dispatching plan of the sample and the corresponding expert recommendation plan; based on the difference between the vehicle dispatching plan and the expert recommendation plan, the vehicle dispatching plan of the sample is evaluated and scored.
[0149] In one embodiment, the scoring module calculates the evaluation score of the sample vehicle dispatch solution using the following formula:
[0150]
[0151] Among them, y i For sample x i Vehicle dispatch plan, z i For sample x i Expert advice, y i (β) Vehicle dispatch plan y i The number of fire trucks of type β dispatched, z i (β) Recommend solutions to experts i The number of fire trucks of type β dispatched, s(y i (β) ,z i (β) ) is the vehicle dispatch plan y i Expert advice i The difference score on the fire truck type β, w(z i ) is the weight of the expert solution, and L is the total number of fire truck types.
[0152] In one embodiment, s(y i (β) ,z i (β) )for:
[0153] And s0 (β) ≥s +(β) ≥s - (β) .
[0154] This embodiment redefines the sample screening method in the feature attribute weight calculation method, focuses on the weight influence of reasonable samples, avoids the weight calculation deviation problem caused by uneven sample distribution, and improves the accuracy and rationality of the weight.
[0155] It should be noted that the embodiments of the characteristic attribute weight calculation device provided by the present invention and the aforementioned embodiment of the characteristic attribute weight calculation method are based on the same inventive concept and can achieve the same technical effects. Therefore, for other specific details of the embodiments of the characteristic attribute weight calculation device, reference can be made to the description of the aforementioned embodiment of the characteristic attribute weight calculation method.
[0156] In one embodiment, Figure 3 As shown, a recommended method for dispatching fire trucks includes:
[0157] Step S10 obtains the weight of each feature attribute according to the aforementioned feature attribute weight calculation method;
[0158] Step S20 calculates the similarity between the target case and existing cases in the case library based on the weights of each feature attribute;
[0159] In step S30 , based on the obtained similarity, the fire truck dispatching plan of the case most similar to the target case is selected from the case library as a recommendation for the target case.
[0160] In one embodiment, step S20 includes: calculating the target case x goa l and case x in the case library j The distance between them; determine the target case x based on the distance goa l and case x j The similarity between them.
[0161] Calculate the target case x according to the following formula goa l and case x in the case library j Distance between:
[0162]
[0163] Among them, diff(x goal (α) -x j (α) ) is the target case x goa l and case x j The difference in feature attribute α, W αis the weight of the feature attribute α, ε(·) is the Heaviside function, θ is the attribute weight threshold, and N is the total number of feature attributes.
[0164] The Heaviside function, also known as the step function, is defined in continuous time as follows:
[0165]
[0166] The larger the distance value, the smaller the similarity between the two cases, that is, the less similar they are.
[0167] In one embodiment, Figure 4 As shown, a recommended device for dispatching fire trucks includes:
[0168] The weight calculation module 10 is used to obtain the weight of each feature attribute according to the aforementioned feature attribute weight calculation method;
[0169] The similarity calculation module 20 is used to calculate the similarity between the target case and the existing cases in the case library according to the weight of each feature attribute;
[0170] The recommendation module 30 is configured to select, from the case library, a fire truck dispatching plan of a case that is most similar to the target case based on the similarity, as a recommendation for the target case.
[0171] In one embodiment, the similarity calculation module 20 is further configured to calculate the target case x goa l and case x in the case library j The distance between them; determine the target case x based on the distance goa l and case x j The similarity between them.
[0172] Calculate the target case x according to the following formula goa l and case x in the case library j Distance between:
[0173]
[0174] Among them, diff(x goal (α) -x j (α) ) is the target case x goal With case x j The difference in feature attribute α, W α is the weight of the feature attribute α, ε(·) is the Heaviside function, θ is the attribute weight threshold, and N is the total number of feature attributes.
[0175] The larger the distance value, the smaller the similarity between the two cases, that is, the less similar they are.
[0176] It should be noted that the embodiments of the firefighting vehicle dispatch recommendation device provided herein and the aforementioned embodiments of the firefighting vehicle dispatch recommendation method are based on the same inventive concept and achieve the same technical effects. Therefore, for other specific details of the embodiments of the firefighting vehicle dispatch recommendation device, reference can be made to the aforementioned embodiments of the firefighting vehicle dispatch recommendation method.
[0177] It should be noted that the above embodiments can be freely combined as needed. The above description is only a preferred embodiment of the present invention. It should be pointed out that those skilled in the art can make several improvements and modifications without departing from the principles of the present invention, and such improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A method for calculating the weight of a feature attribute, characterized in that: include: A reference sample is drawn from the case base according to the principle that the probability of selecting good cases is higher than that of selecting bad cases among similar cases; The case library is constructed based on existing cases in the fire alarm database and corresponding vehicle dispatch plans. Each case is described by alarm feature information, and the alarm feature information that affects the vehicle dispatch plan is selected as the feature attribute; Forming a first sample set and a second sample set of the reference sample, wherein the first sample set is composed of k samples taken from samples of the same type as the reference sample and having the smallest distance from the reference sample, and the second sample set is composed of k samples taken from samples of a different type from the reference sample and having the smallest distance from the reference sample; According to the difference between all samples in the first sample set and the reference sample in each characteristic attribute, the first average difference value of the characteristic attribute corresponding to the reference sample is calculated using the following formula: in, Represents sample x p From category I(x p ) is selected, is the reference sample x i With sample x p The difference in feature attribute α, N i H is the reference sample x i The first sample set of According to the difference between all samples in the second sample set and the reference sample in each characteristic attribute, the second average difference value of the characteristic attribute corresponding to the reference sample is calculated using the following formula: Among them, p(I(x q )) represents sample x q For category I(x q ), Represents sample x q From category I(x q ) is selected, p(I(x i )) represents the reference sample x i For category I(x i ), N i M is the reference sample x i The second sample set of Extracting the next reference sample from the case library, and repeating the above process until the number of extracted reference samples reaches a preset number; According to the first average difference value and the second average difference value of each characteristic attribute corresponding to all reference samples, the weight update amount of the corresponding characteristic attribute is obtained; wherein the weight update amount of the characteristic attribute is calculated using the following formula: Among them, set T is the reference sample set selected in n operations, p(I(x i )) represents the reference sample x i For category I(x i ), Represents the reference sample x i From category I (x i ) is selected, is the reference sample x i The second average difference value of the corresponding feature attribute α, is the reference sample x i The first average difference value of the corresponding feature attribute α; Update the weight of the corresponding feature attribute according to the weight update amount of each feature attribute.
2. The weight calculation method according to claim 1, characterized in that: According to the principle that the probability of selecting good cases among similar cases is higher than that of selecting bad cases, a reference sample is extracted from the case library, including: A reference sample is drawn from the case library according to the principle that samples with higher evaluation scores among similar cases have a higher probability of being selected.
3. The weight calculation method according to claim 1, characterized in that: According to the principle that the probability of selecting good cases among similar cases is higher than that of selecting bad cases, a reference sample is extracted from the case library, including: according to A reference sample is randomly drawn from the case base with a probability of Among them, p(I(x i )) represents sample x i For category I(x i ), Represents sample x i From category I(x i ) is selected; Satisfies: Among samples of the same category, samples with higher evaluation scores have a higher probability of being selected.
4. The weight calculation method according to claim 2 or 3, characterized in that: Calculate the evaluation score of a sample vehicle dispatch solution, including: Obtaining a vehicle dispatching plan for the sample and a corresponding expert suggestion plan; The vehicle dispatching plan of the sample is evaluated and scored according to the difference between the vehicle dispatching plan and the expert recommendation plan.
5. The weight calculation method according to claim 4, characterized in that: The evaluation score of the vehicle dispatching solution of the sample is calculated using the following formula: Among them, s(y i (β) ,z i (β) ) is the sample x i Vehicle dispatch plan y i With sample x i Expert advice on i The difference score on the fire truck type β, w(z i ) is the weight of the expert solution, and L is the total number of fire truck types.
6. The weight calculation method according to claim 5, characterized in that: And s0 (β) >0≥s + (β) ≥s - (β) ; Among them, s0 (β) The score when the number of type β fire trucks dispatched for the vehicle dispatch solution is equal to the expert's recommended solution; s + (β) The score when the number of type β fire trucks dispatched for the vehicle dispatch solution is greater than that of the expert recommendation solution; s - (β) The score when the number of type β fire trucks dispatched for the vehicle dispatch solution is less than the expert recommendation solution.
7. A device for calculating the weight of a characteristic attribute, characterized in that: include: An extraction module is used to extract a reference sample from the case library according to the principle that the probability of selecting a good case is higher than that of a bad case among similar cases; The case library is constructed based on existing cases in the fire alarm database and corresponding vehicle dispatch plans. Each case is described by alarm feature information, and the alarm feature information that affects the vehicle dispatch plan is selected as the feature attribute; The difference calculation module is used to form a first sample set and a second sample set of the reference sample, wherein the first sample set is composed of k samples taken from samples of the same type as the reference sample and having the smallest distance to the reference sample, and the second sample set is composed of k samples taken from samples of a different type from the reference sample and having the smallest distance to the reference sample; according to the difference between all samples in the first sample set and the reference sample in each characteristic attribute, the first average difference value of the characteristic attribute corresponding to the reference sample is calculated using the following formula: in, Represents sample x p From category I (x p ) is selected, is the reference sample x i With sample x p The difference in feature attribute α, N i H is the reference sample x i The first sample set of According to the difference between all samples in the second sample set and the reference sample in each characteristic attribute, the second average difference value of the characteristic attribute corresponding to the reference sample is calculated using the following formula: Among them, p(I(x q )) represents sample x q For category I(x q ), Represents sample x q From category I(x q ) is selected, p(I(x i )) represents the reference sample x i For category I(x i ), N i M is the reference sample x i The second sample set of A repeat execution module is used to extract the next reference sample from the case library and repeat the above process until the number of reference samples extracted reaches a preset number; The weight updating module is used to obtain the weight update amount of the corresponding feature attribute according to the first average difference value and the second average difference value of each feature attribute corresponding to all reference samples; wherein the weight update amount of the feature attribute is calculated using the following formula: Among them, set T is the reference sample set selected in n operations, p(I(x i )) represents the reference sample x i For category I(x i ), Represents the reference sample x i From category I(x i ) is selected, is the reference sample x i The second average difference value of the corresponding feature attribute α, is the reference sample x i The first average difference value of the corresponding feature attribute α; Update the weight of the corresponding feature attribute according to the weight update amount of each feature attribute.
8. A method for recommending fire truck dispatch, characterized in that: include: Obtaining the weight of each feature attribute according to the feature attribute weight calculation method according to any one of claims 1 to 6; According to the weights of the characteristic attributes, the similarities between the target case and the existing cases in the case library are calculated respectively; According to the similarity, a fire truck dispatching plan of a case most similar to the target case is selected from the case library as a recommendation for the target case.
9. The method for recommending fire truck dispatch according to claim 8, characterized in that: The similarity between the target case and the existing cases in the case library is calculated as follows: The target case x is calculated according to the following formula goal The same as case x in the case library j Distance between: Among them, diff(x goal (α) -x j (α) ) is the target case x goal With case x j The difference in feature attribute α, W α is the weight of the feature attribute α, ε(·) is the Heaviside function, θ is the attribute weight threshold, and N is the total number of feature attributes; Determine the target case x according to the distance goal With the case x j The similarity between .
10. A fire truck dispatch recommendation device, characterized in that: include: A weight calculation module, used to obtain the weight of each feature attribute according to the weight calculation method of the feature attribute according to any one of claims 1 to 6; A similarity calculation module is used to calculate the similarity between the target case and the existing cases in the case library according to the weights of the characteristic attributes; A recommendation module is used to select, from the case library, a fire truck dispatching plan of a case most similar to the target case as a recommendation for the target case based on the similarity.
Citation Information
Patent Citations
Weight calculation method and device for characteristic attributes and terminal equipment
CN110059118A
Feature extraction method, electronic device and medical case similarity model construction method
CN111310857A
Concept drift detection method and system based on weighted sampling and electronic equipment
CN113033643A