Situation characterization and deduction method for emergency scene
By encoding situation information, the Token sequence is formed, and the Transformer model is used for situation deduction, which solves the problem of difficult understanding of large language models in complex situation representation and deduction, realizes accurate representation and deduction of situations, and provides intelligent decision-making support.
Patent Information
- Application Number
- CN202411595049.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-11
- Publication Date
- 2025-02-21
AI Technical Summary
In the situation representation and deduction of existing large language models, it is difficult to accurately understand and explain complex situations due to the ambiguity and ambiguity of language.
Using maps, rescue personnel's purpose and actions and information encoding situations of rescued personnel, form a situation token sequence, use the Transformer model to model the complex relationship between situation token sequences, and form self-marking of the token sequence by reviewing the data, and conduct training to construct Stability deduction model.
It realizes accurate representation and deduction of complex situations, can innovate activity plans, reduce personnel deduction training costs, and provide intelligent basic decision-making support.
Smart Images

Figure CN119494446A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence, and in particular to a situation characterization and deduction method for emergency scenarios. Background Art
[0002] Situational simulation is a decision support technology that can be used in scenarios such as emergency rescue plan formulation and military action planning. This technology evaluates potential future events and their development status, and then predicts the potential impact of these events on current decisions. This forward-looking analysis helps decision makers develop more accurate and effective strategies when faced with uncertainty. Nowadays, computers are often used to simulate the real world for simulation. It generally relies on professionals to understand the disaster scenario, manually decide on the deployment of rescue forces, and control the rescue forces to carry out actions. With the development of artificial intelligence technology, computers can assist humans in making the above decisions, which is expected to solve the problem of reduced decision-making ability when humans are tired.
[0003] With the improvement of computing power and the optimization of algorithms, neural network technology has been increasingly used in the field of situational deduction and decision-making, and has achieved remarkable results. Transformer is a neural network that uses a self-attention mechanism to capture long-distance dependencies in a sequence. It does not require the information in the sequence to be transmitted in chronological order, but instead stacks a series of self-attention layers to process the entire sequence. It is faster to train, and can increase the size of the neural network almost unlimitedly. It has shown excellent performance in processing long sequences and complex tasks. Natural language text is a typical sequence with the above-mentioned "long-distance dependency" relationship. It does not need to be labeled, and there is a large corpus of text on the Internet. By training the neural network of Transformer and its variants with the corpus, the so-called pre-trained language model is obtained.
[0004] When the parameter scale of the pre-trained language model exceeds a certain level, and after large-scale corpus generation pre-training (Pre-train) and instruction tuning (Instruction Tuning), it emerges with capabilities such as instruction following, context understanding (In-context), step-by-step reasoning of thought chains, and even zero-shot reasoning (Zero-shot). The research community calls this kind of pre-trained language model a large language model (LLM). However, although the neural network of the large language model captures the objective but very complex relationship between natural language before and after, the ambiguity and ambiguity of language may make it difficult for the model to accurately understand and explain the current complex situation. Summary of the invention
[0005] In order to solve the problem that the existing large language model is difficult to accurately understand and explain the complex situation in the real world due to the ambiguity and ambiguity of language in situation representation and deduction, the present invention provides a situation representation and deduction method for emergency scenarios, which uses maps, rescue personnel's purpose and actions, and rescued personnel information to encode the situation, and the situation information of different time periods forms a situation Token sequence. The complex relationship between the situation Token sequences is modeled using Transform, and the self-annotation of the Token sequence is formed using replay data, which can accurately understand and explain the complex situation in the real world.
[0006] In a first aspect, the present invention provides a situation characterization and deduction method for emergency scenarios, comprising:
[0007] Step S1: Perform situation representation encoding on the multi-dimensional situation history information of the target scene to obtain a Token sequence; wherein the multi-dimensional situation history information includes map information, rescuer information and rescued person information; the Token sequence includes multiple Tokens arranged in chronological order;
[0008] Step S2: construct a situation deduction model, the situation deduction model includes an embedded coding module, a Transformer module and a decoding module; wherein the embedded coding module is used to embed the plurality of Tokens respectively to generate a corresponding vector sequence; the Transformer module is used to extract the dependency relationship between the plurality of vectors in the vector sequence to generate a latent vector sequence; the decoding module decodes the latent vector sequence according to the Token sequence corresponding to the latent vector sequence to obtain a situation deduction result;
[0009] Step S3: training the situation deduction model;
[0010] Step S4: Send the token sequence to be predicted into the trained situation deduction model to obtain the situation deduction result of the target scene.
[0011] Furthermore, step S1 specifically includes: dividing the entire time range where the multi-dimensional situation history information is located into multiple time periods according to whether the number of rescuers and rescued persons changes, encoding the multi-dimensional situation history information in each time period according to a preset encoding rule, and generating a Token corresponding to each time period; wherein the preset encoding rule includes:
[0012] Step S101: Encode the map information to generate a map information matrix, wherein the map information matrix is used to indicate map elevation data, obstructed areas, and terrain factors affecting maneuvering speed;
[0013] Step S102: Encode the rescuer information to generate a rescuer purpose matrix and a rescuer information matrix of each rescue type, wherein the rescuer information matrix includes: a first rescuer information matrix and a second rescuer information matrix under multiple attribute information;
[0014] The first rescuer information matrix represents the attribute information of the rescuer in the entire unit time period, and the second rescuer information matrix represents the attribute information of the rescuer's location at the last moment in the unit time period;
[0015] Step S103: Encode the rescued person information to generate a rescued person information matrix, including: a first rescued person information matrix and a second rescued person information matrix under multiple attribute information;
[0016] The first rescued person information matrix represents the most recently observed positions and attribute information of the rescued persons, and the second rescued person information matrix represents the inferred positions and attribute information of the rescued persons.
[0017] Furthermore, the attribute information includes action location, quantity of consumables and physical strength.
[0018] Furthermore, the embedded coding module includes a combination of multiple convolutional layers and pooling downsampling layers and a Flatten processing layer; the embedded module performs parallel processing on multiple tokens in the Token sequence.
[0019] Furthermore, the process of embedding encoding of each Token specifically includes:
[0020] First, semantic extraction and dimensionality reduction processing are performed through multiple convolution sampling blocks to generate a semantic feature map; wherein the convolution sampling block includes a convolution layer and a pooling downsampling layer connected in sequence;
[0021] The semantic feature map is flattened by a Flatten processing layer to obtain a vector.
[0022] Furthermore, the processing flow of the Transformer module includes:
[0023] Performing position encoding on each vector in the vector sequence output by the embedding coding module;
[0024] The position-encoded vector sequence is fed into the Transformer block to capture the sequence dependency and generate a latent vector sequence.
[0025] The Transformer block includes a multi-head self-attention layer and a fully connected layer with residual connections; each sub-layer output is connected to a layer normalization.
[0026] Furthermore, the decoding module decodes the latent vector sequence according to the Token sequence corresponding to the latent vector sequence to obtain a situation deduction result, which specifically includes:
[0027] For each rescue type contained in the Token, the number of available rescuers under the rescue type is taken as the number of decoding times for the rescue type;
[0028] All rescue types contained in the Token and all actionable rescuers under each rescue type are decoded in parallel.
[0029] Furthermore, the decoding process of each actionable rescuer under each rescue type specifically includes:
[0030] Rearranging the latent vectors in the latent vector sequence according to the inverse process of flattening to generate a first feature map;
[0031] First, take out the second physical strength matrix under the current rescue type from the Token, specify the target actionable rescuer, retain the physical strength value of the target actionable rescuer at the corresponding position on the second physical strength matrix, set the remaining physical strength values to zero, obtain a new second physical strength matrix and put it back into the Token; then perform multiple convolution and downsampling processes on the Token to generate a second feature map; wherein, the second physical strength matrix refers to the second rescuer information matrix under the physical attribute;
[0032] The first feature map and the second feature map are stacked and subjected to inverse convolution upsampling processing to generate a third feature map; wherein the third feature map is a situation deduction result.
[0033] Furthermore, the step S3 specifically includes: taking the cumulative rewards of the Token sequence and the current Token sequence as offline data sets, and using offline reinforcement learning to train the situation deduction model, wherein the cumulative rewards are calculated by the scores of rescuers completing rescue operations, the scores of rescuers who have not left the scene, and the scores of consumed materials.
[0034] Furthermore, the step S3 further includes selecting a Token sequence of successful rescue missions to pre-train the situation deduction model:
[0035] The cumulative rewards of the rescuer from the current Token to the next Token and the current Token are used as pre-training data;
[0036] The current Token is embedded in the encoding module and concatenated with the cumulative reward as the input of the Transformer module.
[0037] In a second aspect, the present invention provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the situation characterization and deduction method for emergency scenarios as described above is implemented.
[0038] Beneficial effects of the present invention:
[0039] The situation characterization method for emergency scenarios proposed in the present invention can characterize complex situations. The present invention designs a method for constructing tokens from situation data, and provides a method for embedding tokens into encoding and decoding prediction. Based on this token mechanism, self-supervisory data can be formed from unlabeled situation deduction data, and model parameters can be trained in a self-supervisory manner to construct a large sequence model for situation deduction, providing an intelligent foundation for implementing activity plan innovation and reducing the cost of personnel deduction training.
[0040] The present invention provides a situation representation and deduction method for emergency scenarios, which is a Transformer model used to capture complex situation / action sequence dependencies. After sufficient training, it can encode the causal knowledge between complex situations and action sequences. By inputting existing situation sequences, various situation analyses are performed and action sequences are output. These sequences can drive the situation deduction decision system to realize automatic deduction, thereby completing the inspection and evaluation of action sequences, providing humans with a new situation deduction decision-making method. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 A schematic diagram of a flow chart of a situation characterization and deduction method for emergency scenarios provided by an embodiment of the present invention;
[0042] Figure 2 A schematic diagram of the situation deduction model training provided by an embodiment of the present invention;
[0043] Figure 3 A schematic diagram of converting situation data into Tokens provided by an embodiment of the present invention;
[0044] Figure 4 A schematic diagram of the structure of an embedded coding module and a Transformer module provided in an embodiment of the present invention;
[0045] Figure 5 A schematic diagram of the decoding module structure provided by an embodiment of the present invention;
[0046] Figure 6 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0047] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution in the embodiment of the present invention will be clearly described below in conjunction with the drawings in the embodiment of the present invention. Obviously, the described embodiment is a part of the embodiment of the present invention, not all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0048] The present invention will use a simulation system for computer simulation of real-world disasters such as earthquakes, fires, and floods, collectively referred to as a situation deduction system. The movable entities are referred to as chess pieces, and the complete action data of the chess pieces and the data on changes in the environment such as related terrain, landforms, and objects are recorded, which are referred to as replay data. The situation representation and deduction method of the present invention is conceived as follows: maps, rescue personnel's purposes and their actions, and rescued personnel information are encoded, and situation information in different time periods is encoded into Tokens to complete situation representation; based on the Token sequence formed by the situation representation, it is embedded and encoded and the complex relationship between situation sequences is modeled using Transformer, and the replay trajectory data is used to form a self-annotation of the situation Token sequence. After learning, a situation deduction model is obtained, which can realize situation deduction and provide an intelligent foundation for implementing activity plan innovation and reducing the cost of personnel deduction training.
[0049] like Figure 1 As shown, an embodiment of the present invention provides a situation characterization and deduction method for emergency scenarios, including:
[0050] Step S1: Perform situation representation encoding on the multi-dimensional situation history information of the target scene to obtain a Token sequence; wherein the multi-dimensional situation history information includes map information, rescuer information and rescued person information; the Token sequence includes multiple Tokens arranged in chronological order;
[0051] Specifically, the entire time range of the multi-dimensional situation history information is divided into multiple time periods according to whether the number of rescuers and rescued persons changes, and the multi-dimensional situation history information in each time period is encoded according to the preset encoding rules to generate the token corresponding to each time period;
[0052] Furthermore, the condition for dividing the entire time period in which the multi-dimensional situation historical information is located also includes: the rescuer and the rescued person are in a fatigue state.
[0053] Furthermore, a fixed time is set as the maximum time interval. When a Token lasts for a long time, it is cut off with the maximum time interval and a new Token is started.
[0054] It can be understood that encoding multi-dimensional situation history information into tokens can reflect the information of rescuers and rescued persons within a specific time period, and superimposing hexagonal map data to form a basic tensor (Token). In the situation deduction model, the token needs to correspond the multi-dimensional information that simultaneously represents the real world and time to the situation unit. In reality, humans are accustomed to using natural language to describe purposes and using visual maps to describe the real world. Natural language cannot be directly used as a prompt word that can be input into the large sequence model, and it needs to be converted into a token for the situation deduction model.
[0055] Step S2: constructing a situation deduction model, which includes an embedded coding module, a Transformer module and a decoding module;
[0056] Specifically, the embedding coding module is used to embed and encode multiple tokens respectively to generate corresponding vector sequences; the Transformer module is used to extract the dependency relationship between multiple vectors in the vector sequence to generate a latent vector sequence; the decoding module decodes the latent vector according to the token corresponding to the latent vector in the latent vector sequence to obtain the situation deduction result;
[0057] Step S3: training the situation deduction model;
[0058] Furthermore, the cumulative returns of the Token sequence and the current Token sequence are used as offline data sets, and offline reinforcement learning is used to train the situation deduction model;
[0059] The cumulative reward is calculated by the score of the rescuers completing the rescue operation, the score of the rescuers who have not left the scene, and the score of the consumed materials. The calculation formula is as follows:
[0060] Number of people rescued at a given moment × personnel value - cumulative value of consumed materials at time t
[0061] Among them, time t represents the time from the current token to the next token, the number of people rescued represents the rescue work completed by the rescuers, and the personnel value represents the rescuers who have not left the scene.
[0062] It should be noted that when using the Token sequence for training, the reward target (cumulative reward amount) of the current Token sequence needs to be taken as part of the Token and input into the model for training. Specifically, according to the trajectory data of the rescuer, the current Token is embedded in the s i Perform action a in state t Arriving at the next Token's s i+t The cumulative reward obtained by the state With status si Cascade As input to the situation simulation model.
[0063] Generate self-supervised samples to obtain the probability value of maneuvering to each position. Use the probability value of each position output by decoding and the minimum cross entropy as the goal to train the Token encoding module, Transformer block and decoding module.
[0064] During the training process, This clarifies the credit allocation problem and guides the output action in the inference process, that is, it guides the rescuer to choose the most advantageous maneuver for the rescuer. It serves as a prompt word.
[0065] In order to improve the training efficiency of the model and make the model converge faster, the training process also includes: selecting the Token sequence of successful rescue missions to pre-train the situation deduction model:
[0066] The cumulative rewards of the rescuers from the current Token to the next Token and the current Token are used as pre-training data to train the situation deduction model;
[0067] like Figure 2 As shown, the current Token is embedded in the encoding module. t The cumulative return amount cascade As the input x of the Transformer module t ;
[0068] Among them, the cumulative return amount is calculated by the scores of rescuers completing rescue operations, the scores of rescuers who have not left the scene, and the scores of consumed materials.
[0069] Step S4: Send the token sequence to be predicted into the trained situation deduction model to obtain the situation deduction result of the target scene.
[0070] An embodiment of the present invention provides a situation characterization and deduction method for emergency scenarios. For a certain rescue scenario, it obtains past multi-dimensional situation historical information data to form a high-quality "corpus". The situation deduction model of the present invention only plays the role of a rescuer, generates self-supervised samples, obtains the probability value of maneuvering to each position, and uses the decoding output of the probability value of each position and its cross entropy minimum as the goal to train the embedded coding module, Transformer module and decoding module. The trained situation deduction model can be used to infer the actions of the rescued personnel, such as the hiding position, the route to the hiding position, etc. The trained situation deduction model can be used to deduce the rescuer's plan, such as the rescuer's arrival position, the route he passed, etc.
[0071] In one embodiment, step S1 specifically includes: dividing the entire time range where the multi-dimensional situation history information is located into multiple time periods according to the changes in the number of rescuers and rescued persons, encoding the multi-dimensional situation history information in each time period according to the preset encoding rules, and generating a Token corresponding to each time period; wherein the preset encoding rules include:
[0072] Step S101: Encode the map information to generate a map information matrix; the map information matrix is used to indicate map elevation data, obstructed areas, and terrain factors that affect maneuvering speed;
[0073] Specifically, the map elevation data is normalized and arranged in hexagonal grids to obtain the first matrix; hexagonal grids with shielding effects such as residential areas are coded as 1, and the rest are coded as 0, thus arranging to obtain the second matrix; roads, rivers, roadblocks and other terrain factors will affect the maneuvering speed, and they are uniformly encoded into 6 matrices, among which the element values of the 6 matrices correspond to the maneuvering speeds in 6 directions (compared to the multiples of the standard maneuvering speed on flat ground).
[0074] Step S102: Encode the rescuer information to generate a rescuer purpose matrix and a rescuer information matrix of each rescue type, wherein the rescuer information matrix includes: a first rescuer information matrix and a second rescuer information matrix under multiple attribute information;
[0075] The first rescuer information matrix represents the attribute information of the rescuer in the entire unit time period, and the second rescuer information matrix represents the attribute information of the rescuer's location at the last moment in the unit time period;
[0076] Specifically, in the situation simulation, the purpose of the rescuers is to go to a certain target point to complete the rescue operation, such as going to a certain place to put out the fire and search for the rescued persons. The hexagonal grid value of the target point is marked as 1, the six surrounding hexagonal grid values are marked as 0.5, and the hexagonal grid values of other non-target points are marked as 0. Arranging the hexagonal grid values will obtain the rescuer's purpose matrix.
[0077] The information matrix of the rescuer is encoded by chess piece type, and the number of chess piece types is num_1. For example, if there are only headquarters, fire trucks, ambulances, firefighters, and doctors, then num_1 is 5. Each type of chess piece has N important attributes, so each type of chess piece uses N matrices to represent the actions of all chess pieces of that type, and the sum of their attribute matrices represents the first rescuer information matrix. N corresponds to N important attributes, and the value of the matrix element represents the attribute value when the chess piece is in the corresponding hexagonal grid during the Token period. For the hexagonal grid that the chess piece has not been in, the matrix element value is 0; if there are two or more chess pieces of the same type in the same hexagonal grid, the value of the matrix element is the sum of the attribute values of each chess piece.
[0078] Specifically, the attribute information includes action location, number of consumables, and physical condition.
[0079] Correspondingly, each attribute matrix in the first rescuer information matrix represents its attribute information. For example, the action matrix can represent the maneuvering process of each piece of the same type of rescuer in the current Token period, forming a maneuvering trajectory; the consumables quantity matrix can represent the consumption process of medicines and water caused by the rescue action in the current Token period, and the physical strength matrix represents the fatigue process in the trajectory, etc.
[0080] Each important attribute of the rescuer has a second matrix. The matrix element value of the last step of each chess piece is the attribute value at this time, which is used to mark the end of the rescuer's action trajectory, while the other matrix elements are all 0. In this way, num_1*N*2 matrices can correspond to an indefinite number of rescuers, indicating emergencies such as rescuers not having the energy to leave the scene.
[0081] It should be noted that the encoding dimension of the above rescuer information is the same as that of the map matrix, and the vertical and horizontal coordinates of the matrix elements correspond to the positions of the hexagonal grids.
[0082] Step S103: Encode the rescued person information to generate a rescued person information matrix, including: a first rescued person information matrix and a second rescued person information matrix under multiple attribute information;
[0083] The first matrix of rescued person information represents the most recently observed position and attribute information of the rescued person, and the second matrix of rescued person information represents the inferred position and attribute information of the rescued person. It should be noted that the attribute information of the rescued person and the attribute information of the rescuer are of the same type.
[0084] Specifically, the information of the rescued persons is also encoded according to their types, and the number of types of rescued persons is num_2; corresponding to the attributes of the rescuer information, each type of chess piece has N important attributes; each type of chess piece uses N matrices to represent the most recently observed positions of the rescued persons and their attribute values, and the corresponding matrix element values are the attribute values, and the other element matrices are all 0.
[0085] Each important attribute of the rescued person has a second matrix, represented by the second rescued person information matrix, which is used to describe the attribute values of the possible location of the rescued person. Among them, the possible location is calculated by the last observed location, the time interval from the current location and the maneuvering speed, and the attribute value is inferred based on prior knowledge.
[0086] like Figure 3 As shown, the Token obtained by the situation characterization of step S1 in the embodiment of the present invention.
[0087] It can be understood that when the embodiment of the present invention obtains the Token sequence through situation characterization, it incorporates prior knowledge such as basic maneuvering speed, number of consumables, and the law of change of physical strength value, performs situation characterization according to the idea of fusion of knowledge and data, and fully characterizes the information of the real world.
[0088] In one possible embodiment, the embedding coding module is used to embed the plurality of tokens respectively to generate corresponding vector sequences; the embedding coding module includes a combination of a plurality of convolutional layers and pooling downsampling layers and a Flatten processing layer.
[0089] like Figure 4 As shown in the lower part of the figure, the process of embedding each Token includes:
[0090] First, semantic extraction and dimensionality reduction are performed through multiple convolution sampling blocks to generate semantic feature maps; wherein the convolution sampling block includes a convolution layer and a pooling downsampling layer connected in sequence;
[0091] Specifically, the matrix generated in the above step S1 constitutes a data cube, such as Figure 3 As shown in the figure, the data cube is the token in the situation deduction. Each token is passed through a combination of multiple convolutional layers and pooling downsampling layers to obtain a semantic feature map;
[0092] The semantic feature map is flattened through the Flatten processing layer to obtain a vector.
[0093] Specifically, the semantic feature map with spatial information is flattened through the Flatten processing layer to obtain a fixed d-dimensional vector, denoted as x i , i is the serial number of Token in the sequence, and multiple vectors constitute the vector sequence {x1 …x i …x m}.
[0094] It is understandable that if the data cube is directly concatenated into row vectors, the space of dictionary index values in the corresponding large language model (LLM) is too large. Therefore, the data cube is subjected to multi-layer convolution for abstract semantic extraction, and then pooling is used for dimensionality reduction.
[0095] In one embodiment, the Transformer module includes a plurality of Transformer blocks; wherein the Transformer block includes a multi-head self-attention layer and a fully connected layer with residual connections; wherein each sub-layer output is connected to a layer normalization;
[0096] like Figure 4 As shown in the upper part of the figure, the Transformer module processes as follows:
[0097] The vector sequence {x 1 …x i …x m} for each vector x i ,i∈{1,…,m} performs position encoding;
[0098] The position-encoded vector sequence is fed into the Transformer block to capture the sequence dependency and generate a latent vector sequence.
[0099] Specifically, the Transformer block captures the dependencies of the input sequence based on the multi-head self-attention mechanism and outputs a hidden vector sequence Where l = 1,…,L, L is the number of Transformer blocks, which determines the parameter scale of the large model. It is still d-dimensional.
[0100] In one embodiment, the decoding module decodes the latent vector sequence according to the Token sequence corresponding to the latent vector sequence to obtain a situation deduction result, which specifically includes:
[0101] For each rescue type contained in the Token, the number of available rescuers under the rescue type is taken as the number of decoding times for the rescue type;
[0102] It can be understood that the total number of decodings required by the decoding module is the sum of the number of decodings required for each rescue type, and each decoding is for one rescuer.
[0103] All rescue types contained in the Token and all actionable rescuers under each rescue type are decoded in parallel.
[0104] like Figure 5 As shown, the decoding process for each actionable rescuer specifically includes:
[0105] The d-dimensional latent vector in the latent vector sequence Rearrange according to the inverse process of flattening to generate the first feature map with spatial information Where i corresponds to the number of the latent vector;
[0106] First, take out the second physical strength matrix under the current rescue type from the Token, specify the target actionable rescuer, retain the physical strength value of the target actionable rescuer at the corresponding position on the second physical strength matrix, set the remaining physical strength values to zero, obtain the new second physical strength matrix and put it back into the Token; then perform multiple convolution and downsampling on the Token to generate the second feature map Wherein, the second physical strength matrix refers to the second rescuer information matrix under the physical strength attribute;
[0107] It can be understood that each time the decoding is performed, the second matrix corresponding to the physical attributes of the target rescuer type chess piece is taken out. This matrix determines which positions of the current Token's last step have chess pieces of this type and their physical values. Each time for a chess piece, the physical value at its corresponding position is retained, and the physical values of the corresponding positions of other chess pieces are set to 0 as the physical matrix of the target rescuer. The replaced Token is then input into the embedded coding module (with the shared parameters before, but without Flatten) and re-convolved and down-sampled multiple times to obtain the second feature map
[0108] The first feature map With the second feature map The stacking is performed and the inverse convolution up-sampling is performed to generate a third feature map; wherein the third feature map is a situation deduction result.
[0109] Understandably, and The stacking and then inverse convolution upsampling process finally obtains the third feature map with the same vertical and horizontal dimensions as the matrix in the original Token. The physical meaning of its element value is the probability of the next Token arriving at this position. In this way, for each type of chess piece at each position in the map, the decoding module outputs the probability of its next Token safely reaching each hexagonal grid on the map in the last step.
[0110] It can be understood that for each type of chess piece at each position in the map, the decoding module outputs the probability of its last step in the next token to safely reach each hexagonal grid in the entire map. There is also a probability of personnel loss (no hexagonal grid corresponding to it), which is equal to 1 minus the difference between the corresponding probabilities of all hexagonal grids on the map. In this sense, the probability corresponding to each hexagonal grid can also be regarded as the percentage of the physical value of the original chess piece to reach this position in the next token, and the probability of personnel loss can be regarded as the departure rate of the chess piece in the next token.
[0111] It should be noted that the number of decoding operations for each latent vector is the number of movable pieces. The decoding operation can be performed in parallel for all movable pieces of all types, and there is no serial dependency. Therefore, the time complexity of pre-training is linear compared to LLM.
[0112] The method provided in this embodiment uses convolution downsampling in embedded coding and inverse convolution upsampling in the decoding process to predict the possible arrival position of each chess piece (i.e., the result of the maneuvering action), achieving a similar effect to predicting the existence probability of all tokens in the dictionary in LLM. This decoding also takes into account the prediction of the loss of chess pieces, and has a strong authenticity.
[0113] like Figure 6 As shown, an embodiment of the present invention further provides an electronic device, which may include: a processor (processor) 601, a communication interface (Communications Interface) 602, a memory (memory) 603 and a communication bus 604, wherein the processor 601, the communication interface 602, and the memory 603 communicate with each other through the communication bus 604. The processor 601 can call the logic instructions in the memory 603 to implement the method provided in the above embodiment when executing the program, for example, including:
[0114] Step S1: Encode the multi-dimensional situation history information of the target scene to obtain a Token sequence;
[0115] Step S2: constructing a situation deduction model, which includes an embedded coding module, a Transformer module and a decoding module;
[0116] Step S3: training the situation deduction model;
[0117] Step S4: Send the token sequence to be predicted into the trained situation deduction model to obtain the situation deduction result of the target scene.
[0118] In addition, when the logic instructions in the above-mentioned memory 603 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 such an understanding, the technical solution of the present invention, in essence, 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, and the computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0119] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A situation characterization and deduction method for emergency scenarios, characterized in that: include: Step S1: Encode the multi-dimensional situation history information of the target scene to obtain a Token sequence; The multi-dimensional situation history information includes map information, rescuer information and rescued person information; the Token sequence includes multiple Tokens arranged in chronological order; Step S2: construct a situation deduction model, the situation deduction model includes an embedded coding module, a Transformer module and a decoding module; wherein the embedded coding module is used to embed the plurality of Tokens respectively to generate a corresponding vector sequence; the Transformer module is used to extract the dependency relationship between the plurality of vectors in the vector sequence to generate a latent vector sequence; the decoding module decodes the latent vector sequence according to the Token sequence corresponding to the latent vector sequence to obtain a situation deduction result; Step S3: training the situation deduction model; Step S4: Send the token sequence to be predicted into the trained situation deduction model to obtain the situation deduction result of the target scene.
2. The situation characterization and deduction method for emergency scenarios according to claim 1 is characterized in that: Step S1 specifically includes: dividing the entire time range where the multi-dimensional situation history information is located into multiple time periods according to whether the number of rescuers and rescued persons changes, encoding the multi-dimensional situation history information in each time period according to the preset coding rules, and generating a Token corresponding to each time period; wherein the preset coding rules include: Step S101: Encode the map information to generate a map information matrix, wherein the map information matrix is used to indicate map elevation data, obstructed areas, and terrain factors affecting maneuvering speed; Step S102: Encode the rescuer information to generate a rescuer purpose matrix and a rescuer information matrix of each rescue type, wherein the rescuer information matrix includes: a first rescuer information matrix and a second rescuer information matrix under multiple attribute information; The first rescuer information matrix represents the attribute information of the rescuer in the entire unit time period, and the second rescuer information matrix represents the attribute information of the rescuer's location at the last moment in the unit time period; Step S103: Encode the rescued person information to generate a rescued person information matrix, including: a first rescued person information matrix and a second rescued person information matrix under multiple attribute information; The first rescued person information matrix represents the most recently observed positions and attribute information of the rescued persons, and the second rescued person information matrix represents the inferred positions and attribute information of the rescued persons.
3. The situation characterization and deduction method for emergency scenarios according to claim 2 is characterized in that: The attribute information includes action position, number of consumables and physical strength.
4. The situation characterization and deduction method for emergency scenarios according to claim 1 is characterized in that: The embedded coding module includes a combination of multiple convolutional layers and pooling downsampling layers and a Flatten processing layer; the embedded module performs parallel processing on multiple tokens in the Token sequence.
5. The situation characterization and deduction method for emergency scenarios according to claim 4 is characterized in that: The specific process of embedding encoding for each Token includes: First, semantic extraction and dimensionality reduction processing are performed through multiple convolution sampling blocks to generate a semantic feature map; wherein the convolution sampling block includes a convolution layer and a pooling downsampling layer connected in sequence; The semantic feature map is flattened by a Flatten processing layer to obtain a vector.
6. The situation characterization and deduction method for emergency scenarios according to claim 1 is characterized in that: The processing flow of the Transformer module includes: Performing position encoding on each vector in the vector sequence output by the embedding coding module; The position-encoded vector sequence is fed into the Transformer block to capture the sequence dependency and generate a latent vector sequence. The Transformer block includes a multi-head self-attention layer and a fully connected layer with residual connections; each sub-layer output is connected to a layer normalization.
7. The situation characterization and deduction method for emergency scenarios according to claim 3 is characterized in that: The decoding module decodes the latent vector sequence according to the Token sequence corresponding to the latent vector sequence to obtain the situation deduction result, which specifically includes: For each rescue type contained in the Token, the number of available rescuers under the rescue type is taken as the number of decoding times for the rescue type; All rescue types contained in the Token and all actionable rescuers under each rescue type are decoded in parallel.
8. The situation characterization and deduction method for emergency scenarios according to claim 7 is characterized in that: The decoding process for each actionable rescuer under each rescue type specifically includes: Rearranging the latent vectors in the latent vector sequence according to the inverse process of flattening to generate a first feature map; First, take out the second physical strength matrix under the current rescue type from the Token, specify the target actionable rescuer, retain the physical strength value of the target actionable rescuer at the corresponding position on the second physical strength matrix, set the remaining physical strength values to zero, obtain a new second physical strength matrix and put it back into the Token; then perform multiple convolution and downsampling processes on the Token to generate a second feature map; wherein, the second physical strength matrix refers to the second rescuer information matrix under the physical attribute; The first feature map and the second feature map are stacked and subjected to inverse convolution upsampling processing to generate a third feature map; wherein the third feature map is a situation deduction result.
9. The situation characterization and deduction method for emergency scenarios according to claim 1 is characterized in that: The step S3 specifically includes: taking the cumulative rewards of the Token sequence and the current Token sequence as offline data sets, and using offline reinforcement learning to train the situation deduction model; wherein the cumulative rewards are calculated by the scores of rescuers completing rescue operations, the scores of rescuers who have not left the scene, and the scores of consumed materials.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the situation characterization and deduction method for emergency scenarios as described in any one of claims 1 to 9 is implemented.