WO2022057321A1 - Method and apparatus for detecting anomalous link, and storage medium - Google Patents

Method and apparatus for detecting anomalous link, and storage medium Download PDF

Info

Publication number
WO2022057321A1
WO2022057321A1 PCT/CN2021/098011 CN2021098011W WO2022057321A1 WO 2022057321 A1 WO2022057321 A1 WO 2022057321A1 CN 2021098011 W CN2021098011 W CN 2021098011W WO 2022057321 A1 WO2022057321 A1 WO 2022057321A1
Authority
WO
WIPO (PCT)
Prior art keywords
samples
unlabeled
model
sample set
abnormal
Prior art date
Application number
PCT/CN2021/098011
Other languages
French (fr)
Chinese (zh)
Inventor
苏婵菲
文勇
刘宝华
潘璐伽
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2022057321A1 publication Critical patent/WO2022057321A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/14Network analysis or design
    • H04L41/145Network analysis or design involving simulating, designing, planning or modelling of a network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/50Testing arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/02Topology update or discovery

Definitions

  • the present application relates to the technical field of artificial intelligence, and in particular, to an abnormal link detection method, device and storage medium.
  • an abnormal link detection model can be used to detect a communication link to obtain a detection result of whether the communication link is an abnormal link.
  • the abnormal link detection model is usually a classifier obtained by training a large number of labeled samples, and each labeled sample is obtained by manual labeling, which requires a lot of manpower, and there are some errors in manual labeling. How to improve the detection accuracy of abnormal links by using the existing marked samples is a technical problem to be solved by those skilled in the art.
  • the embodiment of the present application discloses an abnormal link detection method, device and storage medium, which can perform abnormal link detection on a communication link by using samples selected from unmarked samples and an abnormal link detection model trained from existing marked samples. detection, which improves the accuracy of detecting abnormal links.
  • an embodiment of the present application discloses a method for detecting an abnormal link, including: receiving network data of at least one network node in a communication link; acquiring network features corresponding to the network data; inputting the network features into a first model to obtain The detection result of the communication link. The detection result is used to indicate whether the communication link is an abnormal link.
  • the first model is based on the marked samples, K marked samples and M unmarked samples in the first sample set.
  • the second model obtained by one training is trained, and the model obtained when the training meets the preset conditions, the K labeled samples are obtained by labeling the K unlabeled samples in the first sample set respectively, and the M unlabeled samples are obtained.
  • the first sample set includes pre-stored labeled samples and unlabeled samples before selecting K unlabeled samples and M unlabeled samples.
  • the link detection model is used to detect the communication link, thereby improving the accuracy of detecting abnormal links.
  • the method before inputting the network features into the first model, the method further includes: acquiring an anomaly score value of each unlabeled sample in the first sample set; The abnormal score values of the samples are sorted in descending order to obtain the first ranking; the unlabeled samples corresponding to the first K serial numbers in the first ranking are regarded as the K unlabeled samples. That is to say, the selected samples to be marked are the most abnormal K unmarked samples in the first sample set, and the sample set for training the abnormal link detection model includes samples that may be abnormal, which can improve the effect of model training and facilitate the training of the model. Improve the accuracy of detecting abnormal links.
  • the method further includes: taking the unlabeled samples corresponding to the last L serial numbers in the first sorting as L unlabeled samples; and selecting M unlabeled samples from the L unlabeled samples. That is to say, the selected unlabeled samples are M unlabeled samples randomly selected from the most normal L unlabeled samples in the first sample set, and the unlabeled samples are regarded as negative samples, then the abnormal link detection model is trained
  • the newly added samples in the sample set are samples of normal links, which can avoid introducing noise, improve the effect of model training, and facilitate the accuracy of detecting abnormal links.
  • the method before the network features are input into the first model, the method further includes: acquiring network topology information of the communication link; storing pre-stored unlabeled samples and labeled samples corresponding to the network topology information The composed set is taken as the first sample set. That is to say, selecting unlabeled samples and labeled samples corresponding to the network topology information of the communication link as the samples to be selected for training can improve the effect of model training and facilitate the detection of whether the communication link is an abnormal link 's accuracy.
  • an embodiment of the present application discloses a model training method, comprising: selecting K unlabeled samples from a first sample set; selecting M unlabeled samples as negative samples from the first sample set.
  • This set includes pre-stored labeled samples and unlabeled samples before selecting K unlabeled samples and M unlabeled samples; according to the labeled samples, K labeled samples and M unlabeled samples in the first sample set , the second model obtained from the previous training is trained, and the first model is obtained when the training meets the preset conditions, and the K marked samples are obtained by marking the K unmarked samples respectively.
  • the model can learn the distribution of positive and negative samples in unlabeled samples during training.
  • retraining the model obtained from the previous training according to the selected samples and the existing labeled samples can further improve the detection accuracy.
  • selecting K unlabeled samples from the first sample set includes: obtaining an anomaly score value of each unlabeled sample in the first sample set; The abnormal score values are sorted in descending order to obtain the first ranking; the unlabeled samples corresponding to the first K serial numbers in the first ranking are regarded as the K unlabeled samples. That is to say, the selected samples to be marked are the most abnormal K unmarked samples in the first sample set, and the sample set for training the abnormal link detection model includes samples that may be abnormal, which can improve the effect of model training and facilitate the training of the model. Improve the accuracy of detecting abnormal links.
  • selecting M unlabeled samples as negative samples from the first sample set includes: taking the unlabeled samples corresponding to the last L serial numbers in the first sorting as L unlabeled samples; M unlabeled samples are selected from the unlabeled samples. That is to say, the selected unlabeled samples are M unlabeled samples randomly selected from the most normal L unlabeled samples in the first sample set, and the unlabeled samples are regarded as negative samples, then the abnormal link detection model is trained
  • the newly added samples in the sample set are samples of normal links, which can avoid introducing noise, improve the effect of model training, and facilitate the accuracy of detecting abnormal links.
  • selecting M unlabeled samples as negative samples from the first sample set includes: counting the labeled samples in the first sample set and the number of positive samples in the K labeled samples; , select M unlabeled samples as negative samples from the first sample set, and M is equal to the number of positive samples. That is to say, the number of new negative samples in the sample set for training the abnormal link detection model is equal to the number of positive samples in the sample set, which can relatively achieve a balance between positive and negative samples, reduce label noise, and improve the effect of model training. , which is convenient to improve the accuracy of detecting abnormal links.
  • the method before selecting K unmarked samples from the first sample set, the method further includes: acquiring network topology information of the communication link to be detected; storing pre-stored information corresponding to the network topology information The set of unlabeled samples and labeled samples is used as the first sample set. That is to say, selecting unlabeled samples and labeled samples corresponding to the network topology information of the communication link as the samples to be selected for training can improve the effect of model training and facilitate the detection of whether the communication link is an abnormal link 's accuracy.
  • the method before acquiring the abnormal score value of each unlabeled sample in the first sample set, the method further includes: acquiring a second The abnormal score value of each unlabeled sample in the sample set, the second sample set includes the pre-stored labeled samples and unlabeled samples before selecting P unlabeled samples; according to the abnormal score value of each unlabeled sample in the second sample set Arrange in descending order to obtain a second order; take the unlabeled samples corresponding to the first P serial numbers in the second order as P unlabeled samples; build a third model according to the labeled samples and P labeled samples in the second sample set, P The marked samples are obtained by marking the P unmarked samples respectively, and the third model is an initialization model corresponding to the first model and the second model.
  • the initialization model of the abnormal link detection model is constructed based on the P marked samples corresponding to the most abnormal P unmarked samples and the existing marked samples, which can
  • an embodiment of the present application discloses an abnormal link detection device, comprising: a communication unit for receiving network data of at least one network node in a communication link; a processing unit for acquiring network characteristics corresponding to the network data; The network feature is input into the first model to obtain the detection result of the communication link, and the detection result is used to indicate whether the communication link is an abnormal link.
  • the first model is based on the marked samples in the first sample set, K marked samples and M unlabeled samples, the second model obtained from the previous training is trained, and the model obtained when the training meets the preset conditions, the K labeled samples are the K unlabeled samples in the first sample set are labeled respectively It is obtained that the M unlabeled samples are unlabeled samples selected as negative samples from the first sample set, and the first sample set includes the pre-stored pre-stored samples before K unlabeled samples and M unlabeled samples are selected. Labeled and unlabeled samples.
  • the link detection model is used to detect the communication link, thereby improving the accuracy of detecting abnormal links.
  • the processing unit is further configured to obtain the abnormal score value of each unlabeled sample in the first sample set; and perform descending sorting according to the abnormal score value of each unlabeled sample in the first sample set to obtain the first Sorting; take the unlabeled samples corresponding to the first K serial numbers in the first sorting as the K unlabeled samples. That is to say, the selected samples to be marked are the most abnormal K unmarked samples in the first sample set, and the sample set for training the abnormal link detection model includes samples that may be abnormal, which can improve the effect of model training and facilitate the training of the model. Improve the accuracy of detecting abnormal links.
  • the processing unit is further configured to use the unlabeled samples corresponding to the last L serial numbers in the first sorting as the L unlabeled samples; and select M unlabeled samples from the L unlabeled samples. That is to say, the selected unlabeled samples are M unlabeled samples randomly selected from the most normal L unlabeled samples in the first sample set, and the unlabeled samples are regarded as negative samples, then the abnormal link detection model is trained
  • the newly added samples in the sample set are samples of normal links, which can avoid introducing noise, improve the effect of model training, and facilitate the accuracy of detecting abnormal links.
  • the processing unit is further configured to obtain an abnormal score value of each unlabeled sample in the second sample set, where the second sample set includes pre-stored labeled samples and unlabeled samples before selecting P unlabeled samples sample; perform a descending arrangement according to the abnormal score value of each unlabeled sample in the second sample set to obtain a second ranking; take the unlabeled samples corresponding to the first P serial numbers in the second ranking as P unlabeled samples; according to the second sample set
  • the marked samples and the P marked samples are constructed to construct a third model, the P marked samples are obtained by marking the P unmarked samples respectively, and the third model is the initialization model corresponding to the first model and the second model.
  • the initialization model of the abnormal link detection model is constructed based on the P marked samples corresponding to the most abnormal P unmarked samples and the existing marked samples, which can improve the effect of model training and improve the accuracy of detecting abnormal links. Rate.
  • the processing unit is further configured to acquire network topology information of the communication link; a set composed of pre-stored unlabeled samples and labeled samples corresponding to the network topology information and device information is used as the first sample set. That is to say, selecting unlabeled samples and labeled samples corresponding to the network topology information of the communication link as the samples to be selected for training can improve the effect of model training and facilitate the detection of whether the communication link is an abnormal link 's accuracy.
  • an embodiment of the present application discloses a model training device, comprising: a selection module for selecting K unlabeled samples from a first sample set; and selecting M samples from the first sample set as negative samples Unlabeled samples, the first sample set includes pre-stored labeled samples and unlabeled samples before selecting K unlabeled samples and M unlabeled samples; a training module, used for according to the labeled samples in the first sample set , K labeled samples and M unlabeled samples, train the second model obtained from the previous training, and obtain the first model when the training meets the preset conditions, and the K labeled samples are for the first sample set. K unlabeled samples are obtained by labeling them respectively.
  • the model can learn the distribution of positive and negative samples in unlabeled samples during training.
  • retraining the model obtained from the previous training according to the selected samples and the existing labeled samples can further improve the detection accuracy.
  • the selection module is specifically configured to obtain the abnormal score value of each unlabeled sample in the first sample set; according to the abnormal score value of each unlabeled sample in the first sample set, the abnormal score value of each unlabeled sample is sorted in descending order to obtain the first Sorting; take the unlabeled samples corresponding to the first K serial numbers in the first sorting as the K unlabeled samples. That is to say, the selected samples to be marked are the most abnormal K unmarked samples in the first sample set, and the sample set for training the abnormal link detection model includes samples that may be abnormal, which can improve the effect of model training and facilitate the training of the model. Improve the accuracy of detecting abnormal links.
  • the selection module is specifically configured to use the unmarked samples corresponding to the last L serial numbers in the first sorting as the L unmarked samples; and select M unmarked samples from the L unmarked samples. That is to say, the selected unlabeled samples are M unlabeled samples randomly selected from the most normal L unlabeled samples in the first sample set, and the unlabeled samples are regarded as negative samples, then the abnormal link detection model is trained
  • the newly added samples in the sample set are samples of normal links, which can avoid introducing noise, improve the effect of model training, and facilitate the accuracy of detecting abnormal links.
  • the selection module is specifically configured to count the marked samples in the first sample set and the number of positive samples in the K marked samples; according to the number of positive samples, select M unmarked samples from the first sample set
  • the labeled samples are taken as negative samples, and M is equal to the labeled samples in the first sample set and the number of positive samples in the K labeled samples. That is to say, the number of new negative samples in the sample set for training the abnormal link detection model is equal to the number of positive samples in the sample set, which can relatively achieve a balance between positive and negative samples, reduce label noise, and improve the effect of model training. , which is convenient to improve the accuracy of detecting abnormal links.
  • the selection module is further configured to obtain the abnormal score value of each unlabeled sample in the second sample set, where the second sample set includes pre-stored labeled samples and unlabeled samples before selecting P unlabeled samples sample; perform a descending arrangement according to the abnormal score value of each unlabeled sample in the second sample set to obtain a second ranking; take the unlabeled samples corresponding to the first P serial numbers in the second ranking as P unlabeled samples; according to the second sample set
  • the marked samples and the P marked samples are constructed to construct a third model, the P marked samples are obtained by marking the P unmarked samples respectively, and the third model is the initialization model corresponding to the first model and the second model. In this way, the initialization model of the abnormal link detection model is constructed based on the P marked samples corresponding to the most abnormal P unmarked samples and the existing marked samples, which can improve the effect of model training and improve the accuracy of detecting abnormal links. Rate.
  • the selection module is further configured to acquire the network topology information of the communication link to be detected; the pre-stored set of unmarked samples and marked samples corresponding to the network topology information is used as the first sample set. That is to say, selecting unlabeled samples and labeled samples corresponding to the network topology information of the communication link as the samples to be selected for training can improve the effect of model training and facilitate the detection of whether the communication link is an abnormal link 's accuracy.
  • M is equal to the number of labeled samples in the first sample set and the number of positive samples in the K labeled samples.
  • the number of new negative samples in the sample set for training the abnormal link detection model is equal to the number of positive samples in the sample set, which can relatively achieve a balance between positive and negative samples, reduce label noise, improve the effect of model training, and facilitate Improve the accuracy of detecting abnormal links.
  • the network data includes at least one of the following: a signal-to-noise ratio, a level of an input signal, Errored seconds, severely errored seconds, unavailable time, network topology information. In this way, abnormal link detection is performed through different network data, which can improve the diversity of detection.
  • an embodiment of the present application provides another device, comprising a processor, a memory connected to the processor, and a communication interface, where the memory is used to store one or more programs and is configured to be executed by the processor in any of the foregoing aspects step, the device includes an abnormal link detection device and a model training device.
  • the present application provides a computer-readable storage medium, where instructions are stored in the computer-readable storage medium, which, when executed on a computer, cause the computer to execute the method of any one of the foregoing aspects.
  • the present application provides a computer program product, where the computer program product is used to store a computer program, and when the computer program is run on a computer, causes the computer to execute the method of any one of the above-mentioned aspects.
  • the present application provides a chip, including a processor and a memory, where the processor is configured to call and execute instructions stored in the memory from the memory, so that a device equipped with the chip executes the method of any one of the foregoing aspects.
  • the present application provides another chip, comprising: an input interface, an output interface and a processing circuit, the input interface, the output interface and the processing circuit are connected through an internal connection path, and the processing circuit is used to perform any one of the above-mentioned aspects. method.
  • the present application provides another chip, including: an input interface, an output interface, a processor, and optionally a memory, the input interface, the output interface, the processor, and the memory are connected through an internal connection path,
  • the processor is used to execute code in the memory, and when the code is executed, the processor is used to perform the method of any of the above aspects.
  • an embodiment of the present application provides a chip system, including at least one processor, a memory and an interface circuit, the memory, the transceiver and the at least one processor are interconnected through lines, and at least one memory stores a computer program; the computer program A method of any of the above aspects is performed by a processor.
  • FIG. 1 is a schematic flowchart of a model training method provided by an embodiment of the present application.
  • FIG. 2 is a schematic structural diagram of a communication system provided by an embodiment of the present application.
  • FIG. 3 is a schematic flowchart of a detection node provided by an embodiment of the present application.
  • FIG. 4 is a schematic flowchart of an abnormal link detection method provided by an embodiment of the present application.
  • FIG. 5 is a schematic structural diagram of a model training device provided by an embodiment of the present application.
  • FIG. 6 is a schematic structural diagram of an abnormal link detection apparatus provided by an embodiment of the present application.
  • FIG. 7 is a schematic structural diagram of a device provided by an embodiment of the present application.
  • abnormal conditions include a network node in the communication link disconnecting from other network nodes, or it may be that the network node does not receive a pre-received signal (or information), or it may be that the network node does not send the signal to be transmitted to the network node.
  • the network node to be received may be at least one of the situations in which the network node sends the signal to be transmitted to the network node that should not be received, which is not limited herein.
  • Positive samples include categories that need to be identified in binary classification tasks.
  • Negative samples are the opposite of positive samples, which include categories that do not need to be identified in binary classification tasks.
  • the car is the type to be identified, the picture of the car can be used as a positive sample, and any picture that is not a car can be used as a negative sample.
  • the category of the abnormal link needs to be identified. Therefore, in this embodiment of the present application, positive samples correspond to samples of abnormal links, and negative samples correspond to samples of normal links.
  • An outlier is a sample that is significantly different from the rest of the data.
  • Non-outliers are the opposite of outliers, which are samples of the same type in the sample as the rest of the data. Since the quantity of normal data is much larger than the quantity of abnormal data, outliers can be understood as abnormal data, and non-outliers can be understood as normal data. That is to say, in the embodiments of the present application, outliers may be understood as positive samples, and non-outliers may be understood as negative samples.
  • the real class sample is actually a positive sample, and the binary classification model predicts it as a positive sample. False negative samples are actually positive samples, but the binary classification model predicts them as negative samples. False positive samples are actually negative samples, but the binary model predicts them as positive samples.
  • the true negative class sample is actually a negative sample, and the two-class model predicts a negative sample.
  • An abnormal link detection model a first model and a second model.
  • the abnormal link detection model is used to detect whether the communication link is an abnormal link.
  • this application refers to the initialization model of the abnormal link detection model as the third model, and the abnormal link detection model obtained from the previous training is called the second model, and the second model will be trained, and the training will be completed after the training is completed.
  • the abnormal link detection model obtained when is called the first model.
  • the second model is not the third model, the training methods of the first model and the second model are the same.
  • the initialization model refers to the model obtained when the abnormal link detection model is constructed, which can be understood as the model obtained by the first training, and the third model can also be understood as the initialization model of the first model and the second model.
  • the parameters of the third model can be understood as the initialization parameters of the abnormal link detection model, and the construction of the initialization model can be understood as obtaining the initialization parameters of the abnormal link detection model.
  • the parameters of the second model can be understood as the initialization parameters of the first model, and the training of the second model can be understood as updating the parameters of the second model, and it can also be understood as acquiring the initialization parameters of the first model.
  • the abnormal link detection model can be a neural network.
  • the neural network can be composed of neural units.
  • the neural unit can refer to an operation unit that takes x s and an intercept 1 as inputs.
  • the output of the operation unit can be:
  • s 1, 2, ... n, n is a natural number greater than 1
  • W s is the weight of x s
  • b is the bias of the neural unit.
  • f is an activation function of the neural unit, which is used to introduce nonlinear characteristics into the neural network to convert the input signal in the neural unit into an output signal. The output signal of this activation function can be used as the input of the next convolutional layer.
  • the activation function can be a sigmoid function.
  • a neural network is a network formed by connecting many of the above single neural units together, that is, the output of one neural unit can be the input of another neural unit.
  • each neural unit can be connected with the local receptive field of the previous layer to extract the features of the local receptive field, and the local receptive field can be an area composed of several neural units.
  • the parameters of the abnormal link detection model can be understood as W s and b in formula (1).
  • the network data includes device information and performance data of the network node, and network topology information of the communication link corresponding to the network node, and the like, which is not limited herein.
  • the network topology information of the communication link is used to describe the connection relationship between each network node in the communication link and the device information of each network node.
  • the device information is used to describe hardware parameters of the network node, such as device model, voltage limit size, current limit size, storage capacity, transmission rate, and the like.
  • the performance data of the network node may include but not limited to at least one of the following information: signal-to-noise ratio (signal-to-noise ratio, SNR or S/N), input signal level (signal level at receiver input, RSL) , the number of errored seconds (ES), the number of severely errored seconds (SES), the period of unavailability (UAS), skewness, etc.
  • Signal-to-noise ratio also known as signal-to-noise ratio, refers to the ratio of signal to noise in a network node or a communication link.
  • the noise here refers to an irregular additional signal (or information) that does not exist in the original signal generated by the network node, and the signal does not change with the change of the original signal.
  • SNR max represents the maximum signal-to-noise ratio during the observation period
  • SNR min represents the minimum signal-to-noise ratio during the observation period.
  • the observation period can also be called observation time or observation duration, etc.
  • the observation period can be a preset fixed time period, which is the same for all communication links and all network nodes; it can also be each communication link and each network node.
  • a different time set by the network node can also be a dynamic time determined by the gateway node used to manage the network node in the communication link, that is to say, the time is not a certain value, and the time can be determined by the gateway node It is determined according to channel quality conditions, network load conditions, etc., and is not limited here.
  • the level of an input signal refers to the logarithm of the ratio of power or voltage or current between two network nodes when a network node sends a signal to another network node.
  • RSL max represents the maximum input signal level within the observation period.
  • Errored Seconds is used to describe the number of errors in a second.
  • Conditions corresponding to severely errored seconds include that the bit error rate in any one second of observation period is greater than a threshold, or signal loss is detected.
  • ES max represents the maximum errored seconds during the observation period
  • SES max represents the maximum severely errored seconds during the observation period.
  • the unavailability time starts when the network node generates 10 consecutive severely errored seconds, and reports it, and ends when the errored seconds per second within 10 consecutive seconds are not severely errored seconds.
  • UAS max represents the maximum unavailable time during the observation period.
  • Skewness also known as skewness and skewness coefficient, is a measure of the direction and degree of skewness in the distribution of statistical data, and is used to measure the asymmetry of the probability distribution of random variables. 0 means the most perfect symmetry, and the skewness of the normal distribution is 0. Please refer to formula (2) for the calculation of skewness.
  • S is the skewness
  • i is the ith value
  • n is the number of samples
  • is the mean
  • is the standard deviation
  • the network feature is used to describe the performance feature corresponding to the network data.
  • the present application does not limit the method for acquiring network features, and statistical analysis can be performed based on network data of different dimensions.
  • the network characteristics of the network node can be determined according to the network data. Taking network node 1 as an example, the variance of SNR, SNR max , SNR min , skewness of RSL, ES max , SES max , and UAS max of network node 1 during the observation period can be obtained.
  • network node 1 and network node 2 are both network nodes on a communication link L1, and the variance of the SNR of network node 1 and network node 2 during the observation period, SNR max , SNR min , RSL skewness, ES max , SES max , UAS max , etc.; the SNR max between network node 1 and network node 2 can be obtained, or the variance of SNR max , or the sum of squared differences of SNR max ; Obtain the SNR min between the network node 1 and the network node 2, or the variance of the SNR min , or the sum of the squared differences of the SNR min ; the RSL max between the network node 1 and the network node 2, or the skewness of the RSL max
  • the network features can also be obtained through the network embedding method (Network Embedding).
  • Network embedding methods aiming to learn low-dimensional latent representations of nodes in a network, and the learned feature representations can be used as features for various graph-based tasks, such as classification, clustering, link prediction, and visualization.
  • the central idea is to find a mapping function that transforms each node in the network into a low-dimensional latent representation. Obtaining the network features of network nodes through the network embedding method can improve the accuracy and efficiency of obtaining features.
  • the data of the labeled samples includes a label, and the label is used to indicate whether the labeled sample is a positive sample or a negative sample.
  • Data for unlabeled samples do not include labels.
  • Labeled samples may also be referred to as labeled samples, or labeled data or labeled data, etc.
  • unlabeled samples may also be referred to as unlabeled data or untagged data, etc.
  • marked samples and unmarked samples are used as examples for illustration, positive samples in the marked samples correspond to samples of abnormal links, and negative samples in the marked samples correspond to samples of normal links.
  • both the marked samples and the unmarked samples can include network data of the network node, and the network data can refer to the definition (6) above, which will not be repeated here.
  • the first sample set includes labeled samples and unlabeled samples before samples for training the first model are selected.
  • the second set of samples includes labeled samples and unlabeled samples before the samples selected for building the third model.
  • the samples selected in the first sample set are K unlabeled samples and M unlabeled samples
  • the first sample set can be understood as the marked samples and unlabeled samples before the K unlabeled samples and M unlabeled samples are selected.
  • a collection of labeled samples when the samples selected in the second sample set are P unlabeled samples, the second sample set can be understood as a set composed of labeled samples and unlabeled samples before the P unlabeled samples are selected.
  • This application does not limit the selection method of the first sample set and the second sample set, and all or part of the samples may be selected, and some samples may be samples obtained in a recent period, or may be the samples of the communication link to be detected.
  • the historical samples, or the historical samples of the communication link of the same type as the communication link are not limited here.
  • the network topology information of the marked samples and the unmarked samples in the first sample set is consistent with the network topology information of the communication link to be detected.
  • the communication link to be detected may be the communication link deployed by the abnormal link detection model.
  • the samples in the first sample set may be historical samples of the communication link, or may be historical samples of a communication link of the same type as the communication link. It can be understood that when unlabeled samples and labeled samples corresponding to the same network topology information are selected as the first sample set, the effect of model training can be improved, and the accuracy of communication link detection can be improved.
  • the evaluation index of the abnormal link detection model is used to evaluate the detection effect of the abnormal link detection model.
  • Evaluation indicators can include precision (precision, P), recall (recall, R), sensitivity (true positive rate, TPR), specificity (false positive rate, FPR), accuracy (accuracy), F1 value (F1- score), etc., which are not limited here.
  • the accuracy also known as the precision, refers to the proportion of the number of positive samples that are correctly divided into all positive samples.
  • Recall rate refers to the proportion of all positive samples that are correctly classified as positive samples.
  • Sensitivity refers to the proportion of all positive samples that are correctly identified as positive samples.
  • Specificity refers to the proportion of all negative samples that are misidentified as positive samples.
  • Accuracy refers to the proportion of all samples that are correctly classified.
  • the F1 value is also known as the harmonic mean. When the recall rate is larger, the prediction coverage will be higher and the precision will be smaller. Therefore, the F1 value can be used to reconcile the precision and recall rate.
  • precision P, recall rate R, sensitivity TPR, specificity FPR, precision rate, and F1 value please refer to formula (3), formula (4), formula (5), formula (6), formula (7) and formula (8).
  • acc represents the accuracy rate
  • TP represents the number of true samples
  • FP represents the number of false positive samples
  • FN represents the number of false negative samples
  • TN represents the number of true negative samples. Recall and sensitivity are equal when the number of all positive samples is equal to the number of true class samples and false negative class samples.
  • the detection effect of the abnormal link detection model can also be evaluated by the precision recall (PR) curve corresponding to the precision and recall rate in the evaluation index, the receiver operating characteristic curve (ROC) corresponding to the specificity and sensitivity,
  • PR precision recall
  • ROC receiver operating characteristic curve
  • the area under the ROC curve (ROC area under curve, ROC-AUC) and the area under the PR curve (PR area under curve, PR-AUC) were determined.
  • the abscissa (x) of the PR curve is the recall rate
  • the ordinate (y) is the precision.
  • the abscissa (x) of the ROC curve is the specificity
  • the ordinate (y) is the sensitivity.
  • the value of ROC-AUC is the area enclosed by the ROC curve and the abscissa and ordinate.
  • PR-AUC The value of PR-AUC is the area enclosed by the PR curve and the abscissa and ordinate. The closer the ROC curve is to the upper left corner, the greater the value of AUC. The larger the value of AUC, the closer the precision and recall are to 1. The closer the precision and recall are to 1, the better the detection performance of the model.
  • the preset condition is used to determine whether the training of the abnormal link detection model is completed, and is specifically used to determine that the evaluation index of the abnormal link detection model reaches or exceeds the threshold, or the evaluation index of the abnormal link detection model is difficult to It is determined that the training of the abnormal link detection model is completed when the number of trainings reaches or exceeds the threshold, etc.
  • the preset conditions that are satisfied when the second model training is completed may include, but are not limited to, at least one of the following information:
  • the precision of the model is greater than or equal to the first threshold; the recall rate of the second model is greater than or equal to the second threshold; the improvement of the precision of the second model is less than or equal to the third threshold; the improvement of the recall of the second model is less than or equal to the fourth threshold; the number of training times of the second model is greater than or equal to the fifth threshold; the accuracy of the second model is greater than or equal to the sixth threshold; the improvement of the accuracy of the second model is less than or equal to the seventh threshold; the second The harmonic mean F1 value corresponding to the precision and recall rate of the model is greater than or equal to the eighth threshold, etc.
  • the above thresholds are not limited, and the third threshold may be equal to the fourth threshold. In order to improve the training effect, the threshold of this training may be equal to or greater than the threshold of the previous training
  • Unsupervised learning solves problems in pattern recognition based on unlabeled samples.
  • Commonly used unsupervised learning algorithms include matrix factorization algorithm, solitary forest algorithm (isolation forest), principal component analysis (PCA), isometric mapping method, local linear embedding method, Laplace feature mapping method, Hesse's local linear embedding method and local tangent space arrangement method, etc.
  • a typical example of unsupervised learning is clustering, where the purpose of clustering is to group similar things together without caring what the class is.
  • Supervised learning is the process of using labeled samples to adjust the parameters of a classifier to achieve the required performance, also known as supervised training or learning with a teacher.
  • Common supervised learning algorithms regression analysis and statistical classification. The most typical algorithms are k-Nearest Neighbor (KNN) and support vector machine (SVM).
  • the training method of the abnormal link detection model provided by the embodiment of the present application involves artificial intelligence technology, and can be specifically applied to data processing methods such as data training, machine learning, and deep learning.
  • the network data of the network node is symbolized and formalized for intelligent information modeling, extraction, preprocessing, training, etc., and finally a trained abnormal link detection model (such as the first model in the embodiment of the present application, the first model, the third Two models); and, the abnormal link detection method provided by the embodiment of the present application may use the above-mentioned trained abnormal link detection model (such as the first model in the embodiment of the present application), and input data (such as the embodiment of the present application)
  • the network features in the abnormal link detection model are input into the abnormal link detection model, and output data (such as the detection result of the communication link in the embodiment of the present application) are obtained.
  • the training method of the abnormal link detection model and the abnormal link detection method provided by the embodiments of the present application are inventions based on the same concept, and can also be understood as two parts in a system, or an overall process two stages: such as model training stage and model application stage.
  • the model training phase includes a model initialization phase and a model training phase.
  • the model training stage is used to train the previously obtained model (such as the first model in the embodiment of the present application).
  • the model initialization stage is used to build a model (such as the third model in the embodiment of the present application).
  • This application does not limit the initialization method of the abnormal link detection model, and a supervised learning method can be used based on the marked samples (such as the embodiment of the present application).
  • the labeled samples in the second sample set in the second sample set) to construct the initialization model of the abnormal link detection model; or the unsupervised learning method can be used first, and the unlabeled samples (such as the unlabeled samples in the second sample set in the embodiment of the present application) ) to classify to obtain unmarked samples of abnormal links and unmarked samples of normal links, and then manually mark the unmarked samples of abnormal links, and the marked samples (such as those in the second sample set in the embodiment of the present application) labeled samples) together to build the initialization model of the abnormal link detection model, etc.
  • the initialization method of the abnormal link detection model includes the following steps A1-A3, wherein:
  • A1 Obtain the abnormal score value of each unlabeled sample in the second sample set.
  • the third model is an initialization model of the abnormal link detection model.
  • the second sample set includes pre-stored labeled samples and unlabeled samples before the samples used to construct the third model are selected.
  • the samples selected in the second sample set are P unlabeled samples
  • the second sample set can be understood as The set of labeled samples and unlabeled samples before selecting P unlabeled samples.
  • This application does not limit the selection method of the second sample set, all or part of the samples can be selected, and part of the samples can be samples obtained in a recent period, or can be historical samples of the communication link to be detected, or can be The history samples of the communication link of the same type as the communication link are not limited here.
  • the network topology information of the marked samples and the unmarked samples in the second sample set is consistent with the network topology information of the communication link to be detected.
  • the communication link to be detected may be the communication link deployed by the abnormal link detection model.
  • the samples in the second sample set may be historical samples of the communication link, or may be historical samples of a communication link of the same type as the communication link. It can be understood that when unmarked samples and marked samples corresponding to the same network topology information are selected as the second sample set, the accuracy of detecting whether the communication link is an abnormal link can be improved.
  • the abnormal score value is used to describe the abnormal possibility of the communication link corresponding to the unlabeled sample, which can be described by probability.
  • This application does not limit the method for obtaining the abnormal score value, which can be obtained based on an unsupervised learning method; or select a most abnormal marked sample as a reference sample, and compare each unmarked sample in the second sample set with the reference sample. By comparison, the similarity value between each sample is obtained, and the similarity value is regarded as an abnormal score value, etc.
  • step A1 This application does not limit the execution conditions of step A1, which may be executed after the abnormal link detection model is deployed on the detection node, or after the number of stored unlabeled samples exceeds a threshold, or it may be executed after the distance Executed after the time of the first unmarked sample received exceeds a threshold, and the above threshold is not limited.
  • A2 According to the abnormal score value of each unlabeled sample in the second sample set, select P unlabeled samples from the second sample set.
  • P is a positive integer, which can be set according to the number of unlabeled samples and/or the number of positive samples in the labeled samples and/or the number of negative samples in the labeled samples, etc., or can be set according to the abnormal link
  • the evaluation indicators that are preset by the detection model are set.
  • the abnormal score value of any unlabeled sample in the P unlabeled samples is greater than or equal to the abnormal score value of any unlabeled sample except the P unlabeled samples in the second sample set.
  • the present application does not limit the method for selecting the P unlabeled samples, and the abnormal score values of each unlabeled sample in the second sample set may be sorted in descending order or ascending order. When the descending order is used as the second order, the unlabeled samples corresponding to the first P serial numbers in the second order can be obtained. In ascending order, the unlabeled samples corresponding to the last P serial numbers can be obtained.
  • the method of selecting P unlabeled samples can also randomly select P reference unlabeled samples, and then compare the abnormal score values of the P reference unlabeled samples from the remaining unlabeled samples one by one, so as to obtain the P reference unlabeled samples.
  • the smaller unlabeled samples among the unlabeled samples are replaced.
  • the P unlabeled samples may include unlabeled samples with equal abnormal score values, and the unlabeled samples other than the P unlabeled samples in the second sample set may also be different from the unlabeled samples in the P unlabeled samples.
  • the anomaly score values for the labeled samples are equal.
  • the P unlabeled samples can be understood as the most abnormal part of the unlabeled samples in the second sample set.
  • A3 Build a third model according to the labeled samples and the P labeled samples in the second sample set.
  • the P marked samples are obtained by marking the P unmarked samples respectively.
  • This application does not limit the labeling method of the P unlabeled samples, and the P unlabeled samples can be manually labeled, or directly used as positive samples.
  • This application also does not limit the method of constructing the third model.
  • Logistic regression or decision tree algorithm can be used to classify the labeled samples in the second sample set, the network data in the P labeled samples, and the labels of the labeled samples.
  • the parameters of the abnormal link detection model ie, the third model
  • the abnormal link detection model is equivalent to a function, and the network data (or the characteristic data corresponding to the network data) of each marked sample is a constant, which can be obtained by multiplying the constant and the parameters of the abnormal link detection model.
  • the label of the labeled sample, the parameters of the abnormal link detection model can be obtained according to the labeled sample in the second sample set and the network data and label of each labeled sample in the P labeled samples. Further, according to gradient descent method (Gradient descent), Newton's method (Newton's method), conjugate gradient method (Conjugate gradient), Quasi-Newton method (Quasi-Newton method), heuristic method (for example, simulated annealing method, genetic method) algorithm, ant colony algorithm, particle swarm algorithm, etc.), adjust the parameters obtained by classification, and then adjust the parameters obtained last time according to the above methods, until the marked samples and P marked samples in the second sample set are determined.
  • the parameters of the abnormal link detection model when the training is completed are used as the initialization parameters of the abnormal link detection model (ie, the parameters of the third model).
  • P unlabeled samples are selected from the second sample set as new training data, and the P unlabeled samples are not randomly selected, but are based on the data of each unlabeled sample in the second sample set.
  • the most abnormal data is selected by the abnormal score value, which can reduce the workload of invalid labeling.
  • the initialization model (ie, the third model) of the abnormal link detection model is constructed by using the P marked samples corresponding to the most abnormal P unmarked samples and the existing marked samples, which can improve the accuracy of the model to detect abnormal links .
  • model training phase can be entered, and the method used in each training process is the same.
  • This application does not limit the execution conditions of model training, which may be triggered after receiving network data of network nodes in the communication link, or the number of unlabeled samples that have been received or stored in advance exceeds a threshold, or It means that the time from the last model training exceeds a threshold, or it may be that the network data sent by the network node in the communication link has not been received for a long time, and the above threshold and time length are not limited.
  • the abnormal link detection model obtained from the previous training can be trained based on the newly added marked samples; or the unsupervised learning method can be used first to determine the sample set Unmarked samples of abnormal links and unmarked samples of normal links in the unmarked samples of the or the abnormal link detection model obtained from the previous training, select the most abnormal unlabeled sample, mark the unlabeled sample, and train it together with the marked sample, etc.
  • FIG. 1 is a schematic flowchart of a model training method proposed by an embodiment of the present application. As shown in FIG. 1 , the method can be executed by an abnormal link detection model or an abnormal link detection device or a detection node or terminal and other equipment, and the method includes:
  • S102 Select K unlabeled samples from the first sample set.
  • K is a positive integer.
  • P the number of the most abnormal unlabeled samples selected by the abnormal link detection model is equal in the model initialization phase and the model training phase. It can be understood that no matter what the value of K is, new unlabeled samples are selected, and the abnormal link detection model is trained based on the new unlabeled samples, which can realize incremental learning, improve the effect of model training, and facilitate the detection of abnormal links. 's accuracy.
  • the present application does not limit the method for selecting K unlabeled samples, which may be randomly selected, or the most abnormal K unlabeled samples may be selected. It can be understood that randomly selecting K unlabeled samples in the sample set for training allows the abnormal link detection model to learn the distribution of positive and negative samples in the unlabeled samples during the training process. Since abnormal data is less than normal data, random selection may result in no or few positive samples.
  • step S102 includes the following steps B1 and B2, wherein:
  • B1 Obtain the anomaly score value of each unlabeled sample in the first sample set.
  • the method for obtaining the abnormal score value may refer to the description of A1, and may also be obtained based on the abnormality detection model (ie, the second model) obtained in the previous training, etc., which is not limited here. Obtaining the abnormal score value of the unlabeled sample through the abnormality detection model obtained by the previous training can improve the efficiency and accuracy of obtaining the abnormal score value.
  • B2 According to the abnormal score value of each unlabeled sample in the first sample set, select K unlabeled samples from the first sample set.
  • the abnormal score value of any unlabeled sample in the K unlabeled samples is greater than or equal to the abnormal score value of any unlabeled sample except the K unlabeled samples in the first sample set.
  • the samples to be marked selected from the unmarked samples are the most abnormal K unmarked samples in the first sample set. That is to say, the sample set of the abnormal link detection model includes samples that may be abnormal, which can improve the effect of model training and facilitate the improvement of the accuracy of the model for detecting abnormal links.
  • S104 Select M unlabeled samples from the first sample set as negative samples.
  • the M unlabeled samples are unlabeled samples selected from the first sample set as negative samples, that is, the M unlabeled samples are regarded as normal link data.
  • the present application does not limit the method for selecting M unlabeled samples, and the most normal M unlabeled samples may be randomly selected. It can be understood that randomly selecting M unlabeled samples as negative samples in the sample set allows the abnormal link detection model to learn the distribution of positive and negative samples in the unlabeled samples during the training process. It should be noted that the M unlabeled samples should be different from the K unlabeled samples.
  • step S104 includes the following two ways, wherein:
  • the first method is to count the number of labeled samples in the first sample set and the number of positive samples in the K labeled samples; according to the number of positive samples, M unlabeled samples are selected from the first sample set as negative samples, where M is equal to the number of positive samples.
  • the labeled samples in the first sample set and the number of positive samples in the K labeled samples can be understood as the number of samples of abnormal links in the sample set of the second model. That is to say, first count the number of samples of abnormal links in the sample set trained by the abnormal link detection model, and then select the most normal unlabeled samples from the first sample set, and the number of selected unlabeled samples is equal to the statistical The number of samples of anomalous links.
  • the number of new negative samples in the sample set trained by the abnormal link detection model is equal to the number of positive samples in the sample set, which can relatively achieve a balance between positive and negative samples, reduce label noise, improve the effect of model training, and facilitate Improve the accuracy of the model to detect abnormal links.
  • step S104 includes the following steps C1-C3, wherein:
  • C1 Obtain the anomaly score value of each unlabeled sample in the first sample set.
  • step C reference may be made to the description of step B1, which will not be repeated here.
  • C2 Select L unlabeled samples from the first sample set according to the abnormal score value of each unlabeled sample in the first sample set.
  • the abnormal score value of any unlabeled sample in the L unlabeled samples is less than or equal to the abnormal score value of any sample in the first sample set except for the L unlabeled samples.
  • the present application does not limit the method for selecting L unlabeled samples, and the abnormal score values of each unlabeled sample in the first sample set may be sorted in descending order or ascending order. When the descending order is used as the first order, the unlabeled samples corresponding to the last L serial numbers in the first order can be obtained. In ascending order, the unlabeled samples corresponding to the first L serial numbers can be obtained.
  • the method of selecting L unlabeled samples can also randomly select L reference unlabeled samples from the first sample set, and then compare the abnormal score values of the L reference unlabeled samples from the remaining unlabeled samples one by one. , so as to replace the larger unlabeled sample among the L reference unlabeled samples.
  • the L unlabeled samples may include unlabeled samples with equal abnormal score values, and the unlabeled samples other than the L unlabeled samples and the K unlabeled samples in the first sample set may also be the same as the L unlabeled samples.
  • the anomaly score values of the unlabeled samples among the unlabeled samples are equal.
  • the L unlabeled samples can be understood as the most normal part of the unlabeled samples in the first sample set, and can also be understood as non-outlier points in the first sample set.
  • C3 Select M unlabeled samples from L unlabeled samples.
  • the M unmarked samples may be randomly selected from the L unmarked samples, or may be samples obtained in a recent period, or may be historical samples of the communication link, or may be the same as the communication link. Historical samples of the type of communication link, etc., are not limited here.
  • the unlabeled samples selected according to the abnormal score values of the unlabeled samples are M unlabeled samples randomly selected from the most normal L unlabeled samples in the first sample set, and the unlabeled samples are Label samples as negative samples. That is to say, the newly added samples in the sample set for training the abnormal link detection model are samples of normal links, which can avoid introducing noise, improve the effect of model training, and facilitate the accuracy of the model to detect abnormal links.
  • M unlabeled samples may be selected in combination with the first manner and the second manner.
  • S106 Train the second model obtained from the previous training according to the labeled samples, K labeled samples, and M unlabeled samples in the first sample set, and obtain the first model when the training meets the preset condition.
  • the preset conditions may refer to the definitions in the foregoing, which will not be repeated here.
  • the preset conditions include at least one of the following: the accuracy of the second model is greater than or equal to the first threshold; the recall rate of the second model is greater than or equal to the second threshold; the improvement in accuracy is less than or equal to equal to the third threshold; the improvement of recall is less than or equal to the fourth threshold; the number of training times of the second model is greater than or equal to the fifth threshold; the accuracy of the second model is greater than or equal to the sixth threshold; the improvement of accuracy is less than or equal to equal to the seventh threshold; the harmonic mean corresponding to precision and recall is greater than or equal to the eighth threshold.
  • This application does not limit the training method of the second model, which can be based on gradient descent method, Newton algorithm, conjugate gradient method, quasi-Newton method, heuristic method (for example, simulated annealing method, genetic algorithm, ant colony algorithm and particle swarm algorithm, etc.) and other methods to adjust the parameters of the second model. Then, based on the above method, the parameters of the second model obtained last time are adjusted until it is determined that the training of the second model meets the preset conditions, and the training is determined to be completed, and the second model obtained after the training is completed is used as the first model.
  • the training method of the second model which can be based on gradient descent method, Newton algorithm, conjugate gradient method, quasi-Newton method, heuristic method (for example, simulated annealing method, genetic algorithm, ant colony algorithm and particle swarm algorithm, etc.) and other methods to adjust the parameters of the second model.
  • K unlabeled samples are first selected from the first sample set, and then M unlabeled samples are selected from the first sample set as negative samples.
  • the K labeled samples obtained from the labeling together with the M unlabeled samples and the labeled samples in the first sample set are used to train the second model obtained from the previous training, so that Get the first model that has been trained.
  • the model can learn the distribution of positive and negative samples in unlabeled samples during training.
  • retraining the model obtained from the previous training according to the selected samples and the existing labeled samples can further improve the detection accuracy.
  • FIG. 2 is an architecture diagram of a communication system provided by an embodiment of the present application.
  • the communication system may include a terminal (eg, terminal 211), a network node (eg, network node 221, network node 222), a detection node (eg, detection node 231), and a target device (eg, network device) 241.
  • Application server 251 This embodiment of the present application does not limit the number of the above devices.
  • the communication system in the embodiments of the present application may be a communication system supporting a fourth generation (4G) access technology, for example, a long term evolution (long term evolution, LTE) access technology; or, the communication system may be a communication system supporting Fifth generation (5G) access technology communication system, for example, new radio (NR) access technology; or, the communication system may be a communication system supporting multiple wireless technologies, for example, supporting LTE technology and NR technology; or the communication system may support microwave communication technology, wavelength division communication technology, optical transport network (OTN) technology, wireless communication technology, broadband and narrowband technology, etc.
  • the communication system can be adapted to future-oriented communication technologies.
  • the communication system can also be applied to other communication systems, such as C-V2X system, public land mobile network (PLMN), device-to-device (D2D) network, machine-to-machine (machine to machine, M2M) network, Internet of things (Internet of things, IoT), wireless local area network (wireless local area networks, WLAN) or other networks, etc., are not limited here.
  • C-V2X system public land mobile network (PLMN), device-to-device (D2D) network, machine-to-machine (machine to machine, M2M) network, Internet of things (Internet of things, IoT), wireless local area network (wireless local area networks, WLAN) or other networks, etc., are not limited here.
  • the terminal may be connected to the network node in a wireless or wired manner, and then connected to the target device via the network node in a wireless or wired manner.
  • a terminal may be a device that provides voice or data connectivity to a user.
  • a terminal may be referred to as a user equipment (UE), a mobile station, a subscriber unit, a station, or a terminal device. (terminal equipment, TE) etc.
  • the terminal may be a cellular phone, a personal digital assistant (PDA), a wireless modem, a handheld, a laptop computer, a cordless phone, a wireless Local loop (wireless local loop, WLL) station, mobile phone (mobile phone), tablet computer (pad), etc.
  • PDA personal digital assistant
  • a device that can access a wireless communication network, communicate with a wireless network side, or communicate with other objects through a wireless network can be a terminal in the embodiments of the present application.
  • Terminals can be stationary or mobile.
  • the terminal is a mobile phone.
  • the network node in the embodiment of the present application is used to provide a transmission service for the terminal.
  • a network node may act as a relay node (relay node, RN) as a node that provides wireless backhaul services for terminals, and wireless backhaul services refer to data and/or signaling backhaul services provided through wireless backhaul links.
  • a relay node can provide wireless access services for terminals through an access link (AL); on the other hand, a relay node can use a one-hop or multi-hop backhaul link (BL)
  • the relay node can realize the forwarding of data and/or signaling between the terminal and the target device, thereby expanding the coverage of the communication system.
  • the network node is a relay node.
  • the target device in this embodiment of the present application is deployed in a communication link, and is an apparatus for providing a terminal with a wireless communication function.
  • the target device can be a base station, an access point, a node, an evolved node (environment Bureau, eNB) or a 5G base station (next generation base station, gNB), which refers to communicating with wireless terminals through one or more sectors on the air interface devices in the access network.
  • eNB evolved node
  • gNB next generation base station
  • IP Internet Protocol
  • the base station can act as a router between the wireless terminal and the rest of the access network, which can include an Internet Protocol network.
  • the base station may also coordinate the management of the attributes of the air interface.
  • the target device can also be an application server, for example, a server of an intelligent traffic system (ITS), a server of a navigation application, a server of a payment application, a server of a medical information system, a server of electronic information file management, etc. Do limit.
  • the target device includes an access network device and an application server.
  • the detection node in the embodiment of the present application is deployed in the communication link, and is used to monitor whether the communication link is an abnormal link.
  • An anomaly detection model can be deployed on the detection node.
  • the detection node can be a node deployed separately in the communication system or a node deployed by each network node, which is not limited here, and can be deployed according to the actual situation of the communication link . It can be understood that when the detection node is a node deployed on each network node, only one network node is detected, which can improve the detection efficiency.
  • the detection node can obtain the network data of any network node in the communication link, thereby comprehensively analyzing the entire communication link, which can improve the detection accuracy.
  • the detection node can be specifically used to obtain network data of at least one network node in the communication link; obtain network characteristics of the network data; and input the network characteristics into the abnormal link detection model to obtain the detection of whether the communication link is an abnormal link result.
  • FIG. 3 is a schematic structural diagram of a detection node according to an embodiment of the present application.
  • the detection node 300 may include an input module 301, a feature acquisition module 302, a detection training module 303, an output module 304, and the like.
  • the input module 301 can be used to obtain network data of at least one network node in the communication link.
  • the feature obtaining module 302 can be used to obtain network features of the network data.
  • the detection and training module 303 can be used to detect the network characteristics to obtain the detection result of whether the communication link is an abnormal link.
  • the detection training module 303 can also be used to train an abnormal link detection model.
  • the output module 304 can be used to output the detection result. When the detection result is an abnormal link, it can also be reported by the output module 304 (it can be reported to pre-assigned business personnel, or it can be reported to the system, and the system assigns business personnel, etc., which is not limited here).
  • the abnormal link detection model provided in this application can be applied to any communication link.
  • the training data in the sample set for training the abnormal detection model can be the same as the embodiment of this application.
  • the network data in the data are different, and the data characteristics of the training data may also be different from the network characteristics in the embodiment of the present application.
  • the method for selecting the sample set can be selected by the method described in the embodiment of FIG. The described training method is used for training.
  • FIG. 4 is a schematic flowchart of an abnormal link detection method provided by an embodiment of the present application.
  • the method can be applied to any communication network as described in FIG. 2, and the method can be performed by an abnormal link detection model or an abnormal link detection device, or a detection node or terminal, etc.
  • the method includes but is not limited to the following steps:
  • S402 Receive network data of at least one network node in the communication link.
  • the network data may include but not limited to performance data of network nodes and network topology information of communication links corresponding to the network nodes, etc., which are not limited herein.
  • the network topology information is used to describe the connection relationship between each network node in the communication link.
  • Performance data may include but not limited to at least one of the following information: signal-to-noise ratio, input signal level, errored seconds, severely errored seconds, unavailable time, skewness, etc. This will not be repeated here.
  • step S402 may be sent by the network node at regular intervals.
  • the time may be a fixed time, which is the same for all network nodes, or may be each network node. A different time corresponding to it; it can also be a dynamic time determined by the abnormal link detection model or the abnormal link detection device, or the detection node or terminal, etc. The time can be determined according to the channel quality, network load, etc., This is not limited.
  • the network data of the network node may be sent when a constraint condition is met, and the constraint condition may include the transmission of new services, the termination or suspension of services or the inability to transmit, the number of transmitted services exceeding a threshold, and the like.
  • the network data of the network node may be sent after receiving the request sent by the execution subject for acquiring the network data of the network node, or the like.
  • the network characteristics are used to describe the performance characteristics of the communication link, which can be obtained by statistical analysis based on network data of different dimensions, or obtained through a network embedding method.
  • S406 Input the network feature into the first model to obtain the detection result of the communication link.
  • the detection result of the communication link is used to indicate whether the communication link is an abnormal link.
  • the first model is based on the labeled samples, K labeled samples, and M unlabeled samples in the first sample set, training the second model obtained from the previous training, and the model obtained when the training meets the preset conditions,
  • the K labeled samples are obtained by labeling the K unlabeled samples in the first sample set respectively
  • the M unlabeled samples are the unlabeled samples selected from the first sample set as negative samples.
  • This set includes pre-stored labeled samples and unlabeled samples before selecting K unlabeled samples and M unlabeled samples.
  • the method further includes: acquiring network topology information of the communication link; using a pre-stored set of unlabeled samples and labeled samples corresponding to the network topology information as the first sample set. That is to say, selecting unlabeled samples and labeled samples corresponding to the network topology information of the communication link as the samples to be selected for training can improve the effect of model training and facilitate the detection of whether the communication link is an abnormal link 's accuracy.
  • the network topology information may be obtained from the network data of the network node received in step S402, or may be obtained from the network data of the network nodes in the previously obtained communication link, or may be obtained from the pre-stored data of the communication link. It can be obtained from network topology information, etc., which is not limited here.
  • the preset conditions include at least one of the following: the accuracy of the second model is greater than or equal to the first threshold; the recall rate of the second model is greater than or equal to the second threshold; the improvement in accuracy is less than or equal to equal to the third threshold; the improvement of recall is less than or equal to the fourth threshold; the number of training times of the second model is greater than or equal to the fifth threshold; the accuracy of the second model is greater than or equal to the sixth threshold; the improvement of accuracy is less than or equal to equal to the seventh threshold; the harmonic mean corresponding to precision and recall is greater than or equal to the eighth threshold.
  • the accuracy of the second model is greater than or equal to the first threshold
  • the recall rate of the second model is greater than or equal to the second threshold
  • the improvement in accuracy is less than or equal to equal to the third threshold
  • the improvement of recall is less than or equal to the fourth threshold
  • the number of training times of the second model is greater than or equal to the fifth threshold
  • the accuracy of the second model is greater than or equal to the sixth threshold
  • the method further includes: acquiring the abnormal score value of each unlabeled sample in the first sample set; Arrange in descending order to obtain the first order; take the unlabeled samples corresponding to the first K serial numbers in the first order as the K unlabeled samples. That is to say, the selected samples to be marked are the most abnormal K unmarked samples in the first sample set, and the sample set for training the abnormal link detection model includes samples that may be abnormal, which can improve the effect of model training and facilitate the training of the model. Improve the accuracy of detecting abnormal links.
  • the method further includes: taking the unmarked samples corresponding to the last L serial numbers in the first sorting as the L unmarked samples; selecting M unmarked samples from the L unmarked samples Label samples. That is to say, the selected unlabeled samples are M unlabeled samples randomly selected from the most normal L unlabeled samples in the first sample set, and the unlabeled samples are regarded as negative samples, then the abnormal link detection model is trained
  • the newly added samples in the sample set are samples of normal links, which can avoid introducing noise, improve the effect of model training, and facilitate the accuracy of detecting abnormal links.
  • the method before acquiring the abnormal score value of each unlabeled sample in the first sample set, the method further includes: acquiring the abnormal score value of each unlabeled sample in the second sample set, and the second sample set Including the pre-stored marked samples and unmarked samples before selecting the P unmarked samples; performing descending sorting according to the abnormal score value of each unmarked sample in the second sample set to obtain the second sorting;
  • the unlabeled samples corresponding to the serial numbers are taken as P unlabeled samples;
  • the third model is constructed according to the labeled samples and P labeled samples in the second sample set, and the P labeled samples are obtained by labeling the P unlabeled samples respectively , and the third model is the initialization model corresponding to the first model and the second model.
  • the initialization model of the abnormal link detection model is constructed based on the P marked samples corresponding to the most abnormal P unmarked samples and the existing marked samples, which can improve the effect of model training and improve the accuracy of detecting abnormal links. Rate.
  • M is equal to the labeled samples in the first sample set and the number of positive samples in the K labeled samples.
  • the number of new negative samples in the training sample set of the abnormal link detection model is equal to the number of positive samples in the sample set, which can relatively achieve a balance between positive and negative samples, reduce label noise, and improve the accuracy of detecting abnormal links. .
  • the network characteristics of the network data are obtained, and then the network characteristics are input into, through the samples selected from the unmarked samples and existing The abnormal link detection model obtained by training the marked samples of , so as to detect the communication link and improve the accuracy of detecting abnormal links.
  • FIG. 5 is a schematic structural diagram of a model training apparatus provided by an embodiment of the present application.
  • the model training apparatus 500 may include a selection module 501 and a training model 502, wherein :
  • the selection module 501 is used to select K unmarked samples from the first sample set; and select M unmarked samples as negative samples from the first sample set, the first sample set includes selecting K unmarked samples and M unmarked samples Pre-stored labeled samples and unlabeled samples before unlabeled samples;
  • the training module 502 is configured to train the second model obtained from the previous training according to the marked samples, K marked samples and M unmarked samples in the first sample set, and obtain the first model when the training meets the preset conditions.
  • the K labeled samples are obtained by labeling the K unlabeled samples in the first sample set respectively.
  • the selection module 501 is specifically configured to obtain the abnormal score value of each unlabeled sample in the first sample set; and perform descending order according to the abnormal score value of each unlabeled sample in the first sample set to obtain the first sample set. 1st sorting; take the unmarked samples corresponding to the first K serial numbers in the first sorting as K unmarked samples. That is to say, the selected samples to be marked are the most abnormal K unmarked samples in the first sample set, and the sample set for training the abnormal link detection model includes samples that may be abnormal, which can improve the effect of model training and facilitate the training of the model. Improve the accuracy of detecting abnormal links.
  • the selection module 501 is specifically configured to use the unmarked samples corresponding to the last L serial numbers in the first sorting as the L unmarked samples; and select M unmarked samples from the L unmarked samples. That is to say, the selected unlabeled samples are M unlabeled samples randomly selected from the most normal L unlabeled samples in the first sample set, and the unlabeled samples are regarded as negative samples, then the abnormal link detection model is trained
  • the newly added samples in the sample set are samples of normal links, which can avoid introducing noise, improve the effect of model training, and facilitate the accuracy of detecting abnormal links.
  • the selection module 501 is specifically configured to count the marked samples in the first sample set and the number of positive samples in the K marked samples; according to the number of positive samples, select M samples from the first sample set Unlabeled samples are taken as negative samples, and M is equal to the number of labeled samples in the first sample set and the number of positive samples in the K labeled samples. That is to say, the number of new negative samples in the sample set for training the abnormal link detection model is equal to the number of positive samples in the sample set, which can relatively achieve a balance between positive and negative samples, reduce label noise, and improve the effect of model training. , which is convenient to improve the accuracy of detecting abnormal links.
  • the selection module 501 is further configured to obtain the abnormal score value of each unlabeled sample in the second sample set, where the second sample set includes pre-stored marked samples and unlabeled samples before selecting P unlabeled samples. Mark the samples; perform descending sorting according to the abnormal score value of each unmarked sample in the second sample set to obtain a second ranking; take the unmarked samples corresponding to the first P serial numbers in the second sorting as P unmarked samples; according to the second sample
  • the marked samples in the set and the P marked samples construct a third model, the P marked samples are obtained by marking the P unmarked samples respectively, and the third model is an initialization model corresponding to the first model and the second model.
  • the initialization model of the abnormal link detection model is constructed based on the P marked samples corresponding to the most abnormal P unmarked samples and the existing marked samples, which can improve the effect of model training and improve the accuracy of detecting abnormal links. Rate.
  • the network data includes at least one of the following: signal-to-noise ratio, level of an input signal, errored seconds, severely errored seconds, unavailable time, and network topology information. In this way, abnormal link detection is performed through different network data, which can improve the diversity of detection.
  • K unlabeled samples are first selected from the first sample set, and then M unlabeled samples are selected from the first sample set as negative samples.
  • the K labeled samples obtained from the labeling together with the M unlabeled samples and the labeled samples in the first sample set are used to train the second model obtained from the previous training, so that Get the first model that has been trained.
  • the model can learn the distribution of positive and negative samples in unlabeled samples during training.
  • retraining the model obtained from the previous training according to the selected samples and the existing labeled samples can further improve the detection accuracy.
  • FIG. 6 is a schematic structural diagram of an abnormal link detection apparatus provided by an embodiment of the present application.
  • the abnormal link detection apparatus 600 may include a communication unit 601 and Processing unit 602, wherein:
  • the communication unit 601 is configured to receive network data of at least one network node in the communication link;
  • the processing unit 602 is used to obtain the network characteristics corresponding to the network data; the network characteristics are input into the first model to obtain the detection result of the communication link, and the detection result is used to indicate whether the communication link is an abnormal link, and the first model is based on the first model.
  • the labeled samples, K labeled samples, and M unlabeled samples in the sample set are trained on the second model obtained from the previous training, and the model obtained when the training meets the preset conditions, the K labeled samples are correct
  • the K unlabeled samples in the first sample set are respectively marked, and the first sample set includes the unlabeled samples and the labeled samples stored in advance before the K unlabeled samples and the M unlabeled samples are selected.
  • the processing unit 602 is further configured to obtain the abnormal score value of each unlabeled sample in the first sample set; and perform descending order according to the abnormal score value of each unlabeled sample in the first sample set to obtain the first sample set. 1st sorting; take the unmarked samples corresponding to the first K serial numbers in the first sorting as K unmarked samples. That is to say, the selected samples to be marked are the most abnormal K unmarked samples in the first sample set, and the sample set for training the abnormal link detection model includes samples that may be abnormal, which can improve the effect of model training and facilitate the training of the model. Improve the accuracy of detecting abnormal links.
  • the processing unit 602 is further configured to use the unlabeled samples corresponding to the last L serial numbers in the first sorting as the L unlabeled samples; and select M unlabeled samples from the L unlabeled samples. That is to say, the selected unlabeled samples are M unlabeled samples randomly selected from the most normal L unlabeled samples in the first sample set, and the unlabeled samples are regarded as negative samples, then the abnormal link detection model is trained The newly added samples in the sample set are samples of normal links, which can avoid introducing noise, improve the effect of model training, and facilitate the accuracy of detecting abnormal links.
  • the processing unit 602 is further configured to obtain an abnormal score value of each unlabeled sample in the second sample set, where the second sample set includes pre-stored labeled samples and unlabeled samples before selecting the P unlabeled samples. Mark the samples; perform descending sorting according to the abnormal score value of each unmarked sample in the second sample set to obtain a second ranking; take the unmarked samples corresponding to the first P serial numbers in the second sorting as P unmarked samples; according to the second sample
  • the marked samples in the set and the P marked samples construct a third model, the P marked samples are obtained by marking the P unmarked samples respectively, and the third model is an initialization model corresponding to the first model and the second model.
  • the initialization model of the abnormal link detection model is constructed based on the P marked samples corresponding to the most abnormal P unmarked samples and the existing marked samples, which can improve the effect of model training and improve the accuracy of detecting abnormal links. Rate.
  • M is equal to the labeled samples in the first sample set and the number of positive samples in the K labeled samples.
  • the number of new negative samples in the sample set for training the abnormal link detection model is equal to the number of positive samples in the sample set, which can relatively achieve a balance between positive and negative samples, reduce label noise, improve the effect of model training, and facilitate Improve the accuracy of detecting abnormal links.
  • the processing unit 602 is further configured to acquire network topology information of the communication link; the pre-stored set of unmarked samples and marked samples corresponding to the network topology information and device information is taken as the first sample this episode. That is to say, selecting unlabeled samples and labeled samples corresponding to the network topology information of the communication link as the samples to be selected for training can improve the effect of model training and facilitate the detection of whether the communication link is an abnormal link 's accuracy.
  • the network data includes at least one of the following: signal-to-noise ratio, level of an input signal, errored seconds, severely errored seconds, unavailable time, and network topology information. In this way, abnormal link detection is performed through different network data, which can improve the diversity of detection.
  • the network characteristics of the network data are obtained, and then the network characteristics of the network data are obtained by training the samples selected from the unlabeled samples and the existing labeled samples.
  • the abnormal link detection model detects the communication link and improves the detection accuracy.
  • FIG. 7 is a device 700 provided by an embodiment of the present application.
  • the device 700 includes a processor 701 , a memory 702 and a communication interface 703 , and the processor 701 , the memory 702 and the communication interface 703 are connected to each other through a bus 704 .
  • the memory 702 includes, but is not limited to, random access memory (RAM), read-only memory (ROM), erasable programmable read only memory (EPROM), or A portable read-only memory (compact disc read-only memory, CD-ROM), the memory 702 is used for related computer programs and data.
  • the communication interface 703 is used to receive and transmit data.
  • the processor 701 may be a device with processing functions, and may include one or more processors.
  • the processor may be a general-purpose processor or a special-purpose processor, or the like.
  • the processor may be a baseband processor, or a central processing unit.
  • the baseband processor can be used to process the communication protocol and communication data
  • the central processing unit can be used to control the communication device, execute the software program, and process the data of the software program.
  • the processor 701 in the device 700 is configured to read the computer program code stored in the memory 702.
  • the device 700 may include an abnormal link detection device, or a model training device, or a detection device node or any other possible device.
  • the processor 701 is configured to perform the following operations:
  • the second model obtained from the previous training is trained, and the first model is obtained when the training meets the preset conditions, and the K labeled samples are
  • the labeled samples are obtained by labeling the K unlabeled samples in the first sample set respectively.
  • the first sample set includes the pre-stored labeled samples and unlabeled samples before selecting K unlabeled samples and M unlabeled samples. sample.
  • the processor 701 is specifically configured to perform the following operations:
  • the first sorting is obtained by performing descending sorting according to the abnormal score value of each unlabeled sample in the first sample set;
  • the unlabeled samples corresponding to the first K serial numbers in the first sorting are regarded as K unlabeled samples.
  • the processor 701 is specifically configured to perform the following operations:
  • the processor 701 is specifically configured to perform the following operations:
  • M unlabeled samples are selected from the first sample set as negative samples, where M is equal to the number of positive samples.
  • the processor 701 before selecting K unlabeled samples from the first sample set, the processor 701 is further configured to perform the following operations:
  • a pre-stored set of unlabeled samples and labeled samples corresponding to the network topology information is used as the first sample set.
  • the processor 701 is configured to perform the following operations:
  • the first model is based on the marked samples and K marked samples in the first sample set. and M unlabeled samples, the second model obtained from the previous training is trained, and the model obtained when the training meets the preset conditions, the K labeled samples are performed on the K unlabeled samples in the first sample set respectively.
  • the M unlabeled samples are the unlabeled samples selected as negative samples from the first sample set.
  • the first sample set includes the pre-stored samples before selecting K unlabeled samples and M unlabeled samples. Labeled and unlabeled samples.
  • the processor 701 before inputting the network features into the first model, the processor 701 is further configured to perform the following operations:
  • the first sorting is obtained by performing descending sorting according to the abnormal score value of each unlabeled sample in the first sample set;
  • the unlabeled samples corresponding to the first K serial numbers in the first sorting are regarded as K unlabeled samples.
  • the processor 701 is further configured to perform the following operations:
  • M is equal to the labeled samples in the first sample set and the number of positive samples in the K labeled samples.
  • the processor 701 before inputting the network features into the first model, the processor 701 is further configured to perform the following operations:
  • the pre-stored set of unlabeled samples and labeled samples corresponding to the network topology information is taken as the first sample set.
  • the processor 701 is further configured to perform the following operations:
  • the second sorting is obtained by performing descending sorting according to the abnormal score value of each unlabeled sample in the second sample set;
  • a third model is constructed according to the marked samples and P marked samples in the second sample set.
  • the P marked samples are obtained by marking the P unmarked samples respectively, and the third model corresponds to the first model and the second model. initialized model.
  • the network data includes at least one of the following: signal-to-noise ratio, level of an input signal, errored seconds, severely errored seconds, unavailable time, and network topology information.
  • each operation may also correspond to the corresponding description with reference to the method embodiments shown in FIG. 1 and FIG. 4 .
  • An embodiment of the present application further provides a chip, including a processor and a memory, where the processor is used to call and run instructions stored in the memory from the memory, so that a device with the chip installed executes any of the methods shown in FIG. 1 and FIG. 4 . .
  • the embodiment of the present application also provides another chip, including: an input interface, an output interface, and a processing circuit.
  • the input interface, the output interface, and the processing circuit are connected through an internal connection path. any method shown.
  • the embodiment of the present application also provides another chip, including: an input interface, an output interface, a processor, and optionally, a memory.
  • the input interface, the output interface, the processor, and the memory are connected through an internal connection path, and the processing
  • the processor is used to execute code in the memory, and when the code is executed, the processor is used to perform any of the methods shown in FIGS. 1 and 4 .
  • the embodiments of the present application further provide a chip system, including at least one processor, a memory and an interface circuit, the memory, the transceiver and the at least one processor are interconnected by lines, and at least one memory stores a computer program; the computer program is executed by the processor , the method flow shown in FIG. 1 and FIG. 4 is realized.
  • Embodiments of the present application further provide a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when the computer program runs on a computer, the method flows shown in FIG. 1 and FIG. 4 are implemented.
  • Embodiments of the present application further provide a computer program product, and when the computer program product runs on a computer, the method flows shown in FIG. 1 and FIG. 4 are implemented.
  • the first model is obtained by first training the second model obtained from the previous training according to the samples selected from the unlabeled samples and the existing labeled samples. After receiving the network data of the network nodes in the communication link, the network characteristics of the network data are obtained, and then the network characteristics are input into the first model to obtain the detection result of whether the communication link is an abnormal link, which improves the detection performance. 's accuracy.
  • the aforementioned storage medium includes: ROM or random storage memory RAM, magnetic disk or optical disk and other mediums that can store computer program codes.

