Parcel abnormality detection method and device based on adaptive neighbor selection reinforcement learning

CN122673613BActive Publication Date: 2026-10-13NAT UNIV OF DEFENSE TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511806987.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-12-03
Publication Date
2026-10-13
Estimated Expiration
2045-12-03

AI Technical Summary

Technical Problem

模型一旦部署,其检测策略就固定了,无法在与黑产的实时对抗中动态地、智能地调整自身的检测策略

Benefits of technology

[0018]上述基于自适应邻居选择强化学习的运单异常检测方法及装置,将全局对比特征以及多关系运单图输入至多门控混合专家学习单元中,通过共享专家集合对全局对比特征进行多视角通用语义提取,由独立门控网络根据多关系运单图中的各类关系下专家权重分配向量,根据专家权重分配向量对各专家网络的输出进行加权融合得到不同关系下的专家融合特征,再由决策输出网络根据专家融合特征生成各类关系下的邻域特征,同时,利用线性变换网络对全局对比特征进行映射,生成与邻域特征处于同一语义空间的中心节点线性变换特征,将多关系运单图、各类关系的邻域特征及中心节点线性变换特征输入强化学习的自适应邻居选择单元,基于标签感知距离度量每类关系下,中心节点与邻居的语义一致性并对其进行优化,通过强化学习动态调整筛选阈值,得到各类关系下与中心节点语义高度一致的自适应邻居节点集合,将多关系运单图、各类关系下的自适应邻居节点集合以及多门控混合专家学习单元输出的特征输入至图注意力网络信息聚合单元中,针对每类关系的自适应邻居节点集合构建关系特异性注意力机制,加权融合生成对应各类关系的聚合特征,将聚合特征整合为关系内整体特征后,通过跨关系注意力机制融合整体邻居加权特征与关系内整体特征,生成运单节点的嵌入表示,最后,将运单节点的嵌入表示输入至运单异常检测单元中,得到异常检测结果。采用本方法可实现了物流场景下的运单异常检测系统,提高了物流运单检测的准确率和鲁棒性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122673613B_ABST
    Figure CN122673613B_ABST
Patent Text Reader

Abstract

The application relates to a way and device for detecting abnormal delivery orders based on adaptive neighbor selection reinforcement learning in the computer technology field. The way comprises the following steps: inputting global contrast features and multi-relation delivery order graphs into a multi-gate hybrid expert learning unit, extracting multi-view semantics, generating neighborhood features of various relations and linear transformation features of central nodes in the same space; inputting the adaptive neighbor selection unit of reinforcement learning, measuring the distance by label perception and optimizing semantic consistency, dynamically adjusting the filtering threshold, obtaining an adaptive neighbor node set, inputting a graph attention network information aggregation unit, constructing a relation-specific attention mechanism to generate aggregated features, integrating the features into overall features in the relation, and then fusing the features through a cross-relation attention mechanism to generate delivery order node embedding representation, and inputting the abnormal detection unit to obtain the result. The method improves the accuracy and robustness of the detection of the delivery order.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a method and apparatus for detecting waybill anomalies based on adaptive neighbor selection reinforcement learning. Background Technology

[0002] With the booming development of global e-commerce, O2O services, and the sharing economy, online transaction systems process hundreds of millions of order slips daily. These order slips form the core of business operations and also become targets for various abnormal behaviors. Order slip irregularities not only directly lead to huge economic losses for businesses but also seriously damage user experience, undermine platform reputation, and disrupt the healthy ecosystem.

[0003] Traditional risk control systems rely heavily on expert experience and predefined, rigid rules. However, this static and singular defense strategy is proving inadequate against increasingly professional and covert cybercrime teams. Attackers can easily study and bypass fixed rules, leaving risk control systems in a passive situation of "constantly creating new rules, only to have them constantly bypassed." Therefore, developing intelligent, adaptive waybill anomaly detection technology capable of accurately identifying unknown new fraud patterns has become an urgent need to ensure the secure and stable operation of the internet business system.

[0004] Currently, mainstream methods for detecting anomalies in waybills can be broadly categorized into three types: rule-based and expert-system-based methods, where risk control experts develop a series of "IF-THEN" logical rules based on historical fraud cases and experience. Their advantages include intuitiveness, strong interpretability, and simple deployment. However, their disadvantages are equally significant: high maintenance costs, difficulty in detecting unknown patterns, poor flexibility and adaptability, and a high susceptibility to false positives and false negatives. To overcome the limitations of rule-based systems, researchers have introduced machine learning models. This method typically first extracts features from waybill data, user behavior data, and device information, and then uses classification algorithms such as logistic regression (LR), support vector machines (SVM), isolation forests, or gradient boosting trees (XGBoost, LightGBM) for supervised or unsupervised learning. These methods have achieved good results in specific scenarios, but their performance heavily depends on the quality of feature engineering. Features require careful design and selection by experts, a process that is cumbersome and subjective. More importantly, facing the rapidly evolving attack strategies of black market actors, static feature sets may quickly become ineffective, requiring frequent retraining of the model to maintain its effectiveness, thus posing a challenge to generalization capabilities.

[0005] In recent years, deep learning methods such as autoencoders, recurrent neural networks (RNNs), and graph neural networks (GNNs) have been applied to anomaly detection. They can automatically learn complex nonlinear relationships and temporal patterns in data, reducing reliance on manual feature engineering. For example, GNNs can effectively capture anomalous subgraphs within the complex relationship networks formed by entities such as users, devices, and addresses behind waybills.

