Method for identifying peer-to-peer content delivery network traffic by storing and memorizing prototype network

By using a memory prototype network method, and leveraging few-shot learning tasks and feature extraction networks to generate embedded feature representations, the resource imbalance problem in traffic identification and management in PCDN systems is solved, achieving efficient traffic identification and resource optimization.

CN121985157APending Publication Date: 2026-05-05NANJING UNIV OF POSTS & TELECOMM
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
NANJING UNIV OF POSTS & TELECOMM
Filing Date
2026-03-13
Publication Date
2026-05-05

AI Technical Summary

Technical Problem

Existing peer-to-peer content delivery network (PCDN) systems suffer from resource imbalances in traffic identification and management, making it difficult to provide differentiated bandwidth guarantees and congestion control, resulting in performance degradation of overloaded nodes and idle low-cost nodes.

Method used

The method of storing memory prototype networks is adopted. A feature extraction network is constructed through a few-shot learning task to generate embedded feature representations, establish category prototypes and store them in the prototype memory module, and use a deep adaptive adjustment mechanism and bidirectional gated recurrent units or bidirectional long short-term memory networks for traffic identification.

Benefits of technology

It improves the accuracy and stability of traffic sample classification, enhances the reliability of network management, improves resource utilization efficiency and optimizes costs, and enables rapid release of normal traffic and accurate identification of abnormal traffic.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121985157A_ABST
    Figure CN121985157A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of artificial intelligence, in particular to a point-to-point content distribution network flow identification method based on a storage memory prototype network, which comprises the following steps: collecting flow samples to establish an original data set, constructing a plurality of small sample learning tasks, each small sample learning task comprising a plurality of initial categories, defining a support set and a query set for any small sample learning task; constructing a feature extraction network, adopting a convolutional architecture with a deep adaptive adjustment mechanism, and carrying out initial configuration on network parameters of the convolutional architecture; respectively inputting the support set and the query set into the initialized feature extraction network to generate corresponding embedded feature representation, and training and optimizing network parameters by adopting the embedded feature representation; building a category prototype for the initial category corresponding to the support set based on the embedded feature representation, and storing the category prototype to build a prototype memory module; and analyzing the embedded feature representation corresponding to the query set by using a prototype memory module, performing category judgment on the traffic sample, and generating an identification result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of artificial intelligence technology, and more specifically to a method for identifying traffic in a peer-to-peer content distribution network that stores a prototype network of memories. Background Technology

[0002] In recent years, video content providers have begun to explore new content delivery systems—peer-to-peer content delivery networks (PCDNs)—to build low-cost, high-quality network services. However, with the expansion of service scale, the continuous growth in the number of viewers, and the increasing introduction of heterogeneous edge nodes, PCDN systems have gradually exposed significant resource imbalances. Some edge nodes are chronically overloaded, severely restricting the overall efficiency of the system. Specifically, in real network environments, PCDN service traffic is often highly mixed with other application traffic and is significantly affected by terminal behavior, node heterogeneity, and network state fluctuations. This makes it difficult for the network side to form an observable and interpretable detailed profile of "who is transmitting, what is being transmitted, how much is being transmitted, and when is it being transmitted." Without reliable traffic identification capabilities, network management systems struggle to perform differentiated bandwidth guarantees, congestion control, and resource scheduling, further amplifying the performance degradation of overloaded nodes and the idleness of low-cost nodes. Summary of the Invention

[0003] To address the technical problem of accurately identifying and characterizing traffic data in existing network environments, which affects network management and service optimization, the present invention aims to provide a method for identifying traffic in a peer-to-peer content distribution network based on a prototype network with a stored memory. The specific technical solution adopted is as follows:

[0004] Collect traffic samples to establish an original dataset. Based on the original dataset, construct several small sample learning tasks, and each small sample learning task includes multiple initial categories. Define the support set and query set for each small sample learning task.

[0005] A feature extraction network is constructed, employing a convolutional architecture with a depth adaptive adjustment mechanism, and its network parameters are initialized and configured.

[0006] The support set and query set are respectively input into the initialized feature extraction network to generate corresponding embedded feature representations. The network parameters are then trained and optimized using the embedded feature representations.

[0007] Based on the embedded feature representation, construct category prototypes for the initial categories corresponding to the support set, and store the category prototypes to establish a prototype memory module;

[0008] The prototype memory module is used to analyze the embedded feature representation corresponding to the query set, classify the traffic samples of the query set, and generate recognition results.

[0009] Preferably, in the same few-shot learning task, the number of traffic samples used to construct the support set is consistent within each initial category.

[0010] Preferably, the feature extraction network includes multiple cascaded one-dimensional convolutional blocks, a temporal feature extraction module, and a terminal feature mapping module. The one-dimensional convolutional block contains a one-dimensional convolutional layer, a one-dimensional batch normalization layer, a ReLU activation layer, and a one-dimensional max pooling layer arranged sequentially. The temporal feature extraction module adopts a bidirectional gated recurrent unit or a bidirectional long short-term memory network. The feature mapping module contains at least three fully connected layers.

