Oil supply chain risk assessment and early warning method, system, equipment and medium

By constructing time-series data features and deploying intelligent agents, the shortcomings of traditional oil supply chain risk assessment methods are addressed, enabling real-time risk monitoring and intelligent early warning of the oil supply chain, and improving the accuracy and speed of risk identification and prediction.

CN121599463APending Publication Date: 2026-03-03NO 30 INST OF CHINA ELECTRONIC TECH GRP CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511713624.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-21
Publication Date
2026-03-03

AI Technical Summary

Technical Problem

Traditional oil supply chain risk assessment methods rely on expert experience and static statistical analysis, which are difficult to cope with complex and ever-changing risk environments and lack real-time monitoring and intelligent early warning capabilities.

Method used

By acquiring real-time monitoring data from each link of the oil supply chain, time-series data is constructed. Features are extracted using a time-series coding layer and a feature interaction layer. Noise is removed by combining a conditional diffusion model. A Gaussian prior distribution model is constructed. An intelligent agent is deployed to conduct local risk assessment. Regional division and group decision-making are performed through spectral clustering and graph attention mechanisms to generate risk prevention and control strategies.

Benefits of technology

It enables accurate identification and prediction of risk propagation paths in the complex network structure of the oil supply chain, improves the accuracy and timeliness of risk warning, enhances the system's ability to perceive potential risks and its response speed, and ensures the security of information transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121599463A_ABST
    Figure CN121599463A_ABST
Patent Text Reader

Abstract

The invention provides an oil supply chain risk assessment and early warning method, system and device and a medium, and relates to the technical field of oil supply chain safety management, and the method comprises the steps: obtaining time sequence data, carrying out the feature extraction through employing a time sequence coding and feature interaction fusion technology in combination with a conditional diffusion model, constructing a Gaussian prior distribution model, and obtaining risk representation. Regional optimization is realized based on agent group decision and a graph attention mechanism, and finally a risk prevention and control strategy is generated and early warning information is pushed. The risk identification accuracy can be improved, the resource configuration is optimized, and the supply chain toughness is enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of oil supply chain security management technology, and in particular to a method, system, equipment and medium for oil supply chain risk assessment and early warning. Background Technology

[0002] With the continuous growth of global energy demand, oilseeds, as an important energy source and industrial raw material, require a secure and stable supply chain that is crucial for national economic development and social stability. The oilseed supply chain involves multiple stages, including exploration, extraction, storage, transportation, processing, and sales, all interconnected to form a complex network structure. However, the oilseed supply chain faces various risk factors, such as natural disasters, equipment failures, human error, and cybersecurity threats. These risks can lead to serious consequences such as supply disruptions, price fluctuations, and environmental pollution. Therefore, establishing a scientific and effective risk assessment and early warning mechanism for the oilseed supply chain is of significant practical importance for ensuring oil supply security and safeguarding national energy security.

[0003] Traditional risk assessment methods for the oil supply chain primarily rely on expert judgment and static statistical analysis, which are ill-suited to address complex and ever-changing risk environments. With the development of technologies such as the Internet of Things, big data, and artificial intelligence, intelligent risk assessment methods based on real-time monitoring data are gaining increasing attention. Currently, scholars both domestically and internationally have conducted a series of related studies, including risk identification based on data mining, risk prediction based on machine learning, and risk collaborative prevention and control based on multi-agent systems, providing technical support for the safety management of the oil supply chain. Summary of the Invention

[0004] This invention provides a method, system, equipment, and medium for risk assessment and early warning in the oil supply chain, which can solve the problems in the prior art.

[0005] A first aspect of this invention provides a method for intelligent safety risk assessment and early warning in the oil supply chain, comprising: Acquire real-time monitoring data from each link of the oil supply chain, and construct time-series data from the real-time monitoring data based on the sampling time; For the time-series data, a time-series coding layer is used to obtain position coding features, which are then input into a feature interaction layer to obtain feature interaction results. The feature interaction results are then input into a feature fusion layer to obtain fused features. The fused features are then combined with a conditional diffusion model for denoising to obtain time-series features. A Gaussian prior distribution model is constructed based on temporal features to obtain a risk representation vector. Based on the risk representation vector, agents are deployed at target nodes in the supply chain. Each agent receives the risk representation vector of the corresponding target node and outputs a local risk assessment result. Spectral clustering is performed on the local risk assessment value to obtain the communication region division result, and the graph attention anomaly score is calculated; the state assessment value is calculated based on the graph attention anomaly score, and nonlinear mapping is performed to obtain the agent decision output, thereby realizing the regional optimization of group decision-making. During the agent interaction process, a nonlinear dynamic equation containing local dynamics terms, time-varying coupling terms, and entropy-driven nonlinear dynamic equations is constructed, and a risk prevention and control strategy is generated based on the risk propagation trajectory. The risk control strategy is decomposed into action sequences and features are extracted. These features are concatenated with the risk representation vector. An adaptive optimization algorithm is used to calculate the risk assessment score, determine the risk level, and push encrypted early warning information to relevant management personnel through a secure communication channel.

[0006] For the time-series data, a time-series coding layer is used to obtain positional coding features, which are then input into a feature interaction layer to obtain feature interaction results. These results are then input into a feature fusion layer to obtain fused features. The fused features are combined with a conditional diffusion model for denoising to obtain time-series features, including: The time-series data is position-encoded by a time-series coding layer. The position coding uses sine and cosine functions to generate a position coding matrix to characterize the positional dependency of the time-series data and obtain position coding features. Based on the temporal features after location encoding, a query matrix and a key-value matrix are constructed and input into the feature interaction layer. The feature interaction layer uses a multi-head self-attention mechanism to calculate the attention weights of the query matrix and the key-value matrix, and extracts the temporal features in a weighted manner according to the attention weights to obtain feature interaction results containing long-term and short-term dependencies. The feature interaction results are input into the feature fusion layer, and residual connections are made between the feature interaction results and the output of the sub-layer network. The results of the residual connections are then subjected to layer normalization to obtain the fused features. The fused features are input as conditional information into the conditional diffusion model. The conditional diffusion model first performs forward diffusion on the input features to obtain noisy features, and then uses the conditional information to guide feature denoising during the back diffusion process. The mean and variance are predicted through a parameterized network to obtain the denoised temporal features.

[0007] A Gaussian prior distribution model is constructed based on temporal features to obtain a risk representation vector. Based on the risk representation vector, agents are deployed at target nodes in the supply chain. Each agent receives the risk representation vector of the corresponding target node and outputs local risk assessment results, including: Based on the aforementioned time series characteristics, the mean function and covariance function of the Gaussian distribution are constructed, and the conditional probability density of the Gaussian prior distribution is calculated to generate a risk characterization vector. A state space is constructed based on the risk representation vector and historical state information, while an action space is constructed based on the deployment location and resource allocation ratio of the agent. A deep reinforcement learning network is constructed based on the state space and action space. The network parameters are iteratively optimized by maximizing the action value function to obtain the specific deployment location and resource allocation ratio of the agent, and the agent is deployed at the target node of the supply chain accordingly. The agent receives the risk representation vector of the corresponding target node, and calculates the anomaly, volatility, and trend of the target node based on the risk representation vector. The anomaly is calculated by the degree of deviation from the historical data distribution, the volatility is calculated by the difference from the state of neighboring nodes, and the trend is calculated by the first derivative of the time series change. The anomaly, volatility, and trend are weighted and combined using an adaptive weighting method based on confidence, and the local risk assessment value of the target node is output.

