Traffic warning method based on Transformer and federated learning
By adopting methods based on Transformer and federated learning in the field of network communications, distributed training of the central early warning model solves the problem of central server computing burden and private data participation, and achieves efficient and safe traffic anomaly monitoring.
Patent Information
- Application Number
- CN202210485501.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-06
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2042-05-06
AI Technical Summary
Existing data-driven traffic anomaly monitoring methods cause excessive computational burden and load pressure on the central server, and due to privacy protection reasons, the network parameters of some nodes are not convenient for participating in model construction.
Using methods based on Transformer and federated learning, each base station ACS collects historical network parameters of CPE equipment, builds a traffic anomaly monitoring data set, and uses federated learning to train the central early warning model distributed between the central server and the base station ACS, reducing the burden on the central server. data transmission and computational burden.
It effectively ensures the data security of CPE equipment, reduces the computing burden of the central server, and improves the model training speed and generalization performance.
Smart Images

Figure CN114745253B
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of network communications, and in particular relates to a traffic early warning method based on Transformer and federated learning. Background Art
[0002] With the rapid development of computer technology, information network has become an important guarantee for social development. With the continuous improvement of the development of network society and the increasing popularity of network applications, while the network brings convenience to people, people's demand for network quality has also increased rapidly, thus putting forward higher requirements for network operation and maintenance.
[0003] CWMP (CPE WAN Management Protocol) is the terminal WAN management protocol, also known as the user-side WAN management protocol. Since the TR069 document defines the framework of the protocol, it is also called the TR069 protocol. The CWMP protocol framework mainly consists of two parts, namely the ACS server (Auto-Configuration Server) and the CPE device (Customer Premises Equipment). The ACS server, as the management end of the CWMP protocol, manages the CPE device through the CWMP protocol. The CPE device is a one-to-many relationship. One ACS server can manage thousands of CPE devices. The ACS server can centrally manage CPE devices scattered in various places, realizing remote centralized management of CPE devices.
[0004] With the rapid development of big data technology and artificial intelligence technology, data-driven traffic anomaly monitoring or early warning methods are widely used in the network quality monitoring tasks of distributed network clusters. This type of method usually uses the ACS server to collect the network parameters of each CPE device, and then summarizes them in the central server to build an anomaly monitoring model, and finally distributes the obtained monitoring model to each ACS server, thereby monitoring and warning the network quality of each CPE device. However, this type of method has the following shortcomings: on the one hand, the massive amount of data summarized brings huge computing burden and load pressure to the central server, and the construction of the anomaly monitoring model often takes a lot of time; on the other hand, based on network security and privacy protection, the network parameters of some nodes or devices are not convenient for network transmission or participation in summary calculations. Summary of the invention
[0005] In view of the deficiencies in the prior art, the present invention provides a traffic warning method based on Transformer and federated learning, which realizes network monitoring of distributed clusters through a federated learning method, and solves the problem that privacy data of distributed clusters is inconvenient to participate in the construction of a central server model due to the different local network services.
[0006] To achieve the above object, the present invention adopts the following technical solutions:
[0007] A traffic warning method based on Transformer and federated learning includes the following steps:
[0008] S1. Each base station ACS collects historical network parameters of each CPE device within its management range, builds a traffic anomaly monitoring data set and stores it in the monitoring database of the base station ACS;
[0009] S2. Build a central early warning model in the central server and initialize the model parameters;
[0010] S3, the central server transmits the central warning model and the initialization model parameters to each base station ACS respectively;
[0011] S4, each base station ACS trains the central warning model using the traffic anomaly monitoring data set according to the initialized model parameters, and transmits the obtained gradient parameters for model updating back to the central server;
[0012] S5. The central server receives and summarizes the gradient parameters sent back by each base station ACS to update the model parameters of the central early warning model, and distributes the updated model parameters to each base station ACS;
[0013] S6. Each base station ACS loads the received updated model parameters into the central warning model, continues model training and transmits the obtained gradient parameters back to the central server;
[0014] S7, repeating steps S5 and S6 until the central warning model in the central server converges;
[0015] S8. The final model parameters in the central server are distributed to each base station ACS, and are loaded into their respective central early warning models by each base station ACS for monitoring the network performance of each CPE device.
[0016] Furthermore, the network parameters described in S1 include the disk occupancy, CPU occupancy, GPU occupancy and memory occupancy of the CPE device at each moment; if a CPE device has abnormal traffic, the network parameters of the CPE device at several moments within a period of time before the abnormal traffic is saved as positive samples in the monitoring database of the base station ACS; the network parameters of the CPE device with normal traffic at several moments in the same period of time are saved as negative samples in the monitoring database of the base station ACS.
[0017] Furthermore, the central warning model constructed in S2 is a Transformer network, which includes several parallel encoders and corresponding decoders; the Encoder includes a Multi-HeadAttention layer and a Feed Forward layer connected in sequence; the Decoder includes a Masked Multi-HeadAttention layer, a Multi-Head Attention layer and a Feed Forward layer connected in sequence, the input of the Multi-Head Attention layer includes the output of the corresponding Encoder, and the input of the Masked Multi-Head Attention layer is the output of the previous Decoder.
[0018] Furthermore, in S5, the central server averages the gradient parameters transmitted back by each base station ACS, and updates the model parameters of the central early warning model according to the obtained result.
[0019] Furthermore, in S1, if a certain network parameter of a certain CPE device at a certain time obtained by the base station ACS is missing, the missing value is calculated according to the corresponding network parameter values of the CPE device at three adjacent time points using the mean method or the quadratic interpolation method.
[0020] Furthermore, in S4, the sample data in the traffic anomaly monitoring data set is input into the central warning model. Each sample data includes network parameters at n moments, which are respectively input into n encoders of the Transformer network, and the corresponding gradient parameters are obtained according to the corresponding sample labels.
[0021] Furthermore, in S8, the base station ACS loads the final model parameters in the central server into the central warning model, inputs the network parameters of a CPE device at the next n moments into the n encoders of the Transformer network, obtains the outputs of the n decoders and then calculates the average. If the obtained average is greater than the set judgment threshold, it indicates that the CPE device is about to have or has experienced traffic abnormality.
[0022] The beneficial effects of the present invention are:
[0023] The present invention uses a federated learning method to perform distributed training on the Transformer early warning model in the central server. Each base station ACS no longer needs to transmit the network parameters of all CPE devices within its management range to the central server, which effectively ensures the data security of the CPE devices, reduces the computing burden and load pressure of the central server, and further improves the training speed and model generalization performance of the central early warning model. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 It is a schematic diagram of the framework of the method of the present invention;
[0025] Figure 2 It is the Transformer network structure diagram in the present invention;
[0026] Figure 3 This is a schematic diagram of the structure of Multi-Head Attention in Transformer;
[0027] Figure 4 This is a structural diagram of Scaled Dot-Product Attention. DETAILED DESCRIPTION
[0028] The present invention will now be described in further detail with reference to the accompanying drawings.
[0029] This paper proposes a traffic warning method based on Transformer and federated learning. The principle framework is as follows: Figure 1 As shown, it mainly includes the following steps:
[0030] S1. Each base station ACS collects historical network parameters of each CPE device within its management range, builds a traffic anomaly monitoring data set and stores it in the monitoring database of the base station ACS.
[0031] The network parameters include the disk occupancy rate, CPU occupancy rate, GPU occupancy rate and memory occupancy rate of the CPE device at each moment; if a CPE device has abnormal traffic, the network parameters of the CPE device at several moments before the abnormal traffic are saved as positive samples in the monitoring database of the base station ACS; the network parameters of the CPE device with normal traffic at several moments in the same period are saved as negative samples in the monitoring database of the base station ACS. If a network parameter of a CPE device at a certain moment obtained by the base station ACS is missing, the missing value is calculated using the mean method or the quadratic interpolation method according to the corresponding network parameter values of the CPE device at three adjacent moments.
[0032] S2. Build a central early warning model in the central server and initialize the model parameters.
[0033] like Figure 2As shown, the central warning model constructed in this example is a Transformer network, which includes several parallel encoders and corresponding decoders; the Encoder includes a Multi-HeadAttention layer and a Feed Forward layer connected in sequence; the Decoder includes a Masked Multi-HeadAttention layer, a Multi-Head Attention layer, and a Feed Forward layer connected in sequence, the input of the Multi-Head Attention layer includes the output of the corresponding Encoder, and the input of the Masked Multi-Head Attention layer is the output of the previous Decoder.
[0034] Among them, the structure of the Multi-Head Attention layer is as follows Figure 3 As shown in Figure 2, the Scaled Dot-Product Attention layer in the Multi-Head Attention layer is as follows: Figure 4 As shown, all are widely used existing technologies.
[0035] S3. The central server transmits the central warning model and the initialization model parameters to each base station ACS respectively.
[0036] S4. Each base station ACS uses the traffic anomaly monitoring data set to train the central warning model based on the initialized model parameters, and transmits the obtained gradient parameters for model update back to the central server. During training, the sample data in the traffic anomaly monitoring data set is input into the central warning model. Each sample data includes the network parameters at n moments, which are respectively input into the n encoders of the Transformer network, and the corresponding gradient parameters are obtained according to the corresponding sample labels.
[0037] S5. The central server receives and summarizes the gradient parameters returned by each base station ACS to update the model parameters of the central warning model, and distributes the updated model parameters to each base station ACS. Typically, the central server averages the gradient parameters returned by each base station ACS, and updates the model parameters of the central warning model based on the average result.
[0038] S6. Each base station ACS loads the received updated model parameters into the central early warning model, continues model training and transmits the obtained gradient parameters back to the central server.
[0039] S7. Repeat steps S5 and S6 until the central warning model in the central server converges.
[0040] S8. The final model parameters in the central server are distributed to each base station ACS, which are loaded into their respective central warning models for monitoring the network performance of each CPE device. Specifically, the base station ACS loads the final model parameters in the central server into the central warning model, inputs the network parameters of a CPE device at the next n moments into the n encoders of the Transformer network, obtains the outputs of the n decoders and calculates the average. If the average is greater than the set judgment threshold, it indicates that the CPE device is about to have or has had a traffic anomaly.
[0041] The above are only preferred embodiments of the present invention, and the protection scope of the present invention is not limited to the above embodiments. All technical solutions under the concept of the present invention belong to the protection scope of the present invention. It should be pointed out that for ordinary technicians in this technical field, some improvements and modifications without departing from the principle of the present invention should be regarded as the protection scope of the present invention.
Claims
1. A traffic warning method based on Transformer and federated learning, characterized in that: The following steps are involved: S1. Each base station ACS collects historical network parameters of each CPE device within its management scope, constructs a traffic anomaly monitoring data set and stores it in the monitoring database of the base station ACS; the network parameters include the disk occupancy rate, CPU occupancy rate, GPU occupancy rate and memory occupancy rate of the CPE device at each time; if a CPE device has a traffic anomaly, the network parameters of the CPE device at several times before the traffic anomaly are saved as positive samples in the monitoring database of the base station ACS; the network parameters of the CPE device with normal traffic at several time points in the same time are saved as negative samples in the monitoring database of the base station ACS; If a certain network parameter of a CPE device at a certain time obtained by the base station ACS is missing, the missing value is calculated according to the corresponding network parameter values of the CPE device at three adjacent times using the mean method or the quadratic interpolation method; S2. Construct a central warning model in the central server and initialize the model parameters; the central warning model is a Transformer network, which includes a plurality of parallel encoders and corresponding decoders; the encoder includes a Multi-Head Attention layer and a Feed Forward layer connected in sequence; the decoder includes a Masked Multi-Head Attention layer, a Multi-Head Attention layer and a Feed Forward layer connected in sequence, the input of the Multi-Head Attention layer includes the output of the corresponding encoder, and the input of the Masked Multi-Head Attention layer is the output of the previous decoder; S3, the central server transmits the central warning model and the initialization model parameters to each base station ACS respectively; S4. Each base station ACS uses the traffic anomaly monitoring data set to train the central warning model based on the initialized model parameters, and transmits the obtained gradient parameters for model update back to the central server; the sample data in the traffic anomaly monitoring data set is input into the central warning model. Each sample data includes the network parameters at n moments, which are respectively input into the n encoders of the Transformer network, and the corresponding gradient parameters are obtained according to the corresponding sample labels; S5. The central server receives and summarizes the gradient parameters transmitted by each base station ACS to update the model parameters of the central early warning model, and distributes the updated model parameters to each base station ACS; the central server averages the gradient parameters transmitted by each base station ACS, and updates the model parameters of the central early warning model according to the obtained result; S6. Each base station ACS loads the received updated model parameters into the central warning model, continues model training and transmits the obtained gradient parameters back to the central server; S7, repeating steps S5 and S6 until the central warning model in the central server converges; S8. The final model parameters in the central server are distributed to each base station ACS, which loads them into their respective central early warning models to monitor the network performance of each CPE device. The base station ACS loads the final model parameters in the central server into the central early warning model, inputs the network parameters of a CPE device at the next n moments into the n encoders of the Transformer network, obtains the outputs of the n decoders and calculates the average. If the obtained average is greater than the set judgment threshold, it indicates that the CPE device is about to have or has experienced traffic abnormality.
