Dangerous article risk detection method, device, equipment, medium and program product

By constructing a graph structure and applying a graph diffusion algorithm for feature enhancement, and combining anomaly prediction model for risk detection of dangerous goods, the problem of low accuracy in traditional detection methods is solved, and more accurate abnormal risk identification is achieved.

CN120145246AActive Publication Date: 2025-06-13SHENZHEN ACAD OF INSPECTION & QUARANTINE +1

Patent Information

Application Number
CN202510201831.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-21
Publication Date
2025-06-13
Estimated Expiration
2045-02-21

AI Technical Summary

Technical Problem

The traditional method of detecting abnormal risks in the import and export of dangerous goods is relatively simple, and it is impossible to deal with complex interactive relationships, resulting in low identification accuracy and difficulty in accurately identifying abnormal risks.

Method used

By constructing a graph structure based on interactive behavior data, a graph diffusion algorithm is used to enhance features, risk detection is performed in combination with a pre-trained anomaly prediction model, and risk warning is performed when abnormal risks are detected.

Benefits of technology

It improves the accuracy of identifying abnormal situations during the import and export of dangerous goods, can more accurately identify abnormal risks, and enhances the reliability of import and export risk management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120145246A_ABST
    Figure CN120145246A_ABST
Patent Text Reader

Abstract

The invention provides a dangerous goods risk detection method and device, equipment, a medium and a program product, and the method comprises the steps: constructing a graph structure according to the interaction behavior data generated in the import and export process of dangerous goods, and obtaining an original structure graph of the dangerous goods in an import and export scene; performing feature enhancement processing on the original structure diagram based on a diagram diffusion algorithm to obtain a feature-enhanced high-order structure diagram; and based on the original structure chart and the high-order structure chart, adopting a pre-trained anomaly prediction model to detect the abnormal risk of the dangerous goods in the import and export process, and performing risk early warning when the abnormal risk of the dangerous goods in the import and export process is detected. According to the embodiment, the complex interaction mode of the dangerous goods and the interaction participants in the entrance and exit process can be comprehensively described through the static graph structure and the high-order structure graph, the accuracy of abnormal condition recognition in the entrance and exit process of the dangerous goods is improved, and therefore the abnormal risk in the entrance and exit process of the dangerous goods can be accurately recognized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular, to a method, device, equipment, medium and program product for detecting risks of dangerous goods. Background Art

[0002] With the increasing types of dangerous goods such as dangerous chemicals and the growing number of global import and export ports, the interaction relationships between dangerous goods and various trading parties and ports have become more complex and diverse. Normal import and export activities usually follow certain rules and are carried out at certain specific ports. If there are some behavioral changes that deviate from the rules during the import and export process of dangerous goods, there may be potential abnormal risks, posing certain safety hazards to the supervision system and the social environment. Therefore, it is crucial to detect abnormal risks during the import and export process of dangerous goods.

[0003] Traditional methods for detecting abnormal risks in import and export usually identify abnormal behaviors in the process of importing and exporting dangerous goods based on relevant supervision rules or behavioral patterns obtained through simple statistical analysis, and give risk warnings when abnormal behaviors are identified. However, such methods for detecting abnormal risks are relatively simple, unable to cope with the increasingly complex import and export interaction relationships, and the accuracy of identifying abnormal behaviors is relatively low, making it difficult to accurately identify abnormal risks during the import and export process of dangerous goods. Summary of the Invention

[0004] The present invention provides a method, device, equipment, medium and program product for detecting risks of dangerous goods to solve the problems that the method for detecting abnormal risks is relatively simple, the accuracy of identifying abnormal behaviors is relatively low, and it is difficult to accurately identify abnormal risks during the import and export process of dangerous goods.

[0005] In a first aspect, an embodiment of the present application provides a method for detecting risks of dangerous goods, including:

[0006] Construct a graph structure based on the interaction behavior data generated during the import and export process of dangerous goods to obtain an original structure graph of the dangerous goods in the import and export scenario. The nodes of the original structure graph include the dangerous goods and the interaction participants during the import and export process of the dangerous goods, and the edges of the original structure graph are the interaction behavior data between the nodes;

[0007] Perform feature enhancement processing on the original structure graph based on the graph diffusion algorithm to obtain a high-order structure graph with enhanced features. The nodes in the high-order structure graph are the same as the nodes in the original structure graph, and the node relationships in the high-order structure graph are different from the node relationships in the original structure graph;

[0008] Based on the original structure diagram and the high-order structure diagram, an anomaly prediction model trained in advance is used to detect the anomaly risk of dangerous goods during the import and export process. The anomaly prediction model is a neural network model obtained by deep learning training using multiple historical interaction behavior data of the same type of dangerous goods during the import and export process;

[0009] When an anomaly risk of dangerous goods is detected during the import and export process, a risk warning is issued.

[0010] Optionally, based on the graph diffusion algorithm, the original structure diagram is subjected to feature enhancement processing to obtain a high-order structure diagram after feature enhancement, including:

[0011] The graph diffusion algorithm is used to perform graph diffusion on the node relationships of the original structure diagram to obtain the diffusion matrix of the original structure diagram;

[0012] The nearest neighbor algorithm is used to construct a graph based on node similarity for the original structure diagram to obtain the target feature graph;

[0013] According to the diffusion matrix and the target feature graph, the original structure diagram is subjected to graph feature enhancement to obtain a high-order structure diagram.

[0014] Optionally, based on the original structure diagram and the high-order structure diagram, an anomaly prediction model trained in advance is used to detect the anomaly risk of dangerous goods during the import and export process, including:

[0015] The original structure diagram and the high-order structure diagram are input into the anomaly prediction model. Through the contrast learning network, the original structure diagram and the high-order structure diagram are subjected to contrast learning, and based on the vector output data of the contrast learning network, the anomaly detection network is used to perform anomaly detection on multiple nodes to obtain the risk scores of multiple nodes;

[0016] According to the risk scores of multiple nodes, the anomaly risk of dangerous goods during the import and export process is detected;

[0017] When a risk node with a risk score greater than a preset threshold is detected among multiple nodes, it is determined that there is an anomaly risk of dangerous goods during the import and export process.

[0018] Optionally, the anomaly prediction model is trained in the following manner:

[0019] Graph structures are respectively constructed for multiple historical interaction behavior data to obtain historical original graphs of multiple historical interaction behavior data, and feature enhancement processing is respectively performed on each historical original graph to obtain historical high-order graphs of multiple historical original graphs;

[0020] Using the historical original graph and the corresponding historical high-order graph as a training sample pair, multiple training sample pairs are obtained, and each training sample pair is labeled with a calibration node;

[0021] Input the training sample pairs into the preset network structure. Use the contrast learning network of the preset network structure to perform contrast learning on the training sample pairs to obtain the loss of the contrast learning network. Based on the vector output data of the contrast learning network, use the anomaly detection network of the preset network structure to perform anomaly detection on the calibration nodes to obtain the loss of the anomaly detection network;

[0022] Determine the total model loss according to the loss of the contrast learning network and the loss of the anomaly detection network;

[0023] When the total model loss does not meet the convergence condition, continue to iteratively train the parameters of the preset network structure according to multiple training sample pairs until the total model loss meets the convergence condition, and output the preset network structure with converged parameters as the anomaly prediction model.

[0024] In a second aspect, an embodiment of the present application provides a dangerous goods risk detection device, including:

[0025] A construction module, configured to construct a graph structure according to the interaction behavior data generated during the import and export process of dangerous goods to obtain the original structure graph of dangerous goods in the import and export scenario. The nodes of the original structure graph include dangerous goods and the interaction participants during the import and export process of dangerous goods, and the edges of the original structure graph are the interaction behavior data between each node;

[0026] A processing module, configured to perform feature enhancement processing on the original structure graph based on the graph diffusion algorithm to obtain a high-order structure graph after feature enhancement. The nodes in the high-order structure graph are the same as the nodes in the original structure graph, and the node relationship in the high-order structure graph is different from the node relationship in the original structure graph;

[0027] A detection module, configured to detect the abnormal risk of dangerous goods during the import and export process based on the original structure graph and the high-order structure graph, using the pre-trained anomaly prediction model. The anomaly prediction model is a neural network model obtained by performing deep learning training using multiple historical interaction behavior data of the same type of dangerous goods during the import and export process;

[0028] An early warning module, configured to perform risk early warning when it is detected that there is an abnormal risk of dangerous goods during the import and export process.

[0029] In a third aspect, an embodiment of the present application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the electronic device implements the above-mentioned dangerous goods risk detection method.

[0030] In a fourth aspect, an embodiment of the present application provides a readable storage medium, which stores a computer program. When the computer program is executed by a processor, the above-mentioned dangerous goods risk detection method is implemented.

[0031] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, which enables the above-mentioned dangerous goods risk detection method to be executed when the computer program is run.

