A data processing method and related apparatus

CN117009840BActive Publication Date: 2026-10-13TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211036206.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-27
Publication Date
2026-10-13
Estimated Expiration
2042-08-27

AI Technical Summary

Technical Problem

[0005]本申请实施例提供一种数据处理方法及相关装置,用以解决因样本随机标注标签导致的模型分类效果不稳定,模型参数难以收敛的问题

Benefits of technology

[0042]本申请实施例中,计算节点基于样本业务数据集,对聚类模型进行迭代训练,输出训练后的目标聚类模型,并将最后一次迭代获得的初始聚类中心集,作为目标聚类中心集,每次迭代执行以下操作:基于聚类模型,对样本业务数据进行聚类,得到任意一个计算节点对应的初始聚类中心集;将初始聚类中心集发送给协调节点,并获得协调节点返回的其他计算节点各自对应的初始聚类中心集;基于各计算节点各自对应的初始聚类中心集得到模型损失,并在模型损失不符合预设损失范围时,基于模型损失,进行模型参数调整。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117009840B_ABST
    Figure CN117009840B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of federated learning, and provides a data processing method and related device to improve model training effect, which can be applied to various scenes such as cloud technology, artificial intelligence, intelligent transportation and auxiliary driving, and comprises the following steps: each computing node performs iterative training on a clustering model based on a sample business data set, outputs a trained target clustering model, and takes an initial clustering center set obtained through the last iteration as a target clustering center set; each iteration performs the following operations: clustering the sample business data based on the clustering model to obtain an initial clustering center set; sending the initial clustering center set to a coordination node and obtaining the initial clustering center set of other computing nodes returned by the coordination node; obtaining a model loss based on the initial clustering center set of each computing node, and adjusting the model parameters based on the model loss when the model loss does not meet a preset loss range.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of federated learning technology, and provides a data processing method and related apparatus. Background Technology

[0002] With the development of computer technology, the application of automated annotation technology is becoming increasingly widespread. For example, in map scenarios, automated annotation technology is used to mark map locations, such as marking a location as a home or company.

[0003] In related technologies, during the model training phase, based on various preset classification labels, initial classification labels are randomly set for each sample data. Then, the weight parameters and loss values ​​of each sample data under each classification label are calculated iteratively. Based on the calculated weight parameters and loss values, the target classification label corresponding to each sample data is selected from the classification labels.

[0004] However, the above annotation methods require random annotation of each sample data first, which increases the annotation difficulty and resource consumption. In addition, random annotation can cause unstable classification results, making it difficult for model parameters to converge. Summary of the Invention

[0005] This application provides a data processing method and related apparatus to solve the problems of unstable model classification performance and difficulty in model parameter convergence caused by random labeling of samples.

[0006] In a first aspect, embodiments of this application provide a data processing method applied to any one of the computing nodes in federated learning, wherein each computing node stores business data of different feature dimensions of the same object, the method comprising:

[0007] Based on the sample business dataset, the clustering model is iteratively trained, outputting the trained target clustering model, and the initial cluster center set obtained in the last iteration is used as the target cluster center set; wherein, the following operations are performed in each iteration:

[0008] Based on the clustering model, the sample business data is clustered to obtain the initial cluster center set corresponding to any computing node, wherein each initial cluster center represents a business category;

[0009] The initial cluster center set is sent to the coordinating node, and the initial cluster center sets corresponding to the other computing nodes are obtained from the coordinating node.

[0010] The model loss is obtained based on the initial cluster center set corresponding to each computing node, and the model parameters are adjusted based on the model loss when the model loss does not meet the preset loss range.

[0011] Secondly, embodiments of this application provide a data processing method applied to a coordination node in federated learning, the method comprising:

[0012] Each computing node in the federated learning process receives an initial cluster center set sent by each computing node. Each computing node stores business data of different feature dimensions of the same object, and each initial cluster center represents a business category.

[0013] Based on the received initial cluster center sets, the cluster center groups corresponding to each computing node are obtained. Each cluster center group contains: the initial cluster center sets corresponding to other computing nodes besides the corresponding computing node.

[0014] Each obtained cluster center group is sent to its corresponding computing node, so that each computing node can train and obtain the corresponding target cluster center set based on the corresponding cluster center group.

[0015] Each computing node receives an encrypted target cluster center set returned by the computing node, and decrypts it using the target encryption algorithm to obtain the target cluster center set corresponding to each computing node.

[0016] Based on the received target cluster center sets, each piece of data to be detected is detected to determine the business category corresponding to each piece of data to be detected.

[0017] Thirdly, embodiments of this application provide a data processing apparatus, which is deployed on any one of the computing nodes in a federated learning system. Each computing node stores business data of different feature dimensions of the same object, including:

[0018] The processing unit is used to iteratively train the clustering model based on the sample business dataset, output the trained target clustering model, and use the initial cluster center set obtained in the last iteration as the target cluster center set; wherein, each iteration performs the following operations:

[0019] The processing unit is also used to cluster the sample business data based on the clustering model to obtain the initial cluster center set corresponding to any one of the computing nodes, wherein each initial cluster center represents a business category.

[0020] The transmission unit is used to send the initial cluster center set to the coordinating node and obtain the initial cluster center sets corresponding to other computing nodes returned by the coordinating node.

[0021] The processing unit is also used to obtain the model loss based on the initial cluster center set corresponding to each computing node, and to adjust the model parameters based on the model loss when the model loss does not meet the preset loss range.

[0022] As one possible implementation, the processing unit is further configured to: encrypt the initial cluster center set using a target encryption algorithm to obtain the encrypted initial cluster center set;

[0023] The transmission unit is further configured to: send the encrypted initial cluster center set to the coordination node, so that the coordination node can decrypt and obtain the initial cluster center set using the target encryption algorithm.

[0024] As one possible implementation, the transmission unit is further configured to: receive the encrypted initial cluster center sets corresponding to each of the other computing nodes returned by the coordinating node;

[0025] The processing unit is further configured to: decrypt the encrypted initial cluster center sets corresponding to each of the other computing nodes using the target encryption algorithm, thereby obtaining the initial cluster center sets corresponding to each of the other computing nodes.

[0026] As one possible implementation, the transmission unit is further used for:

[0027] The target cluster center set is sent to the coordination node, so that the coordination node can detect each piece of data to be detected based on the obtained target cluster center set corresponding to each computing node, and determine the business category corresponding to each piece of data to be detected; or...

[0028] Each computing node receives its own initial cluster center set and, based on the target cluster center sets obtained for each computing node, performs detection on each piece of data to be detected to determine the business category corresponding to each piece of data to be detected.

[0029] As one possible implementation, the processing unit is further configured to:

[0030] If the data type of the business data is historical navigation information, then based on the business data, object dwell information is obtained, and based on the object dwell information, the sample business dataset is obtained;

[0031] If the business data is parking information or location attribute information, then the business data is directly used as the sample business dataset.

[0032] Fourthly, embodiments of this application provide a data processing apparatus, including:

[0033] The transmission unit is used to receive the initial cluster center set sent by each computing node in the federated learning. Each computing node stores business data of different feature dimensions of the same object, and each initial cluster center represents a business category.

[0034] The splicing unit is used to obtain the cluster center group corresponding to each computing node based on the received initial cluster center sets. Each cluster center group contains: the initial cluster center set corresponding to other computing nodes besides the corresponding computing node.

[0035] The transmission unit is also used to send each obtained cluster center group to the corresponding computing node, so that each computing node can train and obtain the corresponding target cluster center set based on the corresponding cluster center group.

[0036] The transmission unit is also used to receive the encrypted target cluster center set returned by each computing node;

[0037] The decryption unit is used to decrypt and obtain the target cluster center set corresponding to each computing node through the target encryption algorithm.

[0038] The clustering unit is used to detect each piece of data to be detected based on the received target cluster center sets, and to determine the business category corresponding to each piece of data to be detected.

[0039] Fifthly, embodiments of this application provide an electronic device, including a processor and a memory, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the steps of the above-described data processing method.

[0040] Sixthly, embodiments of this application provide a computer-readable storage medium including a computer program, which, when run on an electronic device, causes the electronic device to perform the steps of the above-described data processing method.

