Layered credible federal learning method with data perception capability

By introducing a hierarchical trusted federated learning method of data perception capabilities in federated learning, the problem of insufficient model update flexibility and scalability in the prior art is solved, more efficient and accurate model training is achieved, and data security is enhanced.

CN119808898AInactive Publication Date: 2025-04-11HUNAN UNIV OF SCI & TECH
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202510308916.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-17
Publication Date
2025-04-11
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing federated learning methods have insufficient flexibility and scalability in the model update process, resulting in poor accuracy of model training, which affects the model training effect and speed.

Method used

A hierarchical trusted federated learning method with data perception capabilities is adopted. By obtaining the learning performance data of each client device, analyzing the learning performance indicators, and intelligently grouping the client devices according to the preset grouping mechanism, generating a global model, and uploading it to the blockchain for updates.

Benefits of technology

Improve the efficiency and accuracy of model training, ensure data privacy and security, and enhance the credibility of the entire federated learning process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119808898A_ABST
    Figure CN119808898A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of federated learning, and particularly discloses a hierarchical credible federated learning method with data perception ability, which comprises the following steps of: acquiring learning performance data of each client device through a hierarchical credible federated learning device, obtaining learning performance indexes of each client device, and judging whether to carry out performance early warning on the client device or not; then the hierarchical trusted federated learning device uploads the public key of each client device to a block chain, each accessible control device is screened out, data privacy is ensured, each accessible control device trains and generates a local model to which each accessible control device belongs, then training feature values of the local model to which each accessible control device belongs are obtained, and the data privacy is ensured; according to the method and the system, the access control devices are classified, whether training is carried out again or not is judged, training evaluation indexes of the access control devices are acquired, intelligent grouping is completed, local models to which the access control devices belong are aggregated, global models are generated and uploaded to the block chain to complete global model updating, and model training efficiency and accuracy are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of federated learning, and in particular to a hierarchical trusted federated learning method with data perception capability. Background Art

[0002] Federated learning has been widely used in privacy-sensitive personalized recommendation systems, smart cities, smart healthcare and other fields. However, traditional federated learning is a typical single-layer centralized architecture that relies on central servers to generate or update global model parameters. It has problems such as single point failure, privacy leakage, and performance bottlenecks. In order to effectively reduce the communication overhead of the central server, some studies have introduced edge computing into federated learning and constructed a hierarchical federated learning framework. The hierarchical trusted federated learning method came into being.

[0003] For example, the invention patent with publication number CN117494846A discloses a clustering federated learning method based on data difference perception between clients. Each client performs calculations based on local data to obtain feature vectors and label vectors. The server calculates the feature vector difference measure between each two clients to obtain a geodesic distance matrix, and calculates the label vector difference measure between each two clients to obtain a Hellinger distance matrix. The geodesic distance matrix and the Hellinger distance matrix are weighted linearly combined to obtain a pairwise distance matrix. The server uses a hierarchical clustering algorithm to perform clustering calculations on the pairwise distance matrix to obtain multiple clustering results. The server maintains multiple cluster-level models based on the clustering results, and sends different cluster-level models to all participating clients belonging to the cluster. Based on the clustering results, the server performs federated learning interactive iterative processing between the server and the client until a preset iteration round is reached, and the different cluster-level models that have completed the iteration are shared with the corresponding clients.

[0004] For example, the invention patent with announcement number CN112488322B announces a federated learning model training method based on data feature perception aggregation, in which the cloud server calculates the global optimal model based on the local model uploaded by the edge client, and reduces the dimension of the data features based on the mining of edge client data features, screens out key features, and clusters the edge clients based on the key features; the cloud server sends grouping information and the global optimal model to the edge client; the edge client performs model training locally based on the received global optimal model and provides local data according to the global optimal model, and randomly selects a local model in the same edge client group or selects the optimal model in the edge client group and uploads it to the cloud server.

[0005] Combining the above technical solutions, it is found that in the current process of model training through federated learning methods, the flexibility and scalability of model updates have certain limitations. Fixed processes are usually used for training, and the accuracy of model training is poor, which affects the effect and speed of model training. Summary of the invention

[0006] In view of the deficiencies in the prior art, the present invention provides a hierarchical trusted federated learning method with data perception capability, which can effectively solve the problems involved in the above-mentioned background technology.

[0007] To achieve the above objectives, the present invention is implemented through the following technical solutions: a hierarchical trusted federated learning method with data perception capability, comprising: S1. a hierarchical trusted federated learning device obtains learning performance data of each client device, thereby analyzing and obtaining learning performance indicators of each client device, and comparing them with the learning performance threshold of the client device preset in the data perception library to determine whether to issue a performance warning for each client device; S2. each client device receives and executes a registration instruction, and the hierarchical trusted federated learning device thereby obtains and uploads the public key of each registered client device to the blockchain, thereby the hierarchical trusted federated learning device screens out a number of client devices with access control authority through the public key of each client device in the blockchain, recorded as each accessible control device, and the blockchain sends global data to each accessible control device, thereby each accessible control device performs performance warning on the global data Perform local training and generate a local model for each accessible control device. The hierarchical trusted federated learning device obtains the local model data of each accessible control device, and analyzes to obtain the training feature value of the local model of each accessible control device, and compares it with the local training model feature threshold preset in the data perception library to determine whether to retrain the local model of each accessible control device; S3. The hierarchical trusted federated learning device obtains the training parameters of each accessible control device, and analyzes to obtain the training evaluation index of each accessible control device, thereby intelligently grouping each accessible control device according to the preset grouping mechanism to obtain each group of accessible control devices. The hierarchical trusted federated learning device aggregates the local models of each group of accessible control devices through the preset access control mechanism to generate a global model, and uploads the global model to the blockchain, and finally completes the global model update of the blockchain.

[0008] As a further method, each client device learns performance indicators, and the specific analysis process is as follows: Through comprehensive analysis of the maximum available memory capacity of each client device during the device operation period, the maximum data throughput of each client device during the device operation period, the log error rate of each client device during the device operation period, and the actual operating time proportion of each client device during the device operation period, the learning performance index of each client device is obtained. The learning performance index of each client device is used to comprehensively and quantitatively evaluate the learning performance of each client device.

[0009] As a further method, the local model training feature values ​​of each accessible control device are specifically analyzed as follows: Through the loss function value of the local model of each accessible control device in the model training period, the actual training time of the local model of each accessible control device in the model training period, the number of floating-point operations of the local model of each accessible control device in the model training period, the balance score of the local model of each accessible control device in the model training period, and the learning performance index of each accessible control device, the training characteristic value of the local model of each accessible control device is obtained through comprehensive analysis. The training characteristic value of the local model of each accessible control device is used to comprehensively and quantitatively evaluate the training effect of the local model of each accessible control device. The specific acquisition method is as follows: ; In the formula, Represents the local model training feature value of the Rth accessible control device, represents the loss function value of the local model to which the Rth accessible control device belongs during the model training period, Indicates the actual training time of the local model of the Rth accessible control device in the model training period, Indicates the reference training duration preset in the data perception library. Indicates the number of floating-point operations of the local model of the Rth accessible control device during the model training period, Indicates the reference number of floating-point operations preset in the data perception library. represents the balance score of the local model to which the Rth accessible control device belongs during the model training period, represents the learning performance index of the Rth accessible control device, Represents the training feature influence coefficient of the loss function value preset in the data perception library, The training feature influence coefficient representing the actual training duration preset in the data perception library, The training feature correction factor representing the number of floating-point operations preset in the data perception library, represents the training feature influence coefficient of the preset balance score in the data perception library, represents the training feature influence coefficient of the learning performance indicator preset in the data perception library, R is the number of each accessible control device, S, S is the total number of accessible control devices.