[0032] In one solution provided by the above-mentioned dangerous goods risk detection method, device, equipment, medium and program product, a graph structure is constructed based on the interactive behavior data generated by dangerous goods in the import and export process to obtain the original structure graph of dangerous goods in the import and export scenario. The nodes of the original structure graph include dangerous goods and interactive participants in the import and export process of dangerous goods, and the edges of the original structure graph are the interactive behavior data between the nodes; the original structure graph is feature enhanced based on the graph diffusion algorithm to obtain a high-order structure graph after feature enhancement. The nodes in the high-order structure graph are the same as the nodes in the original structure graph, and the node relationship of the high-order structure graph is different from the node relationship of the original structure graph; based on the original structure graph and the high-order structure graph, a pre-trained abnormal prediction model is used to detect abnormal risks of dangerous goods in the import and export process, and a risk warning is issued when abnormal risks are detected in the import and export process of dangerous goods. The abnormal prediction model is a neural network model obtained by deep learning training using multiple historical interactive behavior data of the same type of dangerous goods in the import and export process. In this embodiment, a static graph structure is introduced into the import and export risk detection process. The static graph structure is used to represent the interactive behavioral relationships among interactive participants such as dangerous goods, trading parties and ports. The static graph structure is then feature enhanced to mine the deep-level correlation between dangerous goods and each interactive participant. The static graph structure and the high-order structure diagram can fully depict the complex interaction pattern between dangerous goods and each interactive participant in the import and export process, providing a more diverse and accurate information basis for subsequent abnormal risk detection, and improving the accuracy of identifying abnormal situations in the import and export process of dangerous goods, thereby accurately identifying abnormal risks in the import and export process of dangerous goods. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.

[0034] Figure 1 Schematic diagram of an application environment of a dangerous goods risk detection method in one embodiment of the present invention;

[0035] Figure 2 is a schematic diagram of a process of a dangerous goods risk detection method in one embodiment of the present invention;

[0036] Figure 3 yesFigure 2 Schematic diagram of an implementation process of step S20

[0037] Figure 4 Schematic diagram of an original structure diagram and a diffusion diagram in an embodiment of the present invention

[0038] Figure 5 Schematic diagram of an original structure diagram and a target feature diagram in an embodiment of the present invention

[0039] Figure 6 Schematic diagram of a high - order structure diagram in an embodiment of the present invention

[0040] Figure 7 Schematic diagram of a training process of an anomaly prediction model in an embodiment of the present invention

[0041] Figure 8 is Figure 2 Schematic diagram of an implementation process of step S30

[0042] Figure 9 Schematic diagram of a structure of a dangerous goods risk detection device in an embodiment of the present invention

[0043] Figure 10 Schematic diagram of a structure of an electronic device in an embodiment of the present invention Detailed implementation manners

[0044] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

[0045] It should be understood that when used in the specification and appended claims of the present invention, the term "comprising" indicates the presence of the described features, wholes, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components, and / or their combinations. It should also be understood that the term "and / or" used in the specification and appended claims of the present invention refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0046] In addition, in the description of the specification and appended claims of the present invention, the terms "first", "second", "third", etc. are only used for distinguishing descriptions, and cannot be understood as indicating or implying relative importance.

[0047] Reference to "one embodiment" or "some embodiments" etc. described in the specification of the present invention means that a specific feature, structure or characteristic described in connection with that embodiment is included in one or more embodiments of the present invention. Thus, statements such as "in one embodiment", "in some embodiments", "in other some embodiments", "in still other embodiments" etc. that appear in different places in this specification do not necessarily all refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in another way. The terms "comprising", "including", "having" and their variants all mean "including but not limited to", unless otherwise specifically emphasized in another way.

[0048] It should be understood that the magnitude of the sequence numbers of the steps in the following embodiments does not mean the order of execution, and the order of execution of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.

[0049] In order to illustrate the technical solution of the present invention, it will be described below through specific embodiments.

[0050] The dangerous goods risk detection method provided by the embodiments of the present invention can be applied in a dangerous goods risk detection system as Figure 1 shown. The dangerous goods risk detection system includes a user terminal and a dangerous goods risk detection device, wherein the user terminal communicates with the dangerous goods risk detection device through a network.

[0051] When risk detection of dangerous goods is required, for example, during the import and export of dangerous goods (such as dangerous chemicals), the user sends a risk detection instruction to the dangerous goods risk detection device through the user terminal. The risk detection instruction includes the interactive behavior data generated by the dangerous goods during the import and export process. After receiving the risk detection instruction, the dangerous goods risk detection device constructs a static graph structure according to the interactive behavior data generated by the dangerous goods during the import and export process in the risk detection instruction, and obtains the original structure diagram of the dangerous goods in the import and export scenario. Among them, the nodes of the original structure diagram include dangerous goods and the interactive participants in the import and export process of dangerous goods, and the edges of the original structure diagram are the interactive behavior data between each node. After obtaining the original structure diagram of the dangerous goods, the dangerous goods risk detection device performs feature enhancement processing on the original structure diagram based on the graph diffusion algorithm to obtain a high-order structure diagram after feature enhancement; wherein, the nodes in the high-order structure diagram are the same as the nodes in the original structure diagram, and the node relationship of the high-order structure diagram is different from the node relationship of the original structure diagram. Then, based on the original structure diagram and the high-order structure diagram, the dangerous goods risk detection device uses a pre-trained abnormal prediction model to detect abnormal risks of dangerous goods during the import and export process, and issues a risk warning when abnormal risks are detected during the import and export process, so that users can promptly learn about abnormal situations of dangerous goods during the import and export process and take corresponding measures to reduce import and export risks. Among them, the abnormal prediction model is a neural network model obtained by deep learning training using multiple historical interactive behavior data of the same type of dangerous goods during the import and export process.

[0052] In this embodiment, a static graph structure is introduced into the import and export risk detection system for risk detection. The interactive behavior relationship between dangerous goods, trading parties, ports and other interactive participants is represented by the static graph structure, and then the static graph structure is enhanced to dig out the deep-level correlation between dangerous goods and each interactive participant. The complex interaction mode between dangerous goods and each interactive participant in the import and export process can be fully portrayed through the static graph structure and the high-order structure diagram, providing a more diverse and accurate information basis for subsequent abnormal risk detection, improving the accuracy of abnormal situation identification in the import and export process of dangerous goods, so that the abnormal risks in the import and export process of dangerous goods can be accurately identified. In addition, the use of an abnormal prediction model for risk identification detection can improve data processing efficiency while ensuring the accuracy of identification, so that the abnormal risks in the import and export process of dangerous goods can be quickly identified; and the abnormal prediction model trained with multiple historical interactive behavior data of the same type of dangerous goods in the import and export process can improve the accuracy of the abnormal prediction model, thereby improving the accuracy of the abnormal prediction model for information extraction and identification of static graph structures and high-order structure diagrams, and helping to increase the accuracy of abnormal situation identification in the import and export process of dangerous goods.

[0053] Among them, the user terminal includes, but is not limited to, various terminal devices such as personal computers, laptops, smartphones, tablets, and portable wearable devices. The dangerous goods risk detection device can be a server, and the server can be implemented by an independent server or a server cluster composed of multiple servers. In other embodiments, the dangerous goods risk detection device can also be various terminal devices with data calculation functions such as personal computers, laptops, smartphones, and tablets.

[0054] In one embodiment, as Figure 2 shown, a dangerous goods risk detection method is provided. Taking the dangerous goods risk detection system in Figure 1 as an example, the method includes the following steps:

[0055] S10: Construct a graph structure based on the interaction behavior data generated during the import and export process of dangerous goods to obtain the original structure graph of dangerous goods in the import and export scenario.

[0056] When dangerous goods risk detection is required, for example, during the import and export process of dangerous goods (such as dangerous chemicals), the user sends a risk detection instruction to the dangerous goods risk detection device through the user terminal. The risk detection instruction includes the interaction behavior data generated during the import and export process of dangerous goods. The interaction behavior data generated during the import and export process of dangerous goods includes the interaction behavior data of different interaction participants for the dangerous goods. Different interaction participants include the trading parties of dangerous goods (such as buyers and sellers), ports (such as import ports and export ports), and the storage and transportation participants of the goods during the process of transporting the dangerous goods to the import and export ports. The interaction behavior data generated by each dangerous good during the import and export process includes the interaction behavior itself of different interaction participants and the attribute data related to the interaction behavior, such as the basic information of the dangerous goods (such as the category, name of the dangerous goods, and declaration element information, etc.), port type, transaction amount, means of transportation, and other information.

[0057] After receiving the risk detection instruction, the dangerous goods risk detection device constructs a static graph structure based on the interaction behavior data generated during the import and export process of the dangerous goods in the risk detection instruction to obtain the original structure graph of the dangerous goods in the import and export scenario. Among them, the nodes of the original structure graph include the dangerous goods and the interaction participants during the import and export process of the dangerous goods, and the edges of the original structure graph are the interaction behavior data between each node, that is, the nodes with interaction behavior are connected by edges. Among them, the original structure graph can be expressed as (X, A), where A represents the adjacency matrix of the original structure graph, and the adjacency matrix is used to represent the connection relationship between any two nodes among the n nodes of the original structure graph; X represents the attribute matrix of all nodes v in the original structure graph.

[0058] This static structure diagram can not only represent the basic relationships among dangerous goods, various trading parties, and ports, but also display more detailed information (such as declaration elements, port types, transaction amounts, means of transportation, etc.) through the attributes between nodes (such as dangerous chemicals, ports, trading parties) and edges (such as import and export interaction behaviors). This data structure can comprehensively depict the complex interaction patterns among dangerous goods, ports, trading parties, and transportation parties in the import and export dangerous goods trading network, thereby providing deeper insights for anomaly detection.

[0059] S20: Perform feature enhancement processing on the original structure diagram based on the graph diffusion algorithm to obtain a higher-order structure diagram with enhanced features.

