Routing service identification method and device

By introducing a separation mechanism between training router and consensus router in the routing service identification method, and aggregating global model parameters using relative voting messages and local model parameters, the problem of lack of malicious router screening mechanism in the existing technology is solved, and high-precision routing service identification is achieved.

CN119520370AActive Publication Date: 2025-02-25E-SURFING DIGITAL LIFE TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202411725508.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-27
Publication Date
2025-02-25
Estimated Expiration
2044-11-27

AI Technical Summary

Technical Problem

The existing federated learning technology lacks the screening mechanism of malicious routers in the training of routing service recognition models, resulting in reduced model performance and recognition accuracy.

Method used

By introducing a separation mechanism between training router and consensus router in the routing service identification method, the global model parameters are aggregated by relative voting messages and local model parameters, and honest routers are selected to participate in model training to reduce the impact of malicious routers.

Benefits of technology

It effectively improves the training accuracy of the routing service identification model, improves the recognition accuracy of the routing service, and reduces the negative impact of malicious routers on model training.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119520370A_ABST
    Figure CN119520370A_ABST
Patent Text Reader

Abstract

The invention discloses a routing service identification method and device, and is applied to the technical field of communication, and the method comprises the steps: obtaining d training routers and m consensus routers of the kth round of training; controlling each training router to carry out local model training; aggregating the global model parameters of the kth round of training according to the voting messages of the consensus routers relative to the training routers and the local model parameters of the at least one training router to obtain aggregated global model parameters; the aggregated global model parameters are determined as global model parameters of the (k + 1) th round of training, k is made to be equal to k + 1, the above steps are circulated until an end condition is met, and a routing service identification model is output; and performing service identification on the data packet quintuple information of the to-be-tested router by using the routing service identification model to obtain the service type of the to-be-tested router. According to the invention, the identification precision of the routing service is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to a method and device for identifying routing services. Background Art

[0002] Routing services refer to the service types of data packets of routers. The service types of data packets often play an important role in data transmission, routing calculation, network management, etc. of routers. In related technologies, federated learning technology is used to implement the training of routing service identification models, and the trained service identification models are used for service identification. However, current federated learning rarely has a screening mechanism for malicious routers, which makes the training of routing service identification models vulnerable to the influence of malicious routers, resulting in a decrease in the performance of routing service identification models, thereby reducing the identification accuracy of routing services. Summary of the invention

[0003] The embodiments of the present application provide a method and device for identifying routing services, which are used to improve the identification accuracy of routing services.

[0004] On the one hand, an embodiment of the present application provides a method for identifying a routing service, comprising the following steps: Get the k Wheel training d training routers and m A consensus router; For each of the training routers, control the training router to train the local model of the training router based on the local data set of the training router; wherein the local data set includes a plurality of preset data packet five-tuple information and a business type label of each preset data packet five-tuple information; The first training router is voted according to the relative voting information of each training router and the local model parameter of at least one training router. k Aggregating the global model parameters of the round training to obtain the aggregated global model parameters; wherein the relative voting message of the training router includes the voting message of each consensus router relative to the training router; When the federated learning does not reach the preset end condition, the aggregated global model parameters are determined as the first k +1 round of training global model parameters, let k=k +1 and return to get the k Wheel training d training routers and m The steps of a consensus router are repeated until the federated learning reaches the end condition, and a routing service identification model is obtained according to the aggregated global model parameters; The routing service identification model is used to perform service identification on the five-tuple information of the data packet of the router to be tested, so as to obtain the service type of the router to be tested.

[0005] On the other hand, an embodiment of the present application provides a routing service identification device, including: Get module, used to get the k Wheel training d training routers and m A consensus router; The first processing module is used to control each of the training routers to k The local model of the training router is trained using the global model parameters of the round training and the local data set of the training router; wherein the local data set includes a plurality of preset data packet five-tuple information and a business type label of each preset data packet five-tuple information; The second processing module is used to process the first training router according to the relative voting information of each training router and the local model parameter of at least one training router. k Aggregating the global model parameters of the round training to obtain the aggregated global model parameters; wherein the relative voting message of the training router includes the voting message of each consensus router relative to the training router; The third processing module is used to determine the aggregated global model parameters as the first k +1 round of training global model parameters, let k=k +1 and return to get the k Wheel training d training routers and m The steps of a consensus router are repeated until the federated learning reaches the end condition, and a routing service identification model is obtained according to the aggregated global model parameters; The fourth processing module is used to use the routing service identification model to perform service identification on the five-tuple information of the data packet of the router to be tested, and obtain the service type of the five-tuple information of the data packet as the service type of the router to be tested.

[0006] According to the routing service identification method and device of the embodiment of the present application, for each round of training, first divide d training routers and m consensus routers and control d A training router trains a local model of the training router based on a local data set of the training router, wherein the local data set includes a plurality of preset data packet five-tuple information and a business type label of each preset data packet five-tuple information, and then uses dThe relative voting messages of the training routers are combined with the local model parameters of at least one training router to realize the aggregation processing of the global model parameters, wherein the relative voting messages of the training routers include the voting messages of each consensus router relative to the training router, and then the cyclic training is performed or the training is terminated according to whether the end condition is met to obtain the routing service identification model, and finally the routing service identification model is used to perform service identification on the five-tuple information of the data packet of the router to be tested to obtain the service type of the router to be tested, so that more honest routers can be accurately selected to participate in the model training, and the probability of malicious training routers participating in the global model parameter aggregation can be reduced, thereby reducing the influence of malicious routers on the training of the routing service identification model, effectively improving the training accuracy of the routing service identification model, and then improving the identification accuracy of the routing service.

[0007] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or understood by practicing the present application. The purpose and other advantages of the present application can be realized and obtained by the structures specifically pointed out in the description, claims and drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0008] Figure 1 It is a routing service identification scenario diagram provided by this application; Figure 2 It is a flow chart of the routing service identification method provided by the present application; Figure 3 is a flowchart of selecting a training router and a consensus router provided by this application; Figure 4 It is a flow chart of the consensus voting process provided by this application; Figure 5 This is a flow chart for obtaining router contribution provided by this application; Figure 6 It is another flow chart of consensus voting processing provided by this application; Figure 7 is a flow chart of global model parameter aggregation provided by this application; Figure 8 It is a structural diagram of the routing service identification device provided by the present application; Fig. 9 It is a schematic diagram of the routing service identification method provided by this application; Fig.10 This is a schematic diagram of the contribution consensus mechanism provided by this application. DETAILED DESCRIPTION

[0009] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0010] The present application is further described below in conjunction with the accompanying drawings and specific embodiments. The described embodiments should not be regarded as limiting the present application, and all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present application.

[0011] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0012] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0013] Routing service refers to the service type of the data packet of the router. The service type of the data packet often plays an important role in the data transmission, routing calculation, network management, etc. of the router. In the related technology, the federated learning technology is used to realize the training of the routing service identification model, and the trained service identification model is used to perform service identification. It can be understood that as one of the distributed learning methods of machine learning, federated learning can realize the training of machine learning models without collecting training data samples of all users. It allows multiple training terminals participating in the training to train the model locally and send the model updates to the central server for aggregation, and finally form a global model on the central server. However, the current federated learning is rarely equipped with a screening mechanism for malicious routers, which makes the training of the routing service identification model vulnerable to the influence of malicious routers, which reduces the performance of the routing service identification model, thereby reducing the recognition accuracy of the routing service.

[0014] In view of this, the embodiments of the present application provide a routing service identification method and device, which aim to reduce the impact of malicious routers on the training of the routing service identification model, effectively improve the training accuracy of the routing service identification model, and thus improve the identification accuracy of the routing service.

[0015] First, the implementation steps of the routing service identification method provided by the present application will be described in detail below with reference to the accompanying drawings.

[0016] The routing service identification method provided in the embodiment of the present application can be applied to a terminal, a server, or software running in a terminal or a server. The terminal can be a tablet computer, a laptop computer, a desktop computer, etc., but is not limited thereto. The server can be an independent physical server, or a server cluster or a distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), and big data and artificial intelligence platforms. In addition, the server can also be a router server in a blockchain network, but is not limited thereto. Among them, blockchain is a new application model of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm.

[0017] Reference Figure 1 , Figure 1 It is a routing service identification scenario diagram provided by the present application. In this application scenario, the routing service identification method in the present application can be executed by the smart contract module of the blockchain. It can be understood that the smart contract module of the blockchain integrates multiple smart contracts, each router serves as a node of the blockchain, each smart contract is distributed to each router and corresponds to each router one by one, and each smart contract stores a computer-readable storage medium for executing the routing service identification method in the present application. Under the control of the smart contract, each router collaboratively executes the above-mentioned routing service identification method in the present application to realize the training of the routing service identification model. The smart contract module of the blockchain is also integrated with an application contract, and the application contract stores a computer-readable storage medium for executing the routing service identification method in the present application. After completing the training of the routing service identification model, the application contract of the smart contract module uses the routing service identification model to realize real-time service identification of the router to be tested.

[0018] Reference Figure 2 , Figure 2 It is a flowchart of the routing service identification method provided in the present application. The routing service identification method may include the following steps S101-S105.

[0019] S101, obtain the k Wheel training d training routers and m A consensus router.

[0020] It should be noted that both the training router and the consensus router are routers of the blockchain. Specifically, each training router is independent of each other. Each training router is used to train the local model of the training router. When the training is completed, the local model parameters and other parameters are encapsulated into a message and broadcast to each consensus router. Each consensus router is used to perform consensus voting on each training router based on the message broadcast by each training router, and send the result of the consensus voting to the smart contract module, so that the smart contract module selects one or more training routers participating in the global model parameter aggregation based on the result of the consensus voting, and uses the local model parameters and contribution of the selected training router to achieve global model parameter aggregation. Among them, the consensus voting process is achieved between each consensus router through a preset consensus mechanism.