[0010] As a further method, the training evaluation index of each accessible control device is specifically analyzed as follows: Through the number of floating-point operations of the local model of each accessible control device in the model training period, the actual training duration of the local model of each accessible control device in the model training period, the discrete value of the training speed of the local model of each accessible control device in the model training period, the model training accuracy of each accessible control device in the model training period and the learning performance index of each accessible control device, a comprehensive analysis is performed to obtain the training evaluation index of each accessible control device. The training evaluation index of each accessible control device is used to comprehensively and quantitatively evaluate the training performance of each accessible control device.

[0011] As a further method, the above-mentioned completing the global model update of the blockchain specifically obtains the adjacent historical global model in the blockchain, and updates the adjacent historical global model to the global model through the preset update mode in the blockchain to complete the global model update of the blockchain.

[0012] The preset update mode specifically performs global model aggregation on the currently generated global model and the adjacent historical global model according to the global model aggregation formula built into the hierarchical trusted federated learning device, thereby uploading the aggregated newly generated global model to the blockchain.

[0013] Compared with the prior art, the embodiments of the present invention have at least the following advantages or beneficial effects: The present invention provides a hierarchical trusted federated learning method with data perception capability. The hierarchical trusted federated learning device obtains the learning performance data of each client device and obtains the learning performance index of each client device, thereby determining whether to issue a performance warning to it. Then, the hierarchical trusted federated learning device uploads the public key of each client device to the blockchain, thereby selecting each accessible control device, ensuring data privacy and accuracy. Each accessible control device is trained to generate a local model belonging to each accessible control device, and then the training feature value of the local model belonging to each accessible control device is obtained, and it is determined whether to re-train to ensure the accuracy of the local model, thereby providing a reliable data basis for subsequent aggregation to generate a global model. At the same time, the training evaluation index of each accessible control device is obtained, thereby completing intelligent grouping, and aggregating the local models belonging to each group of accessible control devices. Synchronous aggregation is performed within the group to ensure the diversity of data samples and reduce data loss. Asynchronous updates are performed between groups to ensure training efficiency, generate a global model, and upload it to the blockchain to complete the global model update, thereby improving the model training efficiency and accuracy. (2) The present invention obtains the learning performance data of each client device through a hierarchical trusted federated learning device, which can fully understand the learning performance of each client device, thereby analyzing and obtaining the learning performance index of each client device, and can quantitatively evaluate the learning performance of each client device, and compare it with the client device learning performance threshold preset in the data perception library to determine whether to issue a performance warning for each client device, thereby ensuring the reliable federated learning performance of each client device and laying a good equipment foundation for the subsequent training of the local model; (3) The present invention receives and executes the registration instruction through each client device, and the hierarchical trusted federated learning device thereby obtains and uploads the public key of each registered client device to the blockchain. The hierarchical trusted federated learning device thereby screens out a number of client devices with access control authority through the public key of each client device in the blockchain, which are recorded as each accessible control device, thereby preventing unauthorized client devices from accessing global data and ensuring data privacy and security. The blockchain sends global data to each accessible control device to ensure data integrity and non-tamperability. Thus, each accessible control device performs local training on the global data and generates a local model belonging to each accessible control device. The hierarchical trusted federated learning device obtains the local model data belonging to each accessible control device, and can fully understand the training effect of the local model belonging to each accessible control device, and analyze and obtain the training feature value of the local model belonging to each accessible control device, and can quantitatively evaluate the training effect of the local model belonging to each accessible control device, and compare it with the local training model feature threshold preset in the data perception library to determine whether to retrain the local model belonging to each accessible control device, thereby providing a strong guarantee for improving the accuracy of the global model generated by subsequent aggregation; (4) The present invention obtains the training parameters of each accessible control device through a hierarchical trusted federated learning device, can comprehensively evaluate the training performance of each accessible control device, analyze and obtain the training evaluation index of each accessible control device, and quantify the training performance of each accessible control device. Thus, the accessible control devices are intelligently grouped according to a preset grouping mechanism to obtain groups of accessible control devices, thereby ensuring the diversity of data in each group and guaranteeing the accuracy of data decision-making. The hierarchical trusted federated learning device aggregates the local models of each group of accessible control devices through a preset access control mechanism to generate a global model, and uploads the global model to the blockchain to ensure the integrity and non-tamperability of the global model, and finally completes the global model update of the blockchain, thereby improving the credibility of the entire federated learning process. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] The present invention is further described with the aid of the accompanying drawings, but the embodiments in the accompanying drawings do not constitute any limitation to the present invention. A person skilled in the art can obtain other accompanying drawings based on the following accompanying drawings without creative work. Figure 1 It is a schematic diagram of the method flow of the present invention; Figure 2 It is the overall flow chart of hierarchical trusted federated learning of the present invention; Figure 3 is a schematic diagram of a preset access control mechanism of the present invention; Figure 4 It is a schematic diagram of the aggregation of intra-group synchronization and inter-group asynchrony of the present invention. DETAILED DESCRIPTION

[0015] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0016] Reference Figure 1 As shown, the present invention provides a hierarchical trusted federated learning method with data perception capability, including: S1. A hierarchical trusted federated learning device obtains learning performance data of each client device, thereby analyzing the learning performance index of each client device, and compares it with the client device learning performance threshold preset in the data perception library to determine whether to issue a performance warning for each client device.

[0017] In a specific embodiment, the above-mentioned hierarchical trusted federated learning device specifically refers to an IoT gateway and edge computing device that performs operation monitoring, model distribution, local training, model aggregation and global update on each client device, and finally completes hierarchical trusted federated learning. It is suitable for scenarios such as medical health, financial services and smart cities. The hierarchical trusted federated learning device performs intelligent grouping based on the data distribution and training efficiency of each client device to ensure the diversity of data in each group and the accuracy of data decisions; adopts a hybrid strategy of synchronous aggregation within the group and asynchronous aggregation between groups to improve the overall training efficiency and ensure the timeliness of data decisions; through the access control mechanism, unauthorized clients are prevented from accessing the model to ensure data privacy and system security; off-chain computing is used to reduce storage and computing overhead and improve the overall efficiency of the system; after security analysis and experimental verification, it can accelerate the convergence speed of the model and improve model performance while ensuring safety. It can be well applied to scenarios such as healthcare, financial services, and smart cities, and can improve the accuracy of disease prediction and diagnosis in medical institutions without sharing private data, enhance the intelligence level of financial decision-making, and enhance risk assessment and market analysis capabilities; improve the intelligence level of traffic management, public safety, and environmental monitoring in smart cities, and achieve optimal allocation of resources; this hierarchical trusted federated learning device can be connected to each client device through the Internet of Things, thereby obtaining model training data from each client device, and finally completing the aggregation to generate a global model; the above-mentioned client devices specifically refer to smart devices with computing power and data storage functions, such as wearable medical devices, remote medical monitoring equipment, smart POS machines, environmental monitoring sensors, smart home devices, smart bus stops, smart phones, and tablets. These client devices can participate in the training and updating of the global model by registering and interacting with the blockchain network.

[0018] like Figure 2 As shown in the figure, the specific steps of the hierarchical trusted federated learning include model distribution, local training, model aggregation and global update; assuming that there are K accessible control devices participating in the federated learning task, the kth accessible control device is recorded as The local dataset is , number of samples , the global dataset is represented as the union of K accessible control device datasets ; The local model of the accessible control device k in round t is expressed as , the global model is , then the local objective function of the kth accessible control device is : ; Among them, f For a single sample and local model weights The loss function is n, where n is the number of samples. Usually, the model training adopts the gradient descent algorithm, which updates the model parameters in the direction that reduces the loss most quickly to minimize the loss function. Then the local model is updated as : ; in, is the local gradient of the kth accessible control device, represents the learning rate of the tth round of local model iteration. In the case of weighted average, the global model : ; in, is the global gradient, represents the global learning rate; according to the actual situation, the access control devices are grouped for training and aggregation to accelerate the training process and ensure its security, including four modules: access control device grouping, local model training, intra-group aggregation, and inter-group aggregation; in the hierarchical federated learning involving K access control devices and E edge servers, the edge servers Divided into S edge server groups }, randomly select one edge server from each group as the edge aggregation server; K accessible control devices Divide into S groups based on data distribution and training efficiency , each group corresponds to an edge server group; set is the local training round, is the edge aggregation round.