[0060] After obtaining the original structure diagram of dangerous goods, the dangerous goods risk detection device performs feature enhancement processing on the original structure diagram based on the graph diffusion algorithm to obtain a higher-order structure diagram with enhanced features. Among them, the nodes in the higher-order structure diagram are the same as those in the original structure diagram, and the node relationships in the higher-order structure diagram are different from those in the original structure diagram.

[0061] For example, the dangerous goods risk detection device can directly expand the adjacency matrix of the nodes in the original structure diagram based on the graph diffusion algorithm to obtain the diffusion graph of the original structure diagram as the higher-order structure diagram with enhanced features. In other embodiments, the generation method of the higher-order structure diagram can also be other methods, which will not be elaborated here.

[0062] S30: Based on the original structure diagram and the higher-order structure diagram, use a pre-trained anomaly prediction model to detect the anomaly risk of dangerous goods during the import and export process.

[0063] After obtaining the original structure diagram and the higher-order structure diagram of the original structure diagram, the dangerous goods risk detection device obtains a pre-trained anomaly prediction model. Among them, the anomaly prediction model is a neural network model obtained through deep learning training using multiple historical interaction behavior data of the same type of dangerous goods during the import and export process. Using the anomaly prediction model trained with multiple historical interaction behavior data of the same type of dangerous goods during the import and export process can improve the accuracy of the anomaly prediction model. The dangerous goods risk detection device uses the anomaly prediction model to predict the anomaly situation of each node (i.e., dangerous goods and interaction participants) in the original structure diagram based on the original structure diagram and the higher-order structure diagram, so as to detect the anomaly risk of dangerous goods during the import and export process to detect whether there is an anomaly risk during the import and export process of dangerous goods.

[0064] S40: Issue a risk warning when detecting that there is an anomaly risk of dangerous goods during the import and export process.

[0065] When detecting that there is an anomaly risk of dangerous goods during the import and export process, a risk warning is issued through the user terminal.

[0066] Among them, when abnormal conditions are detected in each node in the original structure diagram, it is determined that there is an abnormal risk in the import and export process of dangerous goods, and the node with the abnormal condition is located, and the node with the abnormal condition is sent to the user terminal as an abnormal risk node for risk warning, so that the user can promptly know the abnormal risk situation of dangerous goods in the import and export process, as well as the node where the abnormal condition occurs.

[0067] In this embodiment, a static graph structure is introduced into the import and export risk detection system for risk detection. The interactive behavior relationship between dangerous goods, trading parties, ports and other interactive participants is represented by the static graph structure, and then the static graph structure is enhanced to dig out the deep-level correlation between dangerous goods and each interactive participant. The complex interaction mode between dangerous goods and each interactive participant in the import and export process can be fully portrayed through the static graph structure and the high-order structure diagram, providing a more diverse and accurate information basis for subsequent abnormal risk detection, improving the accuracy of abnormal situation identification in the import and export process of dangerous goods, so that the abnormal risks in the import and export process of dangerous goods can be accurately identified. In addition, the use of an abnormal prediction model for risk identification detection can improve data processing efficiency while ensuring the accuracy of identification, so that the abnormal risks in the import and export process of dangerous goods can be quickly identified; and the abnormal prediction model trained with multiple historical interactive behavior data of the same type of dangerous goods in the import and export process can improve the accuracy of the abnormal prediction model, thereby improving the accuracy of the abnormal prediction model for information extraction and identification of static graph structures and high-order structure diagrams, and helping to increase the accuracy of abnormal situation identification in the import and export process of dangerous goods.

[0068] In one embodiment, if Figure 3 As shown, in step S20, feature enhancement processing is performed on the original structure graph based on the graph diffusion algorithm to obtain a high-order structure graph after feature enhancement, which specifically includes the following steps:

[0069] S21: Use a graph diffusion algorithm to diffuse the node relationships of the original structure graph to obtain a diffusion matrix of the original structure graph.

[0070] The dangerous goods risk detection device uses a graph diffusion algorithm to diffuse the node relationship of the original structure graph, and obtains the diffusion matrix of the original structure graph, that is, the diffusion data of the original structure graph. According to the relationship between each node in the diffusion matrix of the original structure graph, the graph structure can be reconstructed to obtain the diffusion graph of the original structure graph.

[0071] Among them, the process of graph diffusion can be expressed as:

[0072]

[0073] Among them, S diffThe diffusion matrix representing the original structure diagram; Θ k is a weight factor that controls the proportion of local structure information and global structure information in the original structure diagram; is the transition matrix for transferring the adjacency matrix of the original structure diagram, where n represents the number of nodes in the original structure diagram.

[0074] In one embodiment, the personalized PageRank algorithm (PPR) can be used to enhance the graph diffusion of the original structure diagram. The process of performing graph diffusion using the personalized PageRank algorithm PPR, that is, the diffusion matrix is determined by the following formula:

[0075] S diff = α(I - (1 - α)D -1 / 2 AD -1 / 2 ) -1 ;

[0076] where, S diff represents the diffusion matrix of the original structure diagram; A represents the adjacency matrix of the original structure diagram, n represents the number of nodes in the original structure diagram; I represents the identity matrix of the adjacency matrix; D represents the degree matrix of the adjacency matrix; α is an adjustable parameter of the personalized PageRank algorithm.

[0077] S22: Use the nearest neighbor algorithm to perform graph construction based on node similarity on the original structure diagram to obtain the target feature map.

[0078] It should be noted that since the graph diffusion algorithm can establish connection relationships between any two nodes on the original structure diagram, and the graph diffusion of the node relationships of the original structure diagram through the graph diffusion algorithm to obtain a high-order structure diagram may introduce noise edges (that is, connection relationships between unassociated nodes, or connections between normal nodes and abnormal nodes), the noise edges will affect the accuracy of the high-order structure diagram.

[0079] Therefore, in this embodiment, the hazardous material risk detection device uses the nearest neighbor algorithm to perform graph construction based on node similarity on the original structure diagram to obtain the target feature map, so as to filter the noise edges between nodes according to the structure information shared by the diffusion graph and the target feature map, and improve the accuracy of the subsequent generated high-order structure diagram.

[0080] Among them, the hazardous material risk detection device can calculate the similarity between any two nodes in the original structure diagram (such as the edit distance), and according to the similarity between any two nodes in the original structure diagram, use the K-NearestNeighbors Algorithm (KNN) to re-update the connection relationships between each node and other nodes, thereby constructing the target feature map.

[0081] S23: Enhance the graph features of the original structure diagram according to the diffusion matrix and the target feature map to obtain a high-order structure diagram.

[0082] After obtaining the diffusion matrix and the target feature map, enhance the graph features of the original structure diagram according to the diffusion matrix and the target feature map to obtain a high-order structure diagram. For example, the diffusion graph can be directly obtained by converting the diffusion matrix, retaining the shared edges (i.e., the edges shared by both) of the diffusion graph and the target feature map, and screening out the non-shared edges in the diffusion graph and the target feature map, then the high-order structure diagram can be obtained.

[0083] For example, as Figure 4 shown, the original structure diagram includes nodes 1-8, and the edges (i.e., connection relationships) of each node are as shown in the figure. The graph diffusion algorithm is used to perform graph diffusion on the node relationships of the original structure diagram to obtain the diffusion graph of the original structure diagram. As Figure 5 shown, the nearest neighbor algorithm (such as the K-nearest neighbor algorithm) is used to construct a graph based on node similarity for the original structure diagram to obtain the target feature map. From Figure 4 whichever Figure 5 it can be seen that the non-shared edges of the diffusion graph and the target feature map are the edges of nodes 5 and 8, and the edges of nodes 7 and 8; retaining the shared edges of the diffusion graph and the target feature map, and screening out the non-shared edges in the diffusion graph and the target feature map, the high-order structure diagram can be obtained, and the high-order structure diagram is as Figure 6 shown.

[0084] In this embodiment, the graph diffusion algorithm is used to perform graph diffusion on the node relationships of the original structure diagram to obtain the diffusion matrix of the original structure diagram, and the nearest neighbor algorithm is used to construct a graph based on node similarity for the original structure diagram to obtain the target feature map. Then, according to the diffusion matrix and the target feature map, the graph features of the original structure diagram are enhanced to obtain a high-order structure diagram. This method can filter the noise edges between nodes according to the shared structure information of the diffusion graph and the target feature map, improve the accuracy of the high-order structure diagram, and can accurately mine the association information between different interacting parties during the import and export process of dangerous goods.

[0085] In one embodiment, in step S22, that is, using the nearest neighbor algorithm to construct a graph based on node similarity for the original structure diagram to obtain the target feature map, specifically includes the following steps:

[0086] S221: Use the cosine similarity algorithm to determine the similarity between each node in the original structure diagram and other nodes.

[0087] The dangerous goods risk detection device uses the cosine similarity algorithm to determine the similarity between each node in the original structure diagram and other nodes, and this similarity is the vector similarity of the nodes.

[0088] Among them, the dangerous goods risk detection device needs to perform vector encoding on each node (which may include the attribute data of the node) in the original structure diagram to obtain the vectors of each node in the original structure diagram; based on the vectors of each node in the original structure diagram, determine the similarity between each node and other nodes. Among them, the similarity between a node and other nodes is represented by the following formula:

[0089]

[0090] Among them, represents the cosine similarity between node i and node j in the original structure diagram; represents the transpose of the vector of node i; x j represents the vector of node j; ||x i || represents the norm of the vector of node i; ||x j || represents the norm of the vector of node j.