[0011] Preferably, the network operation mode corresponding to the feature extraction network is as follows:

[0012]

[0013] in, Indicates the first Embedded feature representations corresponding to each traffic sample; This represents the mapping function of the feature extraction network. This represents the set of trainable parameters for a feature extraction network. Indicates the first One traffic sample.

[0014] Preferably, the support set and query set are respectively input into the initialized feature extraction network to generate corresponding embedded feature representations. The network parameters are then trained and optimized using these embedded feature representations, including:

[0015] Based on the initialized feature extraction network, the embedded feature representations corresponding to the support set and query set are obtained respectively;

[0016] The feature extraction network is subjected to discriminative pre-training and prototype constraint optimization in sequence using feature embedding representation. In the discriminative pre-training stage, a cross-entropy loss function is constructed to obtain basic discriminative power, and in the prototype constraint optimization stage, a prototype loss function is constructed to refine the embedding space distribution, thereby updating the network parameters step by step iteratively.

[0017] Preferably, the feature extraction network is subjected to discriminative pre-training and prototype constraint optimization sequentially using feature embedding representation, correspondingly constructing cross-entropy loss function and prototype loss function, and updating network parameters, including:

[0018] After embedding the feature representation, a classification layer is connected to predict the category of the traffic sample, and the prediction result is obtained. A cross-entropy loss function is constructed, and the network parameters are updated by minimizing the cross-entropy loss function.

[0019] The parameters of the convolutional layers in the feature extraction network are frozen, and only the network parameters of the fully connected layers are updated. A prototype loss function is constructed, and the spatial structure of the embedded feature representation is optimized by minimizing the prototype loss function.

[0020] Preferably, a category prototype is constructed based on the embedded feature representation for the initial category corresponding to the support set, and the category prototype is stored to establish a prototype memory module, specifically as follows:

[0021] By embedding feature representations, a corresponding category prototype is generated for each initial category in the support set. The category prototype is defined as a representative feature of the embedded feature representation. The representative features are stored to establish a prototype memory module. The representative features corresponding to the initial category in the small sample learning task being analyzed are fused with the stored historical representative features to update the category prototype in real time.

[0022] Preferably, the prototype memory module is used to analyze the embedded feature representation corresponding to the query set, classify the traffic samples of the query set, and generate recognition results, including:

[0023] Anomaly detection screening is performed based on traffic samples in the query set to determine whether they belong to the baseline normal distribution. If they do, a forced coverage mechanism is triggered to directly generate the identification result; otherwise, subsequent judgment steps are executed.

[0024] When a traffic sample is determined to be abnormal traffic, the distance relationship with each category of prototype in the prototype memory module is obtained based on the embedded feature representation corresponding to the query set.

[0025] The predicted category of the traffic samples in the query set is determined by the distance relationship, and the identification result is generated.

[0026] Preferably, a category probability distribution is constructed based on distance relationships, and the fusion ratio of the representative features corresponding to the query set and the stored historical representative features in the prototype memory module is adjusted to improve the stability of the predicted category.

[0027] To address the aforementioned problems, the present invention also provides an electronic device comprising: a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus, and the processor invokes logical instructions in the memory to execute the peer-to-peer content distribution network traffic identification method for storing a prototype network of memory as described in any of the preceding claims.

[0028] The present invention has the following beneficial effects:

[0029] 1. This paper proposes a PCDN network traffic identification method based on a prototype network with a storage memory, which improves the classification accuracy of the prototype memory module for traffic samples and enhances its classification stability under small sample conditions. It is designed for network management and PCDN business scenarios, providing reliable traffic perception and decision-making basis for scheduling strategies. While ensuring efficient transmission of PCDN media traffic, it also improves resource utilization efficiency and releases potential cost optimization space.

[0030] 2. This invention innovatively introduces a deep and shallow dual-branch feature mining and fusion mechanism. A lightweight table classifier utilizes the shallow statistical features of the unmapped original sequence to provide a coarse probability screening under a global perspective; while the prototype memory module uses the deep embedded features mapped by the feature extraction network to perform fine-grained spatial measurement. Through the complementary advantages of multi-view features, it achieves rapid passage of normal traffic and accurate identification of abnormal traffic with extremely low computational overhead, greatly improving the model's robustness in dealing with complex network interference and subtle feature differences.

[0031] 3. The electronic device provided by this invention has the same beneficial effects as the peer-to-peer content distribution network traffic identification method based on the storage memory prototype network provided by this invention, and will not be described in detail here. Attached Figure Description

[0032] To more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0033] Figure 1 This is a flowchart illustrating an implementation method for identifying traffic in a peer-to-peer content distribution network that stores a prototype network of memory, as provided in an embodiment of the present invention.

[0034] Figure 2 A flowchart illustrating the steps of a method for identifying traffic in a peer-to-peer content distribution network using a prototype network with a stored memory, provided as an embodiment of the present invention.

[0035] Figure 3 This is a schematic diagram of the feature extraction network structure of a peer-to-peer content distribution network traffic identification method based on a stored memory prototype network, provided as an embodiment of the present invention. Detailed Implementation