[0006] However, deep learning models are often "black boxes," with decision-making processes difficult to interpret, posing a significant weakness in risk control scenarios requiring high reliability. Furthermore, they demand vast amounts of labeled data and high computational resources, and are highly sensitive to model hyperparameters. Whether machine learning or deep learning methods, their training processes are largely based on static learning using historical data. Once deployed, the model's detection strategy is fixed, unable to dynamically and intelligently adjust itself in real-time confrontations with malicious actors. This is like a "cat and mouse game," where the defender's (detection system's) tactics are fixed, while the attacker constantly changes and probes, always finding a weakness in the system. Summary of the Invention

[0007] Therefore, it is necessary to provide a self-evolving and adaptive waybill anomaly detection method and device based on adaptive neighbor selection reinforcement learning to address the above-mentioned technical problems.

[0008] A waybill anomaly detection method based on adaptive neighbor selection reinforcement learning, the method comprising: The original waybill data in the logistics scenario is obtained, and the original waybill data is preprocessed to obtain the global comparison features of the corresponding waybill node and the multi-relationship waybill graph. The global comparative features and the multi-relationship waybill graph are input into a multi-gated hybrid expert learning unit. The global comparative features are subjected to multi-view general semantic extraction through a shared expert set. An independent gated network obtains expert weight allocation vectors based on various relationships in the multi-relationship waybill graph. The outputs of each expert network are weighted and fused based on the expert weight allocation vectors to obtain expert fusion features under different relationships. Then, the decision output network generates neighborhood features under various relationships based on the expert fusion features. At the same time, a linear transformation network is used to map the global comparative features to generate linear transformation features of the central node in the same semantic space as the neighborhood features. By inputting the multi-relationship waybill graph, the neighborhood features of various relationships, and the linear transformation features of the center node into the adaptive neighbor selection unit of reinforcement learning, an adaptive set of neighbor nodes that are highly consistent with the semantics of the center node under various relationships is obtained. The features output by the multi-relationship waybill graph, the adaptive neighbor node set under various relationships, and the multi-gated hybrid expert learning unit are input into the graph attention network information aggregation unit to generate the embedded representation of the waybill node; The embedded representation of the waybill node is input into the waybill anomaly detection unit to obtain the anomaly detection result.

[0009] In one embodiment, in the multi-gated hybrid expert learning unit, the shared expert set consists of multiple expert networks with identical structures and independent parameters. Each expert network adopts a multilayer perceptron structure and learns semantic information of different dimensions in the global contrastive features through different weight parameters.

[0010] In one embodiment, in the multi-gated hybrid expert learning unit: The independent gating network corresponds one-to-one with the relationship types in the multi-relationship waybill diagram; Each independent gated network outputs a weight allocation vector matching the number of expert networks through a sigmoid activation function, and the sum of all elements in the weight allocation vector is 1, so as to achieve dynamic weighting of the outputs of different expert networks.

[0011] In one embodiment, in the multi-gated hybrid expert learning unit, the decision output network and the linear transformation network use the same feature dimension mapping rule; The decision output network maps expert fusion features to neighborhood features through a relation-specific linear layer; The linear transformation network maps global contrastive features to linear transformation features of the central node through a dedicated linear layer at the central node.

[0012] In one embodiment, in the reinforcement learning-based adaptive neighbor selection unit, the semantic consistency between the center node and its neighbors is optimized based on the label-aware distance metric for each type of relationship. The selection threshold is dynamically adjusted through reinforcement learning to obtain the adaptive neighbor node set. The process further includes: The label perception distance is the cosine distance between the linear transformation feature of the central node and the neighborhood feature of the corresponding neighboring node, which is used to quantify the difference between the central node and the neighboring node in the label prediction semantic space. The semantic consistency between the central node and its neighboring nodes is optimized using a node-aware similarity loss function.

[0013] In one embodiment, in the reinforcement learning adaptive neighbor selection unit, the threshold used to filter highly similar neighbor nodes is dynamically adjusted through reinforcement learning to obtain the adaptive neighbor node set. When the filtering threshold is dynamically adjusted using reinforcement learning: A Top-p neighbor sampling mechanism is adopted, and the neighbor nodes under each type of relationship are sorted in descending order based on the similarity score corresponding to the semantic consistency. The sampling threshold is used as the state, the threshold adjustment action is used as the action space, and the change in the average label perception distance between the central node and the sampling neighbor set is used as the immediate reward. A greedy strategy is adopted to select the optimal action to dynamically adjust the threshold for retaining the top p proportion of highly similar neighbors. When the reward fluctuation is lower than the preset threshold, the sampling threshold is fixed, and the adaptive neighbor node set under various relationships is applied.

[0014] In one embodiment, in the graph attention network information aggregation unit, a relation-specific attention mechanism is constructed for the adaptive neighbor node set of each type of relation. Weighted fusion is used to generate aggregated features corresponding to each type of relation. After integrating the aggregated features into a relation-wide feature, the overall neighbor weighted feature and the relation-wide feature are fused through a cross-relation attention mechanism to obtain the embedded representation. The process further includes: The relation-specific attention mechanism constructs an independent attention parameter matrix for each type of relation. It converts the linear transformation features of the center node and the neighborhood features of the neighboring nodes into attention queries, keys, and values, calculates the initial semantic contribution weights using dot product operations, and normalizes them using the softmax function. The neighborhood features of neighboring nodes are weighted and summed based on the normalized weights, and then fused with the features of the central node itself through residual connections to generate aggregated features corresponding to various relationships.

[0015] In one embodiment, in the graph attention network information aggregation unit, integrating aggregated features into a relational overall feature includes: The aggregated features corresponding to various relationships are aligned by dimensions and then concatenated to obtain the overall features within the relationship.

[0016] In one embodiment, in the graph attention network information aggregation unit; The cross-relationship attention mechanism uses the overall features within the relationship as a benchmark. It first converts the overall features within the relationship of the central node and the overall features within the relationships of the adaptive neighbor nodes under all relationships into queries, keys, and values ​​for cross-relationship attention, respectively. The semantic association degree of each neighbor node with the central node from a global perspective is calculated by dot product operation, and the global contribution weight is obtained by normalization by the softmax function. Based on the global contribution weight, the features of neighbor nodes under all relationships are weighted and fused to generate overall neighbor weighted features; The weighted features of the overall neighbors and the overall features within the relationship of the central node are fused through residual connections and then processed by layer normalization to generate the embedded representation of the waybill node.

[0017] This application provides a waybill anomaly detection device based on adaptive neighbor selection reinforcement learning, the device comprising: The original waybill data acquisition module is used to acquire original waybill data in the logistics scenario, and to obtain the global comparison features of the corresponding waybill node and the multi-relationship waybill graph after preprocessing the original waybill data. A multi-gated hybrid expert learning module is used to input the global comparative features and the multi-relationship waybill graph into the multi-gated hybrid expert learning unit. Through a shared expert set, the global comparative features are subjected to multi-view general semantic extraction. An independent gated network obtains expert weight allocation vectors based on various relationships in the multi-relationship waybill graph. The outputs of each expert network are weighted and fused based on the expert weight allocation vectors to obtain expert fusion features under different relationships. Then, the decision output network generates neighborhood features under various relationships based on the expert fusion features. At the same time, a linear transformation network is used to map the global comparative features to generate linear transformation features of the central node in the same semantic space as the neighborhood features. The reinforcement learning adaptive neighbor selection module is used to input the multi-relationship waybill graph, the neighborhood features of various relationships, and the linear transformation features of the center node into the reinforcement learning adaptive neighbor selection unit to obtain an adaptive neighbor node set that is highly consistent with the semantics of the center node under various relationships. The graph attention network information aggregation module is used to input the features of the multi-relationship waybill graph, the adaptive neighbor node set under various relationships, and the output of the multi-gated hybrid expert learning unit into the graph attention network information aggregation unit to generate the embedded representation of the waybill node; The waybill anomaly detection module is used to input the embedded representation of the waybill node into the waybill anomaly detection unit to obtain the anomaly detection result.

[0018] The aforementioned method and apparatus for waybill anomaly detection based on adaptive neighbor selection reinforcement learning inputs global contrast features and a multi-relationship waybill graph into a multi-gated hybrid expert learning unit. A shared expert set is used to extract general semantics from the global contrast features from multiple perspectives. Independent gating networks assign expert weight vectors based on various relationships in the multi-relationship waybill graph. The outputs of each expert network are then weighted and fused according to these weight vectors to obtain expert fusion features for different relationships. A decision output network then generates neighborhood features for various relationships based on these expert fusion features. Simultaneously, a linear transformation network maps the global contrast features to generate linear transformation features of the central node that reside in the same semantic space as the neighborhood features. The multi-relationship waybill graph, the neighborhood features of various relationships, and the linear transformation features of the central node are then input into the adaptive neighbor selection unit of reinforcement learning. This paper proposes a method to optimize the semantic consistency between the central node and its neighbors under each type of relationship based on label-aware distance measurement. By dynamically adjusting the selection threshold through reinforcement learning, an adaptive set of neighbor nodes with high semantic consistency with the central node is obtained for each type of relationship. Features from the multi-relationship waybill graph, the adaptive neighbor node sets for each type of relationship, and the output of the multi-gated hybrid expert learning unit are input into the graph attention network information aggregation unit. A relationship-specific attention mechanism is constructed for the adaptive neighbor node set of each type of relationship, and weighted fusion is used to generate aggregated features corresponding to each type of relationship. These aggregated features are then integrated into overall features within the relationship. Finally, the overall neighbor weighted features and overall features within the relationship are fused through a cross-relationship attention mechanism to generate the embedded representation of the waybill node. The embedded representation of the waybill node is then input into the waybill anomaly detection unit to obtain the anomaly detection result. This method enables a waybill anomaly detection system in logistics scenarios, improving the accuracy and robustness of waybill detection. Attached Figure Description

[0019] Figure 1 This is a flowchart illustrating a waybill anomaly detection method based on adaptive neighbor selection reinforcement learning in one embodiment. Figure 2 This is a schematic diagram of the structure of a multi-gated hybrid expert learning unit in one embodiment; Figure 3 This is a schematic diagram of the structure of an adaptive neighbor selection unit based on reinforcement learning in one embodiment; Figure 4 This is a schematic diagram illustrating the aggregation representation within the order node relationship in one embodiment; Figure 5 This is a schematic diagram of the overall aggregation of multiple relationships of a single-node in one embodiment; Figure 6 This is a schematic diagram of the training algorithm framework for a complete waybill anomaly detection model in one embodiment; Figure 7 This is a schematic diagram illustrating the adaptive change of the sampling threshold in a specific embodiment; Figure 8 This is a schematic diagram of the ablation experiment results of a reinforcement learning adaptive neighbor selection strategy in a specific embodiment. Figure 9 This is a structural block diagram of a waybill anomaly detection device based on adaptive neighbor selection reinforcement learning in one embodiment. Figure 10 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0020] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0021] In this application, as Figure 1 As shown, a waybill anomaly detection method based on adaptive neighbor selection reinforcement learning is provided, which specifically includes the following steps: Step S100: Obtain the original waybill data in the logistics scenario, and after preprocessing the original waybill data, obtain the global comparison features of the corresponding waybill node and the multi-relationship waybill graph.