[0091] S222: Based on the similarity between each node and other nodes, perform a descending order sorting of the nodes, and select the top preset number of nodes as the neighbor nodes of the node.

[0092] After obtaining the similarity between each node and other nodes in the original structure diagram, the dangerous goods risk detection device performs a descending order sorting on multiple other nodes except this node based on the similarity between each node and other nodes, and selects the top preset number (such as 5) of nodes as the neighbor nodes of the node.

[0093] S223: Construct node relationship features based on each node and the neighbor nodes of each node in the original structure diagram to obtain the target feature map.

[0094] The dangerous goods risk detection device constructs node relationship features based on each node and the neighbor nodes of each node in the original structure diagram to obtain the target feature map. Among them, the nodes and the neighbor nodes of the nodes in the target feature map are connected by edges.

[0095] For example, after determining the neighbor nodes of the node, it can be determined whether each node is connected to its neighbor nodes by an edge in the original structure diagram. If a node is not connected to its neighbor node by an edge, then connect the unconnected node to its neighbor node by an edge, and reconstruct the structural relationship between each node by adding edges between each node and some other nodes.

[0096] In this embodiment, the cosine similarity algorithm is used to determine the similarity between each node in the original structure diagram and other nodes. Based on the similarity between each node and other nodes, the neighboring nodes of each node are sorted in descending order, and the first preset number of neighboring nodes are selected as the neighbor nodes of the node. According to each node and the neighbor nodes of each node in the original structure diagram, the node relationship features are constructed to obtain the target feature map, which can increase the edges between each node and some other nodes, reconstruct the structural relationship between each node, improve the diversity of the node structural relationship in the target feature map, thereby mining the association information between different interaction participants in the process of import and export of dangerous goods, and improving the subsequent high-order structure diagram.

[0097] In one embodiment, in step S23, that is, according to the diffusion matrix and the target feature map, the graph features of the original structure diagram are enhanced to obtain a high-order structure diagram, which specifically includes the following steps:

[0098] S231: Perform noise filtering on the adjacency matrix of the original structure diagram according to the diffusion matrix and the structure matrix of the target feature map to generate a high-order structure matrix.

[0099] After obtaining the diffusion matrix and the target feature map, the dangerous goods risk detection device needs to generate the structure matrix of the target feature map according to the structural relationship between the nodes in the target feature map (that is, the connection relationship between nodes and nodes); the structure matrix of the target feature map can be the adjacency matrix of the target feature map; then, according to the diffusion matrix and the structure matrix of the target feature map, perform noise filtering on the adjacency matrix of the original structure diagram to generate a high-order structure matrix.

[0100] Among them, the high-order structure matrix can be calculated by the following formula:

[0101]

[0102] Among them, S h represents the high-order structure matrix; A represents the adjacency matrix of the original structure diagram; S diff represents the diffusion matrix, that is, the structure matrix of the diffusion graph; S feat represents the structure matrix of the target feature map; represents the positive sum symbol, that is, the summation symbol; represents the Hadamard product symbol.

[0103] By using the diffusion matrix and the structure matrix of the target feature map to perform noise filtering on the adjacency matrix of the original structure diagram, the high-order structure matrix is calculated, and there is no need to perform shared edge recognition and non-shared edge deletion processing on the diffusion matrix for the point diffusion graph and the target feature map. The matrix calculation is simple and has high accuracy.

[0104] S232: Construct a graph based on the high-order structure matrix and the attribute matrix of the original structure diagram to obtain a high-order structure diagram.

[0105] Among them, the dangerous goods risk detection device needs to obtain the attribute matrix of the original structure diagram. The attribute matrix is obtained by extracting the attribute data of the nodes in the original structure diagram, and a graph is constructed according to the high-order structure matrix and the attribute matrix of the original structure diagram to obtain a high-order structure diagram. That is, the connection relationship of each node is reconstructed according to the high-order structure matrix, and the attribute data of the nodes in the original structure diagram is restored to the reconstructed structure diagram to obtain a high-order structure diagram.

[0106] Among them, the high-order structure diagram can be expressed as (X, S h ), S h represents the adjacency matrix of the high-order structure diagram. The adjacency matrix is used to represent the connection relationship between two nodes among the n nodes of the high-order structure diagram; X represents the attribute matrix of all nodes v in the high-order structure diagram, that is, the attribute matrix of the original structure diagram.

[0107] In this embodiment, according to the diffusion matrix and the structure matrix of the target feature map, noise filtering is performed on the adjacency matrix of the original structure diagram to generate a high-order structure matrix, and a graph is constructed according to the high-order structure matrix and the attribute matrix of the original structure diagram to obtain a high-order structure diagram. The graph construction is carried out by means of matrix calculation, which is highly accurate, simple and convenient, and reduces the amount of calculation.

[0108] In one embodiment, before step S30, that is, before detecting the abnormal risk of dangerous goods during the import and export process, the dangerous goods risk detection device needs to first use the historical interaction behavior data of multiple same-type dangerous goods during the import and export process to perform deep learning training on a preset network structure to obtain an abnormal prediction model, so as to directly use the abnormal prediction model to detect the abnormal risk of dangerous goods during the import and export process in the future. Among them, as Figure 7 shown, the abnormal prediction model is trained in the following manner:

[0109] S01: Respectively construct the graph structures of multiple historical interaction behavior data to obtain the historical original graphs of multiple historical interaction behavior data, and respectively perform feature enhancement processing on each historical original graph to obtain the historical high-order graphs of multiple historical original structure diagrams.

[0110] The dangerous goods risk detection device obtains the historical interaction behavior data of multiple same-type dangerous goods during the import and export process, and then respectively constructs the graph structures of multiple historical interaction behavior data to obtain the historical original graphs of multiple historical interaction behavior data. After obtaining multiple historical original graphs, the dangerous goods risk detection device respectively performs feature enhancement processing on each historical original graph to obtain the historical high-order graphs of multiple historical original structure diagrams.

[0111] Among them, the construction process of the historical original graph is the same as that of the original structure graph in the previous text, and the acquisition process of the historical high-order graph is the same as that of the high-order structure graph in the previous text, which will not be elaborated here.

[0112] S02: Using the historical original graph and the corresponding historical high-order graph as a pair of training samples, multiple pairs of training samples are obtained, and each pair of training samples is labeled with a calibration node.

[0113] The dangerous goods risk detection device uses the historical original graph and the corresponding historical high-order graph (i.e., the historical high-order graph of this historical original graph) as a pair of training samples to obtain multiple pairs of training samples. Among them, the same calibration node is marked in the historical original graph and the historical high-order graph of the pair of training samples, so as to perform anomaly detection on the anomaly detection target with this calibration node subsequently.

[0114] S03: Inputting the pair of training samples into the preset network structure, performing contrastive learning on the pair of training samples through the contrastive learning network of the preset network structure to obtain the loss of the contrastive learning network, and based on the vector output data of the contrastive learning network, performing anomaly detection on the calibration node through the anomaly detection network of the preset network structure to obtain the loss of the anomaly detection network.

[0115] In this embodiment, the preset network structure includes a contrastive learning network and an anomaly detection network connected in sequence.

[0116] The dangerous goods risk detection device inputs the pair of training samples into the preset network structure, performs contrastive learning on the pair of training samples through the contrastive learning network to obtain the loss of the contrastive learning network, and based on the vector output data of the contrastive learning network, performs anomaly detection on the calibration node through the anomaly detection network to obtain the loss of the anomaly detection network.

[0117] S04: Determining the total model loss according to the loss of the contrastive learning network and the loss of the anomaly detection network.

[0118] The dangerous goods risk detection device determines the total model loss according to the loss of the contrastive learning network and the loss of the anomaly detection network. Among them, different balance parameters can be set for the loss of the contrastive learning network and the loss of the anomaly detection network, and according to the corresponding balance parameters, the loss of the contrastive learning network and the loss of the anomaly detection network are weighted and summed to obtain the total model loss.

[0119] S05: When the total model loss does not meet the convergence condition, continue to iteratively train the parameters of the preset network structure according to multiple pairs of training samples until the total model loss meets the convergence condition, and output the preset network structure with converged parameters as the anomaly prediction model.

[0120] When the total loss of the model does not meet the convergence condition, continue to iteratively train the parameters of the preset network structure according to multiple training samples, that is, execute the above steps S03 to S04 until the total loss of the model meets the convergence condition, and output the preset network structure with converged parameters as the anomaly prediction model.

[0121] In this embodiment, the training process of the anomaly prediction model is clarified. By constructing a graph structure for multiple historical interaction behavior data, multiple historical original graphs and historical high-order graphs are obtained. Then, the historical original graphs and the corresponding historical high-order graphs are used as a training sample pair to train the model, obtaining the loss of the contrastive learning network and the loss of the anomaly detection network, and then determining the total loss of the model. When the total loss of the model does not meet the convergence condition, continue to iteratively train the parameters of the preset network structure according to multiple training samples until the model converges to obtain the anomaly prediction model. Using the total loss determined by the loss of the contrastive learning network and the loss of the anomaly detection network as the model optimization target can improve the information mining ability of the contrastive learning network for the original structure graph and the high-order structure graph during the training process, can dig out the deep association information of each node in the import and export process, improve the contrastive learning ability and anomaly detection ability of the anomaly prediction model, improve the subsequent anomaly risk detection ability, and improve the accuracy of anomaly risk detection in the import and export process.