[0036] To further illustrate the technical means and effects adopted by the present invention to achieve its intended purpose, the following, in conjunction with the accompanying drawings and preferred embodiments, details the specific implementation, structure, features, and effects of a peer-to-peer content distribution network traffic identification method based on a memory-based prototype network proposed in this invention. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. Furthermore, specific features, structures, or characteristics in one or more embodiments can be combined in any suitable form.

[0037] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.

[0038] The following description, in conjunction with the accompanying drawings, details a specific scheme for a peer-to-peer content distribution network traffic identification method based on a stored memory prototype network provided by the present invention.

[0039] To better illustrate, Peer-to-Peer Content Delivery Network (PCDN) is a content delivery network built using P2P technology. It stores content on user devices such as personal computers, smartphones, and smart TVs, allowing these devices to act as upload nodes while downloading content, distributing data to other users who need it. This overcomes the limitations of traditional CDNs that rely on centralized servers for content transmission, achieving efficient content distribution from "center to edge" and then "edge to edge." However, significant resource imbalance remains a problem when used for network services. Therefore, this paper proposes a PCDN traffic identification method based on a storage-memory prototype network to accurately identify and characterize PCDN media traffic, enabling refined network management and business optimization.

[0040] Please combine Figure 1 and Figure 2 The diagrams show the implementation flowchart and step flowchart of a peer-to-peer content distribution network traffic identification method based on a stored memory prototype network provided in the first embodiment of the present invention. The method includes:

[0041] Step S1: Collect traffic samples to establish an original dataset. Based on the original dataset, construct several small sample learning tasks, and each small sample learning task includes multiple initial categories. Define the support set and query set for each small sample learning task.

[0042] Step S2: Construct a feature extraction network, using a convolutional architecture with a depth adaptive adjustment mechanism, and initialize its network parameters;

[0043] Step S3: Input the support set and query set into the initialized feature extraction network to generate corresponding embedded feature representations, and use the embedded feature representations to train and optimize the network parameters;

[0044] Step S4: Construct category prototypes for the initial categories corresponding to the support set based on the embedded feature representations, and store the category prototypes to establish a prototype memory module;

[0045] Step S5: Use the prototype memory module to analyze the embedded feature representation corresponding to the query set, classify the traffic samples of the query set, and generate recognition results.

[0046] Specifically, in step S1, traffic samples are collected to establish an original dataset, denoted as... ,in, Indicates the first Input features of each traffic sample; Representing input features Corresponding category tags; Indicates the traffic sample index; This represents the number of traffic samples in the original dataset. Several small-sample learning tasks are constructed based on the original dataset, denoted as... , This represents the number of few-shot learning tasks, which involves processing the original dataset into multiple classes and multiple samples of few-shot batches suitable for subsequent training. Each few-shot learning task includes multiple initial classes, and each initial class corresponds to only a limited number of traffic samples. Then, for any few-shot learning task... The dataset is divided into a support set and a query set according to a preset rule, based on a certain ratio of the number of traffic samples in the few-sample learning task. These are denoted as follows: and Among them, support set Includes traffic samples from each initial category used to construct category representations, query sets It contains traffic samples used for training and classification.

[0047] Furthermore, in the same few-shot learning task, the number of traffic samples used to construct the support set is consistent across all initial classes; this setting ensures the stability of subsequent class representation computation, where, for the initial class... Therefore, its corresponding support set is denoted as , This represents the initial class index in a few-shot learning task.

[0048] Please see Figure 3It illustrates an example of a network structure generated by a feature extraction network under a specific input dimension; in particular, the first and second convolutional neural networks shown are merely specific embodiments for ease of understanding and do not constitute a limitation on the network depth of the present invention.

[0049] Further, in step S2, the feature extraction network includes multiple cascaded one-dimensional convolutional blocks, a temporal feature extraction module, and a terminal feature mapping module. The one-dimensional convolutional block contains a one-dimensional convolutional layer, a one-dimensional batch normalization layer, a ReLU activation layer, and a one-dimensional max pooling layer arranged sequentially. The temporal feature extraction module adopts a bidirectional gated recurrent unit or a bidirectional long short-term memory network. The feature mapping module contains at least three fully connected layers.

[0050] The feature extraction network has a depth adaptive adjustment mechanism, which can dynamically determine the number of cascaded one-dimensional convolutional blocks based on the initial feature dimension of the input traffic samples through iterative logic, so as to achieve automatic adaptation of the receptive field for different business traffic.

[0051] Specifically, each one-dimensional convolutional block contains, from input to output, a one-dimensional convolutional layer, a one-dimensional batch normalization layer, a ReLU activation layer, and a one-dimensional max pooling layer. Max pooling is used to extract the translation invariance of traffic features and achieve feature dimensionality reduction, thereby performing a nonlinear transformation on the traffic samples. That is, the feature extraction network is used to map the input traffic samples to the embedded feature space to extract discriminative feature representations.

