Security key scene generation method and device, storage medium and product
By obtaining the heterogeneous diagram of the urban air traffic system and using meta-path sampling and heterogeneous diagram representation algorithms to generate key safety scenarios, the problem that the existing technology is difficult to generate multi-factor urban air traffic system scenarios is solved, and the effective extraction and fusion of state characteristics is achieved, and a more comprehensive safety scenario is generated.
Patent Information
- Application Number
- CN202510495496.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-18
- Publication Date
- 2025-08-01
AI Technical Summary
The existing security key scenario generation algorithm is difficult to effectively generate scenes for the multi-factor environment of the urban air traffic system, and its state characteristics cannot be extracted and integrated.
By obtaining the heterogeneous diagram of the urban air traffic system, using the meta-path sampling algorithm and heterogeneous diagram representation algorithm, key safety scenarios of the urban air traffic system are generated, including the node attributes and edge relationships of the route, communication base station and take-off and landing platform, and key scenarios are generated in combination with reinforcement learning.
It can effectively extract and integrate the state characteristics of the urban air traffic system, generate more rich and comprehensive safety key scenarios, break the limitations of existing algorithms, and provide feasible safety scenario generation methods for the complex urban air traffic system.
Smart Images

Figure CN120407858A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence and machine learning, and in particular to a method, device, storage medium and product for generating safety-critical scenarios. Background Art
[0002] Urban Air Mobility (UAM) refers to the efficient, safe, and convenient air transportation of people and goods within cities and their surrounding areas using new aircraft and related infrastructure. The UAM network is an emerging, complex super-system. Compared to the traditional civil aviation system, it features a significantly increased number of aircraft, more flexible route planning, a more complex operating environment, and significantly improved intelligence. Both physically and informationally, the UAM network involves real-time interaction between a large number of aircraft, traffic management systems, and communication equipment. At the same time, with the widespread application of emerging technologies such as autonomous drone flight and aerial communication networks, the components of the UAM system are constantly increasing, and the degree of internal interconnectedness is gradually increasing. This introduces many new uncertainties, which poses a potential safety risk to the UAM system due to potential failures. The physical processes of propagation and resolution are becoming increasingly complex, which also poses considerable difficulties in analyzing the mechanism, tracing the source, and managing the failures. The urban air traffic system safety key scenario generation method can be used to generate key scenarios involving emergencies, system failures, and environmental factors. Combining key scenarios with urban air traffic system safety assessment can analyze the impact and characteristics of the scenarios to form the fault propagation law, thereby providing a reference basis for the safety optimization of future urban air traffic.
[0003] While existing research on safety-critical scenario generation has made some progress, it still faces many challenges. For example, existing safety-critical scenario generation algorithms often only target independent test objects, such as autonomous vehicles and robots. However, due to the diverse nature of urban air traffic systems, which face varying external environments, existing methods are unable to effectively extract and integrate the state characteristics of urban air traffic systems. Consequently, current safety-critical scenario generation algorithms struggle to generate scenarios for these multi-element urban air traffic systems. Summary of the Invention
[0004] The purpose of this application is to provide a safety-critical scenario generation method, device, storage medium and product that can generate safety-critical scenarios for complex urban air traffic systems.
[0005] To achieve the above objectives, this application provides the following solutions:
[0006] In a first aspect, the present application provides a method for generating a safety-critical scenario, comprising:
[0007] Obtain the urban air traffic system at the current stage; the urban air traffic system includes multiple elements, namely air routes, communication base stations, and takeoff and landing platforms.
[0008] Process the urban air traffic system to obtain an urban air traffic heterogeneous graph; the node set in the urban air traffic heterogeneous graph includes: air route nodes, communication base station nodes, and takeoff and landing platform nodes; the edge set in the urban air traffic heterogeneous graph includes: edges established between a communication base station and the takeoff and landing platforms it serves, edges established between interconnected air routes, and edges established between a takeoff and landing platform and the air route it is connected to; the node attribute set in the urban air traffic heterogeneous graph includes air route node attributes, communication base station node attributes, and takeoff and landing platform node attributes.
[0009] Process the urban air traffic heterogeneous graph according to the meta-path sampling algorithm to obtain the meta-path sampling result corresponding to each node; the meta-path sampling result is a path constructed with a target node as the starting node; the target node is any node in the urban air traffic heterogeneous graph.
[0010] Process the node attributes of each node in the urban air traffic heterogeneous graph to obtain the state representation vector corresponding to each node.
[0011] Determine the heterogeneous graph representation vector of each node based on the meta-path sampling result according to the state representation vector and the meta-path sampling result corresponding to each node.
[0012] Input the heterogeneous graph representation vector of each node based on the meta-path sampling result into the safety-critical scenario generation model to obtain the safety-critical scenarios of the urban air traffic system.
[0013] In a second aspect, the present application provides a computer device, including: a memory, a processor, and a computer program stored on the memory and executable on the processor, and the processor executes the computer program to implement the steps of the safety-critical scenario generation method described in any one of the above.
[0014] In a third aspect, the present application provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the steps of the safety-critical scenario generation method described in any one of the above.
[0015] In a fourth aspect, the present application provides a computer program product, including a computer program, and when the computer program is executed by a processor, it implements the steps of the safety-critical scenario generation method described in any one of the above.
[0016] According to the specific embodiments provided by the present application, the present application discloses the following technical effects:
[0017] This application provides a method, device, storage medium, and product for generating safety-critical scenarios. First, obtain the connection relationships and attribute characteristics of various elements in the urban air traffic system at the current stage, and perform network abstraction on the information obtained at the current stage for the urban air traffic system. Secondly, based on the meta-path sampling technique, this application conducts targeted neighbor sampling on all nodes in the urban air traffic system to obtain the meta-path sampling results corresponding to each node. After completing the meta-path sampling, process the node attributes of each node in the heterogeneous graph of urban air traffic to obtain the state representation vector corresponding to each node. According to the state representation vector and meta-path sampling results corresponding to each node, determine the heterogeneous graph representation vector of each node based on the meta-path sampling results. Finally, use the heterogeneous graph representation vector as the state input for reinforcement learning to generate critical scenarios that cause the collapse of the functions of the urban air traffic system. In this way, this application can capture the diversity of node types and relationship types in the urban air traffic system, utilize the heterogeneous graph representation algorithm to mine the deep-seated association relationships between nodes, thereby effectively extracting and integrating the state characteristics of the system. The obtained heterogeneous graph representation vector can represent the nodes more richly and comprehensively, breaking the limitations of existing scenario generation algorithms and providing a feasible safety scenario generation method for the complex urban air traffic system. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] To more clearly illustrate the technical solutions in the embodiments of this application or in the prior art, the following will briefly introduce the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of this application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0019] Figure 1 It is an application environment diagram of a method for generating safety-critical scenarios in an embodiment of this application;
[0020] Figure 2 It is a flowchart of a method for generating safety-critical scenarios provided in an embodiment of this application;
[0021] Figure 3 It is a route network diagram of the urban air traffic system for a method for generating safety-critical scenarios provided in an embodiment of this application;
[0022] Figure 4 It is a network abstraction architecture diagram of the urban air traffic system for a method for generating safety-critical scenarios provided in an embodiment of this application;
[0023] Figure 5 It is a defined meta-path diagram of a method for generating safety-critical scenarios provided in an embodiment of this application;
[0024] Figure 6 A structural schematic diagram of a computer device provided in an embodiment of the present application. Specific embodiments
[0025] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying 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. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present application without creative efforts shall fall within the protection scope of the present application.
[0026] To make the above objects, features, and advantages of the present application more obvious and understandable, the present application will be further described in detail below with reference to the drawings and specific embodiments.
[0027] The security critical scenario generation method provided in the embodiments of the present application can be applied to, for example Figure 1 the application environment shown in the figure. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be set separately, integrated on the server 104, placed in the cloud or on other servers. The terminal 102 can send the current stage of the urban air traffic system to the server 104. The server 104 receives the current stage of the urban air traffic system. The server 104 processes the urban air traffic system to obtain an urban air traffic heterogeneous graph; processes the urban air traffic heterogeneous graph according to the meta-path sampling algorithm to obtain the meta-path sampling result corresponding to each node; processes the node attributes of each node in the urban air traffic heterogeneous graph to obtain the state representation vector corresponding to each node; determines the heterogeneous graph representation vector of each node based on the meta-path sampling result according to the state representation vector and the meta-path sampling result corresponding to each node; inputs the heterogeneous graph representation vector of each node based on the meta-path sampling result into the security critical scenario generation model to obtain the security critical scenario of the urban air traffic system. The server 104 can feedback the obtained security critical scenario of the urban air traffic system to the terminal 102. In addition, in some embodiments, the security critical scenario generation method can also be implemented by the server 104 or the terminal 102 alone. For example, the terminal 102 can directly process the current stage of the urban air traffic system to obtain the security critical scenario of the urban air traffic system, or the server 104 can obtain the current stage of the urban air traffic system from the data storage system and process the current stage of the urban air traffic system to obtain the security critical scenario of the urban air traffic system.
[0028] Among them, the terminal 102 can be, but is not limited to, various desktop computers, laptop computers, smart phones, tablet computers, Internet of Things devices, and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart in-vehicle devices, etc. The portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server 104 can be implemented by an independent server or a server cluster composed of multiple servers, and can also be a cloud server.
[0029] In an exemplary embodiment, as Figure 2 shown, a method for generating a security-critical scenario is provided. This method is executed by a computer device, and specifically can be executed alone by a computer device such as a terminal or a server, or can be jointly executed by a terminal and a server. In the embodiments of the present application, taking this method applied to Figure 1 the server 104 in it as an example for illustration, it includes the following steps 201 to step 206. Among them:
[0030] Step 201, obtain the urban air traffic system in the current stage; the urban air traffic system includes multiple elements, namely air routes, communication base stations, and takeoff and landing platforms.
[0031] Step 202, process the urban air traffic system to obtain an urban air traffic heterogeneous graph; the node set in the urban air traffic heterogeneous graph includes: air route nodes, communication base station nodes, and takeoff and landing platform nodes; the edge set in the urban air traffic heterogeneous graph includes: edges established between a communication base station and the takeoff and landing platform it serves, edges established between interconnected air routes, and edges established between a takeoff and landing platform and the air route it is connected to; the node attribute set in the urban air traffic heterogeneous graph includes air route node attributes, communication base station node attributes, and takeoff and landing platform node attributes.
[0032] Step 203, process the urban air traffic heterogeneous graph according to the meta-path sampling algorithm to obtain the meta-path sampling result corresponding to each node; the meta-path sampling result is a path constructed with the target node as the starting node; the target node is any node in the urban air traffic heterogeneous graph.
[0033] Step 204, process the node attributes of each node in the urban air traffic heterogeneous graph to obtain the state representation vector corresponding to each node.
[0034] Step 205, determine the heterogeneous graph representation vector of each node based on the meta-path sampling result according to the state representation vector and the meta-path sampling result corresponding to each node.
[0035] Step 206: Input the heterogeneous graph representation vectors of each node based on the meta-path sampling results into the safety-critical scenario generation model to obtain the safety-critical scenarios of the urban air traffic system.
[0036] By implementing the above Steps 201 to 206, the present application provides a method for generating safety-critical scenarios. First, obtain the connection relationships and attribute features of various elements in the urban air traffic system at the current stage, and perform network abstraction of the urban air traffic system on the information obtained at the current stage. Secondly, based on the meta-path sampling technique, the present application conducts targeted neighbor sampling on all nodes in the urban air traffic system to obtain the meta-path sampling results corresponding to each node. After completing the meta-path sampling, graph representation learning is carried out, and through heterogeneous node content representation, each node in the urban air traffic system forms a corresponding state representation vector. According to the state representation vector corresponding to each node and the meta-path sampling results, determine the heterogeneous graph representation vectors of each node based on the meta-path sampling results. Finally, use the heterogeneous graph representation vectors as the state input of reinforcement learning to generate critical scenarios that cause the collapse of the functions of the urban air traffic system. In this way, the present application can capture the diversity of node types and relationship types in the urban air traffic system, utilize the heterogeneous graph representation algorithm to mine the deep-seated association relationships between nodes, thereby effectively extracting and integrating the state features of the system. The obtained heterogeneous graph representation vectors can represent the nodes more richly and comprehensively, breaking the limitations of existing scenario generation algorithms, and providing a feasible safety scenario generation method for the complex urban air traffic system. Among them, the heterogeneous graph representation algorithm refers to an algorithm that uses machine learning or deep learning techniques to map a heterogeneous graph with different types of nodes and edges to the same-dimensional vector space to capture its structural information and semantic relationships.
[0037] In an exemplary embodiment, as Figure 3 shown, in Step 201, obtain the urban air traffic system at the current stage; the urban air traffic system includes multiple elements, namely air routes, communication base stations, and takeoff and landing platforms, and specifically includes:
[0038] Taking Figure 3 the air route network diagram of the urban air traffic system as an example, the green lines represent air routes, and aircraft can fly according to the predetermined routes; the red rectangles represent takeoff and landing platforms, and aircraft enter the air routes connected to them through the takeoff and landing platforms; the orange triangles represent communication platforms, which are used to transmit the situation information of the air routes they serve and are responsible for the communication of unmanned aircraft on the air routes they serve.
[0039] In an exemplary embodiment, as Figure 4As shown, in step 202, the urban air traffic system is processed to obtain an heterogeneous graph of urban air traffic; the node set in the heterogeneous graph of urban air traffic includes: airway nodes, communication base station nodes, and takeoff and landing platform nodes; the edge set in the heterogeneous graph of urban air traffic includes: edges established between a communication base station and the takeoff and landing platform it serves, edges established between interconnected airways, and edges established between a takeoff and landing platform and the airway it is connected to; the node attribute set in the heterogeneous graph of urban air traffic includes airway node attributes, communication base station node attributes, and takeoff and landing platform node attributes, specifically including:
[0040] Determine the node set in the heterogeneous graph of urban air traffic and the edge set in the heterogeneous graph of urban air traffic according to the urban air traffic system at the current stage obtained in step 201.
[0041] The node set in the heterogeneous graph of urban air traffic is the elements in the urban air traffic system, namely airways, communication base stations, and takeoff and landing platforms.
[0042] The edge set in the heterogeneous graph of urban air traffic is obtained according to the following rules:
[0043] 1. An edge is established between a communication base station and the takeoff and landing platform it serves, that is, if a communication base station provides communication services for a certain takeoff and landing platform, then an edge is added in the graph from this communication base station to this takeoff and landing platform.
[0044] 2. An edge is established between interconnected airways, that is, if two airways are directly connected, then an edge representing the connectivity between these two airways is added in the graph.
[0045] 3. An edge is established between a takeoff and landing platform and the airway it is connected to, that is, if a takeoff and landing platform is connected to a certain airway, then an edge is added in the graph from this takeoff and landing platform to this airway.
[0046] Establish a network abstraction architecture diagram of the urban air traffic system as Figure 4 shown according to the node set in the heterogeneous graph of urban air traffic and the edge set in the heterogeneous graph of urban air traffic.
[0047] In an exemplary embodiment, as Figure 5 shown, in step 203, the heterogeneous graph of urban air traffic is processed according to the meta-path sampling algorithm to obtain the meta-path sampling result corresponding to each node; the meta-path sampling result is a path constructed with the target node as the starting node; the target node is any node in the heterogeneous graph of urban air traffic, specifically including:
[0048] Define meta-paths according to the heterogeneous graph of urban air traffic and prior knowledge, specifically:
[0049] Define the basic information of the meta-path. The basic information of the meta-path includes node types and the connection patterns between two adjacent nodes. The expression of the meta-path is as follows:
[0050]
[0051] In the formula, A i is the i-th node type of the urban air traffic system, where i = 1, 2, 3....i + 1; Rx represents the connection pattern between the i-th node and the (i + 1)-th node, and x = 1, 2....l.
[0052] The number of the meta-paths is one or more.
[0053] After completing the step of defining the meta-path, perform the following operations on each node in the heterogeneous graph of urban air traffic:
[0054] Use the meta-path to sample the neighbors of the target node to obtain the meta-path sampling result corresponding to the target node. The steps are as follows:
[0055] Start from the target node v s and select the next node v n that meets the requirements of the meta-path as:
[0056] v n = sample(N(v c ), A i+1 ).
[0057] Among them, v c is the current node; the current node is the target node or a node that meets the requirements of the meta-path. N(v c ) is the set of adjacent nodes of the current node v c , and A i+1 is the type of the next node to be sampled; sample is a sampling algorithm that meets the sampling rules. The sampling rules are: select the neighbor nodes that meet the requirements of the next node type in the meta-path from the set of adjacent nodes of the current node.
[0058] Set the length of the meta-path to k; set the maximum number of times a single node can be sampled to b.
[0059] Repeat sampling until k nodes including the target node are obtained. The meta-path composed of the k nodes including the target node is the meta-path of the target node.
[0060] When the number of meta-paths is one, the meta-path of the target node is the meta-path sampling result corresponding to the target node.
[0061] When the number of meta - paths is multiple, according to the node type of the target node, filter the meta - paths in which the node type is suitable for the target node, and use the filtered meta - paths to sample the target node respectively to obtain multiple meta - paths of the target node. The set of all meta - paths of the target node constitutes the meta - path sampling result corresponding to the target node.
[0062] Specifically, taking Figure 5 the defined meta - path graph as an example, four meta - paths are set for the urban air traffic system, namely: Meta - path A: airway - take - off and landing platform - airway, Meta - path B: take - off and landing platform - communication base station - communication base station, C: airway - airway - airway, D: communication base station - airway - airway. Among them, the take - off and landing platform is abbreviated as platform; the communication base station is abbreviated as base station. The airway - take - off and landing platform - airway is used to excavate the airway situation entering and leaving the take - off and landing platform; the take - off and landing platform - communication base station - communication base station is used to excavate the area situation that requires safety decision - making; the airway - airway - airway is used to excavate the airway conditions connected to the target airway; the communication base station - airway - airway is used to excavate the airway served by the base station and the airway conditions around the airway.
[0063] In an exemplary embodiment, step 204, processing the node attributes of each node in the urban air traffic heterogeneous graph to obtain the state representation vector corresponding to each node, specifically includes:
[0064] The airway node attributes include average flight speed, airway traffic flow, average distance between aircraft on the airway, maximum flyable speed, total traffic flow of the airway segment, airway node type identifier, and airway node degree; the communication base station node attributes include the number of communication device accesses, information packet loss rate, average distance between aircraft on the served airway, degree of the served airway, traffic flow situation of the served airway, working status of the served take - off and landing platform, and node type identifier of the served take - off and landing platform; the take - off and landing platform node attributes include the number of completed orders, the number of remaining orders, the number of remaining aircraft, and the number of connected communication base stations.
[0065] The specific meanings of the above attributes are as follows:
[0066] Average flight speed: represents the average value of the flight speeds of all aircraft on the airway at the current moment. If there are no aircraft on this airway segment at the current moment, the average speed is the maximum flight speed specified for this airway.
[0067] Airway traffic flow: represents the total number of aircraft flying on this airway at the current moment.
[0068] Average distance between aircraft on the airway: represents the average flight interval of all aircraft on the airway at the current moment. If there are no aircraft on this airway segment at the current moment, the average distance is the length of this airway segment.
[0069] Maximum flight speed: It represents the maximum flight speed permitted according to the route situation at the current moment of the route. The speeds of all aircraft flying on this route segment cannot exceed the maximum flight speed.
[0070] Total traffic volume of the route segment: It represents the total number of aircraft passing through this route from the start of the simulation to the current moment.
[0071] Route node type identifier: It is used to distinguish different node attributes.
[0072] Degree of the route node: It is used to represent the connectivity of this route with other routes.
[0073] Number of communication device accesses: It represents the total number of aircraft served by the communication base station at the current moment.
[0074] Packet loss rate of information: It represents the data transmission situation of the currently served aircraft.
[0075] Average spacing of aircraft on the service route, degree of the service route, and traffic volume situation of the service route: They are used to represent the situation of the service route.
[0076] Working status of the service takeoff and landing platform: It represents whether the function of issuing instructions to the takeoff and landing platform served by the communication base station is normal.
[0077] Route node type identifier of the service takeoff and landing platform: It is used to distinguish different node attributes.
[0078] Number of completed orders: It represents the number of orders completed by this takeoff and landing platform from the start of the simulation to the current moment.
[0079] Number of remaining orders: It represents the number of remaining uncompleted orders of this takeoff and landing platform.
[0080] Number of remaining aircraft: It represents the number of available aircraft in the takeoff and landing platform at the current moment.
[0081] Number of connected communication base stations: It represents the number of communication base stations through which the takeoff and landing platform can issue safety scheduling instructions at the current moment.
[0082] Perform data partitioning on the attributes of the route nodes, the attributes of the communication base station nodes, and the attributes of the takeoff and landing platform nodes to obtain a first data set, a second data set, and a third data set; the first data set includes: the maximum flyable speed, the route node type identifier, the working status of the served takeoff and landing platform, and the node type identifier of the served takeoff and landing platform; the second data set includes: the average flight speed, the average spacing between aircraft on the route, the total traffic volume of the route segment, the route node degree, the number of communication device accesses, the information packet loss rate, the average spacing between aircraft on the served airway, the degree of the served airway, the traffic condition of the served airway, the remaining order quantity, the remaining number of aircraft, and the number of connected communication base stations; the third data set includes: the route traffic volume and the number of completed orders.
[0083] Preprocess the data in the first data set, the second data set, and the third data set respectively to obtain the preprocessed first data set, second data set, and third data set.
[0084] According to the node attributes, re-partition the preprocessed first data set, second data set, and third data set to obtain the preprocessed route node attributes, the preprocessed communication base station node attributes, and the preprocessed takeoff and landing platform node attributes.
[0085] Combine the numerical values in the preprocessed route node attributes, the preprocessed communication base station node attributes, and the preprocessed takeoff and landing platform node attributes respectively to obtain a long vector of route nodes, a long vector of communication base station nodes, and a long vector of takeoff and landing platform nodes.
[0086] Input the long vector of route nodes, the long vector of communication base station nodes, and the long vector of takeoff and landing platform nodes into a multi-layer perceptron for vector representation respectively to obtain the state representation vector of the route nodes, the state representation vector of the communication base station nodes, and the state representation vector of the takeoff and landing platform nodes.
[0087] In an exemplary embodiment, in step 204, preprocessing the data in the first data set, the second data set, and the third data set respectively to obtain the preprocessed first data set, second data set, and third data set specifically includes:
[0088] Process the data in the first data set using one-hot encoding to obtain the preprocessed first data set; the data in the preprocessed first data set is in the form of a sparse vector of 0s and 1s.
[0089] Process the data in the second data set using maximum-minimum normalization to obtain the preprocessed second data set; the data in the preprocessed second data set is normalized attribute data.
[0090] Process the data in the third data set by using maximum-minimum normalization after differential operation to obtain the preprocessed third data set; the data in the preprocessed third data set are normalized attribute data.
[0091] In an exemplary embodiment, step 205 of determining, according to the state representation vector corresponding to each node and the meta-path sampling result, the heterogeneous graph representation vector of each node based on the meta-path sampling result specifically includes:
[0092] Perform a first operation on each node to obtain the heterogeneous graph representation vector of each node based on the meta-path sampling result.
[0093] The first operation is:
[0094] Perform a second operation on each meta-path corresponding to the target node to obtain the state representation vector of each meta-path corresponding to the target node.
[0095] Aggregate the state representation vectors of each meta-path corresponding to the target node to obtain the heterogeneous graph representation vector of the target node based on the meta-path sampling result.
[0096] The second operation is:
[0097] Aggregate the state representation vectors of all nodes in the target meta-path of the target node to obtain the state representation vector of the target meta-path of the target node; the target meta-path is any meta-path corresponding to the target node.
[0098] In an exemplary embodiment, in step 205, the aggregating the state representation vectors of all nodes in the target meta-path of the target node to obtain the state representation vector of the target meta-path of the target node, and the aggregating the state representation vectors of each meta-path corresponding to the target node to obtain the heterogeneous graph representation vector of the target node based on the meta-path sampling result specifically include:
[0099] The specific steps of aggregating the state representation vectors of all nodes in the target meta-path of the target node to obtain the state representation vector of the target meta-path of the target node are as follows:
[0100] Define the set of other nodes except the target node in any one meta-path in the meta-path sampling result as the remaining nodes, given the attribute representation vector q of the target node and the set of attribute representation vectors of the remaining nodes C = {C1, C2,..., C n}, and through W q , W k , W v perform a linear transformation to project the vector q and the vector set C into the query space, key space, and value space respectively:
[0101] Q1 = W q ·q, K1 = W k ·C, V1 = W v ·C;
[0102] Wherein, Q1 is the query vector, K1 is the key vector, and V1 is the value vector; W q is the query weight matrix, W k is the key weight matrix, W v is the value weight matrix.
[0103] Calculate the dot product of the main vector and the secondary vector to obtain the attention score att_scores1:
[0104] att_scores1 = Q1 · K1 T .
[0105] Wherein, K1 T is the transpose of K1.
[0106] Use the softmax function to normalize the attention score to obtain the attention weight:
[0107] α i = softmax(att_scroes1).
[0108] Among them, α i represents the attention score of the i-th node.
[0109] Use the attention weight to calculate the representation vector q of the new target node meta-path n :
[0110] q n = Q1 + ∑ i α i V i .
[0111] Among them, V i is the state representation vector of the i-th node in the value space; then, through the linear layer W O transform the representation vector of the target node meta-path to obtain the state representation vector q of the target meta-path of the target node m :
[0112] q m = W O ·q n .
[0113] Aggregate the state representation vectors of each meta-path corresponding to the target node to obtain the heterogeneous graph representation vector of the target node based on the meta-path sampling result. The specific steps are as follows:
[0114] Step 1: Put each meta-path corresponding to the target node into the first set.
[0115] Step 2: Select a meta-path, traverse all meta-paths, and put the meta-paths of the same type as the selected meta-path in the first set into the second set.
[0116] Step 3: If the first set is empty, perform the first processing method on the second set to obtain a homogeneous aggregation representation vector, and use the homogeneous aggregation representation vector as the heterogeneous graph representation vector of the target node based on the meta-path sampling result; if the first set is not empty, then jump to Step 4.
[0117] Step 4: Repeat Step 2 until the first set is empty, and at least obtain the second set and the third set; perform the first processing method on the obtained second set and third set respectively to obtain the heterogeneous graph representation vectors of the second set and the third set; perform the second processing method on the heterogeneous graph representation vectors of the second set and the third set to obtain a heterogeneous aggregation representation vector, and use the heterogeneous aggregation representation vector as the heterogeneous graph representation vector of the target node based on the meta-path sampling result.
[0118] Among them, the first processing method is:
[0119] Calculate the average value of the state representation vectors of each meta-path of the target node to balance the feature differences between different paths:
[0120] For the homogeneous aggregation representation vector F of the i-th type of meta-path of the target node q i The calculation method is as follows:
[0121]
[0122] where q m,i is the representation vector of the m-th meta-path of type i of node q, and n is the sampling number of the i-th type of meta-path of the target node.
[0123] Among them, the second processing method is:
[0124] Use the attention mechanism to dynamically adjust the contribution weights of different types of meta-paths to the final aggregation representation:
[0125] For each node, select the representation vector of the i-th type of meta-path with the largest sampling number as the main vector F j , and the representation vectors of the meta-paths of the remaining categories as the set of slave vectors D = {D1, D2,..., D n}, where the meta-paths of the remaining categories are all the meta-paths of the same type after the meta-path sampling results of the target node are aggregated by the same type of meta-path, except for the i-th type of meta-path with the largest sampling number. Through W q , Wk , W v performs a linear transformation to project F j and set D into the query space, key space, and value space respectively:
[0126] Q2 = W q ·F j , K2 = W k ·D, V2 = W v ·D;
[0127] In the formula, Q2 is the query vector, K2 is the key vector, and V2 is the value vector; W q is the query weight matrix, W k is the key weight matrix, W v is the value weight matrix.
[0128] Calculate the dot product of the main vector and the slave vector to obtain the attention score att_scores2:
[0129] att_scores2 = Q2 · K2 T .
[0130] In the formula, K2 T is the transpose of K2.
[0131] Normalize the attention score through the softmax function to obtain the attention weight:
[0132] α j = softmax(att_scroes2).
[0133] Among them, α j represents the attention score of the i-th type of meta-path.
[0134] Use the attention weight to calculate the content aggregation vector q o between different types of meta-paths:
[0135] q o = Q2 + ∑ i α j V i .
[0136] Among them, V i is the representation vector of the i-th type of meta-path in the value space.
[0137] Transform the aggregation vector through the linear layer W O to obtain the heterogeneous aggregation representation vector q p of the target node:
[0138] q p = W O ·q o .
[0139] That is to say, if there is only the same type of meta-path in the target meta-path of the target node, the homogeneous aggregation representation vector is used as the heterogeneous graph representation vector of the target node based on the meta-path sampling result. If there are different types of meta-paths in the target meta-path of the target node, the heterogeneous aggregation representation vector is used as the heterogeneous graph representation vector of the target node based on the meta-path sampling result.
[0140] In an exemplary embodiment, step 206, inputting the heterogeneous graph representation vector of each node based on the meta-path sampling result into the safety-critical scenario generation model to obtain the safety-critical scenario of the urban air traffic system, specifically includes:
[0141] The safety-critical scenario generation model is trained and generated based on the proximal policy optimization algorithm.
[0142] In an exemplary embodiment, a computer device is provided. The computer device can be a server or a terminal, and its internal structure diagram can be as Figure 6 shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, abbreviated as I / O), and a communication interface. Among them, the processor, the memory, and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store safety-critical scenario data. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with external terminals through a network connection. When the computer program is executed by the processor, it implements a safety-critical scenario generation method.
[0143] Those skilled in the art can understand that Figure 6 the structure shown in
[0144] In an exemplary embodiment, a computer device is further provided, including a memory and a processor. A computer program is stored in the memory, and when the processor executes the computer program, it implements the steps in the above method embodiments.
[0145] In an exemplary embodiment, a computer-readable storage medium is provided, storing a computer program, and when the computer program is executed by a processor, the steps in the above method embodiments are implemented.
[0146] In an exemplary embodiment, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps in the above method embodiments are implemented.
[0147] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use, and processing of relevant data need to comply with relevant regulations.
[0148] Those of ordinary skill in the art can understand that all or part of the processes of implementing the above method embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the above method embodiments. Among them, any reference to a memory, database, or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memories. Non-volatile memories can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memories can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc.
[0149] In each of the embodiments provided in this application, the database involved may include at least one of a relational database and a non-relational database. The non-relational database may include a distributed database based on blockchain, etc., without limitation. In each of the embodiments provided in this application, the processor may be a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., without limitation.
[0150] The technical features of the above embodiments can be combined arbitrarily. For the sake of concise description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope described in this specification.
[0151] In this article, specific examples are used to elaborate on the principle and implementation manner of this application. The description of the above embodiments is only used to help understand the method and its core idea of this application; at the same time, for those of ordinary skill in the art, according to the idea of this application, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to this application.
Claims
1. A method for generating safety-critical scenarios, characterized in that, The security-critical scenario generation method includes: Obtain the urban air traffic system at the current stage; the urban air traffic system includes multiple elements, namely air routes, communication base stations, and takeoff and landing platforms; Process the urban air traffic system to obtain an urban air traffic heterogeneous graph; the node set in the urban air traffic heterogeneous graph includes: air route nodes, communication base station nodes, and takeoff and landing platform nodes; the edge set in the urban air traffic heterogeneous graph includes: edges established between a communication base station and the takeoff and landing platforms it serves, edges established between interconnected air routes, and edges established between a takeoff and landing platform and the air route it is connected to; the node attribute set in the urban air traffic heterogeneous graph includes air route node attributes, communication base station node attributes, and takeoff and landing platform node attributes; Process the urban air traffic heterogeneous graph according to the meta-path sampling algorithm to obtain the meta-path sampling result corresponding to each node; the meta-path sampling result is a path constructed with a target node as the starting node; the target node is any node in the urban air traffic heterogeneous graph; Process the node attributes of each node in the urban air traffic heterogeneous graph to obtain the state representation vector corresponding to each node; Determine the heterogeneous graph representation vector of each node based on the meta-path sampling result according to the state representation vector and the meta-path sampling result corresponding to each node; Input the heterogeneous graph representation vector of each node based on the meta-path sampling result into the security-critical scenario generation model to obtain the security-critical scenario of the urban air traffic system.
2. The method for generating security-critical scenarios according to claim 1, wherein, It further includes: Judge whether it is necessary to obtain the security-critical scenario of the urban air traffic system in the next stage to obtain a first judgment result; If the first judgment result indicates that it is necessary to obtain the security-critical scenario of the urban air traffic system in the next stage, then obtain the urban air traffic system in the next stage, and update the urban air traffic system in the step of processing the urban air traffic system to obtain the urban air traffic heterogeneous graph to the urban air traffic system in the next stage, and return to the step of processing the urban air traffic system to obtain the urban air traffic heterogeneous graph, so as to obtain the security-critical scenario of the urban air traffic system in the next stage.
3. The method for generating security-critical scenarios according to claim 1, wherein Processing the urban air traffic heterogeneous graph according to the meta-path sampling algorithm to obtain the meta-path sampling result corresponding to each node specifically includes: Define meta-paths according to the urban air traffic heterogeneous graph and prior knowledge, specifically: Define the basic information of the meta-path, and the basic information of the meta-path includes node types and the connection mode of two adjacent nodes; the expression of the meta-path is as follows: where A i is the i-th node type of the urban air traffic system, i = 1, 2, 3....i + 1; R x represents the connection mode between the i-th node and the (i + 1)-th node, x = 1, 2....l; The number of the meta-paths is one or more; After completing the step of defining the meta-path, perform the following operations on each node in the urban air traffic heterogeneous graph: Use the meta-path to sample the neighbors of the target node to obtain the meta-path sampling result corresponding to the target node, and the steps are as follows: Starting from the target node v s begin, select the next node v that meets the requirements of the meta-path n as follows: v n = sample(N(v c ), A i+1 ); Among them, v c is the current node; the current node is the target node or a node that meets the requirements of the meta-path, N(v c ) is the set of adjacent nodes of the current node v c , A i+1 is the type of the next node to be sampled; sample is a sampling algorithm that conforms to the sampling rule, and the sampling rule is: select the neighbor nodes that meet the requirements of the next node type in the meta-path from the set of adjacent nodes of the current node; Repeat sampling until k nodes including the target node are obtained, and the meta-path composed of the k nodes including the target node is the meta-path of the target node; When the number of meta-paths is one, the meta-path of the target node is the meta-path sampling result corresponding to the target node; When the number of meta-paths is multiple, according to the node type of the target node, filter the meta-paths in the meta-paths that are suitable for the node type of the target node, and use the filtered meta-paths to sample the target node respectively to obtain multiple meta-paths of the target node. The set of all meta-paths of the target node constitutes the meta-path sampling result corresponding to the target node.
4. The method for generating security-critical scenarios according to claim 1, wherein The attributes of the airway node include average flight speed, airway traffic flow, average spacing between aircraft on the airway, maximum flyable speed, total traffic flow of the airway segment, airway node type identifier, and airway node degree; the attributes of the communication base station node include the number of communication device accesses, information packet loss rate, average spacing of aircraft on the served airway, degree of the served airway, traffic flow situation of the served airway, working status of the served landing platform, and node type identifier of the served landing platform; the attributes of the landing platform node include the number of completed orders, the number of remaining orders, the number of remaining aircraft, and the number of connected communication base stations; Process the node attributes of each node in the urban air traffic heterogeneous graph to obtain the state representation vector corresponding to each node, specifically including: Perform data partitioning on the airway node attributes, the communication base station node attributes, and the landing platform node attributes to obtain a first data set, a second data set, and a third data set; the first data set includes: maximum flyable speed, airway node type identifier, working status of the served landing platform, node type identifier of the served landing platform; the second data set includes: average flight speed, average spacing between aircraft on the airway, total traffic flow of the airway segment, airway node degree, number of communication device accesses, information packet loss rate, average spacing of aircraft on the served airway, degree of the served airway, traffic flow situation of the served airway, number of remaining orders, number of remaining aircraft, number of connected communication base stations; the third data set includes: airway traffic flow, number of completed orders; Perform preprocessing on the data in the first data set, the second data set, and the third data set respectively to obtain the preprocessed first data set, the second data set, and the third data set; According to the node attributes, re-partition the preprocessed first data set, the second data set, and the third data set to obtain the preprocessed airway node attributes, the preprocessed communication base station node attributes, and the preprocessed landing platform node attributes; Combine the values in the preprocessed airway node attributes, the preprocessed communication base station node attributes, and the preprocessed landing platform node attributes respectively to obtain the airway node long vector, the communication base station node long vector, and the landing platform node long vector; Input the airway node long vector, the communication base station node long vector, and the landing platform node long vector into a multi-layer perceptron for vector representation respectively to obtain the state representation vector of the airway node, the state representation vector of the communication base station node, and the state representation vector of the landing platform node.
5. The method for generating a security-critical scenario according to claim 4, wherein Preprocess the data in the first data set, the second data set, and the third data set respectively to obtain the preprocessed first data set, second data set, and third data set, which specifically includes: Process the data in the first data set using one-hot encoding to obtain the preprocessed first data set; the data in the preprocessed first data set is in the form of a sparse vector of 0s and 1s; Process the data in the second data set using min-max normalization to obtain the preprocessed second data set; the data in the preprocessed second data set is normalized attribute data; Process the data in the third data set using difference operation followed by min-max normalization to obtain the preprocessed third data set; the data in the preprocessed third data set is normalized attribute data.
6. The method for generating security-critical scenarios according to claim 1, wherein Determine the heterogeneous graph representation vector of each node based on the meta-path sampling result according to the state representation vector corresponding to each node and the meta-path sampling result corresponding to each node, which specifically includes: Execute a first operation for each node to obtain the heterogeneous graph representation vector of each node based on the meta-path sampling result; The first operation is: Execute a second operation for each meta-path corresponding to the target node to obtain the state representation vector of each meta-path corresponding to the target node; Aggregate the state representation vectors of each meta-path corresponding to the target node to obtain the heterogeneous graph representation vector of the target node based on the meta-path sampling result; The second operation is: Aggregate the state representation vectors of all nodes in the target meta-path of the target node to obtain the state representation vector of the target meta-path of the target node; the target meta-path is any meta-path corresponding to the target node.
7. The method for generating a security-critical scenario according to claim 6, wherein The aggregation of the state representation vectors of all nodes in the target meta-path of the target node to obtain the state representation vector of the target meta-path of the target node, and the aggregation of the state representation vectors of each meta-path corresponding to the target node to obtain the heterogeneous graph representation vector of the target node based on the meta-path sampling result specifically includes: The steps for aggregating the state representation vectors of all nodes in the target meta-path of the target node to obtain the state representation vector of the target meta-path of the target node are as follows: Define the set of nodes other than the target node in any one of the meta-path sampling results as the remaining nodes. Given the attribute representation vector q of the target node and the set of attribute representation vectors of the remaining nodes C = {C1, C2,..., C n}, through W q , W k , W v perform a linear transformation to project the vector q and the vector set C into the query space, key space, and value space respectively: Q1 = W q ·q, K1 = W k ·C, V1 = W v ·C; Wherein, Q1 is a query vector, K1 is a key vector, and V1 is a value vector; W q is a query weight matrix, W k is a key weight matrix, W v is a value weight matrix; Calculate the dot product of the main vector and the slave vector to obtain the attention score att_scores1: att_scores1 = Q1 · K1 T ; where K1 T is the transpose of K1; Normalize the attention score using the softmax function to obtain the attention weight: α i = softmax(att_scroes1); where α i represents the attention score of the i-th node; Calculate the representation vector q of the new target node meta-path using attention weights n : q n = Q1 + ∑ i α i V i ; Among which V i is the state representation vector of the i-th node in the value space; then, through the linear layer W O transforms the representation vector of the target node's meta-path to obtain the state representation vector q of the target meta-path of the target node m : q m = W O ·q n ; The steps for aggregating the state representation vectors of each meta-path corresponding to the target node to obtain the heterogeneous graph representation vector of the target node based on the meta-path sampling result are as follows: Step 1: Put each meta-path corresponding to the target node into the first set; Step 2: Select a meta-path, traverse all meta-paths, and put the meta-paths of the same type as the selected meta-path in the first set into the second set; Step 3: If the first set is empty, perform a first processing method on the second set to obtain a homogeneous aggregation representation vector, and use the homogeneous aggregation representation vector as the heterogeneous graph representation vector of the target node based on the meta-path sampling result; if the first set is not empty, jump to step 4; Step 4: Repeat Step 2 until the first set is empty, and at least obtain the second set and the third set; perform the first processing method on the obtained second set and third set respectively to obtain the heterogeneous graph feature vectors of the second set and the heterogeneous graph feature vectors of the third set; perform the second processing method on the heterogeneous graph feature vectors of the second set and the heterogeneous graph feature vectors of the third set to obtain the heterogeneous aggregation feature vectors, and use the heterogeneous aggregation feature vectors as the heterogeneous graph feature vectors of the target node based on the meta-path sampling results; Among them, the first processing method is: Calculate the average value of the state feature vectors of each meta-path of the target node to balance the feature differences between different paths: The homogeneous aggregation representation vector F of the i-th type of meta-path for the target node q i The calculation method is as follows: where q m,i is the meta-path representation vector of the m-th meta-path of type i for node q, and n is the sampling number of the i-th type of meta-path of the target node; Among them, the second processing method is: Use the attention mechanism to dynamically adjust the contribution weights of different types of meta-paths to the final aggregation representation: Select the eigenvector of the \(i\)-th meta-path representation vector with the largest sampling number for each node as the main vector \(F\). j , and the representation vectors of the remaining category meta-paths are used as the slave vector set \(D=\{D_1, D_2, \cdots, D\}\). n The remaining category meta-paths are all other types of the same meta-paths except the \(i\)-th meta-path with the largest sampling number after aggregating the meta-path sampling results of the target node through the same meta-path. Through \(W\). q , \(W\). k , \(W\). v Perform a linear transformation to project \(F\). j and the set \(D\) into the query space, key space, and value space respectively: Q2 = W q ·F j , K2 = W k ·D, V2 = W v ·D; where Q2 is the query vector, K2 is the key vector, and V2 is the value vector; W q is the query weight matrix, W k is the key weight matrix, W v is the value weight matrix; Calculate the dot product of the main vector and the slave vector to obtain the attention score att_scores2: att_scores2 = Q2 · K2 T ; where K2 T is the transpose of K2; Normalize the attention score through the softmax function to obtain the attention weight: α j = softmax(att_scroes2); where α j represents the attention score of the i-th type of meta-path; Calculate the content aggregation vector q between different types of metapaths using attention weights o : q o = Q2 + ∑ i α j V i ; Among which V i is the representation vector of the i-th type of meta-path in the value space; Transform the aggregated vector through the linear layer W O to obtain the heterogeneous aggregation representation vector q of the target node p : q p = W O ·q o .
8. A computer device, comprising: A memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor executes the computer program to implement the security-critical scenario generation method according to any one of claims 1-7.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the security-critical scenario generation method according to any one of claims 1-7.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the security-critical scenario generation method according to any one of claims 1-7.