Method and device for feature enhancement representation of time series data based on multi-scale contrastive learning

By constructing a multi-relationship graph using a multi-scale contrastive learning method and combining it with a graph convolutional network to generate global and local semantic features, the problem of multi-scale feature representation of logistics time-series order data is solved, improving the discriminative power of features and the generalization ability of the model, and enhancing the sensitivity of anomaly detection.

CN121389027BActive Publication Date: 2026-03-20NAT UNIV OF DEFENSE TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511941100.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-12-22
Publication Date
2026-03-20
Estimated Expiration
2045-12-22

AI Technical Summary

Technical Problem

The multi-scale features of logistics time-series order data are prone to information loss and representation bias when directly spliced ​​or aggregated. Existing methods are difficult to effectively capture deep semantics and contextual relationships, and their generalization ability is insufficient in the case of class imbalance.

Method used

A multi-scale contrastive learning approach is adopted. By constructing a multi-relationship graph, utilizing the neighborhood subgraph order node feature aggregation unit and the global-level order contrastive learning unit, combined with a graph convolutional network, global and local semantic features are generated and multi-scale fusion is performed to alleviate feature sparsity and class imbalance.

Benefits of technology

It improves the discriminative power and generalization of logistics order features, fully captures the order context, and enhances the sensitivity of anomaly detection and the efficiency of model implementation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121389027B_ABST
    Figure CN121389027B_ABST
Patent Text Reader

Abstract

The application relates to a time series data feature enhancement representation method and device based on multi-scale contrast learning in the field of computer information technology. The method comprises the following steps: extracting three types of node relationship data and basic attribute information of each order node of original time series order data respectively, constructing an order node feature matrix, constructing a relationship graph for the three types of node relationship data by using a neighborhood subgraph order node feature aggregation unit, processing the order node basic features corresponding to each relationship graph, extracting global semantic features and local semantic features according to the order node basic features by using a global level order contrast learning unit and a local level order contrast learning unit respectively, and fusing the two features to obtain multi-scale fusion logistics order enhanced features after the order basic attribute is enhanced. By using the method, the sparsity and class imbalance of logistics order features can be relieved, multi-scale information fragmentation can be solved, and the order semantic expression and downstream task adaptability can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of computer information technology, and particularly relates to a time series data feature enhancement representation method and device based on multi-scale contrastive learning. BACKGROUND

[0002] With the deep integration of e-commerce and global supply chain, modern logistics systems exhibit highly complex, dynamic, and cross-network collaboration characteristics. Billions of logistics time series order data are generated every day. These data not only have a huge scale, but also have complex characteristics such as multi-source, heterogeneous, and spatio-temporal correlation. Efficient and accurate learning of the semantic representation of orders from these data is of great significance for intelligent logistics operation and management, especially for key tasks such as abnormal order detection, time prediction, and route optimization. However, the inherent characteristics of logistics time series order data (such as feature sparsity, class imbalance, and strong context dependence) make it difficult to directly use original features or traditional methods for modeling.

[0003] Logistics orders usually contain multi-dimensional information, such as sender and receiver information, goods details, timestamps, routing node sequences, real-time status updates, and the like. These features often exist in different semantic spaces and scales: there are fine-grained sequential events (such as “pick-up-transit-delivery”), and there are coarse-grained statistical summaries (such as historical average delivery time); there are static attributes (such as goods type), and there are dynamically changing states (such as geographic location time series trajectory). Directly concatenating or aggregating these heterogeneous and multi-scale features can easily lead to information loss and representation bias, making it difficult to capture their deep semantics and context relationships, thereby restricting the performance of downstream tasks.

[0004] To learn better order representations, existing research mainly employs the following methods: Methods based on traditional feature engineering heavily rely on domain knowledge to manually construct statistical features (such as historical anomaly rates and routing frequencies). While highly interpretable, these methods are costly to construct and have poor generalization ability, making them difficult to adapt to constantly changing logistics scenarios and new fraud patterns. Methods based on deep learning utilize recurrent neural networks (RNNs / Temporal CNNs) to encode the temporal state of orders or use graph neural networks (GNNs) to model order-node relationships. While these methods can automatically learn feature representations, they typically rely heavily on large amounts of labeled data and are prone to overfitting in logistics scenarios with highly imbalanced positive and negative samples. Furthermore, most methods lack the ability to explicitly model and fuse multi-scale features, failing to adequately coordinate information at different granularities (such as individual events and global behavior). Methods based on contrastive learning have shown great potential in recent years for learning robust representations in unsupervised or semi-supervised scenarios by constructing positive and negative sample pairs. Existing work has attempted to apply this approach to sequence or graph-structured data. However, in the field of logistics orders, most of these methods do not fully consider the multi-scale characteristics of features. When constructing comparative samples, they usually rely on only a single scale (e.g., only performing temporal enhancement or only using graph structure enhancement), and fail to jointly utilize the self-supervised signals between micro-behavioral patterns and macro-network patterns, thus limiting the discriminative power and generalization of feature representations. Summary of the Invention

[0005] Therefore, it is necessary to provide a method and apparatus for enhancing the representation of temporal data features based on multi-scale contrastive learning, which can perform multi-scale feature fusion, alleviate class imbalance and feature sparsity, in order to address the above-mentioned technical problems.

[0006] A method for enhancing the feature representation of time-series data based on multi-scale contrastive learning, the method comprising:

[0007] Obtain raw time-series order data in a logistics scenario. The raw time-series order data contains multiple order node data. Extract three types of node relationship data and basic attribute information of each order node from the raw time-series order data to construct an order node feature matrix.

[0008] Using the neighborhood subgraph order node feature aggregation unit, relationship graphs are constructed for the three types of node relationship data respectively, and the order node feature matrix is ​​used to process the relationship graphs to obtain the basic features of order nodes corresponding to each relationship graph;

[0009] The global-level order contrast learning unit generates global contrast positive and negative sample pairs based on order node basic features corresponding to each relationship graph according to a predefined logic, calculates a global similarity score based on the global contrast positive and negative sample pairs using a similarity score measurement mechanism of a bidirectional linear transformation, and extracts global semantic features;

[0010] The local-level order contrast learning unit determines a set of neighborhood nodes in each relationship graph based on three types of node relationship data with each order node as a center node, constructs a local environment information subgraph through a center node feature masking strategy, aggregates local environment semantic features using a pre-trained graph convolutional network sharing parameters with the global module, and calculates local semantic features using a dual similarity measurement mechanism.

[0011] After multi-scale fusion of the global semantic features and the local semantic features, a multi-scale fusion logistics order enhanced feature enhanced by each order basic attribute information in the order node feature matrix is obtained.

[0012] In one embodiment, the three types of node relationship data are extracted from the original time-series order data, including:

[0013] The original time-series order data includes logistics order information, courier performance information, and user portrait information.

[0014] According to the courier performance information, order ID, courier ID, and road area ID are extracted. If two orders belong to the same road area and are collected by the same courier, an O-P-O relationship is established as the first type of node relationship data.

[0015] According to the user portrait information, order ID and user ID are extracted. The user's annual order quantity is counted and the order frequency level is divided. If the order creation user levels of two orders are the same, an O-U-O relationship is established as the second type of node relationship data.

[0016] According to the logistics order information, order ID and creation time are extracted. If the order pickup time and workday or holiday attributes of two orders are consistent, an O-T-O relationship is established as the third type of node relationship data.

[0017] In one embodiment, the basic attribute information of each order is extracted from the original time-series order data to construct an order node feature matrix, including:

[0018] The basic attribute information includes payment amount, cargo size and weight, insurance amount, and cargo and product type.

[0019] After numerical processing of the basic attribute information, the order node feature matrix is constructed by arranging the order nodes.

[0020] In an embodiment, processing the relationship graph by using the single-node feature matrix to obtain the order node basic feature corresponding to each relationship graph comprises:

[0021] Adding a self-loop to the adjacency matrix of each relationship graph and performing normalization processing, and configuring an independent graph convolutional network for each relationship graph;

[0022] Initializing the 0th layer hidden state of each graph convolutional network by using the order node feature matrix;

[0023] Aggregating neighbor node information by performing layer-by-layer convolution operation on the processed relationship graph adjacency matrix through each initialized graph convolutional network to obtain the order node basic feature corresponding to each relationship graph;

[0024] In an embodiment, the adding a self-loop to the adjacency matrix of each relationship graph and performing normalization processing comprises:

[0025] According to each relationship graph, constructing an adjacency matrix for quantifying the connection relationship between order nodes;

[0026] Adding a self-loop to each adjacency matrix by stacking a unit matrix consistent with the dimension of the adjacency matrix and the adjacency matrix;