[0052] To compensate for the limitations of pure convolutional networks in handling long-range temporal dependencies and to make the generated category prototypes more reflective of the dynamic fluctuation characteristics of real PCDN traffic, the feature extraction network also includes a temporal feature extraction module set between the one-dimensional convolutional block and the feature mapping module. This module receives the features output by the one-dimensional convolutional block and extracts the forward and backward dynamic evolution of traffic in the time dimension. Then, the hidden layer state containing global spatiotemporal context information is input to the feature mapping module.

[0053] This module employs either a Bidirectional Gated Recurrent Unit (Bi-GRU) or a Bidirectional Long Short-Term Memory Network (Bi-LSTM). Taking the Bidirectional GRU as an example, the local spatial features output from cascaded one-dimensional convolutional blocks are rearranged in dimension before being input into the Bidirectional GRU. It processes the sequence data in both forward and backward directions, extracting the dynamic evolution of the flow data over time, and outputs the hidden layer state containing global spatiotemporal context information to the final feature mapping module. The final feature mapping module then maps this state into the final low-dimensional embedded feature representation. .

[0054] Furthermore, the network operation mode corresponding to the feature extraction network is as follows:

[0055]

[0056] in, Indicates the first Embedded feature representations corresponding to each traffic sample; This represents the mapping function of the feature extraction network. This represents the set of trainable parameters for a feature extraction network. Indicates the first One traffic sample.

[0057] It can be explained that the embedded feature representation ,Right now , This represents the dimension of the embedded feature representation; during the feature extraction network initialization phase, the network structure of the feature extraction network, i.e., the neural network structure, is determined, and the set of trainable parameters, i.e., the network parameters, is set. Initialization is performed to enable the feature extraction network to perform basic feature embedding mapping, providing an initial model for subsequent training and optimization steps; in other words, the feature extraction network is initialized based on the data features of traffic samples in the few-shot learning task.

[0058] In this embodiment, the feature extraction network employs a multi-level linear mapping framework consisting of at least three fully connected layers at its end, namely the feature extraction layer. This framework is used to linearly map and reduce the dimensionality of feature vectors from a high-dimensional space to a low-dimensional embedding space. The framework sequentially performs linear dimensionality reduction compression on the feature dimensions extracted by convolution at 64, 32, and 16. Finally, the system extracts the 16-dimensional vector output from the penultimate layer as the embedded feature vector. This serves as the representational basis for subsequently constructing prototype memory modules.

[0059] Furthermore, step S3 includes:

[0060] Step S31: Based on the initialized feature extraction network, obtain the embedded feature representations corresponding to the support set and query set respectively.

[0061] Specifically, based on the aforementioned few-shot learning task The support set obtained by partitioning and query set This section provides an explanation, supporting set notation. The query set is recorded as ,in, , These represent the first and second sets in the support set and query set, respectively. The and the first One traffic sample; , These represent the traffic sample indexes in the support set and the query set, respectively; , These represent flow samples respectively. and Corresponding category tags; This indicates the initial number of categories for the small-sample learning task in the current analysis; , These represent the number of traffic samples for each initial category in the support set and query set, respectively; then, the support set... and query set The traffic samples are input into the initialized feature extraction network to generate embedded feature representations. The corresponding calculation formula is as follows: , During this process, the feature extraction network outputs a 16-dimensional embedded feature vector while simultaneously generating predictive distribution information for optimization during the pre-training stage, thereby enhancing the discriminative power of different categories of features in the embedding space.

[0062] Step S32: The feature extraction network is subjected to discriminative pre-training and prototype constraint optimization in sequence using feature embedding representation, and the cross-entropy loss function and prototype loss function are constructed accordingly to update the network parameters.

[0063] The explanation is that training and optimizing the feature extraction network can significantly improve its performance, enabling it to more accurately capture key information in traffic samples and provide high-quality feature input for downstream tasks.

[0064] Further, step S32 includes:

[0065] Step S321: After embedding the feature representation, connect the classification layer to predict the category of the traffic samples, obtain the prediction result, construct the cross-entropy loss function, and update the network parameters by minimizing the cross-entropy loss function. Simultaneously update all trainable parameters of the feature extraction network and the classification layer, enabling the network to initially possess the ability to discriminate the categories of the entire traffic volume.

[0066] Specifically, based on support sets To explain, the cross-entropy loss function is constructed based on the difference between the predicted category probability distribution and the true category label of the corresponding traffic sample, according to the prediction results of the classification layer. The corresponding calculation formula is as follows:

[0067]

[0068] in, Represents the cross-entropy loss function; Represents flow samples Corresponding category tags; Represents flow samples The prediction results.

[0069] It can be explained that the cross-entropy loss function is used to measure the difference between the predicted results generated from traffic samples and the class labels, that is, to effectively quantify the degree of mismatch between the predicted class probability distribution and the true class labels; and by minimizing the cross-entropy loss function, the network parameters are optimized. Update the feature representation to obtain an initial feature representation with class discrimination capability.