[0022] Step S110: Input the global contrast features and the multi-relationship waybill graph into the multi-gated hybrid expert learning unit. Through a shared expert set, multi-view general semantic extraction is performed on the global contrast features. The independent gated network obtains the expert weight allocation vector according to the various relationships in the multi-relationship waybill graph. The outputs of each expert network are weighted and fused according to the expert weight allocation vector to obtain the expert fusion features under different relationships. Then, the decision output network generates the neighborhood features under various relationships according to the expert fusion features. At the same time, the linear transformation network is used to map the global contrast features to generate the central node linear transformation features in the same semantic space as the neighborhood features.

[0023] Step S110: Input the multi-relationship single graph, the neighborhood features of various relationships, and the linear transformation features of the center node into the adaptive neighbor selection unit of reinforcement learning to obtain an adaptive neighbor node set that is highly consistent with the semantics of the center node under various relationships.

[0024] Step S120: Input the features output by the multi-relationship waybill graph, the adaptive neighbor node set under various relationships, and the multi-gated hybrid expert learning unit into the graph attention network information aggregation unit to generate the embedded representation of the waybill node.

[0025] Step S130: Input the embedded representation of the waybill node into the waybill anomaly detection unit to obtain the anomaly detection result.

[0026] This method simulates the continuous struggle between risk control experts and cybercriminals: by observing changes in cybercriminal behavior, it assesses the effectiveness of current detection strategies in real time and proactively adjusts strategies to maximize long-term security benefits. Reinforcement Learning (RL) is an ideal framework for simulating this process. Its core idea is that an agent learns the optimal policy based on rewards gained through continuous interaction with the environment. In this method, the waybill flow is considered the environment, the behavior of the detection model (e.g., classifying a waybill as abnormal or normal) is considered an action, and the benefits of correctly identifying anomalies (e.g., reducing losses) and the costs of misjudging are used as reward signals.

[0027] Specifically, this method proposes an adaptive neighbor selection reinforcement learning model for detecting abnormal waybills in logistics, aiming to address issues such as the difficulty in separating semantic features of waybill nodes and strong neighbor noise interference. The model integrates a multi-gated hybrid expert module, extracting general semantics through a shared expert network and achieving heterogeneous feature fusion through multi-relational gating and expert decision-making. It employs a reinforcement learning-driven adaptive neighbor selection module, introducing perceptual similarity measurement and a Top-p sampling strategy, combined with real-time reinforcement learning to dynamically optimize neighbor thresholds, enhancing adaptability to diverse adjacency relationships. Furthermore, an information aggregation module based on a graph attention network is designed, performing attention weighting at both the intra-relational and multi-relational levels to improve the semantic coverage and expressiveness of nodes. Finally, through multi-module collaboration, the model effectively improves the recognition accuracy and robustness of abnormal waybills.

[0028] In step S100, the multi-relationship waybill graph is constructed from the interaction relationships between waybill nodes and other related entities. The original waybill data in the logistics scenario includes: waybill ID, deliveryman ID, user ID, delivery area ID, latitude and longitude of the delivery address, product information, order time, completion time, tracking number, and delivery status.

[0029] In this embodiment, when the global comparison features of the corresponding waybill node are obtained after preprocessing the original waybill data, the waybill node feature vector after standardization and normalization is used to capture the relative position or semantics of the waybill in the global space.

[0030] Specifically, the multi-relationship waybill diagram includes OPO, waybill-courier-waybill relationship (waybills associated through a common area); OUU, waybill-user-waybill relationship (waybills associated through a common user); and OTO, waybill-time-waybill relationship (waybills associated through time proximity or periodicity).

[0031] like Figure 2As shown, in step S110, the multi-gated hybrid expert learning unit captures general structural patterns by sharing the underlying expert network, and uses multiple independent gated networks to allocate expert weights as needed to complete task-specific decision modeling. Finally, it obtains an expert hybrid decision network by weighting the above multi-expert information to perform semantic feature fusion of nodes under multi-relational neighborhood subgraphs.

[0032] In this embodiment, in the multi-gated hybrid expert learning unit, the shared expert set consists of multiple expert networks with the same structure and independent parameters. Each expert network adopts a multilayer perceptron structure and learns semantic information of different dimensions in the global contrastive features through different weight parameters.

[0033] Specifically, the shared expert set is a fundamental component of the entire unit, designed to extract general characteristic representations of logistics documents. The shared expert set is constructed by... A network of experts ,in This allows each expert to learn the waybill node representation from different perspectives, thus forming a shared expert set. This design helps alleviate parameter conflicts between tasks and provides richer structural feature support for subsequent relational tasks.

[0034] Furthermore, each expert network is based on the global comparative features of the waybill node. As input, output the corresponding vector representation. This data is then used for selection and weighting in subsequent gating mechanisms. To enhance inter-layer feature interaction while maintaining representational capabilities, residual connections and linear normalization mechanisms are introduced into the expert network to unify the representation processing. The calculation process is as follows: ; In the above formula, For the first The intermediate feature representation of an expert subnetwork after processing with an activation function. For the first The linear mapping parameter matrix of an expert, This is a bias term.

[0035] ; In the above formula, For the first The linear mapping parameter matrix of each expert. The final embedded features. It will be used as the input for the gating selection mechanism.

[0036] In this embodiment, to control the weighted combination of experts, a method based on waybill node relationships was designed. Independent gated network This mechanism can adjust the participation of each expert based on the specific semantic relationship scenario of the waybill node, achieving adaptive weighted combination of relationships in multi-expert decision-making. Each independent gated network corresponds one-to-one with the relationship type in the multi-relationship waybill graph, and each independent gated network outputs a weight allocation vector matching the number of expert networks through a sigmoid activation function. The sum of all elements in the weight allocation vector is 1, thus achieving dynamic weighting of the outputs of different expert networks.

[0037] Specifically, the independent gated network structure is defined as: ; In the above formula, The weight matrix is ​​a learnable matrix. Let the nodes represent dimensions. For the number of experts. (Through) After function normalization, the relationship between each expert is obtained. The weight vector below reflects the degree of attention the relationship pays to the abilities of different experts. This mechanism supports dynamic modeling of the specific needs between different relationships, enabling personalized learning of multiple single-node relationships.

[0038] In this embodiment, after the weight information output by the independent gating network and the node representation generated by the shared expert set, in order to generate a node representation with relation-adaptive semantic features, the relationship between the waybill nodes is... Perform expert-weighted fusion operations separately.

[0039] Specifically, by combining the weight information output by the multi-relation gating network with the node vectors generated by the shared multi-expert network, the weighted value of a node in a relation is obtained. The following is a comprehensive representation : ; In the above formula, It is the first A network of experts for nodes The output, Indicates a relationship Next An expert The probability of being selected and This formula enables weighted fusion of expert networks, thereby generating more relationally adaptive node representations.

[0040] In this embodiment, after obtaining expert fusion features Subsequently, to further enhance the model's ability to model the importance of neighboring nodes, a decision output network was introduced into the multi-gated hybrid expert learning unit. The definition is as follows: ; In the above formula, It is a relationship Multilayer perceptron. Integrating expert features. The input is fed into the decision network to construct the final output for neighbor representation modeling, ultimately generating the final node embedding representation for neighbor representation construction, i.e., the neighborhood features under various relationships, denoted as... The specific definition is as follows: ; In the above formula, Representing neighboring nodes In relationship The output of the expert decision-making network.