[0041] In a seventh aspect, embodiments of this application provide a computer program product, the program product including a computer program stored in a computer-readable storage medium, wherein a processor of an electronic device reads from the computer-readable storage medium and executes the computer program, causing the electronic device to perform the steps of the above-described data processing method.

[0042] In this embodiment, the computing nodes iteratively train the clustering model based on the sample business dataset, output the trained target clustering model, and use the initial cluster center set obtained in the last iteration as the target cluster center set. Each iteration performs the following operations: clustering the sample business data based on the clustering model to obtain the initial cluster center set corresponding to any computing node; sending the initial cluster center set to the coordination node and obtaining the initial cluster center sets corresponding to other computing nodes returned by the coordination node; obtaining the model loss based on the initial cluster center sets corresponding to each computing node, and adjusting the model parameters based on the model loss when the model loss does not meet the preset loss range.

[0043] In this way, random labeling and classification of sample data is unnecessary during model training. This reduces the instability caused by the randomness of labeling, effectively improving clustering performance. Furthermore, the elimination of random labeling also enhances computational efficiency. Moreover, the federated learning mechanism effectively protects the data security of each computing node while utilizing the data stored on each node for model optimization, thus improving the effectiveness of model labeling.

[0044] Other features and advantages of this application will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the application. The objectives and other advantages of this application may be realized and obtained by means of the structures particularly pointed out in the written description, claims, and drawings. Attached Figure Description

[0045] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:

[0046] Figure 1 This is a schematic diagram illustrating one possible application scenario provided in the embodiments of this application;

[0047] Figure 2 This is a flowchart illustrating a data processing method provided in an embodiment of this application;

[0048] Figure 3A This is a navigation diagram of computing node A provided in the embodiments of this application;

[0049] Figure 3B This refers to the map in computing node B provided in this embodiment of the application;

[0050] Figure 4 This is a logical diagram illustrating the first data transmission process provided in the embodiments of this application;

[0051] Figure 5 This is a logical diagram of the first type of cluster center group provided in the embodiments of this application;

[0052] Figure 6 This is a logical diagram illustrating the second data transmission process provided in the embodiments of this application;

[0053] Figure 7 This is a logical diagram of the second type of cluster center group provided in the embodiments of this application;

[0054] Figure 8 This is a flowchart illustrating a model loss determination method provided in an embodiment of this application;

[0055] Figure 9 This is a schematic diagram of a clustering method provided in an embodiment of this application;

[0056] Figure 10 This is a logical diagram illustrating the data processing procedure in the map scene provided in the embodiments of this application;

[0057] Figure 11 This is a schematic diagram of the structure of a data processing device provided in an embodiment of this application;

[0058] Figure 12 This is a schematic diagram of another data processing device provided in the embodiments of this application;

[0059] Figure 13 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0060] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings of the embodiments of this application. Obviously, the described embodiments are only some embodiments of the technical solutions of this application, and not all embodiments. Based on the embodiments recorded in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the technical solutions of this application.

[0061] Federated learning is a technique that enables at least two parties to collaborate on training or inference tasks for a machine learning model without requiring any data to leave the domain. It's a framework based on distributed machine learning, with the core idea of ​​building machine learning models from datasets distributed across multiple devices while preventing data leakage.

[0062] Homomorphic encryption is a cryptographic technique based on the computational complexity theory of mathematical problems. Processing homomorphically encrypted data yields an output; decrypting this output produces the same result as processing the unencrypted original data. In other words, others can process the encrypted data without revealing any of the original content. Furthermore, a user with the key can decrypt the processed data and obtain the exact same result.

[0063] Federated distance: A distance calculation based on federated learning mechanism. This distance is calculated with privacy by encrypting and fusing the distances calculated from other nodes' data before using them in the distance calculation of the master node.

[0064] Artificial intelligence (AI) is the theory, methods, technology, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results. In other words, AI is a comprehensive technology within computer science that attempts to understand the essence of intelligence and produce a new kind of intelligent machine that can react in a way similar to human intelligence. AI studies the design principles and implementation methods of various intelligent machines, enabling them to possess the functions of perception, reasoning, and decision-making.

[0065] Artificial intelligence (AI) is a comprehensive discipline encompassing a wide range of fields, including both hardware and software technologies. Fundamental AI technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI software technologies primarily include computer vision, speech processing, natural language processing, and machine learning / deep learning.

[0066] Machine learning (ML) is a multidisciplinary field involving probability theory, statistics, approximation theory, convex analysis, and algorithm complexity theory. It specifically studies how computers can simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to endow computers with intelligence; its applications span all areas of artificial intelligence. Machine learning and deep learning typically include techniques such as artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and instructional learning.

[0067] With the research and advancement of artificial intelligence (AI) technology, AI is being studied and applied in various fields, such as smart homes, smart wearable devices, virtual assistants, smart speakers, smart marketing, autonomous driving, drones, robots, smart healthcare, and smart customer service. It is believed that with the development of technology, AI will be applied in more fields and play an increasingly important role.

[0068] The solutions provided in this application involve technologies such as machine learning in artificial intelligence, specifically unsupervised learning based on federated learning. For example, in this application embodiment, a clustering model is iteratively trained based on a sample business dataset, outputting the trained target clustering model, and the initial cluster center set obtained in the last iteration is used as the target cluster center set.

[0069] Automated annotation is a method that uses algorithms to annotate text, images, and scene labels without the need for manual annotation. Automated annotation methods can effectively improve the efficiency of manual annotation and reduce the subjective impact of manual annotation.

[0070] In related technologies, during the model training phase, based on various preset classification labels, initial classification labels are randomly set for each sample data. Then, the weight parameters and loss values ​​of each sample data under each classification label are calculated iteratively. Based on the calculated weight parameters and loss values, the target classification label corresponding to each sample data is selected from the classification labels.

[0071] However, the above annotation methods require random annotation of each sample data first, which increases the annotation difficulty and resource consumption. In addition, random annotation can cause unstable classification results, making it difficult for model parameters to converge.

[0072] In this embodiment, the computing nodes iteratively train the clustering model based on the sample business dataset, output the trained target clustering model, and use the initial cluster center set obtained in the last iteration as the target cluster center set. Each iteration performs the following operations: clustering the sample business data based on the clustering model to obtain the initial cluster center set corresponding to any computing node, where each initial cluster center represents a business category; sending the initial cluster center set to the coordination node and obtaining the initial cluster center sets corresponding to other computing nodes returned by the coordination node; obtaining the model loss based on the initial cluster center sets corresponding to each computing node, and adjusting the model parameters based on the model loss if the model loss does not meet the preset loss range.

[0073] In this way, random labeling and classification of sample data is unnecessary during model training. This reduces the instability caused by the randomness of labeling, effectively improving clustering performance. Furthermore, the elimination of random labeling also enhances computational efficiency. Moreover, the federated learning mechanism effectively protects the data security of each computing node while utilizing the data stored on each node for model optimization, thus improving the effectiveness of model labeling.

[0074] See Figure 1 The diagram shown illustrates a possible application scenario provided in this embodiment. This application scenario includes a coordination node 110 and at least two computing nodes 120.

[0075] In this embodiment, at least two computing nodes 120 store business data of different feature dimensions of the same object. It should be noted that, in this application embodiment, the business data includes, but is not limited to, text, video, and image data. Business categories include, but are not limited to, text categories, video categories, and scene categories. For example, the number of computing nodes is three, and the business data stored in the three computing nodes are respectively the target object's historical navigation information, parking information, and location attribute information.

[0076] In this embodiment of the application, at least two computing nodes 120 or coordinating nodes 110 can be computing nodes on the blockchain or independent computing devices with computing capabilities, and there is no limitation on this.

[0077] The computing device can be a terminal device or a server. Terminal devices can be mobile phones, computers, desktop computers, smart speakers, smartwatches, IoT devices, smart home appliances, in-vehicle terminals, smart voice interaction devices, aircraft, etc., but are not limited to these. The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms. At least two computing nodes 120 and the coordinating node 110 can be directly or indirectly connected via wired or wireless communication, which is not limited herein.