[0021] It is understandable that the training process of the routing service identification model is set with multiple training rounds, and the total number of training rounds can be flexibly set according to actual conditions. k Round training refers to the first round of training of the routing service identification model. k It should be understood that the present application embodiment is from k= 1Start.

[0022] In this step, for k Round of training, among the many routers in the blockchain, the smart contract module is selected d The routers participating in local training are used as training routers, and m The routers participating in the consensus voting process serve as consensus routers to facilitate subsequent local training and global model parameter aggregation.

[0023] Optionally, the number of training routers and the number of consensus routers can be set according to actual conditions, and the present application embodiment does not specifically limit this. However, it should be noted that the number of training routers and the number of consensus routers are both integers.

[0024] Optionally, in some embodiments, the above-mentioned acquisition k Wheel training d training routers and m A consensus router can be included in the many routers of the blockchain, randomly selected d A router as the k The training routers of the round training are randomly selected m A router as the k Consensus routers trained in rounds, but not limited to them.

[0025] S102: For each training router, control the training router to train a local model of the training router based on a local data set of the training router.

[0026] It should be noted that the local data set may include but is not limited to a plurality of preset data packet quintuple information and a business type label of each preset data packet quintuple information.

[0027] It is understandable that the five-tuple information of the data packet may include but is not limited to the source Internet Protocol (IP) address, source port, destination Internet Protocol address, destination port and protocol type, and the service type label of the five-tuple information of the data packet may be divided according to the characteristics, purpose and network traffic pattern of the data packet, for example, the service type label may be a web browsing service type, a video streaming service type, a file transfer service type and an email service type, but is not limited thereto. Among them, the data packet of the web browsing service type may include the data packet generated by the user terminal accessing the web page, loading the web page resources, etc., the data packet of the video streaming service type may include the data packet of the video streaming service such as online video playback, live broadcast, etc., the data packet of the file transfer service type may include the data packet generated by various file transfer protocols, and the data packet of the email service type may include the data packet generated by various email protocols.

[0028] In this step, k In the round of training, for the i A training router, , the smart contract module controls i The training router is based on i The local dataset for training routers and k The global model parameters of the training round are i The local model of a training router is trained to achieve local model training.

[0029] Optionally, the local model of the training router can be set according to actual conditions, and the embodiment of the present application does not specifically limit this. For example, the local model can be a convolutional neural network (CNN) model, and other neural networks such as YOLOv3, Faster R-CNN, etc. are also applicable, and the embodiment of the present application does not specifically limit this.

[0030] Optionally, in some embodiments, the controlling the training router to train the local model of the training router based on the local data set of the training router may include: k round of training, the smart contract module d The training routers broadcast the training message so that at the same time, each training router receives the training message and kThe global model parameters of the round training are used to train the local model. When the training is completed, the local model parameters and other parameters are encapsulated into a message and broadcast to m A consensus router.

[0031] Optionally, in some other embodiments, the controlling the training router to train the local model of the training router based on the local data set of the training router may include: k In the first round of training, the smart contract module sends training instructions to each training router in turn, so that each training router can perform training based on the first round of training after receiving the training instructions. k The global model parameters of the round training are used to train the local model. When the training is completed, the local model parameters and other parameters are encapsulated into a message and broadcast to m A consensus router, but not limited to it.

[0032] S103, according to the relative voting information of each training router and the local model parameters of at least one training router, k The global model parameters of the round training are aggregated to obtain the aggregated global model parameters.

[0033] It should be noted that the relative voting message of the training router may include but is not limited to m The voting message of the consensus router relative to the training router. The voting message of the consensus router relative to the training router carries information indicating whether the consensus router agrees with the training router to participate in the global model parameter aggregation. The information can be flexibly set according to the actual situation. For example, the information can be the approval coefficient value of the consensus router for the training router to participate in the global model parameter aggregation. The higher the approval coefficient value, the more the consensus router agrees with the training router to participate in the global model parameter aggregation, but it is not limited to this.

[0034] In this step, k In the training round, the smart contract module first obtains d The relative voting message of the training router and the local model parameters, the relative voting message of the training router may include but is not limited to m The consensus routers send voting messages to the training routers. These voting messages are composed of m The consensus routers perform consensus voting on the training routers based on the preset consensus mechanism, and then use dThe relative voting messages of the training routers and the local model parameters of at least one training router are used to realize the aggregation processing of the global model parameters. It can be understood that the consensus mechanism is the core mechanism to ensure the security and reliability of transactions in blockchain technology. It is based on competitive or voting mathematical principles, implements secure accounting rules through consensus protocols, and determines the way in which each router reaches a consensus on transaction data. The consensus mechanism ensures that the compliant data is ultimately confirmed by all honest routers, and realizes the consistency and activity of the distributed ledger data records. Among them, the above consensus mechanism can be flexibly set according to actual conditions. For example, the consensus mechanism can be Proof of Work (PoW), and other consensus mechanisms such as Proof of Stake (PoS) and Delegated Proof of Stake (DPoS) are also applicable. The embodiments of this application do not make specific limitations on this.

[0035] Optionally, in some embodiments, the above-mentioned relative voting information of each training router and the local model parameters of at least one training router are used to train the first k The global model parameters of the round training are aggregated to obtain the aggregated global model parameters, which can be included in the first k In the training round, the smart contract module first obtains d The relative voting messages and local model parameters of the training routers are then d Choose from a training router d’ The training routers whose relative voting messages meet the preset conditions are used as aggregation routers, and then calculate d’ The average value of the local model parameters of the aggregation routers is used as the average model parameter, and the correction value corresponding to the average model parameter is found from the preset first mapping data as the global correction value. Finally, the global correction value and the first k The sum of the global model parameters of the first round of training is taken as k The aggregated global model parameters of the round of training. Among them, the number of aggregation routers and the preset conditions can be flexibly set according to the actual situation, and the embodiments of the present application do not specifically limit this. For example, if the voting message of the consensus router relative to the training router carries the consensus router's approval coefficient value for the training router's participation in the global model parameter aggregation, the preset condition may be that the approval coefficient value is greater than a preset coefficient threshold, but is not limited to this. In addition, the preset first mapping data may include a plurality of preset average model parameters and a correction value corresponding to each preset average model parameter, but is not limited to this. Furthermore, the preset first mapping data may be chart data or table data, but is not limited to this.

[0036] S104, when the federated learning does not reach the preset end condition, the aggregated global model parameters are determined as the firstk +1 round of training global model parameters, let k=k +1 and return to get the k Wheel training d training routers and m The steps of a consensus router are repeated until the federated learning reaches the end condition, and the routing service identification model is obtained according to the aggregated global model parameters.

[0037] It should be noted that the routing service identification model is used to identify the service type of the router.

[0038] In this step, k In the first round of training, after the global model parameter aggregation is completed, the smart contract module determines whether the federated learning has reached the preset end condition; if so, it means that the routing service identification model training is completed and the federated learning can be terminated. At this time, the smart contract module uses the k The aggregated global model parameters of the first round of training are used to generate the routing service identification model and output it; if not, it means that the routing service identification model has not been trained and the federated learning has not been terminated. At this time, the smart contract module will k The aggregated global model parameters of the first round of training are used as k +1 round of training global model parameters, i.e. k The global model parameters of the +1 round of training will adopt the k The aggregated global model parameters of the round training, and let k=k +1, and then return to step S101 to implement cycle training.

[0039] Optionally, the termination condition can be set according to actual conditions, and the present application embodiment does not specifically limit this. For example, the termination condition can be that the current training round of federated learning is greater than or equal to the preset total training rounds, that is, k≥N , N is the preset total number of training rounds; or, the end condition can be k The aggregated global model parameters after round training are relative to the first k -The difference of the aggregated global model parameters after 1 round of training is less than a preset difference threshold, but is not limited thereto.

[0040] S105, using the routing service identification model to perform service identification on the five-tuple information of the data packet of the router to be tested, and obtain the service type of the router to be tested.

[0041] In this step, after the training of the routing service identification model is completed, the routing service identification model can be used to realize real-time routing service identification. Specifically, the smart contract module determines the router to be tested and obtains the five-tuple information of the data packet of the router to be tested, and then uses the routing service identification model to perform service identification on the five-tuple information of the data packet to obtain the service type of the router to be tested. It can be understood that the service type of the router to be tested refers to the service type of the five-tuple information of the data packet.

[0042] It can be seen that in the embodiment of the present application, for each round of training, first divide d training routers and m consensus routers and control d A training router trains a local model of the training router based on a local data set of the training router, wherein the local data set includes a plurality of preset data packet five-tuple information and a business type label of each preset data packet five-tuple information, and then uses d The relative voting messages of the training routers are combined with the local model parameters of at least one training router to realize the aggregation processing of the global model parameters, wherein the relative voting messages of the training routers include the voting messages of each consensus router relative to the training router, and then the training is cyclically trained or terminated according to whether the termination conditions are met, and the routing service identification model is obtained. Finally, the routing service identification model is used to identify the service of the five-tuple information of the data packet of the router to be tested, and the service type of the router to be tested is obtained. In this way, more honest routers can be accurately selected to participate in the model training, and the probability of malicious training routers participating in the global model parameter aggregation can be reduced, thereby reducing the influence of malicious routers on the training of the routing service identification model, effectively improving the training accuracy of the routing service identification model, and then improving the identification accuracy of the routing service. It can be understood that an honest router refers to a router with high accuracy and efficiency in local model training, and a malicious training router refers to a training router with low contribution to the global model parameter aggregation.

[0043] The above steps will be further described below.

[0044] In some embodiments, reference Figure 1 and Figure 3 In the above step S101, obtain the k Wheel training d training routers and m The implementation process of a consensus router may include the following steps S1011-S1013.

[0045] S1011, get the blockchain M initial routers and the cumulative contribution of each initial router.

[0046] It should be noted that M=d+m , that is, the sum of the total number of training routers and the total number of consensus routers is equal to the total number of initial routers. However, it should be noted that the total number of initial routers is an integer.