[0041] In this embodiment, for the relationship The linear transformation network of the central node Defined as: ; Finally, the above-mentioned multi-gated hybrid expert network is denoted as... Therefore, the final node embedding representation can be simplified to the following definition: ; In this embodiment, a multi-gated hybrid expert network is used. Linear transformation network with central node This can be further expanded to measure the differences in label prediction semantics between the central node and its neighboring nodes.

[0042] In this embodiment, the decision output network and the linear transformation network use the same feature dimension mapping rule. The decision output network maps expert fusion features to neighborhood features through a relation-specific linear layer, while the linear transformation network maps global comparison features to central node linear transformation features through a central node-specific linear layer.

[0043] In step S120, in the reinforcement learning-based adaptive neighbor selection unit, based on the multi-relationship flow graph, the neighborhood features of various relationships and the linear transformation features of the center node, the semantic consistency between the center node and its neighbors under each relationship is optimized based on the label-aware distance metric, and the screening threshold is dynamically adjusted through reinforcement learning to obtain an adaptive neighbor node set.

[0044] In this embodiment, to achieve an efficient waybill anomaly detection mechanism, a node-aware similarity measurement method is designed. A label predictor is used to model the semantic consistency between nodes, and the measurement result is used to guide the selection and aggregation strategy of neighboring nodes. Inspired by the multilayer perceptual mechanism of graph networks, this method measures the node-aware similarity of each layer of the subsequent graph network's node information aggregation process. A multi-expert hybrid network is used to output the waybill node embedding feature representation, and the difference between the node embedding representations is used as an important basis for node similarity measurement.

[0045] In this embodiment, the label-aware distance is the cosine distance between the linear transformation feature of the central node and the neighborhood feature of the corresponding neighboring node. It is used to quantify the difference between the central node and the neighboring node in the label prediction semantic space. At the same time, the semantic consistency between the central node and the neighboring node is optimized through the node-aware similarity loss function.

[0046] Specifically, global comparison features Embedded features as initial input to graph neural networks The specific definition is as follows:

[0047] Furthermore, consider any two nodes in the graph. and In the In layered graph neural networks, in relation They are connected by edges. To perceive distance by labeling Defined as the cosine distance between the activation features of the two entities, specifically as follows: ; In the above formula, Indicates the first Layer center node A linear transformation network (used to generate linear transformation features of the central node), with its input being the central node of the layer above it. Global contrast features , Indicates the central node In relationship The parameters of the multi-gated hybrid expert network (used to generate neighborhood features of neighboring nodes) are input to its upper-level neighboring nodes. Embedding features The above formula measures the semantic difference between the central node and its neighboring nodes in label prediction. This distance is further mapped to a node-perceived similarity score: ; In the above formula, Represents a node With nodes At the current level, a higher semantic consistency value indicates that the node... With the central node The closer the neighbors are in the label prediction space, the more effective the neighbor aggregation target is considered.

[0048] In this embodiment, to achieve end-to-end parameter training, the label-aware similarity measurement process is incorporated into the joint optimization of the GNN model. By defining a node-aware similarity loss function, the predicted similarity score is constrained to the true label. Consistency between them.

[0049] Specifically, firstly, the embedding of nodes under all relations... This indicates that average aggregation is performed to form a node representation: ; In the above formula, This is the set of all relation types. Next, the label predictor used to output the label prediction score of the node in the current task is defined as follows: ; In the above formula, , where is the linear weight matrix of the label predictor. This is a bias term.

[0050] Furthermore, the node-aware similarity loss function, used to measure the consistency error between the current predicted output and the true label, is expressed as: ; In the above formula, Represents a node The model obtains the true label vectors. Through this loss function, the model can effectively constrain the feature propagation behavior within the GNN layers, ensuring consistency between the node embedding representation and the label semantics.

[0051] In this embodiment, reinforcement learning is used to dynamically adjust the threshold for filtering highly similar neighbor nodes to obtain an adaptive set of neighbor nodes. When using reinforcement learning to dynamically adjust the filtering threshold: a Top-p neighbor sampling mechanism is used, and the neighbor nodes under each type of relationship are sorted in descending order based on the similarity score corresponding to semantic consistency. The sampling threshold is used as the state, the threshold adjustment action is used as the action space, and the change in the average label perception distance between the center node and the sampled neighbor set is used as the immediate reward. A greedy strategy is used to select the optimal action to dynamically adjust the threshold for retaining the top p proportion of highly similar neighbors. When the reward fluctuation is lower than the preset threshold, the sampling threshold is fixed to obtain an adaptive set of neighbor nodes under each type of relationship.

[0052] In this embodiment, a Top-p sampling strategy is introduced to optimize the sampling quality of neighbor nodes. The proportion of neighbor nodes is dynamically adjusted adaptively using reinforcement learning, thereby realizing feature aggregation within subsequent relationships and overall feature aggregation across multiple relationships.

[0053] Specifically, for nodes In the Hierarchical Relationship The set of edges below In the process, firstly, based on the node-aware similarity score set... Sort all neighboring nodes in descending order and retain the top [number]. The set of neighboring nodes with high similarity ratios is used as the aggregation input for this layer, while other neighboring nodes do not participate in subsequent information propagation. Meanwhile, the set of edges after Top-p filtering is defined as follows:

[0054] Top-p sampling can effectively eliminate noisy neighbors that are semantically inconsistent with the central node, while retaining neighbor nodes with high semantic similarity for information transmission. This improves the model's ability to discriminate abnormal node representations and its robustness in multi-relation aggregation.

[0055] In this embodiment, in the Top-p neighbor sampling mechanism, the sampling threshold is... The choice of neighbor sampling method has a crucial impact on the quality of neighbor sampling and training stability. Traditional methods relying on empirical settings are ill-suited for anomaly detection tasks with high data sparsity in multi-relationship graphs. To address the diversity and uncertainty of relationships between nodes, such as... Figure 3 As shown, in the adaptive neighbor selection unit of reinforcement learning, instantaneous reinforcement learning is used to optimize the relationship selection in real time based on task feedback. sampling threshold It automatically learns the optimal neighbor selection strategy.

[0056] Furthermore, in order to describe the sampling threshold Optimized reinforcement learning process, defined = Representing the action space, for relations ,action These represent the sampling thresholds respectively. Take actions to reduce, keep constant, or increase. This is the immediate reward function, used to represent the reward for the current state (i.e., the sampling threshold). Take action The reward information given later.

[0057] To ensure the model has stable initial performance, the relevant parameters are initialized. In the first... Hierarchical Relationship Initial sampling threshold Set to middle level: ; In the Hierarchical Relationship The initial action Set to remain unchanged: ; In the Hierarchical Relationship r The initial reward is set to 0:

[0058] This invention measures the semantic consistency between the current sampled neighbor set and the central node. It utilizes label-aware distance to calculate the central node. Gather with neighbors At the sampling threshold The average distance is defined as follows: ; In the above formula, Represents a node In relationship The following sampling ratio The selected set of neighbors, Represents a node The distance to neighboring nodes in the label-aware semantic space. The smaller this distance, the stronger the node's position. With sampling neighbor set The higher the semantic consistency, the higher the sampling quality.

[0059] In this embodiment, the instant reward function is defined based on the average distance difference between the center node and the neighbor set of the current round and the previous round, as shown in the following formula: ; In the above formula, the step size Used to control the sampling threshold The magnitude of the action taken is rewarded positively (i.e., encouraged) if the average distance between the current round's center node and its neighbor set is less than that of the previous round, and negatively if not. This allows the model to guide the sampling threshold to be adjusted towards a better outcome.

[0060] To achieve the sampling threshold The optimal adjustment is achieved by selecting the action that brings the greatest improvement from the action space in each round, as defined below:

[0061] This action selection strategy can be understood as a greedy strategy, always prioritizing the sampling adjustment direction that brings the maximum average distance difference between the central node and its neighbor set. Then, based on the selected action... Update the sampling threshold for this round The formula is as follows: ; In the above formula, The step size is fixed. When a positive reward is obtained, the sampling threshold of the previous round is adjusted after the current training round to gradually approach the optimal value and effectively avoid policy oscillations.