[0078] In this embodiment, for each of the at least two computing nodes 120, the clustering model is iteratively trained based on the sample business dataset, and the trained target clustering model is output. The initial cluster center set obtained in the last iteration is used as the target cluster center set. Each iteration performs the following operations: clustering the sample business data based on the clustering model to obtain the initial cluster center set corresponding to any computing node, wherein each initial cluster center represents a business category; sending the initial cluster center set to the coordination node 110 and obtaining the initial cluster center sets corresponding to other computing nodes returned by the coordination node 110; obtaining the model loss based on the initial cluster center sets corresponding to each computing node, and adjusting the model parameters based on the model loss when the model loss does not meet the preset loss range.

[0079] The coordinating node 110 is used to obtain the cluster center group corresponding to each computing node based on the received initial cluster center sets. Each cluster center group contains the initial cluster center sets corresponding to other computing nodes besides the corresponding computing node. The obtained cluster center groups are sent to the corresponding computing nodes so that each computing node can train to obtain the corresponding target cluster center set based on the corresponding cluster center group.

[0080] The embodiments of this application can be applied to various scenarios such as cloud technology, artificial intelligence, smart transportation, and assisted driving.

[0081] Of course, the methods provided in the embodiments of this application are not limited to... Figure 1 The application scenarios shown can also be used in other possible scenarios, and this application does not impose any limitations. Figure 1 The functions that each device in the application scenario shown can achieve will be described in subsequent method embodiments, and will not be elaborated on here.

[0082] See Figure 2 As shown, it is a flowchart of a possible data processing method provided in the embodiment of this application. The method is applied to any computing node in federated learning. The following is an example of an iteration process in computing node x, which is any computing node in federated learning.

[0083] S201. The computing node x clusters the sample business data x based on the clustering model to obtain the initial cluster center set corresponding to any computing node, wherein each initial cluster center represents a business category.

[0084] In this embodiment, the sample business dataset can be configured as follows: If the data type of the business data is historical navigation information, then based on the business data, object dwell information is obtained, and based on the object dwell information, the sample business dataset is obtained. If the business data is parking lot information or location attribute information, then the business data is directly used as the sample business dataset.

[0085] The following example illustrates federated learning, which includes compute nodes A, B, and C. Compute nodes A, B, and C store business data for the same object across different feature dimensions. Compute node x can be any one of compute nodes A, B, or C.

[0086] Taking compute node x as compute node A as an example, compute node A stores historical navigation information from the navigation application. This historical navigation information may include, but is not limited to, one or more of the following: the location information of the target object at the navigation start point, the location information of the navigation destination, the time of departure from the navigation start point, the time of return to the navigation start point, the time of arrival at the navigation destination, the time of departure from the navigation destination, the time of entry into the parking lot, and the time of departure from the parking lot. The location information may use, but is not limited to, latitude and longitude information. (See also...) Figure 3A As shown in the diagram, the navigation application includes the navigation start point and navigation end point input by the target object. The computing node A can obtain the location information of the navigation start point, the location information of the navigation end point, the time of leaving the navigation start point, the time of returning to the navigation start point, the time of arriving at the navigation end point, the time of leaving the navigation end point, the time of entering the parking lot, and the time of leaving the parking lot as historical navigation information.

[0087] The object dwell time information includes, but is not limited to, one or more of the following: first time length, second time length, third time length, and parking lot dwell time. Computation node A can use the various information contained in the object dwell time information as feature dimensions of the sample business data.

[0088] For example, computing node A calculates the time interval between the departure time from the navigation starting point and the arrival time at the navigation destination to obtain a first time length. Computing node A calculates the time interval between the arrival time at the navigation destination and the departure time from the navigation destination to obtain a second time length. Computing node A calculates the time interval between the departure time from the navigation starting point and the return time to the navigation starting point to obtain a third time length. Computing node A calculates the time interval between the entry time into the parking lot and the exit time from the parking lot to obtain the parking lot dwell time. Computing node A uses the first time length, the second time length, the third time length, the location information of the navigation starting point, and the location information of the navigation destination as feature dimensions of the sample business data, thereby obtaining the sample business dataset corresponding to computing node A.

[0089] Taking computing node x as computing node B as an example, computing node B stores location attribute information for map services. This location attribute information can also be called location attribute classification information. The location attribute information may include, but is not limited to, one or more of the following: the classification attribute of the location area where the navigation start point is located, and the classification attribute of the location area where the navigation destination is located. These classification attributes include, but are not limited to, commercial, residential, and tourist attractions. Computing node B uses the classification attributes of the location area where the navigation start point is located and the classification attributes of the location area where the navigation destination is located as the feature dimensions of the sample service data, thereby obtaining the sample service dataset corresponding to computing node B.

[0090] See Figure 3B As shown, computing node B stores the classification attributes of the navigation starting point location area and the navigation ending point location area. The classification attribute of the navigation starting point location area is a commercial area, and the classification attribute of the navigation ending point location area is a scenic spot area.

[0091] Taking computing node x as computing node C as an example, computing node C stores parking information for parking services. This parking information includes, but is not limited to, one or more of the following: parking record information at the navigation starting point (private vehicles, temporary vehicles, etc.), parking record information at the navigation destination (private vehicles, temporary vehicles, etc.), parking fees, entry time, and exit time. Computing node C uses the parking record information at the navigation starting point, the parking record information at the navigation destination, parking fees, entry time, and exit time as feature dimensions of the sample service data, thereby obtaining the sample service dataset corresponding to computing node C.

[0092] The above implementation method can utilize the business data stored on each computing node to obtain sample business data for model training, and then use the sample business data from each computing node to optimize the model, ensuring the data storage security of each computing node.

[0093] In this embodiment, the clustering algorithm can be, but is not limited to, the k-means clustering algorithm. During execution S201, computing node x clusters the sample business data x based on the k-means clustering model, obtaining m initial cluster centers, and using these m initial cluster centers as the initial cluster center set corresponding to computing node x. The value of m can be set according to the business scenario.

[0094] It should be noted that when each computing node performs clustering using k-means, the number of initial cluster centers can be the same or different. In this embodiment, we will only use the example where each computing node obtains m initial cluster centers.

[0095] The sample service data x is one or more data points from the sample service dataset. For example, in this embodiment, sample service data x can be randomly partitioned from the sample service dataset according to a set data partitioning ratio. Sample service data x can also be referred to as training samples.

[0096] For example, if the data split ratio is 8:2 (training sample: test sample), and the sample business dataset contains 1000 data points, 800 data points are randomly selected from the sample business dataset and used as training samples.

[0097] S202. Computing node x sends the initial cluster center set to the coordinating node and obtains the initial cluster center sets corresponding to the other computing nodes returned by the coordinating node.

[0098] Specifically, when executing S202, the following two possible implementation methods can be adopted, but are not limited to:

[0099] The first possible implementation involves direct data transmission between the computing node x and the coordinating node.

[0100] In this embodiment, each computing node sends its initial cluster center set to the coordinating node. After receiving the initial cluster center sets from each computing node, the coordinating node obtains the corresponding cluster center groups for each computing node based on the received initial cluster center sets, and then sends the obtained cluster center groups to the corresponding computing nodes.

[0101] Each cluster center group contains the initial cluster center set corresponding to all computing nodes except the corresponding computing node. The cluster center group can also be referred to as the encrypted initial cluster center set corresponding to each of the other computing nodes.

[0102] Let's take federated learning, which includes compute node A, compute node B, and compute node C, as an example.

[0103] The cluster center set corresponding to node A is represented as {μ k |k=1,…,m},μ k Let μ be the cluster center vector of the k-th class in node A, i.e., the cluster center of the k-th class. k It can be calculated using formula (1):

[0104]

[0105] Among them, C k Let X represent the k-th class, and let X represent the sample business data of computing node A.

[0106] The cluster center set corresponding to node B is represented as {θ}k |k=1,…,m},θ k Let θ represent the class center vector of the k-th class in node B. k It can be calculated using formula (2):

[0107]

[0108] Among them, C k Let Y represent the k-th class, and let Y represent the sample business data of computing node B.

[0109] The cluster center set corresponding to node C is represented as {η} k |k=1,…,m},η k Let η represent the class center vector of the k-th class in node C. k It can be calculated using formula (3):

[0110]

[0111] Where Ck represents the k-th class, and Z represents the sample business data of computing node C.