[0027] Calculating the degree matrix corresponding to each adjacency matrix, and then pre-multiplying and post-multiplying the adjacency matrix after adding the self-loop by the reciprocal square root of the degree matrix to perform normalization processing.

[0028] In an embodiment, configuring an independent graph convolutional network for each relationship graph and initializing the 0th layer hidden state of the graph convolutional network by using the order node feature matrix comprises:

[0029] For each relationship graph, configuring an independent graph convolutional network comprising a plurality of convolutional layers, and the parameters of the graph convolutional network corresponding to each relationship graph are not shared;

[0030] After linear transformation of the order node feature matrix and the initialization weight matrix, inputting an activation function for nonlinear processing to obtain the 0th layer hidden state of the graph convolutional network, wherein the dimension of the initialization weight matrix is determined by the number of order node features and the hidden layer parameters.

[0031] In an embodiment, in the global-level order comparison learning unit:

[0032] Based on the order label distribution quantization rule determined in the training stage, the consistency of the order node basic feature and the order label is calculated, and then the basic features of the same label order node are fused to generate global comparison positive samples, and the basic features of the different label order node are fused to generate global comparison negative samples, to form a global comparison positive and negative sample pair;

[0033] The context transformation matrix learned in the training stage is called to calculate the global similarity score of the order node basic feature and the global comparison positive and negative sample pair through the similarity score measurement mechanism of bidirectional linear transformation.

[0034] Based on the feature screening threshold determined in the training stage, the feature components corresponding to the global similarity scores meeting the threshold requirements are screened out, and the screened feature components are aggregated to form and extract global semantic features.

[0035] In one embodiment, in the local level order comparison learning unit:

[0036] Taking each order node as a center node, matching the nodes in each relationship graph that have a direct association with the center node according to three types of node relationship data, respectively, to form a neighborhood node set of the center node under the corresponding relationship graph;

[0037] Performing shielding processing on the order node basic feature of the center node, combining the original basic features of the neighborhood node set and the connection relationship of each relationship graph, and constructing a local environment information subgraph corresponding to each center node;

[0038] Inputting the adjacency matrix of the local environment information subgraph and the subgraph node feature into the pre-trained graph convolution network, aggregating the neighborhood node semantic information through layer-by-layer convolution operation, and generating local environment semantic features;

[0039] Calling the dual similarity matrix learned in the training, calculating the similarity between the local environment semantic features corresponding to the center node using the dual similarity measurement mechanism, screening the feature information meeting the threshold in the training stage, and aggregating to obtain local semantic features.

[0040] In one embodiment, when training the global level order comparison learning unit and the local level order comparison learning unit:

[0041] Based on the similarity score of bidirectional linear transformation, a binary classification cross-entropy loss function is used to calculate the global comparison loss, wherein the similarity score is obtained according to the similarity of the order node basic feature and the global comparison positive and negative sample pair.

[0042] Based on the dual similarity score, a binary classification cross-entropy loss function is used to calculate the local comparison loss, wherein the dual similarity score is obtained according to the similarity between the local environment semantic features of the center node.

[0043] A joint loss function is constructed according to the global contrast loss and the local contrast loss, and the training parameters including the context transformation matrix of the global-level order contrast learning unit, the dual similarity matrix of the local-level order contrast learning unit, and the convolution layer parameters of the pre-trained graph convolution network shared by the two units are updated by back propagation to minimize the joint loss function.

[0044] The application also provides a time series data feature enhancement representation device based on multi-scale contrast learning, which comprises:

[0045] An original time series order data acquisition module is configured to acquire original time series order data in a logistics scenario, wherein the original time series order data comprises a plurality of order node data, three types of node relationship data are extracted from the original time series order data respectively, and the basic attribute information of each order node is extracted to construct an order node feature matrix.

[0046] An order node basic feature obtaining module is configured to construct a relationship graph for each type of node relationship data by using a neighborhood subgraph order node feature aggregation unit, and obtain the order node basic feature corresponding to each relationship graph by processing the relationship graph by using the order node feature matrix.

[0047] A global semantic feature extraction module is configured to generate a global contrast positive-negative sample pair based on the order node basic feature corresponding to each relationship graph according to a pre-defined logic by using a global-level order contrast learning unit, calculate a global similarity score according to the global contrast positive-negative sample pair by using a similarity score measurement mechanism of a bidirectional linear transformation, and extract a global semantic feature.

[0048] A local semantic feature extraction module is configured to determine a neighborhood node set in each relationship graph based on the three types of node relationship data by taking each order node as a center node, construct a local environment information subgraph by using a center node feature shielding strategy, aggregate a local environment semantic feature by using a pre-trained graph convolution network sharing parameters with the global module, and calculate a local semantic feature by using a dual similarity measurement mechanism.

[0049] A logistics order feature enhancement module is configured to obtain a multi-scale fusion logistics order enhancement feature after multi-scale fusion of the global semantic feature and the local semantic feature.

[0050] A computer device comprises a memory and a processor, the memory stores a computer program, and the processor implements the steps of the above-mentioned time series data feature enhancement representation method based on multi-scale contrast learning when executing the computer program.

[0051] A computer readable storage medium, having stored thereon a computer program, the computer program being executed by a processor to implement the steps of the above-mentioned multi-scale contrastive learning-based time series data feature enhancement representation method.

[0052] The multi-scale contrastive learning-based time series data feature enhancement representation method and device, by obtaining original time series order data in a logistics scenario, the original time series order data containing multiple order node data, extracting three types of node relationship data from the original time series order data respectively, and constructing an order node feature matrix of the basic attribute information of each order node, using a neighborhood subgraph order node feature aggregation unit, constructing a relationship graph for each type of node relationship data, and processing the relationship graph using the order node feature matrix to obtain the order node basic feature corresponding to each relationship graph, using a global level order contrastive learning unit, based on the order node basic feature corresponding to each relationship graph, generating a global contrastive positive and negative sample pair according to a pre-defined logic, calculating a global similarity score according to the global contrastive positive and negative sample pair using a similarity score measurement mechanism of a bidirectional linear transformation, extracting a global semantic feature, using a local level order contrastive learning unit, taking each order node as a center node, determining a neighborhood node set in each relationship graph based on the three types of node relationship data, constructing a local environment information subgraph through a center node feature screening strategy, aggregating local environment semantic features using a pre-trained graph convolutional network sharing parameters with the global module, and calculating the local semantic features using a dual similarity measurement mechanism. After multi-scale fusion of the global semantic features and the local semantic features, a multi-scale fusion logistics order enhanced feature enhanced by the basic attribute information of each order in the order node feature matrix is obtained. This method uses three types of node relationships to construct multi-relationship graphs, aggregates neighbor information using independent GCN, relieves order feature sparsity, enriches semantic expression, generates positive and negative samples according to labels through global contrastive learning, and improves class imbalance by using a bidirectional linear similarity measurement mechanism, thereby improving feature discrimination, fusing global macro semantic and local neighborhood semantic, breaking multi-scale information fragmentation, completely capturing order context, reusing global GCN parameters in the local unit, reducing redundancy, improving model generalization and landing efficiency, accurately identifying implicit abnormal patterns through the local center node screening strategy, and strengthening abnormal detection sensitivity. BRIEF DESCRIPTION OF DRAWINGS

[0053] Figure 1 A flowchart of a multi-scale contrastive learning-based time series data feature enhancement method in one embodiment;

[0054] Figure 2 A training flowchart of a global level order contrastive learning unit in one embodiment;

[0055] Figure 3 A training flowchart of a local level order contrastive learning unit in one embodiment;

[0056] Figure 4 A schematic diagram of a training algorithm framework for a multi-scale contrastive learning-based logistics order feature enhancement representation model in an embodiment;

[0057] Figure 5 A schematic diagram of the variation of the multi-scale contrastive learning loss function in an experiment;

[0058] Figure 6 A schematic diagram of the multi-scale contrastive learning strategy ablation experiment results in an experiment;

[0059] Figure 7 A schematic diagram of multi-step updates of the optimizer in multi-scale contrastive learning in an experiment;

[0060] Figure 8 A structural block diagram of a multi-scale contrastive learning-based time series data feature enhancement device in an embodiment;

[0061] Figure 9 An internal structure diagram of a computer device in an embodiment. DETAILED DESCRIPTION

[0062] In order to make the purpose, technical scheme and advantages of the present application clearer, the present application will be further described in detail below in combination with the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and do not limit the present application.

[0063] In the present embodiment, as shown in Figure 1 , a multi-scale contrastive learning-based time series data feature enhancement method is provided, comprising the following steps:

[0064] Step S100, obtaining original time series order data in a logistics scenario, the original time series order data containing a plurality of order node data, extracting three types of node relationship data and the basic attribute information of each order node from the original time series order data, and constructing an order node feature matrix.

[0065] Step S110, using a neighborhood subgraph order node feature aggregation unit to construct a relationship graph for each of the three types of node relationship data, and processing the relationship graph using the order node feature matrix to obtain the order node basic feature corresponding to each relationship graph.

[0066] Step S120, using a global-level order contrastive learning unit to generate a global contrastive positive-negative sample pair based on the order node basic feature corresponding to each relationship graph according to a pre-defined logic, calculate a global similarity score based on the global contrastive positive-negative sample pair using a similarity score measurement mechanism of bidirectional linear transformation, and extract a global semantic feature.

[0067] In step S130, the local level order comparison learning unit determines the neighborhood node set in each relationship graph based on the three types of node relationship data, constructs a local environment information subgraph through a center node feature shielding strategy, aggregates local environment semantic features using a pre-trained graph convolutional network sharing parameters with the global module, and calculates the local semantic features using a dual similarity measurement mechanism.

[0068] In step S140, after multi-scale fusion of the global semantic features and the local semantic features, a multi-scale fusion logistics order enhanced feature is obtained, which enhances the basic attribute information of each order in the order node feature matrix.

[0069] In this application, in the neighborhood subgraph order node feature aggregation unit in the logistics abnormal order detection research, for the three types of order node relationships (O-P-O, O-U-O and O-T-O), corresponding graph structures are constructed, and a graph convolutional network (GCN) with layers of convolution is designed for each relationship graph. First, the adjacency matrix of each relationship graph is added with a self-loop and normalized to obtain a standardized matrix, so as to preserve the node's own features and enhance the aggregation stability. Then, the order node feature matrix is used to initialize the 0th layer hidden state. Each layer of convolution updates the node representation by aggregating neighbor node information, and finally realizes the layer-by-layer refinement and enhancement of the order node features through multi-layer convolution. This process effectively improves the consistency of node feature expression and the structure perception ability, and lays a stable feature foundation for subsequent multi-scale contrastive learning.

[0070] Then, in the global level order comparison learning unit, the feature mode and label consistency of the order node under the multi-class neighborhood subgraph are quantitatively analyzed according to the order node features and label distribution. In view of the problems of sparse abnormal nodes and high feature aggregation degree, a global contrast feature generation strategy is designed, the global contrast features are aggregated using a graph convolutional network, a global contrast positive and negative sample pair is constructed, and a similarity score measurement mechanism based on bidirectional linear transformation is designed to improve the separation ability of the model in the global scale for abnormal distribution.

[0071] Further, in the local level order comparison learning unit, a center node feature shielding strategy is introduced, only the neighborhood nodes of the center node are used to construct a local environment information subgraph, the local environment semantics are aggregated through a graph convolutional network sharing parameters with the global level, and a local contrast positive and negative sample pair is constructed. Subsequently, a dual similarity measurement mechanism is designed specifically and is used as a local supervision signal to participate in the training process together with the global contrast semantic information.

[0072] ​Meanwhile, when training the global-level order contrast learning unit and the local-level order contrast learning unit, the global-level contrast loss and the local-level contrast loss are jointly optimized, an adjustable weight factor is introduced, and a joint loss function that integrates multi-scale contrast objectives is uniformly constructed, so that the node feature expression capability is improved in the multi-relation order graph structure. Finally, the above trained model can effectively enhance the multi-scale of the basic attribute information of each order.

[0073] In step S100, three types of node relationship data are extracted from the original time series order data, including: first, the original time series order data includes logistics order information, courier performance information and user portrait information. According to the courier performance information, order ID, courier ID and road area ID are extracted. If two orders belong to the same road area and are collected by the same courier, an O-P-O relationship is established as the first type of node relationship data. According to the user portrait information, order ID and user ID are extracted, the user's annual order quantity is counted and the order frequency level is divided. If two orders have the same user level, an O-U-O relationship is established as the second type of node relationship data. According to the logistics order information, order ID and creation time are extracted. If the order pickup time and working day or holiday attribute of two orders are consistent, an O-T-O relationship is established as the third type of node relationship data.

[0074] In this embodiment, the basic attribute information of each order is extracted from the original time series order data, and the order node feature matrix is constructed, including: the basic attribute information includes: payment amount, cargo size and weight, insurance amount, cargo and product type. After numerical processing of the basic attribute information, the order node is arranged, and the order node feature matrix is constructed.

[0075] In step S110, in the neighborhood subgraph order node feature aggregation module, for three types of order node relationships , namely O-P-O, O-U-O and O-T-O, three types of graph structures are constructed, denoted as . For each relationship graph , a graph convolution model with convolution layers will be constructed, the th graph convolution layer is denoted as .

[0076] In the embodiment, the single-node feature matrix is used to process the relationship graph, and the order node basic features corresponding to each relationship graph include: adding a self-loop to the adjacency matrix of each relationship graph and performing normalization processing, configuring an independent graph convolution network for each relationship graph, and initializing the 0th layer hidden state of each graph convolution network using the order node feature matrix. The initialized graph convolution network is used to perform layer-by-layer convolution operation on the processed relationship graph adjacency matrix to aggregate neighbor node information, and the order node basic features corresponding to each relationship graph are obtained.

[0077] Specifically, the neighborhood subgraph order node feature aggregation unit adds a self-loop to the adjacency matrix of each relationship graph and performs normalization processing, including: constructing an adjacency matrix for quantifying the connection relationship between order nodes according to each relationship graph, then adding a unit matrix with the same dimension as the adjacency matrix to the adjacency matrix to realize adding a self-loop to each adjacency matrix, calculating the degree matrix corresponding to each adjacency matrix, and then multiplying the adjacency matrix after adding the self-loop by the square root reciprocal of the degree matrix to realize normalization processing.

[0078] Specifically, for the relationship graph , the adjacency matrix of the logistics order node in the graph is denoted as , and the feature matrix of the order node is denoted as In order to ensure that each node can consider the features of neighbor nodes and retain its own features during feature aggregation, and prevent the information of the node itself from being covered by neighbor information during the aggregation process, the logistics order node adjacency matrix is transformed as follows:

[0079] ;

[0080] In the above formula, denotes the transformed adjacency matrix of the relationship graph , and is a unit matrix. Secondly, in order to control the range of order node feature values, avoid the instability of the numerical values, balance the influence between nodes, and make the feature aggregation process more uniform, the adjacency matrix is also normalized. The specific process is as follows:

[0081] ;

[0082] In the above formula, denotes the degree matrix of the relationship graph .

[0083] In the embodiment, an independent graph convolutional network is configured for each relationship graph, and the order node feature matrix is used to initialize the 0th layer hidden state of the graph convolutional network. The method comprises the following steps: for each relationship graph, an independent graph convolutional network comprising a plurality of convolutional layers is configured, and the parameters of the graph convolutional network corresponding to each relationship graph are not shared. After linear transformation of the order node feature matrix and an initialization weight matrix, a non-linear process is performed on the order node feature matrix by using an activation function to obtain the 0th layer hidden state of the graph convolutional network, wherein the dimension of the initialization weight matrix is determined by the number of order node features and hidden layer parameters.

[0084] Specifically, the feature matrix of the order node is used to initialize the 0th order node hidden state of the relationship graph. The relationship graph is initialized. The 0th order node hidden state of the relationship graph is initialized. The formula is as follows:

[0085] ;

[0086] In the above formula, the activation function is represented by , , is a hidden layer parameter. Next, for the order node hidden state of the mth layer , the node information aggregation process is as follows:

[0087] ;

[0088] In the above formula, the order node hidden state of the m-1th layer is represented by , is a linear transformation matrix of the node state in the mth layer. Finally, the aggregation of the order node information by using the mth layer graph convolutional layer is denoted by

[0089] For the order relationship graph , the above node information aggregation process can be simplified as:

[0090] ;

[0091] In the above formula, the order node basic feature is represented by . In the subsequent steps, in step S120, the positive and negative samples are constructed based on the order node basic feature, and in step S130, the order node basic feature is used as the node feature of the domain subgraph for processing.

[0092] In step S120, in the global level order comparison learning unit, the feature similarity and label similarity indicators between the order nodes are introduced, and the multi-edge order relationship ​​​​On this basis, the structural quality of orders under multi-class semantic relationships is evaluated from two aspects of node feature similarity and node label consistency. For each order node in each relationship graph , a neighborhood subgraph is defined, where is the first-order neighbor set of , is the corresponding edge set, is the enhanced representation generated by subsequent contrastive learning, is the relationship, is the node label, and the node feature of the domain subgraph is the basic feature of the order node .