[0062] To avoid sampling threshold Continuing ineffective exploration after stabilization can lead to model overfitting or divergence. Therefore, a reinforcement learning termination criterion is designed to end training, defining the first... Hierarchical Relationship Next Evaluation function for round training The formula is as follows: ; In the above formula, This represents the absolute value operation. The function determines the size of the evaluation window used to terminate the judgment. Indicates the sampling threshold in the current round Take action The instant reward results.

[0063] Reinforcement learning terminates prematurely when the following conditions are met: ; In the above formula, This is the minimum permissible threshold for reward fluctuation. When recently... The total fluctuation of the reward function in each training cycle is less than When, it indicates the sampling threshold. It has entered a stable state, no longer triggers policy action updates, terminates reinforcement learning, and fixes the current value sampling threshold for subsequent aggregation within node relationships and aggregation between node relationships.

[0064] Furthermore, in order to achieve the neighbor sampling threshold To optimize the policy update, a dynamic policy update mechanism based on reinforcement learning is introduced. This mechanism uses the objective function... The optimization objective is to minimize the objective function. The core idea is to guide the parameters to evolve in the direction of decreasing the objective function in each round of policy adjustment, thereby ensuring the convergence and stability of the training process. Starting from gradient direction estimation and combining the construction of the reward function, the rationality and effectiveness of the policy update rule are systematically demonstrated.

[0065] In this embodiment, the objective function is first defined. , is the current sampling threshold The average distance between the central node and its sampled neighbor nodes is calculated using the following formula: ; In the above formula, Indicates a relationship Next, target node Based on the current sampling strategy The selected set of neighbors. Indicates a relationship Next, node and The semantic distance between them. Clearly, the smaller the distance, the stronger the semantic similarity, indicating higher quality neighbor sampling. Therefore, the optimization objective is to minimize... .

[0066] To estimate the changing trend of the objective function under sampling threshold adjustment, this invention employs a finite difference approximation method for the action. Expanding on the resulting changes in the objective function: ; This formula characterizes the direction of strategy adjustment. With sampling threshold gradient The symbolic relationship between them, that is, when When the sign is opposite to that of the gradient, This indicates that the policy update contributes to the descent of the objective function. Based on this, the correlation between the expected value of the immediate reward function and the gradient of the policy update is derived, namely: ; This design embodies the concept of negative gradients as rewards in reinforcement learning, meaning that when policy adjustments can significantly reduce the value of the objective function, the model will provide positive feedback.

[0067] Based on the reward mechanism constructed above, gradient estimation in the form of a sign function is used as the action update direction, as shown in the following formula: ; That is, the direction that causes the objective function to decrease the fastest is selected as the update action for this round. Then, through a gating mechanism, the update action is performed only when the reward is valid. The strategy update operation is performed only when the time is right, as shown in the following formula: ; In the above formula, the model will only perform a fixed-step update when the current action receives a positive reward; otherwise, it will remain unchanged. This mechanism effectively avoids the adverse perturbation of the objective function caused by erroneous updates.

[0068] To further verify the stability of the above mechanism, the impact of policy updates on the objective function is derived from the perspective of the monotonicity of the objective function, as shown in the following formula: ; This inequality demonstrates that, under the premise of sign consistency, the objective function can be guaranteed to remain monotonically non-increasing in each round of updates, ensuring that the convergence trend is not interrupted, thereby effectively improving the stability and robustness of policy updates.

[0069] In step S130, in the graph attention network information aggregation unit, based on the multi-relationship single graph, the adaptive neighbor node set under various relationships, and the features output by the multi-gated hybrid expert learning unit, a relationship-specific attention mechanism is constructed for the adaptive neighbor node set of each relationship. The aggregated features corresponding to various relationships are generated by weighted fusion. After the aggregated features are integrated into the overall features within the relationship, the overall neighbor weighted features and the overall features within the relationship are fused through the cross-relationship attention mechanism to obtain the embedded representation.

[0070] In this embodiment, a graph attention network information aggregation unit is used to model the data at two levels: within a relation and across multiple relations. During the within-relation aggregation stage, considering the multi-relational characteristics of waybill nodes and the importance of their neighborhood information aggregation elements, a targeted waybill node attention mechanism is constructed to complete the within-relational aggregation of waybill node information. During the multi-relational overall aggregation stage, considering the inherent characteristics of waybill nodes and the overall characteristics among multiple relations, an overall node attention mechanism is designed to achieve the multi-relational overall aggregation of waybill node information, thereby enhancing the discriminability of the waybill node embedded representation.

[0071] Specifically, in multi-relationship scenarios, the waybill node is connected to neighbor nodes with various semantic labels. Because the semantic contributions of different types of neighbor nodes to the target node vary, such as... Figure 4 As shown, a relation-aware attention mechanism graph neural network is constructed to model the influence weights of neighboring nodes on the central node, thereby achieving weighted fusion of information.

[0072] In this embodiment, the relation-specific attention mechanism constructs an independent attention parameter matrix for each type of relation. By converting the linear transformation features of the central node and the neighborhood features of the neighboring nodes into attention queries, keys, and values, the initial semantic contribution weights are calculated using dot product operations and normalized using the softmax function. Based on the normalized weights, the neighborhood features of the neighboring nodes are weighted and summed, and then fused with the features of the central node itself through residual connections to generate aggregated features corresponding to each type of relation.

[0073] Specifically, in order to introduce a central node Its neighboring nodes In the relationship Based on the semantic information below, a relation encoder is introduced. It will neighbor nodes The representation vector Mapped to the central node Within a specific semantic space, the formula is as follows: ; In the above formula, This is a learnable relational semantic transformation matrix. Output This will be further used for the query in the attention mechanism, and its calculation method is as follows: ; In the above formula, , , They respectively represent the relationship The following transformation matrix is ​​used for queries, keys, and values. Using the above transformations, node embeddings are mapped into the attention matching space, and the semantic matching degree between nodes is calculated.

[0074] To measure the semantic contribution of neighboring nodes to the central node, a dot product attention mechanism is used to measure the neighboring nodes. For the central node Importance, attention weight The definition is as follows: ; In the above formula, Representing neighboring nodes For nodes The attention weight is a normalized result of the semantic matching degree between neighbors and the central node, reflecting the importance of information aggregation.

[0075] Based on the importance weights of neighboring nodes to the central node, the node information aggregation representation is defined as follows: ;

[0076] In the above formula, The attention fusion transformation matrix expresses how the attention-weighted representations of neighboring nodes affect the semantic update of the central node.

[0077] To more generally describe the information aggregation representation under different relations, we utilize an attention mechanism to aggregate neighbor node information and define the neighbor information aggregation under this relation. Represented as: ; In the above formula, The fusion result, which takes into account the importance of the aggregated elements of the waybill node's neighborhood information, can be used for subsequent aggregation within the relationship of waybill nodes.

[0078] Furthermore, to fully preserve the contextual semantics of neighbor nodes and enhance the model's structural expressiveness in the multi-relation graph, after adaptively filtering the neighbor set under a relation, an intra-relation aggregation mechanism is introduced to integrate the multi-relation neighborhood information of a single node. Simultaneously, this strategy helps the model learn more semantically oriented relation aggregation representations, providing a unified information context for the overall fusion of multiple relations.

[0079] In each relationship Next, for the first Layer Relationship The central node below First, the aggregated representation of the sampled neighbor set obtained by the attention module is fused with the representation of the central node. The neighbor feature representation aggregated within the relation is denoted as... The calculation process is as follows: ; In the above formula, express Layer nodes Embedded representation, It is a relationship The following is an aggregated representation of the sampled neighbor set obtained based on the attention mechanism. In the relationship The attention fusion transformation matrix is ​​used. This fusion strategy can preserve the differences in the influence of sampled neighbor nodes on the central node under different relationships.