[0047] It is understandable that the cumulative contribution of the initial router refers to the k The sum of the contributions of the initial routers to the federated learning in the round of training. The contribution of the initial routers to the federated learning can be understood as the contribution of the initial routers to the training of the routing service identification model. k The target block of the first round of training stores the cumulative contribution of each initial router and other data, that is, the cumulative contribution of each initial router can be obtained through the first k -The target block of 1 round of training is obtained.

[0048] In this step, the initial router acts as the router of the blockchain. k At the beginning of the round of training, the smart contract module obtains the blockchain M The initial router, M The initial router is used to participate in the training of the routing service identification model. k -The target block of the 1st round of training obtains the cumulative contribution of each initial router so as to select the training router and the consensus router based on the cumulative contribution.

[0049] Optionally, the type of contribution of the initial router to the federated learning can be set according to actual conditions, and this embodiment does not specifically limit this. For example, the contribution of the initial router to the federated learning can be k The local model training accuracy or local model training efficiency of the initial router in the round of training, but not limited to this.

[0050] S1012, according to M The cumulative contribution of the initial routers to M The initial routers are sorted and the M The sorted initial routers.

[0051] It should be noted that the cumulative contribution of the initial router is negatively correlated with the ranking number of the initial router, which means that the higher the cumulative contribution of the initial router, the smaller the ranking number of the initial router, and the lower the cumulative contribution of the initial router, the larger the ranking number of the initial router.

[0052] In this step, the smart contract module uses M The cumulative contribution of the initial routers to M The initial routers are sorted, and the initial routers with high cumulative contribution are sorted first, while the initial routers with low cumulative contribution are sorted last.M The sorted initial routers are used to select training routers and consensus routers according to the size of the cumulative contribution.

[0053] S1013, in M Among the sorted initial routers, select the first m The initial routers serve as consensus routers and the remaining d The first initial router is determined as the training router.

[0054] In this step, the principle of selecting training routers and consensus routers is to select routers with high cumulative contribution as consensus routers and routers with low cumulative contribution as training routers. M Among the sorted initial routers, the smart contract module selects the first m The initial routers serve as consensus routers, and the remaining d Initial routers are determined as training routers. For example, there are 70 initial routers in the blockchain. Among the 70 sorted initial routers, the first 10 initial routers are selected as consensus routers, and the remaining 60 initial routers are determined as training routers, but not limited to this. d training routers can constitute a training router set ,and m The consensus routers can then form a consensus router set .

[0055] It can be seen that this implementation mode is based on the initial routers in front k The sum of the contributions to federated learning in the round of training is M Among the initial routers, the router with high cumulative contribution is selected as the consensus router, and the router with low cumulative contribution is selected as the training router. This can effectively improve the selection accuracy of the consensus router and the training router, thereby improving the training accuracy of the routing service identification model.

[0056] In some embodiments, reference Figure 1 In the above step S103, the first training router is voted according to the relative voting information of each training router and the local model parameters of at least one training router. k Before aggregating the global model parameters of the rounds of training to obtain the aggregated global model parameters, the method may include the following steps: For each training router that has completed training, each consensus router is controlled to perform consensus voting on the training router, and the voting message of each consensus router relative to the training router is obtained as the relative voting message of the training router.

[0057] It should be noted that the relative voting message of the training router may include but is not limited to m The voting message of the consensus router relative to the training router carries information indicating whether the consensus router agrees with the training router to participate in the global model parameter aggregation. The information can be flexibly set according to the actual situation. For example, the information can be the approval coefficient value of the consensus router for the training router to participate in the global model parameter aggregation, but is not limited to this.

[0058] It is understandable that each consensus router implements consensus voting processing based on a preset consensus mechanism.

[0059] In this embodiment, k In each round of training, for each training router that completes local model training, the smart contract module controls m Consensus routers vote on whether to agree that the training router participates in the global model parameter aggregation, and obtain the relative voting message of the training router, so that the smart contract module selects one or more training routers participating in the global model parameter aggregation based on the result of the consensus vote, and uses the local model parameters and contribution of the selected training routers to achieve global model parameter aggregation. It can be understood that by traversing d training routers, we can get d It can be seen that this implementation method integrates the consensus mechanism of blockchain into the training of the routing service identification model. In each round of training, each consensus router is controlled by the consensus mechanism of blockchain to perform consensus voting on each training router, so as to realize the aggregation processing of global model parameters while fully considering the consensus voting results. In this way, more honest routers can be accurately selected to participate in local model training, and the probability of malicious training routers participating in global model parameter aggregation can be reduced, thereby reducing the impact of malicious training routers on the routing service identification model and improving the training accuracy of the routing service identification model.

[0060] Optionally, in some embodiments, the above-mentioned control of each consensus router to perform consensus voting on the training router to obtain the voting message of each consensus router relative to the training router as the relative voting message of the training router may include: k round of training, the smart contract module m The consensus routers broadcast the consensus message, so that each consensus router receives the consensus message and performs consensus voting on the training router based on the preset consensus mechanism, obtains the voting message of each consensus router relative to the training router and sends it to the smart contract module, and the smart contract module obtains the voting message of each consensus router relative to the training router as the relative voting message of the training router. Among them, the above consensus mechanism can be flexibly set according to actual conditions.

[0061] It is understandable that the consensus voting process of each consensus router can be performed simultaneously or sequentially. Moreover, for each consensus router, the consensus router can perform consensus voting on each training router at the same time, or the consensus router can perform consensus voting on each training router sequentially.

[0062] In some embodiments, reference Figure 1 and Figure 4 The specific implementation process of controlling each consensus router to perform consensus voting on the training router and obtaining the voting message of each consensus router relative to the training router as the relative voting message of the training router may include the following steps S01-S03.

[0063] S01, controlling the consensus router to decrypt the verification message of the training router based on the public key of the training router.

[0064] It should be noted that the verification message of the training router is a verification message broadcast by the training router and encrypted by the private key of the training router. The private key of the training router can be flexibly set according to the actual situation. The verification message may include but is not limited to the local model parameters of the training router and the message broadcast timestamp, etc. Among them, the local model parameters of the training router refer to the parameters of the local model of the training router after the training router completes the local model training; the message broadcast timestamp of the training router refers to the timestamp of the training router's verification message broadcast to each consensus router after the training router completes the local model training.

[0065] S02, if the consensus router successfully decrypts the verification message of the training router, the current contribution of the training router is obtained through the consensus router, and the voting information of the consensus router relative to the training router is obtained according to the current contribution of the training router. The voting information of the consensus router relative to the training router is signed using the private key of the training router to obtain the voting message of the consensus router relative to the training router.

[0066] It should be noted that the current contribution of the training router refers to the k Contribution of training routers to federated learning in one round of training.

[0067] S03, if the consensus router fails to successfully decrypt the verification message of the training router, the preset null value voting information is determined as the voting information of the consensus router relative to the training router, and the voting information of the consensus router relative to the training router is signed using the private key of the training router to obtain the voting message of the consensus router relative to the training router.

[0068] In this embodiment, in view of the defect that the current federated learning is not equipped with a malicious router screening mechanism, this embodiment provides a router screening method based on legitimacy verification in the consensus voting process. In addition, the current blockchain-based federated learning still uses traditional consensus mechanisms such as proof of work mechanism and proof of equity mechanism to achieve router consensus, which not only wastes the computing resources of the consensus router and reduces the resource utilization of the consensus router, but also reduces the overall training performance of the routing service identification model. In this regard, this embodiment also provides a consensus voting method based on router contribution in the consensus voting process.

[0069] Specifically, in this implementation, each consensus router needs to d The training routers perform consensus voting, which means that whether each training router can participate in the aggregation of global model parameters is determined by m The smart contract module predefines a voting set to store the relative voting messages of all training routers. The voting set is represented as , Indicates training router The voting subset of Represents a consensus router Relative to training router Voting information.

[0070] In the k In the round of training, for the j Consensus Router , and i Training Routers , , there are: controlled by the smart contract module, training router Use local datasets to train local models. When training routers When the local model training is complete, train the router Record message broadcast timestamp , through the private key For packages with local model parameters and timestamp The verification message is signed to obtain the verification message And broadcast to the consensus router .

[0071] In the consensus voting process, the first step is to screen the routers based on legitimacy verification. Specifically, for the consensus routers and training routers , controlled by the smart contract module, the consensus router By training the router The public key Training Router Verification message Decryption is performed, if the consensus router Successfully decrypted verification message , it means that the training router Broadcast verification message Legal, training router is a legitimate router; if the consensus router Unable to successfully decrypt the verification message , it means that the training router Broadcast verification message Illegal, training router is an illegal router. At this time, the consensus router The preset empty value voting information Confirmed as voting information And store it in the training router The voting subset , to update the collection VQ Among them, the null value voting information is used to indicate the training router Verification message illegal.

[0072] Then a consensus vote based on the router contribution is performed. Specifically, for the consensus router and training routers , controlled by the smart contract module, the consensus router Pair Collection VQ Perform traversal and retrieval to determine the collection VQ Does it include voting information? . It is understandable that only in the verification message Illegal voting information Exists in the collection VQ Therefore, in the verification message Legally, the consensus router In the collection VQ No voting information could be retrieved from , at this time the consensus router According to the training router The current contribution of And store it in the training router The voting subset To update the collection VQ Finally, the consensus router Using training router Private key Pair Collection VQ Voting information in Perform signature encryption to obtain voting information And sent to the smart contract module. It is understandable that in the consensus router Unable to successfully decrypt the verification message Voting information , voting information The voting message obtained after signature encryption Is a null value.

[0073] By traversing m Consensus routers can be obtained m The voting messages of consensus routers relative to a single training router, i.e., the voting subset of a single training router , and then by traversing d training routers, we can get d The relative voting messages of the training routers, i.e., the set .

