Method for predicting efficiency of power energy conversion equipment of cigarette factory based on federated learning
By adopting the multi-center global clustering strategy and attention condensation network of federal learning in the performance prediction of power energy conversion equipment in cigarette factory, the prediction complexity brought about by data privacy and device differences is solved, and efficient and accurate device performance prediction is achieved.
Patent Information
- Application Number
- CN202510176601.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-18
- Publication Date
- 2025-05-23
AI Technical Summary
In the performance prediction of power energy conversion equipment in cigarette plants, the traditional centralized learning framework is difficult to integrate and share sensitive production data of each cigarette plant, and the differences in equipment operating environment and process flow increase the complexity of the prediction model, resulting in insufficient generalization capabilities of the model and serious client drift problems.
Using a multi-center global clustering strategy based on federated learning, clients with the same prediction tasks are grouped and aggregated operations are performed within each group. Through attention condensation network, global parameters are dynamically adjusted to adapt to the data distribution of the target client, and the personalization performance and generalization capabilities of the model are improved.
It effectively protects data privacy, makes full use of diversified production data characteristics, improves the generalization performance of the global model and the personalization of the client model, alleviates the client drift problem, and improves the accuracy and robustness of device performance prediction.
Smart Images

Figure CN120031204A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of energy conversion equipment energy efficiency prediction in cigarette factories, belonging to the category of intelligent prediction algorithms, and specifically relates to a method for predicting the efficiency of power energy conversion equipment in cigarette factories based on federated learning. Background Art
[0002] In the crucial field of predicting the efficiency of power energy conversion equipment in cigarette factories, the production data owned by each cigarette factory is highly sensitive. This data covers various key information of equipment operation, including but not limited to the real-time energy consumption of the equipment, operation duration, production efficiency, and various process parameters. Under the traditional centralized learning framework, there are huge obstacles to integrating and sharing offline data. On the one hand, due to various considerations such as commercial secret protection and data security, each cigarette factory is reluctant to centrally upload and share this sensitive data. On the other hand, from a technical perspective, there are differences in the data formats, data standards, and the equipment operation states and process flows reflected by the data among different cigarette factories, which makes data integration extremely complex.
[0003] However, the differences in equipment operation environments and process flows between different factory areas are an objective existence that cannot be ignored. Each cigarette factory may have different equipment operation environmental conditions due to factors such as geographical location, production scale, and product positioning. For example, there are differences in aspects such as temperature and humidity, and power supply stability. At the same time, the process flows of each factory may also have unique features. From raw material processing to finished product packaging, the operation methods and parameter settings of each link are different. These differences put higher requirements on the generalization ability of the prediction model. An excellent prediction model needs to be able to adapt to various complex situations in different factory areas and accurately predict the efficiency of power energy conversion equipment, providing a reliable basis for the production decision-making of the enterprise.
[0004] The emergence of federated learning has brought new ideas and methods for solving the problems of data privacy and using diverse data for modeling. Through the prediction means of federated learning, each cigarette factory can retain data locally and only upload model parameters to participate in global aggregation. In this way, it not only effectively protects data privacy and avoids the risk of data leakage, but also can make full use of the diverse production data characteristics of each factory for modeling. The unique data characteristics of each factory can be incorporated into the training of the global model without exposing the data itself, improving the performance of the model.
[0005] However, constructing a power energy conversion equipment efficiency prediction model for cigarette factories through a federated learning framework is not smooth sailing, and its inherent characteristics and many challenges need to be fully considered. First of all, the power energy conversion equipment efficiency prediction model for cigarette factories has a clear and special goal. It aims to help each client achieve better prediction results on their own equipment, which is significantly different from the goals of traditional federated learning frameworks. Traditional federated learning frameworks may focus more on building a general global model to adapt to a wide range of application scenarios. In the scenario of cigarette factories, the core goal of the power energy conversion equipment efficiency prediction model is to achieve information sharing between clients within the federated framework, thereby improving the prediction performance of local models on their respective data. This requires that in the entire federated learning process, priority must be given to the characteristics of the equipment within the client. Each client's equipment has its own unique operating rules, performance characteristics, and adaptation relationship with the production process. Only by taking these equipment characteristics as the main driving force of the entire federated process and deeply exploring the intrinsic relationship between equipment characteristics and efficiency can the goal of the prediction model be better achieved.
[0006] Secondly, heterogeneous data from different clients may cause a series of problems in the process of model parameter aggregation. In actual federated learning scenarios, data from different clients often show non-independent and identically distributed characteristics. Due to the differences in the origin or model of equipment in various cigarette factories, the data generated by these equipment will also be different in distribution. For example, the distribution of energy consumption data of model A refrigerator used in a factory may be very different from that of model B refrigerator used in another factory. The non-independent and identically distributed nature of this data will cause the models of each client to converge in different directions during the training process, which is the so-called "client drift" phenomenon. In general federated learning scenarios, "client drift" has been a long-standing and difficult to solve problem. In the context of the efficiency prediction model of power energy conversion equipment in cigarette factories, this problem is further exacerbated due to the diversity and complexity of equipment differences. Client drift will have a serious impact on the aggregation and convergence performance of the global model, making it difficult for the global model to effectively integrate the information of each client, resulting in unstable model training and reduced prediction accuracy, which cannot meet the needs of cigarette factories for accurate prediction of equipment efficiency. Summary of the invention
[0007] In order to solve the deficiencies and difficulties in the above-mentioned prior art, through the research and development design of the inventor team, the present invention provides a method and means for grouping clients with the same prediction task using a multi-center global clustering strategy and performing aggregation operations within each group, aiming to better adapt to the heterogeneity and diversified needs of data in industrial scenarios. The global parameters returned by the server are dynamically adjusted through the attention condensation network to optimize the parameter subset that adapts to the target client data distribution. This method uses the attention mechanism to significantly improve the personalized performance of the model, taking into account the synergistic effect of global model sharing and the accuracy of independent client tasks.
[0008] The training method based on the federated learning framework allows each cigarette factory to retain data locally and only upload model parameters for global aggregation. This not only effectively protects data privacy, but also makes full use of the diverse production data characteristics of each factory for modeling. Under this framework, after dynamic aggregation of the model parameters of each factory, a more generalized global model can be formed, thereby providing more accurate decision support for equipment performance prediction. This method not only complies with the security specifications of industrial data, but also breaks through the performance bottleneck of traditional models under data isolation conditions through technical means. It has important business value and technical significance.
[0009] Working principle of the present invention: The present invention systematically proposes solutions from two aspects: global optimization on the server side and personalized modeling on the client side. In view of the heterogeneity of client data, a multi-center clustering strategy is adopted on the server side, and the uploaded model parameters are assigned to the corresponding clustering centers for aggregation through cosine similarity. This strategy enhances the adaptability of the federated framework to diverse data distributions by aggregating specific types of parameters, improves the generalization performance of the global model, and alleviates the interference of client drift on the model. In addition, in order to meet the professional requirements of the client performance prediction model, an attention refinement network is introduced to optimize parameter selection. The attention mechanism is used to calculate the similarity between the local and server-side aggregated models, and dynamically extract the parameter subset that best suits the local model, thereby enhancing the personalized performance of the client model while retaining the generalization ability of the global model. Specifically, the technical concept of the present invention is as follows:
[0010] Dataset construction and preprocessing: Data on five types of power energy conversion equipment, such as air conditioners, boilers, and refrigerators, are collected from the equipment production data interface of the cigarette factory. The current performance status of the equipment is annotated according to the performance indicators provided by the cigarette factory to provide a basis for subsequent analysis; the collected data are deduplicated, missing values are filled, and outliers are processed; the Pearson correlation coefficient is used to calculate the correlation between the equipment performance indicators and other production parameters, generate equipment parameter heat maps, remove parameters with low correlation, retain key parameters, and construct a single-factory multi-equipment production information dataset; in order to meet the requirements of multi-factory joint training in the federated learning framework, time shift, noise injection, random cropping and padding, random scaling, random slicing and other methods are used to enhance the dataset, improve data diversity, and make it meet the requirements of multi-factory and multi-equipment in federated learning data;
[0011] Setting up the federated learning framework: In view of the heterogeneity of client data, a multi-center global aggregation strategy is introduced on the server side. Through a two-stage iterative clustering algorithm, the first stage dynamically determines the number of cluster centers based on the changes in local model parameters to characterize the local data distribution characteristics; in the second stage, the client parameters are allocated to the closest center based on the distance between the uploaded parameters and the cluster center to complete the global model aggregation. During initialization, the global model sends the initialization parameters to the client, the client updates the parameters and uploads them, and the weight change between the client and the global center and the weight change distance between the clients are calculated through a specific formula to determine the number of cluster centers. Subsequently, the gating parameters are introduced to determine the center to which the client belongs, and the weighted sum is performed in each center to complete the aggregation. The aggregated global model is then transmitted back to the client, and it is continuously iterated until the client model converges. In order to meet the professional needs of the client performance prediction model, AEN is introduced on the client side. Its operation is divided into two stages. In the first stage, the similarity between the target client and the client of the same type aggregated on the server side is calculated based on the attention mechanism, and a weighted similarity matrix is generated to improve the adaptability of the aggregation model. The client divides the received parameter set X into sets X other than the client parameters in the same aggregation category. m- and the current training wheel local client parameters x m , with x m is the query matrix, X m- is a key-value matrix, and the query Q and key matrix K are constructed by combining the learnable parameters to calculate the similarity matrix M m The second stage uses the results of the first stage to further refine and optimize the server-side aggregation parameters. Based on the local model parameters, the aggregation parameters returned by the server and the similarity matrix of the first stage, the same feature extraction method as the first stage is adopted, but the key-value matrix composition is changed to output the model parameters required for local client aggregation, balancing personalized needs and global model commonality.
[0012] Performance prediction model training and optimization: Based on the time series prediction model, it is placed in the federated learning framework and trained collaboratively under multi-factory and multi-equipment conditions. The client uploads the local training equipment parameters to the server. The server uses a multi-center global clustering strategy to group clients with the same equipment prediction task into the same group and aggregate the parameters, and then returns the parameters to the client. The client uses the attention extraction network to condense the returned parameters for the second time, constructs a similarity matrix to optimize the global parameters returned by the server, adapts them to the local data distribution, enhances the model's prediction ability and personalization, ensures the adaptability of the local model to specific tasks, and improves the accuracy and robustness in diversified tasks.
[0013] Develop and implement data preprocessing code to perform operations such as transposition, deduplication, and outlier removal on the data output by the cigarette factory production equipment, optimize the data structure, and improve the prediction speed. Save the trained and converged cigarette factory power energy conversion equipment efficiency prediction model as a ".pth" file, and load it into the memory with the help of the Web application Sanic framework to avoid frequent model loading. Based on the Sanic framework, perform back-end development, encapsulate the model recognition and decoding process as a callable API interface and deploy it to realize the multi-concurrent request function of the Web port. Call the model deployed on the server side on the Web side, test the input data, and display the predicted equipment production efficiency on the front-end interface.
[0014] Server-side multi-center clustering strategy: When facing the problem of client data heterogeneity, the server adopts a two-stage iterative clustering algorithm. In the initialization stage, the global model sends the initialization parameters to all clients. At this time, the server has only one center (N=1). After receiving the parameters, the client updates and uploads the parameters to the server according to the local model results. The corresponding weight change between the mth client and the nth global center is calculated by a specific formula, and then the distance between the weight changes of each client is calculated using cosine similarity. An object is randomly selected from the object set consisting of a given M clients to determine whether it belongs to an existing cluster. If not, it is regarded as a new core object point, and its distance to other unassigned objects is calculated. If the distance is less than the set threshold, it is included in the new cluster. Repeat this process until all objects are assigned, so as to dynamically determine the number of cluster centers N, so as to accurately characterize the local data distribution characteristics. After determining the number of cluster centers, the gating parameter dmn is introduced to determine whether the parameters of client m can be assigned to the nth center for global aggregation. Global aggregation is weighted summed in all N centers respectively, and the calculation formula involves the current aggregation round number t. The global model aggregated by each center is passed to the corresponding client, and the client continuously updates the local model, repeating this process until convergence. In this way, by dynamically allocating parameters with similar features to the corresponding aggregation center, aggregation of specific types of parameters is achieved, enhancing the adaptability of the federated framework to diverse data distribution. Data from different clients can be aggregated in their respective appropriate clustering centers based on similarity, avoiding interference caused by excessive data differences, improving the generalization performance of the global model, and alleviating the interference of client drift on the model. Because similar data is aggregated in the same clustering center, the convergence of different directions is reduced, making the model more stable.
[0015] The beneficial effects of the present invention are:
[0016] 1. Reasonable allocation of client parameters: It helps to accurately allocate client parameters to the corresponding clustering centers. In the second stage of clustering, client parameters are allocated based on the distance between the uploaded parameters and each clustering center, and the distance calculation result between the client weight changes is the key factor to measure this distance. The distance calculated by cosine similarity can clearly show the similarity between different clients. For example, for clients with the same equipment prediction task (such as air-conditioning equipment prediction tasks), those with a closer weight change distance will be assigned to the same clustering center for aggregation. In this way, parameters with similar features can be aggregated in the same center, improving the pertinence and effectiveness of model aggregation and enhancing the adaptability of the federated framework to diverse data distribution. Through two-stage dynamic clustering (determining the number of centers + parameter allocation) and cosine similarity to calculate the weight change distance, the same group aggregation of similar client parameters is achieved (such as the refrigerator task clients are classified into one category). The single subgraph relationship matrix of Comparative Document 1 cannot adapt to the heterogeneity of industrial scenarios. The gating parameter dmn is introduced to control the aggregation weight, combined with the dynamic adjustment of the number of rounds t, to avoid the "one-size-fits-all" aggregation of traditional FedAvg and improve model personalization.
[0017] 2. Improve the generalization performance of the global model: Promote the global model to better integrate information from different clients and improve generalization performance. When similar client parameters are aggregated together, the model update of each cluster center can focus more on the characteristics of similar data. For example, in the cigarette factory scenario, the data of similar equipment in different workshops (such as refrigerators in different workshops) can enable the model to learn more representative refrigerator operation modes and efficiency characteristics after weight change distance clustering. This similarity-based aggregation method avoids interference from data of different types of equipment, allowing the global model to better adapt to various complex industrial scenarios and have better predictive capabilities for equipment data from different cigarette factories.
[0018] 3. Alleviate the client drift problem: effectively alleviate the interference of client drift on the model. In federated learning, client drift is due to the non-independent and identically distributed data of different clients, which causes the models of each client to converge in different directions. By using cosine similarity to calculate the weight change distance, similar clients can be grouped together, making the update direction of client models in the same group more similar. Taking the cigarette factory as an example, different cigarette factories have different equipment models or origins, but the equipment clients with similar operating conditions are clustered through weight change distances, and the model is updated in the same cluster center, which reduces the differences in model update directions, thereby alleviating the client drift problem and ensuring the stability and accuracy of model training.
[0019] Aiming at the special needs of power energy conversion equipment in cigarette factories, this invention has achieved innovations in data preprocessing, multi-center aggregation strategy, two-stage attention extraction network, etc., solving problems that existing technologies cannot cope with, such as client drift, industrial data noise, and privacy protection. It has also been verified through experiments that its prediction accuracy and robustness are significantly better than existing methods. These technical features are coupled with each other to form a federated learning framework dedicated to industrial equipment performance prediction, which has outstanding substantive characteristics and significant progress, and is creative. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 It is an overall flow chart of the method for predicting the efficiency of power energy conversion equipment in a cigarette factory based on federated learning in the present invention;
[0021] Figure 2 This is a structural diagram of the attention extraction network in the present invention;
[0022] Figure 3 This is a structural diagram of the efficiency prediction model of power energy conversion equipment in a cigarette factory based on personalized federated learning in the present invention. DETAILED DESCRIPTION
[0023] In order to make the purpose, technical scheme and advantages of the present invention clearer, the present invention is further described in detail below in conjunction with specific embodiments and with reference to the accompanying drawings. It should be understood that these descriptions are only exemplary and are not intended to limit the scope of the present invention. In addition, in the following description, the description of well-known structures and technologies is omitted to avoid unnecessary confusion of the concept of the present invention.
[0024] Example 1: Basic Overview:
[0025] A method for predicting the efficiency of power energy conversion equipment in a cigarette factory based on federated learning, wherein the specific steps of the method are as follows:
[0026] Step 1, Construction and preprocessing of production information data set of power energy conversion equipment in cigarette factories: Aiming at the current demand for constructing an efficiency prediction model of power energy conversion equipment in cigarette factories, the present invention constructs a production information data set of power energy conversion equipment in cigarette factories by means of manual labeling, algorithm generation and the like.
[0027] Step 2: Federated learning framework for power energy conversion equipment in cigarette factories that integrates multi-center aggregation and attention distillation: A multi-center aggregation strategy is adopted on the server side, and uploaded model parameters are assigned to corresponding cluster centers for aggregation through cosine similarity. An attention distillation network is introduced on the client side to dynamically extract the parameter subset that best suits the local model.
[0028] Step 3, a method for predicting the efficiency of power energy conversion equipment in a cigarette factory based on federated learning: a time series prediction model is used as the basic model of the equipment efficiency prediction model, and training is performed in a federated learning framework assisted by multiple factories to improve the generalization of the model. When the production data of equipment such as air conditioners, refrigerators and boilers are used for multi-factory and multi-equipment integration, the client sends the local training equipment parameters to the server for aggregation. At this time, the server uses a multi-center global clustering strategy to classify clients with the same equipment prediction task (all performing air conditioning equipment prediction tasks) into the same group and perform aggregation operations within the group. After the parameters are sent down on the server side, a similarity matrix is constructed based on the model parameters of other clients in the same group (other clients performing air conditioning equipment prediction tasks), and the global parameters returned by the server side are dynamically optimized to make them more suitable for the data distribution of the target client. While enhancing the model prediction capability, the present invention significantly improves the personalization of the client model and ensures the adaptability of the local model to specific tasks.
[0029] Step 4, Cigarette factory production equipment efficiency prediction device: In order to improve the working efficiency of cigarette factory production equipment, the equipment production data input by the model is preprocessed in real time to achieve continuous prediction of production equipment efficiency, and the trained converged model is packaged for deployment on the server. On this basis, a set of API interfaces is constructed to achieve efficient prediction of the efficiency of cigarette factory production equipment.
[0030] Preferably, the specific steps of Step 1 are:
[0031] Step 1.1. Collect data from five types of power energy conversion equipment, such as air conditioners, boilers, and refrigerators, from the equipment production data interface provided by the cigarette factory, and perform pre-processing operations such as deduplication, missing value completion, and outlier processing on the data. At the same time, the current performance status of the equipment is marked according to the performance indicators provided by the cigarette factory. In order to reduce the interference of irrelevant equipment parameters on performance analysis, a heat map of equipment parameters is generated based on the marked equipment performance. When calculating the heat map, the Pearson correlation coefficient is most commonly used to calculate the correlation. The specific calculation formula is:
[0032]
[0033] r xy Variable: The correlation coefficient between x and y, with a value range of [-1,1]. The closer to -1 and 1, the higher the correlation, and the closer to 0, the weaker the correlation. i and i : The i-th observed value of variables x and y. and The means of the variables x and y.
[0034] Through this formula, we can calculate that the correlation coefficients between the chiller efficiency index (cold-to-electricity ratio) and the chiller water flow and chiller cooling water flow are 0.89 and 0.90 respectively, which have high correlations and need to be retained. At the same time, the correlation coefficients between the cold-to-electricity ratio and the chiller voltage and chiller water outlet pressure are 0.02 and -0.17, which have low correlations and should be removed. By calculating the correlation coefficients between the equipment efficiency index and other equipment production parameters, the key equipment parameters with high negative correlation (colder) and high positive correlation (hotter) are retained, and finally a single-plant multi-equipment power energy conversion equipment production information data set is constructed.
[0035] Step 1.2, in order to fit the situation of multi-factory joint training in the federated learning framework, the production information data set of power energy conversion equipment of cigarette factories collected in real production work is enhanced, which improves the data diversity and meets the requirements of multi-factory and multi-equipment data during the training of the federated learning framework. This step adopts the following methods: 1. Time shift: Time series shift the production information data of power energy conversion equipment of cigarette factories to generate new sequences to simulate changes in time. 2. Noise injection: Add random noise to the production information data of power energy conversion equipment of cigarette factories to improve the robustness of the model to noise. 3. Random cropping and padding: Randomly intercept subsequences of the production information data of power energy conversion equipment of cigarette factories and fill them to the original length to increase data diversity. 4. Random scaling: Randomly scale the production information data of power energy conversion equipment of cigarette factories to simulate changes of different amplitudes. 5. Random slicing: Intercept random fragments of the production information data of power energy conversion equipment of cigarette factories to generate new samples.
[0036] Preferably: the specific steps of Step 2 are:
[0037] Step 2.1. To address the problem of client data heterogeneity, a multi-center global aggregation strategy is introduced on the server side. This strategy dynamically assigns parameters with similar features to corresponding aggregation centers by designing an iterative multi-center clustering mechanism on a global scale. This method is a two-stage iterative clustering algorithm. In the first stage, the number of cluster centers is dynamically determined by the change of local model parameters to accurately characterize the local data distribution characteristics; in the second stage, the client parameters are assigned to the closest center based on the distance between the uploaded parameters and each cluster center, and the aggregation of the global model is completed accordingly.
[0038] In the initialization phase, the global model first initializes the parameters Sent to all clients, at this time the server has only one center, that is, N = 1. At this time, the mth client receives Then it will update the output according to its local model results. (Parameters uploaded by client m to the server) and uploaded to the server. Then the corresponding weight change between the mth client and the nth global center can be calculated as shown in Formula 1:
[0039]
[0040] Then the distance between each client weight change is calculated by cosine similarity, which is calculated as shown in Formula 2:
[0041]
[0042] Then the first stage clustering is performed to find the appropriate number of centers N. Suppose the given M clients constitute the object set First, randomly select an object from S Determine whether it already belongs to an existing cluster. If it does, select the next object from S; if it does not, is considered as a new core object point and its relationship with other objects (such as ). If and The distance is less than the set
[0043] threshold, and has not been assigned to any existing cluster, then and The above process is repeated until all objects in S are assigned to a cluster. Through this process, an appropriate number of center points (i.e., N) can be initialized to lay the foundation for subsequent multi-center global aggregation.
[0044] In the next two-stage clustering, the gating parameter dmn is introduced as a variable to determine the center to which the client belongs. The function of dmn is to define the Can it be assigned to the nth center for global aggregation? On this basis, the global aggregation will be weighted summed in all N centers respectively, and its calculation is shown in Formula 3:
[0045]
[0046] Where t is the current aggregation round number. Finally, the global model aggregated by each center can be passed to the corresponding client, and the client will continue to update its local model, repeating this process until each client reaches convergence.
[0047] Step 2.2. In order to meet the professional needs of the client performance prediction model, an attention extraction network is proposed. Through the attention mechanism, the characteristic parameters that are most conducive to the construction of the target client are extracted from the similar global model parameters returned by the server, and the personalized potential of the model is fully explored. The operation of AEN is divided into two stages: the first stage calculates the similarity between the target client and the similar clients aggregated on the server side based on the attention mechanism, and generates a weighted similarity matrix to improve the adaptability of the aggregation model to the target client; the second stage uses the weighted results of the first stage to further refine and optimize the server-side aggregation parameters, dynamically balance the personalized needs of the target client and the commonality of the global model, strengthen the personalized features while maintaining the synergistic effect of global knowledge sharing. Its overall structure is as follows: Figure 1 shown.
[0048] In order to achieve model parameter aggregation, we apply the attention mechanism to calculate the similarity score between the client parameters and the model parameters of other clients under the same aggregation, thereby constructing a matrix of model parameter similarity to help retain knowledge that is beneficial to the target client. The essential idea of the attention mechanism is to calculate the correlation between the query Q and the key matrix K, and its calculation is shown in Formula 4:
[0049]
[0050] The return parameter received by the client is and X (the upload parameter set of all clients in the class to which the local client belongs). In this stage, we divide X into X m- and x m , where X m- is the parameter set of other clients in the same aggregation category except the parameters of this client, x m is the local client parameter of the current training round. We will m Considered as a query matrix, X m- As a key-value matrix, and Complete the construction of Q and K in formula 4 where and are learnable parameters for constructing the query matrix and key-value matrix in the first phase of AEN, which are trained by gradient descent using the client's local dataset. Thus, the similarity matrix M of the current phase can be obtained m The calculation formula is:
[0051]
[0052] In the second stage, given the local model parameters x m , the aggregation parameters returned by the server And the similarity matrix M calculated in the first stage m, output the model parameters required by the local client for aggregation It aggregates valuable information from local models and other clients in the same cluster. Specifically, we use the same feature extraction method as the first stage structure and adopt x m as the query matrix. The difference is that x m 、M m and Connect together as a key value matrix. The calculation method is shown in formula 6 and can be expressed as follows:
[0053]
[0054] in and is a learnable parameter in the second stage of AEN.
[0055] Preferably: the specific steps of Step 3 are:
[0056] Step 3.1, by placing the equipment performance prediction model under the federated learning framework and conducting collaborative training under multi-factory and multi-equipment conditions, the model's adaptability to complex industrial scenarios is effectively improved. This method not only makes full use of the heterogeneous data of equipment in each factory and improves the generalization performance of the model, but also provides strong technical support for the intelligentization of industrial production by sharing global information and retaining local characteristics.
[0057] Step 3.2: After the model completes a single round of training on the client, each client will The data is shared to the server for aggregation, and the center uses a multi-center global aggregation strategy to classify and aggregate the parameters of each client. The server will then return the parameters. and X are returned to the client, and the client uses the attention extraction network to condense the returned parameters to obtain the aggregated parameters Aggregating the aggregated parameters with the client model completes a cycle. The efficiency prediction model of power energy conversion equipment in cigarette factories is trained in this framework, which effectively enhances the accuracy and robustness of the model in various tasks.
[0058] Preferably: the specific steps of Step 4 are:
[0059] Step 4.1, adapt to the production information data output by the production equipment of the cigarette factory, first develop and implement the corresponding data preprocessing code. Through operations such as data transposition, deduplication and outlier removal, the data structure is optimized, thus providing a solid data foundation for equipment performance prediction and significantly improving the prediction speed.
[0060] Step 4.2, save the efficiency prediction model of the power energy conversion equipment of the cigarette factory as a ".pth" file, and load the model into the memory based on the Web application Sanic framework to avoid frequent model loading process caused by request results and improve the running speed of the recognition model;
[0061] Step 4.3. Backend development based on the Sanic framework encapsulates the recognition and decoding process of the cigarette factory power energy conversion equipment efficiency prediction model into a callable API interface and deploys it, thereby realizing the function of multiple concurrent requests on the Web port;
[0062] Step 4.4, on the Web side, call the cigarette factory power energy conversion equipment efficiency prediction model deployed on the server side to test the input cigarette factory power energy conversion equipment production information data, and then obtain the equipment production efficiency status in the next time terminal and display it on the front-end interface.
[0063] Example 2: Specific drill:
[0064] like Figure 1 As shown, a method for predicting the efficiency of power energy conversion equipment in a cigarette factory based on federated learning, the specific steps of the method are as follows:
[0065] Step 1. Aiming at the actual demand of constructing the efficiency prediction model of power energy conversion equipment in cigarette factories, the present invention designs and implements a systematic data set construction scheme. By combining manual labeling and algorithm generation methods, the production information of power energy conversion equipment in cigarette factories is comprehensively collected and sorted to ensure that the data set covers key dimensions such as equipment operating status, production efficiency, and abnormal conditions. In the data preprocessing stage, technical means such as data cleaning, deduplication, outlier detection and correction are used to further improve the integrity and reliability of the data. This data set not only provides an accurate data foundation for the development of equipment efficiency prediction models, but also lays a solid data foundation for the intelligent production management of cigarette factories.
[0066] Step 2. The present invention proposes a federated learning framework for power energy conversion equipment in cigarette factories that integrates a multi-center aggregation strategy and an attention refinement network to cope with data heterogeneity and personalized needs in industrial equipment performance prediction. On the server side, a multi-center aggregation strategy based on cosine similarity was designed and applied to divide the model parameters uploaded by the client into cluster centers with higher similarity, thereby achieving refined model aggregation and improving the adaptability of the global model to different data distributions. On the client side, an attention refinement network was constructed to dynamically analyze the global parameters returned by the server to extract the parameter subset that best matches the local data distribution. This process not only significantly improves the model personalization capability, but also ensures the effective sharing and collaborative optimization of global knowledge, providing stronger technical support and practical value for the application of federated learning in complex industrial scenarios.
[0067] Step 3, a method for predicting the efficiency of power energy conversion equipment in a cigarette factory based on federated learning: a time series prediction model is used as the basic model of the equipment efficiency prediction model, and training is performed in a federated learning framework assisted by multiple factories to improve the generalization of the model. When the production data of equipment such as air conditioners, refrigerators and boilers are used for multi-factory and multi-equipment integration, the client sends the local training equipment parameters to the server for aggregation. At this time, the server uses a multi-center global clustering strategy to classify clients with the same equipment prediction task (all performing air conditioning equipment prediction tasks) into the same group and perform aggregation operations within the group. After the parameters are sent down on the server side, a similarity matrix is constructed based on the model parameters of other clients in the same group (other clients performing air conditioning equipment prediction tasks), and the global parameters returned by the server side are dynamically optimized to make them more suitable for the data distribution of the target client. While enhancing the model prediction capability, the present invention significantly improves the personalization of the client model and ensures the adaptability of the local model to specific tasks.
[0068] Step 4, Cigarette factory production equipment efficiency prediction device: In order to improve the working efficiency of cigarette factory production equipment, the equipment production data input by the model is preprocessed in real time to achieve continuous prediction of production equipment efficiency, and the trained converged model is packaged for deployment on the server. On this basis, a set of API interfaces is constructed to achieve efficient prediction of the efficiency of cigarette factory production equipment.
[0069] Furthermore, the specific steps of Step 1 are:
[0070] Step 1.1. Collect data from five types of power energy conversion equipment, such as air conditioners, boilers, and refrigerators, from the equipment production data interface provided by the cigarette factory, and perform pre-processing operations such as deduplication, missing value completion, and outlier processing on the data. At the same time, the current performance status of the equipment is marked according to the performance indicators provided by the cigarette factory. In order to reduce the interference of irrelevant equipment parameters on performance analysis, a heat map of equipment parameters is generated based on the marked equipment performance. When calculating the heat map, the Pearson correlation coefficient is most commonly used to calculate the correlation. The specific calculation formula is:
[0071]
[0072] r xy Variable: The correlation coefficient between x and y, with a value range of [-1,1]. The closer to -1 and 1, the higher the correlation, and the closer to 0, the weaker the correlation. i and i : The i-th observed value of variables x and y. and The means of the variables x and y.
[0073] Through this formula, we can calculate that the correlation coefficients between the chiller efficiency index (cold-to-electricity ratio) and the chiller water flow and chiller cooling water flow are 0.89 and 0.90 respectively, which have high correlations and need to be retained. At the same time, the correlation coefficients between the cold-to-electricity ratio and the chiller voltage and chiller water outlet pressure are 0.02 and -0.17, which have low correlations and should be removed. By calculating the correlation coefficients between the equipment efficiency index and other equipment production parameters, the key equipment parameters with high negative correlation (colder) and high positive correlation (hotter) are retained, and finally a single-plant multi-equipment power energy conversion equipment production information data set is constructed.
[0074] Step 1.2, in order to fit the situation of multi-factory joint training in the federated learning framework, the production information data set of power energy conversion equipment of cigarette factories collected in real production work is enhanced, which improves the data diversity and meets the requirements of multi-factory and multi-equipment data during the training of the federated learning framework. This step adopts the following methods: 1. Time shift: Time series shift the production information data of power energy conversion equipment of cigarette factories to generate new sequences to simulate changes in time. 2. Noise injection: Add random noise to the production information data of power energy conversion equipment of cigarette factories to improve the robustness of the model to noise. 3. Random cropping and padding: Randomly intercept subsequences of the production information data of power energy conversion equipment of cigarette factories and fill them to the original length to increase data diversity. 4. Random scaling: Randomly scale the production information data of power energy conversion equipment of cigarette factories to simulate changes of different amplitudes. 5. Random slicing: Intercept random fragments of the production information data of power energy conversion equipment of cigarette factories to generate new samples.
[0075] Furthermore, the specific steps of Step 2 are as follows:
[0076] Step 2.1: Regarding the problem of client data heterogeneity, a multi-center global aggregation strategy is introduced on the server side. This strategy designs an iterative multi-center clustering mechanism globally, dynamically allocating parameters with similar features to the corresponding aggregation centers. This method is a two-stage iterative clustering algorithm. In the first stage, the number of clustering centers is dynamically determined based on the changes in local model parameters to accurately characterize the local data distribution characteristics; in the second stage, according to the distance between the uploaded parameters and each clustering center, the client parameters are assigned to the closest center, and the global model aggregation is completed accordingly.
[0077] In the initialization stage, the global model first sends the initialization parameters to all clients. At this time, there is only one center on the server side, i.e., N = 1. At this time, the m-th client receives and will update (the parameters uploaded by client m to the server) according to the results of its local model and upload them to the server side. Then, the corresponding weight change between the m-th client and the n-th global center can be calculated as shown in Formula 1:
[0078]
[0079] After that, the distance between the weight changes of each client is calculated through cosine similarity, and the calculation is as shown in Formula 2:
[0080]
[0081] Then, the first-stage clustering is performed to find the appropriate number of centers N. Let the given M clients form an object set First, randomly select an object from S and determine whether it belongs to an existing cluster. If it belongs to an existing cluster, select the next object from S; if not, is regarded as a new core object point, and its distance from other objects (such as ) is calculated. If and The distance is less than the set threshold, and has not been assigned to any existing cluster, then and are grouped into a new cluster together. Repeat the above process until all objects in S are assigned to a certain cluster. Through this process, an appropriate number (i.e., N) of center points can be initialized to lay the foundation for subsequent multi-center global aggregation.
[0082] In the next two-stage clustering, the gating parameter dmn is introduced as a variable to determine the center to which the client belongs. The function of dmn is to define the Can it be assigned to the nth center for global aggregation? On this basis, the global aggregation will be weighted summed in all N centers respectively, and its calculation is shown in Formula 3:
[0083]
[0084] Where t is the current aggregation round number. Finally, the global model aggregated by each center can be passed to the corresponding client, and the client will continue to update its local model, repeating this process until each client reaches convergence.
[0085] Step 2.2. In order to meet the professional needs of the client performance prediction model, an attention extraction network is proposed. Through the attention mechanism, the characteristic parameters that are most conducive to the construction of the target client are extracted from the similar global model parameters returned by the server, and the personalized potential of the model is fully explored. The operation of AEN is divided into two stages: the first stage calculates the similarity between the target client and the similar clients aggregated on the server side based on the attention mechanism, and generates a weighted similarity matrix to improve the adaptability of the aggregation model to the target client; the second stage uses the weighted results of the first stage to further refine and optimize the server-side aggregation parameters, dynamically balance the personalized needs of the target client and the commonality of the global model, strengthen the personalized features while maintaining the synergistic effect of global knowledge sharing. Its overall structure is as follows: Figure 1 shown.
[0086] In order to achieve model parameter aggregation, we apply the attention mechanism to calculate the similarity score between the client parameters and the model parameters of other clients under the same aggregation, thereby constructing a matrix of model parameter similarity to help retain knowledge that is beneficial to the target client. The essential idea of the attention mechanism is to calculate the correlation between the query Q and the key matrix K, and its calculation is shown in Formula 4:
[0087]
[0088] The return parameter received by the client is and X (the uploaded parameter set of all clients in the category to which the local client belongs). In this stage, we divide X into Xm- and xm, where Xm- is the parameter set of other clients in the same aggregate category except the client parameters, and xm is the local client parameters of the current training round. We regard xm as the query matrix and Xm- as the key-value matrix. and Complete the construction of Q and K in formula 4 where and are learnable parameters for constructing the query matrix and key-value matrix in the first phase of AEN, which are trained by gradient descent using the client's local data set. From this, the calculation formula for the similarity matrix Mm of the current phase can be obtained:
[0089]
[0090] In the second stage, given the local model parameters x m , the aggregation parameters returned by the server And the similarity matrix M calculated in the first stage m , output the model parameters required by the local client for aggregation It aggregates valuable information from local models and other clients in the same cluster. Specifically, we use the same feature extraction method as the first stage structure and adopt x m as the query matrix. The difference is that x m 、M m and Connect together as a key value matrix. The calculation method is shown in formula 6 and can be expressed as follows:
[0091]
[0092] in and is a learnable parameter in the second stage of AEN.
[0093] Furthermore, the specific steps of Step 3 are:
[0094] Step 3.1, by placing the equipment performance prediction model under the federated learning framework and conducting collaborative training under multi-factory and multi-equipment conditions, the model's adaptability to complex industrial scenarios is effectively improved. This method not only makes full use of the heterogeneous data of equipment in each factory and improves the generalization performance of the model, but also provides strong technical support for the intelligentization of industrial production by sharing global information and retaining local characteristics.
[0095] Step 3.2: After the model completes a single round of training on the client, each client will The data is shared to the server for aggregation, and the center uses a multi-center global aggregation strategy to classify and aggregate the parameters of each client. The server will then return the parameters. and X are returned to the client, at which point the client uses the attention extraction network to perform a secondary condensation on the returned parameters to obtain the aggregated parameters Aggregating the aggregated parameters with the client model completes a cycle. The efficiency prediction model of power energy conversion equipment in cigarette factories is trained in this framework, which effectively enhances the accuracy and robustness of the model in various tasks.
[0096] Furthermore, the specific steps of Step 4 are:
[0097] Step 4.1, adapt to the production information data output by the production equipment of the cigarette factory, first develop and implement the corresponding data preprocessing code. Through operations such as data transposition, deduplication and outlier removal, the data structure is optimized, thus providing a solid data foundation for equipment performance prediction and significantly improving the prediction speed.
[0098] Step 4.2, save the efficiency prediction model of the power energy conversion equipment of the cigarette factory as a ".pth" file, and load the model into the memory based on the Web application Sanic framework to avoid frequent model loading process caused by request results and improve the running speed of the recognition model;
[0099] Step 4.3. Backend development based on the Sanic framework encapsulates the recognition and decoding process of the cigarette factory power energy conversion equipment efficiency prediction model into a callable API interface and deploys it, thereby realizing the function of multiple concurrent requests on the Web port;
[0100] Step 4.4, on the Web side, call the cigarette factory power energy conversion equipment efficiency prediction model deployed on the server side to test the input cigarette factory power energy conversion equipment production information data, and then obtain the equipment production efficiency status in the next time terminal and display it on the front-end interface.
[0101] Example 3: In order to verify the effectiveness of the proposed method for predicting the efficiency of power energy conversion equipment in cigarette factories based on federated learning, experiments were conducted on 1.2 million self-constructed equipment production data. About 400,000 of them were collected from real production scenarios, and the rest of the data was synthesized by algorithms. To ensure the effectiveness of our experiments, all experiments were conducted in an environment with Intel(R) Xeon(R) Gold 6132CPU@2.60GHz, four NVIDIA GEFORCE RTX 3090GPUs, and python3.9.
[0102] The following comparative experiment was designed for analysis.
[0103] For the task of industrial equipment performance prediction, the mean square error (MSE) and mean absolute error (MAE) are used to evaluate the prediction results of the model:
[0104] (1) Mean Squared Error (MSE) is a metric widely used to evaluate the performance of prediction models, especially in regression analysis. It measures the prediction accuracy of a model by calculating the square of the difference between the predicted value and the actual value, and then taking the average of these squared differences. Specifically, MSE sums up the squares of each prediction error and divides by the number of errors, resulting in an overall error assessment value. The specific formula is as follows:
[0105]
[0106] where n is the number of samples, y i is the i-th observation value, i.e., the true value. is the i-th predicted value. Generally, the smaller the value of MSE, the closer the predicted result is to the actual value, and the higher the prediction accuracy of the model.
[0107] Mean Absolute Error (MAE) is another metric for measuring the performance of prediction models. Similar to MSE, it also evaluates by calculating the difference between the predicted value and the actual value. However, different from MSE, MAE directly takes the absolute value of the prediction error and then calculates the average of these absolute values.
[0108]
[0109] where n is the number of samples, y i is the i-th true value. is the i-th predicted value, is the gap between the predicted value and the true value. A significant advantage of this method is its lower sensitivity to outliers. Therefore, MAE can better reflect the performance of the model in general errors, making the evaluation results more robust. Generally speaking, the smaller the value of Mean Absolute Error, the more accurate the predicted result of the model and the smaller the error.
[0110] Experiment 1: Mainly compare the experimental results
[0111] Table 1 Main experimental results
[0112]
[0113] As shown in Table 1, the MSE and MAE indicators of the present invention in the cigarette factory industrial equipment production data set reached 0.1985 and 0.1924, reaching the optimal level. Compared with the basic local training architecture, the two indicators are reduced by 0.027 and 0.012 respectively, which shows that the use of the federated learning framework can effectively overcome the problem of the inability to communicate training information under the premise of ensuring user privacy, thereby constructing a more generalized global model, which is superior to the local model training of a single device in a data environment with high diversity and heterogeneity. Compared with the traditional FedAvg framework, this method uses a server-side multi-center global aggregation strategy to allocate the model parameters uploaded by the client to the corresponding clustering center for aggregation according to the cosine similarity of the model parameters. Compared with single-center aggregation, the multi-center strategy effectively alleviates the model drift problem caused by client data differences and improves the stability and accuracy of the global model. At the same time, this strategy takes into account both personalization and global requirements, and provides a more adaptive model update for the client. Different from the traditional method of directly performing parameter fusion on the client side in the federated framework, this method optimizes the MSE and MAE indicators by introducing AEN. AEN dynamically selects the global model parameter part that best suits the target client through the attention mechanism, which can more accurately capture personalized needs, thereby improving the model's adaptability to non-independent and identically distributed data. Secondly, through two-stage similarity analysis and optimization refinement, AEN effectively balances the contradiction between personalized features and global knowledge sharing, and significantly reduces the negative impact of client data heterogeneity on aggregation effects. Therefore, this method can achieve the best results on the cigarette factory industrial equipment production data set.
[0114] Experiment 2: Ablation experiment
[0115] In order to verify the effectiveness of the multi-granularity feature extraction module, the present invention conducted an ablation experiment on it on the baseline model. The experimental results are shown in Table 2 ("×" represents no fusion, "√" represents fusion):
[0116] Table 2 The impact of multi-center aggregation strategy and attention extraction network on prediction results
[0117]
[0118] As shown in Table 2, when the multi-center aggregation strategy is only adopted on the server side, the MSE and MAE indicators decrease by 0.013 and 0.006 respectively, indicating that the multi-center aggregation can accurately aggregate according to the client task characteristics and avoid the mutual interference of different device tasks; when the attention refinement network is only introduced on the client to assist parameter fusion, the MSE and MAE indicators decrease by 0.020 and 0.007 respectively, indicating that the attention refinement network significantly improves the prediction accuracy. Even if the multi-center aggregation is not used on the server side, the personalized performance of the client model can still be effectively enhanced through parameter optimization based on client similarity. At the same time, when the multi-center aggregation strategy is adopted on the server side and the attention refinement network is introduced on the client side, the MSE and MAE indicators decrease by 0.029 and 0.013, indicating that the dual feature module can help improve the personalized modeling ability and the accuracy of performance prediction while alleviating the problem of client data heterogeneity.
[0119] Experiment 3: Communication Overhead Experiment
[0120] In order to study the impact of introducing multi-center aggregation and attention distillation networks on the model communication overhead, in this section we will compare the number of communication rounds and total communication overhead required for different federated learning frameworks to achieve the same MSE value. This experiment still uses the cigarette factory industrial equipment production dataset for experiments. For each method, we choose MSE reduced to 0.35 and 0.30 as the benchmark, and we record the highest accuracy that these methods can achieve and the time required to achieve the accuracy of different methods, where the time unit used is minutes.
[0121] Table 3 Comparison of model training speed and inference speed
[0122]
[0123] Table 3 further shows the trade-off between communication overhead and model performance of different federated learning algorithms. FedAvg has the lowest communication overhead because each round of communication only requires a simple update of the global model, but the prediction performance of the model is weak and it is difficult to meet the requirements of high-precision tasks. FedSGD and FedProx effectively improve the prediction accuracy of the model by introducing a personalized module, but the communication cost is correspondingly increased, resulting in reduced efficiency. In contrast, the method proposed in this paper integrates a multi-center aggregation strategy and an attention refinement network module in the architecture design, which can not only dynamically handle data heterogeneity, but also enhance the personalized performance of the model. Although the communication time is slightly increased compared with traditional methods, the prediction effect of the model is significantly improved. At the same time, compared with other similar methods, this method has achieved excellent performance in both training efficiency and prediction accuracy, fully demonstrating its practical value and innovation in addressing data privacy and heterogeneity challenges.
[0124] It should be understood that the above specific embodiments of the present invention are only used to illustrate or explain the principles of the present invention, and do not constitute a limitation of the present invention. Therefore, any modifications, equivalent substitutions, improvements, etc. made without departing from the spirit and scope of the present invention should be included in the protection scope of the present invention. In addition, the appended claims of the present invention are intended to cover all changes and modifications that fall within the scope and boundaries of the appended claims, or the equivalent forms of such scope and boundaries.
Claims
1. A method for predicting the efficiency of power energy conversion equipment in cigarette factories based on federated learning, characterized in that The following steps are involved: Step S1, constructing a production information dataset of power energy conversion equipment in a cigarette factory; Step S2: Build a federated learning framework for power energy conversion equipment in cigarette factories based on the fusion of multi-center aggregation and attention distillation. A multi-center aggregation strategy is adopted on the server side to distribute the uploaded model parameters to the corresponding clustering centers for aggregation through cosine similarity; an attention distillation network is introduced on the client side to dynamically extract the parameter subset that best suits the local model. Step S3: adopt the time series prediction model as the basic model of the equipment performance prediction model, and train it in a federated learning framework assisted by multiple factories to improve the generalization of the model; When equipment production data is combined across multiple plants and multiple devices, the client sends the local training equipment parameters to the server for aggregation; The server uses a multi-center global clustering strategy to group clients with the same device prediction task into the same group and perform aggregation operations within the group; After the server sends the parameters, it builds a similarity matrix based on the model parameters of other clients in the same group, and dynamically optimizes the global parameters returned by the server to make them more suitable for the data distribution of the target client. Step S4: pre-process the equipment production data input into the model in real time to achieve continuous prediction of production equipment efficiency, and encapsulate the trained and converged model for deployment on the server.
2. The method for predicting the efficiency of power energy conversion equipment in a cigarette factory according to claim 1, characterized in that: The step S1 further comprises: Step S1.1, collect the data of power energy conversion equipment from the equipment production information data set, and perform pre-processing operations such as deduplication, missing value filling and outlier processing on the data, and mark the current performance status of the equipment according to the performance indicators provided by the cigarette factory; generate a heat map of equipment parameters based on the marked equipment performance, and use the Pearson correlation coefficient to calculate the correlation, and the specific calculation formula is: Where: r xy Variable: The correlation coefficient between x and y, with a value range of [-1,1]; the closer to -1 and 1, the higher the correlation, and the closer to 0, the weaker the correlation; x i and i : The i-th observed value of variables x and y. and The means of variables x and y; Based on the above formula, key equipment parameters are calculated and screened, and key equipment parameters with high negative correlation and high positive correlation are retained to construct a production information data set of power energy conversion equipment with multiple devices in a single plant.
3. The method for predicting the efficiency of power energy conversion equipment in a cigarette factory according to claim 2, characterized in that: The step S1 further comprises: Step S1.2: Data enhancement is performed on the cigarette factory power energy conversion equipment production information dataset, including the following steps: Time shift: perform time series shift on the production information data of the power energy conversion equipment of the cigarette factory to generate a new sequence to simulate the changes in time; Noise injection: Add random noise to the production information data of power energy conversion equipment in cigarette factories to improve the robustness of the model to noise; Random cropping and padding: randomly intercept subsequences of the production information data of the power energy conversion equipment of the cigarette factory and pad them to the original length to increase data diversity; Random scaling: Randomly scale the production information data of the power energy conversion equipment in the cigarette factory to simulate changes of different magnitudes; Random slicing: intercept random fragments of the production information data of the power energy conversion equipment of the cigarette factory to generate new samples.
4. The method for predicting the efficiency of power energy conversion equipment in a cigarette factory according to any one of claims 1 to 3, characterized in that: The step S2 further comprises: Step S2.1, the multi-center global aggregation strategy is to dynamically allocate parameters with similar characteristics to corresponding aggregation centers by designing an iterative multi-center clustering mechanism on a global scale; In the first stage, the number of cluster centers is dynamically determined by changing the local model parameters to accurately characterize the local data distribution characteristics; In the second stage, the client parameters are assigned to the closest center according to the distance between the uploaded parameters and each cluster center, and the global model is aggregated accordingly; Among them: The global model first initializes the parameters Sent to all clients, the mth client receives Then it will update the output according to its local model results. And upload it to the server; calculate the corresponding weight change between the mth client and the nth global center, and calculate the distance between the weight changes of each client through cosine similarity; then perform the first stage clustering to find the appropriate number of centers N; from the object set consisting of the given M clients, randomly select objects to determine whether they belong to the existing cluster; if not, they are regarded as new core object points, and their distances with other objects are calculated. If the distance is less than the set threshold and the object is not assigned to an existing cluster, they are included in the new cluster together, and this process is repeated to determine the appropriate number of centers N, laying the foundation for multi-center global aggregation; The gating parameter dmn is introduced as a variable to determine the center to which the client belongs. It is used to determine whether the client parameters can be assigned to a specific center for global aggregation. The weighted sum is performed in all N centers to calculate the global aggregation result. The global model aggregated by each center is passed to the corresponding client, and the client continuously updates the local model, repeating until each client reaches convergence.
5. The method for predicting the efficiency of power energy conversion equipment in a cigarette factory according to claim 4, characterized in that: The step S2 further comprises: Step S2.2, construct an attention extraction network; Phase 1: Calculate the similarity between the target client and the aggregated clients of the same type on the server side based on the attention mechanism, and generate a weighted similarity matrix to improve the adaptability of the aggregation model to the target client; Phase II: Use the weighted results of the first phase to further refine and optimize the server-side aggregation parameters, dynamically balance the personalized needs of the target clients and the commonalities of the global model, strengthen personalized features while maintaining the synergistic effect of global knowledge sharing.
6. The method for predicting the efficiency of power energy conversion equipment in a cigarette factory according to claim 5, characterized in that: The step S2.2 also includes: Based on the formula Calculate the correlation between the query Q and the key matrix K; the return parameter received by the client is and X; divide X into X m- and x m , where X m- is the parameter set of other clients in the same aggregation category except the parameters of this client, x m The local client parameters of the current training wheel; x m Considered as a query matrix, X m- As a key-value matrix, and Complete the construction of Q and K in the above formula; and It is the learnable parameter for constructing the query matrix and key-value matrix in the first stage of AEN; Get the current stage similarity matrix M m The calculation formula is: In the second stage, given the local model parameters x m , the aggregation parameters returned by the server And the similarity matrix M calculated in the first stage m , output the model parameters required by the local client for aggregation It aggregates valuable information from local models and other clients in the same cluster; using x m As the query matrix, x m 、M m and Concatenate together as a key-value matrix: among them and is a learnable parameter in the second stage of AEN.
7. The method for predicting the efficiency of power energy conversion equipment in a cigarette factory according to claim 1, characterized in that: The step S3 further comprises: Step S3.1: By placing the equipment effectiveness prediction model under the federated learning framework and conducting collaborative training under multi-factory and multi-equipment conditions, the model's adaptability to complex industrial scenarios is effectively improved; Step S3.2: After the model completes a single round of training on the client, each client will set the model parameters Share to the server for aggregation, and use the multi-center global aggregation strategy on the center to classify and aggregate the parameters of each client; the server will return the parameters and X are returned to the client, at which point the client uses the attention extraction network to perform a secondary condensation on the returned parameters to obtain the aggregated parameters Aggregate the aggregation parameters with the client model to complete a cycle.
8. The method for predicting the efficiency of power energy conversion equipment in a cigarette factory according to any one of claims 1 to 3, characterized in that: The step S4 also includes the following steps: Step S4.1, optimize the data structure by performing data transposition, deduplication and outlier removal operations; Step S4.2, save the efficiency prediction model of the power energy conversion equipment of the cigarette factory as a ".pth" file, and load the model into the memory based on the Web application Sanic framework to avoid frequent model loading process caused by request results and improve the running speed of the recognition model; Step S4.3, based on the Sanic framework, back-end development is performed to encapsulate the recognition and decoding process of the cigarette factory power energy conversion equipment efficiency prediction model into a callable API interface and deploy it, thereby realizing the function of multiple concurrent requests of the Web port; Step S4.4, on the Web side, the power energy conversion equipment efficiency prediction model of the cigarette factory deployed on the server side is called to test the input production information data of the power energy conversion equipment of the cigarette factory, so as to obtain the production efficiency of the equipment in the next time terminal and display it on the front-end interface.
9. The method for predicting the efficiency of power energy conversion equipment in a cigarette factory according to claim 4, characterized in that: The weight change calculation formula is as follows: The formula for calculating the distance between each client weight change is: Then the first stage clustering is performed to find the appropriate number of centers N; let the given M clients constitute the object set The randomly selected object to determine whether it belongs to an existing cluster further comprises the following steps: Randomly select an object from S Determine whether it already belongs to an existing cluster. If it does, select the next object from S; if it does not, is considered as a new core object point and its relationship with other objects (such as ). If and The distance is less than the set threshold, and has not been assigned to any existing cluster, then and The above process is repeated until all objects in S are assigned to a cluster. In the two-stage clustering, the gating parameter dmn is introduced as a variable to determine the center to which the client belongs; Whether it can be assigned to the nth center for global aggregation; The global aggregation is calculated by the weighted sum of all N centers, where t is the current aggregation round number.
Citation Information
Cited By
Quality pre-control method based on standard data intelligent analysis
CN121258327A
A quality pre-control method based on intelligent analysis of standard data
CN121258327B