[0019] In this embodiment, the goal is to maximize the diversity of data distribution associated with edge nodes while alleviating the impact of bottleneck access control devices on overall training; in order to make the data distribution of each edge aggregator more balanced, distributed nodes with different data distributions are associated with the same edge aggregator as much as possible to supplement the unbalanced data; Indicates whether edge server e is selected as edge aggregator, It indicates an edge aggregator. 0 means not an edge aggregator; Indicates the accessible control device k(k K) whether it is associated with edge aggregator e, Indicates association, 0 means no association; set | is the size of training data that can access control device k, | is the sum of the training data sizes of the nodes associated with edge aggregator e, represents the diversity of training data distribution between node i and node j; in addition, the training data size is considered to make the data distribution of each edge aggregator more balanced.

[0020] Specifically, the global update is that each accessible control device obtains the global model on the regional chain for a new round of local training, and generates a new round of local models belonging to each accessible control device. The hierarchical trusted federated learning device aggregates the local models of each accessible control device in each group through a preset access control mechanism to generate a new round of global models, and uploads the new round of global models to the blockchain to replace the historical global models and complete the model update. This process will continue to iterate until the predetermined training goal is reached and the training is terminated, and finally a federated learning global model is generated; the above-mentioned predetermined training goal can be "the model accuracy rate reaches 99.5% or above".

[0021] Specifically, the learning performance data of each client device includes the duration of the device operation period, the available memory capacity of each client device at each operation moment in the device operation period, the data throughput of each client device at each operation moment in the device operation period, the number of error logs of each client device in the device operation period, the total number of operation logs of each client device in the device operation period and the idle time of each client device in the device operation period.

[0022] It should be explained that the above-mentioned device running time period specifically refers to the time period from the start of operation of each client device to the end of the operation, which is recorded as the device running time period. The specific duration is determined by factors such as the number of devices, training difficulty, and complexity of training data; the above-mentioned running moments specifically refer to the various time points when each client device is running, which can be obtained through PyTorch's VisualDL, where PyTorch's VisualDL can collect, organize and analyze log and event data from the model training data of each client device by time period, thereby helping to obtain relevant information for each time period and local model training; the length of the above-mentioned device running time period and the time at which each client device is running at the device The number of error logs in the standby running period, the total number of running logs of each client device in the device running period, and the idle time of each client device in the device running period can all be obtained through PyTorch's VisualDL; the device running period duration specifically refers to the duration corresponding to the above-mentioned device running period; the number of error logs of each client device in the device running period specifically refers to the number of error events recorded by the system or application during the entire time period from the start of operation to the end of operation of each client device, wherein the error log is a record automatically generated by each client device when an error or abnormal situation is encountered during operation, which usually includes the time when the error occurred, the error The total number of operation logs of each client device during the device operation period specifically refers to the total number of all log entries automatically recorded by the system or application during the entire period from the start of operation to the end of operation of each client device, where log entries refer to information about events automatically generated in the device, usually including information about operation status, errors, warnings, and other related events; the idle time of each client device during the device operation period specifically refers to the duration of each client device being in a state of not executing any task during the device operation period. This idle state is caused by a variety of reasons, such as waiting for user input, waiting for I / O operations to complete, etc. completion, waiting for network resource response, etc.; the available memory capacity of each of the above-mentioned client devices at each operating moment during the device operation period specifically refers to the size of the unoccupied space in the internal memory of each client device during the device operation period that can be used to store and run application programs and data, which can be obtained through the built-in Linux system of each client device; the data throughput of each of the client devices at each operating moment during the device operation period specifically refers to the amount of data successfully transmitted by each client device at each operating moment during the device operation period, usually measured in bits, and can be obtained by using the ip command of the built-in Linux system of each client device to view the status and configuration information of the network interface.

[0023] The available memory capacity of each client device at each operating moment in the device operation period and the data throughput of each client device at each operating moment in the device operation period are arranged in descending order, thereby extracting the first-ranked available memory capacity as the maximum available memory capacity of each client device in the device operation period, and extracting the first-ranked data throughput as the maximum data throughput of each client device in the device operation period.

[0024] It should be explained that the maximum available memory capacity of each of the above-mentioned client devices during the device operation period specifically refers to the maximum available memory amount of each client device during the device operation period; the maximum data throughput of each of the above-mentioned client devices during the device operation period specifically refers to the maximum data transmission rate of each client device during the device operation period.

[0025] Furthermore, the learning performance indicators of each client device are analyzed in the following specific process: The number of error logs of each client device during the device operation period is ratioed to the total number of operation logs of each client device during the device operation period to obtain the log error rate of each client device during the device operation period.

[0026] The idle time of each client device in the device operation period and the device operation period duration are processed in turn by difference processing and absolute value processing, and the processing result is processed by ratio processing with the device operation period duration to obtain the actual operation time ratio of each client device in the device operation period.

[0027] It should be explained that the log error rate of the above-mentioned client devices in the device operation time period specifically refers to the ratio of the number of error logs generated by each client device in the specified device operation time period to the total number of all operation logs (including error logs and other types of logs, such as information logs, warning logs, etc.) generated in this period; the actual operation time proportion of the above-mentioned client devices in the device operation time period specifically refers to the percentage of the actual operation time of each client device in the device operation time period.

[0028] Through comprehensive analysis of the maximum available memory capacity of each client device during the device operation period, the maximum data throughput of each client device during the device operation period, the log error rate of each client device during the device operation period, and the actual operating time ratio of each client device during the device operation period, the learning performance index of each client device is obtained. The learning performance index of each client device is used to comprehensively and quantitatively evaluate the learning performance of each client device. The specific acquisition method is as follows: ; In the formula, Indicates the maximum available memory capacity of the Nth client device during the device operation period. Indicates the maximum data throughput of the Nth client device during the device operation period. Indicates the log error rate of the Nth client device during the device operation period. Indicates the actual running time ratio of the Nth client device in the device running period, where N is the number of each client device. M, M is the total number of client devices, e is a natural constant, It represents the learning performance index of the Nth client device. The size of the available memory capacity directly affects the efficiency of data processing. When the available memory capacity of a client device is large, it can support more data to be processed and stored at the same time, thereby improving data throughput. At the same time, when the device has sufficient memory capacity, it can maintain operation for a longer time without frequent restart or memory cleaning, which increases the actual running time ratio and thus increases the learning performance index of the client device. When the available memory capacity of a client device is small, the insufficient memory capacity requires frequent memory swapping, resulting in a decrease in data throughput and frequent insufficient memory errors on the device, thereby increasing the log error rate and shortening the actual running time ratio, resulting in a decrease in the learning performance index of the client device.

[0029] represents the learning performance weight factor of the maximum available memory capacity preset in the data-aware library, represents the learning performance weight factor of the maximum data throughput preset in the data-aware library, represents the learning performance weight factor of the log error rate preset in the data perception library, The learning performance weight factor representing the actual running time ratio preset in the data-aware library.

[0030] It needs to be explained that the learning performance weight factors corresponding to the maximum available memory capacity, maximum data throughput, log error rate and actual running time ratio are respectively used for the importance of the maximum available memory capacity, maximum data throughput, log error rate and actual running time ratio in analyzing the learning performance indicators of the client device. For example, there is a pre-set mapping relationship between the real-time learning performance data and the corresponding learning performance weight factor in the data perception library. The learning performance weight factor corresponding to the real-time learning performance data can be matched through the pre-set mapping relationship. The maximum available memory capacity, maximum data throughput, log error rate and actual running time ratio are respectively matched with the pre-set mapping relationship to obtain the learning performance weight factor corresponding to the maximum available memory capacity, the learning performance weight factor corresponding to the maximum data throughput, the learning performance weight factor corresponding to the log error rate and the learning performance weight factor corresponding to the actual running time ratio. The value range in this embodiment is (0, 1).