[0074] It can be seen that in this embodiment, whether the training router is illegal is determined by whether the verification message of the training router is decrypted or not, so that malicious training routers can be effectively identified. In addition, if the verification message of the training router is illegal, the null value voting information is assigned to the voting information of the consensus router relative to the training router and encapsulated into a corresponding voting message, which can reduce the probability of malicious training routers participating in the global model parameter aggregation; if the verification message of the training router is legal, the blockchain contribution consensus mechanism is executed. This consensus mechanism uses the router contribution as the consensus indicator between the consensus routers, and uses the k The contribution of the training router to the federated learning in the round of training is used to determine the voting information of the consensus router relative to the training router and encapsulate it into the corresponding voting message. In this way, it can not only effectively improve the trust between the consensus routers in the training process of the routing business identification model, improve the consensus voting accuracy, consensus voting efficiency and resource utilization of each consensus router, but also improve the accuracy of global model parameter aggregation, thereby improving the overall training performance of the routing business identification model.

[0075] Optionally, the public key of the training router can be set according to actual conditions, and this embodiment does not specifically limit this. It should be understood that the private key and the public key of the training router form a key pair in pairs, and the generation algorithm of the key pair can be flexibly set according to actual conditions. For example, the generation algorithm of the key pair can be an asymmetric encryption algorithm, an elliptic curve encryption algorithm, a digital signature algorithm, etc., but is not limited to this. In addition, the decryption processing algorithm can also be flexibly set according to actual conditions. For example, the decryption processing algorithm can be an asymmetric encryption algorithm, a digital signature algorithm, etc., but is not limited to this.

[0076] Optionally, in some embodiments, the above-mentioned obtaining the voting information of the consensus router relative to the training router according to the current contribution of the training router may include obtaining the voting information of the consensus router relative to the training router according to the current contribution of the training router in combination with a machine learning method, but is not limited thereto. Among them, the machine learning method can be set according to actual conditions, for example, the machine learning method can be a support vector machine or a random forest, but is not limited thereto.

[0077] In some embodiments, reference Figure 1 and Figure 5 In the above step S02, the implementation process of obtaining the current contribution of the training router may include the following steps S021-S023.

[0078] S021, according to the local data set weight of the training router, the total number of consensus routers and the initial training contribution of the training router, obtain k The target training contribution of the training router in the training round.

[0079] It should be noted that the local dataset weight of the training router is used to indicate the proportion of the dataset labels held by the training router in the dataset labels participating in the training of the routing service identification model. The initial training contribution of the training router refers to the weight of the dataset held by the training router in the first k The sum of the training router's contribution to the local model training of each consensus router in the round of training. k The target training contribution of the training router in the round of training is k The contribution of local model training of training routers to federated learning in round training.

[0080] In this step, k In the first round of training, the consensus router evaluates the local model training status of the training router based on the weight of the local dataset of the training router, the total number of consensus routers and the initial training contribution of the training router, thereby obtaining the k The target training contribution of the router in the training round is used to map the k The impact of the local dataset and local model accuracy of the training router on the global model in the round of training.

[0081] Optionally, in some embodiments, the above is obtained based on the local data set weight of the training router, the total number of consensus routers and the initial training contribution of the training router. k The target training contribution of the training router in the round of training may include obtaining the target training contribution of the training router in the first round according to the weight of the local data set of the training router, the total number of consensus routers and the initial training contribution of the training router, combined with the machine learning method.k The target training contribution of the training router in the training round.

[0082] Optionally, in some other embodiments, for the local dataset weight, there is M Initial routers participate in the training of the routing service identification model. i' Initial Router Label the locally stored dataset and the total number of samples in the dataset Upload to the smart contract module, The smart contract module counts the total number of data set labels involved in the training of the routing business identification model to form a label set , n The total number of dataset labels used to train the model for identifying routing services. For the n The labels of the data sets participating in the training of the routing service identification model are formed into the label table shown in Table 1 below. Indicates that the router owns the dataset with this label.

[0083] Table 1: Label table

[0084] The smart contract module gets the initial router based on the tag table The total number of dataset labels held m’ , and combined with the total number of data set samples involved in the training of the routing service identification model, the total number of data set labels involved in the training of the routing service identification model, and the initial router The total number of data set samples is calculated to obtain the initial router The local data set weights are stored. Among them, the initial router The weight of the local dataset satisfies the following formula (1): (1); In formula (1), Indicates the initial router The weight of the local dataset; Indicates the initial router The total number of samples in the dataset; m’ Indicates the initial router The total number of dataset labels held; n Indicates the total number of dataset labels involved in the training of the routing service identification model; Indicates the total number of data set samples involved in the training of the routing service identification model.

[0085] For the initial training contribution of training routers,k At the beginning of the round of training, the smart contract module will M The initial routers are divided into m consensus routers and d training routers. d training routers can constitute a training router set ,and m The consensus routers can then form a consensus router set It is understandable that only the training routers that have passed the consensus router vote have contribution. and training routers , smart contract module or consensus router controlled by smart contract module The consensus router can be Local dataset and training router The local dataset is label-aligned, a public dataset is selected, and the router is trained based on the public dataset. The local model is tested and the classification accuracy is used to measure the training router during testing. Compared to consensus routers The contribution of local model training. k Training routers in rounds of training Compared to consensus routers The contribution of local model training satisfies the following formula (2): (2); In formula (2), Indicated in k Training routers in rounds of training Compared to consensus routers The contribution of local model training can be , but not limited to this; Represents a consensus router Relative to training router Public datasets; Represents a public dataset The total number of data samples; Represents a public dataset Sample labels for each data in ; Represented by the training router The prediction result output by the local model is consistent with the sample label Corresponding. Among them, Used to indicate sample labels Is it equal to the predicted result? , if the sample label Equal to the predicted result ,but ,otherwise .

[0086] Smart contract module or consensus router controlled by smart contract module By traversing m consensus routers, and obtain training routers Relative to the local model training contribution of each consensus router, and then calculate the training router Relative to m The sum of the local model training contributions of the consensus routers is used as the training router Initial training contribution and store.

[0087] In the consensus voting process, through the consensus router Get the training router The local dataset weight and initial training contribution And the total number of consensus routers m , and these data are used to calculate the k Training routers in rounds of training The target training contribution is k Training routers in rounds of training The higher the target training contribution, the k Training routers in rounds of training The better the local model training condition is, the worse it is. k Training routers in rounds of training The target training contribution satisfies the following formula (3): (3); In formula (3), Indicated in k Training routers in rounds of training Contribution to target training; Indicates training router The local dataset weight, express d The minimum value among the weights of the local dataset of training routers, express d The maximum value among the weights of the local dataset of the training routers; Indicated in k Training routers in rounds of training Initial training contribution of m Indicates the total number of consensus routers.

[0088] S022, according to k In the round of training, the data transmission delay value and data loss rate of the training router are obtained. k The communication quality parameters of the router are trained in the round of training.

[0089] It should be noted that the message broadcast delay of the training router refers to the data transmission delay value of the training router when broadcasting the message, and the data loss rate of the training router refers to the data loss rate of the training router when broadcasting the message. k The communication quality parameters of the training routers in the round of training are used to indicate the k In the round training, the communication performance of the router is trained when broadcasting messages.

[0090] In this step, in addition to considering the impact of training data and model accuracy on the global model, the impact of inter-router communication quality on the training of the routing service identification model is also considered. Since in the blockchain, the training router needs to broadcast local model parameters and other parameters to other consensus routers, in order to complete the training of the routing service identification model more quickly, it is necessary to select training routers whose communication quality meets the expected requirements to participate in the global model parameter aggregation. Based on this, this implementation method evaluates the communication quality of the training router from two aspects: message broadcast delay and data loss rate. Specifically, in the first k In the round of training, the consensus router obtains k The data transmission delay value and data loss rate of the router are trained in the round of training. The data transmission delay value can indicate the message broadcast delay, and the data loss rate can indicate the data loss rate. Then, the data transmission delay value and the data loss rate are used to determine the k The communication quality parameters of the routers are trained in the round of training. The communication quality parameters can indicate k In the round training, the communication performance of the router is trained when broadcasting messages.

[0091] Optionally, in some embodiments, the above-mentioned k In the round of training, the data transmission delay value and data loss rate of the training router are obtained. k The communication quality parameters of the routers trained in the round of training may include the following: k In the first round of training, the data transmission delay value and data loss rate of the router are trained, and the machine learning method is combined to obtain the k The communication quality parameters of the routers are trained in the round of training.

[0092] Optionally, in some other embodiments, in k In the round of training, it is controlled by the smart contract module, for the consensus router and training routers , training router Use local data sets to train local models when training routers When the local model training is complete, train the router Record message broadcast timestamp , through the private key For packages with local model parameters and timestamp The verification message is signed to obtain the verification message And broadcast to the consensus router .

[0093] In the consensus voting process, through the consensus router Training Router Specifically, the consensus router Receive verification message And record the receipt of the verification message Timestamp , and then use the training router The public key Verification message Decrypt the message and get the training router Timestamp of message broadcast , and finally calculate the timestamp Relative to timestamp The difference is taken as the k Training routers in rounds of training Data transmission delay value ,Right now For the training of routing service identification models with delay requirements, the data transmission delay value must be met. Less than or equal to the preset constraint delay T It is understandable that if the data transmission delay value The smaller the k Training routers in rounds of training The lower the message broadcast delay, the higher the delay.

[0094] Through the consensus router Training Router Specifically, the smart contract module sets the corresponding bounded tolerance threshold according to the level of the global model in advance, that is, the bounded tolerance threshold of the back layer of the global model is set to , the middle-level bounded tolerance threshold is , the bounded tolerance threshold of the front layer is , and then set the overall bounded tolerance threshold of the global model as The division of the front layer, middle layer and back layer of the global model can be set according to actual conditions, and this embodiment does not specifically limit this.

[0095] For example, in some embodiments, the global model It can be expressed as , where the parameter To Parameters are all model parameters of the front layer, parameters To Parameters are all middle-level model parameters. To Parameters are all model parameters of the back layer, thus dividing the global model into the front layer, middle layer and back layer.