[0008] Perform spectral clustering on the local risk assessment values ​​to obtain communication region partitioning results, and calculate graph attention anomaly scores; calculate state assessment values ​​based on the graph attention anomaly scores, perform nonlinear mapping to obtain agent decision outputs, and achieve regional optimization of group decision-making, including: The feature matrix and adjacency matrix of the target node risk representation vector are obtained. The node feature matrix and the adjacency matrix are input into the graph neural network. The hierarchical feature representation of the target node in the supply chain is obtained through the feature propagation function. The dual exponential similarity matrix is ​​constructed by combining the location distance of the target node and the local risk assessment value. The spectral clustering operation is performed based on the dual exponential similarity matrix to obtain the intelligent agent communication region division result. Based on the communication region division results, a normal distribution encoder is used to map the agent features within the region into latent representation vectors. The latent representation vectors are then reconstructed using a nonlinear decoder to obtain reconstructed features. The deviation between the agent features and the reconstructed features is calculated to obtain the graph attention anomaly score. The graph attention anomaly scores are used to construct an agent observation matrix, and the observation errors with neighboring agents are calculated. The weighted combination is used to obtain a state estimate. The state estimate is then nonlinearly mapped to obtain the agent decision output. The agent decision output is then transmitted between different communication regions through a boundary operator to achieve regional optimization of group decision-making.

[0009] During agent interaction, a nonlinear dynamic equation containing local dynamics terms, time-varying coupling terms, and entropy-driven equations is constructed, and a risk prevention and control strategy is generated based on the risk propagation trajectory, including: The system obtains the regional optimization position coordinates and local risk assessment values ​​of the agent group, constructs the agent state vector, and establishes local dynamics terms and time-varying coupling terms based on the agent state vector; calculates the phase synchronization state of the agent group, constructs the state transition probability matrix between agents, calculates the local information entropy based on the state transition probability matrix, establishes the negative gradient of the local information entropy as the entropy driving term, and constructs a nonlinear dynamic equation by combining the local dynamics terms and the time-varying coupling terms. The topological association features between agents are extracted based on graph neural networks, and the dynamic evolution features of the agent group are captured using a temporal graph attention mechanism. The risk propagation trajectory of the agent group is obtained based on the topological association features and the dynamic evolution features, and a risk avoidance vector field is constructed. Based on the risk avoidance vector field and nonlinear dynamic equations, a risk prevention and control strategy is generated, which includes risk avoidance direction, risk avoidance speed, and safety distance.

[0010] The local information entropy is calculated based on the state transition probability matrix, and the negative gradient of the local information entropy is established as the entropy driving term, including: The local information entropy of each agent is calculated based on the state transition probability matrix, and the local information entropy is then subjected to spatiotemporal weighting to obtain the weighted local information entropy. The formula for calculating the weighted local information entropy is as follows: , in, H i ( t ) is the first i An intelligent agent in t Weighted local information entropy at time step, N i For the first i The set of neighboring intelligent agents of an intelligent agent, α k For the first k Spatial weight coefficients of each neighboring agent H k ( t ) is the first k A neighboring intelligent agent in t Local information entropy at time t, β The time dimension weighting coefficient, T The length of the historical time window. c T-τ For time decay weight, H i ( t ) is the first i An intelligent agent at a historical moment t The local information entropy; calculate the negative gradient of the weighted local information entropy with respect to the state vector, using the following formula: , in, For the first i An intelligent agent in t The weighted local entropy negative gradient at time step [time]. x i ( t ) is the first i An intelligent agent in t The state vector at any given time; Multiplying the negative gradient by the adaptive gain function yields the entropy-driving term, and the formula for calculating the adaptive gain function is as follows: , in, l ( t ) is the adaptive gain function. l 0 Basic gain coefficient, or For adjustment coefficients, H i ( t ) is the first i An intelligent agent in t Weighted local information entropy at time step, H th This is the preset entropy threshold.

[0011] A second aspect of this invention provides an intelligent safety risk assessment and early warning system for the oil supply chain, comprising: The first unit is used to acquire real-time monitoring data of each link in the oil supply chain and construct time-series data based on the sampling time. The second unit is used to obtain position coding features from the time-series data using a time-series coding layer, input the feature interaction layer to obtain feature interaction results, input the feature interaction results to a feature fusion layer to obtain fused features, and combine the fused features with a conditional diffusion model for denoising to obtain time-series features. The third unit is used to construct a Gaussian prior distribution model based on time-series features to obtain a risk representation vector; based on the risk representation vector, intelligent agents are deployed at the target nodes of the supply chain, and each intelligent agent receives the risk representation vector of the corresponding target node and outputs the local risk assessment result. The fourth unit is used to perform spectral clustering on the local risk assessment value to obtain the communication region division result and calculate the graph attention anomaly score; calculate the state assessment value based on the graph attention anomaly score, perform nonlinear mapping to obtain the agent decision output, realize the regional optimization of group decision-making, construct nonlinear dynamic equations containing local dynamics terms, time-varying coupling terms and entropy-driven during the agent interaction process, and generate risk prevention and control strategies based on the risk propagation trajectory. The fifth unit is used to decompose the risk prevention and control strategy into action sequences and extract features, concatenate the features with the risk representation vector, calculate the risk assessment score using an adaptive optimization algorithm, determine the risk level, and push encrypted early warning information to relevant management personnel through a secure communication channel.

[0012] A third aspect of the present invention, An electronic device is provided, comprising: processor; Memory used to store processor-executable instructions; The processor is configured to invoke instructions stored in the memory to execute the aforementioned method.

[0013] Fourth aspect of the embodiments of the present invention, A computer-readable storage medium is provided, having stored thereon computer program instructions that, when executed by a processor, implement the aforementioned method.

[0014] The beneficial effects of this application are as follows: This invention constructs time-series data by acquiring real-time monitoring data from each link of the oil supply chain, and extracts time-series features by combining a time-series coding layer and a feature interaction layer with a conditional diffusion model. This effectively captures deep-seated patterns and trend changes in the data, improves the accuracy of risk characterization, and provides a reliable data foundation for subsequent risk assessment.

[0015] This invention deploys intelligent agents at target nodes in the supply chain, divides communication regions through spectral clustering, calculates anomaly scores based on graph attention mechanisms, and constructs nonlinear dynamic equations to simulate risk propagation. This enables accurate identification and prediction of risk propagation paths in the complex network structure of the oil supply chain, enhancing the system's ability to perceive potential risks and its response speed.

[0016] This invention decomposes risk control strategies into action sequences and concatenates them with risk representation vectors. It uses an adaptive optimization algorithm to calculate risk assessment scores and pushes encrypted early warning information through a secure communication channel. This not only improves the accuracy and timeliness of risk warnings but also ensures the security of information transmission, providing managers with scientific decision support and effectively reducing the security risks in the oil supply chain. Attached Figure Description

[0017] Figure 1 This is a flowchart illustrating an intelligent safety risk assessment and early warning method for the oil supply chain according to an embodiment of the present invention. Figure 2 This is a schematic diagram of a supply chain risk assessment system architecture based on time-series characteristics. Detailed Implementation

[0018] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0019] The technical solution of the present invention will be described in detail below with reference to specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.