[0031] Specifically, the process of determining whether to issue a performance warning to each client device is as follows: If the learning performance indicator of a client device is greater than or equal to the client device learning performance threshold preset in the data perception library, there is no need to issue a performance warning for the client device; the client device learning performance threshold specifically refers to the critical value used to determine whether the learning performance of a client device meets the qualified standards during the evaluation of the learning performance of each client device, and is used to measure whether the learning performance of the client device meets the qualified standards; if the above-mentioned learning performance indicator of a client device is greater than or equal to the client device learning performance threshold preset in the data perception library, it means that the learning performance of the client device is qualified, and there is no need to issue a performance warning for the client device.

[0032] If the learning performance index of a client device is less than the client device learning performance threshold preset in the data perception library, it means that the learning performance of the client device is unqualified, and a performance warning needs to be issued for the client device.

[0033] The performance warning for the client device specifically refers to the hierarchical trusted federated learning device sending a warning prompt signal to the client device, with the specific content being "the learning performance of the client device is not up to standard, please optimize the configuration to ensure that the client device can complete the federated learning task."

[0034] S2. Each client device receives and executes the registration instruction, and the hierarchical trusted federated learning device thereby obtains and uploads the public key of each registered client device to the blockchain. The hierarchical trusted federated learning device thereby screens out a number of client devices with access control authority through the public key of each client device in the blockchain, which are recorded as each accessible control device. The blockchain sends global data to each accessible control device, and each accessible control device thereby performs local training on the global data and generates a local model belonging to each accessible control device. The hierarchical trusted federated learning device obtains the local model data belonging to each accessible control device, and analyzes the training feature value of the local model belonging to each accessible control device, and compares it with the local training model feature threshold preset in the data perception library to determine whether to retrain the local model belonging to each accessible control device.

[0035] In a specific embodiment, the above-mentioned blockchain specifically refers to the distributed ledger technology applied in the hierarchical trusted federated learning device, which is responsible for the registration of client devices, the storage and management of public keys, and the screening of access control permissions, ensuring the secure distribution of global data to authorized devices, and supporting the analysis of local model training feature values ​​generated by these devices to evaluate the quality of model training and decide whether retraining is needed, so that each client device can efficiently participate in the federated learning task under the premise of protecting data privacy; the above-mentioned global data specifically refers to a set of data sets used for federated learning task model training, which is designed to be shared among multiple client devices for distributed training; global data usually includes It contains various features and information required for training machine learning models. For example, in the medical field, global data may include patient medical records, test results and diagnostic information from different hospitals; in the financial field, global data may include transaction records, user behavior data and credit assessment information; the specific process of each client device receiving and executing the registration instruction is that each client device establishes communication with the registration node of the blockchain network through an HTTPS secure connection; when a client device receives the registration instruction, a public key and a private key pair will be generated on the client device. The public key is used for encrypted communication and identity authentication, and the private key is stored on the client device for decryption and signing; the client device submits the registration information, including device identification, user name and password. The registration information is sent to the registration node of the blockchain network. After receiving the registration information, the registration node verifies the uniqueness of the device identification and the validity of the public key. If the verification is successful, the registration node records the public key information in a smart contract on the blockchain or stores it in the trusted storage layer of the blockchain network. The registration node generates a registration certificate containing the device identification and the public key, and returns it to the client device. After receiving the registration certificate, the client device verifies its authenticity, such as through signature verification. Once the verification is successful, the client device completes the registration and can start using its public key for subsequent access control and data encryption communication. The hierarchical trusted federated learning device is connected to each client device in the blockchain. The specific screening process is that in the hierarchical trusted federated learning device, each client device will generate a unique public key and private key pair when registering. The hierarchical trusted federated learning device will formulate a set of access control policies according to business needs and security requirements, including: which client devices can access which data on the blockchain, which operations require specific permissions, etc.; when a registered client device attempts to access global data in the blockchain, it can use its public key to prove its identity to the smart contract in the blockchain network. The hierarchical trusted federated learning device will first verify the public key of the client device, check whether the public key has been registered, whether the public key is valid, whether the public key belongs to a trusted entity, etc.;If the public key verification is passed, the client device is considered to have access control authority and can access the corresponding global data, and the client device is recorded as an access control device; if the public key verification is not passed, the client device is considered to have no access control authority and cannot access the corresponding global data. ;

[0036] In a specific embodiment, each of the above-mentioned accessible control devices performs local training on the global data and generates a local model belonging to each accessible control device. The specific process is that each accessible control device initializes the local model according to the global data and copies the global data to the corresponding position of the local model; at the same time, each device prepares a local data set, which contains a subset of the global data set, and inputs a part of the data in the local data set into the local model in batch form. The local model training model calculates the output through forward propagation. During the forward propagation process, the input data passes through each layer of the model until the final output is generated. The output is a predicted value. The mean square error loss function is used to calculate the difference between the output of the model and the actual label to obtain the loss function value of the current batch data; the gradient of the loss function with respect to the model parameters is calculated through the back propagation algorithm, and the gradient of each parameter is calculated using the chain rule; during the back propagation process, the gradient of each parameter is calculated and its cumulative value is updated. The gradient is accumulated to the corresponding parameter, and the stochastic gradient descent optimization algorithm is used to update the parameters of the model, such as the learning rate multiplied by the gradient, to generate a local model.

[0037] Specifically, the local model data of each accessible control device includes the loss function value of the local model of each accessible control device during the model training period, the actual training time of the local model of each accessible control device during the model training period, the number of floating-point operations of the local model of each accessible control device during the model training period, the precision of the local model of each accessible control device during the model training period and the recall rate of the local model of each accessible control device during the model training period.

[0038] It should be explained that the above-mentioned model training period specifically refers to the time period from the start of local training of each accessible control device to the end of training, which is recorded as the model training period. The specific duration is determined by factors such as the number of accessible control devices, specific training requirements, and global data complexity, and can be obtained through PyTorch's VisualDL; the loss function value of the local model of each accessible control device in the model training period, the actual training time of the local model of each accessible control device in the model training period, the number of floating-point operations of the local model of each accessible control device in the model training period, and the number of floating-point operations of each accessible control device in the model training period. The precision of the local model of each accessible control device during the model training period and the recall rate of the local model of each accessible control device during the model training period can be obtained through the training output of the local model of each accessible control device; wherein, the loss function value of the local model of each accessible control device during the model training period specifically refers to a numerical indicator that calculates the difference between the model prediction result and the actual result, reflecting the error of the local model of each accessible control device during the training process of the model training period; the actual training time of the local model of each accessible control device during the model training period specifically refers to the time from the start of model training. The effective time until the end of training; the number of floating-point operations of the local model of each accessible control device during the model training period specifically refers to the total number of floating-point operations that the model needs to perform during one forward propagation and one backward propagation process, where floating-point operations refer to arithmetic operations performed using floating-point numbers during model training, including basic arithmetic operations such as addition, subtraction, multiplication and division, which are the main component of the calculation amount in the model training process; the accuracy of the local model of each accessible control device during the model training period specifically refers to the proportion of truly positive samples in the instances predicted by the model as positive samples, and its calculation formula is The precision rate is: Precision = True Positives / (True Positives + False Positives), where True Positives represent the number of instances correctly predicted as positive samples by the model, and False Positives represent the number of instances incorrectly predicted as positive samples by the model. The precision rate reflects the model's ability to identify positive samples. The recall rate of the local model of each accessible control device during the model training period specifically refers to the proportion of instances that are correctly predicted as positive samples among all instances that are actually positive samples. The calculation formula is: Recall Rate = True Positives / (True Positives + False Negatives), where True Positives represent the number of instances correctly predicted as positive samples by the model, and False Negatives represent the number of instances that are actually positive samples but are incorrectly predicted as negative samples by the model.