[0122] In one embodiment, the contrastive learning network includes a sampling module, an encoding module, and a contrastive learning module. In step S03, the training sample pair is subjected to contrastive learning through the contrastive learning network of the preset network structure to obtain the loss of the contrastive learning network, which specifically includes the following steps:

[0123] S031: The sampling module of the contrastive learning network is used to perform subgraph sampling on the historical original graph and the historical high-order graph of the training sample pair respectively, obtaining multiple original subgraphs of a preset size in the historical original graph and multiple high-order subgraphs of a preset size in the historical high-order graph.

[0124] S032: The encoding module of the contrastive learning network is used to perform low-dimensional encoding on the multiple original subgraphs to obtain the encoding vectors of the multiple original subgraphs and the first encoding vectors of the calibrated nodes in the original subgraphs, and perform low-dimensional encoding on the multiple high-order subgraphs through the encoding module to obtain the encoding vectors of the multiple high-order subgraphs and the second encoding vectors of the calibrated nodes in the high-order subgraphs.

[0125] S033: Through the contrastive learning module of the contrastive learning network, sample pairs are constructed for the first encoding vectors of the calibrated nodes, the encoding vectors of the multiple original subgraphs, and the encoding vectors of the multiple high-order subgraphs, and contrastive learning is performed according to the multiple first sample pairs and multiple second sample pairs constructed to obtain the loss of the contrastive learning network.

[0126] Through the contrastive learning module of the contrastive learning network, sample pairs are constructed by respectively comparing the first encoding vector of the calibrated node with the encoding vectors of multiple original subgraphs, that is, a sample pair is formed by combining the first encoding vector of the calibrated node with the encoding vector of an original subgraph, and multiple first sample pairs are obtained. The multiple first sample pairs include positive sample pairs and negative sample pairs. The corresponding original subgraph in the positive sample pair is the original subgraph containing the calibrated node, and the corresponding original subgraph in the negative sample pair is the original subgraph not containing the calibrated node.

[0127] Similarly, sample pairs are constructed by respectively comparing the second encoding vector of the calibrated node with the encoding vectors of multiple high-order subgraphs, that is, a sample pair is formed by combining the second encoding vector of the calibrated node with the encoding vector of a high-order subgraph, and multiple second sample pairs are obtained. The multiple second sample pairs include positive sample pairs and negative sample pairs. The corresponding high-order subgraph in the positive sample pair is the high-order subgraph containing the calibrated node, and the corresponding high-order subgraph in the negative sample pair is the high-order subgraph not containing the calibrated node.

[0128] Contrastive learning is performed based on the negative sample pairs in the multiple first sample pairs and the multiple second sample pairs to obtain the contrastive learning loss between the node and the subgraph, that is, the first contrast loss; contrastive learning is performed based on the negative sample pairs in the multiple second sample pairs and the multiple first sample pairs to obtain the contrastive learning loss between the node and the subgraph, that is, the second contrast loss; the loss of the contrastive learning network is determined based on the first contrast loss and the second contrast loss.

[0129] Among them, the first contrast loss is represented by the following formula:

[0130]

[0131] Among them, represents the first contrast loss; represents the total number of nodes in the historical original graph; represents the embedding representation of the calibrated node v i in the historical original graph, and respectively represent the encoding vectors of the original subgraph containing the calibrated node in the positive sample pair and the encoding vector of the original subgraph not containing the calibrated node in the negative sample pair, is the encoding vector of the high-order subgraph not containing the calibrated node v i in the negative sample pair, and τ is the temperature parameter.

[0132] Among them, the second contrast loss is represented by the following formula:

[0133]

[0134] Among them, represents the second contrast loss; Represents the total number of nodes in the historical high-order graph; Represents the embedding representation of the calibrated node v i in the historical high-order graph, and respectively represent the encoded vectors of the high-order subgraphs containing the calibrated node in the positive sample pairs and the encoded vectors of the high-order subgraphs not containing the calibrated node in the negative sample pairs. is the encoded vector of the original subgraph that does not contain the calibrated node v i in the negative sample pairs, and τ is the temperature parameter.

[0135] Among them, the loss of the contrast learning network is represented by the following formula:

[0136]

[0137] Among them, represents the loss of the contrast learning network; represents the first contrast loss; represents the second contrast loss.

[0138] In this embodiment, by respectively determining the comparison and analysis between the calibrated node and the subgraphs of the historical original graph and the historical high-order graph, the loss of the contrast learning network is obtained, and the loss of the contrast learning network is used as the contrast target to optimize the encoding ability of the model, enhance the semantic distinguishability of the nodes, and thus improve the accuracy of the encoded vectors of the nodes and each subgraph encoded by the contrast learning network.

[0139] In one embodiment, the anomaly detection network includes a structure discriminator and an attribute detection module; the loss of the anomaly detection network includes the loss of the structure similarity discriminator and the loss of the attribute detection module; the vector output data of the contrast learning network includes multiple first sample pairs of the historical original graph and multiple second sample pairs of the historical high-order graph. In step S03, based on the vector output data of the contrast learning network, the calibrated node is detected for anomalies through the anomaly detection network with a preset network structure, and the loss of the anomaly detection network is obtained, which specifically includes the following steps:

[0140] S034: Based on multiple first sample pairs and multiple second sample pairs, the structure discriminator is used to discriminate the similarity between the calibrated node and the subgraph, and the loss of the structure discriminator is obtained.

[0141] Among them, based on multiple first sample pairs of historical original graphs, the structure discriminator discriminates the similarity between the calibrated nodes in the historical original graphs and each original sub-graph, obtains the similarity between each original sub-graph and the calibrated nodes in the historical original graphs, that is, obtains the node sub-graph similarities of multiple first sample pairs, and calculates the first structure loss according to the node sub-graph similarities of multiple first sample pairs; based on multiple second sample pairs of historical original graphs, the structure discriminator discriminates the similarity between the calibrated nodes in the historical high-order graphs and each high-order sub-graph, obtains the similarity between each high-order sub-graph and the calibrated nodes in the historical high-order graphs, that is, obtains the node sub-graph similarities of multiple second sample pairs, and calculates the second structure loss according to the node sub-graph similarities of multiple second sample pairs; determines the loss of the structure discriminator according to the first structure loss and the second structure loss.

[0142] Among them, the node sub-graph similarity of the first sample pair can be directly used as the node sub-graph risk value of the first sample pair. Among them, multiple first sample pairs include positive sample pairs and negative sample pairs. Then, the sum of the node sub-graph risk values of the negative sample pairs in multiple first samples can be subtracted from the sum of the node sub-graph risk values of the positive sample pairs in multiple first samples to obtain the structure risk of the calibrated node in the historical original graph, that is, obtain the first structure risk of the calibrated node, with high accuracy. Similarly, the node sub-graph similarity of the second sample pair can be directly used as the node sub-graph risk of the second sample pair, that is, obtain the second structure risk of the calibrated node. Among them, multiple first sample pairs include positive sample pairs and negative sample pairs. Then, the sum of the node sub-graph risks of the negative sample pairs in multiple second samples can be subtracted from the sum of the node sub-graph risks of the positive sample pairs in multiple second samples to obtain the structure risk value of the calibrated node in the historical high-order graph. Then, the structure risk value of the calibrated node in the historical original graph and the structure risk of the calibrated node in the historical high-order graph are averaged to obtain the overall structure risk value of the calibrated node, with high accuracy.

[0143] Among them, the first structure loss is represented by the following formula:

[0144]

[0145] Among them, represents the first structure loss; represents the first coding vector z of the calibrated node in the first sample pair i and the coding vector e of the original sub-graph i similarity; Bilinear represents a bilinear model; sigmoid(·) represents a logistic function; W is a parameter matrix; y i represents the constant coefficient of the sample pair. When the first sample pair is a positive sample pair, y i is 1; when the first sample pair is a negative sample pair, y i is 0; n represents the number of first sample pairs.

[0146] Among them, the second structural loss is represented by the following formula:

[0147]

[0148] Among them, represents the second structural loss; represents the second encoding vector z of the calibrated node in the second sample pair i and the encoding vector e of the high-order subgraph i similarity; Bilinear represents a bilinear model; sigmoid(·) represents a logistic function; W is a parameter matrix; y i represents the constant coefficient of the sample pair. When the second sample pair is a positive sample pair, y i is 1; when the second sample pair is a negative sample pair, y i is 0.

[0149] Among them, the loss of the structure discriminator is represented by the following formula:

[0150]

[0151] Among them, represents the loss of the structure discriminator; represents the first structural loss; represents the second structural loss.

[0152] S035: Based on the original subgraph including the calibrated node in the historical original graph and the high-order subgraph including the calibrated node in the historical high-order graph, the attribute detection module detects the attribute error between the calibrated node and the subgraph, and obtains the loss of the attribute detection module.