[0093] In this embodiment, for the three types of semantic relationships O-P-O, O-U-O and O-T-O, specifically, for any relationship ∈{1, 2, 3}, the feature similarity of a node pair is defined in the form of the following exponential kernel function , which is used to measure the similarity of the two nodes in the feature space connected by the edge. Wherein, represents the edge set constructed based on the relationship in the graph, and the node pair on each edge is modeled as follows:

[0094] ;

[0095] In the above formula, are the feature vectors of the order nodes , and represents the squared Euclidean distance. This formula smoothes the node feature distance by a Gaussian kernel function, so that the smaller the distance between nodes, the greater the contribution. Finally, the average similarity of the entire relationship graph is normalized, and the result value range is (0, 1). The higher the value, the more consistent the node features connected by the edge under the relationship.

[0096] In this embodiment, the global-level order contrastive learning unit is shown in Figure 2 , which introduces a contrastive feature enhancement mechanism for order nodes at the global level, aiming to construct a structure-aware and semantically enhanced representation for each order node for subsequent global contrastive learning tasks.

[0097] ​In the embodiment, in the global level order contrast learning unit: based on the order label distribution quantization rule determined in the training stage, the consistency of the order node basic feature and the order label is calculated, and then the basic features of the same label order node are fused to generate global contrast positive samples, and the basic features of different label order nodes are fused to generate global contrast negative samples, to form a global contrast positive and negative sample pair, the context transformation matrix learned in the training stage is called, the global similarity score of the order node basic feature and the global contrast positive and negative sample pair is calculated through the similarity score measurement mechanism of bidirectional linear transformation. Based on the feature screening threshold determined in the training stage, the feature components corresponding to the global similarity score meeting the threshold requirement are screened out, and the screened feature components are aggregated to form and extract global semantic features.

[0098] Specifically, the global level order contrast learning unit is based on the neighborhood subgraph defined in the foregoing , and performs feature aggregation through a multi-layer graph neural network. The following will describe the unit from three stages of initialization, structure perception aggregation and feature fusion.

[0099] In the initialization stage, the global level order contrast learning unit takes the original feature of the center node as input , wherein the center node refers to the order node v currently being processed. In the graph neural network, the information of the neighbors is usually aggregated around each node, which is called "center node", and the original feature comes from the order node feature matrix constructed in step S100 , that is, the numerical feature vector of "payment amount, cargo size and weight, insured amount, cargo and product type", etc. An initial hidden representation is generated through a relationship-aware linear mapping , and the process is defined as follows:

[0100] ;

[0101] In the above formula, is the initialization weight matrix related to the relationship , and is a nonlinear activation function. This operation preserves the information structure of the original node feature, making the subsequent feature aggregation more discriminative.

[0102] Further, in order to more fully integrate the information of the target node and its neighbors in the graph structure, in each layer , the representation of the first-order neighbor set of the center node is first averaged with its own representation to obtain the neighborhood average feature:

[0103] ;

[0104] The above expression realizes the modeling of self-loop information by adding the node itself , alleviating the gradient degradation problem caused by the sparsity of adjacency information in the graph structure.

[0105] Next, the representation of the target node is spliced with the aggregated representation of the neighborhood (the neighborhood comes from the first-order neighbor set of node v in the relationship graph) to obtain the fused structural semantic feature representation:

[0106] ;

[0107] This splicing operation enhances the guiding role of local context on node representation, so that the model can not only capture the node's own features, but also effectively fuse the neighborhood semantic background, and improve the discriminability of node embedding.

[0108] After obtaining the fused feature , the graph convolution network based on the relationship is used to encode it to update the node representation of the current layer:

[0109] ;

[0110] In the above formula, The core operation includes the normalization and linear transformation of the adjacency matrix. The main goal of this step is to use the information of multiple-order neighbors for semantic diffusion, so as to generate structure-sensitive node embedding and capture more extensive semantic relevance within the subgraph.

[0111] After completing the layer graph neural network encoding, the model inputs the node representation of the final layer to a set of relationship-aware multilayer perceptrons to further generate the final global contrastive representation :

[0112] ;

[0113] In the above formula, is the parameter set of the MLP under the relationship . The introduction of this process not only enhances the model's ability to learn the semantic boundaries of nodes, but also alleviates the representation confusion problem caused by the inter-class connection of the graph structure.

[0114] In this embodiment, the global positive sample candidate set of the node in the training batch, i.e., the current sample, is defined based on label consistency. Specifically, for a certain center node , the positive sample node set of the node is defined as the set of nodes in the batch that are connected to the node The set of all nodes with the same label is in the form shown below:

[0115] ;

[0116] In the above formula, and Representing nodes respectively and central node Category tags, This represents the set of all order nodes participating in global contrastive learning in the current training batch. When two nodes belong to the same category (normal or abnormal), they are included in the positive sample candidate set. middle.

[0117] Next, in order to extract category consistency information from the feature level, the set is calculated. China in relations Below and The average of the original features of all nodes with the same label As the central representation of the label-consistent node in the input space:

[0118] ;

[0119] In the above formula, Represents a node The original input features, This is the number of nodes in the set of positive samples. This formula measures the clustering position of positive samples in the original feature space, providing a structurally independent but label-consistent reference representation.