[0039] The precision of the local model of each accessible control device during the model training period and the recall of the local model of each accessible control device during the model training period are processed to obtain a balance score of the local model of each accessible control device during the model training period.

[0040] It should be explained that the above-mentioned data processing specifically refers to multiplying and adding the precision of the local model of each accessible control device during the model training period and the recall of the local model of each accessible control device during the model training period in sequence, then ratio processing the multiplication result with the addition result, and finally doubling the ratio processing result; the above-mentioned balance score of the local model of each accessible control device during the model training period specifically refers to the harmonic mean of the precision and recall of the local model of each accessible control device during the model training period.

[0041] Furthermore, the local model training feature values ​​of each accessible control device are specifically analyzed as follows: Obtaining a learning performance indicator for each accessible control device; wherein the learning performance indicator for each accessible control device specifically refers to a performance indicator for comprehensively and quantitatively evaluating the learning performance of each accessible control device obtained by comprehensive analysis of the maximum available memory capacity of each accessible control device during the device operation period, the maximum data throughput of each accessible control device during the device operation period, the log error rate of each accessible control device during the device operation period, and the actual operating time ratio of each accessible control device during the device operation period; obtaining learning performance data of each accessible control device, and obtaining the learning performance indicator of each accessible control device through data analysis and processing, wherein the learning performance data of each accessible control device is obtained in the same manner as the learning performance data of the above-mentioned client devices, and the learning performance indicator of each accessible control device is also consistent with the analysis method of the learning performance indicator of the above-mentioned client devices, thereby obtaining the learning performance indicator of each accessible control device.

[0042] Through the loss function value of the local model of each accessible control device in the model training period, the actual training time of the local model of each accessible control device in the model training period, the number of floating-point operations of the local model of each accessible control device in the model training period, the balance score of the local model of each accessible control device in the model training period, and the learning performance index of each accessible control device, the training characteristic value of the local model of each accessible control device is obtained through comprehensive analysis. The training characteristic value of the local model of each accessible control device is used to comprehensively and quantitatively evaluate the training effect of the local model of each accessible control device. The specific acquisition method is as follows: ; In the formula, represents the loss function value of the local model to which the Rth accessible control device belongs during the model training period, Indicates the actual training time of the local model of the Rth accessible control device in the model training period, Indicates the reference training duration preset in the data perception library. Indicates the number of floating-point operations of the local model of the Rth accessible control device during the model training period, Indicates the reference number of floating-point operations preset in the data perception library. represents the balance score of the local model to which the Rth accessible control device belongs during the model training period, represents the learning performance index of the Rth accessible control device, where R is the number of each accessible control device. S, S is the total number of accessible control devices, Indicates the training characteristic value of the local model to which the Rth accessible control device belongs. If the number of floating-point calculations of the local model to which a certain accessible control device belongs is too many, the actual training time will be too long, resulting in the model overfitting the noise and details in the training data, and the generalization ability of the model will decrease, thereby increasing the loss function value of the model, and also causing the model precision and recall rate to decrease, and the balance score will also decrease accordingly, ultimately resulting in a decrease in the training characteristic value of the local model to which the accessible control device belongs; if the number of floating-point calculations of the local model to which a certain accessible control device belongs is too small, the actual training time will be too short, resulting in underfitting of the model, and the model precision and recall rate will decrease, so that the balance score will also decrease, and the loss function value of the model will increase, and ultimately the training characteristic value of the local model to which the accessible control device belongs will be reduced; if the learning performance index of the accessible control device is larger, it means that the learning performance of the accessible control device is better, which is helpful to improve the model training effect, and the loss function value can converge to a lower level faster, and the loss function value will decrease, while also increasing the model precision and recall rate, so that the balance score increases, thereby increasing the training characteristic value of the local model to which the accessible control device belongs.

[0043] It should be explained that the above-mentioned reference training duration specifically refers to the optimal training duration of the local model of the access control device preset in the data perception library; the above-mentioned reference number of floating-point operations specifically refers to the number of floating-point operations of the local model of the access control device preset in the data perception library.

[0044] Represents the training feature influence coefficient of the loss function value preset in the data perception library, The training feature influence coefficient representing the actual training duration preset in the data perception library, The training feature correction factor representing the number of floating-point operations preset in the data perception library, represents the training feature influence coefficient of the preset balance score in the data perception library, Represents the training feature influence coefficient of the learning performance indicator preset in the data perception library.

[0045] It needs to be explained that the loss function value, actual training time, number of floating-point operations, balance score and training feature influence coefficients corresponding to the learning performance index are respectively used for the importance of the loss function value, actual training time, number of floating-point operations, balance score and learning performance index in analyzing the importance of the local model training feature value. For example, there is a preset mapping relationship between the real-time local model data and the corresponding training feature influence coefficient in the data perception library. The training feature influence coefficient corresponding to the real-time local model data can be matched through the preset mapping relationship, and the loss function value, actual training time, number of floating-point operations and balance score are respectively matched with the preset The mapping relationship is matched to obtain the training feature influence coefficient corresponding to the loss function value, the training feature influence coefficient corresponding to the actual training time, the training feature correction coefficient corresponding to the number of floating-point operations, and the training feature influence coefficient corresponding to the balance score; for example, there is a pre-set mapping relationship between the real-time learning performance indicator and the corresponding training feature influence coefficient in the data perception library, and the training feature influence coefficient corresponding to the real-time learning performance indicator can be matched through the pre-set mapping relationship. The learning performance indicator is matched with the pre-set mapping relationship to obtain the training feature influence coefficient corresponding to the learning performance indicator. In this embodiment, the value range is (0, 1).

[0046] Specifically, the determination of whether to retrain the local model of each accessible control device is as follows: If the training characteristic value of the local model belonging to a certain accessible control device is greater than or equal to the local training model characteristic threshold preset in the data perception library, there is no need to re-train the local model belonging to the accessible control device; the local training model characteristic threshold specifically refers to the critical value used to judge whether the training effect of the local model belonging to a certain accessible control device meets the qualification standard during the training effect evaluation of the local models belonging to each accessible control device, and is used to measure whether the training effect of the local model belonging to the accessible control device is good; the above-mentioned training characteristic value of the local model belonging to a certain accessible control device is greater than or equal to the local training model characteristic threshold preset in the data perception library, indicating that the training effect of the local model belonging to the accessible control device is good, and there is no need to re-train the local model belonging to the accessible control device.

[0047] If the training feature value of the local model of a certain accessible control device is less than the local training model feature threshold preset in the data perception library, it means that the training effect of the local model of the accessible control device is not good, and the local model of the accessible control device needs to be retrained.

[0048] S3. The hierarchical trusted federated learning device obtains the training parameters of each accessible control device, analyzes and obtains the training evaluation index of each accessible control device, and then intelligently groups the accessible control devices according to the preset grouping mechanism to obtain groups of accessible control devices. The hierarchical trusted federated learning device aggregates the local models of each group of accessible control devices through the preset access control mechanism, generates a global model, and uploads the global model to the blockchain, finally completing the global model update of the blockchain.

[0049] In a specific embodiment, the above preset access control mechanism specifically includes the following steps: Figure 3 As shown: 1) Access control device k to upload local model Key information, including access control device identifier , the identifier of the model and hash code ; 2) Aggregation Server As the requester, generate a random number X, which will be the message Send to blockchain; 3) Aggregation server Send the message Sent to the accessible control device k through off-chain communication; 4) The accessible control device k uses the public key and private key , decrypt and ; 5) The access control device k verifies the aggregation server by comparing the two values ​​of 𝑋 After the authentication is passed, the aggregation server Will be granted access to control device k submission On-chain; 6) Once approved, the access control device k can send the model encrypted through the off-chain channel To the aggregation server ;7) Aggregation Server The model is saved as a copy through authorization and broadcasted in the aggregation server group; the replication mechanism introduced in 7) realizes fault tolerance and load balancing without additional communication cost. The authorized access control device stores the model as a copy locally, which can effectively avoid server single point failure SPOF; in order to balance the communication overhead of model transmission, the number of copies is calculated by obtaining the hash code and its own identifier, and the modulo operation is performed on the total number of available copies.