[0080] To obtain the overall features of a node across the entire relational semantic space, the model concatenates the aggregation results from all relations to form the final in-relation feature representation, thus obtaining the final in-relation node feature representation. The definition is as follows: ; In the above formula, This represents the concatenation operation along the feature dimension. It also represents the feature representation of nodes within a relation. It integrates information from different semantic neighbors, thus possessing higher semantic integrity and diversity.

[0081] In this embodiment, in the graph attention network information aggregation unit, integrating aggregated features into overall features within a relationship includes aligning the aggregated features corresponding to various relationships by dimensions and then concatenating them to obtain the overall features within the relationship.

[0082] In this embodiment, the cross-relationship attention mechanism uses the overall features within the relationship as a benchmark. First, the overall features within the relationship of the central node and the overall features within the relationship of the adaptive neighbor nodes under all relationships are converted into queries, keys, and values ​​for cross-relationship attention, respectively. The semantic relevance of each neighbor node to the central node from a global perspective is calculated through dot product operation, and the global contribution weight is obtained by normalization using the softmax function. Based on the global contribution weight, the features of the neighbor nodes under all relationships are weighted and fused to generate the overall neighbor weighted features. The overall neighbor weighted features are fused with the overall features within the relationship of the central node through residual connection, and then processed by layer normalization to generate the embedded representation of the waybill node.

[0083] Specifically, based on intra-relational aggregation, to further integrate the inherent features of waybill nodes and the overall features between multiple relations, a multi-relational overall aggregation strategy is proposed, realizing the multi-relational overall aggregation of waybill node information. An integrated representation of multi-source relational semantics is achieved through a unified attention mechanism, thereby endowing nodes with higher-level semantic representation capabilities. The process is as follows: Figure 5 As shown.

[0084] First, structurally unify the adaptive sampling neighbor sets within all relations to form a multi-relational overall adaptive sampling neighbor set, as shown in the following formula: ; In the above formula, Representing relations Next node The adaptive sampling neighbor set is constructed by the model through this joint operation, allowing it to build a complete multi-relational global adaptive sampling neighbor set in the global relational semantic space. .

[0085] To unify the modeling of node interaction information under multi-relation semantics, the node feature representation within the relation is... The mapping is into query, key, and value, and its calculation method is as follows: ;

[0086] In the above formula, , , These represent the transformation matrices for query, key, and value in a multi-relational aggregate, respectively, used to embed and project nodes into a unified attention space.

[0087] After completing the ternary vector calculation, the dot product attention mechanism is used to measure the multi-relation global neighborhood nodes. For the central node Attention level, attention weight The definition is as follows: ; In the above formula, Representing neighboring nodes For nodes The attention weight is a normalized result of the semantic matching degree between neighbors and the central node, reflecting the importance of information aggregation.

[0088] Furthermore, based on the calculated attention weights, the representations of all neighbor nodes within the overall neighborhood of the multi-relationship are weighted and fused to obtain the aggregated information representation of the neighbor nodes of the overall multi-relationship, defined as follows: ; In the above formula, It is a linear transformation matrix for the overall aggregation of multiple relationships, used to integrate the attention information of neighboring nodes with the structural semantics of the central node itself.

[0089] To enhance the model's multi-semantic representation capabilities, the residual structure and layer normalization are combined to further construct the interaction features between the central node and its multi-relationship overall fusion representation: ; In the above formula, For multi-relation node feature representation, As a layer normalization operation, this fusion method enables the model to maintain semantic diversity while possessing the ability to integrate information from multiple relationships, effectively enhancing the modeling ability for complex semantic structures in waybill anomaly detection.

[0090] Finally, the process of aggregating information within the order node relationship and the overall information aggregation process across multiple relationships are repeated. Next, generate the first Layer node embedding vector In summary, for both the intra-relational and multi-relational overall levels, an attention graph network-based information aggregation unit for waybill nodes was designed, which fully exploits the contextual semantic information of waybill nodes in a multi-relational graph structure.

[0091] In step S140, the waybill anomaly detection unit is a multilayer perceptron, and the final output of the graph attention network information aggregation unit is the first... Node embedding vectors generated by layer attention graph networks After being mapped by the waybill anomaly detection unit, it is used for classification, as shown in the following formula: ; In the above formula, This represents a multilayer perceptron, used to represent multiple relationships between nodes as a whole. Mapped to a classification space, For nodes The classification probability prediction results.

[0092] In this embodiment, the four units mentioned above—the multi-gated hybrid expert learning unit, the reinforcement learning adaptive neighbor selection unit, the graph attention network information aggregation unit, and the waybill anomaly detection unit—can be regarded as a complete waybill anomaly detection model. This is to achieve the detection of each logistics waybill node. The anomaly detection process, as shown in Figure 6, is the training and inference process of the complete waybill anomaly detection model.

[0093] Specifically, for the node binary classification task, this invention uses cross-entropy as the basic loss objective to optimize the difference between the predicted probability distribution of nodes and the true labels. The definition is as follows: ; In the above formula, Represents a node The true label vector, The loss is used for classifying waybill anomalies. To further enhance the model's ability to model semantic differences, this invention introduces a structure-aware label similarity loss. As a supplementary supervisory signal for the semantic consistency of node structure, the overall training loss is defined as follows: ;

[0094] In the above formula, It is a trade-off parameter that controls the similarity loss and the loss of the main node classification task. These are the coefficients of the L2 regularization term, used to prevent overfitting. This represents the set of all learnable parameters of the model.

[0095] like Figure 6 The diagram shown is a schematic of the training algorithm framework for the complete waybill anomaly detection model.

[0096] This paper also demonstrates the effectiveness of the method through a specific embodiment. In this specific embodiment, the following is set... As the action step size, the sampling threshold is dynamically and adaptively adjusted during training through a reinforcement learning mechanism, continuously optimizing the sampling threshold based on the semantic similarity between neighboring nodes and the center node and the classification effect. When the filtering threshold stabilizes and no longer changes after several iterations, the termination condition is met, and the sampling thresholds of neighbor sets under different relationships eventually converge to different values.

[0097] like Figure 7 As shown, the reinforcement learning mechanism proposed in this method can effectively drive the dynamic adjustment of the sampling threshold, and the sampling thresholds under different relationships exhibit significant differences. The sampling threshold exhibited significant fluctuations in the early stages of training, indicating a more complex graph structure and thus making model training more difficult. The relationship... and The sampling threshold fluctuates less within shorter rounds, due to the relationship This represents the relationship between waybill, user, and waybill node, and the user's waybill creation behavior pattern is relatively clear; Representing the waybill-time-waybill node relationship, the temporal characteristics of waybills mostly exhibit some temporal periodic patterns. Therefore, the graph structure under these relationships is relatively stable, and the representation of neighboring nodes is more consistent, which is beneficial for the model to aggregate information and learn features. The above phenomena further prove the effectiveness of the sampling strategy of our method in multi-relationship heterogeneous graph structures, which can assign differentiated neighbor selection weights to different relationships, enhancing the model's adaptability to structural heterogeneity.

[0098] Furthermore, ablation experiments were conducted to systematically verify the impact of key design considerations of the reinforcement learning adaptive neighbor selection strategy on the performance of this method. This method focuses on three core components: (1) a multi-gated hybrid expert learning (MMoE) unit, (2) an adaptive threshold adjustment mechanism utilizing the reward function, and (3) a multi-relational single-graph attention network. Figure 8 As shown, in the experiment, this method was compared with its three variant models w / o ATA, w / o MMoE and w / o MRA.

[0099] Specifically, in the w / o MMoE setting, replacing the multi-expert gating structure of MMoE with an MLP network results in the model's inability to effectively mine the generality and differences of node semantics under different relationships, leading to significant disadvantages in AUC and Recall. In contrast, MMoE, through its task-aware expert-sharing mechanism, not only improves the model's ability to represent multi-relation information but also enhances the flexibility and personalization of feature expression.