[0020] Figure 1 This is a flowchart illustrating an intelligent safety risk assessment and early warning method for the oil supply chain according to an embodiment of the present invention. Figure 1 As shown, the method includes: Acquire real-time monitoring data from each link of the oil supply chain, and construct time-series data from the real-time monitoring data based on the sampling time; For the time-series data, a time-series coding layer is used to obtain position coding features, which are then input into a feature interaction layer to obtain feature interaction results. The feature interaction results are then input into a feature fusion layer to obtain fused features. The fused features are then combined with a conditional diffusion model for denoising to obtain time-series features. A Gaussian prior distribution model is constructed based on temporal features to obtain a risk representation vector. Based on the risk representation vector, agents are deployed at target nodes in the supply chain. Each agent receives the risk representation vector of the corresponding target node and outputs a local risk assessment result. Spectral clustering is performed on the local risk assessment value to obtain the communication region division result, and the graph attention anomaly score is calculated; the state assessment value is calculated based on the graph attention anomaly score, and nonlinear mapping is performed to obtain the agent decision output, thereby realizing the regional optimization of group decision-making. During the agent interaction process, a nonlinear dynamic equation containing local dynamics terms, time-varying coupling terms, and entropy-driven nonlinear dynamic equations is constructed, and a risk prevention and control strategy is generated based on the risk propagation trajectory. The risk control strategy is decomposed into action sequences and features are extracted. These features are concatenated with the risk representation vector. An adaptive optimization algorithm is used to calculate the risk assessment score, determine the risk level, and push encrypted early warning information to relevant management personnel through a secure communication channel.

[0021] In one optional implementation, the time-series data is processed by a time-series coding layer to obtain positional coding features, which are then input into a feature interaction layer to obtain feature interaction results. These results are then input into a feature fusion layer to obtain fused features. Finally, the fused features are combined with a conditional diffusion model for denoising to obtain time-series features, including: The time-series data is position-encoded by a time-series coding layer. The position coding uses sine and cosine functions to generate a position coding matrix to characterize the positional dependency of the time-series data and obtain position coding features. Based on the temporal features after location encoding, a query matrix and a key-value matrix are constructed and input into the feature interaction layer. The feature interaction layer uses a multi-head self-attention mechanism to calculate the attention weights of the query matrix and the key-value matrix, and extracts the temporal features in a weighted manner according to the attention weights to obtain feature interaction results containing long-term and short-term dependencies. The feature interaction results are input into the feature fusion layer, and residual connections are made between the feature interaction results and the output of the sub-layer network. The results of the residual connections are then subjected to layer normalization to obtain the fused features. The fused features are input as conditional information into the conditional diffusion model. The conditional diffusion model first performs forward diffusion on the input features to obtain noisy features, and then uses the conditional information to guide feature denoising during the back diffusion process. The mean and variance are predicted through a parameterized network to obtain the denoised temporal features.

[0022] This invention discloses a time-series data processing method that achieves efficient processing and feature extraction of time-series data through the collaborative work of a time-series coding layer, a feature interaction layer, a feature fusion layer, and a conditional diffusion model.

[0023] In a specific implementation, the time-series data to be processed is acquired. This time-series data can be continuous stock price data, meteorological monitoring data, or time-series data collected by industrial sensors. For example, for the operating status monitoring data of a certain power equipment, which includes multi-dimensional features such as temperature, humidity, and vibration, the sampling frequency is once per minute, and the data is collected continuously for 7 days, forming a time-series data matrix of shape [10080, 5], where 10080 represents the time step and 5 represents the feature dimension.

[0024] The acquired time-series data is position-encoded using a time-series coding layer to capture the temporal dependencies of the data. Position coding uses sine and cosine functions to generate a position coding matrix; specifically, for each position... i and dimensions d Location code PE ( i ,2 d )=sin( i / 10000 (2d / dmodel) ), PE (i ,2 d +1)=cos( i / 10000 (2d / dmodel) ),in dmodel The model dimension is set to 128. This encoding method enables the model to perceive the relative relationships between different locations in time-series data. For example, for the power equipment monitoring data mentioned above, a location encoding matrix with a shape of [10080, 128] is generated and combined with the original features to obtain the location-encoded feature representation.

[0025] Based on the temporal features after position encoding, a query matrix Q, a key matrix K, and a value matrix V are constructed. Specifically, the input feature X is transformed into Q, K, and V through three different linear transformation matrices WQ, WK, and WV, i.e., Q = X·WQ, K = X·WK, and V = X·WV. In the actual implementation, WQ, WK, and WV are all weight matrices with a shape of [128, 64], and the Xavier method is used for initialization, so that the generated Q, K, and V all have a dimension of 64.

[0026] The constructed Q, K, and V matrices are input into the feature interaction layer, which uses a multi-head self-attention mechanism to calculate attention weights and extract features. In this embodiment, an 8-head attention mechanism is used, with each attention head having a dimension of 8 and the overall dimension remaining at 64. The implementation process of the multi-head attention mechanism is as follows: Q, K, and V are divided into 8 sub-matrices, each with a dimension of [10080, 8]. For each attention head, the dot product of Q and K is calculated to obtain the original attention score, which is then normalized by dividing by the scaling factor sqrt(8) and applying the softmax function to obtain the attention weights. The attention weights are used to perform a weighted summation on V to obtain the output of each attention head. The outputs of the 8 attention heads are concatenated and a linear transformation is performed to obtain the final feature interaction result with a dimension of [10080, 64].

[0027] Through a multi-head self-attention mechanism, the model can simultaneously focus on dependencies at different time scales. For example, in detecting temperature anomalies in power equipment, some attention heads focus on short-term temperature fluctuations, while others focus on long-term temperature trends, thereby comprehensively capturing complex patterns in time-series data.

[0028] The feature interaction results are input to the feature fusion layer for residual connection and normalization. Specifically, the feature fusion layer consists of two sub-layers: a multi-head self-attention sub-layer and a feedforward neural network sub-layer. For each sub-layer, the input is first processed by the sub-layer, and then residually connected to the original input, i.e., Z = LayerNorm(X + Sublayer(X)). The feedforward neural network consists of two linear transformations with a ReLU activation function in between, i.e., FFN(…).x )=max(0, x W1+b1)W2+b2, where W1 has dimensions [64, 256] and W2 has dimensions [256, 64]. Layer normalization standardizes each feature dimension by calculating the mean and variance, ensuring training stability. After processing by the feature fusion layer, the fused features are obtained, maintaining dimensions [10080, 64].