[0050] It should be explained that the preset access control mechanism of the hierarchical trusted federated learning device mainly focuses on ensuring the security of model storage and access, and can effectively defend against common attacks; when an attacker attempts to bypass access control and directly requests the model from all accessible control devices of the model without submitting the request to the blockchain, the request is invalid, because the preset access control mechanism of the hierarchical trusted federated learning device is implemented using blockchain technology, and all requests and interactions need to be recorded and verified on the blockchain. If the attacker does not submit the request through the blockchain, he cannot obtain legal access rights, so the bypasser's request is invalid; when the attacker launches a Sybil attack and tries to use a large number of identities to access the model, due to the uniqueness of the blockchain certificate, the attacker cannot copy multiple blockchain certificates. Even if he creates multiple false identities, he cannot pass the identity authentication, and any request from the false identity will not be processed. Therefore, the Sybil attack will not succeed; when the attacker launches a man-in-the-middle attack to interfere And manipulate the communication between the model owner and the requester, trying to steal the model by impersonating the requester, the attacker cannot forge or tamper with the data on the chain. In addition, the random number verification proposed by the access control mechanism can detect replay attacks; when the attacker launches model tampering, the attacker tampered with the local model as the model owner and sent it to the requester, but in the preset access control mechanism of the hierarchical trusted federated learning device, when the requester uses the hash code on the chain to verify the integrity of the model, this attack can be detected, resulting in the failure of its tampering; in summary, the preset access control mechanism of the hierarchical trusted federated learning device can ensure the security of model storage and access to a certain extent; the above-mentioned aggregation of local models belonging to each group of access control devices specifically refers to the use of asynchronous aggregation between groups, and each group submits a model and the current latest historical global model to jointly aggregate to generate the current round of global models; this scheme combines the advantages of synchronous and asynchronous aggregation, and adopts synchronous aggregation within the group and asynchronous aggregation between groups, such as Figure 4 As shown in the figure, after completing the grouping, the accessible control device submits the model update to the aggregation edge server within the group to perform synchronous aggregation and reduce sample loss. In order to improve the training efficiency, the global model aggregation is completed by asynchronous aggregation between groups. At the same time, considering the impact of uneven data distribution on the global model, the historical global model is used to compensate for the information loss of a single group model.

[0051] Specifically, the training evaluation index of each accessible control device is analyzed in the following process: The training parameters of each accessible control device specifically include the real-time training speed of the local model of each accessible control device during the model training period, the number of samples correctly predicted by the local model of each accessible control device during the model training period, and the total number of samples predicted by the local model of each accessible control device during the model training period.

[0052] It should be explained that the real-time training speed of the local models belonging to the above-mentioned each accessible control device in the model training period, the number of samples correctly predicted by the local models belonging to the accessible control devices in the model training period, and the total number of samples predicted by the local models belonging to the accessible control devices in the model training period can all be obtained through PyTorch's VisualDL; wherein, the real-time training speed of the local models belonging to the accessible control devices in the model training period specifically refers to the amount of data processed per unit time during the training process of the local models belonging to the accessible control devices in the model training period; the number of samples correctly predicted by the local models belonging to the accessible control devices in the model training period specifically refers to the number of samples whose prediction results are consistent with the actual labels when the model predicts the training data set during the model training process, reflecting the degree of fit of the model to the data during the training stage; the total number of samples predicted by the local models belonging to the accessible control devices in the model training period specifically refers to the total number of all samples processed by the model and given prediction results during the model training process.

[0053] The real-time training speed of the local model of each accessible control device in the model training period is processed with variance to obtain a discrete value of the training speed of the local model of each accessible control device in the model training period.

[0054] The number of samples correctly predicted by the local model of each accessible control device during the model training period is ratioed to the total number of samples predicted by the local model of each accessible control device during the model training period to obtain the model training accuracy of each accessible control device during the model training period.

[0055] It should be explained that the discrete value of the training speed of the local model belonging to each of the above-mentioned accessible control devices during the model training period specifically refers to a statistic obtained by variance processing of the real-time training speed of each accessible control device for model training during the model training period, reflecting the degree of discreteness of the training speed of each accessible control device during the model training process; the model training accuracy rate of each of the above-mentioned accessible control devices during the model training period specifically refers to the ratio between the number of samples correctly predicted by the local model belonging to each accessible control device during the model training period and the total number of predicted samples, reflecting the ability of the model to correctly predict samples.

[0056] The training evaluation index of each accessible control device is obtained by comprehensive analysis based on the number of floating-point operations of the local model of each accessible control device in the model training period, the actual training duration of the local model of each accessible control device in the model training period, the discrete value of the training speed of the local model of each accessible control device in the model training period, the model training accuracy of each accessible control device in the model training period, and the learning performance index of each accessible control device. The training evaluation index of each accessible control device is used to comprehensively and quantitatively evaluate the training performance of each accessible control device. The specific acquisition method is as follows: ; In the formula, Indicates the number of floating-point operations of the local model of the Rth accessible control device during the model training period, Indicates the reference number of floating-point operations preset in the data perception library. Indicates the actual training time of the local model to which the Rth accessible control device belongs during model training. Indicates the reference training duration preset in the data perception library. It represents the discrete value of the training speed of the local model of the Rth accessible control device during the model training period. represents the model training accuracy of the local model of the Rth accessible control device during the model training period, represents the learning performance index of the Rth accessible control device, where R is the number of each accessible control device. S, S is the total number of accessible control devices, e is a natural constant, Represents the training evaluation index of the Rth accessible control device. If an accessible control device has too many floating-point operations during the model training process, the training complexity increases, resulting in a longer actual training time and reduced training efficiency. At the same time, too many floating-point operations will cause the training speed to fluctuate greatly at different stages, thereby increasing the discrete value of the training speed. Excessive training time and too many floating-point operations will also lead to overfitting of the model, reducing the model accuracy, and ultimately reducing the training evaluation index of the accessible control device. If an accessible control device has too few floating-point operations during the model training process, the actual training time will be too short, resulting in underfitting of the model, and the model accuracy will also decrease accordingly, thereby reducing the training evaluation index of the accessible control device. If the learning performance index of the accessible control device is larger, it means that the learning performance of the accessible control device is better, which is helpful to improve the model training effect and increase the model accuracy, thereby increasing the training evaluation index of the accessible control device.

[0057] It should be explained that the above-mentioned learning performance indicators of each access control device specifically refer to the indicators obtained by comprehensive analysis of the maximum available memory capacity of each access control device during the device operation period, the maximum data throughput of each access control device during the device operation period, the log error rate of each access control device during the device operation period, and the actual operating time ratio of each access control device during the device operation period when evaluating the learning performance of each access control device; the above-mentioned reference training time specifically refers to the optimal training time of the local model of the access control device preset in the data perception library; the above-mentioned reference number of floating-point operations specifically refers to the optimal adaptation value of the number of floating-point operations of the local model of the access control device preset in the data perception library.

[0058] Represents the training evaluation correction factor of the number of floating-point operations preset in the data perception library, The training evaluation weight coefficient representing the actual training duration preset in the data perception library, The training evaluation weight coefficient representing the discrete value of training speed preset in the data perception library, Represents the training evaluation weight coefficient of the model training accuracy preset in the data perception library, Represents the training evaluation weight coefficient of the learning performance indicator preset in the data perception library.

