Emergency plan generation method and device and electronic equipment
By combining the dual-channel retrieval mechanism of knowledge graph and vector library, the problem of low accuracy of emergency plans in existing technologies is solved, and a more accurate and logically coherent emergency plan is generated, which is suitable for responding to emergencies in public places.
Patent Information
- Application Number
- CN202511141744.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-15
- Publication Date
- 2025-09-30
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the prior art, the accuracy of determining emergency plans for public places only through vector retrieval is not high, resulting in inaccurate plans.
A dual-channel retrieval mechanism of knowledge graph and vector library is adopted. By converting the description information of abnormal events into text vectors and performing vector retrieval, graph retrieval is performed in combination with entity relationship triples, and emergency plans are generated by fusing knowledge subgraphs and text vectors.
The accuracy of emergency plan generation has been improved, ensuring that the generated plans are more accurate, logically coherent, and able to effectively respond to emergencies in public places.
Smart Images

Figure CN120723893A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and more specifically, to an emergency plan generation method, device, and electronic device. Background Art
[0002] In order to ensure the safety of public places, it is usually necessary to specify corresponding emergency plans so that emergencies can be responded to in a legal, rapid, scientific and orderly manner, and the damage caused by emergencies can be minimized.
[0003] In related technologies, vector retrieval is used to query related plans based on a plan knowledge base, and then a final plan is generated based on these related plans through a large model.
[0004] However, if only relevant plans are determined through vector retrieval, the accuracy of plan retrieval is not high, resulting in a low accuracy of the final plan generated. Summary of the Invention
[0005] In view of this, the embodiments of the present application provide an emergency plan generation method, device and electronic device to solve the problem that the accuracy of plan retrieval is not high when only determining relevant plans through vector retrieval, resulting in low accuracy of the final plan generated.
[0006] In a first aspect, an embodiment of the present application provides a method for generating an emergency plan, comprising: Obtain description information of abnormal events at the target location; Converting the abnormal event description information into a description text vector, and performing a vector search on a preset vector library based on the description text vector to obtain a target text vector, wherein the preset vector library includes: text vectors corresponding to multiple slice texts in the emergency treatment document of the target location; Extracting a target entity relationship triple from the abnormal event description information, and performing a graph search on a preset knowledge graph based on the target entity relationship triple to obtain a target knowledge subgraph, wherein the preset knowledge graph includes: a plurality of knowledge subgraphs, and the plurality of knowledge subgraphs are obtained by clustering the entity relationship triples in the plurality of slice texts; A target slice text is obtained by fusing the first slice text corresponding to the target text vector and the second slice text corresponding to the target knowledge subgraph; The target large language model part in the multimodal large model of the target place is used to generate an emergency plan for the target place according to the target slice text.
[0007] In an optional embodiment, obtaining abnormal event description information for the target location includes: Using sensor equipment to collect current surveillance video and current IoT data for the target location; Using the target visual encoder in the multimodal large model, visually encode the current monitoring video to obtain video encoding information; Using the target large language model portion, processing the video encoding information to identify the type of abnormal event at the target location; According to the location of the sensor device, the Internet of Things data and the type of abnormal event, the location where the abnormal event occurred and the number of people in the target place are identified; the abnormal event description information includes the type of abnormal event, the location where the abnormal event occurred and the number of people.
[0008] In an optional embodiment, the method further includes: Based on historical surveillance videos of the target location, self-supervised pre-training is performed on the first visual encoder in the base multimodal large model to obtain a second visual encoder; Incrementally pre-training the first language model portion of the base multimodal large model according to the operation control data of the target location to obtain the second language model portion; According to the pre-labeled graphic data, the second visual encoder and the second large language model are fine-tuned to obtain the target visual encoder and the target large language model.
[0009] In an optional embodiment, the fusing the first slice text corresponding to the target text vector and the second slice text corresponding to the target knowledge subgraph to obtain the target slice text includes: Obtaining a first vector similarity between the text vector corresponding to the first slice text and the description text vector, and a second vector similarity between the text vector corresponding to the second slice text and the description text vector; Determining a first graph affinity of the first slice text based on a distance between an entity in the first slice text and an entity in the abnormal event description information, and determining a second graph affinity of the second slice text based on a distance between an entity in the second slice text and an entity in the abnormal event description information; The target slice text is determined from the first slice text and the second slice text according to the first vector similarity, the second vector similarity, the first graph relevance, and the second graph relevance.
[0010] In an optional embodiment, determining the target slice text from the first slice text and the second slice text according to the first vector similarity, the second vector similarity, the first graph relevance, and the second graph relevance includes: Performing weighted processing based on the first vector similarity and the first graph relevance to obtain a weighted score for the first slice text; Performing weighted processing according to the second vector similarity and the second graph relevance to obtain a weighted score for the second slice text; The target slice text is determined from the first slice text and the second slice text according to the weighted score of the first slice text and the weighted score of the second slice text.
[0011] In an optional embodiment, the generating of an emergency plan for the target place based on the target slice text using the target large language model portion of the multimodal large model of the target place includes: Generate a target prompt word according to the target slice text, the processing person constraint information, the processing time constraint information, and the constraint information of the emergency processing document corresponding to the target slice text; The target large language model portion is used to generate an emergency plan for the target location according to the target prompt word.
[0012] In an optional embodiment, before performing a vector search on a preset vector library based on the description text vector to obtain the target text vector, the method further includes: If the emergency handling document is a title document, then structurally segmenting the emergency handling document according to a preset level title and preset segmentation parameters to obtain the plurality of slice texts; If the emergency handling document is a non-title document, semantically segmenting the emergency handling document according to a preset delimiter to obtain the plurality of slice texts; The multiple slice texts are respectively converted into text vectors, and the text vectors corresponding to the multiple slice texts, the multiple slice texts and the identifiers of the multiple slice texts are saved in the preset vector library.
[0013] In an optional embodiment, before performing graph retrieval on a preset knowledge graph based on the target entity relationship triple to obtain a target knowledge subgraph, the method further includes: Respectively identifying entity relationship triples in the plurality of slice texts; Clustering the entity relationship triples in the multiple slice texts to obtain the multiple knowledge subgraphs, and generating the preset knowledge graph; According to the slice text corresponding to the entity in each knowledge subgraph, generate the slice identification attribute corresponding to the entity in each knowledge subgraph, and add it to the preset knowledge graph; Before fusing the first slice text corresponding to the target text vector and the second slice text corresponding to the target knowledge subgraph to obtain the target slice text, the method further includes: Determine a target slice identification attribute corresponding to an entity in the target knowledge subgraph from the preset knowledge graph; According to the target slice identification attribute, the second slice text is determined from the multiple slice texts.
[0014] In a second aspect, an embodiment of the present application further provides an emergency plan generating device, comprising: An acquisition module is used to obtain description information of abnormal events at a target location; a processing module, configured to convert the abnormal event description information into a description text vector, and perform a vector search on a preset vector library based on the description text vector to obtain a target text vector, wherein the preset vector library includes: text vectors corresponding to a plurality of slice texts in the emergency response document of the target location; The processing module is further configured to extract a target entity relationship triple from the abnormal event description information, and perform a graph search on a preset knowledge graph based on the target entity relationship triple to obtain a target knowledge subgraph, wherein the preset knowledge graph includes: a plurality of knowledge subgraphs, and the plurality of knowledge subgraphs are obtained by clustering the entity relationship triples in the plurality of slice texts; a processing module, configured to fuse the first slice text corresponding to the target text vector and the second slice text corresponding to the target knowledge subgraph to obtain a target slice text; A processing module is used to use the target large language model part in the multimodal large model of the target place to generate an emergency plan for the target place according to the target slice text.
[0015] In a third aspect, an embodiment of the present application further provides an electronic device comprising: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the memory through the bus, and the processor executes the machine-readable instructions to execute any one of the methods described in the first aspect.
[0016] The present application provides a method, device, and electronic device for generating an emergency plan, wherein the method includes: obtaining abnormal event description information for a target location, converting the abnormal event description information into a description text vector, and performing a vector search on a preset vector library based on the description text vector to obtain a target text vector, extracting a target entity relationship triple from the abnormal event description information, and performing a graph search on a preset knowledge graph based on the target entity relationship triple to obtain a target knowledge subgraph, fusing a first slice text corresponding to the target text vector and a second slice text corresponding to the target knowledge subgraph to obtain a target slice text, and using the target large language model portion in the multimodal large model of the target location to generate an emergency plan for the target location based on the target slice text. The present application uses a dual-channel retrieval mechanism of a knowledge graph and a vector library to retrieve relevant knowledge, thereby improving the accuracy of generating emergency plans. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without creative work.
[0018] Figure 1 Schematic diagram of the process of generating an emergency plan provided in the embodiment of the present application Figure 1 ; Figure 2 Schematic diagram of the process of generating an emergency plan provided in the embodiment of the present application Figure 2 ; Figure 3 Schematic diagram of the process of generating an emergency plan provided in the embodiment of the present application Figure 3 ; Figure 4 A schematic diagram of the self-supervised training process of a visual encoder provided in an embodiment of the present application; Figure 5 Schematic diagram of the process of generating an emergency plan provided in the embodiment of the present application Figure 4 ; Figure 6 Schematic diagram of the process of generating an emergency plan provided in the embodiment of the present application Figure 5 ; Figure 7 Schematic diagram of the process of generating an emergency plan provided in the embodiment of the present application Figure 6 ; Figure 8 Schematic diagram of the process of generating an emergency plan provided in the embodiment of the present application Figure 7 ; Figure 9 A schematic diagram of the structure of an emergency plan generation device provided in an embodiment of the present application; Figure 10 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0019] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of this application.
[0020] Before introducing the solution of this application, we first explain the professional terms involved: Multimodal large model: refers to a large-scale artificial intelligence model that can simultaneously process and understand multiple types of data (such as text, images, videos, sensor data, etc.).
[0021] Retrieval-augmented generation technology: A technology that combines retrieval and generation, aiming to enhance the output of a large language model (LLM) by leveraging external knowledge bases. This enables the LLM to access and utilize external information to generate more accurate, relevant, and contextual answers.
[0022] Currently, using only vector search to identify relevant emergency plans for public places has the following flaws: (1) Imprecise semantic matching: When querying "platform water management," vector search may return documents related to "tunnel drainage" (similar semantics but mismatched scenarios). (2) Logical discontinuity: It is impossible to establish a reasoning chain such as "equipment failure → impact on system → associated emergency plan." For example, when a water leak causes an escalator to stop operating, the key step of "activating the backup channel" is missing from the search results.
[0023] Based on this, in order to improve the retrieval accuracy, this application introduces a knowledge graph, adopts retrieval enhancement generation technology that integrates the knowledge graph, and uses a dual-channel retrieval mechanism based on the knowledge graph and vector library to retrieve relevant knowledge and then generate emergency plans for the target locations, thereby improving the generation accuracy of emergency plans through hybrid retrieval.
[0024] Figure 1Schematic diagram of the process of generating an emergency plan provided in the embodiment of the present application Figure 1 The execution subject of this embodiment can be an electronic device, such as a computer, a server, etc.
[0025] like Figure 1 As shown, the method may include: S101. Obtain abnormal event description information for a target location.
[0026] The target location may be, for example, a subway station, a railway station, an airport, etc.
[0027] The abnormal event description information for the target place may include the type of abnormal event occurring at the target place, the location of the event, and the number of people, etc., wherein the abnormal event type is used to indicate the type of abnormal event occurring at the target place, such as fire, flood prevention, large passenger flow, passenger falls, equipment abnormalities, fire doors not closed, damaged air shaft anti-fall nets, accumulation of debris in fire passages, etc.
[0028] The event location is the location where the abnormal event occurred in the target place, such as the entrance, exit, waiting hall, etc. The number of passengers is the number of passengers in different areas of the target place or the number of passengers corresponding to the event location.
[0029] S102: Convert the abnormal event description information into a description text vector, and perform a vector search on a preset vector library based on the description text vector to obtain a target text vector.
[0030] The preset vector library includes text vectors corresponding to multiple text slices in the target location's emergency response documents. The target location's emergency response documents include, but are not limited to, one type, and may include, for example, emergency response specifications, equipment operating manuals, and historical emergency incident handling records. The emergency response documents may be stored in a subway station emergency knowledge base.
[0031] The emergency response documents are cleaned to delete erroneous data, remove duplicates, and perform optical character recognition (OCR). Then, the emergency response documents of the target location are segmented to obtain multiple sliced texts, and the multiple sliced texts are converted into text vectors to generate a preset vector library.
[0032] A preset embedding model is used to convert the abnormal event description information into a vector to obtain a description text vector. Based on the description text vector, a vector search is performed on the preset vector library using vector similarity, and a target text vector is determined from the preset vector library. The target text vector is a vector in the preset vector library whose similarity with the description text vector exceeds a preset similarity threshold.
[0033] In some embodiments, cosine similarity is used as vector similarity, and the calculation formula of cosine similarity is as follows:
[0034] in, is the value of the i-th dimension of the text description vector, is the value of the i-th dimension of the text vector in the preset vector library, where i is a positive integer from 0 to n-1, representing the first dimension, the second dimension...the n-1th dimension respectively.
[0035] It should be noted that the value range of cosine similarity is [-1, 1]. The larger the cosine similarity, the smaller the angle between the two vectors, indicating that the cosine similarity between the two vectors is higher.
[0036] S103. Extract target entity relationship triples from the abnormal event description information, and perform graph retrieval on the preset knowledge graph based on the target entity relationship triples to obtain the target knowledge subgraph.
[0037] An entity-relationship triplet consists of three parts: {entity, relationship, entity}. Entity-relationship triples describe the semantic relationship between entities. For example, from the sentence "When the smoke sensor is triggered for more than 60 seconds, the duty station manager must activate the FAS system," we can extract two entity-relationship triples: {smoke sensor, timeout trigger, FAS system} and {duty station manager, activate, FAS system}.
[0038] Among them, the preset knowledge graph includes: multiple knowledge subgraphs, and the multiple knowledge subgraphs are obtained by clustering entity relationship triplets in multiple slice texts.
[0039] Identify entity relationship triples from multiple slice texts, write the identified entity relationship triples into a preset graph database, generate a preset knowledge graph, and cluster the entity relationship triples in the preset knowledge graph to divide the preset knowledge graph into knowledge subgraphs.
[0040] Target entity relationship triples are extracted from the abnormal event description information, and based on the target entity relationship triples, a graph query statement is constructed to perform graph retrieval on the preset knowledge graph, and a knowledge subgraph whose relevance to the target entity relationship triples meets the preset relevance condition is obtained from the preset knowledge graph as the target knowledge subgraph, wherein the preset relevance condition can be, for example, the highest relevance, that is, the target knowledge subgraph is the knowledge subgraph that is most relevant to the target entity relationship.
[0041] S104 , fusing the first slice text corresponding to the target text vector and the second slice text corresponding to the target knowledge subgraph to obtain the target slice text.
[0042] The second slice text corresponding to the target knowledge subgraph is the slice text where the entity in the entity relationship triple contained in the target knowledge subgraph in the multiple slice texts is located, that is, all slice texts corresponding to the entity in the target knowledge subgraph.
[0043] It should be noted that there is a many-to-many relationship between slices and entities. One slice text can identify multiple entities, and one entity can exist in multiple slice texts.
[0044] Calculate the vector similarity between the first slice text and the description text vector corresponding to the target text vector, as well as the correlation between the second slice text and the abnormal event description information corresponding to the target knowledge subgraph. Determine the target slice text from the first slice text and the second slice text based on the vector similarity and correlation.
[0045] The number of the first slice text and the number of the second slice text can be multiple.
[0046] S105. Using the target large language model part of the multimodal large model of the target place, an emergency plan for the target place is generated according to the target slice text.
[0047] A prompt word is generated according to the target slice text, and the prompt word is input into the target large language model part in the multimodal large model to guide the target large language model part to generate an emergency plan for the target place based on the target slice text, wherein the emergency plan is a response plan formulated for abnormal events occurring in the target place.
[0048] For example, the target slice text is "Flood Control Plan Section 2.1", which represents the slice text of Section 2.1 in the emergency response document (the content of Section 2.1). By guiding the target large language model to generate an emergency plan for the target location based on the slice text of "Flood Control Plan Section 2.1".
[0049] In the emergency plan generation method provided in this embodiment, the retrieval enhancement generation technology of the knowledge graph is integrated, and a dual-channel retrieval mechanism of the knowledge graph and the vector library is adopted to retrieve relevant knowledge, thereby improving the accuracy of emergency plan generation.
[0050] Figure 2 Schematic diagram of the process of generating an emergency plan provided in the embodiment of the present application Figure 2 ,like Figure 2 As shown, in an optional embodiment, the above step S101, obtaining abnormal event description information for the target location, may include: S201: Use sensor equipment to collect current monitoring video and current Internet of Things data for the target location.
[0051] The sensor device is set in the target location, and the sensor device may be, for example, a camera, a temperature sensor, a humidity sensor, a pressure sensor, a smoke sensor, etc.
[0052] The current surveillance video is a real-time surveillance video of the target location, and the current IoT data is real-time IoT data of the target location. The camera can be used to collect the current surveillance video of the target location, and the temperature sensor and humidity sensor can be used to collect the temperature value, humidity value, pressure value, and smoke value of the target location. The current IoT (Internet of Things, IoT) data can include temperature value, humidity value, pressure value, and smoke value.
[0053] S202: Using the target visual encoder in the multimodal large model of the target location, visually encode the current monitoring video to obtain video encoding information.
[0054] S203: Using the target large language model part, process the video coding information to identify the type of abnormal event at the target location.
[0055] The target visual encoder in the multimodal large model of the target place is used to encode the current surveillance video to obtain video encoding information, and generate prompt words to guide the target large language model part to process the target video encoding information to identify the type of abnormal event in the target place.
[0056] S204: Identify the location of the abnormal event and the number of people at the target location based on the location of the sensor device, the IoT data, and the type of abnormal event.
[0057] The abnormal event description information includes the abnormal event type, the location where the abnormal event occurred, and the number of people involved.
[0058] Obtain the location of the sensor device in the target venue, and analyze the key information of the abnormal event based on the location of the sensor device, IoT data, and the type of abnormal event to identify the location where the abnormal event occurred and the number of people in the target venue. The location of the abnormal event is, for example, the location of a fire. The number of people is the number of passengers in different areas of the target venue or the number of passengers corresponding to the location where the event occurred.
[0059] In the emergency plan generation method provided in this embodiment, by integrating real-time data such as video and Internet of Things data, a multimodal large model is used to identify abnormal events in the target place. It has multimodal perception capabilities and can grasp the detailed information of abnormal events, making the description information of abnormal events more accurate.
[0060] Figure 3 Schematic diagram of the process of generating an emergency plan provided in the embodiment of the present application Figure 3 ,like Figure 3 As shown, in an optional embodiment, the method may further include: S301. Based on historical surveillance videos of the target location, perform self-supervisory pre-training on the first visual encoder in the base multimodal large model to obtain a second visual encoder.
[0061] The initial first visual encoder is an initialized visual encoder, which uses a camera to collect historical surveillance videos of the target location and clean the historical surveillance videos.
[0062] The self-supervised training of the first video encoder is implemented by selecting a large, existing multimodal model, extracting its visual encoder, and then adding a visual decoder consisting of the same number of transformer layers as the visual encoder, to create an encoder-decoder model. The large, existing multimodal model is a mature model that has undergone multiple rounds of iteration and training.
[0063] Figure 4 A schematic diagram of the self-supervised training process of the visual encoder provided in the embodiment of the present application is shown as follows: Figure 4 As shown in the figure, the surveillance footage from historical surveillance videos is used as input images and tiled into a two-dimensional patch sequence, each patch being 16×16 pixels. The patches are then randomly masked. The visual encoder encodes the unmasked patches to obtain visual features, and the visual decoder restores the masked patches and reconstructs the masked pixels, thus achieving self-supervised pre-training of the model. After training is complete, the visual decoder is removed.
[0064] S302. Based on the operation control data of the target site, incremental pre-training is performed on the first largest language model part in the base multimodal large model to obtain the second largest language model part.
[0065] The operation control data of the target location may include, for example, real-time passenger flow data, train operation data, equipment status data, etc. of the target location.
[0066] The implementation method of incremental pre-training of the first large language model part is: mask part of the operation control data and input it into the first large language model part, and the output of the first large language model part is the predicted occluded data, so as to perform incremental pre-training on the first large language model part until the occluded data output by the first large language model is consistent with the actual occluded data, and determine that the first large language model obtained by training at this time is the second large language model part.
[0067] S303: fine-tune the second visual encoder and the second large language model according to the pre-labeled graphic data to obtain the target visual encoder and the target large language model.
[0068] The graphic data includes sample pictures and picture descriptions. The picture descriptions can be descriptions of questions raised for the sample pictures. The pre-annotated graphic data refers to descriptions of answers corresponding to the annotations of the graphic data.
[0069] A second visual encoder is used to visually encode the sample image to obtain an image code, and the image code and the question for the sample image are input into the second largest language model part. The second largest language model part outputs the answer description corresponding to the question description. Then, a loss value is calculated based on the pre-labeled answer description and the answer description output by the second largest language model part. Based on the loss value, the second visual encoder and the second largest language model part are fine-tuned to obtain the target visual encoder and the target large language model part.
[0070] In the emergency plan generation method provided in this embodiment, based on the base multimodal large model, a multimodal large model of the target place is realized through three fine-tuning steps. The three fine-tuning steps are: self-supervised pre-training of the first visual encoder in the base multimodal large model, incremental pre-training of the first large language model part in the base multimodal large model, and instruction fine-tuning of the second visual encoder and the second large language model part. The fine-tuning algorithms used in the above three fine-tuning steps can all adopt the Lora fine-tuning method.
[0071] It should be noted that the first two fine-tuning steps do not require labeled data, and can be achieved directly using the original data. The data preparation cost is low, which enables the first visual encoder and the first large language model to be fine-tuned on massive monitoring images, so that the trained visual encoder can recognize more equipment in the station, and the large language model has more station knowledge, which enables the trained multimodal large model of the target location to recognize the facilities in the subway station (such as ground emblems, elevator guide signs, etc.), identify abnormal equipment conditions, and identify abnormal conditions such as fire doors not being closed, damaged air shaft anti-fall nets, and accumulation of debris in fire passages.
[0072] Figure 5 Schematic diagram of the process of generating an emergency plan provided in the embodiment of the present application Figure 4 ,like Figure 5 As shown, in an optional embodiment, the above step S104, fusing the first slice text corresponding to the target text vector and the second slice text corresponding to the target knowledge subgraph to obtain the target slice text, may include: S401: Obtain a first vector similarity between a text vector corresponding to a first slice text and a description text vector, and a second vector similarity between a text vector corresponding to a second slice text and a description text vector.
[0073] The vector similarity between the text vector corresponding to the first slice text and the description text vector is calculated as the first vector similarity, and the vector similarity between the text vector corresponding to the second slice text and the description text vector is calculated as the second vector similarity, wherein the first vector similarity and the second vector similarity can be cosine similarity.
[0074] The number of the first slice text and the second slice text can be multiple.
[0075] S402. Determine a first graph relevance of the first slice text based on a distance between an entity in the first slice text and an entity in the description text vector, and determine a second graph relevance of the second slice text based on a distance between an entity in the second slice text and an entity in the description text vector.
[0076] The entities in the first slice text are entities in the entity relationship triples contained in the first slice text, and the entities in the second slice text are entities in the entity relationship triples contained in the second slice text. The number of entities in the first slice text and the number of entities in the second slice text can be multiple.
[0077] The entities in the abnormal event description information are entities in the target entity relationship triples contained in the abnormal event description information.
[0078] Calculate the distance between each entity in the first slice text and each entity in the abnormal event description information, and determine the closest distance therefrom as the first closest distance; calculate the distance between each entity in the second slice text and each entity in the abnormal event description information, and determine the closest distance therefrom as the second closest distance.
[0079] A first graph correlation of the first slice text is determined based on the first nearest distance, and the first graph correlation is used to indicate the degree of correlation between the first slice text and the abnormal event description information; and a second graph correlation of the second slice text is determined based on the second nearest distance, and the second graph correlation is used to indicate the degree of correlation between the second slice text and the abnormal event description information.
[0080] It should be noted that when calculating the distance between entities, the entities can be converted into vector form, and the cosine similarity between the vectors can be used as the distance between the entities.
[0081] In some embodiments, graph affinity is expressed as: score_kg = 1 - 0.3 × distance Among them, distance is the shortest distance between the entity in the slice text and the entity in the abnormal event description information.
[0082] S403 : Determine a target slice text from the first slice text and the second slice text according to the first vector similarity, the second vector similarity, the first graph relevance, and the second graph relevance.
[0083] The first vector similarity and the second vector similarity are used as vector similarity scores, and the first graph relevance and the second graph relevance are used as graph relevance scores. A score for the first slice text can be determined based on the first vector similarity and the first graph relevance, and a score for the second slice text can be determined based on the second vector similarity and the second graph relevance. Based on the scores of the first slice text and the second slice text, a slice text that exceeds a preset score threshold is determined from the first slice text and the second slice text as a target slice text. There can be multiple target slice texts.
[0084] In an optional embodiment, the above step S403 of determining the target slice text from the first slice text and the second slice text according to the first vector similarity, the second vector similarity, the first graph correlation, and the second graph correlation may include: A weighted processing is performed based on the first vector similarity and the first graph correlation to obtain a weighted score of the first slice text; a weighted processing is performed based on the second vector similarity and the second graph correlation to obtain a weighted score of the second slice text; and a target slice text is determined from the first slice text and the second slice text based on the weighted score of the first slice text and the weighted score of the second slice text.
[0085] For example, the weighted score is expressed as: score = 0.5×score_kg + 0.5×score_vec Among them, score is the weighted score, score_kg is the graph relevance score, score_vec is the vector similarity score, and 0.5 is the weighting coefficient.
[0086] In some embodiments, based on the preset number of slices, the weighted score of the first slice text, and the weighted score of the second slice text, a slice text that meets the preset number of slices and whose weighted score exceeds a preset score threshold can be determined from the first slice text and the second slice text as the target slice text.
[0087] It should be noted that the cross encoder re-ranking can also be used to finely sort the top 20 results ranked by weighted scores to determine the top 20 sliced texts as target sliced texts.
[0088] Taking the subway as an example, the abnormal event description information is: large-scale water accumulation on the west escalator. The first slice text returned by vector search includes: Flood Control Plan Section 2.1 (0.82), Escalator Operation Manual (0.76), etc. The second slice text returned by graph search includes: Flood Control Plan Section 2.1 (1.0), Escalator Operation Manual (0.7), Drainage Pump Operation Manual (0.7), Power Interruption Response Plan (0.7), etc. The fusion result is: Flood Control Plan Section 2.1 (0.91), Escalator Operation Manual (0.73), Drainage Pump Operation Manual (0.68).
[0089] Taking Section 2.1 of the Flood Control Plan as an example, Section 2.1 of the Flood Control Plan (0.82) indicates that the vector similarity score between the text vector corresponding to the slice text in Section 2.1 of the emergency response document and the description text vector corresponding to the abnormal description information is 0.82. Section 2.1 of the Flood Control Plan (1.0) indicates that the graph correlation score of the slice text in Section 2.1 of the emergency response document is 1.0. Section 2.1 of the Flood Control Plan (0.91) indicates that the weighted score of the slice text in Section 2.1 of the emergency response document is 0.91.
[0090] In the emergency plan generation method provided in this embodiment, the target slice text is determined based on vector similarity and graph correlation, so that a dual-channel retrieval mechanism of knowledge graph and vector library can be adopted to retrieve relevant knowledge, thereby improving the accuracy of emergency plan generation.
[0091] Figure 6 Schematic diagram of the process of generating an emergency plan provided in the embodiment of the present application Figure 5 ,like Figure 6 As shown, in an optional embodiment, the above step S105 uses the target large language model part in the multimodal large model of the target place to generate an emergency plan for the target place according to the target slice text, which may include: S501: Generate a target prompt word according to the target slice text, processing person constraint information, processing time constraint information, and constraint information of the emergency processing document corresponding to the target slice text.
[0092] Among them, the handler constraint information is used to indicate that each execution action in the emergency plan to be generated has a handler, the processing time constraint information is used to indicate that each execution action in the emergency plan to be generated has a processing time limit, the emergency processing document corresponding to the target slice text is the emergency processing document where the target slice text is located, and the constraint information of the emergency processing document is used to indicate that the emergency plan to be generated has basis information indicating the emergency processing document.
[0093] Based on the target slice text, the processing person constraint information, the processing time constraint information and the constraint information of the emergency processing document corresponding to the target slice text, a target prompt word is generated. The target prompt word is used to guide the large language model to generate an emergency plan based on the target slice text, the processing person constraint information, the processing time constraint information and the constraint information of the emergency processing document corresponding to the target slice text.
[0094] Taking the subway as an example, the target location is as follows: You are a subway emergency expert. Please generate an emergency response plan based on the following information: Event details: {Event description} Related knowledge: {search results organized into articles} Require: 1. Each action must be marked with the responsible person and related equipment.
[0095] 2. Quote the standard clauses as the basis.
[0096] Among them, the event description is the abnormal event description information, the search result is the target slice text, and the responsible person is the person who performs the action.
[0097] S502: Using the target large language model part, generate an emergency plan for the target place according to the target prompt word.
[0098] The target prompt word is taken as input and processed by the target large language model to generate an emergency plan for the target place.
[0099] Take the emergency plan for large passenger flow in the subway as an example: { "Plan ID": "CROWD-20250609-001", "Step": [ {"Action":"Activate the west backup channel", "Responsible person":"Stationmaster on duty", "Time limit":"Immediately"}, {"Action":"Broadcast to guide passengers", "Responsible person":"Announcer", "Time limit":"Within 2 minutes"}, {"Action":"Contact additional security personnel", "Responsible Person":"Control Center", "Time Limit":"5 minutes"} ], "Basis": ["Large Passenger Flow Handling Standards", "2024 Drill Record"] } In the emergency plan generation method provided in this embodiment, since the retrieved target slice text is relatively scattered, the target large language model can be used to organize it into a clearly structured article. The plan partially generated using the target large language model has strong executability. The generated plan has clear time constraints, specific responsible persons and normative basis, and can be implemented directly.
[0100] Figure 7 Schematic diagram of the process of generating an emergency plan provided in the embodiment of the present application Figure 6 ,like Figure 7 As shown, in an optional embodiment, before the above step S102, performing a vector search on a preset vector library based on the description text vector to obtain the target text vector, the method may further include: S601: If the emergency handling document is a title document, the emergency handling document is structurally segmented according to a preset level title and preset segmentation parameters to obtain a plurality of slice texts.
[0101] The title document is a document with chapters, such as a docx file or html file with multi-level titles.
[0102] If the emergency handling document is a title document, the emergency handling document is structured and segmented according to the preset level title and preset block parameters to obtain multiple slice texts, where the preset block parameters may include the maximum block length and the minimum block length, and the units of the preset block parameters are all strings (tokens).
[0103] The maximum block length may be, for example, 8192, the minimum block length may be, for example, 256, and the maximum overlap length between blocks may be, for example, 100.
[0104] Read all levels of titles in the emergency handling document, split them according to the lowest level title, and obtain sliced text (i.e., content blocks). For example, a docx document has first-level titles, second-level titles, third-level titles, and fourth-level titles. Then, split it according to the fourth-level title. The sliced text includes the sliced text of Section 4.1, the sliced text of Section 4.2, the sliced text of Section 4.3, and so on.
[0105] For the content block sliced according to the title, if its length is greater than the maximum block length, it can be segmented using symbols such as "\n.!?" until the content block length is less than the maximum block length, at which point segmentation is complete.
[0106] For the content blocks segmented by title, if the length is less than the minimum segment length, then the content blocks belonging to the same level of title will be merged. For example, the segmented text of Section 4.1 and the segmented text of Section 4.2 will be merged until the length of the content block is greater than the minimum segment length, and then the merging is completed.
[0107] In some embodiments, the preset block parameters may also include the maximum overlap length between blocks (that is, the maximum overlap length between adjacent blocks). The overlapping part can help the model better capture contextual information and avoid losing important information due to block segmentation.
[0108] S602: If the emergency handling document is a non-title document, semantic segmentation is performed on the emergency handling document according to a preset delimiter to obtain a plurality of slice texts.
[0109] If the emergency processing document is a non-title document, the emergency processing document is semantically segmented according to preset delimiters, such as "\n .!?" and other symbols, so as to split the emergency processing document into multiple sentences, and then calculate the similarity between the first sentence and the second sentence. If it is greater than the similarity threshold, the two sentences are merged into a new first sentence, and then calculate the similarity between the third sentence and the new first sentence. If the similarity is greater than the similarity threshold, the new first sentence and the third sentence are merged, wherein the sentence formed by the merger of the new first sentence and the third sentence is used as a slice text, otherwise it is not merged, and the first round of merging is ended, wherein the new first sentence is used as a slice text, and then in the second round, the similarity between the third sentence and the fourth sentence is calculated, and so on, until the last sentence is processed, thereby obtaining multiple slice texts.
[0110] If the similarity between the first sentence and the second sentence is not greater than the similarity threshold, the first sentence is taken as a slice text, and the similarity between the second sentence and the third sentence is calculated. If the similarity is greater than the similarity threshold, the sentence obtained by merging the second and third sentences is taken as a slice text. If the similarity is not greater than the similarity threshold, the second sentence is taken as a slice text, and the first round of merging is completed. Then, in the second round, the similarity between the third and fourth sentences is calculated, and so on, until the last sentence is processed, thereby obtaining multiple slice texts.
[0111] S603: Convert the plurality of slice texts into text vectors respectively, and save the text vectors respectively corresponding to the plurality of slice texts, the plurality of slice texts, and identifiers of the plurality of slice texts into a preset vector library.
[0112] A preset embedding model is used to convert multiple slice texts into text vectors respectively. The preset vector library includes text vectors corresponding to the multiple slice texts, the multiple slice texts and identifiers of the multiple slice texts.
[0113] In this way, when determining the first slice text corresponding to the target text vector, the identifier of the first slice text can be queried from the preset vector library based on the target text vector, and then the first slice text can be determined.
[0114] In the emergency plan generation method provided in this embodiment, since the most common and direct segmentation method in retrieval enhancement generation is fixed-length segmentation, it ignores the text structure and is very easy to destroy the semantic integrity. It is only suitable for retrieval tasks that do not require high context integrity, and is not suitable for emergency plan generation scenarios. Based on this, in order to maintain the integrity of the context and divide the content of the same semantic information into the same slice, the structured segmentation and semantic segmentation methods are adopted to ensure the semantic integrity of the slice.
[0115] Figure 8 Schematic diagram of the process of generating an emergency plan provided in the embodiment of the present application Figure 7 ,like Figure 8 As shown, in an optional embodiment, in the above step S103, before performing a graph search on a preset knowledge graph based on the target entity relationship triples and obtaining the target knowledge subgraph, the method may further include: S701. Identify entity relationship triples in multiple slice texts respectively.
[0116] Identify entity relationship triples from each slice text and write the identified entity relationship triples into the preset graph database to obtain the initial knowledge graph. For example, from "When the smoke sensor is triggered for more than 60 seconds, the duty station manager needs to start the FAS system", extract the two entity relationship triples {smoke sensor, timeout trigger, FAS system} and {duty station manager, start, FAS system}.
[0117] S702. Cluster the entity relationship triples in multiple slice texts to obtain multiple knowledge subgraphs and generate a preset knowledge graph.
[0118] Cluster the entity relationship triples in multiple slice texts in the initial knowledge graph to obtain multiple knowledge subgraphs. One knowledge subgraph includes the entity relationship triples obtained by clustering, and the preset knowledge graph includes multiple knowledge subgraphs.
[0119] In some embodiments, a hierarchical clustering algorithm Leiden is used to divide the entire initial knowledge graph into subgraphs, that is, multiple knowledge subgraphs.
[0120] S703. Generate slice identification attributes corresponding to the entities in each knowledge subgraph based on the slice text corresponding to the entities in each knowledge subgraph, and add them to the preset knowledge graph.
[0121] The slice text corresponding to the entity in each knowledge subgraph is the slice text where the entity in each knowledge subgraph is located. A unique identifier (id) is generated for the slice text, and the slice id is used as the slice identification attribute of the entity in each knowledge subgraph, and the slice description attribute is added to the preset knowledge graph.
[0122] It should be noted that there is a many-to-many relationship between slices and entities. One slice text can identify multiple entities, and one entity can exist in multiple slice texts, so an entity has multiple slice IDs as its slice identification attributes.
[0123] In some embodiments, a large language model may be used to generate summary attributes for entities in each knowledge subgraph based on slice identification attributes of the entities, and a large language model may be used to generate a summary for each knowledge subgraph based on summaries of all members in each knowledge subgraph. Here, all members in a knowledge subgraph refer to all entities contained in the knowledge subgraph.
[0124] When performing graph retrieval on a preset knowledge graph, a graph query statement can be constructed to perform graph retrieval on the preset knowledge graph based on the summary of each knowledge subgraph and the summary of the entity in each knowledge subgraph, and a knowledge subgraph whose relevance to the target entity relationship triple meets the preset relevance condition is obtained from the preset knowledge graph as the target knowledge subgraph.
[0125] Accordingly, before the above step S104, in which the first slice text corresponding to the target text vector and the second slice text corresponding to the target knowledge subgraph are fused to obtain the target slice text, the method may further include: S704. Determine the target slice identification attribute corresponding to the entity in the target knowledge subgraph from the preset knowledge graph.
[0126] S705: Determine a second slice text from multiple slice texts according to the target slice identification attribute.
[0127] The entities in the target knowledge subgraph refer to the entities in the entity relationship triples contained in the target knowledge subgraph.
[0128] After retrieving and determining the target knowledge subgraph, the target slice identification attribute corresponding to the entity in the target knowledge subgraph can also be determined from the preset knowledge graph, and based on the target slice identification attribute, the slice text whose slice identification attribute is the target slice identification attribute can be determined from multiple slice texts as the second slice text.
[0129] The second slice text is the slice text where the entity in the entity relationship triple contained in the target knowledge subgraph is located.
[0130] In the emergency plan generation method provided in this embodiment, by constructing a knowledge graph and adopting the retrieval enhancement generation technology that integrates the knowledge graph, relevant knowledge is retrieved, thereby improving the generation accuracy of the emergency plan.
[0131] Figure 9 This is a structural diagram of an emergency plan generation device provided in an embodiment of the present application, which can be integrated into an electronic device.
[0132] like Figure 9 As shown, the device may include: Acquisition module 801, used to acquire abnormal event description information for a target location; Processing module 802 is configured to convert the abnormal event description information into a description text vector, and perform a vector search on a preset vector library based on the description text vector to obtain a target text vector. The preset vector library includes text vectors corresponding to multiple slice texts in the emergency response document of the target location. Processing module 802 is further configured to extract target entity relationship triples from the abnormal event description information, and perform a graph search on a preset knowledge graph based on the target entity relationship triples to obtain a target knowledge subgraph, wherein the preset knowledge graph includes: multiple knowledge subgraphs, each of which is obtained by clustering entity relationship triples in multiple slice texts; The processing module 802 is further configured to fuse the first slice text corresponding to the target text vector and the second slice text corresponding to the target knowledge subgraph to obtain the target slice text; The processing module is also used to adopt the target large language model part in the multimodal large model of the target place to generate an emergency plan for the target place according to the target slice text.
[0133] In an optional implementation, the acquisition module 801 is specifically configured to: Use sensor equipment to collect current surveillance videos and current IoT data of the target location; Use the target visual encoder in the multimodal large model to visually encode the current surveillance video to obtain video encoding information; The target large language model is used to process the video encoding information and identify the type of abnormal events in the target location; Based on the location of sensor equipment, IoT data, and the type of abnormal event, the location where the abnormal event occurred and the number of people in the target place are identified; the abnormal event description information includes the type of abnormal event, the location where the abnormal event occurred, and the number of people.
[0134] In an optional implementation, the processing module 802 is further configured to: Based on historical surveillance videos of the target location, the first visual encoder in the base multimodal large model is self-supervised pre-trained to obtain the second visual encoder; Based on the operational control data of the target site, incremental pre-training is performed on the first language model part of the base multimodal large model to obtain the second language model part; According to the pre-labeled graphic data, the second visual encoder and the second large language model are fine-tuned to obtain the target visual encoder and the target large language model.
[0135] In an optional implementation, the processing module 802 is specifically configured to: Obtaining a first vector similarity between a text vector corresponding to a first slice text and a description text vector, and a second vector similarity between a text vector corresponding to a second slice text and a description text vector; Determining a first graph relevance of the first slice text based on a distance between an entity in the first slice text and an entity in the abnormal event description information, and determining a second graph relevance of the second slice text based on a distance between an entity in the second slice text and an entity in the abnormal event description information; A target slice text is determined from the first slice text and the second slice text according to the first vector similarity, the second vector similarity, the first graph relevance, and the second graph relevance.
[0136] In an optional implementation, the processing module 802 is specifically configured to: Perform weighted processing based on the first vector similarity and the first graph relevance to obtain a weighted score for the first slice text; Performing weighted processing according to the second vector similarity and the second graph relevance to obtain a weighted score for the second slice text; According to the weighted score of the first slice text and the weighted score of the second slice text, a target slice text is determined from the first slice text and the second slice text.
[0137] In an optional embodiment, the processing module is specifically configured to: Generate target prompt words based on the target slice text, the processing person constraint information, the processing time constraint information, and the constraint information of the emergency processing document corresponding to the target slice text; The target large language model part is used to generate an emergency plan for the target place according to the target prompt words.
[0138] In an optional implementation, the processing module 802 is further configured to: If the emergency handling document is a title document, the emergency handling document is structurally segmented according to the preset level title and the preset segmentation parameters to obtain multiple slice texts; If the emergency handling document is a non-title document, semantic segmentation is performed on the emergency handling document according to a preset delimiter to obtain multiple slice texts; The multiple slice texts are converted into text vectors respectively, and the text vectors corresponding to the multiple slice texts, the multiple slice texts and the identifiers of the multiple slice texts are saved in a preset vector library.
[0139] In an optional implementation, the processing module 802 is further configured to: Identify entity relationship triples in multiple slice texts respectively; Cluster entity relationship triples in multiple slice texts to obtain multiple knowledge subgraphs and generate a preset knowledge graph; According to the slice text corresponding to the entity in each knowledge subgraph, the slice identification attribute corresponding to the entity in each knowledge subgraph is generated and added to the preset knowledge graph; Determine the target slice identification attribute corresponding to the entity in the target knowledge subgraph from the preset knowledge graph; A second slice text is determined from a plurality of slice texts according to a target slice identification attribute.
[0140] For descriptions of the processing flow of each module in the device and the interaction flow between each module, reference can be made to the relevant descriptions in the above method embodiment, which will not be described in detail here.
[0141] Figure 10 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application, such as Figure 10 As shown, the device may include: a processor 901, a memory 902 and a bus 903. The memory 902 stores machine-readable instructions executable by the processor 901. When the electronic device is running, the processor 901 communicates with the memory 902 through the bus 903, and the processor executes the machine-readable instructions to perform the above method.
[0142] An embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the above method is executed.
[0143] In the embodiment of the present application, the computer program can also execute other machine-readable instructions when run by the processor to execute other methods described in the embodiment. For the specific execution method steps and principles, please refer to the description of the embodiment and will not be repeated here.
[0144] In the embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interface, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0145] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0146] In addition, each functional unit in the embodiments provided in the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0147] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a number of instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, and other media that can store program code.
[0148] It should be noted that similar numbers and letters represent similar items in the following figures. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. In addition, the terms "first", "second", "third", etc. are only used to distinguish the description and are not to be understood as indicating or implying relative importance.
[0149] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present application, which are used to illustrate the technical solutions of the present application, rather than to limit them. The scope of protection of the present application is not limited thereto. Although the present application has been described in detail with reference to the above-described embodiments, those skilled in the art should understand that any person skilled in the art can modify or easily conceive of changes to the technical solutions described in the above-described embodiments within the technical scope disclosed in the present application, or make equivalent replacements for some of the technical features thereof. However, these modifications, changes, or replacements do not deviate from the spirit and scope of the technical solutions of the embodiments of the present application. They should all be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.
Claims
1. A method for generating an emergency plan, characterized in that: include: Obtain description information of abnormal events at the target location; Converting the abnormal event description information into a description text vector, and performing a vector search on a preset vector library based on the description text vector to obtain a target text vector, wherein the preset vector library includes: text vectors corresponding to multiple slice texts in the emergency treatment document of the target location; Extracting a target entity relationship triple from the abnormal event description information, and performing a graph search on a preset knowledge graph based on the target entity relationship triple to obtain a target knowledge subgraph, wherein the preset knowledge graph includes: a plurality of knowledge subgraphs, and the plurality of knowledge subgraphs are obtained by clustering the entity relationship triples in the plurality of slice texts; A target slice text is obtained by fusing the first slice text corresponding to the target text vector and the second slice text corresponding to the target knowledge subgraph; The target large language model part in the multimodal large model of the target place is used to generate an emergency plan for the target place according to the target slice text.
2. The method according to claim 1, characterized in that The obtaining of abnormal event description information for the target location includes: Using sensor equipment to collect current surveillance video and current IoT data for the target location; Using the target visual encoder in the multimodal large model, visually encode the current monitoring video to obtain video encoding information; Using the target large language model portion, processing the video encoding information to identify the type of abnormal event at the target location; According to the location of the sensor device, the Internet of Things data and the type of abnormal event, the location where the abnormal event occurred and the number of people in the target place are identified; the abnormal event description information includes the type of abnormal event, the location where the abnormal event occurred and the number of people.
3. The method according to claim 2, characterized in that The method further comprises: Based on historical surveillance videos of the target location, self-supervised pre-training is performed on the first visual encoder in the base multimodal large model to obtain a second visual encoder; Incrementally pre-training the first language model portion of the base multimodal large model according to the operation control data of the target location to obtain the second language model portion; According to the pre-labeled graphic data, the second visual encoder and the second large language model are fine-tuned to obtain the target visual encoder and the target large language model.
4. The method according to claim 1, wherein The fusing the first slice text corresponding to the target text vector and the second slice text corresponding to the target knowledge subgraph to obtain the target slice text includes: Obtaining a first vector similarity between the text vector corresponding to the first slice text and the description text vector, and a second vector similarity between the text vector corresponding to the second slice text and the description text vector; Determining a first graph affinity of the first slice text based on a distance between an entity in the first slice text and an entity in the abnormal event description information, and determining a second graph affinity of the second slice text based on a distance between an entity in the second slice text and an entity in the abnormal event description information; The target slice text is determined from the first slice text and the second slice text according to the first vector similarity, the second vector similarity, the first graph relevance, and the second graph relevance.
5. The method according to claim 4, characterized in that The determining the target slice text from the first slice text and the second slice text according to the first vector similarity, the second vector similarity, the first graph relevance, and the second graph relevance includes: Performing weighted processing based on the first vector similarity and the first graph relevance to obtain a weighted score for the first slice text; Performing weighted processing according to the second vector similarity and the second graph relevance to obtain a weighted score for the second slice text; The target slice text is determined from the first slice text and the second slice text according to the weighted score of the first slice text and the weighted score of the second slice text.
6. The method according to claim 1, characterized in that The method of using the target large language model portion of the multimodal large model of the target location to generate an emergency plan for the target location according to the target slice text includes: Generate a target prompt word according to the target slice text, the processing person constraint information, the processing time constraint information, and the constraint information of the emergency processing document corresponding to the target slice text; The target large language model portion is used to generate an emergency plan for the target location according to the target prompt word.
7. The method according to claim 1, characterized in that Before performing a vector search on a preset vector library based on the description text vector to obtain a target text vector, the method further includes: If the emergency handling document is a title document, then structurally segmenting the emergency handling document according to a preset level title and preset segmentation parameters to obtain the plurality of slice texts; If the emergency handling document is a non-title document, semantically segmenting the emergency handling document according to a preset delimiter to obtain the plurality of slice texts; The multiple slice texts are respectively converted into text vectors, and the text vectors corresponding to the multiple slice texts, the multiple slice texts and the identifiers of the multiple slice texts are saved in the preset vector library.
8. The method according to claim 1, characterized in that Before performing graph retrieval on a preset knowledge graph based on the target entity relationship triple to obtain a target knowledge subgraph, the method further includes: Respectively identifying entity relationship triples in the plurality of slice texts; Clustering the entity relationship triples in the multiple slice texts to obtain the multiple knowledge subgraphs, and generating the preset knowledge graph; According to the slice text corresponding to the entity in each knowledge subgraph, generate the slice identification attribute corresponding to the entity in each knowledge subgraph, and add it to the preset knowledge graph; Before fusing the first slice text corresponding to the target text vector and the second slice text corresponding to the target knowledge subgraph to obtain the target slice text, the method further includes: Determine a target slice identification attribute corresponding to an entity in the target knowledge subgraph from the preset knowledge graph; According to the target slice identification attribute, the second slice text is determined from the multiple slice texts.
9. An emergency plan generating device, characterized in that: include: An acquisition module is used to obtain description information of abnormal events at a target location; a processing module, configured to convert the abnormal event description information into a description text vector, and perform a vector search on a preset vector library based on the description text vector to obtain a target text vector, wherein the preset vector library includes: text vectors corresponding to a plurality of slice texts in the emergency response document of the target location; The processing module is further configured to extract a target entity relationship triple from the abnormal event description information, and perform a graph search on a preset knowledge graph based on the target entity relationship triple to obtain a target knowledge subgraph, wherein the preset knowledge graph includes: a plurality of knowledge subgraphs, and the plurality of knowledge subgraphs are obtained by clustering the entity relationship triples in the plurality of slice texts; The processing module is further configured to fuse the first slice text corresponding to the target text vector and the second slice text corresponding to the target knowledge subgraph to obtain a target slice text; The processing module is also used to adopt the target large language model part in the multimodal large model of the target place to generate an emergency plan for the target place according to the target slice text.
10. An electronic device, characterized in that: include: A processor, a memory, and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate via the bus, and the processor executes the machine-readable instructions to perform the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Emergency plan generation method and system based on neural network, equipment and medium
CN114004210A
Method and system for determining auxiliary reference information based on medical knowledge graph
CN114218955A
Method and system for generating enhanced knowledge questions and answers for mixed retrieval of heterogeneous database
CN119311831A
Emergency plan knowledge question and answer method, system and equipment
CN119719288A
Question and answer generation method and device, equipment and storage medium
CN119719297A
Cited By
Large-model-driven emergency disposal process generation method and system
CN121010104A
Method and device for generating coping scheme description information, storage medium and electronic equipment
CN121658663A