[0120] In this embodiment, the calculation set In graph neural networks ( The mean of the contrast features generated after propagation This is used to model the central tendency of class-consistent nodes in the contrastive representation space.

[0121] ;

[0122] In the above formula, Based on relationships Below generated nodes The global comparison representation. This reflects the shared semantic features of nodes with consistent categories after graph structure modeling.

[0123] Finally, the generated features and the original features are weighted and fused using a linear combination method to obtain the center node. The global-level positive sample representation, Global-level positive contrast samples is defined as:

[0124] ;

[0125] In the above formula, the hyper-parameter is used to control the degree of influence of the original features on the final sample representation. When is larger, the model is more inclined to utilize the original structural information; when is smaller, more emphasis is placed on the embedding features learned by the graph.

[0126] In this embodiment, similar to the positive sample construction method, first define the set of nodes in the training batch that are different from the center node label, used to form the negative contrast sample pair, define :

[0127] ;

[0128] This set selects all nodes that are opposite to the semantic label of the center node , ensuring that the generated negative sample representation has significant class differences.

[0129] Further, calculate the mean of the original features of the nodes in the set , which is used to describe the collective representation of abnormal nodes in the original feature space:

[0130] ;

[0131] Here is consistent with the definition in the previous section, reflecting the possible disturbance feature pattern of the negative sample in the input space. Similarly, solve the contrast feature mean of all nodes in the set in the representation space , the formula is as follows:

[0132] ;

[0133] This formula represents the shared representation features of abnormal nodes after graph structure modeling, which is a key reference vector in the subsequent contrast task.

[0134] Finally, the positive sample construction method is also applied to the negative sample, obtaining the global contrast representation of the negative sample, the formula is as follows:

[0135] ;

[0136] This vector will participate in the similarity calculation as the negative item in the contrast loss, and its design aims to maximize its semantic distance from the center node, thereby improving the discriminative efficiency of contrast learning. ​

[0137] In this embodiment, when training the global-level order contrast learning, the similarity between the center node generated feature and the positive contrast sample is maximized, while the similarity between the center node generated feature and the negative contrast sample is minimized. To achieve this goal, a bi-linear layer is adopted to calculate the similarity score between nodes, and on this basis, the probability transformation and contrast loss calculation are performed.

[0138] First, to implement the bi-linear matching mechanism, a context transformation matrix is constructed, which is defined as follows:

[0139] ;

[0140] In the above formula, respectively represent two learnable linear mapping matrices, represents the context feature interaction weight matrix under the relationship , which is used to capture the matching relationship between nodes under different semantics. By constructing in the form of transposed product of two mapping matrices, more rich context information interaction can be introduced while maintaining the model interpretability.

[0141] Next, after obtaining the context matching weight matrix, the matching score between the center node generated feature and the positive contrast sample is calculated using the bi-linear mapping method:

[0142]

[0143] Then, it is mapped to a similarity probability score by an activation function:

[0144] ;

[0145] In the above formula, represents the similarity probability between node and its positive contrast sample under the relationship . This calculation method indicates that the higher the similarity score between positive samples, the closer the corresponding probability value to 1, thereby enhancing the model's ability to model semantic consistency samples.

[0146] Further, similar to the positive sample, the matching process of the negative contrast sample with the generated node feature is as follows:

[0147] ;

[0148] Again, the activation function is used to map it to a similarity probability score.Obtain the similarity probability of the negative sample:

[0149]

[0150] In the above formula, represents the similarity score between the node and its negative contrast sample, the closer to 0 indicates the greater difference. The core of this step is to further enhance the discriminative ability of the model by reducing the similarity between the node and the negative sample, thereby being punished in the loss function.

[0151] In order to effectively distinguish the positive and negative sample pairs and optimize the discriminative ability of the model, in the embodiment, a binary cross-entropy (BCE) is introduced as a loss function in the context-level contrast learning task. The loss function is widely used in binary classification tasks and can measure the difference between the model output probability distribution and the true label, thereby guiding the iterative optimization of the model parameters.

[0152] Specifically, the binary cross-entropy loss function is widely used in binary classification, and the formula is defined as follows:

[0153]

[0154] In the context contrast learning task, a loss function is independently designed for each relationship type . For each training sample, its positive sample and negative sample are spliced in order, and a label vector is constructed, the th element of which is defined as:

[0155]

[0156] At the same time, the model generates a corresponding similarity score vector , the th component of which is defined as:

[0157]

[0158] Finally, the context contrast learning loss function under the relationship type can be expressed as:

[0159]

[0160] In the above formula, represents the number of samples in the batch. By minimizing the loss function, the discriminative ability of the model for the context relationship type can be effectively improved, and the distinguishability of the positive and negative samples in the representation space can be promoted. ​​​​​

[0161] In step S130, in the local-level order comparison learning unit, each order node is taken as the center node. Based on the three types of node relationship data, nodes that are directly related to the center node in each relationship graph are matched to form a set of neighboring nodes of the center node in the corresponding relationship graph. The basic features of the order node of the center node are masked. Combining the original basic features of the neighboring node set and the connection relationship of each relationship graph, a local environment information subgraph corresponding to each center node is constructed. The adjacency matrix of the local environment information subgraph and the node features of the subgraph are input into the pre-trained graph convolutional network. The semantic information of the neighboring nodes is aggregated through layer-by-layer convolution operations to generate local environment semantic features. The dual similarity matrix learned during training is called. The dual similarity measurement mechanism is used to calculate the similarity between the local environment semantic features corresponding to the center node. Feature information that meets the threshold of the training stage is filtered and aggregated to obtain local semantic features.

[0162] In this embodiment, as Figure 3 As shown, in the local-level order comparison learning unit, the neighborhood subgraph, i.e., the set of neighborhood nodes, is analyzed. The central node in The feature masking operation is performed, and the features of each node in its neighborhood subgraph become the basic features of the order node. The masking operation is for constructing a self-supervised signal and does not negate the use of the basic features, i.e., the nodes... The initial features are replaced with zero vectors to block their influence during feature propagation. This masking operation can be formalized as:

[0163] ;

[0164] In the above formula, This represents the masking feature vector of layer 0, with all zeros. It is used to simulate local environments where information about the central node is missing.

[0165] Specifically, during the propagation process of the graph neural network at each layer, the features of neighboring nodes are propagated to the central node through mean aggregation. The aggregated representation of the neighbor node features of a layer is as follows:

[0166] ;

[0167] In the above formula, Representing relations Next node The neighborhood group, Indicates the neighbor node at the th The shielding characteristics of the layer are represented.

[0168] Next, the features of the center node and its neighboring nodes are concatenated to construct a feature vector for graph convolution input, in the following form:

[0169] ;

[0170] In the above formula, represents a vector splicing operation, generating a composite feature that fuses the center node and its neighbor node information. Finally, the graph convolution network is used to propagate the spliced features to generate a feature expression for local environment contrast learning:

[0171] ;

[0172] In the above formula, is the local environment feature vector generated by the i-th layer. This representation is generated without relying on the node's own features, but only through the information of the neighborhood structure, thus effectively reflecting the statistical distribution characteristics of the local environment, which can be used for subsequent difference measurement with the global contrast feature, enhancing the model's ability to recognize abnormal nodes. In this embodiment, a refined contrast sample generation strategy is constructed at the local level, aiming to use the neighborhood environment to assist in modeling the center node. This strategy is based on the key assumption in the anomaly detection scenario, that is, the abnormal node exhibits a significantly different feature pattern from the environment in its local neighborhood, while the normal node maintains consistency with the environment. Therefore, for the global contrast feature generation node

[0173] , the present application dynamically determines its local environment feature according to its true label category, that is, the role in the contrast learning task, that is, a positive sample or a negative sample.

[0174] Specifically, the following sample division logic is adopted: when the node is an abnormal node, that is, , the local environment feature of the node is regarded as a negative sample, and a negative sample pair is constructed, and the training objective is to maximize the difference, that is, to drive the model to identify the abnormal deviation features of the node from its neighborhood environment. When the node is a normal node, that is, , the local environment feature of the node is regarded as a positive sample, and a positive sample pair is constructed, and the training objective is to minimize the difference, that is, to enhance the semantic consistency modeling between the node and its neighborhood.

[0175] ​Further, through the above label-driven contrastive sample definition mechanism, the model will be explicitly guided to learn the local deviation of abnormal nodes and the local consistency of normal nodes during training, so as to realize higher resolution modeling of node class and structural differences. The contrast strategy is closely combined with the local contrast loss function, in which the cross-entropy calculation of the label encoding vector and the predicted similarity score achieves supervised guidance on positive and negative relationship pairs.

[0176] In this embodiment, in the local-level order contrast learning, on the basis of the foregoing local contrast feature modeling, a learnable dual similarity measurement mechanism is designed to further quantify the relevance between the node and its local environment feature representation The mechanism aims to capture the coupling relationship between the behavior characteristics of the node itself in the global perspective and the environmental semantics exhibited by the node in the local structure of the neighborhood, thereby improving the recognition ability of the model to abnormal patterns.

[0177] To achieve the above goal, first, a relationship-specific bidirectional linear weight matrix is constructed, and then the invention calculates the similarity between the node and its environment representation in a trainable manner, as follows:

[0178] ;

[0179] In the above formula, , are the parameter matrices under the relationship , denotes the feature dimension, is the low-rank approximation dimension. The matrix captures the interaction structure of the node under different relationship types through learnable low-rank decomposition.

[0180] Next, based on the dual linear parameter matrix, the dual similarity between the environment feature and the generated feature is defined, as follows:

[0181] ;

[0182] The above formula matches the two feature vectors through bidirectional linear interaction structure, capturing their collaborative relationship in the embedding space. The larger the value, the higher the similarity between the two, reflecting the consistency between the local and global semantic distribution of the node.

[0183] To facilitate model training and interpretation, the dual similarity value is further mapped to a probability form of similarity score, using The activation function is normalized, and the final form is as follows:

[0184] ;

[0185] This score will be used to distinguish positive and negative samples in subsequent loss function construction, providing an explicit supervision signal for the model to optimize the embedding feature representation.

[0186] Further, in the local-level order contrast learning unit, it is assumed that the normal nodes provide reliable and semantically consistent environmental feature information in the neighborhood propagation. Therefore, it is expected that the model can strengthen the semantic consistency between its neighborhood environment representation on the normal nodes, i.e., the generated global contrast feature should have a higher similarity with the neighborhood semantic feature ; on the contrary, on the abnormal nodes, it should show obvious semantic difference.

[0187] To achieve the above optimization goal, first define the local contrast supervision signal to distinguish the positive and negative attributes of each sample in the training set, the formula is as follows:

[0188] ;

[0189] In the above formula, is the true label of node , 0 represents a normal node, and 1 represents an abnormal node. As can be seen, represents the expected similarity (positive sample), then it means that the similarity between the neighborhood environment should be reduced (negative sample).

[0190] Next, the predicted value of the local similarity between nodes is denoted as:

[0191] ;

[0192] The above variable is the local similarity score of node estimated using the bidirectional linear measurement mechanism, which is the predicted score of the contrast supervision target.

[0193] Finally, to measure the deviation between the model's predicted similarity and the expected semantic consistency, a binary cross-entropy loss function is introduced as the optimization objective, which is as follows:

[0194] ;

[0195] In the above formula, represents the node set in the current mini-batch, The loss encouragement model maintains high similarity on normal nodes and low similarity on abnormal nodes, thereby effectively improving the perception ability of the model to abnormal behaviors in the local structure. As a local supervision signal, the loss term will participate in the training process together with the global contrast loss function to cooperatively optimize the node embedding representation and improve the discrimination performance of the model for abnormal behaviors of logistics orders.

[0196] In the embodiment, when training the global-level order contrast learning unit and the local-level order contrast learning unit, a binary classification cross-entropy loss function is used to calculate the global contrast loss based on the similarity score obtained according to the similarity between the order node basic features and the global contrast positive and negative sample pairs, a binary classification cross-entropy loss function is used to calculate the local contrast loss based on the dual similarity score obtained according to the similarity between the local environment semantic features of the center nodes, and a joint loss function is constructed according to the global contrast loss and the local contrast loss. The training parameters including the context transformation matrix of the global-level order contrast learning unit, the dual similarity matrix of the local-level order contrast learning unit, and the convolution layer parameters of the pre-trained graph convolution network shared by the two units are updated by back propagation to minimize the joint loss function.

[0197] In the embodiment, when training the global-level order contrast learning unit and the local-level order contrast learning unit, a joint optimization method combining global loss and local loss is used to optimize the features of the difference generation nodes. An adjustable balance coefficient hyperparameter is introduced to control the relative weight of the global loss and the local loss in the final training target. Under the condition of the hyperparameter , the present application defines the joint loss under the first class relationship as:

[0198] ;

[0199] In the above formula, represents the context-based global contrast learning loss function, which measures the global feature consistency under the first class relationship graph; represents the local structure contrast learning loss, which is used to capture the local expression difference of abnormal behaviors in the neighborhood; controls the weight distribution of the two.

[0200] As shown in Figure 4 , the joint optimization strategy ensures that each unit pays attention to both global structure patterns and local semantic differences during the training process, so that the learned node representation has stronger abnormal detection discrimination ability while maintaining semantic consistency.

[0201] To demonstrate the effectiveness of the method, it is also applied in a specific embodiment. In the logistics scenario, how to accurately capture the characteristics of logistics orders and model their potential association patterns is a key problem in building an efficient abnormal order detection model. The site usually refers to the operation center, distribution center or transit station of a logistics enterprise or express company, which is an important hub for packages at different transportation stages. Its main functions include package collection, sorting, storage, scheduling and delivery, playing a key role. Road zones are geographical units divided according to administrative divisions, transportation networks, logistics operation needs and other factors. Using the real order trajectory dataset provided by the Jingdong logistics platform, in this method, the geographical space is divided according to the sites defined in the platform, and a site-road zone mapping table is constructed to depict the geographical area to which each road zone belongs. According to the site ID and road zone ID fields contained in each order record, the association is established to define the order spatial structure information. All order samples are matched, and order information with missing road zone ID is removed to ensure the integrity and consistency of the geographical structure data. Each road zone usually contains multiple sites and has different population density, business activity and logistics demand characteristics.

[0202] Further, according to the logistics order information dataset, the logistics order courier performance dataset and the logistics order user portrait dataset, three types of relationships are extracted to construct the order multi-relationship graph. Define the multi-relationship graph as where each logistics pickup order is defined as a node The node set is i.e. According to the payment amount, length of goods, value of goods, width of goods, type of goods, height of goods, weight of goods, product type and other fields in the logistics order information dataset, the feature information of the logistics order is defined as the node feature The feature set is i.e. , represent different types of relationships, i.e. Finally, the edge set is defined as where represents an edge connecting and through the relationship Nodes can be connected through multiple types of relationship edges. is a set of labels for each node in Under a specific relationship , the first-order neighbor node of the target node is denoted as , and the local subgraph formed by the target node and its first-order neighbor is denoted as is defined as the neighborhood subgraph. The edge set of this subgraph is The node is connected in this relationship, in the relationship , the original target node is denoted as . Through this node representation, the target node is connected with its neighbors, thereby modeling the influence of different relationships on node features. The neighborhood subgraph of each target node is uniquely determined and provides a relationship-aware local structure learning method for graph neural networks, enabling the model to more accurately capture the representation of nodes under different relationships and improve the feature expression capability for the logistics order anomaly detection task.

[0203] Further, according to the logistics order courier performance dataset, the fields in the order data including order ID, courier ID and road area ID are extracted. Order records with missing courier ID or area identifier are removed to ensure the semantic consistency and data quality of the graph structure. On the basis of the previous data analysis, the order-courier-order (O-P-O) relationship in the logistics scenario is defined, that is, if two logistics pickup orders belong to the same road area and are collected by the same courier, an edge is established between the corresponding nodes, which essentially constructs the connection relationship between the orders continuously collected by the same courier in the same area. The graph constructed under this relationship is referred to as the O-P-O graph. The O-P-O relationship is defined as the first type of relationship, i.e. = 1. The O-P-O graph can depict the distribution mode of orders in the area and model the influence of courier performance on order performance. Finally, the neighborhood subgraph under the O-P-O relationship is defined as According to the logistics order user portrait dataset, the fields in the order data including order ID and user ID are extracted. Order records with missing user ID are removed to ensure the semantic consistency and data quality of the graph structure. The order-user-order (O-U-O) relationship in the logistics scenario is defined, that is, if the creation users of two orders belong to the same annual order frequency level, an edge is established between the order nodes. The total amount of user logistics orders in a year is counted, and users are bucketed by annual order amount. Users with annual order amount of 0-10 are classified into the first bucket, and the annual order frequency level rating is 1; users with annual order amount of 11-20 are classified into the second bucket, and the annual order frequency level rating is 2, and so on. Then, the edge is constructed according to the user annual order frequency level. This graph can reflect the order mode of different sending user groups, thereby assisting in abnormal order detection. The O-U-O relationship is defined as the second type of relationship, i.e. =2. The present application defines the neighborhood subgraph under O-U-O relationship as According to the logistics order information dataset, the fields in the order data are extracted, including order ID and order creation time. Order records with missing order creation time are removed to ensure the semantic consistency and data quality of the graph structure. The order-time-order (O-T-O) relationship in the logistics scenario is defined, that is, if the appointment pickup time and working holiday of two orders are the same, an edge is established between the order nodes. The O-T-O relationship is defined as the third type of relationship, that is =3. This subgraph can reflect the order pattern under different time sequences, thereby assisting in abnormal order detection. The present application defines the neighborhood subgraph under O-T-O relationship as The core of the present application is to learn the structural information and node features of the graph to identify potential abnormal behavior patterns, so that each node, i.e. the logistics order entity, will be labeled as an abnormal node or a normal node. Each node has a label , where 0 represents a normal order and 1 represents an abnormal order. The relationship R between nodes in the graph considers the synergistic effect of multi-entity interaction, and the rule definition comes from users with similar order frequencies, the same road area and courier, or orders with similar time sequence features. Since abnormal orders often exhibit complex network relationships and hidden patterns, the multi-relation graph-based method can utilize the topology and hierarchical structure between nodes, combine neighbor information and global relationships, more effectively detect abnormal activities, and improve the accuracy and robustness of detection.

[0204] After generating the guide nodes, the feature similarity between abnormal and normal nodes decreases, the intra-class node clustering degree is higher, and the inter-class distance increases. As can be seen from Figure 5 , the multi-scale contrastive learning loss functions corresponding to relationships , and all show obvious convergence trends during the training process, verifying the effectiveness of global guide node generation for the contrastive learning goal in the multi-relation graph. Further observation shows that the loss value of relationship fluctuates greatly in the early stage of training and converges relatively slowly, indicating that the relationship structure is more complex and the training difficulty is higher. Since relationship represents the order-courier-order relationship, in the actual delivery process, the large number of couriers leads to complex order node attribution, resulting in higher model training cost; while relationships and rapidly decrease in a short period, indicating that their structures are relatively stable and easy to learn by the model. Overall, the multi-scale contrastive learning strategy can effectively adapt to the structural characteristics of different relationships, enhancing the robustness and generalization ability of the model.

[0205] Then, the influence of the key design of the multi-scale contrastive learning strategy on the performance of the method is systematically verified through ablation experiments. The ablation experiments focus on two core components: (1) the global contrastive learning module and (2) the local contrastive learning module. Comparative experiments are conducted between the proposed method and its three variant models w / o Gen, w / o GC, and w / o LC. In the w / o Gen setting, i.e., removing the node feature generation module in the model, only direct aggregation operations using graph convolution are used, and the separable node features generated based on multi-scale contrastive learning are ignored. As shown in FIG. 6, the variant is lower than the complete model in AUC and Recall indicators, indicating that the module has important value for improving the expression ability and recognition accuracy of the model. To further analyze the contribution of different scales in the multi-scale contrastive learning mechanism, two model variants w / o GC and w / o LC are constructed, which remove the global contrastive learning module and the local contrastive learning module, respectively. Experiments show that even if only one scale of the learning module is retained, the model can still achieve good results, but when the two scales are trained collaboratively, the model performance is significantly better, verifying the complementarity and effectiveness of the multi-scale contrastive strategy in expressing information. Figure 6

[0206] Figure 7 The influence of the number of step-by-step training on the performance of the model in multi-scale contrastive learning is shown. Specifically, in each round of overall training, the multi-scale contrastive learning part optimizer is separately executed for multiple-step optimization updates. As can be seen from the experimental results, when the number of step-by-step training increases from 0 to 8, the AUC and Recall of the model are both improved, and when the number of steps is 8, the performance is optimal. Appropriately increasing the optimization steps of the multi-scale contrastive learning part helps to fully learn the feature representation and better distinguish abnormal nodes.

[0207] In the above multi-scale contrastive learning-based logistics order feature enhancement representation method, the separability of abnormal nodes is enhanced through global and local contrastive learning. Based on the three types of heterogeneous relationship graph structures of O-P-O, O-U-O, and O-T-O, the model first aggregates node features using a graph convolutional network to construct a multi-level feature base. At the global level, by quantifying the consistency of the features and labels of the nodes in the multi-relation subgraph, a pair of contrastive samples is constructed and a bidirectional similarity measurement mechanism is designed to enhance the recognition ability of the abnormal distribution. At the local level, a center node feature masking strategy is used to construct a local environment subgraph based only on neighborhood information, and a dual similarity measurement is used to strengthen local difference perception. Finally, the multi-scale contrastive loss is jointly optimized through adjustable weights, effectively improving the node representation ability and alleviating the problem of abnormal sample sparsity and feature aggregation.

[0208] It should be understood that, although Figure 1 ​The steps in the flowcharts are shown in sequence according to the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order limitation for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1 At least part of the steps in the flowcharts can include multiple sub-steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution order of these sub-steps or stages is not necessarily sequential, but can be alternately executed with at least part of other steps or sub-steps or stages of other steps.

[0209] In one embodiment, as shown in Figure 8 A multi-scale contrast learning-based time series data feature enhancement representation device is provided, comprising: an original time series order data acquisition module 200, an order node basic feature obtaining module 210, a global semantic feature extraction module 220, a local semantic feature extraction module 230, and a logistics order feature enhancement module 240, wherein:

[0210] The original time series order data acquisition module 200 is configured to acquire original time series order data in a logistics scenario, wherein the original time series order data includes multiple order node data, three types of node relationship data are extracted from the original time series order data, and the basic attribute information of each order node is extracted, and an order node feature matrix is constructed;

[0211] The order node basic feature obtaining module 210 is configured to use a neighborhood subgraph order node feature aggregation unit to construct a relationship graph for each of the three types of node relationship data, and use the order node feature matrix to process the relationship graph to obtain an order node basic feature corresponding to each relationship graph;

[0212] The global semantic feature extraction module 220 is configured to use a global-level order contrast learning unit to generate a global contrast positive-negative sample pair based on the order node basic features corresponding to the relationship graphs according to a predefined logic, calculate a global similarity score based on the global contrast positive-negative sample pair using a similarity score measurement mechanism of a bidirectional linear transformation, and extract a global semantic feature;

[0213] The local semantic feature extraction module 230 is configured to use a local-level order contrast learning unit to determine a neighborhood node set in each relationship graph based on the three types of node relationship data by taking each order node as a center node, construct a local environment information subgraph by a center node feature masking strategy, aggregate a local environment semantic feature using a pre-trained graph convolutional network sharing parameters with the global module, and calculate a local semantic feature using a dual similarity measurement mechanism;

[0214] The logistics order feature enhancement module 240 is configured to obtain the multi-scale fusion logistics order enhanced feature after the global semantic feature and the local semantic feature are fused.

[0215] The specific limitations of the time series data feature enhancement representation device based on multi-scale contrastive learning can refer to the limitations of the time series data feature enhancement representation method based on multi-scale contrastive learning described above, and will not be described here. Each module in the above time series data feature enhancement representation device based on multi-scale contrastive learning can be realized by software, hardware, and combinations thereof, in whole or in part. The above modules can be embedded in or independent of the processor in the computer device in hardware form, or can be stored in the memory in the computer device in software form, so that the processor calls and executes the operations corresponding to each of the above modules.

[0216] In one embodiment, a computer device is provided, which can be a terminal, and its internal structure diagram can be as shown in Figure 9 The computer device includes a processor, a memory, a network interface, a display screen, and an input device connected through a system bus. The processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operating system and the computer program in the non-volatile storage medium to run. The network interface of the computer device is configured to communicate with external terminals through network connections. The computer program is executed by the processor to implement a time series data feature enhancement representation method based on multi-scale contrastive learning. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer overlaid on the display screen, or a key, trackball, or touchpad provided on the shell of the computer device. It can also be an external keyboard, touchpad, or mouse, etc.

[0217] Those skilled in the art can understand that Figure 9 The structure shown in the above

[0218] In one embodiment, a computer device is provided, which includes a memory and a processor, and the memory stores a computer program. When the processor executes the computer program, the following steps are implemented:

[0219] The original time sequence order data in a logistics scenario is acquired, the original time sequence order data includes multiple order node data, three types of node relationship data are extracted from the original time sequence order data respectively, and the order node feature matrix is constructed based on the basic attribute information of each order node.

[0220] The order node feature aggregation unit is used to construct a relationship graph for each type of node relationship data, and the order node feature matrix is used to process the relationship graph to obtain the order node basic feature corresponding to each relationship graph.

[0221] The order contrast learning unit at the global level is used to generate a global contrast positive-negative sample pair based on the order node basic feature corresponding to each relationship graph according to a predefined logic, calculate a global similarity score based on the global contrast positive-negative sample pair by using a similarity score measurement mechanism of bidirectional linear transformation, and extract a global semantic feature.

[0222] The order contrast learning unit at the local level is used to determine a set of neighborhood nodes in each relationship graph based on the three types of node relationship data by taking each order node as a center node, construct a local environment information subgraph by using a center node feature shielding strategy, aggregate a local environment semantic feature by using a pre-trained graph convolutional network sharing parameters with the global module, and calculate a local semantic feature by using a dual similarity measurement mechanism.

[0223] After the global semantic feature and the local semantic feature are fused at multiple scales, a multi-scale fusion logistics order enhanced feature is obtained, which enhances the basic attribute information of each order in the order node feature matrix.

[0224] In one embodiment, a computer readable storage medium is provided, which stores a computer program. When the computer program is executed by a processor, the following steps are implemented:

[0225] The original time sequence order data in a logistics scenario is acquired, the original time sequence order data includes multiple order node data, three types of node relationship data are extracted from the original time sequence order data respectively, and the order node feature matrix is constructed based on the basic attribute information of each order node.

[0226] The order node feature aggregation unit is used to construct a relationship graph for each type of node relationship data, and the order node feature matrix is used to process the relationship graph to obtain the order node basic feature corresponding to each relationship graph.

[0227] The order contrast learning unit at the global level is used to generate a global contrast positive-negative sample pair based on the order node basic feature corresponding to each relationship graph according to a predefined logic, calculate a global similarity score based on the global contrast positive-negative sample pair by using a similarity score measurement mechanism of bidirectional linear transformation, and extract a global semantic feature.

[0228] The local level order contrast learning unit takes each order node as a center node, determines a set of neighborhood nodes in each relationship graph based on three types of node relationship data, constructs a local environment information subgraph through a center node feature screening strategy, aggregates local environment semantic features by using a pre-training graph convolutional network sharing parameters with a global module, and calculates local semantic features by using a dual similarity measurement mechanism.

[0229] After multi-scale fusion of the global semantic features and the local semantic features, a multi-scale fusion logistics order enhanced feature enhanced by each order basic attribute information in an order node feature matrix is obtained.

[0230] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by a computer program instructing related hardware, and the computer program can be stored in a non-volatile computer readable storage medium. When the computer program is executed, it can include the processes of the above-mentioned embodiments. Any reference to memory, storage, database or other medium used in each embodiment provided by the present application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration but not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0231] Each technical feature of the above embodiments can be combined arbitrarily. To make the description concise, all possible combinations of each technical feature in the above embodiments are not described, but as long as the combinations of the technical features do not exist, they should be considered as the scope of the present disclosure.