[0059] It needs to be explained that the training evaluation weight coefficients corresponding to the number of floating-point operations, actual training time, training speed discrete values, model training accuracy and learning performance indicators are respectively used for the importance of the number of floating-point operations, actual training time, training speed discrete values, model training accuracy and learning performance indicators in analyzing the training evaluation index. For example, there is a preset mapping relationship between the real-time accessible control device training parameters and the corresponding training evaluation weight coefficients in the data perception library. The pre-set mapping relationship can be used to match the training evaluation weight coefficients corresponding to the real-time accessible control device training parameters. The training speed discrete values ​​and the model training accuracy are respectively matched with the pre-set mapping relationship to obtain the training speed discrete values ​​corresponding to the training parameters. The training evaluation weight coefficient and the training evaluation weight coefficient corresponding to the model training accuracy rate; for example, there is a pre-set mapping relationship between the real-time number of floating-point operations, the actual training duration and the learning performance index and the corresponding training evaluation weight coefficient in the data perception library. The real-time number of floating-point operations, the actual training duration and the training evaluation weight coefficient corresponding to the learning performance index can be matched through the pre-set mapping relationship. The number of floating-point operations, the actual training duration and the learning performance index are matched with the pre-set mapping relationship to obtain the training evaluation correction coefficient corresponding to the number of floating-point operations, the training evaluation weight coefficient corresponding to the actual training duration and the training evaluation weight coefficient corresponding to the learning performance index. In this embodiment, the value range is (0, 1).

[0060] Furthermore, the access control devices are intelligently grouped according to a preset grouping mechanism, and the specific grouping process is as follows: The training evaluation index of a certain accessible control device is matched with the group corresponding to the training evaluation index interval of each accessible control device preset in the data perception library to complete the intelligent grouping of the accessible control device.

[0061] It should be explained that the above matching of the training evaluation index of a certain accessible control device with the group corresponding to the training evaluation index interval of each accessible control device preset in the data perception library is specifically carried out as follows: Match the training evaluation index of a certain access control device with the groups corresponding to the training evaluation index intervals of each access control device preset in the data perception library, thereby matching to obtain the group of the training evaluation index of the access control device; the groups corresponding to the training evaluation index intervals of the above-mentioned access control devices are formulated by authoritative model training monitoring agencies or standardization organizations through data collection, collation, and encryption processing. The training evaluation index of each access control device is carefully divided, and the corresponding groups are designed for the training evaluation index interval range of each access control device based on the model qualification standard, threat and risk analysis, and application requirements and compliance requirements; for example, if the training evaluation index of a certain access control device in this example is 6, it belongs to the access control device training evaluation index interval corresponding to [3, 7], and the group corresponding to the access control device training evaluation index interval of [3, 7] preset in the data perception library is "2".

[0062] The training evaluation index of each accessible control device is matched with the group corresponding to the training evaluation index interval of each accessible control device preset in the data perception library according to the above operation, thereby completing the intelligent grouping of each accessible control device.

[0063] In a specific embodiment, the above-mentioned intelligent grouping of each accessible control device can also be completed by the following method: firstly, the computing capability similarity of each accessible control device is calculated, and each accessible control device is required to upload the device CPU cycle frequency, and then the computing capability similarity of each accessible control device is calculated. represents the number of CPU cycles required for the accessible control device k to execute a data sample, which can be measured offline and is known in advance. With the same number of bits, the number of CPU cycles required to run a local iteration of accessible control device k is ;use Indicates the CPU cycle frequency of the accessible control device k, using express vector, combined with the number of clusters S, K accessible control devices are grouped according to the CPU cycle frequency Sorted from small to large, they are divided into S groups, which can access the control devices and The computing power similarity between them is: ; Among them, K can access control devices ,i K, j K, Represents the Gth edge server group; the similarity of the data distribution of accessible control devices. In order to alleviate the problem of low efficiency of model gradient similarity calculation in cluster federated learning, this scheme uses the sparsity of neural networks to reflect the data distribution of accessible control devices; in each local training round, the accessible control device k is defined to use the local data set Training a local model ,from The feature map extracted by the ReLU layer; in the feedforward process, that is, the process of unidirectional transmission of local data from the input layer to the output layer, q channels are randomly selected And extract their corresponding accessible control device sparsity, accessible control device k from the given input of Extract the feature matrix from the output of the channel ,calculate of The channel characteristics are as follows: ; in, It is a function that calculates how many zeros there are in the matrix. H and W are the height and width of the feature matrix respectively. By averaging all sample features, the data set is calculated. superior Channel characteristics: ; The accessible control device k forms a feature vector during the local training process ; Each access control device generates a feature vector that reflects the local data distribution; The top layer uses cosine similarity as a metric to calculate the similarity between vectors; Given an access control device , The eigenvector of , , and its distribution similarity is calculated as follows: ; In order to ensure the efficiency of training, randomly select the features of the zth accessible control device , and then calculate its feature similarity with other accessible control devices to generate a final similarity vector: ; Select the accessible control devices with large similarity values ​​(i.e., large data distribution differences) to aggregate into a group. The principle of selecting the final training device is to select the devices with the same computing power. Select the device with the largest data similarity value (i.e., the data distribution difference is large) from the devices Access control devices are aggregated into a group for training, and cluster similarity calculation is completed through smart contracts. The clustering process is parallel to the local training of the access control devices, so it will not cause efficiency bottlenecks; although access control devices with similar efficiency are divided into the same cluster, the aggregation process within the cluster is still synchronized. Therefore, a timeout mechanism is set to avoid continuous waiting for stragglers.

[0064] Specifically, the completion of the global model update of the blockchain is to obtain the adjacent historical global model in the blockchain, and update the adjacent historical global model to the global model through the preset update mode in the blockchain to complete the global model update of the blockchain.

[0065] The preset update mode specifically performs global model aggregation on the currently generated global model and the adjacent historical global model according to the global model aggregation formula built into the hierarchical trusted federated learning device, thereby uploading the aggregated newly generated global model to the blockchain.

[0066] The global model aggregation adopts the method of iterating the historical model. The global model aggregation formula built into the hierarchical trusted federated learning device is as follows: ; in, is the weight, is the global model, represents the local model of round t-1, represents the Sth group, represents the global model of the Sth group in the tth round, i represents the node of the global model. Since each aggregation of the full set model is to aggregate the currently generated global model with the adjacent historical global models, the maximum value of i is 2.

[0067] The above contents are merely examples and explanations of the structure of the present invention. The technicians in this technical field may make various modifications or additions to the specific embodiments described or replace them in a similar manner. As long as they do not deviate from the structure of the invention or exceed the scope defined by the present invention, they should all fall within the protection scope of the present invention.

Claims

1. A hierarchical trusted federated learning method with data awareness, characterized in that: include: S1. The hierarchical trusted federated learning device obtains the learning performance data of each client device, thereby analyzing the learning performance indicators of each client device, and compares them with the client device learning performance threshold preset in the data perception library to determine whether to issue a performance warning for each client device; S2. Each client device receives and executes the registration instruction, and the hierarchical trusted federated learning device thereby obtains and uploads the public key of each registered client device to the blockchain, thereby the hierarchical trusted federated learning device selects a number of client devices with access control authority through the public key of each client device in the blockchain, which are recorded as each accessible control device, and the blockchain sends global data to each accessible control device, thereby each accessible control device performs local training on the global data and generates a local model belonging to each accessible control device, and the hierarchical trusted federated learning device obtains the local model data belonging to each accessible control device, and analyzes and obtains the training feature value of the local model belonging to each accessible control device, and compares it with the local training model feature threshold preset in the data perception library to determine whether to retrain the local model belonging to each accessible control device; S3. The hierarchical trusted federated learning device obtains the training parameters of each accessible control device, analyzes and obtains the training evaluation index of each accessible control device, and then intelligently groups the accessible control devices according to the preset grouping mechanism to obtain groups of accessible control devices. The hierarchical trusted federated learning device aggregates the local models of each group of accessible control devices through the preset access control mechanism, generates a global model, and uploads the global model to the blockchain, finally completing the global model update of the blockchain.