[0100] Furthermore, in the w / o ATA setting, a fixed sampling threshold is used instead of the adaptive threshold adjustment mechanism utilizing the reward function. The results show that the model's performance on both AUC and Recall metrics decreases. This indicates that the fixed threshold strategy lacks flexibility and adaptability when facing the differences in adjacency structure in multi-relationship graphs, failing to dynamically adjust the information aggregation strength and adapt to scenarios where the method wraps and flows through multiple heterogeneous nodes with different influences, thus affecting the anomaly detection capability. The threshold update mechanism provided by reinforcement learning can guide the model to gradually converge to the optimal sampling threshold during training based on the similarity of neighbor features, enhancing the model's robustness and generalization ability to graph structure changes.

[0101] In the w / o MRA setting, the multi-relationship graph attention mechanism in the original model is replaced with a simple mean aggregation method. This ignores the differential weights of neighbor nodes under different relationships during the aggregation process, thus failing to fully model the differences in the interaction strength of waybill nodes in different relationship structures. Experimental results show that removing the MRA module significantly reduces the model's performance in AUC and Recall metrics. This indicates that the attention-based relationship weighting mechanism plays a crucial role in modeling the interaction strength of waybills in multi-relationship graph structures. This mechanism can assign different weights to neighbor nodes under each relationship, thereby achieving more fine-grained feature representation and aggregation, and improving the model's ability to distinguish abnormal nodes. In contrast, simple mean aggregation ignores the importance of different neighbor nodes, causing the model to fail to effectively utilize the contextual information in the multi-relationship structure, thus affecting the final detection performance.

[0102] The aforementioned waybill anomaly detection method based on adaptive neighbor selection reinforcement learning first utilizes a multi-gated hybrid expert learning unit. This unit extracts the general semantic representation of waybill nodes through a shared expert network and dynamically activates different experts using multiple relation-specific gating networks to fuse heterogeneous features in multi-relational neighborhood subgraphs. To further optimize the quality of neighbor information, the reinforcement learning-based adaptive neighbor selection unit dynamically evaluates node associations through a perceptual similarity measurement mechanism and employs a Top-p sampling strategy to filter key neighbors. Simultaneously, a bounded, real-time reinforcement learning algorithm automatically optimizes the sampling threshold, achieving adaptive selection for multiple relations. Subsequently, a waybill node information aggregation unit based on a graph attention network efficiently aggregates the above information, performing overall attention calculations within and across relations using a multi-relational waybill attention graph network to fully mine neighborhood information. Finally, by fusing perceptual similarity loss and anomaly classification loss, the model is jointly trained and inferred, constructing an accurate and robust logistics waybill anomaly detection system. By addressing the difficulties in separating semantic features of waybill nodes and the strong interference from neighbor noise, the system effectively improves the recognition accuracy and robustness of abnormal waybills.

[0103] It should be understood that, although Figure 1 The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order in which these steps are executed, and they can be performed in other orders. Figure 1At least some of the steps in the process may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.

[0104] In one embodiment, such as Figure 9 As shown, a waybill anomaly detection device based on adaptive neighbor selection reinforcement learning is provided, comprising: a raw waybill data acquisition module 200, a multi-gated hybrid expert learning module 210, a reinforcement learning adaptive neighbor selection module 220, a graph attention network information aggregation module 230, and a waybill anomaly detection module 240, wherein: The original waybill data acquisition module 200 is used to acquire original waybill data in the logistics scenario, and to obtain the global comparison features of the corresponding waybill node and the multi-relationship waybill graph after preprocessing the original waybill data. The multi-gated hybrid expert learning module 210 is used to input the global comparative features and the multi-relationship waybill graph into the multi-gated hybrid expert learning unit. Through a shared expert set, the global comparative features are subjected to multi-view general semantic extraction. An independent gated network obtains expert weight allocation vectors based on various relationships in the multi-relationship waybill graph. The outputs of each expert network are weighted and fused based on the expert weight allocation vectors to obtain expert fusion features under different relationships. Then, the decision output network generates neighborhood features under various relationships based on the expert fusion features. At the same time, a linear transformation network is used to map the global comparative features to generate linear transformation features of the central node in the same semantic space as the neighborhood features. The reinforcement learning adaptive neighbor selection module 220 is used to input the multi-relationship transport graph, the neighborhood features of various relationships and the linear transformation features of the center node into the reinforcement learning adaptive neighbor selection unit to obtain an adaptive neighbor node set that is highly consistent with the semantics of the center node under various relationships. The graph attention network information aggregation module 230 is used to input the features output by the multi-relationship waybill graph, the adaptive neighbor node set under various relationships, and the multi-gated hybrid expert learning unit into the graph attention network information aggregation unit to generate the embedded representation of the waybill node; The waybill anomaly detection module 240 is used to input the embedded representation of the waybill node into the waybill anomaly detection unit to obtain the anomaly detection result.

[0105] Specific limitations regarding the waybill anomaly detection device based on adaptive neighbor selection reinforcement learning can be found in the limitations of the waybill anomaly detection method based on adaptive neighbor selection reinforcement learning described above, and will not be repeated here. Each module in the aforementioned waybill anomaly detection device based on adaptive neighbor selection reinforcement learning can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the corresponding operations of each module.

[0106] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 10 As shown, the computer device includes a processor, memory, network interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The network interface is used to communicate with external terminals via a network connection. When executed by the processor, the computer program implements a waybill anomaly detection method based on adaptive neighbor selection reinforcement learning. The display screen can be an LCD screen or an e-ink screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad mounted on the computer device casing, or an external keyboard, touchpad, or mouse.

[0107] Those skilled in the art will understand that Figure 10 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0108] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps: The original waybill data in the logistics scenario is obtained, and the original waybill data is preprocessed to obtain the global comparison features of the corresponding waybill node and the multi-relationship waybill graph. The global comparative features and the multi-relationship waybill graph are input into a multi-gated hybrid expert learning unit. The global comparative features are subjected to multi-view general semantic extraction through a shared expert set. An independent gated network obtains expert weight allocation vectors based on various relationships in the multi-relationship waybill graph. The outputs of each expert network are weighted and fused based on the expert weight allocation vectors to obtain expert fusion features under different relationships. Then, the decision output network generates neighborhood features under various relationships based on the expert fusion features. At the same time, a linear transformation network is used to map the global comparative features to generate linear transformation features of the central node in the same semantic space as the neighborhood features. By inputting the multi-relationship waybill graph, the neighborhood features of various relationships, and the linear transformation features of the center node into the adaptive neighbor selection unit of reinforcement learning, an adaptive set of neighbor nodes that are highly consistent with the semantics of the center node under various relationships is obtained. The features output by the multi-relationship waybill graph, the adaptive neighbor node set under various relationships, and the multi-gated hybrid expert learning unit are input into the graph attention network information aggregation unit to generate the embedded representation of the waybill node; The embedded representation of the waybill node is input into the waybill anomaly detection unit to obtain the adaptive neighbor selection unit for reinforcement learning of the anomaly detection result.

[0109] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor: The original waybill data in the logistics scenario is obtained, and the original waybill data is preprocessed to obtain the global comparison features of the corresponding waybill node and the multi-relationship waybill graph. The global comparative features and the multi-relationship waybill graph are input into a multi-gated hybrid expert learning unit. The global comparative features are subjected to multi-view general semantic extraction through a shared expert set. An independent gated network obtains expert weight allocation vectors based on various relationships in the multi-relationship waybill graph. The outputs of each expert network are weighted and fused based on the expert weight allocation vectors to obtain expert fusion features under different relationships. Then, the decision output network generates neighborhood features under various relationships based on the expert fusion features. At the same time, a linear transformation network is used to map the global comparative features to generate linear transformation features of the central node in the same semantic space as the neighborhood features. By inputting the multi-relationship waybill graph, the neighborhood features of various relationships, and the linear transformation features of the center node into the adaptive neighbor selection unit of reinforcement learning, an adaptive set of neighbor nodes that are highly consistent with the semantics of the center node under various relationships is obtained. The features output by the multi-relationship waybill graph, the adaptive neighbor node set under various relationships, and the multi-gated hybrid expert learning unit are input into the graph attention network information aggregation unit to generate the embedded representation of the waybill node; The embedded representation of the waybill node is input into the waybill anomaly detection unit to obtain the adaptive neighbor selection unit for reinforcement learning of the anomaly detection result.