[0232] The above embodiments only express several implementation ways of the present application, and the description is more specific and detailed, but it should not be understood as a limitation to the scope of the application. It should be pointed out that for ordinary skilled in the art, without departing from the concept of the present application, several modifications and improvements can be made, which are all within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.

Claims

1. A method for enhancing the feature representation of time-series data based on multi-scale contrastive learning, characterized in that, The method includes: Obtain raw time-series order data in a logistics scenario. The raw time-series order data contains multiple order node data. Extract three types of node relationship data and basic attribute information of each order node from the raw time-series order data to construct an order node feature matrix. Using the neighborhood subgraph order node feature aggregation unit, relationship graphs are constructed for the three types of node relationship data respectively, and the order node feature matrix is ​​used to process the relationship graphs to obtain the basic features of order nodes corresponding to each relationship graph; Using a global-level order comparison learning unit, based on the basic features of the order nodes corresponding to each relationship graph, global comparison positive and negative sample pairs are generated according to predefined logic. A bidirectional linear transformation similarity score measurement mechanism is used to calculate the global similarity score based on the global comparison positive and negative sample pairs, and global semantic features are extracted. By utilizing local-level order comparison learning units, each order node is taken as the central node. Based on three types of node relationship data, the set of neighboring nodes in each relationship graph is determined. A local environment information subgraph is constructed through a central node feature masking strategy. Local environment semantic features are aggregated using a pre-trained graph convolutional network that shares parameters with the global module. Local semantic features are calculated using a dual similarity measurement mechanism. After multi-scale fusion of the global semantic features and local semantic features, multi-scale fused logistics order enhancement features are obtained, which enhance the basic attribute information of each order in the order node feature matrix.