[0096] On this basis, through the consensus router Received by the training router Broadcast verification message And use the training router The public key Decryption is performed to obtain the training router The actual local model parameters , the actual local model parameters Can be understood as a consensus router The model parameters actually received, and the training router after training is completed Local model parameters As a training router The expected local model parameters are based on the training router The actual local model parameters and the expected local model parameters Calculated in the k Training routers in rounds of training It is understandable that if k Training routers in rounds of training The smaller the data loss rate is, the k Training routers in rounds of training The lower the data loss is, the higher the data loss is. k Training routers in rounds of training The data loss rate satisfies the following formula (4): (4); In formula (4), Indicated in k Training routers in rounds of training Data loss rate; Indicated ink Training routers in rounds of training The size of the expected local model parameters; Indicated in k Training routers in rounds of training The actual local model parameters of Indicates training router The expected size of local model parameters relative to the trained router The difference between the actual local model parameters and the actual local model parameters. For the training of routing service identification models with data loss rate requirements, the data loss rate must be met. Less than or equal to the overall bounded tolerance threshold of the global model .

[0097] Finally, through the consensus router According to the k Training routers in rounds of training Data transmission delay value and data loss rate Calculated in the k Training routers in rounds of training The communication quality parameters. k Training routers in rounds of training The communication quality parameter satisfies the following formula (5): (5); In formula (5), Indicated in k Training routers in rounds of training Communication quality parameters; Indicated in k Training routers in rounds of training The data transmission delay value; T Indicates the preset constraint delay, which can be flexibly set according to actual conditions; represents the overall bounded tolerance threshold of the global model; Indicated in k Training routers in rounds of training It is understandable that if the data transmission delay value is Less than or equal to the preset constraint delay T And the data loss rate Less than or equal to the overall bounded tolerance threshold of the global model ,but The value is 1, otherwise it is 0.

[0098] S023, according to kThe target training contribution and communication quality parameters of the training router in the round of training are used to obtain the current contribution of the training router.

[0099] In this step, k In the round of training, the consensus router is based on k The target training contribution and communication quality parameters of the training routers in the round of training are calculated and obtained in the first k Contribution of training routers to federated learning in one round of training.

[0100] Optionally, in some embodiments, according to k The target training contribution and communication quality parameters of the training router in the round of training are obtained to obtain the current contribution of the training router, which may include k The target training contribution and communication quality parameters of the training router in the round of training are combined with the machine learning method to obtain the current contribution of the training router.

[0101] Optionally, in some other embodiments, for the consensus router and training routers , consensus router Based on training router Contribution of target training and communication quality parameters Calculated in the k Training routers in rounds of training The current contribution of k Training routers in rounds of training The higher the current contribution of k Training routers in rounds of training The more contributions are made to the training of the routing service identification model, the less contributions are made otherwise. k Training routers in rounds of training The current contribution of satisfies the following formula (6): (6); In formula (6), Indicated in k Training routers in rounds of training Contribution to federated learning, i.e. training routers Current contribution.

[0102] It can be seen that this embodiment evaluates the contribution of the training router to federated learning from two aspects: the communication quality of the training router and the local model training status. The communication quality of the training router is used as the judgment condition and the local model training status of the training router is used as the benchmark to determine the current contribution of the training router. In this way, the contribution of the training router to federated learning can be accurately measured, and the accuracy of the router contribution can be improved, thereby effectively improving the accuracy and efficiency of the consensus voting process.

[0103] In some embodiments, reference Figure 1 and Figure 6 In the above step S02, the implementation process of obtaining the voting information of the consensus router relative to the training router according to the current contribution of the training router may include any one of the following steps S024-S025: S024, if the current contribution of the training router is greater than or equal to the preset contribution threshold, then determine the preset first key value as the voting information of the consensus router relative to the training router; wherein the first key value is used to indicate that the consensus router agrees that the training router participates in the aggregation of global model parameters; S025, if the current contribution of the training router is less than a preset contribution threshold, the preset second key value is determined as the voting information of the consensus router relative to the training router; wherein the second key value is used to indicate that the consensus router opposes the training router's participation in the aggregation of global model parameters.

[0104] In this embodiment, in the consensus voting method based on router contribution, for the consensus router and training routers , when the consensus router In the collection VQ No voting information could be retrieved from When the consensus router Training the router Perform contribution evaluation, i.e. compare training routers Whether the current contribution of is greater than or equal to the preset contribution threshold.

[0105] If you train the router The current contribution of is greater than or equal to the preset contribution threshold, that is, , indicates the preset contribution threshold, which means that the training router In the k The contribution to the training of the routing service identification model in the round training is relatively large. At this time, the preset first key value is determined as the voting information , which means that the consensus router Agree to train router Participate in the aggregation of global model parameters.

[0106] If you train the router The current contribution of is less than the preset contribution threshold, that is, , then the training router In the k The contribution to the training of the routing service identification model in the round training is small, and the preset second key value is determined as the voting information , which means that the consensus router Against training routers Participate in the aggregation of global model parameters to realize the blockchain contribution consensus mechanism.

[0107] In this way, this implementation uses router contribution as the consensus indicator between consensus routers, which can not only accurately screen training routers with relatively high contribution to participate in global model parameter aggregation, and reject training routers with relatively low contribution to participate in global model parameter aggregation, effectively improving the accuracy of global model parameter aggregation, but also effectively improve the consensus voting accuracy, consensus voting efficiency and resource utilization of each consensus router, ensure the availability of consensus voting processing in the training of the routing business identification model, thereby improving the overall training performance of the routing business identification model.

[0108] Optionally, the first key value and the second key value can be set according to actual conditions, and this embodiment does not specifically limit this. For example, the first key value can be 1, that is, when Consensus Router Agree to train router Participate in the aggregation of global model parameters, and the second key value can be 0, that is, when Consensus Router Against training routers Participate in the aggregation of global model parameters.

[0109] Optionally, the contribution threshold may be set according to actual conditions, and this embodiment does not specifically limit this.

[0110] In some embodiments, reference Figure 1 and Figure 7 In the above step S103, the first training router is voted according to the relative voting information of each training router and the local model parameters of at least one training router. k The global model parameters of the round training are aggregated to obtain the aggregated global model parameters, which may include the following steps S1031-S1033.

[0111] S1031, in kDuring the block generation period of the round of training, for each training router, the relative voting message of the training router is decrypted using the public key of the training router. If the relative voting message of the training router is successfully decrypted and the aggregation proportion of the training router is greater than the preset proportion threshold, the training router and the local model parameters of the training router are added to the preset aggregation list, and the cumulative contribution of the training router is updated according to the current contribution of the training router, and the updated cumulative contribution of the training router is obtained and stored in the first k Candidate blocks for round training.

[0112] It should be noted that the aggregate proportion of training routers refers to the proportion of consensus routers that agree to train routers to participate in the aggregation of global model parameters among all consensus routers. In addition, the updated cumulative contribution of training routers will be used in the k In the +1 round of training, the training router and the consensus router are divided, that is, the updated cumulative contribution of the training router will be used as the k +1 The cumulative contribution of the training routers in the training round.

[0113] It can be understood that the preset aggregation list is a pre-set storage list for storing the training routers and their local model parameters that participate in the global model parameter aggregation. In addition, the candidate block refers to the block generated within the block generation time period, which is mainly used to store the updated cumulative contribution of the training router. It should be emphasized that the candidate block is not the final block. In this step, k During the block generation period of the round training, for the training router , the smart contract module receives the training router Relative voting messages and using training routers The public key The purpose of the secondary decryption verification is to verify the legitimacy of the training router again and reduce the probability of malicious training routers participating in global model parameter aggregation. Relative voting messages indicate that the training router Illegal, considered as training router Failed to pass the decryption verification, and the smart contract module determines the training router Does not participate in global model parameter aggregation and excludes training routers If the smart contract module successfully decrypts the training router Relative voting messages indicate that the training router Legal, considered as training router After decryption verification, the smart contract module obtains the training router The aggregation ratio and the training router Whether the aggregation ratio of is greater than the preset ratio threshold. The aggregate percentage refers to the number of routers that agree to train The proportion of consensus routers participating in the aggregation of global model parameters among all consensus routers satisfies the following formula (7): (7); In formula (7), To train the router The aggregation ratio of represents the summation function, Indicates consent to train the router The number of consensus routers participating in the aggregation of global model parameters; d is the total number of consensus routers.

[0114] If the aggregation ratio If it is greater than the percentage threshold, it means that most consensus routers agree to train the router. Participate in global model parameter aggregation, only a few consensus routers oppose training routers Participate in global model parameter aggregation, at which time the smart contract module determines the training router Participate in global model parameter aggregation and train the router and training routers Local model parameters Add to preset aggregation list AG In the meantime, according to the training router The current contribution of The cumulative contribution of The updated cumulative contribution is stored in k The candidate blocks for round 1 training will be used as the cumulative contribution of the update. k +1 training round in training router The cumulative contribution of .

[0115] If the aggregation ratio If it is less than the percentage threshold, it means that most consensus routers do not agree to train the router. Participate in global model parameter aggregation, only a few consensus routers agree to train the router Participate in global model parameter aggregation, at which time the smart contract module determines the training router Does not participate in global model parameter aggregation and excludes training routers .

[0116] It is understandable that this step i=1, the smart contract module traverses d The relative voting messages of the training routers can be obtained from d Choose from a training router d’ A training router that participates in global model parameter aggregation. d’ The training routers participating in the global model parameter aggregation can be recorded as aggregation routers, and the preset aggregation list AG This will be stored d’ aggregation routers and the local model parameters of each aggregation router.

[0117] It is understandable that in k Outside the block generation period of a round of training, the smart contract module stops receiving relative voting messages from any training router.

[0118] Optionally, the percentage threshold may be set according to actual conditions, for example, the percentage threshold may be 0.5, but is not limited thereto.

[0119] Optionally, the decryption processing algorithm can be set according to actual conditions, and this embodiment does not specifically limit this. For example, the decryption processing algorithm can be an algorithm such as an asymmetric encryption algorithm, a digital signature algorithm, etc., but is not limited thereto.