[0153] Specifically, encode the attribute data of the calibrated nodes in the historical original graph to obtain the attribute vectors of the calibrated nodes. Use a contrastive learning network to encode the attribute data of each node in the original subgraph (referred to as the target original subgraph) including the calibrated nodes to obtain the attribute encoding vectors of each node in the target original subgraph; concatenate the attribute encoding vectors of each node in the target original subgraph into a one-dimensional vector, and use a Multilayer Perceptron (MLP) to map the concatenated one-dimensional vector to obtain an encoding vector with the same dimension size as the attribute vector of the calibrated node, which is used as the attribute vector of the target original subgraph, that is, obtain the first attribute vector. Use a contrastive learning network to encode the attribute data of each node in the high-order subgraph (referred to as the target high-order subgraph) including the calibrated nodes to obtain the attribute encoding vectors of each node in the target high-order subgraph; concatenate the attribute encoding vectors of each node in the target high-order subgraph into a one-dimensional vector, and use the MLP to map the concatenated one-dimensional vector to obtain an encoding vector with the same dimension size as the attribute vector of the calibrated node, which is used as the attribute vector of the target high-order subgraph, that is, obtain the second attribute vector; determine the similarity between the first attribute vector and the attribute vector of the calibrated node to obtain the first attribute loss; determine the similarity between the second attribute vector and the attribute vector of the calibrated node to obtain the second attribute loss.

[0154] Among them, a multilayer perceptron can be used as the attribute error generator to map the attribute encoding vectors of each node in the target original subgraph to obtain the first attribute vector, and the Euclidean norm (i.e., the L2 norm) is used to determine the similarity between the first attribute vector and the attribute vector of the calibrated node to obtain the attribute generation error of the calibrated node in the target original subgraph. Averaging the attribute generation errors of the calibrated node in different target original subgraphs can obtain the first attribute loss of the attribute detection module. That is, the first attribute loss is represented by the following formula:

[0155]

[0156] Among them, represents the first attribute loss, that is, the similarity between the calibrated node v i and its original subgraph where it is located; MLP represents the multilayer perceptron, and MLP(E i ) represents the first attribute vector, that is, the attribute vector of the original subgraph including the calibrated node; E i represents the one-dimensional vector obtained by concatenating the attribute encoding vectors of each node in the target original subgraph; x i represents the attribute vector of the calibrated node v i ; n represents the number of original subgraphs including the calibrated node.

[0157] Similarly, a multi-layer perceptron can be used as the attribute error generator to map the attribute number encoding vectors of each node in the target high-order subgraph to obtain the second attribute vector, and the Euclidean norm is used to determine the similarity between the second attribute vector and the second attribute vector of the calibrated node, so as to obtain the attribute generation error of the calibrated node in the target high-order subgraph; then, the attribute generation errors of the calibrated node in different target original subgraphs are averaged to obtain the second attribute loss of the attribute detection module.

[0158] Among them, the attribute generation error of the calibrated node in the target original subgraph can be directly used as the attribute risk value of the calibrated node in the target original subgraph, and the attribute generation error of the calibrated node in the target high-order subgraph can be used as the attribute risk value of the calibrated node in the target high-order subgraph. By averaging the attribute risk values of the calibrated node in the target original subgraph and the target high-order subgraph, the attribute risk value of the calibrated node can be obtained, which is highly accurate, simple and intuitive.

[0159] Among them, the loss of the attribute detection module is represented by the following formula:

[0160]

[0161] Among them, represents the loss of the attribute detection module; represents the first attribute loss; represents the second attribute loss.

[0162] It should be understood that the essence of attribute anomaly is that there are significant differences between the attributes of a node and its adjacent nodes. In this embodiment, by distinguishing the consistency of attributes between a node and its local neighbor nodes, the essence of node attribute anomaly can be captured, providing greater utility for anomaly detection; on the basis of the node subgraph structure relationship discrimination loss, the judgment of node attribute error loss is added, which can not only detect node structure anomalies but also detect attribute anomalies, improving the anomaly detection ability of the model.

[0163] In one embodiment, in step S04, that is, according to the loss of the contrast learning network and the loss of the anomaly detection network, the total loss of the model is determined, which specifically includes the following steps:

[0164] S041: Determine the loss of the structure discriminator in the loss of the anomaly detection network and the loss of the attribute detection module;

[0165] S042: Determine the total loss of the model according to the loss of the contrast learning network, the loss of the structure discriminator and the loss of the attribute detection module.

[0166] Among them, the anomaly detection network includes a structure discriminator and an attribute detection module. The loss of the anomaly detection network includes the loss of the structure discriminator and the loss of the attribute detection module. According to the balance coefficients of different losses, the losses of the structure discriminator, the attribute detection module, and the contrast learning network are weighted and summed to obtain the total model loss.

[0167] Among them, the total model loss is expressed by the following formula:

[0168]

[0169] Among them, represents the total model loss; represents the loss of the structure discriminator; represents the loss of the attribute detection module; represents the loss of the contrast learning network; α, γ represent the balance coefficients of different types of losses and are constant values.

[0170] In this embodiment, determining the total model loss according to the loss of the contrast learning network, the structure discriminator, and the attribute detection module can use the encoding ability of the contrast learning network, the structural anomaly detection ability of the node subgraph, and the node attribute anomaly detection ability as optimization goals, thereby improving the model training effect, enhancing the encoding ability of the anomaly detection model, the detection abilities of structural anomalies and attribute anomalies, and improving the accuracy of subsequent anomaly risk detection.

[0171] In one embodiment, the anomaly prediction model includes a contrast learning network and an anomaly detection network connected in sequence. As Figure 8 shown, in step S30, that is, based on the original structure diagram and the high-order structure diagram, the anomaly risk of dangerous goods during the import and export process is detected, and a risk warning is issued when it is detected that there is an anomaly risk of dangerous goods during the import and export process. The specific steps are as follows:

[0172] S31: Input the original structure diagram and the high-order structure diagram into the anomaly prediction model, perform contrast learning on the original structure diagram and the high-order structure diagram through the contrast learning network, and based on the vector output data of the contrast learning network, perform anomaly detection on multiple nodes through the anomaly detection network to obtain the risk scores of multiple nodes.

[0173] After obtaining the original structure diagram and the high-order structure diagram, use the anomaly prediction model to perform node anomaly prediction on the original structure diagram and the high-order structure diagram to obtain the risk scores of multiple nodes in the original structure diagram. That is, directly input the original structure diagram and the high-order structure diagram into the anomaly prediction model, perform contrast learning on the original structure diagram and the high-order structure diagram through the contrast learning network, and based on the vector output data of the contrast learning network, perform anomaly detection on multiple nodes through the anomaly detection network to obtain the risk scores of multiple nodes.

[0174] S32: Detect the abnormal risk of dangerous goods during the import and export process based on the risk scores of multiple nodes. When it is detected that there are risk nodes with risk scores greater than a preset threshold among the multiple nodes, determine the abnormal risk of the dangerous goods during the import and export process.

[0175] Then, detect the abnormal risk of dangerous goods during the import and export process based on the risk scores of multiple nodes. When it is detected that there are risk nodes with risk scores greater than a preset threshold among the multiple nodes, determine that there is an abnormal risk of the dangerous goods during the import and export process, and issue a risk warning for the risk nodes.

[0176] In this embodiment, through the anomaly prediction model, node anomaly prediction is performed on the original structure diagram and the high-order structure diagram, and the risk scores of multiple nodes in the original structure diagram are obtained. Then, based on the risk scores of multiple nodes, the abnormal risk of dangerous goods during the import and export process is detected. When it is detected that there are risk nodes with risk scores greater than a preset threshold among the multiple nodes, determine that there is an abnormal risk of the dangerous goods during the import and export process, and issue a risk warning for the risk nodes. By using the anomaly prediction model to score the risk of all nodes (i.e., interaction participants) during the import and export process of dangerous goods to determine the nodes with abnormal risks, it is simple, intuitive, and highly accurate.

[0177] In one embodiment, the anomaly prediction model includes a contrastive learning network, an anomaly detection network, and an aggregator connected in sequence. The anomaly detection network includes a structure discriminator for detecting node structure anomalies and an attribute detection module for detecting node attribute anomalies. In step S32, that is, through the contrastive learning network, contrastive learning is performed on the original structure diagram and the high-order structure diagram pair, and based on the vector output data of the contrastive learning network, the anomaly detection network is used to perform anomaly detection on multiple nodes to obtain the risk scores of multiple nodes, which specifically includes the following steps:

[0178] S321: Perform vector encoding on multiple nodes, the original structure diagram, and the high-order structure diagram pair through the contrastive learning network, and construct sample pairs based on the encoded vectors to obtain multiple first sample pairs of the original structure diagram and multiple second samples of the high-order structure diagram pair.

[0179] Perform vector encoding on multiple nodes, the original structure diagram, and the high-order structure diagram pair through the contrastive learning network, and construct sample pairs based on the encoded vectors to obtain multiple first sample pairs of the original structure diagram and multiple second samples of the high-order structure diagram pair. Among them, the construction processes of the first sample pair and the second sample pair refer to the above text and will not be elaborated here.

[0180] S322: Based on multiple first sample pairs and multiple second samples, use the structure discriminator to perform node structure relationship anomaly prediction on the original structure diagram and the high-order structure diagram to obtain the structure risk values of multiple nodes.

[0181] Among them, for multiple first sample pairs based on the original structure diagram, a structure discriminator is used to discriminate the similarity between a certain node in the original structure diagram and each original sub-diagram, and a first structure risk value of this node is obtained; for multiple second sample pairs based on the high-order structure diagram, a structure discriminator is used to discriminate the similarity between this node in the high-order structure diagram and each high-order sub-diagram, and a second structure risk value is obtained; the structure risk value of this node is determined according to the first structure risk value and the second structure risk value.