[0070] Step S322: Freeze the parameters of the convolutional layers in the feature extraction network, update only the network parameters of the fully connected layers, construct the prototype loss function, and optimize the spatial structure of the embedded feature representation by minimizing the prototype loss function.

[0071] Specifically, based on the corresponding embedded feature representation generated from the traffic samples in each initial category of the support set, the category prototype of that initial category is obtained, that is, the category prototype vector of the initial category in the embedded feature space is obtained, and the corresponding calculation formula is as follows:

[0072]

[0073] in, Indicates the first The initial category prototype vectors in the embedding feature space; Indicates the first The number of traffic samples in the initial category supporting the set; Represents flow samples The corresponding embedded feature representation.

[0074] Next, the prototype loss function is constructed by combining it with the embedded feature representation corresponding to the query set, and the corresponding calculation formula is as follows:

[0075]

[0076] Preferably, to improve the numerical stability of the embedded feature space under small sample conditions, a cosine similarity with a temperature scaling factor is used to construct the prototype loss function, and the corresponding calculation formula is as follows:

[0077]

[0078] in, Represents the cosine similarity function; This represents the temperature scaling factor.

[0079] In this embodiment, the temperature scaling factor It can be adjusted according to the actual situation. It is used to adjust the penalty of the loss function on hard samples and the smoothness of the feature distribution. It can be combined with cosine metric to achieve fine-grained control of the smoothness of the feature distribution.

[0080] Finally, by minimizing the prototype loss function, traffic samples of the same initial category are clustered toward the corresponding category prototype in the embedding feature space, while traffic samples of different initial categories are separated from each other in the embedding feature space, thereby optimizing the spatial structure of the embedding feature representation.

[0081] Preferably, in actual operation, a machine learning classifier (such as support vector machine or random forest) is used based on the original dataset to provide pruning decisions when classifying the prototype memory module.

[0082] Furthermore, in step S4, specifically:

[0083] By embedding feature representations, a corresponding category prototype is generated for each initial category in the support set. The category prototype is defined as a representative feature of the embedded feature representation. The representative features are stored to establish a prototype memory module. The representative features corresponding to the initial category in the small sample learning task being analyzed are fused with the stored historical representative features to update the category prototype in real time.

[0084] Specifically, the acquisition of the category prototype is the same as that in step S322, that is... Similarly, we obtain the category prototypes corresponding to all initial categories in the support set, and store these category prototypes as representative features of the embedded feature representation. We then integrate all representative features to form a prototype memory module. This prototype memory module is used to store the category prototypes generated in multiple few-sample learning tasks, and generates a storage set, denoted as […]. , This represents the index of the few-shot learning task. When the prototype memory module already contains a historical category prototype corresponding to the current task category, that is, when the prototype memory module contains representative features that match the few-shot learning task being analyzed, the category prototype in the prototype memory module is updated after the category prototype of the current few-shot learning task is completed, so as to integrate the historical task information and the current task information.

[0085] To achieve storage size control and automatically remove anomalous noise features, the system implements a representative screening and dynamic shrinkage strategy based on class centroid distance. First, a maximum prototype capacity for each initial class is preset, denoted as . When a specific category Total number of storage prototypes When overflow occurs, the mean vector of all prototypes in the category's storage set is calculated as the class centroid. The corresponding calculation formula is:

[0086]

[0087] in, Indicates the first The first in the category The prototype vector of each prototype; Indicates the prototype index.

[0088] Subsequently, the Euclidean distance from each prototype to the centroid of the class was calculated. ,Right now The data is then sorted in ascending order based on distance values, and finally, only the data closest to the class centroid is retained. Each prototype is used to eliminate outliers that deviate from the mean, thus completing the adaptive compression and purification of prototype memory for this category.

[0089] Understandably, after completing prototype construction and prototype memory storage, that is, after completing the construction of the prototype memory module, the traffic samples in the query set are classified based on the prototype memory module to achieve classification decision-making in small sample scenarios.

[0090] Furthermore, step S5 includes:

[0091] Step S51: Perform pre-screening for anomaly detection based on traffic samples in the query set to determine whether they belong to the baseline normal distribution. If they do, trigger the forced coverage mechanism to directly generate the identification result; if they do not, execute the subsequent judgment steps.

[0092] Specifically, extract traffic samples from the query set. The corresponding features are input into a pre-trained single-class anomaly detection model (e.g., a One-Class SVM model pre-trained using only traffic samples of the normal or lightly loaded categories). If the single-class anomaly detection model outputs an inlier result, indicating that the traffic sample conforms to the baseline normal distribution, a forced coverage mechanism is triggered, directly classifying the traffic sample's predicted category as the preset normal category and forcibly setting the prediction confidence of its corresponding category to the maximum value, no longer relying on the prototype memory module for measurement, thus directly generating the final identification result; if the result is an outlier, indicating that the traffic sample deviates from the normal distribution and belongs to abnormal traffic, the subsequent classification and discrimination process continues.