[0120] Optionally, in some embodiments, the above-mentioned updating of the cumulative contribution of the training router according to the current contribution of the training router to obtain the updated cumulative contribution of the training router may include weighting the current contribution of the training router and the cumulative contribution of the training router to obtain the updated cumulative contribution of the training router, wherein the sum of the weight of the current contribution and the weight of the cumulative contribution is one.

[0121] Optionally, in other embodiments, the updating of the cumulative contribution of the training router according to the current contribution of the training router to obtain the updated cumulative contribution of the training router may include calculating the sum of the current contribution of the training router and the cumulative contribution of the training router as the updated cumulative contribution of the training router. The updated cumulative contribution satisfies the following formula (8): (8); In formula (8), Indicates training router The updated cumulative contribution of Indicated in k Training routers in rounds of training Current contribution of Indicates k -1 round of training target block; represents the contribution extraction function, Indicates that from k -1 round of training target block Get the training router from The cumulative contribution of .

[0122] It is understood that in some embodiments, k During the block generation period of the training round, each consensus router can simultaneously broadcast the voting messages of the consensus router relative to each training router to the smart contract module, so that the smart contract module can obtain the voting messages of multiple consensus routers relative to each training router at the same time, thereby ensuring that k Before the end of the block generation period of the round of training, the smart contract module completes the judgment on whether each training router participates in the global model parameter aggregation. k During the block generation period of the round of training, each consensus router can send the voting messages of the consensus router relative to each training router to the smart contract module in sequence, so that the smart contract module can obtain the voting messages of multiple consensus routers relative to each training router at different times. In the previous case, when the first k At the end of the block generation period of the round of training, the smart contract module completes the judgment on whether at least one training router participates in the global model parameter aggregation, and the number of training routers that complete the judgment is less than or equal to d .

[0123] It is understandable that the smart contract module can simultaneously determine whether each training router participates in the global model parameter aggregation, or the smart contract module can sequentially determine whether each training router participates in the global model parameter aggregation.

[0124] S1032, when k At the end of the block generation period of the round of training, the local model parameters and current contribution of each training router in the aggregation list are used to generate the first k The global model parameters of the round training are aggregated to obtain the aggregated global model parameters.

[0125] It should be noted that the aggregated global model parameters refer to the k The updated parameters of the global model in this round of training.

[0126] In this step, k During the block generation period of the training round, the smart contract module traverses d The relative voting messages of the training routers come from d Choose from a training router d’ Aggregation routers participate in global model parameter aggregation and d’The aggregation routers and the local model parameters of each aggregation router are added to the preset aggregation list AG In. k At the end of the block generation period of the round of training, the smart contract module obtains the aggregate list AG , and using the aggregation list AG middle d’ The local model parameters and current contribution of the aggregation router are used to k The global model parameters of the round training are aggregated to obtain the aggregated global model parameters.

[0127] Optionally, in some embodiments, the above-mentioned use of the local model parameters and current contribution of each training router in the aggregation list to the first k Aggregate the global model parameters of the round training to obtain the aggregated global model parameters, which can include calculation d’ The average model parameter is calculated by taking the mean of the local model parameters of the aggregation routers as the average model parameter. d’ The current contribution of each aggregation router is taken as the average contribution, and the correction value corresponding to the average model parameter and the average contribution is found from the preset second mapping data as the global correction value. Finally, the global correction value and the first k The sum of the global model parameters of the first round of training is taken as k The aggregated global model parameters of the round training. The second mapping data may include a plurality of preset composite variables and a correction value corresponding to each preset composite variable, and the preset composite variable may include a preset average model parameter and a preset average contribution. In addition, the second mapping data may be chart data or table data, but is not limited thereto.

[0128] Optionally, in some embodiments, the above-mentioned use of the local model parameters and current contribution of each training router in the aggregation list to the first k Aggregating the global model parameters of the rounds of training to obtain the aggregated global model parameters may include using the local model parameters and current contribution of each training router in the aggregation list, combined with the following formula (9), to calculate the aggregated global model parameters: (9); In formula (9), Indicates k The aggregated global model parameters after rounds of training are k +Global model parameters for 1 round of training; Indicated in k Training routers in rounds of training Contribution to federated learning, i.e. training routers Current contribution of Indicated in kTraining routers in rounds of training Local model parameters of ; Represents an aggregate list AG The training router in is the aggregation router; Represents an aggregate list AG The sum of the current contributions of all training routers in .

[0129] S1033, based on the aggregation list, the aggregated global model parameters and the k -1 round of training target block, combined with k The candidate blocks of the round training are obtained k The target block of the round of training is broadcast to the blockchain.

[0130] It should be noted that k The target block of the round training is mainly used to store the k Parameter information involved in the round and past rounds of training, such as aggregated global model parameters, each training router in the aggregation list and its local model parameters, private key, updated cumulative contribution, etc., but not limited to this.

[0131] It is understandable that the training router and consensus router, as nodes of the blockchain, can use the corresponding public key to k The target block of the round of training is decrypted to read the k The information stored in the target block of the round of training.

[0132] In this step, after completing the global model parameter aggregation, a new block needs to be generated to store the k The relevant data parameters of the round of training are broadcasted to the blockchain so that the routers and smart contract modules of the blockchain can read the data in the block to facilitate subsequent training. AG Information stored in, aggregated global model parameters , No. k -1 round of training target block and k Candidate blocks for round training, build new blocks, and use the aggregation list AG The private key of each training router in the network signs and encrypts the new block, thus obtaining the k The target block of the round of training will be broadcast to the blockchain. k The target block of round training satisfies the following formula (10): (10); In formula (10), Indicates k Target block for round training; Indicates k -1 round of training target block; AG Represents an aggregate list; Represents the private key of each training router in the aggregation list; Represents the block generation function.

[0133] It can be seen that in this embodiment, first, the relative voting message of each training router is decrypted and verified, so that the legitimacy of the training router can be ensured, and the probability of malicious training routers participating in the global model parameter aggregation can be reduced; then, the principle of minority obeys majority is used to determine whether the training router that has passed the decryption verification is agreed to participate in the global model parameter aggregation, and the training router whose relative voting message is successfully decrypted and whose aggregation ratio is greater than the preset ratio threshold is selected to participate in the global model parameter aggregation, so as to determine the final voting result, so that the honest training router can be accurately selected to participate in the global model parameter aggregation, and the influence of malicious training routers on the global model parameter aggregation can be reduced; at the same time, the cumulative contribution of the training routers participating in the global model parameter aggregation is accumulated and calculated and saved in the candidate block, so as to facilitate the division of training routers and consensus routers in subsequent training rounds; then, the aggregation processing of the global model parameters is realized while fully considering the router contribution and the local model parameters of the router, so that not only the accuracy of the global model parameter aggregation can be effectively improved, but also the degree of decentralization of federated learning can be improved, thereby improving the training accuracy and training efficiency of the routing service identification model; finally, the information stored in the aggregation list, the aggregated global model parameters, the first k -1 round of training target block and k The candidate blocks of the round of training are used to build new blocks, and the new blocks are signed and encrypted using the private keys of each training router in the aggregation list to obtain the first k The target block of the round of training will be broadcast to the blockchain, which can ensure the normal progress of subsequent training and improve the training security of the routing business identification model. It can be understood that an honest training router refers to a training router that has a high contribution to the aggregation of global model parameters.

[0134] In some implementations, in the above step S103, the first training router is voted according to the relative voting information of each training router and the local model parameters of at least one training router. k After aggregating the global model parameters of the rounds of training to obtain the aggregated global model parameters, the method may further include the following step S11: S11, for each training router, if the aggregate proportion of the training router is greater than the preset proportion threshold, the training router is rewarded according to the current contribution of the training router and the total number of samples in the local data set, combined with the preset reward and punishment hyperparameters, otherwise there is no reward.

[0135] In this implementation, an incentive mechanism is designed for each training router. It can be understood that the incentive mechanism refers to the use of certain economic means or rewards to stimulate the routers within the system to actively adopt specific data and algorithms and participate in the operation and construction of the blockchain system. This mechanism encourages routers to contribute to the blockchain ecosystem by providing economic motivation, thereby maintaining the normal operation and development of the network. In the incentive mechanism, the reward value of the training router is determined by the current contribution and the total number of samples in the local data set. The judgment condition is m The voting results of the consensus routers on the training routers. When more than half of the consensus routers agree that the training router participates in the global model parameter aggregation, it means that the training router is an honest training router, and the smart contract module should give the training router a corresponding reward value. Otherwise, it means that the training router is a malicious router and no reward should be given to the training router. In multiple iterations of training, malicious training routers are less enthusiastic about participating in the global model parameter aggregation, so the reward value of malicious training routers will gradually decrease, while honest training routers have a certain enthusiasm for participating in the global model parameter aggregation, so the reward value of honest training routers will gradually increase. This can not only effectively improve the enthusiasm of each router to participate in the training of the routing business identification model and improve the scalability of the blockchain, but also speed up the screening of malicious training routers and improve the training efficiency and training accuracy of the routing business identification model.

[0136] It is understandable that the reward value has a certain value, and it can be set according to actual conditions. For example, at the end of the training of the routing service identification model, each training router can settle its reward, but it is not limited to this.

[0137] Optionally, the reward and punishment hyperparameters may be flexibly set according to actual conditions, and this embodiment does not specifically limit this.

[0138] Optionally, in some embodiments, the above-mentioned rewarding the training router based on the current contribution of the training router and the total number of local data set samples in combination with preset reward and punishment hyperparameters may include obtaining the reward value of the training router based on the preset reward and punishment hyperparameters, the current contribution of the training router and the total number of local data set samples of the training router in combination with a machine learning method.