Abstract

Provided is a method for detecting an anomalous link, the method comprising: receiving network data of at least one network node in a communication link; acquiring a network feature corresponding to the network data; and inputting the network feature into a first model, so as to obtain a detection result regarding whether the communication link is an anomalous link, wherein the first model is a model which is obtained by means of a second module obtained in previous training being trained according to labeled samples, K labeled samples and M unlabeled samples in a first sample set until the training meets a pre-set condition; the K labeled samples are obtained by means of respectively labeling K unlabeled samples in the first sample set; the M unlabeled samples are unlabeled samples which are selected from the first sample set to serve as negative samples; and the first sample set comprises pre-stored labeled samples and unlabeled samples before the K unlabeled samples and the M unlabeled samples are selected. By using the embodiments of the present application, the accuracy of the detection of anomalous links is increased.

Description

异常链路检测方法、装置及存储介质Abnormal link detection method, device and storage medium
本申请要求于2020年9月17日提交中国国家知识产权局、申请号为202010981945.1、申请名称为“异常链路检测方法、装置及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application with the application number 202010981945.1 and the application name "Abnormal link detection method, device and storage medium", which was submitted to the State Intellectual Property Office of China on September 17, 2020, the entire contents of which are by reference Incorporated in this application.
技术领域technical field
本申请涉及人工智能技术领域,特别涉及一种异常链路检测方法、装置及存储介质。The present application relates to the technical field of artificial intelligence, and in particular, to an abnormal link detection method, device and storage medium.
背景技术Background technique
随着电信网络的快速发展和用户日益增长的多样化需求,网络通信企业需要处理大规模的通信数据和更加复杂的网络运维工作。如果不能及时发现和处理网络设备上发生的异常,则会造成用户无法正常通信,从而影响用户体验感。With the rapid development of telecommunication networks and the increasingly diverse demands of users, network communication enterprises need to deal with large-scale communication data and more complex network operation and maintenance work. If the abnormality that occurs on the network device cannot be detected and handled in time, the user cannot communicate normally, thereby affecting the user experience.
在实际应用中,可采用异常链路检测模型检测通信链路,得到该通信链路是否为异常链路的检测结果。然而,异常链路检测模型通常是通过大量的标记样本进行训练得到的分类器,且每一标记样本是通过人工标记得到的,需要耗费大量人力,且人工标记存在一些误差。如何通过现有的标记样本提高异常链路的检测准确率是本领域技术人员待解决的技术问题。In practical applications, an abnormal link detection model can be used to detect a communication link to obtain a detection result of whether the communication link is an abnormal link. However, the abnormal link detection model is usually a classifier obtained by training a large number of labeled samples, and each labeled sample is obtained by manual labeling, which requires a lot of manpower, and there are some errors in manual labeling. How to improve the detection accuracy of abnormal links by using the existing marked samples is a technical problem to be solved by those skilled in the art.
发明内容SUMMARY OF THE INVENTION
本申请实施例公开了一种异常链路检测方法、装置及存储介质,能够通过从未标记样本中选取的样本和现有的已标记样本训练得到的异常链路检测模型,对通信链路进行检测,提高了检测异常链路的准确率。The embodiment of the present application discloses an abnormal link detection method, device and storage medium, which can perform abnormal link detection on a communication link by using samples selected from unmarked samples and an abnormal link detection model trained from existing marked samples. detection, which improves the accuracy of detecting abnormal links.
第一方面,本申请实施例公开了一种异常链路检测方法,包括:接收通信链路中至少一个网络节点的网络数据;获取网络数据对应的网络特征;将网络特征输入至第一模型得到通信链路的检测结果,检测结果用于指示通信链路是否为异常链路,第一模型是根据第一样本集中的已标记样本、K个已标记样本和M个未标记样本,对上一次训练得到的第二模型进行训练,在训练满足预设条件时得到的模型,K个已标记样本是对第一样本集中的K个未标记样本分别进行标记得到的,M个未标记样本是从第一样本集中选出来的作为负样本的未标记样本,第一样本集包括选取K个未标记样本和M个未标记样本之前,预先存储的已标记样本和未标记样本。如此,在接收到的通信链路中网络节点的网络数据之后,获取网络数据的网络特征,再将网络特征输入至,通过从未标记样本中选取的样本和现有的标记样本训练得到的异常链路检测模型,从而对该通信链路进行检测,提高了检测异常链路的准确率。In a first aspect, an embodiment of the present application discloses a method for detecting an abnormal link, including: receiving network data of at least one network node in a communication link; acquiring network features corresponding to the network data; inputting the network features into a first model to obtain The detection result of the communication link. The detection result is used to indicate whether the communication link is an abnormal link. The first model is based on the marked samples, K marked samples and M unmarked samples in the first sample set. The second model obtained by one training is trained, and the model obtained when the training meets the preset conditions, the K labeled samples are obtained by labeling the K unlabeled samples in the first sample set respectively, and the M unlabeled samples are obtained. is an unlabeled sample selected as a negative sample from the first sample set, and the first sample set includes pre-stored labeled samples and unlabeled samples before selecting K unlabeled samples and M unlabeled samples. In this way, after receiving the network data of the network nodes in the communication link, the network characteristics of the network data are obtained, and then the network characteristics are input to the abnormality obtained by training the samples selected from the unlabeled samples and the existing labeled samples. The link detection model is used to detect the communication link, thereby improving the accuracy of detecting abnormal links.
在一种可能的示例中,在将网络特征输入至第一模型之前,该方法还包括:获取第一样本集中每一未标记样本的异常评分值;根据第一样本集中每一未标记样本的异常评分值进行降序排列得到第一排序;将第一排序中前K个序号对应的未标记样本作为K个未标记样本。也就是说,选取的待标记样本是第一样本集中最为异常的K个未标记样本,则异常 链路检测模型进行训练的样本集中包括可能为异常的样本,可提高模型训练的效果,便于提高检测异常链路的准确率。In a possible example, before inputting the network features into the first model, the method further includes: acquiring an anomaly score value of each unlabeled sample in the first sample set; The abnormal score values of the samples are sorted in descending order to obtain the first ranking; the unlabeled samples corresponding to the first K serial numbers in the first ranking are regarded as the K unlabeled samples. That is to say, the selected samples to be marked are the most abnormal K unmarked samples in the first sample set, and the sample set for training the abnormal link detection model includes samples that may be abnormal, which can improve the effect of model training and facilitate the training of the model. Improve the accuracy of detecting abnormal links.
在一种可能的示例中,该方法还包括:将第一排序中后L个序号对应的未标记样本作为L个未标记样本;从L个未标记样本中选取M个未标记样本。也就是说,选取的未标记样本是第一样本集中最为正常的L个未标记样本中随机选取的M个未标记样本,且该未标记样本作为负样本,则异常链路检测模型进行训练的样本集中新增的样本为正常链路的样本,可避免引入噪声,提高了模型训练的效果,便于提高检测异常链路的准确率。In a possible example, the method further includes: taking the unlabeled samples corresponding to the last L serial numbers in the first sorting as L unlabeled samples; and selecting M unlabeled samples from the L unlabeled samples. That is to say, the selected unlabeled samples are M unlabeled samples randomly selected from the most normal L unlabeled samples in the first sample set, and the unlabeled samples are regarded as negative samples, then the abnormal link detection model is trained The newly added samples in the sample set are samples of normal links, which can avoid introducing noise, improve the effect of model training, and facilitate the accuracy of detecting abnormal links.
在一种可能的示例中,在将网络特征输入至第一模型之前,该方法还包括:获取通信链路的网络拓扑信息;将预先存储的与网络拓扑信息对应的未标记样本和已标记样本组成的集合作为第一样本集。也就是说,选取与通信链路的网络拓扑信息对应的未标记样本和已标记样本作为待选取的用于训练的样本,可提高模型训练的效果,便于提高检测通信链路是否为异常链路的准确率。In a possible example, before the network features are input into the first model, the method further includes: acquiring network topology information of the communication link; storing pre-stored unlabeled samples and labeled samples corresponding to the network topology information The composed set is taken as the first sample set. That is to say, selecting unlabeled samples and labeled samples corresponding to the network topology information of the communication link as the samples to be selected for training can improve the effect of model training and facilitate the detection of whether the communication link is an abnormal link 's accuracy.
第二方面,本申请实施例公开了一种模型训练方法,包括:从第一样本集中选取K个未标记样本;从第一样本集中选取M个作为负样本的未标记样本第一样本集包括选取K个未标记样本和M个未标记样本之前,预先存储的已标记样本和未标记样本;根据第一样本集中的已标记样本、K个已标记样本和M个未标记样本,对上一次训练得到的第二模型进行训练,在训练满足预设条件时得到第一模型,K个已标记样本是K个未标记样本分别进行标记得到的。如此,通过从未标记样本中选取的样本,可以使得模型在训练的过程中学习到未标记样本中正负样本的分布情况。且根据选取得到的样本和现有的标记样本,对上一次训练得到的模型重新进行训练,可进一步提高检测的准确率。In a second aspect, an embodiment of the present application discloses a model training method, comprising: selecting K unlabeled samples from a first sample set; selecting M unlabeled samples as negative samples from the first sample set. This set includes pre-stored labeled samples and unlabeled samples before selecting K unlabeled samples and M unlabeled samples; according to the labeled samples, K labeled samples and M unlabeled samples in the first sample set , the second model obtained from the previous training is trained, and the first model is obtained when the training meets the preset conditions, and the K marked samples are obtained by marking the K unmarked samples respectively. In this way, by selecting samples from unlabeled samples, the model can learn the distribution of positive and negative samples in unlabeled samples during training. In addition, retraining the model obtained from the previous training according to the selected samples and the existing labeled samples can further improve the detection accuracy.
在一种可能的示例中,从第一样本集中选取K个未标记样本包括:获取第一样本集中每一未标记样本的异常评分值;根据第一样本集中每一未标记样本的异常评分值进行降序排列得到第一排序;将第一排序中前K个序号对应的未标记样本作为K个未标记样本。也就是说,选取的待标记样本是第一样本集中最为异常的K个未标记样本,则异常链路检测模型进行训练的样本集中包括可能为异常的样本,可提高模型训练的效果,便于提高检测异常链路的准确率。In a possible example, selecting K unlabeled samples from the first sample set includes: obtaining an anomaly score value of each unlabeled sample in the first sample set; The abnormal score values are sorted in descending order to obtain the first ranking; the unlabeled samples corresponding to the first K serial numbers in the first ranking are regarded as the K unlabeled samples. That is to say, the selected samples to be marked are the most abnormal K unmarked samples in the first sample set, and the sample set for training the abnormal link detection model includes samples that may be abnormal, which can improve the effect of model training and facilitate the training of the model. Improve the accuracy of detecting abnormal links.
在一种可能的示例中,从第一样本集中选取M个作为负样本的未标记样本包括:将第一排序中后L个序号对应的未标记样本作为L个未标记样本;从L个未标记样本中选取M个未标记样本。也就是说,选取的未标记样本是第一样本集中最为正常的L个未标记样本中随机选取的M个未标记样本,且该未标记样本作为负样本,则异常链路检测模型进行训练的样本集中新增的样本是正常链路的样本,可避免引入噪声,提高了模型训练的效果,便于提高检测异常链路的准确率。In a possible example, selecting M unlabeled samples as negative samples from the first sample set includes: taking the unlabeled samples corresponding to the last L serial numbers in the first sorting as L unlabeled samples; M unlabeled samples are selected from the unlabeled samples. That is to say, the selected unlabeled samples are M unlabeled samples randomly selected from the most normal L unlabeled samples in the first sample set, and the unlabeled samples are regarded as negative samples, then the abnormal link detection model is trained The newly added samples in the sample set are samples of normal links, which can avoid introducing noise, improve the effect of model training, and facilitate the accuracy of detecting abnormal links.
在一种可能的示例中,从第一样本集中选取M个作为负样本的未标记样本包括:统计第一样本集中的已标记样本和K个已标记样本中正样本的数量;根据正样本的数量,从第一样本集中选取M个作为负样本的未标记样本,M等于正样本的数量。也就是说,异常链路检测模型进行训练的样本集中新增的负样本的数量与样本集中的正样本的数量相等,相对可达到正负样本平衡,减少了标签噪声,可提高模型训练的效果,便于提高检测异常链路的准确率。在一种可能的示例中,在从第一样本集中选取K个未标记样本之前,该方法 还包括:获取待检测的通信链路的网络拓扑信息;将预先存储的与网络拓扑信息对应的未标记样本和已标记样本组成的集合作为第一样本集。也就是说,选取与通信链路的网络拓扑信息对应的未标记样本和已标记样本作为待选取的用于训练的样本,可提高模型训练的效果,便于提高检测通信链路是否为异常链路的准确率。In a possible example, selecting M unlabeled samples as negative samples from the first sample set includes: counting the labeled samples in the first sample set and the number of positive samples in the K labeled samples; , select M unlabeled samples as negative samples from the first sample set, and M is equal to the number of positive samples. That is to say, the number of new negative samples in the sample set for training the abnormal link detection model is equal to the number of positive samples in the sample set, which can relatively achieve a balance between positive and negative samples, reduce label noise, and improve the effect of model training. , which is convenient to improve the accuracy of detecting abnormal links. In a possible example, before selecting K unmarked samples from the first sample set, the method further includes: acquiring network topology information of the communication link to be detected; storing pre-stored information corresponding to the network topology information The set of unlabeled samples and labeled samples is used as the first sample set. That is to say, selecting unlabeled samples and labeled samples corresponding to the network topology information of the communication link as the samples to be selected for training can improve the effect of model training and facilitate the detection of whether the communication link is an abnormal link 's accuracy.
结合第一方面、第二方面或者任意一种可能的示例,在一种可能的示例中,在获取第一样本集中每一未标记样本的异常评分值之前,该方法还包括:获取第二样本集中每一未标记样本的异常评分值,第二样本集包括选取P个未标记样本之前,预先存储的已标记样本和未标记样本;根据第二样本集中每一未标记样本的异常评分值进行降序排列得到第二排序;将第二排序中前P个序号对应的未标记样本作为P个未标记样本;根据第二样本集中的已标记样本和P个已标记样本构建第三模型,P个已标记样本是对P个未标记样本分别进行标记得到的,第三模型为第一模型和第二模型对应的初始化模型。如此,基于最为异常的P个未标记样本对应的P个已标记样本和现有的已标记样本构建异常链路检测模型的初始化模型,可提高模型训练的效果,便于提高检测异常链路的准确率。With reference to the first aspect, the second aspect or any one possible example, in a possible example, before acquiring the abnormal score value of each unlabeled sample in the first sample set, the method further includes: acquiring a second The abnormal score value of each unlabeled sample in the sample set, the second sample set includes the pre-stored labeled samples and unlabeled samples before selecting P unlabeled samples; according to the abnormal score value of each unlabeled sample in the second sample set Arrange in descending order to obtain a second order; take the unlabeled samples corresponding to the first P serial numbers in the second order as P unlabeled samples; build a third model according to the labeled samples and P labeled samples in the second sample set, P The marked samples are obtained by marking the P unmarked samples respectively, and the third model is an initialization model corresponding to the first model and the second model. In this way, the initialization model of the abnormal link detection model is constructed based on the P marked samples corresponding to the most abnormal P unmarked samples and the existing marked samples, which can improve the effect of model training and improve the accuracy of detecting abnormal links. Rate.
第三方面,本申请实施例公开了一种异常链路检测装置,包括:通信单元用于接收通信链路中至少一个网络节点的网络数据;处理单元用于获取网络数据对应的网络特征;将网络特征输入至第一模型得到通信链路的检测结果,检测结果用于指示通信链路是否为异常链路,第一模型是根据第一样本集中的已标记样本、K个已标记样本和M个未标记样本,对上一次训练得到的第二模型进行训练,在训练满足预设条件时得到的模型,K个已标记样本是对第一样本集中的K个未标记样本分别进行标记得到的,M个未标记样本是从第一样本集中选出来的作为负样本的未标记样本,第一样本集包括选取K个未标记样本和M个未标记样本之前,预先存储的已标记样本和未标记样本。如此,在接收到的通信链路中网络节点的网络数据之后,获取网络数据的网络特征,再将网络特征输入至,通过从未标记样本中选取的样本和现有的标记样本训练得到的异常链路检测模型,从而对该通信链路进行检测,提高了检测异常链路的准确率。In a third aspect, an embodiment of the present application discloses an abnormal link detection device, comprising: a communication unit for receiving network data of at least one network node in a communication link; a processing unit for acquiring network characteristics corresponding to the network data; The network feature is input into the first model to obtain the detection result of the communication link, and the detection result is used to indicate whether the communication link is an abnormal link. The first model is based on the marked samples in the first sample set, K marked samples and M unlabeled samples, the second model obtained from the previous training is trained, and the model obtained when the training meets the preset conditions, the K labeled samples are the K unlabeled samples in the first sample set are labeled respectively It is obtained that the M unlabeled samples are unlabeled samples selected as negative samples from the first sample set, and the first sample set includes the pre-stored pre-stored samples before K unlabeled samples and M unlabeled samples are selected. Labeled and unlabeled samples. In this way, after receiving the network data of the network nodes in the communication link, the network characteristics of the network data are obtained, and then the network characteristics are input to the abnormality obtained by training the samples selected from the unlabeled samples and the existing labeled samples. The link detection model is used to detect the communication link, thereby improving the accuracy of detecting abnormal links.
在一种可能的示例中,处理单元还用于获取第一样本集中每一未标记样本的异常评分值;根据第一样本集中每一未标记样本的异常评分值进行降序排列得到第一排序;将第一排序中前K个序号对应的未标记样本作为K个未标记样本。也就是说,选取的待标记样本是第一样本集中最为异常的K个未标记样本,则异常链路检测模型进行训练的样本集中包括可能为异常的样本,可提高模型训练的效果,便于提高检测异常链路的准确率。In a possible example, the processing unit is further configured to obtain the abnormal score value of each unlabeled sample in the first sample set; and perform descending sorting according to the abnormal score value of each unlabeled sample in the first sample set to obtain the first Sorting; take the unlabeled samples corresponding to the first K serial numbers in the first sorting as the K unlabeled samples. That is to say, the selected samples to be marked are the most abnormal K unmarked samples in the first sample set, and the sample set for training the abnormal link detection model includes samples that may be abnormal, which can improve the effect of model training and facilitate the training of the model. Improve the accuracy of detecting abnormal links.
在一种可能的示例中,处理单元还用于将第一排序中后L个序号对应的未标记样本作为L个未标记样本;从L个未标记样本中选取M个未标记样本。也就是说,选取的未标记样本是第一样本集中最为正常的L个未标记样本中随机选取的M个未标记样本,且该未标记样本作为负样本,则异常链路检测模型进行训练的样本集中新增的样本为正常链路的样本,可避免引入噪声,提高了模型训练的效果,便于提高检测异常链路的准确率。In a possible example, the processing unit is further configured to use the unlabeled samples corresponding to the last L serial numbers in the first sorting as the L unlabeled samples; and select M unlabeled samples from the L unlabeled samples. That is to say, the selected unlabeled samples are M unlabeled samples randomly selected from the most normal L unlabeled samples in the first sample set, and the unlabeled samples are regarded as negative samples, then the abnormal link detection model is trained The newly added samples in the sample set are samples of normal links, which can avoid introducing noise, improve the effect of model training, and facilitate the accuracy of detecting abnormal links.
在一种可能的示例中,处理单元还用于获取第二样本集中每一未标记样本的异常评分值,第二样本集包括选取P个未标记样本之前,预先存储的已标记样本和未标记样本;根据第二样本集中每一未标记样本的异常评分值进行降序排列得到第二排序;将第二排序中前P个序号对应的未标记样本作为P个未标记样本;根据第二样本集中的已标记样本和P 个已标记样本构建第三模型,P个已标记样本是对P个未标记样本分别进行标记得到的,第三模型为第一模型和第二模型对应的初始化模型。如此,基于最为异常的P个未标记样本对应的P个已标记样本和现有的已标记样本构建异常链路检测模型的初始化模型,可提高模型训练的效果,便于提高检测异常链路的准确率。In a possible example, the processing unit is further configured to obtain an abnormal score value of each unlabeled sample in the second sample set, where the second sample set includes pre-stored labeled samples and unlabeled samples before selecting P unlabeled samples sample; perform a descending arrangement according to the abnormal score value of each unlabeled sample in the second sample set to obtain a second ranking; take the unlabeled samples corresponding to the first P serial numbers in the second ranking as P unlabeled samples; according to the second sample set The marked samples and the P marked samples are constructed to construct a third model, the P marked samples are obtained by marking the P unmarked samples respectively, and the third model is the initialization model corresponding to the first model and the second model. In this way, the initialization model of the abnormal link detection model is constructed based on the P marked samples corresponding to the most abnormal P unmarked samples and the existing marked samples, which can improve the effect of model training and improve the accuracy of detecting abnormal links. Rate.
在一种可能的示例中,处理单元还用于获取通信链路的网络拓扑信息;将预先存储的与网络拓扑信息和设备信息对应的未标记样本和已标记样本组成的集合作为第一样本集。也就是说,选取与通信链路的网络拓扑信息对应的未标记样本和已标记样本作为待选取的用于训练的样本,可提高模型训练的效果,便于提高检测通信链路是否为异常链路的准确率。In a possible example, the processing unit is further configured to acquire network topology information of the communication link; a set composed of pre-stored unlabeled samples and labeled samples corresponding to the network topology information and device information is used as the first sample set. That is to say, selecting unlabeled samples and labeled samples corresponding to the network topology information of the communication link as the samples to be selected for training can improve the effect of model training and facilitate the detection of whether the communication link is an abnormal link 's accuracy.
第四方面,本申请实施例公开了一种模型训练装置,包括:选取模块,用于从第一样本集中选取K个未标记样本;以及从第一样本集中选取M个作为负样本的未标记样本,第一样本集包括选取K个未标记样本和M个未标记样本之前,预先存储的已标记样本和未标记样本;训练模块,用于根据第一样本集中的已标记样本、K个已标记样本和M个未标记样本,对上一次训练得到的第二模型进行训练,在训练满足预设条件时得到第一模型,K个已标记样本是对第一样本集中的K个未标记样本分别进行标记得到的。如此,通过从未标记样本中选取的样本,可以使得模型在训练的过程中学习到未标记样本中正负样本的分布情况。且根据选取得到的样本和现有的标记样本,对上一次训练得到的模型重新进行训练,可进一步提高检测的准确率。In a fourth aspect, an embodiment of the present application discloses a model training device, comprising: a selection module for selecting K unlabeled samples from a first sample set; and selecting M samples from the first sample set as negative samples Unlabeled samples, the first sample set includes pre-stored labeled samples and unlabeled samples before selecting K unlabeled samples and M unlabeled samples; a training module, used for according to the labeled samples in the first sample set , K labeled samples and M unlabeled samples, train the second model obtained from the previous training, and obtain the first model when the training meets the preset conditions, and the K labeled samples are for the first sample set. K unlabeled samples are obtained by labeling them respectively. In this way, by selecting samples from unlabeled samples, the model can learn the distribution of positive and negative samples in unlabeled samples during training. In addition, retraining the model obtained from the previous training according to the selected samples and the existing labeled samples can further improve the detection accuracy.
在一种可能的示例中,选取模块具体用于获取第一样本集中每一未标记样本的异常评分值;根据第一样本集中每一未标记样本的异常评分值进行降序排列得到第一排序;将第一排序中前K个序号对应的未标记样本作为K个未标记样本。也就是说,选取的待标记样本是第一样本集中最为异常的K个未标记样本,则异常链路检测模型进行训练的样本集中包括可能为异常的样本,可提高模型训练的效果,便于提高检测异常链路的准确率。In a possible example, the selection module is specifically configured to obtain the abnormal score value of each unlabeled sample in the first sample set; according to the abnormal score value of each unlabeled sample in the first sample set, the abnormal score value of each unlabeled sample is sorted in descending order to obtain the first Sorting; take the unlabeled samples corresponding to the first K serial numbers in the first sorting as the K unlabeled samples. That is to say, the selected samples to be marked are the most abnormal K unmarked samples in the first sample set, and the sample set for training the abnormal link detection model includes samples that may be abnormal, which can improve the effect of model training and facilitate the training of the model. Improve the accuracy of detecting abnormal links.
在一种可能的示例中,选取模块具体用于将第一排序中后L个序号对应的未标记样本作为L个未标记样本;从L个未标记样本中选取M个未标记样本。也就是说,选取的未标记样本是第一样本集中最为正常的L个未标记样本中随机选取的M个未标记样本,且该未标记样本作为负样本,则异常链路检测模型进行训练的样本集中新增的样本是正常链路的样本,可避免引入噪声,提高了模型训练的效果,便于提高检测异常链路的准确率。In a possible example, the selection module is specifically configured to use the unmarked samples corresponding to the last L serial numbers in the first sorting as the L unmarked samples; and select M unmarked samples from the L unmarked samples. That is to say, the selected unlabeled samples are M unlabeled samples randomly selected from the most normal L unlabeled samples in the first sample set, and the unlabeled samples are regarded as negative samples, then the abnormal link detection model is trained The newly added samples in the sample set are samples of normal links, which can avoid introducing noise, improve the effect of model training, and facilitate the accuracy of detecting abnormal links.
在一种可能的示例中,选取模块具体用于统计第一样本集中的已标记样本和K个已标记样本中正样本的数量;根据正样本的数量,从第一样本集中选取M个未标记样本作为负样本,M等于第一样本集中的已标记样本和K个已标记样本中正样本的数量。也就是说,异常链路检测模型进行训练的样本集中新增的负样本的数量与样本集中的正样本的数量相等,相对可达到正负样本平衡,减少了标签噪声,可提高模型训练的效果,便于提高检测异常链路的准确率。In a possible example, the selection module is specifically configured to count the marked samples in the first sample set and the number of positive samples in the K marked samples; according to the number of positive samples, select M unmarked samples from the first sample set The labeled samples are taken as negative samples, and M is equal to the labeled samples in the first sample set and the number of positive samples in the K labeled samples. That is to say, the number of new negative samples in the sample set for training the abnormal link detection model is equal to the number of positive samples in the sample set, which can relatively achieve a balance between positive and negative samples, reduce label noise, and improve the effect of model training. , which is convenient to improve the accuracy of detecting abnormal links.
在一种可能的示例中,选取模块还用于获取第二样本集中每一未标记样本的异常评分值,第二样本集包括选取P个未标记样本之前,预先存储的已标记样本和未标记样本;根据第二样本集中每一未标记样本的异常评分值进行降序排列得到第二排序;将第二排序中前P个序号对应的未标记样本作为P个未标记样本;根据第二样本集中的已标记样本和P 个已标记样本构建第三模型,P个已标记样本是对P个未标记样本分别进行标记得到的,第三模型为第一模型和第二模型对应的初始化模型。如此,基于最为异常的P个未标记样本对应的P个已标记样本和现有的已标记样本构建异常链路检测模型的初始化模型,可提高模型训练的效果,便于提高检测异常链路的准确率。In a possible example, the selection module is further configured to obtain the abnormal score value of each unlabeled sample in the second sample set, where the second sample set includes pre-stored labeled samples and unlabeled samples before selecting P unlabeled samples sample; perform a descending arrangement according to the abnormal score value of each unlabeled sample in the second sample set to obtain a second ranking; take the unlabeled samples corresponding to the first P serial numbers in the second ranking as P unlabeled samples; according to the second sample set The marked samples and the P marked samples are constructed to construct a third model, the P marked samples are obtained by marking the P unmarked samples respectively, and the third model is the initialization model corresponding to the first model and the second model. In this way, the initialization model of the abnormal link detection model is constructed based on the P marked samples corresponding to the most abnormal P unmarked samples and the existing marked samples, which can improve the effect of model training and improve the accuracy of detecting abnormal links. Rate.
在一种可能的示例中,选取模块还用于获取待检测的通信链路的网络拓扑信息;将预先存储的与网络拓扑信息对应的未标记样本和已标记样本组成的集合作为第一样本集。也就是说,选取与通信链路的网络拓扑信息对应的未标记样本和已标记样本作为待选取的用于训练的样本,可提高模型训练的效果,便于提高检测通信链路是否为异常链路的准确率。In a possible example, the selection module is further configured to acquire the network topology information of the communication link to be detected; the pre-stored set of unmarked samples and marked samples corresponding to the network topology information is used as the first sample set. That is to say, selecting unlabeled samples and labeled samples corresponding to the network topology information of the communication link as the samples to be selected for training can improve the effect of model training and facilitate the detection of whether the communication link is an abnormal link 's accuracy.
结合第一方面、第三方面或者任意一种可能的示例,在一种可能的示例中,M等于第一样本集中的已标记样本和K个已标记样本中正样本的数量。如此,异常链路检测模型进行训练的样本集中新增的负样本的数量与样本集中的正样本的数量相等,相对可达到正负样本平衡,减少了标签噪声,可提高模型训练的效果,便于提高检测异常链路的准确率。In combination with the first aspect, the third aspect, or any possible example, in a possible example, M is equal to the number of labeled samples in the first sample set and the number of positive samples in the K labeled samples. In this way, the number of new negative samples in the sample set for training the abnormal link detection model is equal to the number of positive samples in the sample set, which can relatively achieve a balance between positive and negative samples, reduce label noise, improve the effect of model training, and facilitate Improve the accuracy of detecting abnormal links.
结合第一方面、第二方面、第三方面、第四方面或者任意一种可能的示例,在一种可能的示例中,网络数据包括以下至少一项:信噪比、输入信号的电平、误码秒、严重误码秒、不可用时间、网络拓扑信息。如此,通过不同的网络数据进行异常链路检测,可提高检测的多样性。With reference to the first aspect, the second aspect, the third aspect, the fourth aspect or any possible example, in a possible example, the network data includes at least one of the following: a signal-to-noise ratio, a level of an input signal, Errored seconds, severely errored seconds, unavailable time, network topology information. In this way, abnormal link detection is performed through different network data, which can improve the diversity of detection.
第五方面,本申请实施例提供了另一种设备,包括处理器和与处理器连接的存储器和通信接口,存储器用于存储一个或多个程序,并且被配置由处理器执行上述任一方面的步骤,设备包括异常链路检测装置和模型训练装置。In a fifth aspect, an embodiment of the present application provides another device, comprising a processor, a memory connected to the processor, and a communication interface, where the memory is used to store one or more programs and is configured to be executed by the processor in any of the foregoing aspects step, the device includes an abnormal link detection device and a model training device.
第六方面,本申请提供了一种计算机可读存储介质,计算机可读存储介质中存储有指令,当其在计算机上运行时,使得计算机执行上述任一方面的方法。In a sixth aspect, the present application provides a computer-readable storage medium, where instructions are stored in the computer-readable storage medium, which, when executed on a computer, cause the computer to execute the method of any one of the foregoing aspects.
第七方面,本申请提供了一种计算机程序产品,计算机程序产品用于存储计算机程序,当计算机程序在计算机上运行时,使得计算机执行上述任一方面的方法。In a seventh aspect, the present application provides a computer program product, where the computer program product is used to store a computer program, and when the computer program is run on a computer, causes the computer to execute the method of any one of the above-mentioned aspects.
第八方面,本申请提供了一种芯片,包括处理器和存储器,处理器用于从存储器中调用并运行存储器中存储的指令,使得安装有芯片的设备执行上述任一方面的方法。In an eighth aspect, the present application provides a chip, including a processor and a memory, where the processor is configured to call and execute instructions stored in the memory from the memory, so that a device equipped with the chip executes the method of any one of the foregoing aspects.
第九方面,本申请提供了另一种芯片,包括:输入接口、输出接口和处理电路,输入接口、输出接口与处理电路之间通过内部连接通路相连,处理电路用于执行上述任一方面的方法。In a ninth aspect, the present application provides another chip, comprising: an input interface, an output interface and a processing circuit, the input interface, the output interface and the processing circuit are connected through an internal connection path, and the processing circuit is used to perform any one of the above-mentioned aspects. method.
第十方面,本申请提供了另一种芯片,包括:输入接口、输出接口、处理器,可选的,还包括存储器,输入接口、输出接口、处理器以及存储器之间通过内部连接通路相连,处理器用于执行存储器中的代码,当代码被执行时,处理器用于执行上述任一方面中的方法。In a tenth aspect, the present application provides another chip, including: an input interface, an output interface, a processor, and optionally a memory, the input interface, the output interface, the processor, and the memory are connected through an internal connection path, The processor is used to execute code in the memory, and when the code is executed, the processor is used to perform the method of any of the above aspects.
第十一方面,本申请实施例提供一种芯片系统,包括至少一个处理器,存储器和接口电路,存储器、收发器和至少一个处理器通过线路互联,至少一个存储器中存储有计算机程序;计算机程序被处理器执行上述任一方面中的方法。In an eleventh aspect, an embodiment of the present application provides a chip system, including at least one processor, a memory and an interface circuit, the memory, the transceiver and the at least one processor are interconnected through lines, and at least one memory stores a computer program; the computer program A method of any of the above aspects is performed by a processor.
附图说明Description of drawings
图1是本申请实施例提供的一种模型训练方法的流程示意图;1 is a schematic flowchart of a model training method provided by an embodiment of the present application;
图2是本申请实施例提供的一种通信系统的结构示意图;FIG. 2 is a schematic structural diagram of a communication system provided by an embodiment of the present application;
图3是本申请实施例提供的一种检测节点的流程示意图;3 is a schematic flowchart of a detection node provided by an embodiment of the present application;
图4是本申请实施例提供的一种异常链路检测方法的流程示意图;FIG. 4 is a schematic flowchart of an abnormal link detection method provided by an embodiment of the present application;
图5是本申请实施例提供的一种模型训练装置的结构示意图;5 is a schematic structural diagram of a model training device provided by an embodiment of the present application;
图6是本申请实施例提供的一种异常链路检测装置的结构示意图;FIG. 6 is a schematic structural diagram of an abnormal link detection apparatus provided by an embodiment of the present application;
图7是本申请实施例提供的一种设备的结构示意图。FIG. 7 is a schematic structural diagram of a device provided by an embodiment of the present application.
具体实施方式detailed description
在进行本申请实施例的说明时,首先对下面描述中所用到的一些概念进行解释说明。When describing the embodiments of the present application, some concepts used in the following description are first explained.
(1)正常链路和异常链路。(1) Normal link and abnormal link.
正常链路的通信过程中无异常情况发生。异常链路与正常链路相反,异常链路的通信过程中发生了异常情况。异常情况包括通信链路中的一个网络节点与其他的网络节点断开连接,或者可以是网络节点未接收到预接收的信号(或信息),或者可以是网络节点未将待传输的信号发送给待接收的网络节点,或者可以是网络节点将待传输的信号发送给不该接收的网络节点等情况中的至少一项,在此不做限定。There is no abnormal situation in the communication process of the normal link. The abnormal link is the opposite of the normal link. An abnormal situation occurs during the communication process of the abnormal link. Abnormal conditions include a network node in the communication link disconnecting from other network nodes, or it may be that the network node does not receive a pre-received signal (or information), or it may be that the network node does not send the signal to be transmitted to the network node. The network node to be received may be at least one of the situations in which the network node sends the signal to be transmitted to the network node that should not be received, which is not limited herein.
(2)二分类、正样本和负样本。(2) Binary classification, positive samples and negative samples.
二分类表示分类任务中有两个类别,例如,对一张图片进行分类,以确定该图片是不是汽车。正样本包括二分类任务中需要识别出来的类别。负样本与正样本相反,负样本包括二分类任务中不需要识别出来的类别。例如,对一张图片进行分类,以确定该图片中的图像是否属于汽车,则汽车为需要识别出来的类型,汽车的图片可作为正样本,任何不是汽车的图片可作为负样本。在异常链路检测场景中,需要识别出的类别为异常链路的样本。因此,在本申请实施例中,正样本对应异常链路的样本,负样本对应正常链路的样本。Binary classification means that there are two categories in a classification task, for example, classifying a picture to determine whether the picture is a car or not. Positive samples include categories that need to be identified in binary classification tasks. Negative samples are the opposite of positive samples, which include categories that do not need to be identified in binary classification tasks. For example, to classify a picture to determine whether the image in the picture belongs to a car, the car is the type to be identified, the picture of the car can be used as a positive sample, and any picture that is not a car can be used as a negative sample. In the abnormal link detection scenario, the category of the abnormal link needs to be identified. Therefore, in this embodiment of the present application, positive samples correspond to samples of abnormal links, and negative samples correspond to samples of normal links.
(3)离群点和非离群点。(3) Outliers and non-outliers.
离群点是指样本中显著不同于其他数据的样本。非离群点与离群点相反,非离群点是样本中与其他数据相同类型的样本。由于正常数据的数量远大于异常数据的数量,因此,离群点可以理解为异常数据,非离群点可以理解为正常数据。也就是说,在本申请实施例中,离群点可以理解为正样本,非离群点可以理解为负样本。An outlier is a sample that is significantly different from the rest of the data. Non-outliers are the opposite of outliers, which are samples of the same type in the sample as the rest of the data. Since the quantity of normal data is much larger than the quantity of abnormal data, outliers can be understood as abnormal data, and non-outliers can be understood as normal data. That is to say, in the embodiments of the present application, outliers may be understood as positive samples, and non-outliers may be understood as negative samples.
(4)真正类(true positive,TP)样本、假负类(false negative,FN)样本、假正类(false positive,FP)样本和真负类(true negative,TN)样本。(4) True positive (TP) samples, false negative (FN) samples, false positive (FP) samples, and true negative (TN) samples.
真正类样本,实际上为正样本,且二分类模型预测为正样本。假负类样本,实际上为正样本,但二分类模型预测为负样本。假正类样本,实际上为负样本,但二分类模型预测为正样本。真负类样本,实际上为负样本,且二分类模型预测为负样本。The real class sample is actually a positive sample, and the binary classification model predicts it as a positive sample. False negative samples are actually positive samples, but the binary classification model predicts them as negative samples. False positive samples are actually negative samples, but the binary model predicts them as positive samples. The true negative class sample is actually a negative sample, and the two-class model predicts a negative sample.
(5)异常链路检测模型、第一模型和第二模型。(5) An abnormal link detection model, a first model and a second model.
在本申请实施例中,异常链路检测模型用于检测通信链路是否为异常链路。需要说明的是,本申请将异常链路检测模型的初始化模型称为第三模型,将上一次训练得到的异常链路检测模型称为第二模型,将对第二模型进行训练,在训练完成时得到的异常链路检测模型称为第一模型。在第二模型不是第三模型时,第一模型和第二模型的训练方法相同。其中,初始化模型是指构建异常链路检测模型时得到的模型,可以理解为第一次训练得到的模型,第三模型也可以理解为第一模型和第二模型的初始化模型。第三模型的参数可以 理解为异常链路检测模型的初始化参数,构建初始化模型可以理解为获取异常链路检测模型的初始化参数。第二模型的参数可以理解为第一模型的初始化参数,训练第二模型可以理解为更新第二模型的参数,也可以理解为获取第一模型的初始化参数。In this embodiment of the present application, the abnormal link detection model is used to detect whether the communication link is an abnormal link. It should be noted that this application refers to the initialization model of the abnormal link detection model as the third model, and the abnormal link detection model obtained from the previous training is called the second model, and the second model will be trained, and the training will be completed after the training is completed. The abnormal link detection model obtained when , is called the first model. When the second model is not the third model, the training methods of the first model and the second model are the same. The initialization model refers to the model obtained when the abnormal link detection model is constructed, which can be understood as the model obtained by the first training, and the third model can also be understood as the initialization model of the first model and the second model. The parameters of the third model can be understood as the initialization parameters of the abnormal link detection model, and the construction of the initialization model can be understood as obtaining the initialization parameters of the abnormal link detection model. The parameters of the second model can be understood as the initialization parameters of the first model, and the training of the second model can be understood as updating the parameters of the second model, and it can also be understood as acquiring the initialization parameters of the first model.
异常链路检测模型可以是一种神经网络,神经网络可以是由神经单元组成的,神经单元可以是指以x s和截距1为输入的运算单元,该运算单元的输出可以为: The abnormal link detection model can be a neural network. The neural network can be composed of neural units. The neural unit can refer to an operation unit that takes x s and an intercept 1 as inputs. The output of the operation unit can be:
Figure PCTCN2021098011-appb-000001
Figure PCTCN2021098011-appb-000001
其中,s=1、2、……n,n为大于1的自然数,W s为x s的权重,b为神经单元的偏置。f为神经单元的激活函数(activation functions),用于将非线性特性引入神经网络中,来将神经单元中的输入信号转换为输出信号。该激活函数的输出信号可以作为下一层卷积层的输入。激活函数可以是sigmoid函数。神经网络是将许多个上述单一的神经单元联结在一起形成的网络,即一个神经单元的输出可以是另一个神经单元的输入。每个神经单元的输入可以与前一层的局部接受域相连,来提取局部接受域的特征,局部接受域可以是由若干个神经单元组成的区域。若异常链路检测模型为一种神经网络,则异常链路检测模型的参数可以理解为公式(1)中的W s和b。 Among them, s=1, 2, ... n, n is a natural number greater than 1, W s is the weight of x s , and b is the bias of the neural unit. f is an activation function of the neural unit, which is used to introduce nonlinear characteristics into the neural network to convert the input signal in the neural unit into an output signal. The output signal of this activation function can be used as the input of the next convolutional layer. The activation function can be a sigmoid function. A neural network is a network formed by connecting many of the above single neural units together, that is, the output of one neural unit can be the input of another neural unit. The input of each neural unit can be connected with the local receptive field of the previous layer to extract the features of the local receptive field, and the local receptive field can be an area composed of several neural units. If the abnormal link detection model is a neural network, the parameters of the abnormal link detection model can be understood as W s and b in formula (1).
(6)网络数据。(6) Network data.
在本申请实施例中,网络数据包括网络节点的设备信息、性能数据以及网络节点对应的通信链路的网络拓扑信息等,在此不做限定。其中,通信链路的网络拓扑信息用于描述通信链路中各个网络节点之间的连接关系,以及各个网络节点的设备信息。该设备信息用于描述网络节点的硬件参数,例如,设备型号、电压限制大小、电流限制大小、存储容量、传输速率等。网络节点的性能数据可以包括但不限于以下信息中的至少一项:信噪比(signal-to-noise ratio,SNR或S/N)、输入信号的电平(signal level at receiver input,RSL)、误码秒(the number of errored seconds,ES)、严重误码秒(the number of severely errored seconds,SES)、不可用时间(the period of unavailability,UAS)、偏度(skewness)等。In this embodiment of the present application, the network data includes device information and performance data of the network node, and network topology information of the communication link corresponding to the network node, and the like, which is not limited herein. The network topology information of the communication link is used to describe the connection relationship between each network node in the communication link and the device information of each network node. The device information is used to describe hardware parameters of the network node, such as device model, voltage limit size, current limit size, storage capacity, transmission rate, and the like. The performance data of the network node may include but not limited to at least one of the following information: signal-to-noise ratio (signal-to-noise ratio, SNR or S/N), input signal level (signal level at receiver input, RSL) , the number of errored seconds (ES), the number of severely errored seconds (SES), the period of unavailability (UAS), skewness, etc.
信噪比又称为讯噪比,是指一个网络节点或者一个通信链路中信号与噪声的比例。此处的噪声是指经过网络节点产生的原信号中并不存在的无规则的额外信号(或信息),并且该信号并不随原信号的变化而变化。在本申请实施例中,SNR max表示观测期间的最大信噪比,SNR min表示观测期间的最小信噪比。观测期间也可称为观察时间或观察时长等,观测期间可以是预设的一个固定的时长,对于所有的通信链路和所有的网络节点均相同;也可以是每个通信链路和每个网络节点设置的一个不同的时间;也可以是通信链路中用于管理网络节点的网关节点确定的一个动态的时间,也就是说该时间不是某一定值,该时间的确定方式可以是网关节点根据信道质量情况、网络负载情况等确定的,在此不做限定。 Signal-to-noise ratio, also known as signal-to-noise ratio, refers to the ratio of signal to noise in a network node or a communication link. The noise here refers to an irregular additional signal (or information) that does not exist in the original signal generated by the network node, and the signal does not change with the change of the original signal. In this embodiment of the present application, SNR max represents the maximum signal-to-noise ratio during the observation period, and SNR min represents the minimum signal-to-noise ratio during the observation period. The observation period can also be called observation time or observation duration, etc. The observation period can be a preset fixed time period, which is the same for all communication links and all network nodes; it can also be each communication link and each network node. A different time set by the network node; it can also be a dynamic time determined by the gateway node used to manage the network node in the communication link, that is to say, the time is not a certain value, and the time can be determined by the gateway node It is determined according to channel quality conditions, network load conditions, etc., and is not limited here.
输入信号的电平是指网络节点向另一个网络节点发送信号时,两个网络节点之间的功率或电压或电流之比的对数。在本申请实施例中,RSL max表示观测期间内的最大输入信号的电平。 The level of an input signal refers to the logarithm of the ratio of power or voltage or current between two network nodes when a network node sends a signal to another network node. In the embodiment of the present application, RSL max represents the maximum input signal level within the observation period.
误码秒用于描述一秒内出现的误码次数。严重误码秒对应的情况包括在任意一秒的观察期间内的误码率大于一个阈值,或者检测出信号丢失等。在本申请实施例中,ES max表示观测期间的最大误码秒,SES max表示观测期间的最大严重误码秒。 Errored Seconds is used to describe the number of errors in a second. Conditions corresponding to severely errored seconds include that the bit error rate in any one second of observation period is greater than a threshold, or signal loss is detected. In this embodiment of the present application, ES max represents the maximum errored seconds during the observation period, and SES max represents the maximum severely errored seconds during the observation period.
不可用时间是在网络节点产生10个连续的严重误码秒时开始计时,并进行上报,直到连续10秒内每秒的误码秒均不是严重误码秒时结束计时。在本申请实施例中,UAS max表示观测期间的最大不可用时间。 The unavailability time starts when the network node generates 10 consecutive severely errored seconds, and reports it, and ends when the errored seconds per second within 10 consecutive seconds are not severely errored seconds. In this embodiment of the present application, UAS max represents the maximum unavailable time during the observation period.
偏度也称为偏态、偏态系数,是统计数据分布偏斜方向和程度的度量,用于度量随机变量概率分布的不对称性。0说明是最完美的对称性,正态分布的偏态就是0。偏度的计算请参照公式(2)。Skewness, also known as skewness and skewness coefficient, is a measure of the direction and degree of skewness in the distribution of statistical data, and is used to measure the asymmetry of the probability distribution of random variables. 0 means the most perfect symmetry, and the skewness of the normal distribution is 0. Please refer to formula (2) for the calculation of skewness.
Figure PCTCN2021098011-appb-000002
Figure PCTCN2021098011-appb-000002
其中,S表示偏度,i表示第i个数值,n为采样数量,μ为均值,σ为标准差。Among them, S is the skewness, i is the ith value, n is the number of samples, μ is the mean, and σ is the standard deviation.
(7)网络特征。(7) Network features.
在本申请实施例中,网络特征用于描述网络数据对应的性能特征。本申请对于获取网络特征的方法不做限定,可以基于不同维度的网络数据进行统计学分析。在接收到一个网络节点的网络数据时,可根据该网络数据确定该网络节点的网络特征。以网络节点1进行举例说明,可以获取网络节点1在观测期间内的SNR的方差、SNR max、SNR min、RSL的偏度、ES max、SES max、UAS max等。 In this embodiment of the present application, the network feature is used to describe the performance feature corresponding to the network data. The present application does not limit the method for acquiring network features, and statistical analysis can be performed based on network data of different dimensions. When network data of a network node is received, the network characteristics of the network node can be determined according to the network data. Taking network node 1 as an example, the variance of SNR, SNR max , SNR min , skewness of RSL, ES max , SES max , and UAS max of network node 1 during the observation period can be obtained.
在接收到一个通信链路上多个网络节点的网络数据时,可分别获取各个网络节点的网络特征,也可综合各个网络节点的网络数据获取通信链路的网络特征。以网络节点1和网络节点2进行举例说明,网络节点1和网络节点2均为一个通信链路L1上面的网络节点,可分别获取网络节点1和网络节点2在观测期间内的SNR的方差、SNR max、SNR min、RSL的偏度、ES max、SES max、UASmax等;可获取网络节点1和网络节点2之间的SNR max,或SNR max的方差,或SNR max平方差的和;可获取网络节点1和网络节点2之间的SNR min,或SNR min的方差,或SNR min平方差的和;可获取网络节点1和网络节点2之间的RSL max,或RSL max的偏度;获取网络节点1和网络节点2之间的ES max;可获取网络节点1和网络节点2之间的SES max;可获取网络节点1和网络节点2之间的UAS max等。且通信链路的网络特征可以以一条数据进行描述,通信链路L1的网络特征x={网络节点1的SNR的方差,网络节点1的RSL的偏度,网络节点2的SNR的方差,网络节点2的RSL的偏度,网络节点1和网络节点2之间的SNR max的平方差的和,网络节点1和节点2之间的SNR min的平方差的和,网络节点1和网络节点2之间的ES max,网络节点1和网络节点2之间的SES max,网络节点1和网络节点2之间的UAS maxWhen network data of multiple network nodes on a communication link is received, the network characteristics of each network node can be obtained separately, or the network characteristics of the communication link can be obtained by integrating the network data of each network node. Taking network node 1 and network node 2 as an example, network node 1 and network node 2 are both network nodes on a communication link L1, and the variance of the SNR of network node 1 and network node 2 during the observation period, SNR max , SNR min , RSL skewness, ES max , SES max , UAS max , etc.; the SNR max between network node 1 and network node 2 can be obtained, or the variance of SNR max , or the sum of squared differences of SNR max ; Obtain the SNR min between the network node 1 and the network node 2, or the variance of the SNR min , or the sum of the squared differences of the SNR min ; the RSL max between the network node 1 and the network node 2, or the skewness of the RSL max can be obtained; Obtain the ES max between the network node 1 and the network node 2; obtain the SES max between the network node 1 and the network node 2; obtain the UAS max between the network node 1 and the network node 2, etc. And the network characteristics of the communication link can be described by a piece of data, the network characteristics of the communication link L1 x = {the variance of the SNR of the network node 1, the skewness of the RSL of the network node 1, the variance of the SNR of the network node 2, the network Skewness of RSL of node 2, sum of squared differences of SNR max between network node 1 and network node 2, sum of squared differences of SNR min between network node 1 and node 2, network node 1 and network node 2 ES max between network node 1 and network node 2, SES max between network node 1 and network node 2, UAS max between network node 1 and network node 2.
网络特征还可通过网络嵌入方法(Network Embedding)进行获取。网络嵌入方法,旨在学习网络中节点的低维度潜在表示,所学习到的特征表示可以用作基于图的各种任务的特征,例如分类,聚类,链路预测和可视化。其中心思想是找到一种映射函数,该函数将网络中的每个节点转换为低维度的潜在表示。通过网络嵌入方法获取网络节点的网络特征,可提高获取特征的准确率和效率。The network features can also be obtained through the network embedding method (Network Embedding). Network embedding methods, aiming to learn low-dimensional latent representations of nodes in a network, and the learned feature representations can be used as features for various graph-based tasks, such as classification, clustering, link prediction, and visualization. The central idea is to find a mapping function that transforms each node in the network into a low-dimensional latent representation. Obtaining the network features of network nodes through the network embedding method can improve the accuracy and efficiency of obtaining features.
(8)已标记样本、未标记样本、第一样本集和第二样本集。(8) Labeled samples, unlabeled samples, first sample set and second sample set.
在本申请实施例中,已标记样本的数据包括标签,且该标签用于指示已标记样本为正样本还是负样本。未标记样本的数据不包括标签。已标记样本也可称为标记样本,或打标 数据或打标签数据等,未标记样本也可称为未打标数据或未打标签数据等。在本申请实施例中,以已标记样本和未标记样本进行举例说明,已标记样本中的正样本对应异常链路的样本,已标记样本中的负样本对应正常链路的样本。且已标记样本和未标记样本中均可包括网络节点的网络数据,网络数据可参照前文的定义(6),在此不再赘述。In this embodiment of the present application, the data of the labeled samples includes a label, and the label is used to indicate whether the labeled sample is a positive sample or a negative sample. Data for unlabeled samples do not include labels. Labeled samples may also be referred to as labeled samples, or labeled data or labeled data, etc., and unlabeled samples may also be referred to as unlabeled data or untagged data, etc. In the embodiments of the present application, marked samples and unmarked samples are used as examples for illustration, positive samples in the marked samples correspond to samples of abnormal links, and negative samples in the marked samples correspond to samples of normal links. In addition, both the marked samples and the unmarked samples can include network data of the network node, and the network data can refer to the definition (6) above, which will not be repeated here.
在本申请实施例中,第一样本集包括选取用于训练第一模型的样本之前的已标记样本和未标记样本。第二样本集包括选取用于构建第三模型的样本之前的已标记样本和未标记样本。当第一样本集中选取的样本为K个未标记样本和M个未标记样本时,第一样本集可以理解为选取K个未标记样本和M个未标记样本之前,已标记样本和未标记样本组成的集合。当第二样本集中选取的样本为P个未标记样本时,第二样本集可以理解为选取P个未标记样本之前,已标记样本和未标记样本组成的集合。In this embodiment of the present application, the first sample set includes labeled samples and unlabeled samples before samples for training the first model are selected. The second set of samples includes labeled samples and unlabeled samples before the samples selected for building the third model. When the samples selected in the first sample set are K unlabeled samples and M unlabeled samples, the first sample set can be understood as the marked samples and unlabeled samples before the K unlabeled samples and M unlabeled samples are selected. A collection of labeled samples. When the samples selected in the second sample set are P unlabeled samples, the second sample set can be understood as a set composed of labeled samples and unlabeled samples before the P unlabeled samples are selected.
本申请对于第一样本集和第二样本集的选取方法不做限定,可选取全部或部分的样本,部分的样本可以是近段时间获取的样本,或者可以是待检测的通信链路的历史样本,或者可以是与该通信链路同类型的通信链路的历史样本等,在此也不做限定。以第一样本集进行举例说明,第一样本集中的已标记样本和未标记样本的网络拓扑信息与待检测的通信链路的网络拓扑信息一致。其中,待检测的通信链路可以为异常链路检测模型所部署的通信链路。第一样本集中的样本可以是该通信链路的历史样本,也可以是与该通信链路同类型的通信链路的历史样本。可以理解,当选取同样的网络拓扑信息对应的未标记样本和已标记样本作为第一样本集,可提高模型训练的效果,便于提高通信链路的检测的准确率。This application does not limit the selection method of the first sample set and the second sample set, and all or part of the samples may be selected, and some samples may be samples obtained in a recent period, or may be the samples of the communication link to be detected. The historical samples, or the historical samples of the communication link of the same type as the communication link, are not limited here. Taking the first sample set as an example, the network topology information of the marked samples and the unmarked samples in the first sample set is consistent with the network topology information of the communication link to be detected. The communication link to be detected may be the communication link deployed by the abnormal link detection model. The samples in the first sample set may be historical samples of the communication link, or may be historical samples of a communication link of the same type as the communication link. It can be understood that when unlabeled samples and labeled samples corresponding to the same network topology information are selected as the first sample set, the effect of model training can be improved, and the accuracy of communication link detection can be improved.
(9)异常链路检测模型的评价指标。(9) Evaluation index of abnormal link detection model.
在本申请实施例中,异常链路检测模型的评价指标用于评价该异常链路检测模型的检测效果。检测效果(或称效果)越好,可以理解为异常链路检测模型识别出异常链路的评价指标对应的值越大。评价指标可包括精确度(precision,P)、召回率(recall,R)、灵敏度(true positive rate,TPR)、特异度(false positive rate,FPR)、准确率(accuracy)、F1值(F1-score)等,在此不做限定。In the embodiment of the present application, the evaluation index of the abnormal link detection model is used to evaluate the detection effect of the abnormal link detection model. The better the detection effect (or the effect) is, it can be understood that the abnormal link detection model has a larger value corresponding to the evaluation index for identifying the abnormal link. Evaluation indicators can include precision (precision, P), recall (recall, R), sensitivity (true positive rate, TPR), specificity (false positive rate, FPR), accuracy (accuracy), F1 value (F1- score), etc., which are not limited here.
其中,精确度又称为精度,是指被正确分为正样本的数量占所有被分为正样本的比例。召回率是指被正确分为正样本的数量占所有正样本的比例。灵敏度是指被正确识别为正样本的数量占所有正样本的比例。特异度是指被错误识别为正样本的数量占所有负样本的比例。准确率是指被正确分类的数量占所有样本的比例。F1值又称调和平均数,当召回率越大时,预测的覆盖率越高,精确度就会越小,因此可以通过F1值来调和精确度和召回率。精确度P、召回率R、灵敏度TPR、特异度FPR、准确率、F1值的计算,请分别参照公式(3)、公式(4)、公式(5)、公式(6)、公式(7)和公式(8)。Among them, the accuracy, also known as the precision, refers to the proportion of the number of positive samples that are correctly divided into all positive samples. Recall rate refers to the proportion of all positive samples that are correctly classified as positive samples. Sensitivity refers to the proportion of all positive samples that are correctly identified as positive samples. Specificity refers to the proportion of all negative samples that are misidentified as positive samples. Accuracy refers to the proportion of all samples that are correctly classified. The F1 value is also known as the harmonic mean. When the recall rate is larger, the prediction coverage will be higher and the precision will be smaller. Therefore, the F1 value can be used to reconcile the precision and recall rate. For the calculation of precision P, recall rate R, sensitivity TPR, specificity FPR, precision rate, and F1 value, please refer to formula (3), formula (4), formula (5), formula (6), formula (7) and formula (8).
P=TP/(TP+FP)                             (3)P=TP/(TP+FP) (3)
R=TP/(TP+FN)                             (4)R=TP/(TP+FN) (4)
TPR=TP/(TP+FN)                           (5)TPR=TP/(TP+FN) (5)
FPR=FP/(FP+TN)                            (6)FPR=FP/(FP+TN) (6)
acc=(TP+FN)/(TP+FN+FP+TN)                    (7)acc=(TP+FN)/(TP+FN+FP+TN) (7)
F1=(2*P*R)/(P+R)                          (8)F1=(2*P*R)/(P+R) (8)
在以上公式中,acc表示准确率,TP表示真正类样本的数量,FP表示假正类样本的数 量,FN表示假负类样本的数量,TN为真负类样本的数量。当所有正样本的数量等于真正类样本和假负类样本的数量时,召回率和灵敏度相等。In the above formula, acc represents the accuracy rate, TP represents the number of true samples, FP represents the number of false positive samples, FN represents the number of false negative samples, and TN represents the number of true negative samples. Recall and sensitivity are equal when the number of all positive samples is equal to the number of true class samples and false negative class samples.
异常链路检测模型的检测效果还可通过评价指标中的精确度和召回率对应的(precision recall,PR)曲线、特异度和灵敏度对应的受试者工作特征曲线(receiver operating characteristic,ROC)、ROC曲线下面积(ROC area under curve,ROC-AUC)以及PR曲线下面积(PR area under curve,PR-AUC)等确定。其中,PR曲线的横坐标(x)为召回率,纵坐标(y)为精确度。ROC曲线的横坐标(x)为特异度,纵坐标(y)为灵敏度。ROC-AUC的值为ROC曲线与横坐标和纵坐标围成的面积。PR-AUC的值为PR曲线与横坐标和纵坐标围成的面积。ROC曲线越靠左上角,AUC的值越大。AUC的值越大,精确度和召回率就越接近1。精确度和召回率越接近1,模型的检测效果就越理想。The detection effect of the abnormal link detection model can also be evaluated by the precision recall (PR) curve corresponding to the precision and recall rate in the evaluation index, the receiver operating characteristic curve (ROC) corresponding to the specificity and sensitivity, The area under the ROC curve (ROC area under curve, ROC-AUC) and the area under the PR curve (PR area under curve, PR-AUC) were determined. Among them, the abscissa (x) of the PR curve is the recall rate, and the ordinate (y) is the precision. The abscissa (x) of the ROC curve is the specificity, and the ordinate (y) is the sensitivity. The value of ROC-AUC is the area enclosed by the ROC curve and the abscissa and ordinate. The value of PR-AUC is the area enclosed by the PR curve and the abscissa and ordinate. The closer the ROC curve is to the upper left corner, the greater the value of AUC. The larger the value of AUC, the closer the precision and recall are to 1. The closer the precision and recall are to 1, the better the detection performance of the model.
(10)预设条件。(10) Preset conditions.
在本申请实施例中,预设条件用于确定异常链路检测模型是否训练完成,具体用于确定在异常链路检测模型的评价指标达到或超过阈值,或者异常链路检测模型的评价指标难以提升,或者训练次数达到或超过阈值等情况下,确定异常链路检测模型训练完成。若上一次训练得到的异常链路检测模型为第二模型,对第二模型进行训练,则第二模型训练完成时满足的预设条件可以包括但不限于以下信息中的至少一项:第二模型的精确度大于或等于第一阈值;第二模型的召回率大于或等于第二阈值;第二模型的精确度的提升幅度小于或等于第三阈值;第二模型的召回率的提升幅度小于或等于第四阈值;第二模型的训练次数大于或等于第五阈值;第二模型的准确率大于或等于第六阈值;第二模型的准确率的提升幅度小于或等于第七阈值;第二模型的精确度和召回率对应的调和平均数F1值大于或等于第八阈值等。以上阈值均不作限定,第三阈值可以等于第四阈值,为了提高训练效果,本次训练的阈值可等于或大于上一次训练的阈值。In the embodiment of the present application, the preset condition is used to determine whether the training of the abnormal link detection model is completed, and is specifically used to determine that the evaluation index of the abnormal link detection model reaches or exceeds the threshold, or the evaluation index of the abnormal link detection model is difficult to It is determined that the training of the abnormal link detection model is completed when the number of trainings reaches or exceeds the threshold, etc. If the abnormal link detection model obtained in the last training is the second model, and the second model is trained, the preset conditions that are satisfied when the second model training is completed may include, but are not limited to, at least one of the following information: The precision of the model is greater than or equal to the first threshold; the recall rate of the second model is greater than or equal to the second threshold; the improvement of the precision of the second model is less than or equal to the third threshold; the improvement of the recall of the second model is less than or equal to the fourth threshold; the number of training times of the second model is greater than or equal to the fifth threshold; the accuracy of the second model is greater than or equal to the sixth threshold; the improvement of the accuracy of the second model is less than or equal to the seventh threshold; the second The harmonic mean F1 value corresponding to the precision and recall rate of the model is greater than or equal to the eighth threshold, etc. The above thresholds are not limited, and the third threshold may be equal to the fourth threshold. In order to improve the training effect, the threshold of this training may be equal to or greater than the threshold of the previous training.
(11)无监督学习(unsupervised learning)和监督学习(supervised learning)。(11) Unsupervised learning and supervised learning.
无监督学习根据未标记样本解决模式识别中的问题。常用的无监督学习的算法有矩阵分解算法、独孤森林算法(isolation forest)、主成分分析方法(principal components analysis,PCA)、等距映射方法、局部线性嵌入方法、拉普拉斯特征映射方法、黑塞局部线性嵌入方法和局部切空间排列方法等。无监督学习里典型例子是聚类,聚类的目的在于把相似的东西聚在一起,而不关心这一类是什么。Unsupervised learning solves problems in pattern recognition based on unlabeled samples. Commonly used unsupervised learning algorithms include matrix factorization algorithm, solitary forest algorithm (isolation forest), principal component analysis (PCA), isometric mapping method, local linear embedding method, Laplace feature mapping method, Hesse's local linear embedding method and local tangent space arrangement method, etc. A typical example of unsupervised learning is clustering, where the purpose of clustering is to group similar things together without caring what the class is.
监督学习利用已标记样本调整分类器的参数,使其达到所要求性能的过程,也称为监督训练或有教师学习。常见的有监督学习算法:回归分析和统计分类。最典型的算法是k最邻近分类算法(k-Nearest Neighbor,KNN)和支持向量机(support vector machine,SVM)。Supervised learning is the process of using labeled samples to adjust the parameters of a classifier to achieve the required performance, also known as supervised training or learning with a teacher. Common supervised learning algorithms: regression analysis and statistical classification. The most typical algorithms are k-Nearest Neighbor (KNN) and support vector machine (SVM).
下面从模型训练侧和模型应用侧对本申请提供的方法进行描述。The method provided by the present application will be described below from the model training side and the model application side.
本申请实施例提供的异常链路检测模型的训练方法,涉及人工智能技术,具体可以应用于数据训练、机器学习、深度学习等数据处理方法,对训练数据(如本申请实施例中已标记样本的网络节点的网络数据)进行符号化和形式化的智能信息建模、抽取、预处理、训练等,最终得到训练好的异常链路检测模型(如本申请实施例中的第一模型、第二模型);并且,本申请实施例提供的异常链路检测方法可以运用上述训练好的异常链路检测模型(如 本申请实施例中的第一模型),将输入数据(如本申请实施例中的网络特征)输入到该异常链路检测模型中,得到输出数据(如本申请实施例中的通信链路的检测结果)。需要说明的是,本申请实施例提供的异常链路检测模型的训练方法和异常链路检测方法是基于同一个构思产生的发明,也可以理解为一个系统中的两个部分,或一个整体流程的两个阶段:如模型训练阶段和模型应用阶段。The training method of the abnormal link detection model provided by the embodiment of the present application involves artificial intelligence technology, and can be specifically applied to data processing methods such as data training, machine learning, and deep learning. The network data of the network node) is symbolized and formalized for intelligent information modeling, extraction, preprocessing, training, etc., and finally a trained abnormal link detection model (such as the first model in the embodiment of the present application, the first model, the third Two models); and, the abnormal link detection method provided by the embodiment of the present application may use the above-mentioned trained abnormal link detection model (such as the first model in the embodiment of the present application), and input data (such as the embodiment of the present application) The network features in the abnormal link detection model) are input into the abnormal link detection model, and output data (such as the detection result of the communication link in the embodiment of the present application) are obtained. It should be noted that the training method of the abnormal link detection model and the abnormal link detection method provided by the embodiments of the present application are inventions based on the same concept, and can also be understood as two parts in a system, or an overall process two stages: such as model training stage and model application stage.
模型训练阶段包括模型初始化阶段和模型训练阶段。其中,模型训练阶段用于对之前得到的模型进行训练(如本申请实施例中的第一模型)。模型初始化阶段用于构建模型(如本申请实施例中的第三模型),本申请对于异常链路检测模型的初始化方法不做限定,可采用监督学习方法基于已标记样本(如本申请实施例中的第二样本集中的已标记样本)构建异常链路检测模型的初始化模型;或者可先采用无监督学习方法,对未标记样本(如本申请实施例中的第二样本集中的未标记样本)进行分类得到异常链路的未标记样本和正常链路的未标记样本,再对异常链路的未标记样本进行人工标记,与已标记样本(如本申请实施例中的第二样本集中的已标记样本)一起构建异常链路检测模型的初始化模型等。The model training phase includes a model initialization phase and a model training phase. Wherein, the model training stage is used to train the previously obtained model (such as the first model in the embodiment of the present application). The model initialization stage is used to build a model (such as the third model in the embodiment of the present application). This application does not limit the initialization method of the abnormal link detection model, and a supervised learning method can be used based on the marked samples (such as the embodiment of the present application). The labeled samples in the second sample set in the second sample set) to construct the initialization model of the abnormal link detection model; or the unsupervised learning method can be used first, and the unlabeled samples (such as the unlabeled samples in the second sample set in the embodiment of the present application) ) to classify to obtain unmarked samples of abnormal links and unmarked samples of normal links, and then manually mark the unmarked samples of abnormal links, and the marked samples (such as those in the second sample set in the embodiment of the present application) labeled samples) together to build the initialization model of the abnormal link detection model, etc.
在一种可能的示例中,异常链路检测模型的初始化方法包括以下步骤A1-A3,其中:In a possible example, the initialization method of the abnormal link detection model includes the following steps A1-A3, wherein:
A1:获取第二样本集中每一未标记样本的异常评分值。A1: Obtain the abnormal score value of each unlabeled sample in the second sample set.
在本申请实施例中,第三模型为异常链路检测模型的初始化模型。第二样本集包括选取用于构建第三模型的样本之前,预先存储的已标记样本和未标记样本,当第二样本集中选取的样本为P个未标记样本时,第二样本集可以理解为选取P个未标记样本之前,已标记样本和未标记样本组成的集合。In the embodiment of the present application, the third model is an initialization model of the abnormal link detection model. The second sample set includes pre-stored labeled samples and unlabeled samples before the samples used to construct the third model are selected. When the samples selected in the second sample set are P unlabeled samples, the second sample set can be understood as The set of labeled samples and unlabeled samples before selecting P unlabeled samples.
本申请对于第二样本集的选取方法不做限定,可选取全部或部分的样本,部分的样本可以是近段时间获取的样本,或者可以是待检测的通信链路的历史样本,或者可以是与该通信链路同类型的通信链路的历史样本等,在此也不做限定。在一种可能的示例中,第二样本集中的已标记样本和未标记样本的网络拓扑信息与待检测的通信链路的网络拓扑信息一致。其中,待检测的通信链路可以为异常链路检测模型所部署的通信链路。第二样本集中的样本可以是该通信链路的历史样本,也可以是与该通信链路同类型的通信链路的历史样本。可以理解,当选取同样的网络拓扑信息对应的未标记样本和已标记样本作为第二样本集,可提高检测通信链路是否为异常链路的准确率。This application does not limit the selection method of the second sample set, all or part of the samples can be selected, and part of the samples can be samples obtained in a recent period, or can be historical samples of the communication link to be detected, or can be The history samples of the communication link of the same type as the communication link are not limited here. In a possible example, the network topology information of the marked samples and the unmarked samples in the second sample set is consistent with the network topology information of the communication link to be detected. The communication link to be detected may be the communication link deployed by the abnormal link detection model. The samples in the second sample set may be historical samples of the communication link, or may be historical samples of a communication link of the same type as the communication link. It can be understood that when unmarked samples and marked samples corresponding to the same network topology information are selected as the second sample set, the accuracy of detecting whether the communication link is an abnormal link can be improved.
异常评分值用于描述未标记样本对应的通信链路的异常可能性,可通过概率进行描述。本申请对于获取异常评分值的方法不做限定,可以基于无监督学习方法获取;也可选取一个最为异常的已标记样本作为参考样本,将第二样本集中每一未标记样本与该参考样本进行对比,得到各个样本之间的相似值,将该相似值作为异常评分值等。The abnormal score value is used to describe the abnormal possibility of the communication link corresponding to the unlabeled sample, which can be described by probability. This application does not limit the method for obtaining the abnormal score value, which can be obtained based on an unsupervised learning method; or select a most abnormal marked sample as a reference sample, and compare each unmarked sample in the second sample set with the reference sample. By comparison, the similarity value between each sample is obtained, and the similarity value is regarded as an abnormal score value, etc.
本申请对于步骤A1的执行条件不做限定,可以是异常链路检测模型部署于检测节点之后执行的,或者可以是在存储的未标记样本的数量超过一个阈值之后执行的,或者可以是在距离接收的第一个未标记样本的时间超过一个阈值之后执行的等,以上阈值不做限定。This application does not limit the execution conditions of step A1, which may be executed after the abnormal link detection model is deployed on the detection node, or after the number of stored unlabeled samples exceeds a threshold, or it may be executed after the distance Executed after the time of the first unmarked sample received exceeds a threshold, and the above threshold is not limited.
A2:根据第二样本集中每一未标记样本的异常评分值,从第二样本集中选取P个未标记样本。A2: According to the abnormal score value of each unlabeled sample in the second sample set, select P unlabeled samples from the second sample set.
本申请对于P不做限定,P为正整数,可以根据未标记样本的数量和/或已标记样本中正样本的数量和/已标记样本中负样本的数量等进行设置,或者可以根据异常链路检测模型 预先设置的评价指标等进行设置。This application does not limit P, and P is a positive integer, which can be set according to the number of unlabeled samples and/or the number of positive samples in the labeled samples and/or the number of negative samples in the labeled samples, etc., or can be set according to the abnormal link The evaluation indicators that are preset by the detection model are set.
在本申请实施例中,P个未标记样本中任一未标记样本的异常评分值大于或等于第二样本集中除了P个未标记样本之外的任一未标记样本的异常评分值。本申请对于选取P个未标记样本的方法不做限定,可以对第二样本集中的各个未标记样本的异常评分值进行降序排列或升序排列。在降序排列作为第二排序时,可获取第二排序中前P个序号对应的未标记样本。在升序排列时,可获取后P个序号对应的未标记样本。选取P个未标记样本的方法还可先随机选取P个参考未标记样本,再从剩下的未标记样本中逐一与P个参考未标记样本的异常评分值进行对比,从而将该P个参考未标记样本中较小的未标记样本进行替换。需要说明的是,P个未标记样本中可能包括异常评分值相等的未标记样本,第二样本集中除了P个未标记样本之外的未标记样本,也可能与P个未标记样本中的未标记样本的异常评分值相等。P个未标记样本可以理解为第二样本集中最为异常的部分未标记样本。In the embodiment of the present application, the abnormal score value of any unlabeled sample in the P unlabeled samples is greater than or equal to the abnormal score value of any unlabeled sample except the P unlabeled samples in the second sample set. The present application does not limit the method for selecting the P unlabeled samples, and the abnormal score values of each unlabeled sample in the second sample set may be sorted in descending order or ascending order. When the descending order is used as the second order, the unlabeled samples corresponding to the first P serial numbers in the second order can be obtained. In ascending order, the unlabeled samples corresponding to the last P serial numbers can be obtained. The method of selecting P unlabeled samples can also randomly select P reference unlabeled samples, and then compare the abnormal score values of the P reference unlabeled samples from the remaining unlabeled samples one by one, so as to obtain the P reference unlabeled samples. The smaller unlabeled samples among the unlabeled samples are replaced. It should be noted that the P unlabeled samples may include unlabeled samples with equal abnormal score values, and the unlabeled samples other than the P unlabeled samples in the second sample set may also be different from the unlabeled samples in the P unlabeled samples. The anomaly score values for the labeled samples are equal. The P unlabeled samples can be understood as the most abnormal part of the unlabeled samples in the second sample set.
A3:根据第二样本集中的已标记样本和P个已标记样本构建第三模型。A3: Build a third model according to the labeled samples and the P labeled samples in the second sample set.
其中,P个已标记样本是对P个未标记样本分别进行标记得到的。本申请对于P个未标记样本的标记方法不做限定,P个未标记样本可以由人工标记,也可直接作为正样本等。Among them, the P marked samples are obtained by marking the P unmarked samples respectively. This application does not limit the labeling method of the P unlabeled samples, and the P unlabeled samples can be manually labeled, or directly used as positive samples.
本申请对于构建第三模型的方法也不做限定,可采用逻辑回归或者决策树算法对第二样本集中的已标记样本和P个已标记样本中的网络数据和已标记样本的标签进行分类,从而得到异常链路检测模型(即第三模型)的参数。简单来说,异常链路检测模型相当于一个函数,每一个已标记样本的网络数据(或网络数据对应的特征数据)为一个常数,该常数与异常链路检测模型的参数相乘可得到该已标记样本的标签,则可根据第二样本集中的已标记样本和P个已标记样本中每一已标记样本的网络数据和标签进行获取异常链路检测模型的参数。进一步的,可根据梯度下降法(Gradient descent)、牛顿算法(Newton's method)、共轭梯度法(Conjugate gradient)、准牛顿法(Quasi-Newton method)、启发式方法(例如,模拟退火方法、遗传算法、蚁群算法以及粒子群算法等)等方法,对分类得到的参数进行调整,再依据以上方法对上一次得到的参数进行调整,直至确定第二样本集中的已标记样本和P个已标记样本,对异常链路检测模型的初始化训练完成时,将训练完成时的异常链路检测模型的参数作为异常链路检测模型的初始化参数(即第三模型的参数)。This application also does not limit the method of constructing the third model. Logistic regression or decision tree algorithm can be used to classify the labeled samples in the second sample set, the network data in the P labeled samples, and the labels of the labeled samples. Thus, the parameters of the abnormal link detection model (ie, the third model) are obtained. In simple terms, the abnormal link detection model is equivalent to a function, and the network data (or the characteristic data corresponding to the network data) of each marked sample is a constant, which can be obtained by multiplying the constant and the parameters of the abnormal link detection model. The label of the labeled sample, the parameters of the abnormal link detection model can be obtained according to the labeled sample in the second sample set and the network data and label of each labeled sample in the P labeled samples. Further, according to gradient descent method (Gradient descent), Newton's method (Newton's method), conjugate gradient method (Conjugate gradient), Quasi-Newton method (Quasi-Newton method), heuristic method (for example, simulated annealing method, genetic method) algorithm, ant colony algorithm, particle swarm algorithm, etc.), adjust the parameters obtained by classification, and then adjust the parameters obtained last time according to the above methods, until the marked samples and P marked samples in the second sample set are determined. Sample, when the initialization training of the abnormal link detection model is completed, the parameters of the abnormal link detection model when the training is completed are used as the initialization parameters of the abnormal link detection model (ie, the parameters of the third model).
可以理解,在步骤A1-A3中,从第二样本集中选取P个未标记样本作为新的训练数据,且P个未标记样本不是随机选取的,而是根据第二样本集中各个未标记样本的异常评分值选取的最为异常的数据,可减少无效标注的工作量。通过该最为异常的P个未标记样本对应的P个已标记样本和现有的已标记样本构建异常链路检测模型的初始化模型(即第三模型),可提高模型检测异常链路的准确率。It can be understood that, in steps A1-A3, P unlabeled samples are selected from the second sample set as new training data, and the P unlabeled samples are not randomly selected, but are based on the data of each unlabeled sample in the second sample set. The most abnormal data is selected by the abnormal score value, which can reduce the workload of invalid labeling. The initialization model (ie, the third model) of the abnormal link detection model is constructed by using the P marked samples corresponding to the most abnormal P unmarked samples and the existing marked samples, which can improve the accuracy of the model to detect abnormal links .
在获取异常链路检测模型的初始化模型之后,可进入模型训练阶段,每次的训练过程采用的方法相同。本申请对于模型训练的执行条件不做限定,可以是接收到通信链路中网络节点的网络数据之后触发的,或者可以是已接收到或预先存储的未标记样本的数量超过一个阈值,或者可以是与上一次模型训练的时间超过一个阈值,或者可以是长时间未接收到通信链路中网络节点发送的网络数据等,以上阈值和时间长度均不做限定。After the initialization model of the abnormal link detection model is obtained, the model training phase can be entered, and the method used in each training process is the same. This application does not limit the execution conditions of model training, which may be triggered after receiving network data of network nodes in the communication link, or the number of unlabeled samples that have been received or stored in advance exceeds a threshold, or It means that the time from the last model training exceeds a threshold, or it may be that the network data sent by the network node in the communication link has not been received for a long time, and the above threshold and time length are not limited.
本申请对于异常链路检测模型的训练方法不做限定,可基于新增的已标记样本,对上一次训练得到的异常链路检测模型进行训练;或者可先采用无监督学习方法,确定样本集 中的未标记样本中异常链路的未标记样本和正常链路的未标记样本,再对异常链路的未标记样本进行标记,与已标记样本(如本申请实施例中的第一样本集中的已标记样本)一起训练;或者可采用上一次训练得到的异常链路检测模型,选取最为异常的未标记样本,对该未标记样本进行标记之后,与已标记样本一起训练等。This application does not limit the training method of the abnormal link detection model. The abnormal link detection model obtained from the previous training can be trained based on the newly added marked samples; or the unsupervised learning method can be used first to determine the sample set Unmarked samples of abnormal links and unmarked samples of normal links in the unmarked samples of the or the abnormal link detection model obtained from the previous training, select the most abnormal unlabeled sample, mark the unlabeled sample, and train it together with the marked sample, etc.
请参照图1,图1是本申请实施例提出的一种模型训练方法的流程示意图。如图1所示,该方法可由异常链路检测模型或异常链路检测装置或检测节点或终端等设备执行,该方法包括:Please refer to FIG. 1 . FIG. 1 is a schematic flowchart of a model training method proposed by an embodiment of the present application. As shown in FIG. 1 , the method can be executed by an abnormal link detection model or an abnormal link detection device or a detection node or terminal and other equipment, and the method includes:
S102:从第一样本集中选取K个未标记样本。S102: Select K unlabeled samples from the first sample set.
本申请对于K不做限定,K为正整数,可参照P的描述,在此不再赘述。可选的,K和P相等。也就是说,异常链路检测模型在模型初始化阶段和模型训练阶段时,所选取的最为异常的未标记样本的数量相等。可以理解,无论K取何值,都选取了新的未标记样本,基于新的未标记样本训练异常链路检测模型,可实现增量学习,提高了模型训练的效果,便于提高检测异常链路的准确率。This application does not limit K, and K is a positive integer. Reference can be made to the description of P, and details are not repeated here. Optionally, K and P are equal. That is to say, the number of the most abnormal unlabeled samples selected by the abnormal link detection model is equal in the model initialization phase and the model training phase. It can be understood that no matter what the value of K is, new unlabeled samples are selected, and the abnormal link detection model is trained based on the new unlabeled samples, which can realize incremental learning, improve the effect of model training, and facilitate the detection of abnormal links. 's accuracy.
本申请对于选取K个未标记样本的方法不做限定,可以随机选取,也可以选取其中最为异常的K个未标记样本。可以理解,在样本集中随机选取K个未标记样本进行训练,可以让异常链路检测模型在训练的过程中,学习到未标记样本中正负样本的分布情况。由于异常数据较正常数据相比数据较少,随机选取可能造成没有或者很少正样本的情况产生。The present application does not limit the method for selecting K unlabeled samples, which may be randomly selected, or the most abnormal K unlabeled samples may be selected. It can be understood that randomly selecting K unlabeled samples in the sample set for training allows the abnormal link detection model to learn the distribution of positive and negative samples in the unlabeled samples during the training process. Since abnormal data is less than normal data, random selection may result in no or few positive samples.
在一种可能的示例中,步骤S102包括以下步骤B1和步骤B2,其中:In a possible example, step S102 includes the following steps B1 and B2, wherein:
B1:获取第一样本集中每一未标记样本的异常评分值。B1: Obtain the anomaly score value of each unlabeled sample in the first sample set.
其中,异常评分值的获取方法可参照A1的描述,还可基于上一次训练得到的异常检测模型(即第二模型)进行获取等,在此也不做限定。通过上一次训练得到的异常检测模型获取未标记样本的异常评分值,可提高异常评分值的获取效率和准确率。The method for obtaining the abnormal score value may refer to the description of A1, and may also be obtained based on the abnormality detection model (ie, the second model) obtained in the previous training, etc., which is not limited here. Obtaining the abnormal score value of the unlabeled sample through the abnormality detection model obtained by the previous training can improve the efficiency and accuracy of obtaining the abnormal score value.
B2:根据第一样本集中每一未标记样本的异常评分值,从第一样本集中K个未标记样本。B2: According to the abnormal score value of each unlabeled sample in the first sample set, select K unlabeled samples from the first sample set.
在本申请实施例中,K个未标记样本中任一未标记样本的异常评分值大于或等于第一样本集中除了K个未标记样本之外的任一未标记样本的异常评分值。K个未标记样本的获取方法可参照A2的描述,在此不进行赘述。In the embodiment of the present application, the abnormal score value of any unlabeled sample in the K unlabeled samples is greater than or equal to the abnormal score value of any unlabeled sample except the K unlabeled samples in the first sample set. For the acquisition method of the K unlabeled samples, reference may be made to the description of A2, which will not be repeated here.
可以理解,在步骤B1和步骤B2中,从未标记样本中选取的待标记样本是第一样本集中最为异常的K个未标记样本。也就是说,异常链路检测模型的样本集中包括可能为异常的样本,可提高模型训练的效果,便于提高模型检测异常链路的准确率。It can be understood that in step B1 and step B2, the samples to be marked selected from the unmarked samples are the most abnormal K unmarked samples in the first sample set. That is to say, the sample set of the abnormal link detection model includes samples that may be abnormal, which can improve the effect of model training and facilitate the improvement of the accuracy of the model for detecting abnormal links.
S104:从第一样本集中选取M个未标记样本作为负样本。S104: Select M unlabeled samples from the first sample set as negative samples.
本申请对于M不做限定,M为正整数,可参照P的描述,在此不再赘述。在本申请实施例中,M个未标记样本是从第一样本集中选出来的作为负样本的未标记样本,也就是说,M个未标记样本当作正常链路的数据。This application does not limit M, and M is a positive integer. Reference can be made to the description of P, and details are not repeated here. In the embodiment of the present application, the M unlabeled samples are unlabeled samples selected from the first sample set as negative samples, that is, the M unlabeled samples are regarded as normal link data.
本申请对于选取M个未标记样本的方法不做限定,可以随机选取最为正常的M个未标记样本。可以理解,在样本集中随机选取M个未标记样本作为负样本,可以让异常链路检测模型在训练的过程中,学习到未标记样本中正负样本的分布情况。需要说明的是,M个未标记样本应与K个未标记样本不同。The present application does not limit the method for selecting M unlabeled samples, and the most normal M unlabeled samples may be randomly selected. It can be understood that randomly selecting M unlabeled samples as negative samples in the sample set allows the abnormal link detection model to learn the distribution of positive and negative samples in the unlabeled samples during the training process. It should be noted that the M unlabeled samples should be different from the K unlabeled samples.
在一种可能的示例中,步骤S104包括以下两种方式,其中:In a possible example, step S104 includes the following two ways, wherein:
第一种方式,统计第一样本集中的已标记样本和K个已标记样本中正样本的数量;根据正样本的数量,从第一样本集中选取M个未标记样本作为负样本,M等于正样本的数量。The first method is to count the number of labeled samples in the first sample set and the number of positive samples in the K labeled samples; according to the number of positive samples, M unlabeled samples are selected from the first sample set as negative samples, where M is equal to the number of positive samples.
其中,第一样本集中的已标记样本和K个已标记样本中正样本的数量,可以理解为第二模型的样本集中异常链路的样本的数量。也就是说,先统计异常链路检测模型进行训练的样本集中异常链路的样本的数量,再从第一样本集中选取最为正常的未标记样本,且选取的未标记样本的数量等于统计的异常链路的样本的数量。如此,异常链路检测模型进行训练的样本集中新增的负样本的数量与样本集中的正样本的数量相等,相对可达到正负样本平衡,减少了标签噪声,可提高模型训练的效果,便于提高模型检测异常链路的准确率。Wherein, the labeled samples in the first sample set and the number of positive samples in the K labeled samples can be understood as the number of samples of abnormal links in the sample set of the second model. That is to say, first count the number of samples of abnormal links in the sample set trained by the abnormal link detection model, and then select the most normal unlabeled samples from the first sample set, and the number of selected unlabeled samples is equal to the statistical The number of samples of anomalous links. In this way, the number of new negative samples in the sample set trained by the abnormal link detection model is equal to the number of positive samples in the sample set, which can relatively achieve a balance between positive and negative samples, reduce label noise, improve the effect of model training, and facilitate Improve the accuracy of the model to detect abnormal links.
第二种方式,步骤S104包括以下步骤C1-C3,其中:In the second way, step S104 includes the following steps C1-C3, wherein:
C1:获取第一样本集中每一未标记样本的异常评分值。C1: Obtain the anomaly score value of each unlabeled sample in the first sample set.
其中,步骤C1可参照步骤B1的描述,在此不再赘述。For step C1, reference may be made to the description of step B1, which will not be repeated here.
C2:根据第一样本集中每一未标记样本的异常评分值,从第一样本集中选取L个未标记样本。C2: Select L unlabeled samples from the first sample set according to the abnormal score value of each unlabeled sample in the first sample set.
本申请对于L不做限定,L为正整数,可参照P的描述,在此不再赘述。在本申请实施例中,L个未标记样本中任一未标记样本的异常评分值小于或等于第一样本集中除了L个未标记样本之外的任一样本的异常评分值。本申请对于选取L个未标记样本的方法不做限定,可以对第一样本集中的各个未标记样本的异常评分值进行降序排列或升序排列。在降序排列作为第一排序时,可获取第一排序中后L个序号对应的未标记样本。在升序排列时,可获取前L个序号对应的未标记样本。选取L个未标记样本的方法还可先从第一样本集中随机选取L个参考未标记样本,再从剩下的未标记样本中逐一与该L个参考未标记样本的异常评分值进行对比,从而将该L个参考未标记样本中较大的未标记样本进行替换。需要说明的是,L个未标记样本中可能包括异常评分值相等的未标记样本,第一样本集中除了L个未标记样本和K个未标记样本之外的未标记样本,也可能与L个未标记样本中的未标记样本的异常评分值相等。L个未标记样本可以理解为第一样本集中最为正常的部分未标记样本,也可以理解为第一样本集中的非离群点。This application does not limit L, and L is a positive integer. Reference can be made to the description of P, and details are not repeated here. In the embodiment of the present application, the abnormal score value of any unlabeled sample in the L unlabeled samples is less than or equal to the abnormal score value of any sample in the first sample set except for the L unlabeled samples. The present application does not limit the method for selecting L unlabeled samples, and the abnormal score values of each unlabeled sample in the first sample set may be sorted in descending order or ascending order. When the descending order is used as the first order, the unlabeled samples corresponding to the last L serial numbers in the first order can be obtained. In ascending order, the unlabeled samples corresponding to the first L serial numbers can be obtained. The method of selecting L unlabeled samples can also randomly select L reference unlabeled samples from the first sample set, and then compare the abnormal score values of the L reference unlabeled samples from the remaining unlabeled samples one by one. , so as to replace the larger unlabeled sample among the L reference unlabeled samples. It should be noted that the L unlabeled samples may include unlabeled samples with equal abnormal score values, and the unlabeled samples other than the L unlabeled samples and the K unlabeled samples in the first sample set may also be the same as the L unlabeled samples. The anomaly score values of the unlabeled samples among the unlabeled samples are equal. The L unlabeled samples can be understood as the most normal part of the unlabeled samples in the first sample set, and can also be understood as non-outlier points in the first sample set.
C3:从L个未标记样本中选取M个未标记样本。C3: Select M unlabeled samples from L unlabeled samples.
其中,M个未标记样本可以是从L个未标记样本中随机选取的,也可以是近段时间得到的样本,或者可以是该通信链路的历史样本,或者可以是与该通信链路同类型的通信链路的历史样本等,在此不做限定。Among them, the M unmarked samples may be randomly selected from the L unmarked samples, or may be samples obtained in a recent period, or may be historical samples of the communication link, or may be the same as the communication link. Historical samples of the type of communication link, etc., are not limited here.
可以理解,在步骤C1-C3中,根据未标记样本的异常评分值选取的未标记样本是第一样本集中最为正常的L个未标记样本中随机选取的M个未标记样本,且该未标记样本作为负样本。也就是说,异常链路检测模型进行训练的样本集中新增的样本为正常链路的样本,可避免引入噪声,提高了模型训练的效果,便于提高模型检测异常链路的准确率。It can be understood that in steps C1-C3, the unlabeled samples selected according to the abnormal score values of the unlabeled samples are M unlabeled samples randomly selected from the most normal L unlabeled samples in the first sample set, and the unlabeled samples are Label samples as negative samples. That is to say, the newly added samples in the sample set for training the abnormal link detection model are samples of normal links, which can avoid introducing noise, improve the effect of model training, and facilitate the accuracy of the model to detect abnormal links.
需要说明的是,上述的两种方式并不构成对本申请实施例的限定,实际应用中,可结合第一种方式和第二种方式选取M个未标记样本等。It should be noted that the above two manners do not constitute limitations to the embodiments of the present application. In practical applications, M unlabeled samples may be selected in combination with the first manner and the second manner.
S106:根据第一样本集中的已标记样本、K个已标记样本和M个未标记样本,对上一次训练得到的第二模型进行训练,在训练满足预设条件时得到第一模型。S106: Train the second model obtained from the previous training according to the labeled samples, K labeled samples, and M unlabeled samples in the first sample set, and obtain the first model when the training meets the preset condition.
其中,预设条件可参照前文中的定义,在此不再赘述。在一种可能的示例中,预设条件包括以下至少一项:第二模型的精确度大于或等于第一阈值;第二模型的召回率大于或等于第二阈值;精确度的提升幅度小于或等于第三阈值;召回率的提升幅度小于或等于第四阈值;第二模型的训练次数大于或等于第五阈值;第二模型的准确率大于或等于第六阈值;准确率的提升幅度小于或等于第七阈值;精确度和召回率对应的调和平均数大于或等于第八阈值。如此,通过不同的预设条件确定第二模型是否训练完成,可提高训练完成之后的第一模型检测异常链路的准确率。Wherein, the preset conditions may refer to the definitions in the foregoing, which will not be repeated here. In a possible example, the preset conditions include at least one of the following: the accuracy of the second model is greater than or equal to the first threshold; the recall rate of the second model is greater than or equal to the second threshold; the improvement in accuracy is less than or equal to equal to the third threshold; the improvement of recall is less than or equal to the fourth threshold; the number of training times of the second model is greater than or equal to the fifth threshold; the accuracy of the second model is greater than or equal to the sixth threshold; the improvement of accuracy is less than or equal to equal to the seventh threshold; the harmonic mean corresponding to precision and recall is greater than or equal to the eighth threshold. In this way, it is determined whether the training of the second model is completed through different preset conditions, which can improve the accuracy of detecting abnormal links by the first model after the training is completed.
本申请对于对第二模型的训练方法不做限定,可根据梯度下降法、牛顿算法、共轭梯度法、准牛顿法、启发式方法(例如,模拟退火方法、遗传算法、蚁群算法以及粒子群算法等)等方法,对第二模型的参数进行调整。再基于以上方法对上一次得到的第二模型的参数进行调整,直至确定第二模型的训练满足预设条件时,确定训练完成,将训练完成得到的第二模型作为第一模型。This application does not limit the training method of the second model, which can be based on gradient descent method, Newton algorithm, conjugate gradient method, quasi-Newton method, heuristic method (for example, simulated annealing method, genetic algorithm, ant colony algorithm and particle swarm algorithm, etc.) and other methods to adjust the parameters of the second model. Then, based on the above method, the parameters of the second model obtained last time are adjusted until it is determined that the training of the second model meets the preset conditions, and the training is determined to be completed, and the second model obtained after the training is completed is used as the first model.
在图1所描述的方法中,先从第一样本集中选取K个未标记样本,再从第一样本集中选取M个未标记样本作为负样本。在K个未标记样本进行标记之后,将标记得到的K个已标记样本与M个未标记样本以及第一样本集中的已标记样本一起,对上一次训练得到的第二模型进行训练,从而得到训练完成的第一模型。如此,通过从未标记样本中选取的样本,可以使得模型在训练的过程中学习到未标记样本中正负样本的分布情况。且根据选取得到的样本和现有的标记样本,对上一次训练得到的模型重新进行训练,可进一步提高检测的准确率。In the method described in FIG. 1 , K unlabeled samples are first selected from the first sample set, and then M unlabeled samples are selected from the first sample set as negative samples. After the K unlabeled samples are labeled, the K labeled samples obtained from the labeling together with the M unlabeled samples and the labeled samples in the first sample set are used to train the second model obtained from the previous training, so that Get the first model that has been trained. In this way, by selecting samples from unlabeled samples, the model can learn the distribution of positive and negative samples in unlabeled samples during training. In addition, retraining the model obtained from the previous training according to the selected samples and the existing labeled samples can further improve the detection accuracy.
请参见图2,图2是本申请实施例提供的一种通信系统的架构图。如图2所示,该通信系统可包括终端(例如,终端211)、网络节点(例如,网络节点221、网络节点222)、检测节点(例如,检测节点231)和目标设备(例如,网络设备241、应用服务器251)。本申请实施例对于以上设备的数量均不作限定。Referring to FIG. 2, FIG. 2 is an architecture diagram of a communication system provided by an embodiment of the present application. As shown in FIG. 2, the communication system may include a terminal (eg, terminal 211), a network node (eg, network node 221, network node 222), a detection node (eg, detection node 231), and a target device (eg, network device) 241. Application server 251). This embodiment of the present application does not limit the number of the above devices.
本申请实施例中的通信系统可以是支持第四代(fourth generation,4G)接入技术的通信系统,例如,长期演进(long term evolution,LTE)接入技术;或者,该通信系统可以是支持第五代(fifth generation,5G)接入技术通信系统,例如,新无线(new radio,NR)接入技术;或者,该通信系统可以是支持多种无线技术的通信系统,例如,支持LTE技术和NR技术的通信系统;或者该通信系统可以是支持微波通信技术、波分通信技术、光传送网(optical transport network,OTN)技术、无线通信技术、宽窄带技术等。另外,该通信系统可以适用于面向未来的通信技术。The communication system in the embodiments of the present application may be a communication system supporting a fourth generation (4G) access technology, for example, a long term evolution (long term evolution, LTE) access technology; or, the communication system may be a communication system supporting Fifth generation (5G) access technology communication system, for example, new radio (NR) access technology; or, the communication system may be a communication system supporting multiple wireless technologies, for example, supporting LTE technology and NR technology; or the communication system may support microwave communication technology, wavelength division communication technology, optical transport network (OTN) technology, wireless communication technology, broadband and narrowband technology, etc. In addition, the communication system can be adapted to future-oriented communication technologies.
该通信系统也可以应用于其他的通信系统中,例如,C-V2X系统,公共陆地移动网络(public land mobile network,PLMN)、设备到设备(device-to-device,D2D)网络、机器到机器(machine to machine,M2M)网络、物联网(internet of things,IoT)、无线局域网(wireless local area networks,WLAN)或者其他网络等,在此不做限定。The communication system can also be applied to other communication systems, such as C-V2X system, public land mobile network (PLMN), device-to-device (D2D) network, machine-to-machine (machine to machine, M2M) network, Internet of things (Internet of things, IoT), wireless local area network (wireless local area networks, WLAN) or other networks, etc., are not limited here.
在本申请实施例中,终端可通过无线或有线的方式与网络节点连接,再通过网络节点以无线或有线的方式与目标设备连接。终端可以是一种向用户提供语音或者数据连通性的设备,终端可以称为用户设备(user equipment,UE)、移动台(mobile station)、用户单元 (subscriber unit)、站台(station)、终端设备(terminal equipment,TE)等。终端可以为蜂窝电话(cellular phone)、个人数字助理(personal digital assistant,PDA)、无线调制解调器(modem)、手持设备(handheld)、膝上型电脑(laptop computer)、无绳电话(cordless phone)、无线本地环路(wireless local loop,WLL)台、手机(mobile phone)、平板电脑(pad)等。随着无线通信技术的发展,可以接入无线通信网络、可以与无线网络侧进行通信,或者通过无线网络与其它物体进行通信的设备都可以是本申请实施例中的终端。譬如,智能交通中的终端和汽车、智能家居中的家用设备、智能电网中的电力抄表仪器、电压监测仪器、环境监测仪器、智能安全网络中的视频监控仪器、收款机等等。终端可以是静态固定的,或者是移动的。示例性的,如图2所示,终端为手机。In this embodiment of the present application, the terminal may be connected to the network node in a wireless or wired manner, and then connected to the target device via the network node in a wireless or wired manner. A terminal may be a device that provides voice or data connectivity to a user. A terminal may be referred to as a user equipment (UE), a mobile station, a subscriber unit, a station, or a terminal device. (terminal equipment, TE) etc. The terminal may be a cellular phone, a personal digital assistant (PDA), a wireless modem, a handheld, a laptop computer, a cordless phone, a wireless Local loop (wireless local loop, WLL) station, mobile phone (mobile phone), tablet computer (pad), etc. With the development of wireless communication technology, a device that can access a wireless communication network, communicate with a wireless network side, or communicate with other objects through a wireless network can be a terminal in the embodiments of the present application. For example, terminals and cars in intelligent transportation, household equipment in smart homes, power meter reading instruments in smart grids, voltage monitoring instruments, environmental monitoring instruments, video monitoring instruments in smart security networks, cash registers, etc. Terminals can be stationary or mobile. Exemplarily, as shown in FIG. 2 , the terminal is a mobile phone.
本申请实施例中的网络节点用于为终端提供传输服务。网络节点可以作为中继节点(relay node,RN)为终端提供无线回传服务的节点,无线回传服务是指通过无线回传链路提供的数据和/或信令回传服务。一方面,中继节点可以通过接入链路(access link,AL)为终端提供无线接入服务;另一方面,中继节点可以通过一跳或者多跳回传链路(backhaul link,BL)连接到目标设备,从而,中继节点可以实现终端和目标设备之间的数据和/或信令的转发,扩大通信系统的覆盖范围。示例性的,如图2所示,网络节点为中继节点。The network node in the embodiment of the present application is used to provide a transmission service for the terminal. A network node may act as a relay node (relay node, RN) as a node that provides wireless backhaul services for terminals, and wireless backhaul services refer to data and/or signaling backhaul services provided through wireless backhaul links. On the one hand, a relay node can provide wireless access services for terminals through an access link (AL); on the other hand, a relay node can use a one-hop or multi-hop backhaul link (BL) By connecting to the target device, the relay node can realize the forwarding of data and/or signaling between the terminal and the target device, thereby expanding the coverage of the communication system. Exemplarily, as shown in FIG. 2 , the network node is a relay node.
本申请实施例中的目标设备部署在通信链路中,用于为终端提供无线通信功能的装置。目标设备可以为基站、接入点、节点、演进型节点(environment Bureau,eNB)或5G基站(next generation base station,gNB),指在空中接口上通过一个或多个扇区与无线终端进行通信的接入网络中的设备。通过将已接收的空中接口帧转换为网际互连协议(Internet Protocol,IP)分组,基站可以作为无线终端和接入网络的其余部分之间的路由器,接入网络可以包括因特网协议网络。基站还可以对空中接口的属性的管理进行协调。The target device in this embodiment of the present application is deployed in a communication link, and is an apparatus for providing a terminal with a wireless communication function. The target device can be a base station, an access point, a node, an evolved node (environment Bureau, eNB) or a 5G base station (next generation base station, gNB), which refers to communicating with wireless terminals through one or more sectors on the air interface devices in the access network. By converting received air interface frames into Internet Protocol (IP) packets, the base station can act as a router between the wireless terminal and the rest of the access network, which can include an Internet Protocol network. The base station may also coordinate the management of the attributes of the air interface.
目标设备还可以是应用服务器,例如,智能交通系统(intelligent traffic systems,ITS)的服务器,导航应用的服务器,缴费应用的服务器,医疗信息系统的服务器,电子信息档案管理的服务器等,在此不做限定。示例性的,如图2所示,目标设备包括接入网设备和应用服务器。The target device can also be an application server, for example, a server of an intelligent traffic system (ITS), a server of a navigation application, a server of a payment application, a server of a medical information system, a server of electronic information file management, etc. Do limit. Exemplarily, as shown in FIG. 2 , the target device includes an access network device and an application server.
本申请实施例中的检测节点部署在通信链路中,用于监测该通信链路是否为异常链路。该检测节点上可部署异常检测模型,该检测节点可以是通信系统中单独部署的节点,也可以是每一网络节点部署的节点,在此不做限定,可根据通信链路的实际情况进行部署。可以理解,当检测节点是每一网络节点上部署的节点时,只检测一个网络节点,可提高检测的效率。当检测节点是通信系统中单独部署的节点时,检测节点可获取通信链路中任一网络节点的网络数据,从而综合分析整个通信链路,可提高检测的准确率。The detection node in the embodiment of the present application is deployed in the communication link, and is used to monitor whether the communication link is an abnormal link. An anomaly detection model can be deployed on the detection node. The detection node can be a node deployed separately in the communication system or a node deployed by each network node, which is not limited here, and can be deployed according to the actual situation of the communication link . It can be understood that when the detection node is a node deployed on each network node, only one network node is detected, which can improve the detection efficiency. When the detection node is a node deployed separately in the communication system, the detection node can obtain the network data of any network node in the communication link, thereby comprehensively analyzing the entire communication link, which can improve the detection accuracy.
检测节点具体可用于获取通信链路中至少一个网络节点的网络数据;获取该网络数据的网络特征;以及将网络特征输入至异常链路检测模型,得到该通信链路是否为异常链路的检测结果。请参照图3,图3为本申请实施例提供的一种检测节点的结构示意图。如图3所示,检测节点300可包括输入模块301、特征获取模块302、检测训练模块303和输出模块304等。The detection node can be specifically used to obtain network data of at least one network node in the communication link; obtain network characteristics of the network data; and input the network characteristics into the abnormal link detection model to obtain the detection of whether the communication link is an abnormal link result. Please refer to FIG. 3 , which is a schematic structural diagram of a detection node according to an embodiment of the present application. As shown in FIG. 3, the detection node 300 may include an input module 301, a feature acquisition module 302, a detection training module 303, an output module 304, and the like.
其中,输入模块301可用于获取通信链路中至少一个网络节点的网络数据。特征获取模块302可用于获取该网络数据的网络特征。检测训练模块303可用于对网络特征进行检 测,得到该通信链路是否为异常链路的检测结果。检测训练模块303还可用于训练异常链路检测模型。输出模块304可用于输出检测结果。在检测结果为异常链路时,还可由输出模块304进行上报(可上报给预先分配的业务人员,也可上报给系统,由系统分配业务人员等,在此不做限定)。Wherein, the input module 301 can be used to obtain network data of at least one network node in the communication link. The feature obtaining module 302 can be used to obtain network features of the network data. The detection and training module 303 can be used to detect the network characteristics to obtain the detection result of whether the communication link is an abnormal link. The detection training module 303 can also be used to train an abnormal link detection model. The output module 304 can be used to output the detection result. When the detection result is an abnormal link, it can also be reported by the output module 304 (it can be reported to pre-assigned business personnel, or it can be reported to the system, and the system assigns business personnel, etc., which is not limited here).
需要说明的是,本申请提供的异常链路检测模型可应用于任一通信链路中,其他的异常检测的应用场景中,异常检测模型进行训练的样本集中的训练数据可与本申请实施例中的网络数据不同,且训练数据的数据特征也可与本申请实施例中的网络特征不同,选取样本集的方法可采用图1实施例所描述的方法进行选取,并采用图1实施例所描述的训练方法进行训练。It should be noted that the abnormal link detection model provided in this application can be applied to any communication link. In other application scenarios of abnormal detection, the training data in the sample set for training the abnormal detection model can be the same as the embodiment of this application. The network data in the data are different, and the data characteristics of the training data may also be different from the network characteristics in the embodiment of the present application. The method for selecting the sample set can be selected by the method described in the embodiment of FIG. The described training method is used for training.
请参见图4,图4是本申请实施例提供的一种异常链路检测方法的流程示意图。该方法可应用于如图2所描述的任意一种通信网络中,该方法可由异常链路检测模型或异常链路检测装置或检测节点或终端等设备执行,该方法包括但不限于如下步骤:Please refer to FIG. 4. FIG. 4 is a schematic flowchart of an abnormal link detection method provided by an embodiment of the present application. The method can be applied to any communication network as described in FIG. 2, and the method can be performed by an abnormal link detection model or an abnormal link detection device, or a detection node or terminal, etc. The method includes but is not limited to the following steps:
S402:接收通信链路中至少一个网络节点的网络数据。S402: Receive network data of at least one network node in the communication link.
其中,网络数据可包括但不限于网络节点的性能数据以及网络节点对应的通信链路的网络拓扑信息等,在此不做限定。其中,网络拓扑信息用于描述通信链路中各个网络节点之间的连接关系。性能数据可以包括但不限于以下信息中的至少一项:信噪比、输入信号的电平、误码秒、严重误码秒、不可用时间、偏度等,具体可参照前面的定义,在此不再赘述。Wherein, the network data may include but not limited to performance data of network nodes and network topology information of communication links corresponding to the network nodes, etc., which are not limited herein. The network topology information is used to describe the connection relationship between each network node in the communication link. Performance data may include but not limited to at least one of the following information: signal-to-noise ratio, input signal level, errored seconds, severely errored seconds, unavailable time, skewness, etc. This will not be repeated here.
本申请对于步骤S402的执行条件不做限定,可以是网络节点每隔一段时间由网络节点发送的,该时间可以是一个固定的时间,对于所有的网络节点均相同,也可以是每个网络节点对应的一个不同的时间;也可以是异常链路检测模型或异常链路检测装置或检测节点或终端等执行主体确定的一个动态的时间,该时间可以根据信道质量情况、网络负载情况等确定,在此不做限定。该网络节点的网络数据或者可以是在满足一个约束条件时发送的,该约束条件可包括传输新的业务、业务结束或者被停止传输或者无法传输、传输的业务的数量超过一个阈值等。该网络节点的网络数据或者可以是在接收到执行主体所发送的用于获取该网络节点的网络数据的请求之后发送的等。This application does not limit the execution conditions of step S402, which may be sent by the network node at regular intervals. The time may be a fixed time, which is the same for all network nodes, or may be each network node. A different time corresponding to it; it can also be a dynamic time determined by the abnormal link detection model or the abnormal link detection device, or the detection node or terminal, etc. The time can be determined according to the channel quality, network load, etc., This is not limited. The network data of the network node may be sent when a constraint condition is met, and the constraint condition may include the transmission of new services, the termination or suspension of services or the inability to transmit, the number of transmitted services exceeding a threshold, and the like. The network data of the network node may be sent after receiving the request sent by the execution subject for acquiring the network data of the network node, or the like.
S404:获取网络数据对应的网络特征。S404: Obtain network features corresponding to the network data.
其中,网络特征用于描述通信链路的性能特征,可以基于不同维度的网络数据进行统计学分析得到,或者通过网络嵌入方法进行获取等,具体可参照前面的定义,在此不再赘述。Among them, the network characteristics are used to describe the performance characteristics of the communication link, which can be obtained by statistical analysis based on network data of different dimensions, or obtained through a network embedding method.
S406:将网络特征输入至第一模型,得到通信链路的检测结果。S406: Input the network feature into the first model to obtain the detection result of the communication link.
在本申请实施例中,通信链路的检测结果用于指示该通信链路是否为异常链路。第一模型是根据第一样本集中的已标记样本、K个已标记样本和M个未标记样本,对上一次训练得到的第二模型进行训练,在训练满足预设条件时得到的模型,K个已标记样本是对第一样本集中的K个未标记样本分别进行标记得到的,M个未标记样本是从第一样本集中选出来的作为负样本的未标记样本,第一样本集包括选取K个未标记样本和M个未标记样本之前,预先存储的已标记样本和未标记样本。K个未标记样本和M个未标记样本的选取方法,以及第一模型的训练方法可参照图1所描述的方法,在此不再赘述。In this embodiment of the present application, the detection result of the communication link is used to indicate whether the communication link is an abnormal link. The first model is based on the labeled samples, K labeled samples, and M unlabeled samples in the first sample set, training the second model obtained from the previous training, and the model obtained when the training meets the preset conditions, The K labeled samples are obtained by labeling the K unlabeled samples in the first sample set respectively, and the M unlabeled samples are the unlabeled samples selected from the first sample set as negative samples. This set includes pre-stored labeled samples and unlabeled samples before selecting K unlabeled samples and M unlabeled samples. For the selection method of the K unlabeled samples and the M unlabeled samples, and the training method of the first model, reference may be made to the method described in FIG. 1 , which will not be repeated here.
在一种可能的示例中,在步骤S406之前,该方法还包括:获取通信链路的网络拓扑信息;将预先存储的与网络拓扑信息对应的未标记样本和已标记样本组成的集合作为第一样本集。也就是说,选取与通信链路的网络拓扑信息对应的未标记样本和已标记样本作为待选取的用于训练的样本,可提高模型训练的效果,便于提高检测通信链路是否为异常链路的准确率。In a possible example, before step S406, the method further includes: acquiring network topology information of the communication link; using a pre-stored set of unlabeled samples and labeled samples corresponding to the network topology information as the first sample set. That is to say, selecting unlabeled samples and labeled samples corresponding to the network topology information of the communication link as the samples to be selected for training can improve the effect of model training and facilitate the detection of whether the communication link is an abnormal link 's accuracy.
其中,网络拓扑信息可以从步骤S402中接收到的网络节点的网络数据中获取,或者可以从之前获取的通信链路中的网络节点的网络数据中获取,或者可以从预先存储的通信链路的网络拓扑信息中获取等,在此不做限定。Wherein, the network topology information may be obtained from the network data of the network node received in step S402, or may be obtained from the network data of the network nodes in the previously obtained communication link, or may be obtained from the pre-stored data of the communication link. It can be obtained from network topology information, etc., which is not limited here.
在一种可能的示例中,预设条件包括以下至少一项:第二模型的精确度大于或等于第一阈值;第二模型的召回率大于或等于第二阈值;精确度的提升幅度小于或等于第三阈值;召回率的提升幅度小于或等于第四阈值;第二模型的训练次数大于或等于第五阈值;第二模型的准确率大于或等于第六阈值;准确率的提升幅度小于或等于第七阈值;精确度和召回率对应的调和平均数大于或等于第八阈值。如此,通过不同的预设条件确定第二模型是否训练完成,可提高训练完成之后的第一模型检测异常链路的准确率。In a possible example, the preset conditions include at least one of the following: the accuracy of the second model is greater than or equal to the first threshold; the recall rate of the second model is greater than or equal to the second threshold; the improvement in accuracy is less than or equal to equal to the third threshold; the improvement of recall is less than or equal to the fourth threshold; the number of training times of the second model is greater than or equal to the fifth threshold; the accuracy of the second model is greater than or equal to the sixth threshold; the improvement of accuracy is less than or equal to equal to the seventh threshold; the harmonic mean corresponding to precision and recall is greater than or equal to the eighth threshold. In this way, it is determined whether the training of the second model is completed through different preset conditions, which can improve the accuracy of detecting abnormal links by the first model after the training is completed.
在一种可能的示例中,在步骤S406之前,该方法还包括:获取第一样本集中每一未标记样本的异常评分值;根据第一样本集中每一未标记样本的异常评分值进行降序排列得到第一排序;将第一排序中前K个序号对应的未标记样本作为K个未标记样本。也就是说,选取的待标记样本是第一样本集中最为异常的K个未标记样本,则异常链路检测模型进行训练的样本集中包括可能为异常的样本,可提高模型训练的效果,便于提高检测异常链路的准确率。In a possible example, before step S406, the method further includes: acquiring the abnormal score value of each unlabeled sample in the first sample set; Arrange in descending order to obtain the first order; take the unlabeled samples corresponding to the first K serial numbers in the first order as the K unlabeled samples. That is to say, the selected samples to be marked are the most abnormal K unmarked samples in the first sample set, and the sample set for training the abnormal link detection model includes samples that may be abnormal, which can improve the effect of model training and facilitate the training of the model. Improve the accuracy of detecting abnormal links.
在一种可能的示例中,在步骤S406之前,该方法还包括:将第一排序中后L个序号对应的未标记样本作为L个未标记样本;从L个未标记样本中选取M个未标记样本。也就是说,选取的未标记样本是第一样本集中最为正常的L个未标记样本中随机选取的M个未标记样本,且该未标记样本作为负样本,则异常链路检测模型进行训练的样本集中新增的样本为正常链路的样本,可避免引入噪声,提高了模型训练的效果,便于提高检测异常链路的准确率。In a possible example, before step S406, the method further includes: taking the unmarked samples corresponding to the last L serial numbers in the first sorting as the L unmarked samples; selecting M unmarked samples from the L unmarked samples Label samples. That is to say, the selected unlabeled samples are M unlabeled samples randomly selected from the most normal L unlabeled samples in the first sample set, and the unlabeled samples are regarded as negative samples, then the abnormal link detection model is trained The newly added samples in the sample set are samples of normal links, which can avoid introducing noise, improve the effect of model training, and facilitate the accuracy of detecting abnormal links.
在一种可能的示例中,在获取第一样本集中每一未标记样本的异常评分值之前,该方法还包括:获取第二样本集中每一未标记样本的异常评分值,第二样本集包括选取P个未标记样本之前,预先存储的已标记样本和未标记样本;根据第二样本集中每一未标记样本的异常评分值进行降序排列得到第二排序;将第二排序中前P个序号对应的未标记样本作为P个未标记样本;根据第二样本集中的已标记样本和P个已标记样本构建第三模型,P个已标记样本是对P个未标记样本分别进行标记得到的,第三模型为第一模型和第二模型对应的初始化模型。如此,基于最为异常的P个未标记样本对应的P个已标记样本和现有的已标记样本构建异常链路检测模型的初始化模型,可提高模型训练的效果,便于提高检测异常链路的准确率。在一种可能的示例中,M等于第一样本集中的已标记样本和K个已标记样本中正样本的数量。如此,异常链路检测模型进行训练样本集中新增的负样本的数量与样本集中的正样本的数量相等,相对可达到正负样本平衡,减少了标签噪声,可提高检测异常链路的准确率。In a possible example, before acquiring the abnormal score value of each unlabeled sample in the first sample set, the method further includes: acquiring the abnormal score value of each unlabeled sample in the second sample set, and the second sample set Including the pre-stored marked samples and unmarked samples before selecting the P unmarked samples; performing descending sorting according to the abnormal score value of each unmarked sample in the second sample set to obtain the second sorting; The unlabeled samples corresponding to the serial numbers are taken as P unlabeled samples; the third model is constructed according to the labeled samples and P labeled samples in the second sample set, and the P labeled samples are obtained by labeling the P unlabeled samples respectively , and the third model is the initialization model corresponding to the first model and the second model. In this way, the initialization model of the abnormal link detection model is constructed based on the P marked samples corresponding to the most abnormal P unmarked samples and the existing marked samples, which can improve the effect of model training and improve the accuracy of detecting abnormal links. Rate. In one possible example, M is equal to the labeled samples in the first sample set and the number of positive samples in the K labeled samples. In this way, the number of new negative samples in the training sample set of the abnormal link detection model is equal to the number of positive samples in the sample set, which can relatively achieve a balance between positive and negative samples, reduce label noise, and improve the accuracy of detecting abnormal links. .
在图4所描述的方法中,在接收到的通信链路中网络节点的网络数据之后,获取网络数据的网络特征,再将网络特征输入至,通过从未标记样本中选取的样本和现有的标记样本训练得到的异常链路检测模型,从而对该通信链路进行检测,提高了检测异常链路的准确率。In the method described in FIG. 4 , after the network data of the network nodes in the communication link is received, the network characteristics of the network data are obtained, and then the network characteristics are input into, through the samples selected from the unmarked samples and existing The abnormal link detection model obtained by training the marked samples of , so as to detect the communication link and improve the accuracy of detecting abnormal links.
上述详细阐述了本申请实施例的方法,下面提供了本申请实施例的装置。The methods of the embodiments of the present application are described in detail above, and the apparatuses of the embodiments of the present application are provided below.
与图1所示的实施例一致的,请参见图5,图5是本申请实施例提供的一种模型训练装置的结构示意图,该模型训练装置500可以包括选取模块501和训练模型502,其中:Consistent with the embodiment shown in FIG. 1, please refer to FIG. 5. FIG. 5 is a schematic structural diagram of a model training apparatus provided by an embodiment of the present application. The model training apparatus 500 may include a selection module 501 and a training model 502, wherein :
选取模块501用于从第一样本集中选取K个未标记样本;以及从第一样本集中选取M个未标记样本作为负样本,第一样本集包括选取K个未标记样本和M个未标记样本之前,预先存储的已标记样本和未标记样本;The selection module 501 is used to select K unmarked samples from the first sample set; and select M unmarked samples as negative samples from the first sample set, the first sample set includes selecting K unmarked samples and M unmarked samples Pre-stored labeled samples and unlabeled samples before unlabeled samples;
训练模块502用于根据第一样本集中的已标记样本、K个已标记样本和M个未标记样本,对上一次训练得到的第二模型进行训练,在训练满足预设条件时得到第一模型,K个已标记样本是对第一样本集中的K个未标记样本分别进行标记得到的。The training module 502 is configured to train the second model obtained from the previous training according to the marked samples, K marked samples and M unmarked samples in the first sample set, and obtain the first model when the training meets the preset conditions. In the model, the K labeled samples are obtained by labeling the K unlabeled samples in the first sample set respectively.
在一种可能的示例中,选取模块501具体用于获取第一样本集中每一未标记样本的异常评分值;根据第一样本集中每一未标记样本的异常评分值进行降序排列得到第一排序;将第一排序中前K个序号对应的未标记样本作为K个未标记样本。也就是说,选取的待标记样本是第一样本集中最为异常的K个未标记样本,则异常链路检测模型进行训练的样本集中包括可能为异常的样本,可提高模型训练的效果,便于提高检测异常链路的准确率。In a possible example, the selection module 501 is specifically configured to obtain the abnormal score value of each unlabeled sample in the first sample set; and perform descending order according to the abnormal score value of each unlabeled sample in the first sample set to obtain the first sample set. 1st sorting; take the unmarked samples corresponding to the first K serial numbers in the first sorting as K unmarked samples. That is to say, the selected samples to be marked are the most abnormal K unmarked samples in the first sample set, and the sample set for training the abnormal link detection model includes samples that may be abnormal, which can improve the effect of model training and facilitate the training of the model. Improve the accuracy of detecting abnormal links.
在一种可能的示例中,选取模块501具体用于将第一排序中后L个序号对应的未标记样本作为L个未标记样本;从L个未标记样本中选取M个未标记样本。也就是说,选取的未标记样本是第一样本集中最为正常的L个未标记样本中随机选取的M个未标记样本,且该未标记样本作为负样本,则异常链路检测模型进行训练的样本集中新增的样本是正常链路的样本,可避免引入噪声,提高了模型训练的效果,便于提高检测异常链路的准确率。In a possible example, the selection module 501 is specifically configured to use the unmarked samples corresponding to the last L serial numbers in the first sorting as the L unmarked samples; and select M unmarked samples from the L unmarked samples. That is to say, the selected unlabeled samples are M unlabeled samples randomly selected from the most normal L unlabeled samples in the first sample set, and the unlabeled samples are regarded as negative samples, then the abnormal link detection model is trained The newly added samples in the sample set are samples of normal links, which can avoid introducing noise, improve the effect of model training, and facilitate the accuracy of detecting abnormal links.
在一种可能的示例中,选取模块501具体用于统计第一样本集中的已标记样本和K个已标记样本中正样本的数量;根据正样本的数量,从第一样本集中选取M个未标记样本作为负样本,M等于第一样本集中的已标记样本和K个已标记样本中正样本的数量。也就是说,异常链路检测模型进行训练的样本集中新增的负样本的数量与样本集中的正样本的数量相等,相对可达到正负样本平衡,减少了标签噪声,可提高模型训练的效果,便于提高检测异常链路的准确率。In a possible example, the selection module 501 is specifically configured to count the marked samples in the first sample set and the number of positive samples in the K marked samples; according to the number of positive samples, select M samples from the first sample set Unlabeled samples are taken as negative samples, and M is equal to the number of labeled samples in the first sample set and the number of positive samples in the K labeled samples. That is to say, the number of new negative samples in the sample set for training the abnormal link detection model is equal to the number of positive samples in the sample set, which can relatively achieve a balance between positive and negative samples, reduce label noise, and improve the effect of model training. , which is convenient to improve the accuracy of detecting abnormal links.
在一种可能的示例中,选取模块501还用于获取第二样本集中每一未标记样本的异常评分值,第二样本集包括选取P个未标记样本之前,预先存储的已标记样本和未标记样本;根据第二样本集中每一未标记样本的异常评分值进行降序排列得到第二排序;将第二排序中前P个序号对应的未标记样本作为P个未标记样本;根据第二样本集中的已标记样本和P个已标记样本构建第三模型,P个已标记样本是对P个未标记样本分别进行标记得到的,第三模型为第一模型和第二模型对应的初始化模型。如此,基于最为异常的P个未标记样本对应的P个已标记样本和现有的已标记样本构建异常链路检测模型的初始化模型,可提高模型训练的效果,便于提高检测异常链路的准确率。In a possible example, the selection module 501 is further configured to obtain the abnormal score value of each unlabeled sample in the second sample set, where the second sample set includes pre-stored marked samples and unlabeled samples before selecting P unlabeled samples. Mark the samples; perform descending sorting according to the abnormal score value of each unmarked sample in the second sample set to obtain a second ranking; take the unmarked samples corresponding to the first P serial numbers in the second sorting as P unmarked samples; according to the second sample The marked samples in the set and the P marked samples construct a third model, the P marked samples are obtained by marking the P unmarked samples respectively, and the third model is an initialization model corresponding to the first model and the second model. In this way, the initialization model of the abnormal link detection model is constructed based on the P marked samples corresponding to the most abnormal P unmarked samples and the existing marked samples, which can improve the effect of model training and improve the accuracy of detecting abnormal links. Rate.
在一种可能的示例中,网络数据包括以下至少一项:信噪比、输入信号的电平、误码秒、严重误码秒、不可用时间、网络拓扑信息。如此,通过不同的网络数据进行异常链路检测,可提高检测的多样性。In a possible example, the network data includes at least one of the following: signal-to-noise ratio, level of an input signal, errored seconds, severely errored seconds, unavailable time, and network topology information. In this way, abnormal link detection is performed through different network data, which can improve the diversity of detection.
在图5所示的装置中,先从第一样本集中选取K个未标记样本,再从第一样本集中选取M个未标记样本作为负样本。在K个未标记样本进行标记之后,将标记得到的K个已标记样本与M个未标记样本以及第一样本集中的已标记样本一起,对上一次训练得到的第二模型进行训练,从而得到训练完成的第一模型。如此,通过从未标记样本中选取的样本,可以使得模型在训练的过程中学习到未标记样本中正负样本的分布情况。且根据选取得到的样本和现有的标记样本,对上一次训练得到的模型重新进行训练,可进一步提高检测的准确率。In the device shown in FIG. 5 , K unlabeled samples are first selected from the first sample set, and then M unlabeled samples are selected from the first sample set as negative samples. After the K unlabeled samples are labeled, the K labeled samples obtained from the labeling together with the M unlabeled samples and the labeled samples in the first sample set are used to train the second model obtained from the previous training, so that Get the first model that has been trained. In this way, by selecting samples from unlabeled samples, the model can learn the distribution of positive and negative samples in unlabeled samples during training. In addition, retraining the model obtained from the previous training according to the selected samples and the existing labeled samples can further improve the detection accuracy.
与图4所示的实施例一致的,请参见图6,图6是本申请实施例提供的一种异常链路检测装置的结构示意图,该异常链路检测装置600装置可以包括通信单元601和处理单元602,其中:Consistent with the embodiment shown in FIG. 4 , please refer to FIG. 6 . FIG. 6 is a schematic structural diagram of an abnormal link detection apparatus provided by an embodiment of the present application. The abnormal link detection apparatus 600 may include a communication unit 601 and Processing unit 602, wherein:
通信单元601用于接收通信链路中至少一个网络节点的网络数据;The communication unit 601 is configured to receive network data of at least one network node in the communication link;
处理单元602用于获取网络数据对应的网络特征;将网络特征输入至第一模型得到通信链路的检测结果,检测结果用于指示通信链路是否为异常链路,第一模型是根据第一样本集中的已标记样本、K个已标记样本和M个未标记样本,对上一次训练得到的第二模型进行训练,在训练满足预设条件时得到的模型,K个已标记样本是对第一样本集中的K个未标记样本分别进行标记得到的,第一样本集包括选取K个未标记样本和M个未标记样本之前,预先存储的未标记样本和已标记样本。The processing unit 602 is used to obtain the network characteristics corresponding to the network data; the network characteristics are input into the first model to obtain the detection result of the communication link, and the detection result is used to indicate whether the communication link is an abnormal link, and the first model is based on the first model. The labeled samples, K labeled samples, and M unlabeled samples in the sample set are trained on the second model obtained from the previous training, and the model obtained when the training meets the preset conditions, the K labeled samples are correct The K unlabeled samples in the first sample set are respectively marked, and the first sample set includes the unlabeled samples and the labeled samples stored in advance before the K unlabeled samples and the M unlabeled samples are selected.
在一种可能的示例中,处理单元602还用于获取第一样本集中每一未标记样本的异常评分值;根据第一样本集中每一未标记样本的异常评分值进行降序排列得到第一排序;将第一排序中前K个序号对应的未标记样本作为K个未标记样本。也就是说,选取的待标记样本是第一样本集中最为异常的K个未标记样本,则异常链路检测模型进行训练的样本集中包括可能为异常的样本,可提高模型训练的效果,便于提高检测异常链路的准确率。In a possible example, the processing unit 602 is further configured to obtain the abnormal score value of each unlabeled sample in the first sample set; and perform descending order according to the abnormal score value of each unlabeled sample in the first sample set to obtain the first sample set. 1st sorting; take the unmarked samples corresponding to the first K serial numbers in the first sorting as K unmarked samples. That is to say, the selected samples to be marked are the most abnormal K unmarked samples in the first sample set, and the sample set for training the abnormal link detection model includes samples that may be abnormal, which can improve the effect of model training and facilitate the training of the model. Improve the accuracy of detecting abnormal links.
在一种可能的示例中,处理单元602还用于将第一排序中后L个序号对应的未标记样本作为L个未标记样本;从L个未标记样本中选取M个未标记样本。也就是说,选取的未标记样本是第一样本集中最为正常的L个未标记样本中随机选取的M个未标记样本,且该未标记样本作为负样本,则异常链路检测模型进行训练的样本集中新增的样本为正常链路的样本,可避免引入噪声,提高了模型训练的效果,便于提高检测异常链路的准确率。In a possible example, the processing unit 602 is further configured to use the unlabeled samples corresponding to the last L serial numbers in the first sorting as the L unlabeled samples; and select M unlabeled samples from the L unlabeled samples. That is to say, the selected unlabeled samples are M unlabeled samples randomly selected from the most normal L unlabeled samples in the first sample set, and the unlabeled samples are regarded as negative samples, then the abnormal link detection model is trained The newly added samples in the sample set are samples of normal links, which can avoid introducing noise, improve the effect of model training, and facilitate the accuracy of detecting abnormal links.
在一种可能的示例中,处理单元602还用于获取第二样本集中每一未标记样本的异常评分值,第二样本集包括选取P个未标记样本之前,预先存储的已标记样本和未标记样本;根据第二样本集中每一未标记样本的异常评分值进行降序排列得到第二排序;将第二排序中前P个序号对应的未标记样本作为P个未标记样本;根据第二样本集中的已标记样本和P个已标记样本构建第三模型,P个已标记样本是对P个未标记样本分别进行标记得到的,第三模型为第一模型和第二模型对应的初始化模型。如此,基于最为异常的P个未标记样本对应的P个已标记样本和现有的已标记样本构建异常链路检测模型的初始化模型,可提 高模型训练的效果,便于提高检测异常链路的准确率。In a possible example, the processing unit 602 is further configured to obtain an abnormal score value of each unlabeled sample in the second sample set, where the second sample set includes pre-stored labeled samples and unlabeled samples before selecting the P unlabeled samples. Mark the samples; perform descending sorting according to the abnormal score value of each unmarked sample in the second sample set to obtain a second ranking; take the unmarked samples corresponding to the first P serial numbers in the second sorting as P unmarked samples; according to the second sample The marked samples in the set and the P marked samples construct a third model, the P marked samples are obtained by marking the P unmarked samples respectively, and the third model is an initialization model corresponding to the first model and the second model. In this way, the initialization model of the abnormal link detection model is constructed based on the P marked samples corresponding to the most abnormal P unmarked samples and the existing marked samples, which can improve the effect of model training and improve the accuracy of detecting abnormal links. Rate.
在一种可能的示例中,M等于第一样本集中的已标记样本和K个已标记样本中正样本的数量。如此,异常链路检测模型进行训练的样本集中新增的负样本的数量与样本集中的正样本的数量相等,相对可达到正负样本平衡,减少了标签噪声,可提高模型训练的效果,便于提高检测异常链路的准确率。In one possible example, M is equal to the labeled samples in the first sample set and the number of positive samples in the K labeled samples. In this way, the number of new negative samples in the sample set for training the abnormal link detection model is equal to the number of positive samples in the sample set, which can relatively achieve a balance between positive and negative samples, reduce label noise, improve the effect of model training, and facilitate Improve the accuracy of detecting abnormal links.
在一种可能的示例中,处理单元602还用于获取通信链路的网络拓扑信息;将预先存储的与网络拓扑信息和设备信息对应的未标记样本和已标记样本组成的集合作为第一样本集。也就是说,选取与通信链路的网络拓扑信息对应的未标记样本和已标记样本作为待选取的用于训练的样本,可提高模型训练的效果,便于提高检测通信链路是否为异常链路的准确率。In a possible example, the processing unit 602 is further configured to acquire network topology information of the communication link; the pre-stored set of unmarked samples and marked samples corresponding to the network topology information and device information is taken as the first sample this episode. That is to say, selecting unlabeled samples and labeled samples corresponding to the network topology information of the communication link as the samples to be selected for training can improve the effect of model training and facilitate the detection of whether the communication link is an abnormal link 's accuracy.
在一种可能的示例中,网络数据包括以下至少一项:信噪比、输入信号的电平、误码秒、严重误码秒、不可用时间、网络拓扑信息。如此,通过不同的网络数据进行异常链路检测,可提高检测的多样性。In a possible example, the network data includes at least one of the following: signal-to-noise ratio, level of an input signal, errored seconds, severely errored seconds, unavailable time, and network topology information. In this way, abnormal link detection is performed through different network data, which can improve the diversity of detection.
在图6所描述的装置中,在接收到的通信链路中网络节点的网络数据之后,获取网络数据的网络特征,再通过从未标记样本中选取的样本和现有的标记样本训练得到的异常链路检测模型,对该通信链路进行检测,提高了检测的准确率。In the device described in FIG. 6 , after receiving the network data of the network nodes in the communication link, the network characteristics of the network data are obtained, and then the network characteristics of the network data are obtained by training the samples selected from the unlabeled samples and the existing labeled samples. The abnormal link detection model detects the communication link and improves the detection accuracy.
请参见图7,图7是本申请实施例提供的一种设备700,该设备700包括处理器701、存储器702和通信接口703,处理器701、存储器702和通信接口703通过总线704相互连接。Referring to FIG. 7 , FIG. 7 is a device 700 provided by an embodiment of the present application. The device 700 includes a processor 701 , a memory 702 and a communication interface 703 , and the processor 701 , the memory 702 and the communication interface 703 are connected to each other through a bus 704 .
存储器702包括但不限于是随机存储记忆体(random access memory,RAM)、只读存储器(read-only memory,ROM)、可擦除可编程只读存储器(erasable programmable read only memory,EPROM)、或便携式只读存储器(compact disc read-only memory,CD-ROM),该存储器702用于相关计算机程序及数据。通信接口703用于接收和发送数据。The memory 702 includes, but is not limited to, random access memory (RAM), read-only memory (ROM), erasable programmable read only memory (EPROM), or A portable read-only memory (compact disc read-only memory, CD-ROM), the memory 702 is used for related computer programs and data. The communication interface 703 is used to receive and transmit data.
处理器701可以是具有处理功能的装置,可以包括一个或者多个处理器。处理器可以是通用处理器或者专用处理器等。处理器可以是基带处理器、或中央处理器。基带处理器可以用于对通信协议以及通信数据进行处理,中央处理器可以用于对通信装置进行控制,执行软件程序,处理软件程序的数据。The processor 701 may be a device with processing functions, and may include one or more processors. The processor may be a general-purpose processor or a special-purpose processor, or the like. The processor may be a baseband processor, or a central processing unit. The baseband processor can be used to process the communication protocol and communication data, and the central processing unit can be used to control the communication device, execute the software program, and process the data of the software program.
该设备700中的处理器701用于读取所述存储器702中存储的计算机程序代码,在本申请实施例中,该设备700可以包括异常链路检测装置,或者为模型训练装置,或者为检测节点或其它的任意一种可能的装置。The processor 701 in the device 700 is configured to read the computer program code stored in the memory 702. In this embodiment of the present application, the device 700 may include an abnormal link detection device, or a model training device, or a detection device node or any other possible device.
当设备700为模型训练装置或检测节点时,处理器701用于执行以下操作:When the device 700 is a model training device or a detection node, the processor 701 is configured to perform the following operations:
从第一样本集中选取K个未标记样本;Select K unlabeled samples from the first sample set;
从第一样本集中选取M个未标记样本作为负样本;Select M unlabeled samples from the first sample set as negative samples;
根据第一样本集中的已标记样本、K个已标记样本和M个未标记样本,对上一次训练得到的第二模型进行训练,在训练满足预设条件时得到第一模型,K个已标记样本是对第一样本集中的K个未标记样本分别进行标记得到的,第一样本集包括选取K个未标记样本和M个未标记样本之前,预先存储的已标记样本和未标记样本。According to the labeled samples, K labeled samples, and M unlabeled samples in the first sample set, the second model obtained from the previous training is trained, and the first model is obtained when the training meets the preset conditions, and the K labeled samples are The labeled samples are obtained by labeling the K unlabeled samples in the first sample set respectively. The first sample set includes the pre-stored labeled samples and unlabeled samples before selecting K unlabeled samples and M unlabeled samples. sample.
在一种可能的示例中,处理器701具体用于执行以下操作:In a possible example, the processor 701 is specifically configured to perform the following operations:
获取第一样本集中每一未标记样本的异常评分值;Obtain the abnormal score value of each unlabeled sample in the first sample set;
根据第一样本集中每一未标记样本的异常评分值进行降序排列得到第一排序;The first sorting is obtained by performing descending sorting according to the abnormal score value of each unlabeled sample in the first sample set;
将第一排序中前K个序号对应的未标记样本作为K个未标记样本。The unlabeled samples corresponding to the first K serial numbers in the first sorting are regarded as K unlabeled samples.
在一种可能的示例中,处理器701具体用于执行以下操作:In a possible example, the processor 701 is specifically configured to perform the following operations:
将第一排序中后L个序号对应的未标记样本作为L个未标记样本;Taking the unlabeled samples corresponding to the last L serial numbers in the first sorting as the L unlabeled samples;
从L个未标记样本中选取M个未标记样本。Pick M unlabeled samples from L unlabeled samples.
在一种可能的示例中,处理器701具体用于执行以下操作:In a possible example, the processor 701 is specifically configured to perform the following operations:
统计第一样本集中的已标记样本和K个已标记样本中正样本的数量;Count the labeled samples in the first sample set and the number of positive samples in the K labeled samples;
根据正样本的数量,从第一样本集中选取M个未标记样本作为负样本,M等于正样本的数量。According to the number of positive samples, M unlabeled samples are selected from the first sample set as negative samples, where M is equal to the number of positive samples.
在一种可能的示例中,从第一样本集中选取K个未标记样本之前,处理器701还用于执行以下操作:In a possible example, before selecting K unlabeled samples from the first sample set, the processor 701 is further configured to perform the following operations:
获取待检测的通信链路的网络拓扑信息;Obtain the network topology information of the communication link to be detected;
将预先存储的与网络拓扑信息对应的未标记样本和已标记样本组成的集合作为第一样本集。当设备700为异常链路检测装置时,处理器701用于执行以下操作:A pre-stored set of unlabeled samples and labeled samples corresponding to the network topology information is used as the first sample set. When the device 700 is an abnormal link detection apparatus, the processor 701 is configured to perform the following operations:
接收通信链路中至少一个网络节点的网络数据;receiving network data for at least one network node in the communication link;
获取网络数据对应的网络特征;Obtain network features corresponding to network data;
将网络特征输入至第一模型得到通信链路的检测结果,检测结果用于指示通信链路是否为异常链路,第一模型是根据第一样本集中的已标记样本、K个已标记样本和M个未标记样本,对上一次训练得到的第二模型进行训练,在训练满足预设条件时得到的模型,K个已标记样本是对第一样本集中的K个未标记样本分别进行标记得到的,M个未标记样本是从第一样本集中选出来的作为负样本的未标记样本,第一样本集包括选取K个未标记样本和M个未标记样本之前,预先存储的已标记样本和未标记样本。Input the network feature into the first model to obtain the detection result of the communication link. The detection result is used to indicate whether the communication link is an abnormal link. The first model is based on the marked samples and K marked samples in the first sample set. and M unlabeled samples, the second model obtained from the previous training is trained, and the model obtained when the training meets the preset conditions, the K labeled samples are performed on the K unlabeled samples in the first sample set respectively. The M unlabeled samples are the unlabeled samples selected as negative samples from the first sample set. The first sample set includes the pre-stored samples before selecting K unlabeled samples and M unlabeled samples. Labeled and unlabeled samples.
在一种可能的示例中,在将网络特征输入至第一模型之前,处理器701还用于执行以下操作:In a possible example, before inputting the network features into the first model, the processor 701 is further configured to perform the following operations:
获取第一样本集中每一未标记样本的异常评分值;Obtain the abnormal score value of each unlabeled sample in the first sample set;
根据第一样本集中每一未标记样本的异常评分值进行降序排列得到第一排序;The first sorting is obtained by performing descending sorting according to the abnormal score value of each unlabeled sample in the first sample set;
将第一排序中前K个序号对应的未标记样本作为K个未标记样本。The unlabeled samples corresponding to the first K serial numbers in the first sorting are regarded as K unlabeled samples.
在一种可能的示例中,处理器701还用于执行以下操作:In a possible example, the processor 701 is further configured to perform the following operations:
将第一排序中后L个序号对应的未标记样本作为L个未标记样本;Taking the unlabeled samples corresponding to the last L serial numbers in the first sorting as the L unlabeled samples;
从L个未标记样本中选取M个未标记样本。Pick M unlabeled samples from L unlabeled samples.
在一种可能的示例中,M等于第一样本集中的已标记样本和K个已标记样本中正样本的数量。In one possible example, M is equal to the labeled samples in the first sample set and the number of positive samples in the K labeled samples.
在一种可能的示例中,在将网络特征输入至第一模型之前,处理器701还用于执行以下操作:In a possible example, before inputting the network features into the first model, the processor 701 is further configured to perform the following operations:
获取通信链路的网络拓扑信息;Obtain the network topology information of the communication link;
将预先存储的与网络拓扑信息对应的未标记样本和已标记样本组成的集合作为第一样 本集。The pre-stored set of unlabeled samples and labeled samples corresponding to the network topology information is taken as the first sample set.
当该设备700可以包括异常链路检测装置,或者为模型训练装置,或者为检测节点或其它的任意一种可能的装置时,在一种可能的示例中,在获取第一样本集中每一未标记样本的异常评分值之前,处理器701还用于执行以下操作:When the apparatus 700 may include an abnormal link detection device, or a model training device, or a detection node or any other possible device, in a possible example, in the first sample set obtained, each Before the abnormal score value of the unlabeled sample, the processor 701 is further configured to perform the following operations:
获取第二样本集中每一未标记样本的异常评分值,第二样本集包括选取P个未标记样本之前,预先存储的已标记样本和未标记样本;Acquiring the abnormal score value of each unlabeled sample in the second sample set, where the second sample set includes pre-stored labeled samples and unlabeled samples before selecting the P unlabeled samples;
根据第二样本集中每一未标记样本的异常评分值进行降序排列得到第二排序;The second sorting is obtained by performing descending sorting according to the abnormal score value of each unlabeled sample in the second sample set;
将第二排序中前P个序号对应的未标记样本作为P个未标记样本;Taking the unlabeled samples corresponding to the first P serial numbers in the second sorting as P unlabeled samples;
根据第二样本集中的已标记样本和P个已标记样本构建第三模型,P个已标记样本是对P个未标记样本分别进行标记得到的,第三模型为第一模型和第二模型对应的初始化模型。A third model is constructed according to the marked samples and P marked samples in the second sample set. The P marked samples are obtained by marking the P unmarked samples respectively, and the third model corresponds to the first model and the second model. initialized model.
在一种可能的示例中,网络数据包括以下至少一项:信噪比、输入信号的电平、误码秒、严重误码秒、不可用时间、网络拓扑信息。In a possible example, the network data includes at least one of the following: signal-to-noise ratio, level of an input signal, errored seconds, severely errored seconds, unavailable time, and network topology information.
需要说明的是,各个操作的实现还可以对应参照图1和图4所示的方法实施例的相应描述。It should be noted that, the implementation of each operation may also correspond to the corresponding description with reference to the method embodiments shown in FIG. 1 and FIG. 4 .
本申请实施例还提供了一种芯片,包括处理器和存储器,处理器用于从存储器中调用并运行存储器中存储的指令,使得安装有芯片的设备执行图1和图4所示的任一方法。An embodiment of the present application further provides a chip, including a processor and a memory, where the processor is used to call and run instructions stored in the memory from the memory, so that a device with the chip installed executes any of the methods shown in FIG. 1 and FIG. 4 . .
本申请实施例还提供了另一种芯片,包括:输入接口、输出接口和处理电路,输入接口、输出接口与处理电路之间通过内部连接通路相连,处理电路用于执行图1和图4所示的任一方法。The embodiment of the present application also provides another chip, including: an input interface, an output interface, and a processing circuit. The input interface, the output interface, and the processing circuit are connected through an internal connection path. any method shown.
本申请实施例还提供了另一种芯片,包括:输入接口、输出接口、处理器,可选的,还包括存储器,输入接口、输出接口、处理器以及存储器之间通过内部连接通路相连,处理器用于执行存储器中的代码,当代码被执行时,处理器用于执行图1和图4所示的任一方法。The embodiment of the present application also provides another chip, including: an input interface, an output interface, a processor, and optionally, a memory. The input interface, the output interface, the processor, and the memory are connected through an internal connection path, and the processing The processor is used to execute code in the memory, and when the code is executed, the processor is used to perform any of the methods shown in FIGS. 1 and 4 .
本申请实施例还提供一种芯片系统,包括至少一个处理器,存储器和接口电路,存储器、收发器和至少一个处理器通过线路互联,至少一个存储器中存储有计算机程序;计算机程序被处理器执行时,图1和图4所示的方法流程得以实现。The embodiments of the present application further provide a chip system, including at least one processor, a memory and an interface circuit, the memory, the transceiver and the at least one processor are interconnected by lines, and at least one memory stores a computer program; the computer program is executed by the processor , the method flow shown in FIG. 1 and FIG. 4 is realized.
本申请实施例还提供一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机程序,当其在计算机上运行时,图1和图4所示的方法流程得以实现。Embodiments of the present application further provide a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when the computer program runs on a computer, the method flows shown in FIG. 1 and FIG. 4 are implemented.
本申请实施例还提供一种计算机程序产品,当所述计算机程序产品在计算机上运行时,图1和图4所示的方法流程得以实现。Embodiments of the present application further provide a computer program product, and when the computer program product runs on a computer, the method flows shown in FIG. 1 and FIG. 4 are implemented.
综上所述,通过实施本申请实施例,先根据从未标记样本中选取的样本和现有的标记样本,对上一次训练得到的第二模型进行训练得到第一模型。在接收到的通信链路中网络节点的网络数据之后,获取网络数据的网络特征,再将该网络特征输入至第一模型,得到该通信链路是否为异常链路的检测结果,提高了检测的准确率。To sum up, by implementing the embodiments of the present application, the first model is obtained by first training the second model obtained from the previous training according to the samples selected from the unlabeled samples and the existing labeled samples. After receiving the network data of the network nodes in the communication link, the network characteristics of the network data are obtained, and then the network characteristics are input into the first model to obtain the detection result of whether the communication link is an abnormal link, which improves the detection performance. 's accuracy.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,该流程可以由计算机程序来计算机程序相关的硬件完成,该计算机程序可存储于计算机可读取存储介 质中,该计算机程序在执行时,可包括如上述各方法实施例的流程。而前述的存储介质包括:ROM或随机存储记忆体RAM、磁碟或者光盘等各种可存储计算机程序代码的介质。Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be implemented, and the process can be completed by a computer program or computer program-related hardware, and the computer program can be stored in a computer-readable storage medium. During execution, the processes of the foregoing method embodiments may be included. The aforementioned storage medium includes: ROM or random storage memory RAM, magnetic disk or optical disk and other mediums that can store computer program codes.

Claims (10)

  1. 一种异常链路检测方法,其特征在于,包括:A method for detecting abnormal links, comprising:
    接收通信链路中至少一个网络节点的网络数据;receiving network data for at least one network node in the communication link;
    获取所述网络数据对应的网络特征;acquiring network features corresponding to the network data;
    将所述网络特征输入至第一模型,得到所述通信链路的检测结果,所述检测结果用于指示所述通信链路是否为异常链路,所述第一模型是根据第一样本集中的已标记样本、K个已标记样本和M个未标记样本,对上一次训练得到的第二模型进行训练,在训练满足预设条件时得到的模型,所述K个已标记样本是对所述第一样本集中的K个未标记样本分别进行标记得到的,所述M个未标记样本是从所述第一样本集中选出来的作为负样本的未标记样本,所述第一样本集包括选取所述K个未标记样本和所述M个未标记样本之前,预先存储的已标记样本和未标记样本。Inputting the network characteristics into a first model to obtain a detection result of the communication link, where the detection result is used to indicate whether the communication link is an abnormal link, and the first model is based on a first sample The labeled samples, K labeled samples, and M unlabeled samples in the set are trained on the second model obtained from the previous training, and the model obtained when the training meets the preset conditions, the K labeled samples are pairs of The K unlabeled samples in the first sample set are obtained by marking them respectively, and the M unlabeled samples are unlabeled samples selected from the first sample set as negative samples. The sample set includes pre-stored labeled samples and unlabeled samples before the K unlabeled samples and the M unlabeled samples are selected.
  2. 根据权利要求1所述的方法,其特征在于,在所述将所述网络特征输入至第一模型之前,所述方法还包括:The method according to claim 1, wherein before the inputting the network feature into the first model, the method further comprises:
    获取所述第一样本集中每一未标记样本的异常评分值;obtaining the abnormal score value of each unlabeled sample in the first sample set;
    根据所述第一样本集中每一未标记样本的异常评分值进行降序排列,得到第一排序;Arrange in descending order according to the abnormal score value of each unlabeled sample in the first sample set to obtain the first order;
    将所述第一排序中前K个序号对应的未标记样本作为所述K个未标记样本。The unlabeled samples corresponding to the first K sequence numbers in the first sorting are used as the K unlabeled samples.
  3. 根据权利要求2所述的方法,其特征在于,所述方法还包括:The method according to claim 2, wherein the method further comprises:
    将所述第一排序中后L个序号对应的未标记样本作为L个未标记样本;Taking the unlabeled samples corresponding to the last L serial numbers in the first sorting as the L unlabeled samples;
    从所述L个未标记样本中选取所述M个未标记样本。The M unlabeled samples are selected from the L unlabeled samples.
  4. 根据权利要求1-3中任一项所述的方法,其特征在于,所述M等于所述第一样本集中的已标记样本和所述K个已标记样本中正样本的数量。The method according to any one of claims 1-3, wherein the M is equal to the labeled samples in the first sample set and the number of positive samples in the K labeled samples.
  5. 根据权利要求2-4中任一项所述的方法,其特征在于,在所述获取所述第一样本集中每一未标记样本的异常评分值之前,所述方法还包括:The method according to any one of claims 2-4, characterized in that before acquiring the abnormal score value of each unlabeled sample in the first sample set, the method further comprises:
    获取第二样本集中每一未标记样本的异常评分值,所述第二样本集包括选取P个未标记样本之前,预先存储的已标记样本和未标记样本;obtaining an abnormal score value of each unlabeled sample in a second sample set, where the second sample set includes pre-stored labeled samples and unlabeled samples before selecting P unlabeled samples;
    根据所述第二样本集中每一未标记样本的异常评分值进行降序排列,得到第二排序;Arrange in descending order according to the abnormal score value of each unlabeled sample in the second sample set to obtain the second order;
    将所述第二排序中前P个序号对应的未标记样本作为所述P个未标记样本;Taking the unlabeled samples corresponding to the first P serial numbers in the second sorting as the P unlabeled samples;
    根据所述第二样本集中的已标记样本和P个已标记样本构建第三模型,所述P个已标记样本是对所述P个未标记样本分别进行标记得到的,所述第三模型为所述第一模型和所述第二模型对应的初始化模型。A third model is constructed according to the marked samples in the second sample set and P marked samples, the P marked samples are obtained by marking the P unmarked samples respectively, and the third model is Initialization models corresponding to the first model and the second model.
  6. 根据权利要求1-5中任一项所述的方法,其特征在于,在所述将所述网络特征输入至第一模型之前,所述方法还包括:The method according to any one of claims 1-5, wherein before the inputting the network feature into the first model, the method further comprises:
    获取所述通信链路的网络拓扑信息;obtaining network topology information of the communication link;
    将预先存储的与所述网络拓扑信息对应的未标记样本和已标记样本组成的集合作为所述第一样本集。A pre-stored set of unlabeled samples and labeled samples corresponding to the network topology information is used as the first sample set.
  7. 根据权利要求1-6中任一项所述的方法,其特征在于,所述网络数据包括以下至少一项:信噪比、输入信号的电平、误码秒、严重误码秒、不可用时间、偏度、网络拓扑信 息。The method according to any one of claims 1-6, wherein the network data includes at least one of the following: signal-to-noise ratio, level of an input signal, errored seconds, severely errored seconds, unavailable Time, skewness, network topology information.
  8. 一种异常链路检测装置,其特征在于,包括:An abnormal link detection device, characterized in that it includes:
    通信单元,用于接收通信链路中至少一个网络节点的网络数据;a communication unit for receiving network data of at least one network node in the communication link;
    处理单元,用于获取所述网络数据对应的网络特征;将所述网络特征输入至第一模型,得到所述通信链路的检测结果,所述检测结果用于指示所述通信链路是否为异常链路,所述第一模型是根据第一样本集中的已标记样本、K个已标记样本和M个未标记样本,对上一次训练得到的第二模型进行训练,在训练满足预设条件时得到的模型,所述K个已标记样本是对所述第一样本集中的K个未标记样本分别进行标记得到的,所述M个未标记样本是从所述第一样本集中选出来的作为负样本的未标记样本,所述第一样本集包括选取所述K个未标记样本和所述M个未标记样本之前,预先存储的已标记样本和未标记样本。a processing unit, configured to obtain network characteristics corresponding to the network data; input the network characteristics into the first model to obtain a detection result of the communication link, where the detection result is used to indicate whether the communication link is a Abnormal link, the first model is to train the second model obtained from the previous training according to the marked samples, K marked samples and M unmarked samples in the first sample set. condition, the K labeled samples are obtained by labeling the K unlabeled samples in the first sample set, and the M unlabeled samples are obtained from the first sample set The selected unlabeled samples as negative samples, the first sample set includes pre-stored labeled samples and unlabeled samples before selecting the K unlabeled samples and the M unlabeled samples.
  9. 一种设备,其特征在于,包括处理器和与所述处理器连接的存储器和通信接口,其中,所述存储器用于存储一个或多个程序,并且被配置由所述处理器执行,所述程序包括用于执行如权利要求1-7中任一项所述的方法中的步骤的指令。An apparatus comprising a processor and a memory and a communication interface connected to the processor, wherein the memory is used to store one or more programs and is configured to be executed by the processor, the The program includes instructions for performing steps in the method of any of claims 1-7.
  10. 一种计算机存储介质,其特征在于,包括计算机指令,当所述计算机指令在终端上运行时,使得所述终端执行如权利要求1-7任一项所述的执行命令的方法。A computer storage medium, characterized by comprising computer instructions, when the computer instructions are executed on a terminal, the terminal is made to execute the method for executing a command according to any one of claims 1-7.
PCT/CN2021/098011 2020-09-17 2021-06-02 Method and apparatus for detecting anomalous link, and storage medium WO2022057321A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010981945.1 2020-09-17
CN202010981945.1A CN114205245A (en) 2020-09-17 2020-09-17 Abnormal link detection method, device and storage medium

Publications (1)

Publication Number Publication Date
WO2022057321A1 true WO2022057321A1 (en) 2022-03-24

Family

ID=80644877

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/098011 WO2022057321A1 (en) 2020-09-17 2021-06-02 Method and apparatus for detecting anomalous link, and storage medium

Country Status (2)

Country Link
CN (1) CN114205245A (en)
WO (1) WO2022057321A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114793205A (en) * 2022-04-25 2022-07-26 咪咕文化科技有限公司 Abnormal link detection method, device, equipment and storage medium
CN115102736A (en) * 2022-06-15 2022-09-23 天津市国瑞数码安全系统股份有限公司 Network security assessment method and system based on pattern recognition
CN115296984A (en) * 2022-08-08 2022-11-04 中国电信股份有限公司 Method, device, equipment and storage medium for detecting abnormal network nodes

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116132330A (en) * 2022-07-12 2023-05-16 马上消费金融股份有限公司 Network detection method, network detection model training method and device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120284791A1 (en) * 2011-05-06 2012-11-08 The Penn State Research Foundation Robust anomaly detection and regularized domain adaptation of classifiers with application to internet packet-flows
CN110933102A (en) * 2019-12-11 2020-03-27 支付宝(杭州)信息技术有限公司 Abnormal flow detection model training method and device based on semi-supervised learning
CN111585997A (en) * 2020-04-27 2020-08-25 国家计算机网络与信息安全管理中心 Network flow abnormity detection method based on small amount of labeled data

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120284791A1 (en) * 2011-05-06 2012-11-08 The Penn State Research Foundation Robust anomaly detection and regularized domain adaptation of classifiers with application to internet packet-flows
CN110933102A (en) * 2019-12-11 2020-03-27 支付宝(杭州)信息技术有限公司 Abnormal flow detection model training method and device based on semi-supervised learning
CN111585997A (en) * 2020-04-27 2020-08-25 国家计算机网络与信息安全管理中心 Network flow abnormity detection method based on small amount of labeled data

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114793205A (en) * 2022-04-25 2022-07-26 咪咕文化科技有限公司 Abnormal link detection method, device, equipment and storage medium
CN115102736A (en) * 2022-06-15 2022-09-23 天津市国瑞数码安全系统股份有限公司 Network security assessment method and system based on pattern recognition
CN115102736B (en) * 2022-06-15 2024-04-26 天津市国瑞数码安全系统股份有限公司 Method and system for evaluating network security based on pattern recognition
CN115296984A (en) * 2022-08-08 2022-11-04 中国电信股份有限公司 Method, device, equipment and storage medium for detecting abnormal network nodes
CN115296984B (en) * 2022-08-08 2023-12-19 中国电信股份有限公司 Abnormal network node detection method and device, equipment and storage medium

Also Published As

Publication number Publication date
CN114205245A (en) 2022-03-18

Similar Documents

Publication Publication Date Title
WO2022057321A1 (en) Method and apparatus for detecting anomalous link, and storage medium
US20210306201A1 (en) Network system fault resolution via a machine learning model
CN110324170B (en) Data analysis equipment, multi-model co-decision system and method
CN110380888A (en) A kind of network anomaly detection method and device
CN113709779B (en) Cellular network fault diagnosis method
CN103716123A (en) Method and system for identifying packet loss and error causes in sensor network
US9936409B2 (en) Analyzing and classifying signaling sets or calls
CN112243249A (en) LTE new access anchor point cell parameter configuration method and device under 5G NSA networking
WO2023029654A1 (en) Fault root cause determination method and device, and storage medium and electronic device
EP2120181A1 (en) A sensor node, a sensor network and a method for autonomous decision-making in sensor networks
CN113676357B (en) Decision method for edge data processing in power internet of things and application thereof
US20220172054A1 (en) Intermediate network node and method performed therein for handling data of communication networks
US20230262489A1 (en) Apparatuses and methods for collaborative learning
CN115660538B (en) Cargo transportation method and system
EP4156631A1 (en) Reinforcement learning (rl) and graph neural network (gnn)-based resource management for wireless access networks
CN111291078A (en) Domain name matching detection method and device
Cerar et al. Learning to fairly classify the quality of wireless links
US11528196B2 (en) Systems and methods for generating a cognitive analytics hub and predictive actions from distributed data models
WO2023041992A1 (en) Systems and methods for performing root cause analysis
Faramondi et al. Distributed c-means clustering via broadcast-only token passing
WO2022079724A1 (en) First node, and method performed thereby, for handling one or more categories of data
US20240129801A1 (en) Systems and methods for determining, monitoring, and predicting application capacity in multiple radio access networks
WO2023245620A1 (en) Handover failure cause classification
EP3783925B1 (en) Determination of indoor/outdoor in mobile networks using deep learning
Apolónia et al. Buildings Occupancy Estimation: Preliminary Results Using Bluetooth Signals and Artificial Neural Networks

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21868157

Country of ref document: EP

Kind code of ref document: A1