[0093] To clarify, when classifying and identifying the query set, a single-class anomaly detection model (such as One-Class SVM) trained on normal traffic samples is introduced for pre-screening and forced coverage. During the inference phase, if the model determines that the current query set traffic sample belongs to the normal baseline distribution, the forced coverage mechanism is triggered, directly outputting the preset normal category as the final predicted category of the traffic sample and assigning it the highest confidence level. If it is determined to be an anomaly distribution, the joint judgment process of the subsequent prototype memory module and lightweight table classifier continues. This mechanism filters massive amounts of normal traffic with extremely low computational cost, effectively reducing the overall inference latency and false positive rate of the system.

[0094] Step S52: When a traffic sample is determined to be abnormal traffic, the distance relationship with each category of prototype in the prototype memory module is obtained based on the embedded feature representation corresponding to the query set.

[0095] Specifically, in practice, for query set traffic samples identified as outliers in step S51... The system performs parallel dual-branch feature mining and discrimination: on the one hand, it extracts the traffic sample. The original sequence features (i.e., one-dimensional flattened features without convolutional network processing) are input into the aforementioned table feature classifier, which outputs the corresponding initial class probability distribution. On the other hand, this traffic sample The input feature extraction network yields the embedded feature representation after deep nonlinear mapping, i.e. Subsequently, the embedded feature representation is calculated. The distance relationship with each category prototype in the prototype memory module, i.e., the similarity between the embedded feature representation and the category prototype, is calculated using the following formula:

[0096]

[0097] in, This represents the distance metric function between the embedded feature representation and the category prototype; Represents the embedded feature representation; Represents the category prototype; Represents norm operations.

[0098] Preferably, in this embodiment, the distance metric function is Euclidean distance. The smaller the distance value between the embedded feature representation and the category prototype, the more similar the traffic sample in the query set is to the corresponding category prototype.

[0099] Step S53: Determine the predicted category of the traffic samples in the query set based on the distance relationship, and generate the identification result.

[0100] Specifically, the corresponding calculation formula is:

[0101]

[0102] in, This represents a traffic sample of the query set. The corresponding predicted category label; Indicates a category index; This represents the set of categories in the query set.

[0103] It can be explained that, based on predicted category labels The system can select the category prototype that has the closest distance relationship with the embedded feature representation from the prototype memory module, and then determine it as the identification result of the traffic sample.

[0104] Furthermore, a category probability distribution is constructed based on distance relationships, and the fusion ratio of the representative features corresponding to the query set and the stored historical representative features in the prototype memory module is adjusted to improve the stability of the predicted category.

[0105] As an optional implementation method, constructing a category probability distribution based on distance relationships can improve the stability of subsequent recognition results.

[0106] Specifically, the traffic samples corresponding to the query set are still used. To explain, the category probability distribution is constructed, and the corresponding calculation formula is as follows:

[0107]

[0108] in, This represents a traffic sample of the query set. Belongs to the The predicted probabilities of each initial category; Indicates An exponential function with base 0; This represents the normalized result of the distance relationships generated for all initial categories; This represents the summation index variable.

[0109] Alternatively, assume the entire set of categories is Therefore, the total number of categories in the initial category is The query set output by the table feature classifier Corresponding category probability distribution Sort the class probabilities corresponding to each initial class and remove the class with the lowest probability. There are initial categories, and they satisfy the following conditions: The remaining categories are denoted as the candidate category set, i.e. Furthermore, for subsequent input traffic samples, the posterior probability of the prototype network, i.e., the prototype memory module, is only within the candidate class set. If the calculation is performed internally, then the summation index variable is used. This indicates that each category in the candidate category set is iterated over.

[0110] Subsequently, the category probability distribution is normalized, and the corresponding calculation formula is as follows:

[0111]

[0112] in, This indicates the prototype memory module in the candidate category set. The recalculated category prediction probability distribution; Represents the set of candidate categories The sum of distance relationships generated by all initial categories within the range.

[0113] It can be explained that, Used for the prototype memory module to process the candidate category set The normalization result of the initial category output, that is, controlling the range of the category probability distribution to be within a certain range. .

[0114] Finally, the fusion decision weight factor is obtained to adjust the fusion ratio of the representative features corresponding to the query set and the stored historical representative features in the prototype memory module. The corresponding calculation formula is as follows:

[0115]

[0116] in, This represents the predicted category probability distribution after distance relation fusion adjustment. ; This represents the weighting factor for the fusion decision.

[0117] It can be explained that the decision weight factors are integrated. The range of values ​​is It is used to adjust the fusion ratio between the historical category prototypes in the prototype memory module and the category prototypes generated by the small sample learning task corresponding to the current query set being analyzed, so as to control the degree of retention of historical task information by the prototype memory; so as to realize the classification and decision-making of traffic samples in the query set based on prototype memory, so that the prototype memory module can use the category prototype information accumulated in the historical small sample learning task to complete accurate classification prediction under small sample conditions.

[0118] As an optional implementation, in step S5, when classifying and identifying the query set, a lightweight table classifier is introduced to assist in decision-making, effectively improving the recognition accuracy and stability. Here, a lightweight table classifier refers to a machine learning or deep learning model in the field of data processing and analysis that is simple in design, consumes low computing resources, has a small model size, and has a fast inference speed, and is used to quickly predict the category probability of data.