[0182] Among them, the structure risk value includes an overall structure risk value and a local structure risk value. Correspondingly, the structure discriminator includes an overall structure discrimination layer and a local structure discrimination layer. The overall structure discrimination layer is used for: based on multiple first sample pairs of the original structure diagram, discriminating the similarity between a certain node in the original structure diagram and each original sub-diagram, and obtaining the structure risk value of this node in the historical original diagram, that is, obtaining the first structure risk value of this node; based on multiple second samples of the high-order structure diagram, discriminating the similarity between this node in the high-order structure diagram and each high-order sub-diagram, and obtaining the structure risk value of this node in the high-order original diagram, that is, obtaining the second structure risk value of this node; averaging the second structure risk value and the second structure risk value, and outputting the overall structure risk value of this node. Among them, the calculation processes of the first structure risk value and the second structure risk value refer to the above text and will not be elaborated here.

[0183] The local structure discrimination layer can be a graph convolutional neural network layer, which is used for: obtaining multiple original sub-diagrams output by the contrast learning module after sampling the original structure diagram, and obtaining multiple high-order sub-diagrams output by the contrast learning module after sampling the high-order structure diagram, determining the original sub-diagram including this node among the multiple original sub-diagrams as the target original sub-diagram, and determining the high-order sub-diagram including this node among the multiple high-order sub-diagrams as the target high-order sub-diagram. Semantically encoding each node in the target original sub-diagram, calculating the variance of the encoded vectors of each node in the target original sub-diagram, obtaining the vector square difference of each node in the target original sub-diagram, and using the L1 norm to sum the vector square differences of each node in the target original sub-diagram to obtain the first local risk value of this node. Semantically encoding each node in the target high-order sub-diagram, calculating the variance of the encoded vectors of each node in the target high-order sub-diagram, obtaining the vector square difference of each node in the target high-order sub-diagram, and using the L1 norm to sum the vector square differences of each node in the target high-order sub-diagram to obtain the second local risk value of this node. Finally, directly outputting the mean value of the first sub-diagram outlier and the second sub-diagram outlier as the local structure risk value of this node.

[0184] S323: Based on the original structure diagram and the high-order structure diagram, the attribute detection module is used to perform node attribute anomaly prediction on the original structure diagram and the high-order structure diagram, and obtain the attribute risk values of multiple nodes.

[0185] Based on the original structure diagram and the high - order structure diagram, the attribute detection module predicts node attribute anomalies for the original structure diagram and the high - order structure diagram, and obtains the attribute risk values of multiple nodes.

[0186] S324: The aggregator obtains the risk scores of nodes based on the structural risk values and attribute risk values of the nodes, and obtains the risk scores of multiple nodes.

[0187] After obtaining the structural risk values and attribute risk values of multiple nodes, the aggregator obtains the risk scores of nodes based on the structural risk values and attribute risk values of the nodes, and obtains the risk scores of multiple nodes.

[0188] Among them, the structural risk value includes the overall structural risk value and the local structural risk value. According to the structural risk values and attribute risk values of multiple nodes, the risk scores of multiple nodes are determined, including: respectively normalizing the attribute risk value, the overall structural risk value and the local structural risk value of the node to obtain the normalized attribute risk value, overall structural risk value and local structural risk value of the node; according to multiple pre - calibrated balance coefficients, performing weighted summation on the normalized attribute risk value, overall structural risk value and local structural risk value of the node to obtain the risk score of the node, and traversing each node to obtain the risk scores of multiple nodes.

[0189] Among them, the risk score of the node is represented by the following formula:

[0190] score(v i )=score ns (v i )+α·score gen (v i )+β·score str (v i );

[0191] Among them, score(v i ) represents the risk score of node v i ; score ns (v i ) represents the overall structural risk value of node v i ; α·score gen (v i ) represents the attribute risk value of node v i ; score str (v i ) represents the local structural risk value of node v i ; α and β are balance coefficients for different risk scores and are constant values. Among them, the value of α is the same as the balance coefficient α of the total loss of the model.

[0192] In this embodiment, the anomaly prediction model includes a contrastive learning network, an anomaly detection network, and an aggregator that are connected in sequence. The anomaly detection network includes a structure discriminator for detecting node structure anomalies and an attribute detection module for detecting node attribute anomalies. The contrastive learning network performs vector encoding on multiple nodes, the original structure diagram, and the high-order structure diagram pairs, and constructs sample pairs based on the encoded vectors to obtain multiple first sample pairs of the original structure diagram and multiple second samples of the high-order structure diagram pairs. Based on the multiple first sample pairs and the multiple second samples, the structure discriminator predicts node structure relationship anomalies in the original structure diagram and the high-order structure diagram to obtain the structure risk values of multiple nodes. Based on the original structure diagram and the high-order structure diagram, the attribute detection module predicts node attribute anomalies in the original structure diagram and the high-order structure diagram to obtain the attribute risk values of multiple nodes. Based on the original structure diagram and the high-order structure diagram, the attribute detection module predicts node attribute anomalies in the original structure diagram and the high-order structure diagram to obtain the attribute risk values of multiple nodes. The aggregator obtains the risk scores of nodes by aggregating the structure risk values and attribute risk values of nodes, and obtains the risk scores of multiple nodes. The calculation process of the risk scores of nodes is clarified, and the risk scores of nodes are obtained by evaluating the structure risk values and attribute risk values of nodes, improving the accuracy of the risk scores of nodes.

[0193] It should be understood that the magnitudes of the sequence numbers of the steps in the above embodiments do not imply the order of execution. The execution order of each process should be determined according to its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.

[0194] In one embodiment, a hazardous material risk detection device is provided, and the hazardous material risk detection device corresponds one-to-one with the hazardous material risk detection method in the above embodiment. As Figure 9 shown, the hazardous material risk detection device includes a construction module 901, a processing module 902, a detection module 903, and a warning module for. The detailed description of each functional module is as follows:

[0195] The construction module 901 is used to construct a graph structure according to the interaction behavior data generated during the import and export process of hazardous materials, obtain the original structure diagram of the hazardous materials in the import and export scenario, the nodes of the original structure diagram include hazardous materials and the interaction participants during the import and export process of hazardous materials, and the edges of the original structure diagram are the interaction behavior data between each node;

[0196] The processing module 902 is used to perform feature enhancement processing on the original structure diagram based on the graph diffusion algorithm to obtain a high-order structure diagram after feature enhancement. The nodes in the high-order structure diagram are the same as the nodes in the original structure diagram, and the node relationship in the high-order structure diagram is different from the node relationship in the original structure diagram;

[0197] The detection module 903 is configured to detect the abnormal risk of dangerous goods during the import and export process based on the original structure diagram and the high-order structure diagram, using a pre-trained abnormal prediction model. The abnormal prediction model is a neural network model obtained by deep learning training using multiple historical interaction behavior data of the same type of dangerous goods during the import and export process;

[0198] The early warning module is configured to give a risk warning when it detects an abnormal risk of dangerous goods during the import and export process.

[0199] Optionally, the processing module 902 is specifically configured to:

[0200] Adopt the graph diffusion algorithm to perform graph diffusion on the node relationships of the original structure diagram to obtain the diffusion matrix of the original structure diagram;

[0201] Adopt the nearest neighbor algorithm to construct a graph based on node similarity for the original structure diagram to obtain the target feature graph;

[0202] According to the diffusion matrix and the target feature graph, perform graph feature enhancement on the original structure diagram to obtain the high-order structure diagram.

[0203] Optionally, the detection module 903 is specifically configured to:

[0204] Input the original structure diagram and the high-order structure diagram into the abnormal prediction model, perform contrast learning on the original structure diagram and the high-order structure diagram pair through the contrast learning network, and based on the vector output data of the contrast learning network, perform abnormal detection on multiple nodes through the abnormal detection network to obtain the risk scores of multiple nodes;

[0205] Detect the abnormal risk of dangerous goods during the import and export process according to the risk scores of multiple nodes, and when it is detected that there are risk nodes with risk scores greater than the preset threshold among multiple nodes, determine that there is an abnormal risk of dangerous goods during the import and export process.

[0206] Optionally, the dangerous goods risk detection device further includes a training module 905, and the training module 905 is configured to:

[0207] Respectively construct the graph structures of multiple historical interaction behavior data to obtain the historical original graphs of multiple historical interaction behavior data, and respectively perform feature enhancement processing on each historical original graph to obtain the historical high-order graphs of multiple historical original structure diagrams;

[0208] Use the historical original graph and the corresponding historical high-order graph as a training sample pair to obtain multiple training sample pairs, and each training sample pair is labeled with a calibration node;

[0209] Input the training sample pairs into the preset network structure. Through the contrast learning network of the preset network structure, perform contrast learning on the training sample pairs to obtain the loss of the contrast learning network. And based on the vector output data of the contrast learning network, use the anomaly detection network of the preset network structure to perform anomaly detection on the calibration nodes to obtain the loss of the anomaly detection network.

[0210] Determine the total loss of the model according to the loss of the contrast learning network and the loss of the anomaly detection network.

[0211] When the total loss of the model does not meet the convergence condition, continue to iteratively train the parameters of the preset network structure according to multiple training sample pairs until the total loss of the model meets the convergence condition, and then output the preset network structure with converged parameters as the anomaly prediction model.

[0212] It should be noted that for the information interaction, execution process, etc. between the above-mentioned devices / units, since they are based on the same concept as the method embodiments of this application, for their specific functions and the technical effects brought, please refer to the method embodiment part specifically, and will not be elaborated here.