2. The temporal data feature enhancement representation method based on multi-scale contrastive learning according to claim 1, characterized in that, The extraction of three types of node relationship data from the original time-series order data includes: The original time-series order data includes logistics order information, courier performance information, and user profile information; Based on the courier's performance information, extract the order ID, courier ID, and route ID. If two orders belong to the same route and are picked up by the same courier, then establish an OPO relationship as the first type of node relationship data. Based on the user profile information, extract the order ID and user ID, count the number of orders placed by the user in a year and classify the order frequency levels. If two orders are created by users of the same level, establish an OUO relationship as the second type of node relationship data. Based on the logistics order information, extract the order ID and creation time. If the scheduled pickup time and weekday or holiday attributes of the two orders are consistent, establish an OTO relationship as the third type of node relationship data.

3. The temporal data feature enhancement representation method based on multi-scale contrastive learning according to claim 2, characterized in that, The basic attribute information of each order is extracted from the original time-series order data, and the order node feature matrix is ​​constructed, including: The basic attribute information includes: payment amount, cargo dimensions and weight, declared value, and cargo and product type; After numerical processing of the basic attribute information, the data are arranged according to order nodes to construct the order node feature matrix.

4. The temporal data feature enhancement representation method based on multi-scale contrastive learning according to claim 1, characterized in that, The relationship graph is processed using the single-node feature matrix to obtain the basic features of each order node corresponding to the relationship graph, including: Add self-loops to the adjacency matrix of each relation graph and normalize it, then configure an independent graph convolutional network for each relation graph; The hidden state of layer 0 of each graph convolutional network is initialized using the order node feature matrix; By performing layer-by-layer convolution operations on the adjacency matrix of the processed relational graph through each initialized graph convolutional network, the information of neighboring nodes is aggregated to obtain the basic features of the order nodes corresponding to each relational graph.