[0139] Optionally, in other embodiments, the above-mentioned rewarding the training router according to the current contribution of the training router and the total number of local data set samples in combination with preset reward and punishment hyperparameters may include obtaining the reward value of the training router according to the preset reward and punishment hyperparameters, the current contribution of the training router and the total number of local data set samples of the training router in combination with the following formula (11): (11); In formula (11), Indicated in k Training routers in rounds of training The reward value of Indicated in k Training routers in rounds of training Current contribution of Indicates training router The total number of local dataset samples; Represents the reward and punishment hyperparameter.

[0140] It is understandable that the smart contract module can reward each training router at the same time, or the smart contract module can reward each training router in turn.

[0141] In some implementations, in the above step S103, the first training router is voted according to the relative voting information of each training router and the local model parameters of at least one training router. k After aggregating the global model parameters of the rounds of training to obtain the aggregated global model parameters, the method may further include the following step S12: S12, for each consensus router, reward the consensus router according to the voting information of the consensus router relative to each training router and the number of samples in the public data set, combined with the preset reward and punishment hyperparameters.

[0142] In this implementation, an incentive mechanism is designed for each consensus router. In the incentive mechanism, the reward value of the consensus router is determined by the consensus router relative to d The voting information of the training routers and the consensus routers relative to d The public dataset of the training routers jointly decides the decision, and the decision condition is that the consensus router d For each training router, when the consensus router votes correctly for the training router, the smart contract module should give the consensus router a reward. When the consensus router votes incorrectly for the training router, the smart contract module does not give the consensus router a reward. In this way, by giving certain rewards to the consensus router through the incentive mechanism, the enthusiasm of the consensus router to participate in the consensus voting process can be effectively improved, thereby speeding up the screening of malicious training routers and improving the training efficiency and training accuracy of the routing business identification model.

[0143] It is understandable that the reward value has a certain value, and it can be set according to the actual situation. For example, at the end of the training of the routing business identification model, each consensus router can settle its reward, but it is not limited to this.

[0144] Optionally, in some embodiments, the above-mentioned rewarding the consensus router based on the voting information of the consensus router relative to each training router and the number of public data set samples, combined with preset reward and punishment hyperparameters, may include obtaining the reward value of the consensus router based on the preset reward and punishment hyperparameters, the voting information of the consensus router relative to each training router, and the number of public data set samples of the consensus router relative to each training router, combined with a machine learning method.

[0145] Optionally, in other embodiments, the above-mentioned rewarding the consensus router according to the voting information of the consensus router relative to each training router and the number of samples of the public data set, combined with the preset reward and punishment hyperparameters, may include obtaining the reward value of the consensus router according to the preset reward and punishment hyperparameters, the voting information of the consensus router relative to each training router, and the number of samples of the public data set of the consensus router relative to each training router, combined with the following formula (12): (12); In formula (12), Indicated in k Consensus router in round training The reward value of Indicated in k Consensus router in round training Relative to training router The number of public dataset samples; represents the reward and punishment hyperparameter; d is the total number of trained routers; Used to indicate the k Consensus router in round training Training Router Whether the vote is correct satisfies the following formula (13): (13); In formula (13), when the first condition or the second condition is met, it means that k Consensus router in round training Training Router The vote is correct, at this time The value is 1; when the first and second conditions are not met, it means that k Consensus router in round training Training Router The voting error is The value is 0. The first condition is and , the second condition is and .

[0146] It is understandable that the smart contract module can reward each consensus router at the same time, or the smart contract module can reward each consensus router in turn.

[0147] In addition, refer to Figure 8 , the embodiment of the present application further provides a routing service identification device, which may include: Acquisition module 201, used to obtain the k Wheel training d training routers and m A consensus router; The first processing module 202 is used to control each training router to perform a training based on the first k The local model of the training router is trained using the global model parameters of the round training and the local data set of the training router; wherein the local data set includes a plurality of preset data packet five-tuple information and a business type label of each preset data packet five-tuple information; The second processing module 203 is used to process the first training router according to the relative voting information of each training router and the local model parameters of at least one training router. k The global model parameters of the round training are aggregated to obtain the aggregated global model parameters; wherein the relative voting message of the training router includes the voting message of each consensus router relative to the training router; The third processing module 204 is used to determine the aggregated global model parameters as the first k +1 round of training global model parameters, let k=k +1 and return to get the k Wheel training d training routers and m The steps of consensus routers are repeated until the federated learning reaches the end condition, and the routing service identification model is obtained according to the aggregated global model parameters; The fourth processing module 205 is used to perform service identification on the five-tuple information of the data packet of the router to be tested by using the routing service identification model, and obtain the service type of the five-tuple information of the data packet as the service type of the router to be tested.

[0148] The contents of the above method embodiments are all applicable to the present system embodiments. The functions specifically implemented by the present system embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0149] In order to facilitate the understanding of the above-mentioned routing service identification method and device of the present application, an example is given here with the actual application scenario of the present application. Figure 1In this application scenario, the smart contract module of the blockchain integrates multiple smart contracts. Each router serves as a node of the blockchain. Each smart contract is distributed to each router and corresponds to each router one by one. Each smart contract stores a computer-readable storage medium for executing the routing service identification method in this application. Under the control of the smart contract, each router collaboratively executes the above-mentioned routing service identification method in this application to realize the training of the routing service identification model. The smart contract module of the blockchain also integrates an application contract, which stores a computer-readable storage medium for executing the routing service identification method in this application. After completing the training of the routing service identification model, the application contract of the smart contract module uses the routing service identification model to realize real-time service identification of the router to be tested.

[0150] Reference Fig. 9 The specific process of implementing routing service identification in this application is shown in the following steps S301-S308.

[0151] S301, router division: in the k At the beginning of the training round, the initial router acts as a node of the blockchain, and the smart contract module first passes the k -Get the target block for 1 round of training M The cumulative contribution of the initial routers is then used M The cumulative contribution of the initial routers to M The initial routers are sorted, and the initial routers with high cumulative contribution are sorted first, while the initial routers with low cumulative contribution are sorted last. M The sorted initial routers are then M Among the sorted initial routers, select the first m The initial routers serve as consensus routers, and the remaining d The first initial router is determined as the training router.

[0152] S302, local model training: After completing the router division, the smart contract module simultaneously sends d The training router broadcasts the training message. i Training Routers , , training router Receive training messages and k The global model parameters of the round training are used for local model training. When the training is completed, the router is trained The local model parameters and the message broadcast timestamp Encapsulate into a message and use the private key Signature encryption is performed and then broadcast to m A consensus router.

[0153] S303, consensus voting process: refer to Fig.10 , each consensus router needs to d The training routers perform consensus voting, that is, whether each training router can participate in the aggregation of global model parameters is determined by m The consensus routers make the decision. k In the round of training, for the consensus router and training routers , consensus router Using a Consensus Router The public key Trained Router Broadcast verification message Decrypt to verify its legitimacy; If the decryption succeeds, the verification message Legal, training router Legal, now the consensus router Determine the training router Is the current contribution of greater than or equal to the preset contribution threshold? If so, let the voting information , i.e. consensus router Agree to train router Participate in the aggregation of global model parameters, otherwise , i.e. consensus router Against training routers Participate in the aggregation of global model parameters; the calculation of the current contribution can refer to the above formulas (1)-(6); if the decryption fails, it means that the verification message Illegal, training router Illegal, at this time the consensus router The preset empty value voting information Confirmed as voting information ; Afterwards, the consensus router Using training router Private key Voting Information Perform signature encryption to obtain voting information And send it to the smart contract module; Finally, if j≠m , then it means m The consensus router has not completed the i The consensus vote of the training routers, at this time the smart contract module j=j+ 1 and returns to the consensus router Using a Consensus Router The public key Trained Router Broadcast verification message Perform the decryption steps to achieve loop processing; if j=m , then it means m The consensus router completes the i The consensus vote of the training routers, at this time the smart contract module determines i Is it equal to d If yes, then it is completed m Consensus router pair d The consensus vote of the training routers is d The relative voting message of the training router, otherwise the smart contract module i=i+ 1, and returns to the consensus router Using a Consensus Router The public key Trained Router Broadcast verification message The decryption step is performed to realize the loop processing. It can be understood that this step starts from i =1 and j= 1Start.

[0154] S304, Committee consensus: refer to Fig.10 , in k During the block generation period of the round training, for the training router , the smart contract module obtains the training router Relative voting messages and using training routers The public key Perform secondary decryption verification; If the smart contract module cannot decrypt the training router Relative voting messages indicate that the training router Illegal, considered as training router Failed to pass the decryption verification, and the smart contract module determines the training router Does not participate in global model parameter aggregation and excludes training routers ; If the smart contract module successfully decrypts the training router Relative voting messages indicate that the training router Legal, considered as training router After decryption verification, the smart contract module determines the training router Whether the aggregation ratio of is greater than the preset ratio threshold, the aggregation ratio can refer to the above formula (7), if so, determine the training router Participate in global model parameter aggregation and train the router and training routers Local model parameters Add to preset aggregation list AG In the meantime, according to the training router The current contribution of The cumulative contribution of The updated cumulative contribution is stored in k Candidate blocks for round training, training routers The updated cumulative contribution satisfies the above formula (8), otherwise the training router is determined Does not participate in global model parameter aggregation and excludes training routers ; Finally, if i=d , it means that the smart contract module has completed d The judgment of the training router is not completed. d The judgment of a training router, the smart contract module i=i +1 and back to get the training router The relative voting message steps are performed to realize the loop processing. Among them, this step starts from i = 1. It is understandable that in k During the block generation period of a round of training, the smart contract module can complete d A training router's judgment.

[0155] S305, global model parameter aggregation: When the k At the end of the block generation period of the round of training, the smart contract module obtains the aggregate list AG , and using the aggregation list AG middle d’ The local model parameters and current contribution of the aggregation router are combined with the above formula (9) to calculate k The global model parameters of the round training are aggregated to obtain the aggregated global model parameters. Finally, the smart contract module uses the aggregate list AG The information stored in k -1 round of training target block and k Candidate blocks for round training, build new blocks, and use the aggregation list AG The private key of each training router in the network is used to sign and encrypt the new block, thereby obtaining the first block as shown in the above formula (10): k The target block for each round of training will be broadcast to the blockchain for subsequent training rounds.