[0119] It can be noted that in small sample scenarios, traditional prototype networks, which perform global metric discrimination across the entire category space, are easily affected by noisy categories, especially when the differences in features between different categories are subtle, which significantly reduces discrimination stability. Using an END-K (End-to-End Pruning) coarse-to-fine fusion discrimination mechanism, the system first employs a dual-branch feature utilization mechanism to extract the original traffic sequence features (i.e., the one-dimensional flattened features before dimensionality reduction) that have not undergone nonlinear mapping by the feature extraction network. These features are then input into a lightweight table classifier for preliminary screening, excluding the lowest probability categories from the entire category set. There are 10 candidate categories, among which The initial number of categories should be less than or equal to half of the maximum total number of categories. Subsequently, the prototype network, i.e., the prototype memory module, computes and normalizes the posterior probability only within this candidate subspace, effectively suppressing interference from irrelevant categories. Finally, the decision weight factors are fused. The posterior probability output by the prototype memory module and the predicted probability of the lightweight table classifier are fused by logarithmic domain linear weighting, which improves the recognition accuracy and stability under small sample conditions while maintaining the model's generalization ability.

[0120] To better illustrate this, the peer-to-peer content distribution network traffic identification method based on the memory prototype network will be tested on the PCDN dataset and the UNSW_NB15 (University of New South Wales - Network Benchmark 15 Dataset) dataset, along with existing methods such as SVM (Support Vector Machine), CNN (Convolutional Neural Network), BiLSTM (Bidirectional Long Short-Term Memory), and BiGRU (Bidirectional Gated Recurrent Unit). This comparative analysis will verify the reliability of the proposed method. Specifically, Table 1 shows the performance metrics on the PCDN dataset, and Table 2 shows the performance metrics on the UNSW_NB15 dataset.

[0121] Table 1. Performance metrics results on the PCDN dataset.

[0122]

[0123] Table 2 shows the performance metrics results on the UNSW_NB15 dataset.

[0124]

[0125] It can be noted that, based on four performance metrics—Precision, Recall, F1 Score, and Accuracy—the proposed peer-to-peer content distribution network traffic identification method using a prototype memory network achieves accuracies of 77.33% and 69.94% on the PCDN and UNSW_NB15 datasets, respectively. This demonstrates that the accuracy of the proposed method is significantly higher than that of existing methods, greatly improving the classification accuracy of the prototype memory module.

[0126] Understandably, this paper proposes a PCDN network traffic identification method based on a prototype network with a storage memory, through small-sample batch sampling, feature extraction network initialization, generation and training of embedded feature representations, prototype learning and memory storage, and traffic sample determination. This method improves the classification accuracy of the prototype memory module for traffic samples and enhances its classification stability under small-sample conditions. It provides reliable traffic perception and decision-making basis for scheduling strategies for network management and PCDN business scenarios, while ensuring efficient transmission of PCDN media traffic, improving resource utilization efficiency and releasing potential cost optimization space.

[0127] Furthermore, an innovative deep-shallow dual-branch feature mining and fusion mechanism is introduced. A lightweight table classifier utilizes unmapped, shallow statistical features of the original sequence to provide a coarse probability screening with a global perspective; while the prototype memory module uses deep embedded features mapped by the feature extraction network for fine-grained spatial measurement. Through the complementary advantages of multi-view features, rapid passage of normal traffic and accurate identification of abnormal traffic are achieved with extremely low computational overhead, greatly improving the model's robustness in dealing with complex network interference and subtle feature differences.

[0128] A second embodiment of the present invention provides an electronic device, which includes a processor, a communication interface, a memory, and a communication bus. The processor, the communication interface, and the memory communicate with each other through the communication bus. The processor calls logical instructions in the memory to execute the peer-to-peer content distribution network traffic identification method for storing a prototype network of memory as described in any embodiment of the present invention.

[0129] When it operates, it needs to use a peer-to-peer content delivery network traffic identification method based on a prototype network with stored memory. Therefore, whether the device and program data are integrated or different hardware is configured to produce a function with similar effect to that achieved by the present invention, it is within the protection scope of the present invention. The device has the same beneficial effect as the aforementioned peer-to-peer content delivery network traffic identification method based on a prototype network with stored memory, and will not be described in detail here.

[0130] It should be noted that the order of the above embodiments of the present invention is merely for descriptive purposes and does not represent the superiority or inferiority of the embodiments. The processes depicted in the accompanying drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0131] The various embodiments in this specification are described in a progressive manner. The same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on describing the differences from other embodiments.

Claims

1. A method for identifying traffic in a peer-to-peer content distribution network using a prototype network with stored memory, characterized in that: The method includes: Collect traffic samples to establish an original dataset. Based on the original dataset, construct several small sample learning tasks, and each small sample learning task includes multiple initial categories. Define the support set and query set for each small sample learning task. A feature extraction network is constructed, employing a convolutional architecture with a depth adaptive adjustment mechanism, and its network parameters are initialized and configured. The support set and query set are respectively input into the initialized feature extraction network to generate corresponding embedded feature representations. The network parameters are then trained and optimized using the embedded feature representations. Based on the embedded feature representation, construct category prototypes for the initial categories corresponding to the support set, and store the category prototypes to establish a prototype memory module; The prototype memory module is used to analyze the embedded feature representation corresponding to the query set, classify the traffic samples of the query set, and generate recognition results.