[0029] The fused features are input as conditional information into the conditional diffusion model to guide the feature denoising process. The conditional diffusion model consists of two processes: forward diffusion and backward diffusion. During the forward diffusion process, Gaussian noise is progressively added to the input feature x0 to generate a noisy feature sequence. x 1 , x 2 ,..., x T Specifically, regarding time steps t , x ( t =sqrt( αt )· x ( t -1)+sqrt(1- αt )· e ,in e Standard Gaussian noise, αt The predefined noise scheduling parameters are gradually decreased from 0.9999 to 0.98.

[0030] During backdiffusion, the model learns how to recover the original data from the noisy data. The conditional diffusion model uses a U-Net-structured neural network to parameterize the noise prediction function and receives the current noise features. x ( t ), time step t and condition information c As input, the noise to be added is predicted. U-Net consists of four downsampling layers and four upsampling layers, each using residual blocks and an attention mechanism, with intermediate dimensions of 128, 256, 512, and 1024 respectively. Conditional information is incorporated into each layer of U-Net through a cross-attention mechanism to guide the denoising process. During sampling, from... x T Begin by gradually applying the denoising formula. x ( t -1)=( x ( t )-sqrt(1- αt )·predicted_noise) / sqrt( αt )+ s · zWhere z is the new standard Gaussian noise, s This is the predefined sampling variance.

[0031] After multiple iterative denoising steps, the recovered temporal features are finally obtained. x 0 For example, in the task of detecting abnormal temperatures in power equipment, the denoised features can more accurately reflect the normal temperature pattern of the equipment, effectively filtering out random fluctuations and abnormal interference, and providing a reliable foundation for subsequent anomaly detection. Experimental results show that the anomaly detection accuracy of this method reaches 95.6% on multiple time-series datasets, which is 8.3 percentage points higher than that of traditional methods.

[0032] Figure 2 This is a schematic diagram of a supply chain risk assessment system architecture based on time-series features. In one optional implementation, a Gaussian prior distribution model is constructed based on time-series features to obtain a risk representation vector; based on the risk representation vector, agents are deployed at target nodes in the supply chain. Each agent receives the risk representation vector corresponding to the target node and outputs a local risk assessment result, including: Based on the aforementioned time series characteristics, the mean function and covariance function of the Gaussian distribution are constructed, and the conditional probability density of the Gaussian prior distribution is calculated to generate a risk characterization vector. A state space is constructed based on the risk representation vector and historical state information, while an action space is constructed based on the deployment location and resource allocation ratio of the agent. A deep reinforcement learning network is constructed based on the state space and action space. The network parameters are iteratively optimized by maximizing the action value function to obtain the specific deployment location and resource allocation ratio of the agent, and the agent is deployed at the target node of the supply chain accordingly. The agent receives the risk representation vector of the corresponding target node, and calculates the anomaly, volatility, and trend of the target node based on the risk representation vector. The anomaly is calculated by the degree of deviation from the historical data distribution, the volatility is calculated by the difference from the state of neighboring nodes, and the trend is calculated by the first derivative of the time series change. The anomaly, volatility, and trend are weighted and combined using an adaptive weighting method based on confidence, and the local risk assessment value of the target node is output.

[0033] This implementation provides a supply chain risk assessment method based on time-series characteristics. It obtains risk representation vectors by constructing a Gaussian prior distribution model and deploys intelligent agents at target nodes in the supply chain to conduct local risk assessments.

[0034] When constructing a Gaussian prior distribution model, it is necessary to collect time-series characteristic data of each node in the supply chain, including key indicators such as inventory levels, order fulfillment rates, and delivery times. For the time-series characteristics of each node, the mean function and covariance function of the Gaussian distribution are constructed. The mean function is calculated by an exponentially weighted moving average of historical data; for example, the average inventory level of a supplier node is 500 units, and the average order fulfillment rate is 92%. The covariance function is obtained by calculating the correlation matrix between features; for example, the covariance between inventory level and order fulfillment rate is -0.35, indicating a negative correlation. Based on the constructed mean function and covariance function, the conditional probability density of the Gaussian prior distribution is calculated, forming a risk representation vector. For example, for a manufacturer node, its risk representation vector can be represented as [0.78, 0.45, 0.92, 0.23, 0.67], corresponding to the probability distribution characteristics of different risk factors.

[0035] During the agent deployment phase, a state space is constructed based on risk representation vectors and historical state information. The state space includes the risk representation vector of the target node, the risk status of surrounding nodes, and historical abnormal event records. For example, the state of a distribution center can be represented by its current risk representation vector [0.65, 0.72, 0.38, 0.91] combined with its historical abnormal event frequency of 0.12 times / month. Simultaneously, the agent's deployment location and resource allocation ratio are constructed as an action space. The action space includes a set of selectable target nodes and their corresponding computational resource allocation ratios. For example, if 3 out of 5 key nodes are selected for deployment, the resource allocation ratio can be adjusted within the range of [0.1, 0.5]. Based on the constructed state and action spaces, a deep reinforcement learning network is designed. The network consists of an input layer, three fully connected hidden layers, and an output layer, with 256, 128, and 64 neurons in the hidden layers, respectively. Parameters are iteratively optimized by maximizing the action value function, which considers factors such as risk detection accuracy, resource utilization efficiency, and response time. After 10,000 rounds of iterative training, the model converges to a stable state, yielding the optimal deployment location and resource allocation ratio of the agents. For example, in a supply chain network, agents are deployed at three nodes: raw material suppliers (resource ratio 0.25), main manufacturing plants (resource ratio 0.45), and regional distribution centers (resource ratio 0.3).

[0036] After the agents are deployed, each agent receives the risk representation vector of its corresponding target node and calculates the target node's risk indicators based on this vector, including anomaly, volatility, and trend. Anomaly is obtained by calculating the Mahalanobis distance between the current risk representation vector and the historical data distribution, reflecting the degree of deviation of the node's state from its normal state. For example, a manufacturer node with a current anomaly of 0.78 indicates a significant difference between its state and its historical normal state. Volatility is obtained by calculating the average Euclidean distance between the target node and the states of its directly connected neighboring nodes, reflecting the relative instability of the node in the supply network. For example, a distribution center with an average state difference of 0.35 with its upstream and downstream nodes indicates a relatively stable network position. Trend is obtained by calculating the first difference of the risk representation vector time-series data and then normalizing it, reflecting the direction and rate of change of the risk state. For example, a retailer node with a trend of -0.42 indicates that its risk state is improving.

[0037] When calculating the overall risk assessment value, an adaptive weighting method based on confidence level is used to weight the anomaly, volatility, and trend. The confidence level is calculated based on the amount of historical data, data quality, and prediction accuracy. For example, when the confidence level for anomaly is 0.85, the confidence level for volatility is 0.75, and the confidence level for trend is 0.65, the corresponding weights can be calculated as [0.38, 0.33, 0.29]. Applying these weights yields the final local risk assessment value; for example, a risk assessment value of 0.72 for a certain node indicates a relatively high risk level.

[0038] This method enables the system to perform real-time risk monitoring and assessment at key nodes in the supply chain network, providing data support for risk management decisions. Experimental results show that compared with traditional risk assessment methods, this method improves the accuracy of risk warning by 15.3% and increases the lead time for risk event detection by an average of 2.7 days, providing supply chain managers with more timely and accurate risk perception capabilities.

[0039] In one optional implementation, spectral clustering is performed on the local risk assessment values ​​to obtain communication region partitioning results, and a graph attention anomaly score is calculated; based on the graph attention anomaly score, a state assessment value is calculated, and a nonlinear mapping is performed to obtain the agent's decision output, thereby achieving regional optimization of group decision-making, including: The feature matrix and adjacency matrix of the target node risk representation vector are obtained. The node feature matrix and the adjacency matrix are input into the graph neural network. The hierarchical feature representation of the target node in the supply chain is obtained through the feature propagation function. The dual exponential similarity matrix is ​​constructed by combining the location distance of the target node and the local risk assessment value. The spectral clustering operation is performed based on the dual exponential similarity matrix to obtain the intelligent agent communication region division result. Based on the communication region division results, a normal distribution encoder is used to map the agent features within the region into latent representation vectors. The latent representation vectors are then reconstructed using a nonlinear decoder to obtain reconstructed features. The deviation between the agent features and the reconstructed features is calculated to obtain the graph attention anomaly score. The graph attention anomaly scores are used to construct an agent observation matrix, and the observation errors with neighboring agents are calculated. The weighted combination is used to obtain a state estimate. The state estimate is then nonlinearly mapped to obtain the agent decision output. The agent decision output is then transmitted between different communication regions through a boundary operator to achieve regional optimization of group decision-making.

[0040] In this embodiment, spectral clustering is performed on the local risk assessment values ​​to obtain the communication region division results, and graph attention anomaly scores are calculated. This process is achieved by obtaining the feature matrix and adjacency matrix of the target node risk representation vector. The feature matrix contains attribute information for each target node, such as node type, historical interaction records, and risk rating; the adjacency matrix represents the connection relationships between nodes. i and nodes j If a connection exists, the value at the corresponding position in the adjacency matrix is ​​1; otherwise, it is 0. These two matrices are input into a graph neural network, and a hierarchical feature representation of the target nodes in the supply chain is obtained through a feature propagation function. The feature propagation function employs a message passing mechanism to aggregate information from neighboring nodes. Specifically, a multilayer perceptron is used for feature transformation, with the output of each layer serving as the input to the next. After multiple layers of propagation, each node obtains a comprehensive representation containing information from its surrounding nodes.

[0041] A dual-exponential similarity matrix is ​​constructed by combining the location distance of target nodes and their local risk assessment values. The location distance is calculated using Euclidean distance; assuming node A is located at coordinates (3, 4) and node B is located at coordinates (6, 8), the distance between them is 5. The local risk assessment value is calculated based on the node's own risk characteristics, such as historical default records and abnormal fund flows, resulting in a weighted risk value of 0.75. The construction of the dual-exponential similarity matrix considers both factors: when two nodes are close in location and have similar risk assessment values, their similarity is high; conversely, it is low. For example, if the distance similarity between node pairs (A, B) is 0.8 and the risk similarity is 0.9, the overall similarity is 0.85.

[0042] Spectral clustering is performed based on a dual exponential similarity matrix to divide nodes into different communication regions. The spectral clustering operation includes constructing a Laplacian matrix, calculating eigenvalues ​​and eigenvectors, selecting the k smallest eigenvectors to form a feature space, and applying the K-means clustering algorithm within this space. Through this process, 100 nodes are divided into 5 communication regions, each containing a set of nodes with similar risk assessment values ​​and location distances.

[0043] Based on the communication region segmentation results, a normal distribution encoder is used to map agent features within the region into latent representation vectors. The encoder consists of a multi-layer fully connected network, with agent features as input (such as risk assessment value 0.75, region number 3, connectivity degree 8, etc.) and a 64-dimensional latent representation vector as output. A nonlinear decoder reconstructs the latent representation vector to obtain reconstructed features. The decoder also consists of a multi-layer fully connected network, but with the structure reversed compared to the encoder. Its input is the latent representation vector, and its output is the reconstructed feature with the same dimension as the original feature.

[0044] The deviation between the agent's original features and the reconstructed features is used to obtain the graph attention anomaly score. Assuming the original features are [0.75, 3, 8] and the reconstructed features are [0.72, 3, 7.8], the Euclidean distance between them yields an anomaly score of 0.28. This anomaly score reflects the degree of anomalousness of a node within its region; a higher score indicates a more anomalous node.

[0045] The graph attention anomaly scores are used to construct the agent observation matrix, and the observation errors with neighboring agents are calculated. Assuming agent A has an anomaly score of 0.28, and its neighboring agents B, C, and D have anomaly scores of 0.31, 0.25, and 0.35 respectively, then the observation errors between A and its neighboring agents are 0.03, 0.03, and 0.07 respectively. These errors are weighted and combined to obtain the state estimate. The weights are determined based on the connection strength between agents. For example, when the connection strengths are 0.4, 0.3, and 0.3 respectively, the weighted combination yields a state estimate of 0.042.

[0046] The agent's decision output is obtained by performing a nonlinear mapping on the state estimate. The nonlinear mapping uses the Sigmoid function to map the state estimate of 0.042 to the decision output of 0.51. The decision output represents the agent's response strategy to the current state, such as resource allocation ratios or risk-avoidance behavior.

[0047] By transmitting the agent's decision outputs between different communication regions through boundary operators, regional optimization of group decision-making is achieved. The boundary operators identify nodes located at the boundaries of different communication regions. These nodes can receive and transmit decision information from multiple regions. For example, node E, located at the boundary of region 1 and region 2, receives the average decision output of 0.53 from nodes in region 1 and the average decision output of 0.48 from nodes in region 2. A weighted average is then used to obtain a comprehensive decision output of 0.51, which is then transmitted to other nodes in both regions.

[0048] Through the above methods, this invention realizes communication area division based on local risk assessment, graph attention anomaly detection, and cross-regional decision optimization, effectively improving the decision-making efficiency and accuracy of swarm intelligence systems.

[0049] In one optional implementation, during agent interaction, a nonlinear dynamic equation comprising local dynamics terms, time-varying coupling terms, and entropy-driven equations is constructed, and a risk prevention and control strategy is generated based on the risk propagation trajectory, including: The system obtains the regional optimization position coordinates and local risk assessment values ​​of the agent group, constructs the agent state vector, and establishes local dynamics terms and time-varying coupling terms based on the agent state vector; calculates the phase synchronization state of the agent group, constructs the state transition probability matrix between agents, calculates the local information entropy based on the state transition probability matrix, establishes the negative gradient of the local information entropy as the entropy driving term, and constructs a nonlinear dynamic equation by combining the local dynamics terms and the time-varying coupling terms. The topological association features between agents are extracted based on graph neural networks, and the dynamic evolution features of the agent group are captured using a temporal graph attention mechanism. The risk propagation trajectory of the agent group is obtained based on the topological association features and the dynamic evolution features, and a risk avoidance vector field is constructed. Based on the risk avoidance vector field and nonlinear dynamic equations, a risk prevention and control strategy is generated, which includes risk avoidance direction, risk avoidance speed, and safety distance.

[0050] This embodiment discloses a method for constructing nonlinear dynamic equations and generating risk control strategies during agent interaction. The method obtains the optimized regional position coordinates and local risk assessment values ​​of an agent group. The optimized regional position coordinates can be determined through a cluster optimization algorithm. For example, for a system containing 20 agents, each agent is distributed in a 100m × 100m two-dimensional space, and its initial position coordinates are obtained through a global search algorithm. For example, the first agent's position is (15.3, 42.7), and the second agent's position is (78.2, 35.6), etc. The local risk assessment value is obtained by the agent's own sensor, ranging from 0 to 1, where 0 represents no risk and 1 represents high risk. For example, the risk assessment value of the first agent is 0.23, and that of the second agent is 0.45.

[0051] Based on the acquired position coordinates and risk assessment values, an agent's state vector is constructed. The state vector contains position components, velocity components, and risk assessment value components. For each agent, its state vector can be represented as a combination of position coordinates, current velocity, and risk assessment value. For example, the state vector of the first agent is ((15.3, 42.7), (0.5, 0.3), 0.23), where (0.5, 0.3) represents the velocity component.

[0052] Based on the agent's state vector, local dynamics and time-varying coupling terms are established. The local dynamics term describes the evolution of the agent's own state and can be represented by the rate of change of the state vector over time. For each agent, its local dynamics can be expressed as a function of position and velocity; for example, the rate of change of velocity is related to the current position and velocity. The time-varying coupling term describes the interaction between agents and can be calculated using the distance and risk difference between agents. For example, when the distance between two agents is less than a safety threshold (e.g., 5 meters), the coupling strength between them increases; when the distance is greater than the threshold, the coupling strength decreases.

[0053] The phase synchronization state of a group of agents is calculated, reflecting the degree of consistency among the agents. The phase synchronization state can be obtained by analyzing the change patterns of the agents' state vectors. The synchronization degree ranges from 0 to 1, where 1 represents complete synchronization. For example, when 15 out of 20 agents move in similar directions, the phase synchronization degree of the system is approximately 0.75.

[0054] Construct a state transition probability matrix between agents, which describes the probability of state changes for each agent. For each pair of agents, calculate their state transition probabilities, such as from agent to agent. i To intelligent agents j The transition probability can be determined based on the distance and risk difference between them. For example, when the agents are 10 meters apart and the risk difference is 0.3, the transition probability is 0.4.

[0055] Local information entropy is calculated based on the state transition probability matrix. Local information entropy reflects the uncertainty of the agent's state distribution. The higher the information entropy, the more dispersed the state distribution; the lower the information entropy, the more concentrated the state distribution. For example, when an agent is surrounded by multiple high-risk areas, its local information entropy is high, reaching 0.85; when the surrounding risk distribution is uniform, the information entropy is low, at 0.35.

[0056] The negative gradient of local information entropy is established as an entropy-driving term. This term propels the agent to move in the direction of decreasing information entropy, that is, to a region with a more certain state. For example, when the calculated direction of change of information entropy in the agent's local environment is (0.2, -0.3), the entropy-driving term is (-0.2, 0.3), guiding the agent to move in the direction of decreasing entropy.

[0057] A nonlinear dynamic equation is constructed by combining local dynamics terms, time-varying coupling terms, and entropy-driven terms. This equation describes the evolution of the agent's state over time and can be expressed as a weighted sum of the three terms. For example, for the first agent, the weights of its dynamic equation are 0.4 for the local dynamics term, 0.3 for the time-varying coupling term, and 0.3 for the entropy-driven term.

[0058] This paper utilizes graph neural networks to extract topological relationship features between agents. An agent interaction network is constructed, where each agent is a node, and interactions between agents are edges. The edge weights are related to the distance and risk differences between agents. For example, for 20 agents, an interaction graph with 86 edges can be constructed, where the edge weights range from 0 to 1. This network is then processed through graph convolutional layers to extract node and edge features, resulting in a 64-dimensional topological feature vector.

[0059] A temporal graph attention mechanism is used to capture the dynamic evolutionary characteristics of an agent swarm. This mechanism identifies important temporal dependencies by analyzing changes in agent states over consecutive time periods. For example, for 50 frames of data collected within 10 seconds, attention weights are assigned to different time points, such as 0.05 for frame 10, 0.15 for frame 30, and 0.08 for frame 45. By weighted combining the features from these time points, a feature representation reflecting the dynamic evolution of the system is obtained.

[0060] Based on topological association and dynamic evolution characteristics, the risk propagation trajectory of a group of agents is obtained. This trajectory predicts how the risk spreads within the group of agents, including the propagation path and speed. For example, the risk starts from an agent with an initial risk value of 0.8 and propagates to neighboring agents at a rate of 0.1 per second, and the risk value of each agent after 10 seconds is predicted.

[0061] A risk avoidance vector field is constructed, which assigns a direction vector to each spatial location to guide the agent away from high-risk areas. For example, the avoidance direction is calculated at each grid point in two-dimensional space (such as a 10m × 10m grid) to obtain the risk avoidance vector field. For example, the avoidance vector at position (50, 60) is (0.7, -0.3), indicating that the agent should move to the upper right to avoid the risk.

[0062] Based on risk avoidance vector fields and nonlinear dynamic equations, a risk control strategy is generated. This strategy includes three key elements: avoidance direction, avoidance speed, and safety distance. The avoidance direction is determined by the risk avoidance vector field, such as the avoidance vector of the agent's current position; the avoidance speed is adjusted according to the risk level, for example, the avoidance speed in high-risk areas (risk value > 0.7) is 2 m / s, and the avoidance speed in medium-risk areas (0.3 < risk value ≤ 0.7) is 1 m / s; the safety distance is also set according to the risk level, for example, the safety distance in high-risk areas is 10 meters, the safety distance in medium-risk areas is 5 meters, and the safety distance in low-risk areas is 2 meters.

[0063] This risk control strategy enables agents to effectively avoid high-risk areas, maintain an appropriate group structure, and ensure the overall stability and security of the system. In experimental verification, agents applying this strategy reduced average risk exposure by 45% while maintaining group cooperation performance.

[0064] In one optional implementation, local information entropy is calculated based on the state transition probability matrix, and the negative gradient of the local information entropy is established as an entropy-driving term, including: The local information entropy of each agent is calculated based on the state transition probability matrix, and the local information entropy is then subjected to spatiotemporal weighting to obtain the weighted local information entropy. The formula for calculating the weighted local information entropy is as follows: , in, H i ( t ) is the first i An intelligent agent in t Weighted local information entropy at time step, N i For the first i The set of neighboring intelligent agents of an intelligent agent, α k For the first k Spatial weight coefficients of each neighboring agent H k ( t ) is the first k A neighboring intelligent agent in t Local information entropy at time t, β The time dimension weighting coefficient,T The length of the historical time window. c T-τ For time decay weight, H i ( t ) is the first i An intelligent agent at a historical moment t The local information entropy; calculate the negative gradient of the weighted local information entropy with respect to the state vector, using the following formula: , in, For the first i An intelligent agent in t The weighted local entropy negative gradient at time step [time]. x i ( t ) is the first i An intelligent agent in t The state vector at any given time; Multiplying the negative gradient by the adaptive gain function yields the entropy-driving term, and the formula for calculating the adaptive gain function is as follows: , in, l ( t ) is the adaptive gain function. l 0 Basic gain coefficient, or For adjustment coefficients, H i ( t ) is the first i An intelligent agent in t Weighted local information entropy at time step, H th This is the preset entropy threshold.

[0065] In this embodiment, a method for controlling an intelligent agent swarm is provided by calculating local information entropy based on the state transition probability matrix and establishing the negative gradient of the local information entropy as an entropy-driving term. This method fully utilizes information entropy theory to provide decision-making basis for the agent, enabling the swarm to adaptively respond to environmental changes.

[0066] The local information entropy calculation process in this embodiment is as follows: The system needs to obtain the state transition probability matrix, which describes the probability distribution of the agent's transitions between different states. For the ... i For each agent, its local information entropy is calculated based on its state transition probability matrix. Local information entropy reflects a measure of the agent's state uncertainty; higher information entropy indicates greater state uncertainty.

[0067] To comprehensively consider spatial relevance and temporal continuity, the system performs spatiotemporal weighting on the calculated local information entropy, resulting in a weighted local information entropy. The spatiotemporal weighting process comprises two parts: spatial and temporal dimensions. In the spatial dimension, it considers the first... i All neighboring intelligent agents of an intelligent agent k The impact on each neighboring intelligent agent k Local information entropy according to spatial weight coefficient αk Weighting is applied. Spatial weight coefficients. αk The spatial weight can be determined based on the distance or topological relationship between neighboring agents and the central agent. Generally, the closer the distance or the closer the relationship, the greater the weight. For example, in a cluster of 5 agents, the neighbors of agent 1 are agents 2, 3, and 4. Their spatial weights can be set to 0.3, 0.25, and 0.2, respectively, indicating that agent 2 has the greatest influence on agent 1.

[0068] In the time dimension, considering the influence of local information entropy from the agent's own historical T moments, a time dimension weight coefficient β is introduced to control the overall influence of historical information. Simultaneously, a time decay weight γ is used to differentiate information from different historical moments; typically, γ takes a value between 0 and 1, so that the more recent historical information has a greater influence. For example, setting the time window length T to 3, the time dimension weight β to 0.4, and the time decay weight γ to 0.8, then... t -1、 t -2、 t The decay weights for the three historical moments -3 are 0.8, 0.64, and 0.512, respectively.

[0069] By integrating spatial neighbor information and temporal history information, the system calculates the [number]th [unit / item]. i An intelligent agent in t Weighted local information entropy at time step H i ( t For example, suppose agent 1 is in t The original local information entropy at time 1 is 2.5. The local information entropies of its neighboring agents 2, 3, and 4 are 2.3, 2.6, and 2.1, respectively. The local information entropies of the three historical time points are 2.4, 2.3, and 2.2, respectively. Based on the above parameter settings, the weighted local information entropy of agent 1 is approximately 2.416.

[0070] After obtaining the weighted local information entropy, the system calculates the negative gradient of this entropy value with respect to the agent's state vector, serving as a directional guide for entropy-driven processes. The negative gradient represents the direction in which the entropy value decreases most rapidly, guiding the agent towards a state that reduces uncertainty. The calculation of the negative gradient involves the partial derivative of the weighted local information entropy with respect to the agent's state vector, which can be approximated using numerical methods. For example, the finite difference method can be used to apply a small perturbation to each component of the state vector and calculate the rate of change of the entropy value.

[0071] To enable the entropy-driven term to adaptively adjust its strength according to environmental complexity, the system introduces an adaptive gain function. l ( t This function is based on the fundamental gain coefficient. l 0 Adjustment coefficient or Current weighted local information entropy H i ( t and preset entropy threshold H th Calculations show that when the entropy value approaches or exceeds the threshold, the gain function value increases, enhancing the entropy-driven effect; conversely, when the entropy value is far below the threshold, the gain function value decreases, weakening the entropy-driven effect. For example, setting a base gain coefficient... l 0 The adjustment coefficient is 0.8. or The preset entropy threshold is 0.5. H th When the weighted local information entropy is 3.0 and the current weighted local information entropy is 2.416, the calculated adaptive gain function value is approximately 0.649.

[0072] Finally, the system multiplies the negative gradient of the weighted local information entropy with the adaptive gain function to obtain the entropy-driven term. This entropy-driven term, as part of the control input, together with other control terms (such as target orientation and obstacle avoidance terms), constitutes the control law of the agent. In practical applications, such as in UAV swarm formation flight missions, when the swarm enters complex terrain areas, the local information entropy increases, the entropy-driven term strengthens, and the UAVs adopt a more conservative strategy; when the environment is simple, the entropy-driven term weakens, and the UAVs can more actively execute mission objectives.

[0073] The entropy-driven control achieved through the above method enables intelligent agent swarms to adaptively adjust their behavioral strategies based on environmental complexity and state uncertainty while maintaining goal orientation, thus improving the swarm's robustness and adaptability in complex and ever-changing environments. This method is particularly suitable for scenarios requiring collaborative operation in uncertain environments, such as drone swarms, intelligent vehicle fleets, and multi-robot systems.

[0074] An embodiment of the present invention discloses an intelligent safety risk assessment and early warning system for the oil supply chain, comprising: The first unit is used to acquire real-time monitoring data of each link in the oil supply chain and construct time-series data based on the sampling time. The second unit is used to obtain position coding features from the time-series data using a time-series coding layer, input the feature interaction layer to obtain feature interaction results, input the feature interaction results to a feature fusion layer to obtain fused features, and combine the fused features with a conditional diffusion model for denoising to obtain time-series features. The third unit is used to construct a Gaussian prior distribution model based on time-series features to obtain a risk representation vector; based on the risk representation vector, intelligent agents are deployed at the target nodes of the supply chain, and each intelligent agent receives the risk representation vector of the corresponding target node and outputs the local risk assessment result. The fourth unit is used to perform spectral clustering on the local risk assessment value to obtain the communication region division result and calculate the graph attention anomaly score; calculate the state assessment value based on the graph attention anomaly score, perform nonlinear mapping to obtain the agent decision output, realize the regional optimization of group decision-making, construct nonlinear dynamic equations containing local dynamics terms, time-varying coupling terms and entropy-driven during the agent interaction process, and generate risk prevention and control strategies based on the risk propagation trajectory. The fifth unit is used to decompose the risk prevention and control strategy into action sequences and extract features, concatenate the features with the risk representation vector, calculate the risk assessment score using an adaptive optimization algorithm, determine the risk level, and push encrypted early warning information to relevant management personnel through a secure communication channel.

[0075] A third aspect of the present invention provides an electronic device, comprising: processor; Memory used to store processor-executable instructions; The processor is configured to invoke instructions stored in the memory to execute the aforementioned method.

[0076] A fourth aspect of the present invention provides a computer-readable storage medium having stored thereon computer program instructions that, when executed by a processor, implement the aforementioned method.

[0077] This invention can be a method, apparatus, system, and / or computer program product. The computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for performing various aspects of the invention.

[0078] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for intelligent safety risk assessment and early warning in the oil supply chain, characterized in that, include: Acquire real-time monitoring data from each link of the oil supply chain, and construct time-series data from the real-time monitoring data based on the sampling time; For the time-series data, a time-series coding layer is used to obtain position coding features, which are then input into a feature interaction layer to obtain feature interaction results. The feature interaction results are then input into a feature fusion layer to obtain fused features. The fused features are then combined with a conditional diffusion model for denoising to obtain time-series features. A Gaussian prior distribution model is constructed based on temporal features to obtain a risk representation vector. Based on the risk representation vector, agents are deployed at target nodes in the supply chain. Each agent receives the risk representation vector of the corresponding target node and outputs a local risk assessment result. Spectral clustering is performed on the local risk assessment values ​​to obtain the communication region division results, and graph attention anomaly scores are calculated; The state evaluation value is calculated based on the graph attention anomaly score, and the agent decision output is obtained by nonlinear mapping to realize the regional optimization of group decision-making. During the agent interaction process, a nonlinear dynamic equation containing local dynamics terms, time-varying coupling terms and entropy-driven nonlinear dynamic equations is constructed, and a risk prevention and control strategy is generated based on the risk propagation trajectory. The risk control strategy is decomposed into action sequences and features are extracted. These features are concatenated with the risk representation vector. An adaptive optimization algorithm is used to calculate the risk assessment score, determine the risk level, and push encrypted early warning information to relevant management personnel through a secure communication channel.

2. The method according to claim 1, characterized in that, For the time-series data, a time-series coding layer is used to obtain positional coding features, which are then input into a feature interaction layer to obtain feature interaction results. These results are then input into a feature fusion layer to obtain fused features. The fused features are combined with a conditional diffusion model for denoising to obtain time-series features, including: The time-series data is position-encoded by a time-series coding layer. The position coding uses sine and cosine functions to generate a position coding matrix to characterize the positional dependency of the time-series data and obtain position coding features. Based on the temporal features after location encoding, a query matrix and a key-value matrix are constructed and input into the feature interaction layer. The feature interaction layer uses a multi-head self-attention mechanism to calculate the attention weights of the query matrix and the key-value matrix, and extracts the temporal features in a weighted manner according to the attention weights to obtain feature interaction results containing long-term and short-term dependencies. The feature interaction results are input into the feature fusion layer, and residual connections are made between the feature interaction results and the output of the sub-layer network. The results of the residual connections are then subjected to layer normalization to obtain the fused features. The fused features are input as conditional information into the conditional diffusion model. The conditional diffusion model first performs forward diffusion on the input features to obtain noisy features, and then uses the conditional information to guide feature denoising during the back diffusion process. The mean and variance are predicted through a parameterized network to obtain the denoised temporal features.

3. The method according to claim 1, characterized in that, A Gaussian prior distribution model is constructed based on temporal features to obtain a risk representation vector. Based on the risk representation vector, agents are deployed at target nodes in the supply chain. Each agent receives the risk representation vector of the corresponding target node and outputs local risk assessment results, including: Based on the aforementioned time series characteristics, the mean function and covariance function of the Gaussian distribution are constructed, and the conditional probability density of the Gaussian prior distribution is calculated to generate a risk characterization vector. A state space is constructed based on the risk representation vector and historical state information, while an action space is constructed based on the deployment location and resource allocation ratio of the agent. A deep reinforcement learning network is constructed based on the state space and action space. The network parameters are iteratively optimized by maximizing the action value function to obtain the specific deployment location and resource allocation ratio of the agent, and the agent is deployed at the target node of the supply chain accordingly. The agent receives the risk representation vector of the corresponding target node, and calculates the anomaly, volatility, and trend of the target node based on the risk representation vector. The anomaly is calculated by the degree of deviation from the historical data distribution, the volatility is calculated by the difference from the state of neighboring nodes, and the trend is calculated by the first derivative of the time series change. The anomaly, volatility, and trend are weighted and combined using an adaptive weighting method based on confidence, and the local risk assessment value of the target node is output.

4. The method according to claim 1, characterized in that, Spectral clustering is performed on the local risk assessment values ​​to obtain the communication region division results, and graph attention anomaly scores are calculated; Based on the graph attention anomaly score, a state evaluation value is calculated, and a nonlinear mapping is performed to obtain the agent's decision output, thereby achieving regional optimization of group decision-making, including: The feature matrix and adjacency matrix of the target node risk representation vector are obtained. The node feature matrix and the adjacency matrix are input into the graph neural network. The hierarchical feature representation of the target node in the supply chain is obtained through the feature propagation function. The dual exponential similarity matrix is ​​constructed by combining the location distance of the target node and the local risk assessment value. The spectral clustering operation is performed based on the dual exponential similarity matrix to obtain the intelligent agent communication region division result. Based on the communication region division results, a normal distribution encoder is used to map the agent features within the region into latent representation vectors. The latent representation vectors are then reconstructed using a nonlinear decoder to obtain reconstructed features. The deviation between the agent features and the reconstructed features is calculated to obtain the graph attention anomaly score. The graph attention anomaly scores are used to construct an agent observation matrix, and the observation errors with neighboring agents are calculated. The weighted combination is used to obtain a state estimate. The state estimate is then nonlinearly mapped to obtain the agent decision output. The agent decision output is then transmitted between different communication regions through a boundary operator to achieve regional optimization of group decision-making.

5. The method according to claim 1, characterized in that, During agent interaction, a nonlinear dynamic equation containing local dynamics terms, time-varying coupling terms, and entropy-driven equations is constructed, and a risk prevention and control strategy is generated based on the risk propagation trajectory, including: The system obtains the regional optimization position coordinates and local risk assessment values ​​of the agent group, constructs the agent state vector, and establishes local dynamics terms and time-varying coupling terms based on the agent state vector; calculates the phase synchronization state of the agent group, constructs the state transition probability matrix between agents, calculates the local information entropy based on the state transition probability matrix, establishes the negative gradient of the local information entropy as the entropy driving term, and constructs a nonlinear dynamic equation by combining the local dynamics terms and the time-varying coupling terms. The topological association features between agents are extracted based on graph neural networks, and the dynamic evolution features of the agent group are captured using a temporal graph attention mechanism. The risk propagation trajectory of the agent group is obtained based on the topological association features and the dynamic evolution features, and a risk avoidance vector field is constructed. Based on the risk avoidance vector field and nonlinear dynamic equations, a risk prevention and control strategy is generated, which includes risk avoidance direction, risk avoidance speed, and safety distance.

6. The method according to claim 5, characterized in that, The local information entropy is calculated based on the state transition probability matrix, and the negative gradient of the local information entropy is established as the entropy driving term, including: The local information entropy of each agent is calculated based on the state transition probability matrix, and the local information entropy is then subjected to spatiotemporal weighting to obtain the weighted local information entropy. The formula for calculating the weighted local information entropy is as follows: , in, H i ( t ) is the first i An intelligent agent in t Weighted local information entropy at time step, N i For the first i The set of neighboring intelligent agents of an intelligent agent, α k For the first k Spatial weight coefficients of each neighboring agent H k ( t ) is the first k A neighboring intelligent agent in t Local information entropy at time t, β The time dimension weighting coefficient, T The length of the historical time window. γ T-τ For time decay weight, H i ( τ ) is the first i An intelligent agent at a historical moment τ The local information entropy; calculate the negative gradient of the weighted local information entropy with respect to the state vector, using the following formula: , in, For the first i An intelligent agent in t The weighted local entropy negative gradient at time step [time]. x i ( t ) is the first i An intelligent agent in t The state vector at any given time; Multiplying the negative gradient by the adaptive gain function yields the entropy-driving term, and the formula for calculating the adaptive gain function is as follows: , in, λ ( t ) is the adaptive gain function. λ 0 Basic gain coefficient, η For adjustment coefficients, H i ( t ) is the first i An intelligent agent in t Weighted local information entropy at time step, H th This is the preset entropy threshold.

7. An intelligent safety risk assessment and early warning system for an oil supply chain, used to implement the method as described in any one of claims 1-6, characterized in that, include: The first unit is used to acquire real-time monitoring data of each link in the oil supply chain and construct time-series data based on the sampling time. The second unit is used to obtain position coding features from the time-series data using a time-series coding layer, input the feature interaction layer to obtain feature interaction results, input the feature interaction results to a feature fusion layer to obtain fused features, and combine the fused features with a conditional diffusion model for denoising to obtain time-series features. The third unit is used to construct a Gaussian prior distribution model based on time-series features to obtain a risk representation vector; based on the risk representation vector, intelligent agents are deployed at the target nodes of the supply chain, and each intelligent agent receives the risk representation vector of the corresponding target node and outputs the local risk assessment result. The fourth unit is used to perform spectral clustering on the local risk assessment values ​​to obtain the communication region division results and calculate the graph attention anomaly score; The state evaluation value is calculated based on the graph attention anomaly score, and the agent decision output is obtained by nonlinear mapping to realize the regional optimization of group decision-making. During the agent interaction process, a nonlinear dynamic equation containing local dynamics terms, time-varying coupling terms and entropy-driven nonlinear dynamic equations is constructed, and a risk prevention and control strategy is generated based on the risk propagation trajectory. The fifth unit is used to decompose the risk prevention and control strategy into action sequences and extract features, concatenate the features with the risk representation vector, calculate the risk assessment score using an adaptive optimization algorithm, determine the risk level, and push encrypted early warning information to relevant management personnel through a secure communication channel.

8. An electronic device, characterized in that, include: processor; Memory used to store processor-executable instructions; The processor is configured to invoke instructions stored in the memory to execute the method according to any one of claims 1 to 6.

9. A computer-readable storage medium having computer program instructions stored thereon, characterized in that, When the computer program instructions are executed by the processor, they implement the method described in any one of claims 1 to 6.