[0156] S306, incentive mechanism: The reward value of the training router is determined by the current contribution and the total number of samples in the local data set. The judgment condition ism The voting results of the consensus routers on the training router are as follows: when more than half of the consensus routers agree that the training router participates in the global model parameter aggregation, the smart contract module gives the training router a corresponding reward value; otherwise, the smart contract module does not give any reward to the training router, as shown in the above formula (11).

[0157] The reward value of the consensus router is determined by the consensus router relative to d The voting information of the training routers and the consensus routers relative to d The public dataset of the training routers jointly decides the decision, and the decision condition is that the consensus router d For each training router, when the consensus router votes correctly for the training router, the smart contract module gives the consensus router a reward. When the consensus router votes incorrectly for the training router, the smart contract module does not give the consensus router a reward, as shown in the above formulas (12)-(13).

[0158] S307, training termination judgment: the smart contract module determines whether the federated learning has reached the preset termination condition; if so, it means that the federated learning can be terminated. At this time, the smart contract module uses the k The aggregated global model parameters of the round of training are used to generate the routing service identification model and output it; if not, it means that the federated learning has not yet terminated, and the smart contract module will k The aggregated global model parameters of the first round of training are used as k +1 round of training global model parameters, i.e. k The global model parameters of the +1 round of training will adopt the k The aggregated global model parameters of the round training, and let k=k +1, and then return to step S301 to implement cyclic training.

[0159] S308, real-time routing service identification: the smart contract module determines the router to be tested and obtains the five-tuple information of the data packet of the router to be tested, and then uses the routing service identification model to perform service identification on the five-tuple information of the data packet to obtain the service type of the router to be tested. It can be understood that the service type of the router to be tested refers to the service type of the five-tuple information of the data packet.

[0160] Although the embodiments of the present application have been shown and described, those skilled in the art will appreciate that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present application, and that the scope of the present application is defined by the claims and their equivalents.

[0161] The above is a specific description of the preferred implementation of the present application, but the present application is not limited to the described embodiments. Technical personnel familiar with the field may make various equivalent modifications or substitutions without violating the spirit of the present application. These equivalent modifications or substitutions are all included in the scope defined by the claims of the present application.

Claims

1. A method for identifying routing services, characterized in that: The method comprises the following steps: Get the k Wheel training d training routers and m A consensus router; For each of the training routers, control the training router to train the local model of the training router based on the local data set of the training router; wherein the local data set includes a plurality of preset data packet five-tuple information and a business type label of each preset data packet five-tuple information; The first training router is voted according to the relative voting information of each training router and the local model parameter of at least one training router. k Aggregating the global model parameters of the round training to obtain the aggregated global model parameters; wherein the relative voting message of the training router includes the voting message of each consensus router relative to the training router; When the federated learning does not reach the preset end condition, the aggregated global model parameters are determined as the first k +1 round of training global model parameters, let k=k +1 and return to get the k Wheel training d training routers and m The steps of a consensus router are repeated until the federated learning reaches the end condition, and a routing service identification model is obtained according to the aggregated global model parameters; The routing service identification model is used to perform service identification on the five-tuple information of the data packet of the router to be tested, so as to obtain the service type of the router to be tested.

2. The method for identifying routing services according to claim 1, characterized in that: The acquisition k Wheel training d training routers and m A consensus router, including: Get blockchain M initial routers and the cumulative contribution of each of the initial routers; wherein, M=d+m , the cumulative contribution of the initial router is k The sum of the contributions of the initial routers to federated learning in the round of training; according to M The cumulative contribution of the initial routers is M The initial routers are sorted and the M The sorted initial routers; wherein the cumulative contribution of the initial routers is negatively correlated with the sorting number of the initial routers; exist M Among the sorted initial routers, select the first m The initial routers are used as the consensus routers, and the remaining d The initial router is determined as the training router.

3. The method for identifying routing services according to claim 1, characterized in that: In the step of: determining the first training router according to the relative voting information of each training router and the local model parameter of at least one training router; k Before aggregating the global model parameters of the round training to obtain the aggregated global model parameters, the method further comprises the following steps: For each training router that has completed training, each consensus router is controlled to perform consensus voting on the training router, and a voting message of each consensus router relative to the training router is obtained as a relative voting message of the training router.

4. The method for identifying routing services according to claim 3, characterized in that: The controlling each of the consensus routers to perform consensus voting on the training router to obtain voting messages of each of the consensus routers relative to the training router includes: Controlling the consensus router to decrypt the verification message of the training router based on the public key of the training router; If the consensus router successfully decrypts the verification message of the training router, the current contribution of the training router is obtained through the consensus router, and the voting information of the consensus router relative to the training router is obtained according to the current contribution of the training router. The voting information of the consensus router relative to the training router is signed by the private key of the training router to obtain the voting message of the consensus router relative to the training router; wherein the current contribution of the training router is k The contribution of the training routers to federated learning described in the round of training; If the consensus router fails to successfully decrypt the verification message of the training router, the preset null value voting information is determined as the voting information of the consensus router relative to the training router, and the voting information of the consensus router relative to the training router is signed using the private key of the training router to obtain the voting message of the consensus router relative to the training router.

5. The method for identifying routing services according to claim 4, characterized in that: The obtaining of the current contribution of the training router includes: According to the local data set weight of the training router, the total number of the consensus routers and the initial training contribution of the training router, the k The target training contribution of the training router in the round of training; wherein the initial training contribution of the training router is k The sum of the local model training contributions of the training router relative to the consensus routers in the round of training; According to the k The data transmission delay value and data loss rate of the training router in the round of training are obtained in the first k Communication quality parameters of the training routers in the round of training; According to the k The target training contribution and communication quality parameters of the training router in the round of training are used to obtain the current contribution of the training router.

6. The method for identifying routing services according to claim 4, characterized in that: The step of obtaining voting information of the consensus router relative to the training router according to the current contribution of the training router includes: If the current contribution of the training router is greater than or equal to a preset contribution threshold, a preset first key value is determined as voting information of the consensus router relative to the training router; wherein the first key value is used to indicate that the consensus router agrees that the training router participates in the aggregation of the global model parameters; Alternatively, if the current contribution of the training router is less than the contribution threshold, the preset second key value is determined as the voting information of the consensus router relative to the training router; wherein the second key value is used to indicate that the consensus router opposes the training router's participation in the aggregation of the global model parameters.

7. The method for identifying routing services according to claim 1, characterized in that: The training routers are trained according to the relative voting information of each training router and at least one local model parameter of the training router. k The global model parameters of the round training are aggregated to obtain the aggregated global model parameters, including: In the k During the block generation time period of the round of training, for each of the training routers, the relative voting message of the training router is decrypted using the public key of the training router. If the relative voting message of the training router is successfully decrypted and the aggregation proportion of the training router is greater than the preset proportion threshold, the training router and the local model parameters of the training router are added to the preset aggregation list, and the cumulative contribution of the training router is updated according to the current contribution of the training router to obtain the updated cumulative contribution of the training router and store it in the first k The candidate blocks for round training; wherein the aggregation ratio of the training routers is the ratio of the number of the consensus routers that agree that the training routers participate in the aggregation of the global model parameters among all the consensus routers; When k At the end of the block generation period of the round of training, the local model parameters and current contribution of each training router in the aggregation list are used to generate the first k Aggregating the global model parameters of the round training to obtain the aggregated global model parameters; According to the aggregation list, the aggregated global model parameters and the k -1 round of training target block, combined with k The candidate blocks of the round training are obtained k The target block of the round of training is broadcast to the blockchain.

8. The method for identifying routing services according to claim 1, characterized in that: In the step of: determining the first training router according to the relative voting information of each training router and the local model parameter of at least one training router; k After aggregating the global model parameters of the rounds of training to obtain the aggregated global model parameters, the method further comprises the following steps: For each of the training routers, if the aggregate proportion of the training router is greater than a preset proportion threshold, the training router is rewarded according to the current contribution of the training router and the total number of samples in the local data set, combined with preset reward and punishment hyperparameters, otherwise there is no reward.

9. The method for identifying routing services according to claim 1, characterized in that: In the step of: determining the first training router according to the relative voting information of each training router and the local model parameter of at least one training router; k After aggregating the global model parameters of the rounds of training to obtain the aggregated global model parameters, the method further comprises the following steps: For each of the consensus routers, the consensus router is rewarded according to the voting information of the consensus router relative to each of the training routers and the total number of samples in the public data set, combined with preset reward and punishment hyperparameters.

10. A routing service identification device, characterized in that: include: Get module, used to get the k Wheel training d training routers and m A consensus router; The first processing module is used to control each of the training routers to k The local model of the training router is trained using the global model parameters of the round training and the local data set of the training router; wherein the local data set includes a plurality of preset data packet five-tuple information and a business type label of each preset data packet five-tuple information; The second processing module is used to process the first training router according to the relative voting information of each training router and the local model parameter of at least one training router. k Aggregating the global model parameters of the round training to obtain the aggregated global model parameters; wherein the relative voting message of the training router includes the voting message of each consensus router relative to the training router; The third processing module is used to determine the aggregated global model parameters as the first k +1 round of training global model parameters, let k=k +1 and return to get the k Wheel training d training routers and m The steps of a consensus router are repeated until the federated learning reaches the end condition, and a routing service identification model is obtained according to the aggregated global model parameters; The fourth processing module is used to use the routing service identification model to perform service identification on the five-tuple information of the data packet of the router to be tested, and obtain the service type of the five-tuple information of the data packet as the service type of the router to be tested.

Citation Information

Patent Citations

  • Decentralized federated machine learning method under privacy protection

    CN111600707A

  • Federal learning incentive method and system based on license chain

    CN112861152A

  • Business identification method based on federal learning

    CN115278570A

  • Router traffic identification system and method based on automatic machine learning

    CN116506310A

  • Distributed multi-party credible joint learning method for virtual power plant

    CN117556475A