[0112] See Figure 4 As shown, computation node A will initialize the cluster center set {μ} k |k=1,…,m} is sent to the coordinating node, and the computation node B sends the initial cluster center set {θ}. k |k=1,…,m} is sent to the coordinating node, and the computing node C sends the initial cluster center set {η}. k |k=1,…,m} is sent to the coordinating node.

[0113] See Figure 5 As shown, the coordinating node receives {μ k |k=1,…,m}、{θ k |k=1,…,m}、{η k After |k=1,…,m}, for {μ k |k=1,…,m}、{θ k |k=1,…,m}、{η k Concatenate each pair of |k=1,…,m} to obtain {μ k θ k |k=1,…,m}、{η k θ k |k=1,…,m}、{μ k η k |k=1,…,m}, where {η k θ k The set of cluster centers, {η}, contains the initial cluster centers corresponding to nodes B and C, respectively. k θk |k=1,…,m} is the cluster center group corresponding to node A, {μ k η k |k=1,…,m} contains the initial cluster center sets corresponding to nodes A and C, respectively, {μ k η k |k=1,…,m} is the cluster center group corresponding to node B, {μ k θ k |k=1,…,m} contains the initial cluster center sets corresponding to nodes A and B, {μ k θ k |k=1,…,m} is the cluster center group corresponding to node C.

[0114] Then, the coordinating node will {η k θ k |k=1,…,m} is sent to compute node A, and {μ k η k |k=1,…,m} is sent to compute node B, and {μ k θ k |k=1,…,m} is sent to compute node C.

[0115] The second possible implementation involves transmitting encrypted data between the computing node x and the coordinating node.

[0116] Specifically, in this embodiment, when the initial cluster center set is sent to the coordinating node, computing node x encrypts the initial cluster center set using the target encryption algorithm to obtain the encrypted initial cluster center set, and then sends the encrypted initial cluster center set to the coordinating node. Correspondingly, after receiving the encrypted initial cluster center set, the coordinating node decrypts the encrypted initial cluster center set using the target encryption algorithm to obtain the initial cluster center set of computing node x.

[0117] After obtaining the initial cluster center sets corresponding to each computing node, the coordinating node will obtain the corresponding cluster center groups for each computing node based on the received initial cluster center sets. Then, the target encryption algorithm is used to encrypt the obtained cluster center groups to obtain encrypted cluster center groups, and the encrypted cluster center groups are sent to the corresponding computing nodes.

[0118] Each computing node can decrypt the encrypted cluster center group returned by the coordinating node using the target encryption algorithm to obtain the corresponding cluster center group.

[0119] The target encryption algorithm can be, but is not limited to, homomorphic encryption algorithms. Homomorphic encryption refers to homomorphically encrypting the original data, performing specific operations on the resulting ciphertext, and then homomorphically decrypting the result to obtain the plaintext, which is equivalent to directly performing the same calculation on the original plaintext data.