2. The method for identifying traffic in a peer-to-peer content distribution network based on a stored memory prototype network as described in claim 1, characterized in that, In the same few-shot learning task, the number of traffic samples used to build the support set is consistent across all initial categories.

3. The method for identifying traffic in a peer-to-peer content distribution network based on a stored memory prototype network as described in claim 1, characterized in that, The feature extraction network includes multiple cascaded one-dimensional convolutional blocks, a temporal feature extraction module, and a terminal feature mapping module. The one-dimensional convolutional block contains a one-dimensional convolutional layer, a one-dimensional batch normalization layer, a ReLU activation layer, and a one-dimensional max pooling layer arranged sequentially. The temporal feature extraction module adopts a bidirectional gated recurrent unit or a bidirectional long short-term memory network. The feature mapping module contains at least three fully connected layers.

4. The method for identifying traffic in a peer-to-peer content distribution network based on a stored memory prototype network according to claim 3, characterized in that, The network operation mode corresponding to the feature extraction network is as follows: ; in, Indicates the first Embedded feature representations corresponding to each traffic sample; This represents the mapping function of the feature extraction network. This represents the set of trainable parameters for a feature extraction network. Indicates the first One traffic sample.

5. The method for identifying traffic in a peer-to-peer content distribution network based on a stored memory prototype network as described in claim 4, characterized in that, The support set and query set are respectively input into the initialized feature extraction network to generate corresponding embedded feature representations. The network parameters are trained and optimized using the embedded feature representations, including: Based on the initialized feature extraction network, the embedded feature representations corresponding to the support set and query set are obtained respectively; The feature extraction network is subjected to discriminative pre-training and prototype constraint optimization in sequence using feature embedding representation. In the discriminative pre-training stage, a cross-entropy loss function is constructed to obtain basic discriminative power, and in the prototype constraint optimization stage, a prototype loss function is constructed to refine the embedding space distribution, thereby updating the network parameters step by step iteratively.

6. The method for identifying traffic in a peer-to-peer content distribution network based on a stored memory prototype network as described in claim 5, characterized in that, The feature extraction network is pre-trained discriminatively and then optimized using feature embedding representation. Correspondingly, cross-entropy loss function and prototype loss function are constructed, and network parameters are updated, including: After embedding the feature representation, a classification layer is connected to predict the category of the traffic sample, and the prediction result is obtained. A cross-entropy loss function is constructed, and the network parameters are updated by minimizing the cross-entropy loss function. The parameters of the convolutional layers in the feature extraction network are frozen, and only the network parameters of the fully connected layers are updated. A prototype loss function is constructed, and the spatial structure of the embedded feature representation is optimized by minimizing the prototype loss function.

7. The method for identifying traffic in a peer-to-peer content distribution network based on a stored memory prototype network according to claim 1, characterized in that, Based on the embedded feature representation, a category prototype is constructed for the initial category corresponding to the support set, and the category prototype is stored to establish a prototype memory module, specifically as follows: By embedding feature representations, a corresponding category prototype is generated for each initial category in the support set. The category prototype is defined as a representative feature of the embedded feature representation. The representative features are stored to establish a prototype memory module. The representative features corresponding to the initial category in the small sample learning task being analyzed are fused with the stored historical representative features to update the category prototype in real time.

8. The method for identifying traffic in a peer-to-peer content distribution network based on a stored memory prototype network according to claim 7, characterized in that, The prototype memory module is used to analyze the embedded feature representation corresponding to the query set, classify the traffic samples of the query set, and generate recognition results, including: Anomaly detection screening is performed based on traffic samples in the query set to determine whether they belong to the baseline normal distribution. If they do, a forced coverage mechanism is triggered to directly generate the identification result; otherwise, subsequent judgment steps are performed. When a traffic sample is determined to be abnormal traffic, the distance relationship with each category of prototype in the prototype memory module is obtained based on the embedded feature representation corresponding to the query set. The predicted category of the traffic samples in the query set is determined by the distance relationship, and the identification result is generated.

9. The method for identifying traffic in a peer-to-peer content distribution network based on a stored memory prototype network as described in claim 8, characterized in that, A category probability distribution is constructed based on distance relationships, and the fusion ratio of the representative features corresponding to the query set and the stored historical representative features in the prototype memory module is adjusted to improve the stability of the predicted category.

10. An electronic device, characterized in that, The device includes a processor, a communication interface, a memory, and a communication bus. The processor, the communication interface, and the memory communicate with each other through the communication bus. The processor calls logical instructions in the memory to execute the peer-to-peer content distribution network traffic identification method for storing a prototype network as described in any one of claims 1 to 9.