5. The temporal data feature enhancement representation method based on multi-scale contrastive learning according to claim 4, characterized in that, The step of adding self-loops to the adjacency matrix of each relation graph and performing normalization processing using the neighborhood subgraph order node feature aggregation unit includes: Based on the relationship graphs described above, an adjacency matrix is ​​constructed to quantify the connection relationships between order nodes; By superimposing an identity matrix with the same dimension as the adjacency matrix onto the adjacency matrix, a self-loop can be added to each of the adjacency matrices; Calculate the degree matrix corresponding to each adjacency matrix, and then perform pre-multiplication and post-multiplication on the adjacency matrix after adding self-loops using the reciprocal of the square root of the degree matrix to achieve normalization.

6. The temporal data feature enhancement representation method based on multi-scale contrastive learning according to claim 5, characterized in that, Each relationship graph is configured with an independent graph convolutional network, and the hidden state of layer 0 of the graph convolutional network is initialized using the order node feature matrix, including: For each relation graph, configure an independent graph convolutional network with multiple convolutional layers, and the parameters of the graph convolutional networks corresponding to each relation graph are not shared; After linearly transforming the order node feature matrix and the initial weight matrix, the input is processed nonlinearly by the activation function to obtain the hidden state of the 0th layer of the graph convolutional network. The dimension of the initial weight matrix is ​​determined by the number of order node features and the hidden layer parameters.

7. The temporal data feature enhancement representation method based on multi-scale contrastive learning according to claim 1, characterized in that, In the global-level order comparison learning unit: Based on the order label distribution quantification rules determined during the training phase, the consistency between the basic features of order nodes and order labels is calculated. Then, according to the weight coefficients optimized during the training phase, the basic features of order nodes with the same label are fused to generate global comparison positive samples, while the basic features of order nodes with different labels are fused to generate global comparison negative samples, forming a global comparison positive and negative sample pair. The context transformation matrix learned during the training phase is invoked, and the global similarity score between the basic features of the order node and the global comparison positive and negative sample pairs is calculated through the similarity score measurement mechanism of bidirectional linear transformation. Based on the feature selection threshold determined during the training phase, feature components corresponding to global similarity scores that meet the threshold requirements are selected. The selected feature components are then aggregated to form and extract global semantic features.

8. The temporal data feature enhancement representation method based on multi-scale contrastive learning according to claim 1, characterized in that, In the local-level order comparison learning unit: Taking each order node as the central node, based on the three types of node relationship data, we match the nodes in each relationship graph that are directly related to the central node, forming a set of neighborhood nodes of the central node in the corresponding relationship graph; The basic features of the order node of the central node are masked, and the original basic features of the neighboring node set and the connection relationships of each relationship graph are combined to construct a local environment information subgraph corresponding to each central node. The adjacency matrix of the local environment information subgraph and the subgraph node features are input into a pre-trained graph convolutional network. The semantic information of the neighboring nodes is aggregated through layer-by-layer convolution operations to generate local environment semantic features. The dual similarity matrix learned during training is invoked, and the dual similarity measurement mechanism is used to calculate the similarity between the local environmental semantic features corresponding to the central node. Feature information that meets the threshold of the training stage is filtered and aggregated to obtain local semantic features.

9. The temporal data feature enhancement representation method based on multi-scale contrastive learning according to claim 7 or 8, characterized in that, When training the global-level order comparison learning unit and the local-level order comparison learning unit: Based on the similarity score of bidirectional linear transformation, the global comparison loss is calculated using the binary classification cross-entropy loss function. The similarity score is obtained based on the similarity between the basic features of the order node and the global comparison positive and negative sample pairs. Based on the dual similarity score, the local contrast loss is calculated using the binary cross-entropy loss function, wherein the dual similarity score is obtained based on the similarity between the local environmental semantic features of the central node; A joint loss function is constructed based on the global and local contrastive losses. With the goal of minimizing the joint loss function, the training parameters are updated through backpropagation. The training parameters include the context transformation matrix of the global-level order contrastive learning unit, the dual similarity matrix of the local-level order contrastive learning unit, and the convolutional layer parameters of the pre-trained graph convolutional network shared by the two units.

10. A temporal data feature enhancement and representation device based on multi-scale contrastive learning, characterized in that, The device includes: The original time-series order data acquisition module is used to acquire original time-series order data in a logistics scenario. The original time-series order data contains multiple order node data. Three types of node relationship data and basic attribute information of each order node are extracted from the original time-series order data to construct an order node feature matrix. The order node basic feature acquisition module is used to construct relationship graphs for the three types of node relationship data using the neighborhood subgraph order node feature aggregation unit, and process the relationship graphs using the order node feature matrix to obtain the order node basic features corresponding to each relationship graph; The global semantic feature extraction module is used to utilize the global-level order comparison learning unit to generate global comparison positive and negative sample pairs according to predefined logic based on the basic features of the order nodes corresponding to each relationship graph. It uses a bidirectional linear transformation similarity score measurement mechanism to calculate the global similarity score based on the global comparison positive and negative sample pairs and extract global semantic features. The local semantic feature extraction module is used to utilize the local-level order comparison learning unit, taking each order node as the center node, and determining the set of neighboring nodes in each relationship graph based on three types of node relationship data. It constructs a local environment information subgraph through the center node feature masking strategy, aggregates local environment semantic features using a pre-trained graph convolutional network that shares parameters with the global module, and calculates local semantic features using a dual similarity measurement mechanism. The logistics order feature enhancement module is used to perform multi-scale fusion of the global semantic features and local semantic features to obtain multi-scale fused logistics order enhancement features that enhance the basic attribute information of each order in the order node feature matrix.

Citation Information

Patent Citations

  • Cross-image associated information enhanced visual location identification method, device and equipment

    CN119418148A

  • Vehicle track similarity calculation method based on semantic fusion and enhanced contrast learning

    CN120162605A