[0213] Those skilled in the art can clearly understand that for the convenience and conciseness of description, only the above-mentioned division of each functional unit and module is used as an example for illustration. In practical applications, the above-mentioned functions can be allocated to different functional units and modules according to needs, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. Each functional unit and module in the embodiment can be integrated into a processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of a software functional unit. In addition, the specific names of each functional unit and module are only for the convenience of mutual distinction and do not limit the protection scope of this application. The specific working processes of the units and modules in the above system can refer to the corresponding processes in the foregoing method embodiments and will not be elaborated here.

[0214] The embodiment of this application also provides an electronic device, and this electronic device can be a server. As Figure 10 shown, this electronic device 2 includes: at least one processor 20, a memory 21, and a computer program 22 stored in the memory 21 and operable on at least one processor 20. When the processor 20 executes the computer program 22, it implements the steps in any of the foregoing method embodiments, or when the processor 20 executes the computer program 22, it implements the functions of each module / unit in the foregoing device embodiments.

[0215] Exemplarily, a computer program can be divided into one or more modules / units. One or more modules / units are stored in the memory and executed by a processor to complete the present application. One or more modules / units can be a series of computer program instruction segments capable of performing specific functions, and these instruction segments are used to describe the execution process of the computer program in an electronic device.

[0216] Those skilled in the art can understand that Figure 9 merely examples of electronic devices, which do not constitute a limitation on the electronic devices. They may include more or fewer components than shown in the figure, or combine certain components, or different components. For example, an electronic device may also include input / output devices, network access devices, buses, etc.

[0217] The above-mentioned processor can be a central processing unit, or other general-purpose processors, digital signal processors, application-specific integrated circuits, field-programmable gate arrays or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc.

[0218] The memory can be an internal storage unit of the electronic device, such as the hard disk or memory of the electronic device. The memory can also be an external storage device of the electronic device, such as a plug-in hard disk, smart memory card, secure digital card, flash card, etc. equipped on the electronic device. Further, the memory can also include both the internal storage unit and the external storage device of the electronic device.

[0219] The embodiments of the present application also provide a readable storage medium. The readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned various method embodiments can be implemented.

[0220] The embodiments of the present application provide a computer program product. When the computer program product runs on a mobile terminal, the mobile terminal can implement the steps in the above-mentioned various method embodiments when executed.

[0221] When the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, to implement all or part of the processes in the above-described embodiment methods of this application, a computer program can be used to instruct the relevant hardware to complete. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, the steps of the above-described method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in the form of source code, object code, executable file, or some intermediate form, etc. The computer-readable medium can at least include: any entity or device that can carry the computer program code to the photographing device / terminal device, recording medium, computer memory, read-only memory, random access memory, electrical carrier signal, telecommunication signal, and software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk, or an optical disc, etc.

[0222] Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.

[0223] The above-described embodiments are only used to illustrate the technical solutions of this application, rather than to limit it; although this application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included in the protection scope of this application.

Claims

1. A method for detecting risk of dangerous goods, characterized in that: include: Constructing a graph structure according to the interactive behavior data generated during the import and export process of dangerous goods, and obtaining an original structure graph of the dangerous goods in the import and export scenario, wherein the nodes of the original structure graph include the dangerous goods and the interactive participants during the import and export process of the dangerous goods, and the edges of the original structure graph are the interactive behavior data between the nodes; Performing feature enhancement processing on the original structure graph based on a graph diffusion algorithm to obtain a feature-enhanced high-order structure graph, wherein the nodes in the high-order structure graph are the same as the nodes in the original structure graph, and the node relationship of the high-order structure graph is different from the node relationship of the original structure graph; Based on the original structure diagram and the high-order structure diagram, a pre-trained abnormal prediction model is used to detect abnormal risks of the dangerous goods in the import and export process, and the abnormal prediction model is a neural network model obtained by deep learning training using multiple historical interactive behavior data of the same type of dangerous goods in the import and export process; A risk warning is issued when it is detected that the dangerous goods have abnormal risks during the import and export process.

2. The method for detecting risk of dangerous goods according to claim 1, characterized in that: The process of performing feature enhancement processing on the original structure graph based on the graph diffusion algorithm to obtain a high-order structure graph after feature enhancement includes: Using the graph diffusion algorithm to perform graph diffusion on the node relationship of the original structure graph to obtain a diffusion matrix of the original structure graph; Using a nearest neighbor algorithm to construct a graph based on node similarity on the original structure graph to obtain a target feature graph; According to the diffusion matrix and the target feature graph, the graph feature of the original structure graph is enhanced to obtain the high-order structure graph.

3. The method for detecting risk of dangerous goods according to claim 2, characterized in that: The method of using a nearest neighbor algorithm to construct a graph based on node similarity on the original structure graph to obtain a target feature graph includes: Using a cosine similarity algorithm to determine the similarity between each node and other nodes in the original structure graph; Sort the nodes in descending order based on the similarity between each node and other nodes, and select a preset number of nodes as neighbor nodes of the node; Node relationship features are constructed according to each node in the original structure graph and the neighboring nodes of each node to obtain the target feature graph, in which the nodes are connected to the neighboring nodes of the nodes.

4. The method for detecting risk of dangerous goods according to claim 2, characterized in that: The step of performing graph feature enhancement on the original structure graph according to the diffusion matrix and the target feature graph to obtain the high-order structure graph includes: According to the diffusion matrix and the structure matrix of the target feature graph, noise filtering is performed on the adjacency matrix of the original structure graph to generate a high-order structure matrix; The high-order structure graph is obtained by performing graph construction according to the high-order structure matrix and the attribute matrix of the original structure graph.

5. The method for detecting risk of dangerous goods according to claim 1, characterized in that: The detecting of abnormal risks of the dangerous goods during the import and export process using a pre-trained abnormal prediction model based on the original structure diagram and the high-order structure diagram includes: Using the anomaly prediction model to perform node anomaly prediction on the original structure graph and the high-order structure graph, and obtaining risk scores of multiple nodes in the original structure graph; According to the risk scores of the multiple nodes, the abnormal risks of the dangerous goods in the import and export process are detected. When it is detected that there is a risk node with a risk score greater than a preset threshold among the multiple nodes, it is determined that the dangerous goods have abnormal risks in the import and export process.

6. The method for detecting risk of dangerous goods according to any one of claims 1 to 5, characterized in that: The abnormal prediction model is trained in the following way: Constructing graph structures for the plurality of historical interaction behavior data respectively to obtain the plurality of historical original graphs of the historical interaction behavior data, and performing feature enhancement processing on each of the historical original graphs respectively to obtain the plurality of historical high-order graphs of the historical original graphs; Using the historical original graph and the corresponding historical high-order graph as training sample pairs, a plurality of training sample pairs are obtained, each of the training sample pairs is annotated with a calibration node; Input the training sample pair into a preset network structure, perform contrastive learning on the training sample pair through a contrastive learning network of the preset network structure to obtain a loss of the contrastive learning network, and perform anomaly detection on the calibration node through an anomaly detection network of the preset network structure based on vector output data of the contrastive learning network to obtain a loss of the anomaly detection network; Determining a total model loss based on the loss of the contrastive learning network and the loss of the anomaly detection network; When the total loss of the model does not meet the convergence condition, the parameters of the preset network structure continue to be iteratively trained according to the multiple training samples until the total loss of the model meets the convergence condition, and the preset network structure with converged parameters is output as the abnormality prediction model.

7. A dangerous goods risk detection device, characterized in that: include: A construction module is used to construct a graph structure according to the interactive behavior data generated during the import and export process of dangerous goods, and obtain an original structure graph of the dangerous goods in the import and export scenario, wherein the nodes of the original structure graph include the dangerous goods and the interactive participants in the import and export process of the dangerous goods, and the edges of the original structure graph are the interactive behavior data between the nodes; A processing module, used for performing feature enhancement processing on the original structure graph based on a graph diffusion algorithm to obtain a high-order structure graph after feature enhancement, wherein the nodes in the high-order structure graph are the same as the nodes in the original structure graph, and the node relationship of the high-order structure graph is different from the node relationship of the original structure graph; A detection module, for detecting abnormal risks of the dangerous goods in the import and export process using a pre-trained abnormal prediction model based on the original structure diagram and the high-order structure diagram, wherein the abnormal prediction model is a neural network model obtained by deep learning training using multiple historical interactive behavior data of the same type of dangerous goods in the import and export process; The early warning module is used to issue a risk warning when it is detected that the dangerous goods have abnormal risks during the import and export process.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the electronic device implements the dangerous goods risk detection method as described in any one of claims 1 to 6.

9. A readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the dangerous goods risk detection method according to any one of claims 1 to 6 is implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed, the dangerous goods risk detection method according to any one of claims 1 to 6 is executed.

Citation Information

Patent Citations

  • Dynamic graph data abnormal edge detection method and system based on graph neural network

    CN118690292A

  • Abnormal commodity detection model construction method and system based on label sparse heterogeneous graph

    CN118885938A

  • Risk information detection method and device and electronic equipment

    CN118886909A

  • Goods import and export customs clearance risk identification method and equipment

    CN118966794A

  • Programmed abnormal security transaction risk identification method and device, computer equipment and storage medium

    CN118967131A

Cited By

  • Abnormality detection method and device, terminal equipment and computer readable storage medium

    CN120744772A

  • Abnormality detection method, device, terminal device, and computer-readable storage medium

    CN120744772B