[0120] See Figure 6 As shown, computing node A uses a homomorphic encryption algorithm to encrypt {μ k Encrypting |k=1,…,m} yields the encrypted initial cluster center set {[[μ k ]]|k=1,…,m}, where [[·]] denotes encryption. Computation node A will use the encrypted initial cluster center set {[[μ k The initial cluster center set {[k=1,…,m} is sent to the coordinating node. The coordinating node receives the encrypted initial cluster center set {[[μ]}. k After |k=1,…,m}, a homomorphic encryption algorithm is used to process {[[μ k Decrypt the cluster center set {μ} corresponding to node A by decrypting |k=1,…,m}. k |k=1,…,m}.

[0121] Computation node B uses a homomorphic encryption algorithm to encrypt {θ} k Encrypt the cluster centers {[[θ}} by encrypting |k=1,…,m}. k ]]|k=1,…,m}, compute node B will encrypt the initial cluster center set {[[θ k The initial cluster center set {[[θ}|k=1,…,m} is sent to the coordinating node. The coordinating node receives the encrypted initial cluster center set {[[θ]|k=1,…,m}. k After |k=1,…,m}, a homomorphic encryption algorithm is used to process {[[θ]}. k Decrypt the cluster center set {θ} corresponding to node B by decrypting |k=1,…,m}. k |k=1,…,m}.

[0122] Computation node C uses a homomorphic encryption algorithm to process {η} k Encrypt the cluster centers {[[η}} by encrypting |k=1,…,m}. k ]]|k=1,…,m}, the computing node C will encrypt the initial cluster center set {[[η k The initial cluster center set {[[η}|k=1,…,m} is sent to the coordinating node. The coordinating node receives the encrypted initial cluster center set {[[η]|k=1,…,m}. k After |k=1,…,m}, a homomorphic encryption algorithm is used to process {[[η]} kDecrypt the cluster center set {η} corresponding to the computing node C by decrypting |k=1,…,m}. k |k=1,…,m}.

[0123] See Figure 7 As shown, the coordinating node obtains the initial cluster center set {μ} corresponding to computing node A. k |k=1,…,m}, compute the initial cluster center set {θ} corresponding to node B. k |k=1,…,m}、The initial cluster center set corresponding to node C {[[η k After |k=1,…,m}, for {μ k |k=1,…,m}、{θ k |k=1,…,m}、{η k Concatenate each pair of |k=1,…,m} to obtain {μ k θ k |k=1,…,m}、{η k θ k |k=1,…,m}、{μ k η k |k=1,…,m}, where {η k θ k |k=1,…,m} is the cluster center group corresponding to node A, {μ k η k |k=1,…,m} is the cluster center group corresponding to node B, {μ k θ k |k=1,…,m} is the cluster center group corresponding to node C.

[0124] Then, the coordinating node uses a homomorphic encryption algorithm to perform encryption on the cluster center group {η} corresponding to computing node A. k θ k Encrypting |k=1,…,m} yields the encrypted cluster center group {[[η k θ k ]]│k=1,…,m}, and the encrypted cluster center group {[[η k θ k The clustering center group {μ} corresponding to computing node B is sent to computing node A. The coordinating node uses a homomorphic encryption algorithm to send the clustering center group {μ} to computing node B. k η k Encrypting |k=1,…,m} yields the encrypted cluster center group {[[μ k η k ]]|k=1,…,m}, and the encrypted cluster center group {[[μ k η kThe clustering center group {μ} corresponding to computing node C is sent to computing node B. The coordinating node uses a homomorphic encryption algorithm to send the clustering center group {μ} to computing node C. k θ k Encrypting |k=1,…,m} yields the encrypted cluster center group {[[μ k θ k ]]|k=1,…,m}, and the encrypted cluster center group {[[μ k θ k The |k=1,…,m} is sent to compute node C.

[0125] Computing node A receives the encrypted clustering center group {[[η k θ k After ]]│k=1,…,m}, a homomorphic encryption algorithm is used to process {[[η k θ k Decrypt the cluster center group {η} by decrypting the cluster center group {k=1,…,m}. k θ k |k=1,…,m}, that is, to obtain the initial cluster center set {η} of computing node B and computing node C. k θ k |k=1,…,m}.

[0126] Computing node B receives the encrypted cluster center group {[[μ k η k After |k=1,…,m}, a homomorphic encryption algorithm is used to process {[[μ k η k Decrypting |k=1,…,m} yields the cluster center group {μ k η k |k=1,…,m}, that is, to obtain the initial cluster center set {μ} of computing nodes A and C. k η k |k=1,…,m}.

[0127] Computing node C receives the encrypted cluster center group {[[μ k θ k After |k=1,…,m}, a homomorphic encryption algorithm is used to process {[[μ k θ k Decrypting |k=1,…,m} yields the cluster center group {μ k θ k |k=1,…,m}, that is, to obtain the initial cluster center set {μ} of computing node A and computing node B. k θ k |k=1,…,m}.

[0128] Through the above implementation, data transmission security is improved during data transfer between computing nodes and coordination nodes, thereby effectively enhancing the data security of each computing node. Furthermore, due to the improved security of stored business data, model optimization using this data avoids the impact of data loss or tampering on model performance, thus improving model annotation effectiveness and the accuracy of automated annotation. In addition, the use of homomorphic encryption algorithms, which focus on data processing security, ensures information security during data processing and also improves data processing efficiency.

[0129] S203. The model loss of each computing node x is obtained based on the initial cluster center set corresponding to each computing node.

[0130] See Figure 8 As shown, specifically, when executing S203, the following steps may be used, but are not limited to:

[0131] S2031. Computation node x obtains each reference cluster center based on the initial cluster center set corresponding to each computing node.

[0132] Specifically, when executing S2031, the following two methods can be used, but are not limited to:

[0133] Method 1: Computation node x concatenates the initial cluster center sets corresponding to other computation nodes with the initial cluster center sets corresponding to computation node x to obtain each reference cluster center.

[0134] Taking computing node x as computing node A as an example, computing node A will set the initial cluster center sets {η} corresponding to the other computing nodes. k θ k |k=1,…,m}, the initial cluster center set {μ} corresponding to A k Concatenate the clusters |k=1,…,m} to obtain the reference cluster centers {μ k η k θ k |k=1,…,m}.

[0135] Taking computation node x as an example of computation node B, computation node B will {μ k η k |k=1,…,m}, the initial cluster center set {θ} corresponding to B k Concatenate the clusters |k=1,…,m} to obtain the reference cluster centers {μ k η k θ k |k=1,…,m}.

[0136] Taking computation node x as an example of computation node C, computation node C will {μ k θ k |k=1,…,m}, the initial cluster center set {η} corresponding to C k Concatenate the clusters |k=1,…,m} to obtain the reference cluster centers {μ k η k θ k |k=1,…,m}.

[0137] Method 2: Computing node x encrypts the initial cluster center sets corresponding to each of the other computing nodes using the target encryption algorithm, obtaining the encrypted initial cluster center sets corresponding to each of the other computing nodes. Then, it encrypts the initial cluster center set corresponding to computing node x using the target encryption algorithm, obtaining the encrypted initial cluster center set corresponding to computing node x. Finally, it concatenates the encrypted initial cluster center sets corresponding to the other computing nodes with the encrypted initial cluster center set corresponding to computing node x to obtain the reference cluster centers.

[0138] Taking computing node x as computing node A as an example, computing node A obtains the encrypted initial cluster center set {[[μ] through the target encryption algorithm. k ]]|k=1,…,m}, compute the encrypted initial cluster center set {[[θ k ]]|k=1,…,m}, compute the encrypted initial cluster center set {[[η k ]]|k=1,…,m}, then compute the encrypted initial cluster center set {[[θ k ]]|k=1,…,m}, compute the encrypted initial cluster center set {[[η k ]]|k=1,…,m}, the encrypted initial cluster center set {[[μ k The reference cluster centers {[[μ} are obtained by concatenating |k=1,…,m}. k ]],[[η k ]], [[θ k ]]│k=1,…,m}.

[0139] Similarly, computation nodes B and C can obtain the reference cluster centers {[[μ] in the same way as computation node A. k ]],[[η k ]], [[θ k The sequence k = 1, ..., m will not be elaborated further here.

[0140] S2032. The computing node x obtains a test sample set based on the sample business data, and determines the test samples contained in each cluster based on each reference cluster center, wherein each cluster corresponds to a reference cluster center.

[0141] In this application, the test sample set is one or more data points from the sample service dataset. For example, in this embodiment, the test sample set can be randomly partitioned from the sample service dataset according to a set data partitioning ratio.

[0142] For example, the data split ratio is 8:2 (training samples: test samples). Suppose that the sample business dataset contains 1000 data points. 200 data points are randomly selected from the sample business dataset and used as the test sample set. The remaining 800 data points are used as the training data.

[0143] It should be noted that in this embodiment, the example of dividing test samples and training samples from the sample business dataset is used for illustration. In actual application, test samples or training samples can also be divided separately from the sample business dataset, and there is no limitation on this.

[0144] For example, the book division ratio of the test sample is 20%. Suppose that the sample business dataset contains 1000 data points, and 200 data points are randomly divided from the sample business dataset, and these 200 data points are used as the test sample set.

[0145] When determining the test samples contained in each cluster based on each reference cluster center, the test sample set is clustered based on each reference cluster center to determine the test samples contained in each cluster. Each cluster corresponds to a reference cluster center.

[0146] Taking compute node x as an example of compute node A, see [link to relevant documentation]. Figure 9 As shown, assuming m is 7, the reference cluster centers include: reference cluster center 1 {[[μ1]], [[η1]], [[θ1]]}, ..., reference cluster center 7 {[[μ7]], [[η7]], [[θ7]]}. Computation node A clusters the test sample set {A1, ..., A100} based on each reference cluster center to determine the test samples contained in each cluster. Specifically, the cluster corresponding to reference cluster center 1 {[[μ1]], [[η1]], [[θ1]]} contains test samples A1, A2, ..., A10, A22, A27, etc. The test samples contained in the clusters corresponding to other reference cluster centers are not detailed here.

[0147] By using the above methods to test the model with training samples that are different from the training samples, the generalization ability of the model can be effectively improved.

[0148] S2033. The computing node x obtains the sub-loss corresponding to each cluster based on the test samples contained in each cluster and their corresponding reference cluster centers, and obtains the model loss based on the obtained sub-losses.

[0149] Specifically, when executing S2033, compute node x performs the following operations for each cluster within each cluster:

[0150] Calculate the distance evaluation value between at least one test sample in a cluster and the reference cluster center of the corresponding cluster; sum the calculated distance evaluation values ​​as a sub-loss corresponding to a cluster.

[0151] Taking computation node x as an example of computation node A, the model loss L of computation node A is... A It can be calculated using, but is not limited to, formula (4):

[0152]

[0153] in, Let ||X| represent the distance evaluation value between a test sample belonging to class k in node A and the kth reference cluster center, and let ||·||2 represent the second normal form. k ]],[[η k ]], [[θ k ]]]‖2 can also be called the federated distance between a test sample belonging to the kth class in computing node A and the kth reference cluster center.

[0154] Taking computation node x as an example of computation node B, the model loss L of computation node B is... B It can be calculated using, but is not limited to, formula (5):

[0155]

[0156] Where, ‖Y-[[[μ k ]],[[η k ]], This represents the distance evaluation value between a test sample belonging to the k-th class in node B and the k-th reference cluster center, ‖·‖2 represents the second normal form, and ‖Y-[[[μ k ]],[[η k ]], [[θ k ]]]‖2 can also be called the federated distance between a test sample belonging to the kth class in computing node B and the kth reference cluster center.

[0157] Taking computation node x as an example of computation node C, the model loss L of computation node C is... C It can be calculated using, but is not limited to, formula (6):

[0158]

[0159] Among them, ||Z-[[[μ k ]],[[η k ]], This represents the distance evaluation value between a test sample belonging to class k in node C and the k-th reference cluster center, ‖·‖2 represents the second normal form, and ‖Z-[[[μ k ]],[[η k ]], [[θ k ]]]‖2 can also be called the federated distance between a test sample belonging to the k-th class in computing node C and the k-th reference cluster center.

[0160] By implementing the above methods and utilizing the federated learning mechanism, we can effectively protect the data security of each computing node, while also using the features of each computing node to optimize the model and improve the effect of automated model labeling.

[0161] S204. Calculate whether the model loss of node x meets the preset loss range. If yes, execute S206; otherwise, execute S205.

[0162] S205, compute node x adjusts the model parameters based on the model loss and returns to execute S201 for the next iteration.

[0163] S206. Calculate the target clustering model after training from node x, and use the initial cluster center set obtained in the last iteration as the target cluster center set.

[0164] For example, computing node A will use the initial cluster center set {μ} obtained from the last iteration. k |k=1,…,m}, serves as the target cluster center set.

[0165] It should be noted that in this embodiment, only whether the model loss meets the preset loss range is considered as a possible model convergence condition. In actual applications, the model convergence condition can also be that the number of iterations does not exceed the iteration threshold, but it is not limited to this. Accordingly, after executing S203, it is determined whether the model convergence condition is met. If it is met, S206 is executed; otherwise, the model parameters are adjusted based on the model loss.

[0166] In some embodiments, the target clustering model can be applied to either compute node x or coordinating node. As a possible implementation, if the target clustering model can be applied to compute node x, compute node x sends the target cluster center set to the coordinating node, so that the coordinating node can detect each piece of data to be detected based on the obtained target cluster center sets corresponding to each compute node, and determine the business category corresponding to each piece of data to be detected.

[0167] As another possible implementation, if the target clustering model can be applied to compute node x, compute node x sends the target cluster center set to the coordinating node and receives the target cluster center sets corresponding to other compute nodes returned by the coordinating node. Based on the obtained target cluster center sets corresponding to each compute node, compute node x performs detection on each piece of data to be detected and determines the business category corresponding to each piece of data.

[0168] Among them, the target cluster center set corresponding to each computing node is obtained to detect each data to be detected. When determining the business category corresponding to each data to be detected, for each data to be detected, the reference cluster center corresponding to the data to be detected can be determined from each reference cluster center based on the distance between the data to be detected and each reference cluster center formed by the target cluster center set corresponding to each computing node, that is, the business category corresponding to the data to be detected can be determined.

[0169] The following description uses several specific examples to illustrate the points:

[0170] Example 1: Geographic location information annotation.

[0171] See Figure 10 As shown, the computing nodes in federated learning include computing node A, computing node B, and computing node C. The interaction process between computing nodes A, B, and C includes the following nine stages.

[0172] Phase 1: Sample Construction.

[0173] Computing node A stores historical navigation information, including: the target object's location at the navigation start point, the navigation destination, departure time, return time, arrival time at the navigation destination, departure time from the navigation start point, entry time into the parking lot, and departure time from the parking lot. Based on this historical navigation information, computing node A obtains object dwell information such as the first time length, second time length, third time length, and the location information of the navigation start point and navigation destination. It then uses these data as feature dimensions for the sample business data of computing node A, thereby obtaining the sample business dataset corresponding to computing node A.

[0174] Computation node B stores location attribute information, which includes the classification attributes of the navigation start-point and navigation end-point locations. Computation node B uses the classification attributes of the navigation start-point and navigation end-point locations as feature dimensions of the sample business data, thereby obtaining the sample business dataset corresponding to computation node B.

[0175] Computing node C stores parking information, including parking records at the navigation start and end points, parking fees, entry time, and exit time. Computing node C uses these parking records as feature dimensions of the sample business data, thus obtaining the sample business dataset corresponding to computing node C.

[0176] Phase Two: Sample Division.

[0177] Computing node A divides the sample business dataset corresponding to computing node A into a training sample set X. A,train and test sample set X A,test Computing node B divides the sample business dataset corresponding to computing node B into a training sample set Y. B,train and test sample set Y B,test Computing node C divides the sample business dataset corresponding to computing node C into a training sample set Z. C ,train and test sample set Z C,test .

[0178] Phase 3: Clustering of models for each computing node.

[0179] Computation node A, based on a clustering model, performs calculations on the training sample set X. A,train Clustering is performed to obtain the initial cluster center set {μ} corresponding to node A. k |k=1,…,m}. Node B, based on a clustering model, performs calculations on the training sample set Y. B,train Clustering is performed to obtain the initial cluster center set {θ} corresponding to node B. k |k=1,…,m}. The computation node C is based on a clustering model and operates on the training sample set Z. C,train Clustering is performed to obtain the initial cluster center set {η} corresponding to the computation node C. k |k=1,…,m}.

[0180] Phase 4: Encrypted transmission of clustering centers across computing nodes.

[0181] Computation node A uses a homomorphic encryption algorithm to process {μk Encrypting |k=1,…,m} yields the encrypted initial cluster center set {[[μ k ]]|k=1,…,m}, and {[[μ k The compute node B sends the {θ} to the coordinating node using a homomorphic encryption algorithm. k Encrypt the cluster centers {[[θ}} by encrypting |k=1,…,m}. k ]]|k=1,…,m}, and {[[θ k The compute node C sends the sequence {η} to the coordinating node using a homomorphic encryption algorithm. k Encrypt the cluster centers {[[η}} by encrypting |k=1,…,m}. k ]]|k=1,…,m}, compute node C will {[[η k Send |k=1,…,m} to the coordinating node.

[0182] Phase 5: Coordinating Node Decryption and Cluster Center Assembly.

[0183] The coordinating node uses a homomorphic encryption algorithm to process {[[μ k ]]|k=1,…,m}、{[[θ k ]]|k=1,…,m}、{[[η k Decrypting |k=1,…,m} yields {μ k |k=1,…,m}、{θ k |k=1,…,m}、

[0184] {[[η k ]]|k=1,…,m}, and for {μ k |k=1,…,m}、{θ k |k=1,…,m}、{η k |k=1,…,m} are concatenated pairwise for encryption to obtain {[[η k θ k ]]│k=1,…,m}、{[[μ k η k ]]|k=1,…,m}、{[[μ k θ k ]]|k=1,…,m}.

[0185] Phase Six: Distribution by Federal Cluster Centers.

[0186] The coordinating node will {[[η k θ k ]]│k=1,…,m} is sent to compute node A, and {[[μ k ηk The message ]]|k=1,…,m} is sent to compute node B, and {[[μ k θ k The |k=1,…,m} is sent to compute node C. See section S202 above for details.

[0187] Phase 7: Clustering Model Testing Phase.

[0188] Based on the initial cluster center sets corresponding to each computing node, computing node A obtains the reference cluster centers {[[μ k ]],[[η k ]], [[θ k ]]│k=1,…,m}. Based on the test sample set X A,test , and based on {[[μ k ]],[[η k ]], [[θ k ]]|k=1,…,m}, using the above formula (4), L is calculated. A If L A If the loss falls within the preset range, then output the {μ} obtained in the current iteration. k |k=1,…,m}, is used as the target cluster center set; otherwise, stages two through seven are repeated until the preset loss range is met.

[0189] Computation node B obtains each reference cluster center {[[μ] based on the initial cluster center set corresponding to each computing node. k ]],[[η k ]], [[θ k ]]│k=1,…,m}. Based on the test sample set Y B,test , and based on {[[μ k ]],[[η k ]], [[θ k ]]|k=1,…,m}, using the above formula (5), L is calculated. B If L B If the loss falls within the preset range, then output the {θ} obtained in the current iteration. k |k=1,…,m}, is used as the target cluster center set; otherwise, stages two through seven are repeated until the preset loss range is met.

[0190] Based on the initial cluster center sets corresponding to each computing node, computing node A obtains the reference cluster centers {[[μ k ]],[[η k ]], [[θ k ]]│k=1,η,m}. Based on the test sample set Z C,test , and based on {[[μ k ]],[[ηk ]],[[η k ]]|k=1,…,m}, using the above formula (6), L is calculated. C If L C If the loss falls within the preset range, then output the {η} obtained in the current iteration. k |k=1,…,m}, is used as the target cluster center set; otherwise, stages two through seven are repeated until the preset loss range is met.

[0191] For details, please refer to S203 above, which will not be repeated here.

[0192] Phase 8: Clustering Application Phase.

[0193] Any one of computing nodes A, B, or C obtains the target cluster center sets corresponding to the other computing nodes through the coordinating node, and then, based on the target cluster center sets {μ} corresponding to each computing node... k |k=1,…,m}、{θ k |k=1,…,m}、{η k |k=1,…,m}, clustering of locally stored business data.

[0194] Furthermore, after acquiring the data to be detected, computing node B can determine the target clustering center set {μ} corresponding to each computing node. k |k=1,…,m}、{θ k |k=1,…,m}、{η k The data to be tested is clustered according to the group |k=1,…,m}, and the classification results of the geographic location information are obtained.

[0195] Example 2: Abnormal Behavior Detection

[0196] The federated learning computing nodes include computing node A, computing node B, and computing node C. Computing node A stores social media data, computing node B stores game data, and computing node C stores financial business information.

[0197] Computational nodes A, B, and C can be trained using S201-S206 to obtain the target cluster center set {μ} for each computing node. k |k=1,…,m}、{θ k |k=1,…,m}、{η k |k=1,…,m}. The computation node C can be based on the target cluster center set {μ} corresponding to each computation node obtained during training. k |k=1,…,m}、{θ k|k=1,…,m}、{η k The clustering of the target object's data is performed on the target object's data. Based on the clustering results, it is determined whether the target object has any abnormal business behavior.

[0198] Example 3: Information Retrieval

[0199] The federated learning computing nodes include computing node A and computing node B. Computing node A stores business data consisting of search keywords in the medical field, while computing node B stores business data consisting of search keywords in the financial field.

[0200] Computational nodes A and B can be trained using steps S201-S206 to create a clustering model, thereby obtaining the target cluster center set {μ} for each computational node. k |k=1,…,m}、{θ k |k=1,…,m}、{η k |k=1,…,m}. The coordinating node can be based on the target cluster center set {μ} corresponding to each computation node obtained during training. k |k=1,…,m}、{θ k |k=1,…,m}、{η k The search keywords are clustered according to the clustering results. Based on the clustering results, the cluster centers corresponding to the search keywords are determined. Based on the cluster centers corresponding to the search keywords, search keywords that are the same as or similar to the search keywords are obtained. Then, the search results corresponding to the search keywords that are the same as or similar to the search keywords are returned to the target object.

[0201] It should be noted that the collection, dissemination, and use of data in this embodiment comply with relevant national laws and regulations.

[0202] Based on the same inventive concept, embodiments of this application provide a data processing apparatus. The apparatus is deployed on any one of the computing nodes in a federated learning system. For example... Figure 11 As shown, this is a structural schematic diagram of the data processing device 1100, which may include:

[0203] Processing unit 1101 is used to iteratively train a clustering model based on a sample business dataset, output the trained target clustering model, and use the initial cluster center set obtained in the last iteration as the target cluster center set; wherein, each iteration performs the following operations:

[0204] The processing unit 1101 is further configured to cluster the sample business data based on a clustering model to obtain an initial cluster center set corresponding to any one of the computing nodes, wherein each initial cluster center represents a business category.

[0205] The transmission unit 1102 is used to send the initial cluster center set to the coordinating node and obtain the initial cluster center sets corresponding to other computing nodes returned by the coordinating node.

[0206] The processing unit 1101 is further configured to obtain the model loss based on the initial cluster center set corresponding to each computing node, and to adjust the model parameters based on the model loss when the model loss does not meet the preset loss range.

[0207] As one possible implementation, the processing unit 1101 is further configured to:

[0208] Based on the initial cluster center set corresponding to each computing node, each reference cluster center is obtained;

[0209] Based on the sample business data, a test sample set is obtained, and based on the reference cluster centers, the test samples contained in each cluster are determined, wherein each cluster corresponds to one reference cluster center.

[0210] Based on the test samples contained in each cluster and their corresponding reference cluster centers, the sub-loss corresponding to each cluster is obtained, and the model loss is obtained based on the obtained sub-losses.

[0211] As one possible implementation, the processing unit 1101 is further configured to:

[0212] For each of the aforementioned clusters, perform the following operations:

[0213] Calculate the distance evaluation value between at least one test sample contained in a cluster and the reference cluster center corresponding to the cluster;

[0214] The sum of the calculated distance evaluation values ​​is used as the sub-loss corresponding to the cluster.

[0215] As one possible implementation, the processing unit 1101 is further configured to: encrypt the initial cluster center set using a target encryption algorithm to obtain the encrypted initial cluster center set;

[0216] The transmission unit 1102 is further configured to: send the encrypted initial cluster center set to the coordination node, so that the coordination node can decrypt and obtain the initial cluster center set through the target encryption algorithm.

[0217] As one possible implementation, the transmission unit 1102 is further configured to: receive the encrypted initial cluster center set corresponding to each of the other computing nodes returned by the coordination node;

[0218] The processing unit 1101 is further configured to: decrypt the encrypted initial cluster center set corresponding to each of the other computing nodes using the target encryption algorithm, so as to obtain the initial cluster center set corresponding to each of the other computing nodes.

[0219] As one possible implementation, the transmission unit 1102 is further configured to:

[0220] The target cluster center set is sent to the coordination node, so that the coordination node can detect each piece of data to be detected based on the obtained target cluster center set corresponding to each computing node, and determine the business category corresponding to each piece of data to be detected; or...

[0221] Each computing node receives its own initial cluster center set and, based on the target cluster center sets obtained for each computing node, performs detection on each piece of data to be detected to determine the business category corresponding to each piece of data to be detected.

[0222] As one possible implementation, the processing unit 1101 is further configured to:

[0223] If the data type of the business data is historical navigation information, then based on the business data, object dwell information is obtained, and based on the object dwell information, the sample business dataset is obtained;

[0224] If the business data is parking information or location attribute information, then the business data is directly used as the sample business dataset.

[0225] Based on the same inventive concept, embodiments of this application provide a data processing apparatus. For example... Figure 12 As shown, this is a structural schematic diagram of the data processing device 1200, which may include:

[0226] The transmission unit 1201 is used to receive the initial cluster center set sent by each computing node in the federated learning. Each computing node stores business data of different feature dimensions of the same object, and each initial cluster center represents a business category.

[0227] The splicing unit 1202 is used to obtain the cluster center group corresponding to each computing node based on the received initial cluster center sets. Each cluster center group contains: the initial cluster center set corresponding to other computing nodes besides the corresponding computing node.

[0228] The transmission unit 1201 is further configured to send each obtained cluster center group to the corresponding computing node, so that each computing node can train and obtain the corresponding target cluster center set based on the corresponding cluster center group.

[0229] The transmission unit 1201 is also used to receive the encrypted target cluster center set returned by each computing node;

[0230] The decryption unit 1203 is used to decrypt and obtain the target cluster center set corresponding to each computing node through the target encryption algorithm;

[0231] Clustering unit 1204 is used to detect each piece of data to be detected based on the received target cluster center sets, and to determine the business category corresponding to each piece of data to be detected.

[0232] For ease of description, the above sections are divided into modules (or units) according to their functions and described separately. Of course, in implementing this application, the functions of each module (or unit) can be implemented in one or more software or hardware components.

[0233] Regarding the apparatus in the above embodiments, the specific manner in which each unit executes the request has been described in detail in the embodiments related to the method, and will not be elaborated here.

[0234] Those skilled in the art will understand that various aspects of this application can be implemented as a system, method, or program product. Therefore, various aspects of this application can be specifically implemented in the following forms: a completely hardware implementation, a completely software implementation (including firmware, microcode, etc.), or a combination of hardware and software implementations, collectively referred to herein as a "circuit," "module," or "system."

[0235] Based on the same inventive concept, embodiments of this application also provide an electronic device. In one embodiment, the electronic device can be a server or a terminal device. See also... Figure 13 As shown, it is a schematic diagram of the structure of a possible electronic device provided in an embodiment of this application. Figure 13 In the electronic device 1300, there are: processor 1310 and memory 1320.

[0236] The memory 1320 stores a computer program that can be executed by the processor 1310. The processor 1310 can execute the steps of the above data processing method by executing the instructions stored in the memory 1320.

[0237] Memory 1320 may be volatile memory, such as random-access memory (RAM); memory 1320 may also be non-volatile memory, such as read-only memory (ROM), flash memory, hard disk drive (HDD), or solid-state drive (SSD); or memory 1320 may be any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but is not limited thereto. Memory 1320 may also be a combination of the above-described memories.

[0238] The processor 1310 may include one or more central processing units (CPUs) or digital processing units, etc. The processor 1310 implements the above-described data processing method when executing a computer program stored in the memory 1320.

[0239] In some embodiments, the processor 1310 and the memory 1320 may be implemented on the same chip, while in other embodiments they may be implemented on separate chips.

[0240] This application embodiment does not limit the specific connection medium between the processor 1310 and the memory 1320. This application embodiment takes the connection between the processor 1310 and the memory 1320 via a bus as an example. Figure 13 The diagram uses thick lines to describe the connections between other components; these are merely illustrative and not intended to be limiting. Buses can be categorized as address buses, data buses, control buses, etc. For ease of description, Figure 13 It is described using only a thick line, but does not indicate that there is only one bus or one type of bus.

[0241] Based on the same inventive concept, embodiments of this application provide a computer-readable storage medium including a computer program. When the computer program is run on an electronic device, it causes the electronic device to perform the steps of the aforementioned data processing method. In some possible implementations, various aspects of the data processing method provided in this application can also be implemented as a program product including a computer program. When the program product is run on an electronic device, the computer program causes the electronic device to perform the steps of the aforementioned data processing method. For example, the electronic device can perform actions such as... Figure 2 The steps are shown in the figure.

[0242] The program product may employ any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: electrical connections having one or more wires, portable disks, hard disks, RAM, ROM, erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0243] The program product of the embodiments of this application may be a CD-ROM and include a computer program, and may run on an electronic device. However, the program product of this application is not limited thereto. In this document, the readable storage medium may be any tangible medium that contains or stores a computer program that may be used by or in conjunction with a command execution system, apparatus, or device.

[0244] A readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying a readable computer program. This propagated data signal may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium, capable of sending, propagating, or transmitting a computer program for use by or in conjunction with a command execution system, apparatus, or device.

[0245] Although preferred embodiments of this application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of this application.

[0246] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.

Claims

1. A data processing method, characterized in that, In federated learning, any one of the computing nodes stores business data of the same object with different feature dimensions, wherein the business data includes at least one of text, video, and image; the method includes: Based on the sample business dataset, the clustering model is iteratively trained, outputting the trained target clustering model, and the initial cluster center set obtained in the last iteration is used as the target cluster center set; wherein, the following operations are performed in each iteration: Based on the clustering model, the sample business data is clustered to obtain the initial cluster center set corresponding to any computing node, wherein each initial cluster center represents a business category; The initial cluster center set is sent to the coordinating node, and the initial cluster center sets corresponding to the other computing nodes are obtained from the coordinating node. The model loss is obtained based on the initial cluster center set corresponding to each computing node, and the model parameters are adjusted based on the model loss when the model loss does not meet the preset loss range.

2. The method as described in claim 1, characterized in that, The model loss obtained based on the initial cluster center set corresponding to each computing node includes: Based on the initial cluster center set corresponding to each computing node, each reference cluster center is obtained; Based on the sample business data, a test sample set is obtained, and based on the reference cluster centers, the test samples contained in each cluster are determined, wherein each cluster corresponds to one reference cluster center. Based on the test samples contained in each cluster and their corresponding reference cluster centers, the sub-loss corresponding to each cluster is obtained, and the model loss is obtained based on the obtained sub-losses.

3. The method as described in claim 2, characterized in that, The step of obtaining the sub-loss corresponding to each cluster based on the test samples contained in each cluster and their corresponding reference cluster centers includes: For each of the aforementioned clusters, perform the following operations: Calculate the distance evaluation value between at least one test sample contained in a cluster and the reference cluster center corresponding to the cluster; The sum of the calculated distance evaluation values ​​is used as the sub-loss corresponding to the cluster.

4. The method as described in claim 1, 2, or 3, characterized in that, Sending the initial cluster center set to the coordinating node includes: The initial cluster center set is encrypted using the target encryption algorithm to obtain the encrypted initial cluster center set. The encrypted initial cluster center set is sent to the coordinating node, so that the coordinating node can decrypt the initial cluster center set using the target encryption algorithm.

5. The method as described in claim 4, characterized in that, Obtaining the initial cluster center sets corresponding to the other computing nodes returned by the coordinating node includes: Receive the encrypted initial cluster center sets corresponding to each of the other computing nodes returned by the coordination node; The encrypted initial cluster center sets corresponding to each of the other computing nodes are decrypted using the target encryption algorithm to obtain the initial cluster center sets corresponding to each of the other computing nodes.

6. The method as described in claim 1, 2, or 3, characterized in that, Also includes: The target cluster center set is sent to the coordination node, so that the coordination node can detect each piece of data to be detected based on the obtained target cluster center set corresponding to each computing node, and determine the business category corresponding to each piece of data to be detected; or... Each computing node receives its own initial cluster center set and, based on the target cluster center sets obtained for each computing node, performs detection on each piece of data to be detected to determine the business category corresponding to each piece of data to be detected.

7. The method as described in claim 1, 2, or 3, characterized in that, The sample business dataset was obtained through the following methods: If the data type of the business data is historical navigation information, then based on the business data, object dwell information is obtained, and based on the object dwell information, the sample business dataset is obtained; If the business data is parking information or location attribute information, then the business data is directly used as the sample business dataset.

8. A data processing method, characterized in that, The method, applied to the coordination node of federated learning, includes: Each computing node in the federated learning process receives an initial cluster center set from each computing node. Each computing node stores business data of the same object with different feature dimensions, and each initial cluster center represents a business category. The business data includes at least one of text, video, and image. Based on the received initial cluster center sets, the cluster center groups corresponding to each computing node are obtained. Each cluster center group contains: the initial cluster center sets corresponding to other computing nodes besides the corresponding computing node. Each obtained cluster center group is sent to its corresponding computing node, so that each computing node can train and obtain the corresponding target cluster center set based on the corresponding cluster center group. Each computing node receives an encrypted target cluster center set returned by the computing node, and decrypts it using a target encryption algorithm to obtain the target cluster center set corresponding to each computing node. Based on the received target cluster center sets, each piece of data to be detected is detected to determine the business category corresponding to each piece of data to be detected.

9. A data processing apparatus, characterized in that, The device is deployed on any one of the computing nodes in the federated learning process. Each computing node stores business data of the same object with different feature dimensions. The business data includes at least one of text, video, and image. The processing unit is used to iteratively train the clustering model based on the sample business dataset, output the trained target clustering model, and use the initial cluster center set obtained in the last iteration as the target cluster center set; wherein, each iteration performs the following operations: The processing unit is also used to cluster the sample business data based on the clustering model to obtain the initial cluster center set corresponding to any one of the computing nodes, wherein each initial cluster center represents a business category. The transmission unit is used to send the initial cluster center set to the coordinating node and obtain the initial cluster center sets corresponding to other computing nodes returned by the coordinating node. The processing unit is also used to obtain the model loss based on the initial cluster center set corresponding to each computing node, and to adjust the model parameters based on the model loss when the model loss does not meet the preset loss range.

10. The apparatus as claimed in claim 9, characterized in that, The processing unit is also used for: Based on the initial cluster center set corresponding to each computing node, each reference cluster center is obtained; Based on the sample business data, a test sample set is obtained, and based on the reference cluster centers, the test samples contained in each cluster are determined, wherein each cluster corresponds to one reference cluster center. Based on the test samples contained in each cluster and their corresponding reference cluster centers, the sub-loss corresponding to each cluster is obtained, and the model loss is obtained based on the obtained sub-losses.

11. The apparatus as claimed in claim 10, characterized in that, The processing unit is also used for: For each of the aforementioned clusters, perform the following operations: Calculate the distance evaluation value between at least one test sample contained in a cluster and the reference cluster center corresponding to the cluster; The sum of the calculated distance evaluation values ​​is used as the sub-loss corresponding to the cluster.

12. A data processing apparatus, characterized in that, include: The transmission unit is used to receive the initial cluster center set sent by each computing node in the federated learning process. Each computing node stores business data of different feature dimensions of the same object, and each initial cluster center represents a business category. The business data includes at least one of text, video, and image. The splicing unit is used to obtain the cluster center group corresponding to each computing node based on the received initial cluster center sets. Each cluster center group contains: the initial cluster center set corresponding to other computing nodes besides the corresponding computing node. The transmission unit is also used to send each obtained cluster center group to the corresponding computing node, so that each computing node can train and obtain the corresponding target cluster center set based on the corresponding cluster center group. The transmission unit is also used to receive the encrypted target cluster center set returned by each computing node; The decryption unit is used to decrypt and obtain the target cluster center set corresponding to each computing node through the target encryption algorithm; The clustering unit is used to detect each piece of data to be detected based on the received target cluster center sets, and to determine the business category corresponding to each piece of data to be detected.

13. An electronic device, characterized in that, It includes a processor and a memory, wherein the memory stores a computer program that, when executed by the processor, causes the processor to perform the steps of any one of the methods of claims 1 to 7, or causes the processor to perform the steps of the method of claim 8.

14. A computer-readable storage medium, characterized in that, It includes a computer program that, when run on an electronic device, causes the electronic device to perform the steps of any of the methods of claims 1 to 7, or causes the electronic device to perform the steps of the method of claim 8.

15. A computer program product, characterized in that, It includes a computer program stored in a computer-readable storage medium, wherein a processor of an electronic device reads from and executes the computer program, causing the electronic device to perform the steps of any one of the methods of claims 1 to 7, or causing the electronic device to perform the steps of the method of claim 8.

Citation Information

Patent Citations

  • Federated data clustering method and device, computer equipment and storage medium

    CN112508203A

  • Federal learning method for k-means clustering algorithm

    CN113222181A