[0110] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0111] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0112] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of the invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A waybill anomaly detection method based on adaptive neighbor selection reinforcement learning, characterized in that, The method includes: The original waybill data in the logistics scenario is obtained, and the original waybill data is preprocessed to obtain the global comparison features of the corresponding waybill node and the multi-relationship waybill graph. The global comparative features and the multi-relationship waybill graph are input into a multi-gated hybrid expert learning unit. The global comparative features are subjected to multi-view general semantic extraction through a shared expert set. An independent gated network obtains expert weight allocation vectors based on various relationships in the multi-relationship waybill graph. The outputs of each expert network are weighted and fused based on the expert weight allocation vectors to obtain expert fusion features under different relationships. Then, the decision output network generates neighborhood features under various relationships based on the expert fusion features. At the same time, a linear transformation network is used to map the global comparative features to generate linear transformation features of the central node in the same semantic space as the neighborhood features. The multi-relationship waybill graph, neighborhood features of various relationships, and linear transformation features of the center node are input into the reinforcement learning adaptive neighbor selection unit to obtain an adaptive neighbor node set that is highly semantically consistent with the center node under various relationships. In the reinforcement learning adaptive neighbor selection unit, the semantic consistency between the center node and its neighbors under each relationship is measured based on the label-aware distance and optimized accordingly. The selection threshold is dynamically adjusted through reinforcement learning to obtain the adaptive neighbor node set. The process also includes: the label-aware distance is the cosine distance between the linear transformation feature of the center node and the neighborhood feature of the neighbor node under the corresponding relationship, used to quantify the difference between the center node and the neighbor node in the label prediction semantic space. The node-aware similarity loss function optimizes the semantic consistency between the central node and its neighboring nodes. When using reinforcement learning to dynamically adjust the screening threshold, a Top-p neighbor sampling mechanism is adopted. Based on the similarity score corresponding to the semantic consistency, the neighboring nodes under each relationship are sorted in descending order. The sampling threshold is used as the state, the threshold adjustment action is used as the action space, and the change in the average label-aware distance between the central node and the sampled neighbor set is used as the immediate reward. A greedy strategy is adopted to select the optimal action to dynamically adjust the threshold for retaining the top p proportion of highly similar neighbors. When the reward fluctuation is lower than the preset threshold, the sampling threshold is fixed to obtain an adaptive set of neighboring nodes under each relationship. The features output by the multi-relationship waybill graph, the adaptive neighbor node set under various relationships, and the multi-gated hybrid expert learning unit are input into the graph attention network information aggregation unit to generate the embedded representation of the waybill node; The embedded representation of the waybill node is input into the waybill anomaly detection unit to obtain the anomaly detection result.

2. The waybill anomaly detection method based on adaptive neighbor selection reinforcement learning according to claim 1, characterized in that, In the multi-gated hybrid expert learning unit, the shared expert set consists of multiple expert networks with identical structures and independent parameters. Each expert network adopts a multilayer perceptron structure and learns semantic information of different dimensions in the global contrastive features through different weight parameters.

3. The waybill anomaly detection method based on adaptive neighbor selection reinforcement learning according to claim 2, characterized in that, In the multi-gated hybrid expert learning unit: The independent gating network corresponds one-to-one with the relationship types in the multi-relationship waybill diagram; Each independent gated network outputs a weight allocation vector matching the number of expert networks through a sigmoid activation function, and the sum of all elements in the weight allocation vector is 1, so as to achieve dynamic weighting of the outputs of different expert networks.

4. The waybill anomaly detection method based on adaptive neighbor selection reinforcement learning according to claim 3, characterized in that, In the multi-gated hybrid expert learning unit, the decision output network and the linear transformation network use the same feature dimension mapping rule; The decision output network maps expert fusion features to neighborhood features through a relation-specific linear layer; The linear transformation network maps global contrastive features to linear transformation features of the central node through a dedicated linear layer at the central node.

5. The waybill anomaly detection method based on adaptive neighbor selection reinforcement learning according to any one of claims 1-4, characterized in that, In the graph attention network information aggregation unit, a relation-specific attention mechanism is constructed for the adaptive neighbor node set of each type of relation. Weighted fusion is used to generate aggregated features corresponding to each type of relation. After integrating the aggregated features into a relation-wide feature, the weighted neighbor features and the relation-wide feature are fused through a cross-relation attention mechanism to obtain the embedded representation. The process further includes: The relation-specific attention mechanism constructs an independent attention parameter matrix for each type of relation. It converts the linear transformation features of the center node and the neighborhood features of the neighboring nodes into attention queries, keys, and values, calculates the initial semantic contribution weights using dot product operations, and normalizes them using the softmax function. The neighborhood features of neighboring nodes are weighted and summed based on the normalized weights, and then fused with the features of the central node itself through residual connections to generate aggregated features corresponding to various relationships.

6. The waybill anomaly detection method based on adaptive neighbor selection reinforcement learning according to claim 5, characterized in that, In the information aggregation unit of a graph attention network, integrating aggregated features into overall features within a relation includes: The aggregated features corresponding to various relationships are aligned by dimensions and then concatenated to obtain the overall features within the relationship.

7. The waybill anomaly detection method based on adaptive neighbor selection reinforcement learning according to claim 6, characterized in that, In the information aggregation unit of the graph attention network; The cross-relationship attention mechanism uses the overall features within the relationship as a benchmark. It first converts the overall features within the relationship of the central node and the overall features within the relationships of the adaptive neighbor nodes under all relationships into queries, keys, and values ​​for cross-relationship attention, respectively. The semantic association degree of each neighbor node with the central node from a global perspective is calculated by dot product operation, and the global contribution weight is obtained by normalization using the softmax function. Based on the global contribution weight, the features of neighbor nodes under all relationships are weighted and fused to generate overall neighbor weighted features; The weighted features of the overall neighbors and the overall features within the relationship of the central node are fused through residual connections and then processed by layer normalization to generate the embedded representation of the waybill node.

8. A waybill anomaly detection device based on adaptive neighbor selection reinforcement learning, characterized in that, The device implements the waybill anomaly detection method based on adaptive neighbor selection reinforcement learning as described in any one of claims 1-7, including: The original waybill data acquisition module is used to acquire original waybill data in the logistics scenario, and to obtain the global comparison features of the corresponding waybill node and the multi-relationship waybill graph after preprocessing the original waybill data. A multi-gated hybrid expert learning module is used to input the global comparative features and the multi-relationship waybill graph into the multi-gated hybrid expert learning unit. Through a shared expert set, the global comparative features are subjected to multi-view general semantic extraction. An independent gated network obtains expert weight allocation vectors based on various relationships in the multi-relationship waybill graph. The outputs of each expert network are weighted and fused based on the expert weight allocation vectors to obtain expert fusion features under different relationships. Then, the decision output network generates neighborhood features under various relationships based on the expert fusion features. At the same time, a linear transformation network is used to map the global comparative features to generate linear transformation features of the central node in the same semantic space as the neighborhood features. The reinforcement learning adaptive neighbor selection module is used to input the multi-relationship waybill graph, the neighborhood features of various relationships, and the linear transformation features of the center node into the reinforcement learning adaptive neighbor selection unit to obtain an adaptive neighbor node set that is highly consistent with the semantics of the center node under various relationships. The graph attention network information aggregation module is used to input the features of the multi-relationship waybill graph, the adaptive neighbor node set under various relationships, and the output of the multi-gated hybrid expert learning unit into the graph attention network information aggregation unit to generate the embedded representation of the waybill node; The waybill anomaly detection module is used to input the embedded representation of the waybill node into the waybill anomaly detection unit to obtain the anomaly detection result.

Citation Information

Patent Citations

  • Multi-dimensional data acquisition and anomaly detection method for industrial equipment

    CN120579113A

  • Multi-dimensional index-driven manufacturing enterprise supply chain digital transformation maturity evaluation method

    CN121032712A