2. A hierarchical trusted federated learning method with data perception capability according to claim 1, characterized in that: The learning performance data of each client device specifically includes the duration of the device operation period, the available memory capacity of each client device at each operation moment during the device operation period, the data throughput of each client device at each operation moment during the device operation period, the number of error logs of each client device during the device operation period, the total number of operation logs of each client device during the device operation period, and the idle time of each client device during the device operation period; The available memory capacity of each client device at each operating moment in the device operation period and the data throughput of each client device at each operating moment in the device operation period are arranged in descending order, thereby extracting the first-ranked available memory capacity as the maximum available memory capacity of each client device in the device operation period, and extracting the first-ranked data throughput as the maximum data throughput of each client device in the device operation period.

3. A hierarchical trusted federated learning method with data perception capability according to claim 2, characterized in that: The learning performance indicators of each client device are analyzed in detail as follows: The number of error logs of each client device during the device operation period is compared with the total number of operation logs of each client device during the device operation period to obtain the log error rate of each client device during the device operation period; Perform difference processing and absolute value processing on the idle time of each client device in the device operation period and the device operation period, and perform ratio processing on the processing result and the device operation period to obtain the actual operation time ratio of each client device in the device operation period; Through comprehensive analysis of the maximum available memory capacity of each client device during the device operation period, the maximum data throughput of each client device during the device operation period, the log error rate of each client device during the device operation period, and the actual operating time proportion of each client device during the device operation period, the learning performance index of each client device is obtained. The learning performance index of each client device is used to comprehensively and quantitatively evaluate the learning performance of each client device.

4. A hierarchical trusted federated learning method with data perception capability according to claim 1, characterized in that: The specific process of determining whether to issue a performance warning to each client device is as follows: If the learning performance index of a client device is greater than or equal to the client device learning performance threshold preset in the data perception library, there is no need to issue a performance warning for the client device; If the learning performance index of a client device is less than the client device learning performance threshold preset in the data perception library, a performance warning needs to be issued for the client device; The performance warning for the client device specifically refers to the hierarchical trusted federated learning device sending a warning prompt signal to the client device, with the specific content being "the learning performance of the client device is not up to standard, please optimize the configuration to ensure that the client device can complete the federated learning task." 5. A hierarchical trusted federated learning method with data perception capability according to claim 1, characterized in that: The local model data of each accessible control device specifically includes the loss function value of the local model of each accessible control device during the model training period, the actual training time of the local model of each accessible control device during the model training period, the number of floating-point operations of the local model of each accessible control device during the model training period, the precision of the local model of each accessible control device during the model training period, and the recall rate of the local model of each accessible control device during the model training period; The precision of the local model of each accessible control device during the model training period and the recall of the local model of each accessible control device during the model training period are processed to obtain a balance score of the local model of each accessible control device during the model training period.

6. A hierarchical trusted federated learning method with data perception capability according to claim 5, characterized in that: The local model training feature values ​​of each accessible control device are specifically analyzed as follows: Obtain learning performance indicators of each accessible control device; Through the loss function value of the local model of each accessible control device in the model training period, the actual training time of the local model of each accessible control device in the model training period, the number of floating-point operations of the local model of each accessible control device in the model training period, the balance score of the local model of each accessible control device in the model training period, and the learning performance index of each accessible control device, the training characteristic value of the local model of each accessible control device is obtained through comprehensive analysis. The training characteristic value of the local model of each accessible control device is used to comprehensively and quantitatively evaluate the training effect of the local model of each accessible control device. The specific acquisition method is as follows: ; In the formula, represents the local model training feature value of the Rth accessible control device, represents the loss function value of the local model to which the Rth accessible control device belongs during the model training period, Indicates the actual training time of the local model of the Rth accessible control device in the model training period, Indicates the reference training duration preset in the data perception library. Indicates the number of floating-point operations of the local model of the Rth accessible control device during the model training period, Indicates the reference number of floating-point operations preset in the data perception library. represents the balance score of the local model to which the Rth accessible control device belongs during the model training period, represents the learning performance index of the Rth accessible control device, Represents the training feature influence coefficient of the loss function value preset in the data perception library, The training feature influence coefficient representing the actual training duration preset in the data perception library, The training feature correction factor representing the number of floating-point operations preset in the data perception library, represents the training feature influence coefficient of the preset balance score in the data perception library, represents the training feature influence coefficient of the learning performance indicator preset in the data perception library, R is the number of each accessible control device, S, S is the total number of accessible control devices.

7. A hierarchical trusted federated learning method with data perception capability according to claim 1, characterized in that: The specific process of determining whether to retrain the local model of each accessible control device is as follows: If the training feature value of the local model to which a certain access control device belongs is greater than or equal to the local training model feature threshold preset in the data perception library, there is no need to retrain the local model to which the access control device belongs; If the training feature value of the local model of a certain accessible control device is less than the local training model feature threshold preset in the data perception library, the local model of the accessible control device needs to be retrained.

8. A hierarchical trusted federated learning method with data perception capability according to claim 1, characterized in that: The training evaluation index of each accessible control device is the training evaluation index of each accessible control device, and the specific analysis process is: The training parameters of each accessible control device specifically include the real-time training speed of the local model of each accessible control device during the model training period, the number of samples correctly predicted by the local model of each accessible control device during the model training period, and the total number of samples predicted by the local model of each accessible control device during the model training period; Performing variance processing on the real-time training speed of the local model of each accessible control device during the model training period to obtain a discrete value of the training speed of the local model of each accessible control device during the model training period; The number of samples correctly predicted by the local model of each accessible control device in the model training period is compared with the total number of samples predicted by the local model of each accessible control device in the model training period to obtain the model training accuracy of each accessible control device in the model training period; Through the number of floating-point operations of the local model of each accessible control device in the model training period, the actual training duration of the local model of each accessible control device in the model training period, the discrete value of the training speed of the local model of each accessible control device in the model training period, the model training accuracy of each accessible control device in the model training period and the learning performance index of each accessible control device, a comprehensive analysis is performed to obtain the training evaluation index of each accessible control device. The training evaluation index of each accessible control device is used to comprehensively and quantitatively evaluate the training performance of each accessible control device.

9. A hierarchical trusted federated learning method with data perception capability according to claim 1, characterized in that: The access control devices are intelligently grouped according to the preset grouping mechanism. The specific grouping process is as follows: Matching the training evaluation index of a certain access control device with the groups corresponding to each training evaluation index interval preset in the data perception library, thereby obtaining the group corresponding to the access control device to complete the intelligent grouping of the access control device; The training evaluation index of each accessible control device is synchronously matched with the groups corresponding to each training evaluation index interval preset in the data perception library according to the above-mentioned intelligent grouping process, and finally the group corresponding to each access control device is obtained, thereby completing the intelligent grouping of each accessible control device.

10. A hierarchical trusted federated learning method with data perception capability according to claim 1, characterized in that: The completing the global model update of the blockchain specifically involves obtaining the adjacent historical global model in the blockchain, and updating the adjacent historical global model to the global model through an update mode preset in the blockchain, so as to complete the global model update of the blockchain; The preset update mode specifically performs global model aggregation on the currently generated global model and the adjacent historical global model according to the global model aggregation formula built into the hierarchical trusted federated learning device, thereby uploading the aggregated newly generated global model to the blockchain.

Citation Information

Patent Citations

  • A federated learning model training method based on data feature-aware aggregation

    CN112488322B

  • Clustering federal learning method based on perception of data difference between clients

    CN117494846A

  • Federated learning model training method based on data feature perception aggregation

    CN112488322A

  • Decentralized federal learning method and device based on block chain, and electronic equipment

    CN114327901A

  • Efficient data perception layered federated learning method based on task unloading

    CN114828095A