Test processing method and apparatus
By acquiring aggregated object features and anomaly features of graph embedding models in a federated learning platform and calculating the evaluation parameters of relationships between objects, the problem of accuracy and convenience of anomaly testing in federated learning is solved, and a balance between data privacy protection and data sharing is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-18
- Publication Date
- 2026-03-31
AI Technical Summary
In federated learning, how can we better train models to achieve a balance between data privacy protection and data sharing computation, while improving the accuracy and convenience of anomaly testing and avoiding the impact of anomalies on normal model training?
By acquiring the aggregated object features of the graph embedding model, combining them with the object and relationship features of the terminal where the anomaly occurs, anomaly prevention and control indicators are determined, and relationship evaluation parameters between objects are calculated, thereby improving the accuracy and effectiveness of anomaly prevention and control.
It improves the accuracy and comprehensiveness of the test metrics of the federated learning platform, enhances the convenience of anomaly testing, and does not affect the normal model training process.
Smart Images

Figure CN116384511B_ABST
Abstract
Description
Technical Field
[0001] This document relates to the field of data processing technology, and in particular to a test processing method and apparatus. Background Technology
[0002] With the rapid development of internet technology, a massive amount of data has been generated. Machine learning technology can automatically unearth the hidden treasures within this data. Machine learning models trained on large amounts of data have been applied in various scenarios and are profoundly changing our world, such as knowledge graph embedding models.
[0003] Federated learning is a distributed machine learning technique. Its core idea is to train models in a distributed manner across multiple data sources with local data. Without exchanging local individual or sample data, it constructs a global model based on virtual fused data by exchanging model parameters or intermediate results, thereby achieving a balance between data privacy protection and data sharing computation. In this process, how to better train models through federated learning has become a key focus of attention. Summary of the Invention
[0004] This specification provides one or more embodiments of a testing processing method applied to a federated learning platform. The method includes: acquiring aggregated object features during the model training process of a graph embedding model using federated learning; determining anomaly prevention indicators for a first test terminal based on the aggregated object features, object features of the anomaly-occurring terminal, and relation features; calculating relation evaluation parameters between objects in the object set of the second test terminal based on the object features of the second test terminal corresponding to the anomaly-occurring server; determining the relational state between the objects according to the relation evaluation parameters, and determining the anomaly prevention indicators for the second test terminal according to the relational state; and sending the anomaly prevention indicators of the first and second test terminals to a test evaluation platform to determine the test indicators of the federated learning platform.
[0005] This specification provides one or more embodiments of a test processing apparatus running on a federated learning platform. The apparatus includes: a feature acquisition module configured to acquire aggregated object features during model training of a graph embedding model using federated learning; a first metric determination module configured to determine an anomaly prevention metric for a first test terminal based on the aggregated object features, object features of the anomaly-occurring terminal, and relational features; a parameter calculation module configured to calculate relational evaluation parameters between objects in the object set of the second test terminal based on object features of the second test terminal corresponding to the anomaly-occurring server; a second metric calculation module configured to determine the relational state between the objects based on the relational evaluation parameters, and determine the anomaly prevention metric for the second test terminal based on the relational state; and a metric sending module configured to send the anomaly prevention metric of the first test terminal and the anomaly prevention metric of the second test terminal to a test evaluation platform to determine the test metrics of the federated learning platform.
[0006] This specification provides one or more embodiments of a test processing device, including: a processor; and a memory configured to store computer-executable instructions, which, when executed, cause the processor to: acquire aggregated object features during the model training process of a graph embedding model using federated learning; determine anomaly prevention indicators for a first test terminal based on the aggregated object features, object features of an anomaly-occurring terminal, and relational features; calculate relational evaluation parameters between objects in the object set of the second test terminal based on the object features of a second test terminal corresponding to an anomaly-occurring server; determine the relational state between the objects based on the relational evaluation parameters, and determine the anomaly prevention indicators for the second test terminal based on the relational state; and send the anomaly prevention indicators of the first and second test terminals to a test evaluation platform to determine the test indicators of the federated learning platform.
[0007] This specification provides one or more embodiments of a storage medium for storing computer-executable instructions, which, when executed by a processor, implement the following process: acquiring aggregated object features during the model training process of a graph embedding model using federated learning; determining anomaly prevention indicators for a first test terminal based on the aggregated object features, object features of the anomaly-occurring terminal, and relational features; calculating relational evaluation parameters between objects in the object set of the second test terminal based on the object features of the second test terminal corresponding to the anomaly-occurring server; determining the relational state between the objects based on the relational evaluation parameters, and determining the anomaly prevention indicators for the second test terminal based on the relational state; and sending the anomaly prevention indicators of the first and second test terminals to a test evaluation platform to determine the test indicators of the federated learning platform. Attached Figure Description
[0008] To more clearly illustrate the technical solutions in one or more embodiments of this specification or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this specification. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0009] Figure 1 A schematic diagram of the implementation environment for a test processing method provided in one or more embodiments of this specification;
[0010] Figure 2 A flowchart illustrating a test processing method provided in one or more embodiments of this specification;
[0011] Figure 3 A flowchart illustrating a test processing method for a knowledge graph embedding model scenario, provided in one or more embodiments of this specification.
[0012] Figure 4 A schematic diagram of an embodiment of a test processing apparatus provided in one or more embodiments of this specification;
[0013] Figure 5 This is a schematic diagram of the structure of a test processing device provided for one or more embodiments of this specification. Detailed Implementation
[0014] To enable those skilled in the art to better understand the technical solutions in one or more embodiments of this specification, the technical solutions in one or more embodiments of this specification will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this specification, and not all of the embodiments. Based on one or more embodiments of this specification, all other embodiments obtained by those skilled in the art without creative effort should fall within the protection scope of this document.
[0015] Reference Figure 1 This specification provides a schematic diagram of the implementation environment for one or more embodiments of the test processing method.
[0016] The testing methods provided in one or more embodiments of this specification are applicable to an implementation environment for testing the process of model training through federated learning. This implementation environment includes at least a federated learning platform 101, which may include one or more central servers, and may also include terminals of one or more institutions. Furthermore, the implementation environment may also include a server 102 for a testing and evaluation platform.
[0017] The central server in the Federated Learning Platform 101 can correspond to a single server, a server cluster consisting of several servers, or one or more cloud servers in a cloud computing platform.
[0018] The terminals in Federated Learning Platform 101 can be mobile phones, personal computers, tablets, e-book readers, VR (Virtual Reality) based devices for information interaction, in-vehicle terminals, IoT devices, wearable smart devices, laptops, and desktop computers, etc. The central server in Federated Learning Platform 101 can perform bidirectional data interaction with each terminal.
[0019] Server 102 can correspond to a single server, a server cluster consisting of several servers, or one or more cloud servers in a cloud computing platform.
[0020] In this implementation environment, after acquiring the aggregated object features during the model training process of the graph embedding model using federated learning, the federated learning platform 101, combined with the object features and relationship features of the terminal where the anomaly occurred, determines the anomaly prevention and control indicators of the first test terminal in the terminal testing dimension. Using the object features of the second test terminal, it calculates the relationship evaluation parameters between objects in the object set of the second test terminal. Based on the relationship evaluation parameters, it determines the anomaly prevention and control indicators of the second test terminal in the server testing dimension. Then, using the server 102 of the testing evaluation platform, it determines the terminal testing indicators of the federated learning platform based on the anomaly prevention and control indicators of the first and second test terminals. Thus, by determining the testing indicators of the federated learning platform from both the terminal testing and server testing dimensions, the accuracy, effectiveness, and comprehensiveness of the testing indicators are improved. Simultaneously, by performing anomaly testing during the model training process of the graph embedding model, the convenience of anomaly testing is improved, without affecting the normal model training process.
[0021] One or more embodiments of a test processing method provided in this specification are as follows:
[0022] Reference Figure 2 The test processing method provided in this embodiment specifically includes steps S202 to S210.
[0023] Step S202: Obtain the aggregated object features during the model training process of the graph embedding model through federated learning.
[0024] This embodiment of the graph embedding model includes an embedding model that maps information in the graph to a low-dimensional space, generating low-dimensional vectors that retain key information from the initial image; the graph embedding model can be a knowledge graph embedding model. The knowledge graph embedding model FKGE (Federated Knowledge Graphs Embedding) is a model that uses supervised learning to learn embeddings and vector representations of nodes and edges. They project "knowledge" into a continuous low-dimensional space, where vectors can have few dimensions, such as a few hundred dimensions (used to represent the memory efficiency of knowledge storage); the knowledge graph embedding model in this embodiment is obtained through model training using a federated learning framework; this embodiment can be applied to federated learning platforms or federated learning systems.
[0025] The aggregated object features include aggregated entity features; the aggregated object features may be aggregated entity embedding matrices; the aggregated object features can be obtained during the training of the graph embedding model through federated learning, specifically during any model iteration training process, for example, the aggregated object features are represented by Eb. In this embodiment, the aggregated object features may include a first aggregated object feature, or a second aggregated object feature.
[0026] In one optional implementation of this embodiment, the graph embedding model is trained in the following manner:
[0027] Each terminal in the federated learning process inputs the tuple and the target tuple into the model to be trained to calculate scores, thereby obtaining a first score for the tuple and a second score for the target tuple.
[0028] Each terminal calculates the training loss based on the first score and the second score, updates the entity embedding matrix and relation embedding matrix of the model to be trained based on the training loss, and uploads the updated entity embedding matrix to the federated learning server.
[0029] The server performs aggregation processing on the updated entity embedding matrix of each terminal and sends the aggregated entity features obtained from the aggregation processing to each terminal.
[0030] Optionally, the tuple is randomly collected from the tuple set of each terminal; the target tuple is obtained by collecting entities from the entity set of each terminal and replacing the target entity in the tuple with the collected entities. The tuple can be a triple, and the target entity can be the tail entity in the triple. Here, the aggregated entity feature represents the aggregated entity feature in any iteration of the training process of the graph embedding model, and the aggregated object feature in step S202 can be the aggregated entity feature in any iteration of the training process.
[0031] The entity embedding matrix and relation embedding matrix of the model to be trained can be the initial entity embedding matrix and initial relation embedding matrix in the first iteration of training, or the entity embedding matrix and relation embedding matrix in any subsequent iteration of training. Optionally, the initial entity embedding matrix is obtained as follows: each terminal of the federated learning platform sends its own entity set to the server of the federated learning platform. The server performs initialization processing based on the number of entities in the entity set of each terminal, the model type of the model to be trained, and / or the vector dimension of the entity embedding, to obtain the initial entity embedding matrix of each terminal. In addition, during the initialization process performed by the server based on the number of entities in the entity set of each terminal, the model type of the model to be trained, and the vector dimension of the entity embedding, the server can also perform deduplication processing on the entity set of each terminal, determine the number of entities in the entity set of each terminal obtained after deduplication, and perform initialization processing based on the number of entities, the model type of the model to be trained, and / or the vector dimension of the entity embedding, to obtain the initial entity embedding matrix of each terminal.
[0032] Optionally, the initial relation embedding matrix is obtained by the following method: each terminal performs initialization processing based on the number of relations in its respective relation set, the model type of the model to be trained, and / or the vector dimension of the relation embedding to obtain the initial relation embedding matrix of each terminal.
[0033] It should be added that the initial entity embedding matrix of each terminal can also be obtained by initialization on each terminal. Specifically, each terminal can perform initialization processing according to the number of entities in its own entity set, the model type of the model to be trained, and / or the vector dimension of the entity embedding to obtain the initial entity embedding matrix of each terminal; in the above initialization process, it can also be processed by the model to be trained.
[0034] Specifically, during the training of the graph embedding model, the following operations can be performed: Each terminal in the federated learning randomly collects a first number of triples from its triple set and a second number of entities from its entity set, randomly replacing the tail entity of each triple with an entity from the entity set; Each terminal inputs the triples and the replacement target triples into the model to be trained for score calculation, obtaining a first score for each triple and a second score for each target triple; Each terminal calculates the training loss based on the first score of each triple, the second score of each target triple, the score influence factor, and / or the second number, and updates the entity embedding matrix and / or relation embedding matrix of the model to be trained based on the training loss, uploading the updated entity embedding matrix to the federated learning server; The server performs aggregation or alignment processing on the updated entity embedding matrices of each terminal to obtain aggregated entity features, and sends the aggregated entity features to each terminal. It should be noted that the relationship between the first quantity and the second quantity is not specifically limited. That is, the first quantity can be greater than the second quantity, the first quantity can be less than the second quantity, and the first quantity can also be equal to the second quantity, but the second quantity ≤ 2 * the first quantity (twice the first quantity).
[0035] In the process of aggregating or aligning the updated entity embedding matrices of each terminal, the aggregating or aligning process can be performed based on the entity sets of each terminal. Specifically, the aggregating or aligning process can be implemented as follows: Calculate the intersection entities of each terminal based on their entity sets; determine the entity embedding vectors of the intersection entities in the updated entity embedding matrices of each terminal based on the calculated intersection entities; and calculate the aggregated entity features based on the entity embedding vectors of the intersection entities. Here, the process of calculating the aggregated entity features based on the entity embedding vectors of the intersection entities can be achieved by calculating the vector parameters of the entity embedding vectors of the intersection entities in the updated entity embedding matrices of each terminal, and generating the aggregated entity features based on the vector parameters and the updated entity embedding matrices of each terminal. The vector parameters here can be the average value of the entity embedding vectors of the intersection entities. The process of sending the aggregated entity features to each terminal can be achieved by broadcasting the aggregated entity features to each terminal.
[0036] Furthermore, the process of randomly collecting a second number of entities from the entity set of each terminal and randomly replacing the tail entity of each triplet with each entity in the plurality of entities can be replaced by: for each triplet in the plurality of triplets, randomly collecting entities from the entity set of each terminal and replacing the tail entity in each triplet with the collected entity, and combining this with other processing steps provided in this embodiment to form a new implementation method.
[0037] For example, in federated learning, each terminal randomly selects B triples from its set of triples and N triples from its set of entities. neg For each entity, randomly replace the tail entity of each of the B triplet pairs with the N entities. neg For each entity in N, that is, for each triple (h, r, t), from N neg Randomly select an entity from the given entities, and replace the tail entity t in the triple (h, r, t) with the selected entity to obtain the target triple (h, r, t′). It should be noted that in the triple, h represents the head entity, t represents the tail entity, and r represents the relationship between the head entity and the tail entity.
[0038] Referring to the model training process of the graph embedding model described above, repeat the above training process on the federated learning platform to train the model until the loss function converges. Once the loss function converges, the training is complete, and the graph embedding model is obtained.
[0039] For example, in the process of training the model to obtain a graph embedding model, the loss function is constructed as follows:
[0040]
[0041] in, f represents the training loss. r (·) represents the score function of the model to be trained, f r (h, t) represents the first score of each triplet, γ represents the score influence factor, which can be a hyperparameter marginal factor used to balance different scoring functions. The score influence factor for each terminal can be the same or different; f r (h, t′) represents the second score of each target triplet, N neg This represents the second quantity, which is the number of entities randomly collected from the entity set of each terminal.
[0042] Furthermore, during the process of aggregating or aligning the updated entity embedding matrices of each terminal, the following operations can also be performed: calculate the intersection entities based on the entity sets of each terminal, and determine the entity embedding vectors of the intersection entities in the updated entity embedding matrices of each terminal based on the calculated intersection entities, and calculate the aggregated entity features based on the entity embedding vectors of the intersection entities; the implementation of calculating the aggregated entity features based on the entity embedding vectors of the intersection entities is similar to that described above, and can be referred to accordingly. It should be added that the intersection entities here can be the intersection entities of two or more terminals, that is, the intersection entities can be the intersection entities of two or more terminals.
[0043] It should be noted that all entities mentioned above in the process of training the model to obtain the graph embedding model can be replaced with objects. For example, the entity embedding matrix can be replaced with the object embedding matrix, and the aggregated entity features can be replaced with the aggregated object features; that is, all entities mentioned above can be replaced with objects.
[0044] In this context, each terminal in federated learning refers to each terminal that trains the model through federated learning. Specifically, each terminal in federated learning can be an institution. It should be noted that the attributes of the institutions corresponding to each terminal in federated learning are not specifically limited. For example, the attributes of an institution can be a financial institution, a catering institution, or other institutions. The attributes of the institutions corresponding to each terminal can be the same or different.
[0045] It should be added that step S202 can be replaced by the exception-causing terminal acquiring the aggregated object features during the model training process of the graph embedding model through federated learning, and forming a new implementation method with other processing steps provided in this embodiment. The exception-causing terminal here includes a terminal in the federated learning platform.
[0046] Step S204: Based on the aggregated object characteristics, the object characteristics and relationship characteristics of the abnormal terminal, determine the abnormal prevention and control indicators of the first test terminal.
[0047] In the process of obtaining aggregated object features during the model training of graph embedding models through federated learning, the above-mentioned aggregated object features and the object and relation features of the abnormal terminal are used to determine the abnormal prevention and control indicators of the first test terminal. Specifically, the abnormal terminal can determine the abnormal prevention and control indicators of the first test terminal based on the aggregated object features and the object and relation features of the abnormal terminal.
[0048] The anomaly-generating terminal described in this embodiment includes terminals that generate anomalies within the federated learning platform. Specifically, the anomaly-generating terminal can be an attack terminal, i.e., a terminal acting as an attacker during the model training process of the graph embedding model using federated learning. Optionally, the anomaly-generating terminal is randomly determined from among the terminals in the federated learning platform. The object features of the anomaly-generating terminal include the entity features of the anomaly-generating terminal. Here, the object features can be an object embedding matrix (e.g., an entity embedding matrix), specifically, it can be the updated entity embedding matrix of the anomaly-generating terminal during the model training process of the graph embedding model. The updated entity embedding matrix includes the updated entity embedding matrix of the anomaly-generating terminal during any model iteration training process. The updated object embedding matrix of the anomaly-generating terminal can be represented by E. a This indicates that the object characteristics of the terminal where the exception occurred can be represented by E. a express.
[0049] The relational features of the anomaly-occurring terminals include the relational embedding matrix of the anomaly-occurring terminals. Here, the relational features can be the updated relational embedding matrix of the anomaly-occurring terminals during the model training process of the graph embedding model described above. The updated relational embedding matrix of the anomaly-occurring terminals can be represented by R... a This indicates that the relational characteristics of the terminals where the anomaly occurred can be represented using R. a express.
[0050] The first test terminal refers to the target terminal of the terminal where the anomaly occurred, specifically the target terminal attacked by the attacking terminal; the anomaly prevention and control indicators include indicators for the first test terminal to prevent and control the anomaly from occurring, such as the anomaly from maliciously stealing the training sample data of the graph embedding model of the first test terminal. The anomaly prevention and control indicators represent the indicators for the first test terminal to prevent and control the anomaly from maliciously stealing the training sample data of the anomaly from occurring terminal.
[0051] Optionally, the anomaly-causing terminal and / or the first test terminal may be randomly selected from the terminals of the federated learning platform; alternatively, after randomly selecting a terminal from the terminals of the federated learning platform as the anomaly-causing terminal, a terminal may be randomly selected from the remaining terminals as the first test terminal; or, after randomly selecting a terminal from the terminals of the federated learning platform as the first test terminal, a terminal may be randomly selected from the remaining terminals as the anomaly-causing terminal.
[0052] In specific implementation, to improve the accuracy and effectiveness of the anomaly prevention and control indicators of the first test terminal, in an optional implementation method provided in this embodiment, the following operations are performed during the process of determining the anomaly prevention and control indicators of the first test terminal in the terminal testing dimension based on the aggregated object characteristics, the object characteristics and relationship characteristics of the anomaly-occurring terminal:
[0053] Based on the aggregated object characteristics and the object characteristics of the abnormal occurrence terminal, calculate the intersection of the object set of the abnormal occurrence terminal and the object set of the first test terminal, and select an object group from the intersection object;
[0054] The object relationships are read from the relationship set of the terminal where the anomaly occurred based on the object group, and the anomaly prevention and control index is calculated based on the relationship characteristics and the tuple constructed based on the object group and the object relationships.
[0055] The intersection objects include objects that overlap between the object set of the anomaly-occurring terminal and the object set of the first test terminal. The object group includes two or more objects selected from the intersection objects; for example, the intersection objects are intersection entities, and entity groups h and t are selected from the intersection entities. The object relationship includes the relationship between two or more objects; for example, object 1 is x1jiang, and object 2 is x2jiang. Since both belong to jiang, the relationship between object 1 and object 2 is a synonym relationship. The tuple constructed based on the object group and the object relationship includes a tuple composed of object combinations and object relationships, which can be a triple. For example, if the entity group selected from the intersection entities is h and t, and the object relationship corresponding to the entity group is read from the relationship set of the anomaly-occurring terminal is r, then the constructed triple is (h, r, t). The object set of the anomaly-occurring terminal refers to a set of one or more objects of the anomaly-occurring terminal; the relationship set of the anomaly-occurring terminal refers to a relationship set composed of one or more object relationships of the anomaly-occurring terminal.
[0056] Specifically, based on the aggregated object embedding matrix, the differential embedding vector in the object embedding matrix of the anomaly-occurring terminal is determined. The entity corresponding to the differential embedding vector is taken as the intersection object of the object set of the anomaly-occurring terminal and the object set of the first test terminal. An object group is selected from the intersection object. According to the selected object group, the object relationship corresponding to the object group is read from the relationship set of the anomaly-occurring terminal. Based on the aggregated object embedding matrix, the relationship embedding matrix of the anomaly-occurring terminal, and / or the triples constructed based on the object group and object relationship, the anomaly prevention and control index of the first test terminal under the terminal testing dimension is calculated. In this way, the intersection object of the anomaly-occurring terminal and the first test terminal is determined by the differential embedding vector, which improves the convenience of determining the intersection object and improves the accuracy of the anomaly prevention and control index.
[0057] In the process of calculating the anomaly prevention and control index based on the relation features and the tuple constructed based on the object group and the object relationship, in order to improve the calculation efficiency and convenience of the anomaly prevention and control index, the first test score of the tuple can be calculated to determine the anomaly prevention and control index; in an optional implementation of this embodiment, the following operations are performed: read the object embedding vector group corresponding to the object group in the tuple from the aggregated object features, and read the relation embedding vector corresponding to the object relationship in the tuple from the relation features;
[0058] The object embedding vector group and the relation embedding vector are input into the model to be trained for score calculation to obtain the first test score of the tuple group, and the anomaly prevention and control index is determined based on the first test score.
[0059] The object embedding vector group refers to the combination of object embedding vectors of each object in the object group. For example, if the object groups are h and t, the aggregated object embedding matrix E... b1 Read the object embedding vectors h1 and t1 corresponding to object groups h and t, construct object embedding vector groups h1 and t1, and extract them from the relation embedding matrix R of the terminal where the exception occurred. a Read the relation embedding vector r1 corresponding to the object relation r in the triple (h, r, t).
[0060] Specifically, in the process of determining the anomaly prevention and control indicator based on the first test score, the following operations can be performed: if the first test score is greater than a preset score threshold, the anomaly prevention and control indicator of the first test terminal is determined to be a prevention and control failure; if the first test score is less than or equal to the preset score threshold, the anomaly prevention and control indicator of the first test terminal is determined to be a prevention and control success.
[0061] In the process of calculating the anomaly prevention and control index based on the relationship features and the tuple constructed based on the relationship between the object group and the object, in order to improve the accuracy and effectiveness of the anomaly prevention and control index, a first test score and a second test score of the tuple can be calculated, and the anomaly prevention and control index can be determined based on the first test score and the second test score; in another optional implementation provided in this embodiment, the following operation is performed:
[0062] Calculate the first test score of the tuple based on the tuple, the first aggregate object feature, and the relation feature;
[0063] Based on the tuple, a second object embedding vector group is determined from the second aggregated object features, and a second relation embedding vector is determined from the relation features;
[0064] The second test score of the tuple is calculated based on the second object embedding vector group and the second relation embedding vector, and the anomaly prevention and control index is determined based on the first test score and the second test score.
[0065] Specifically, in the process of calculating the first test score of the tuple based on the tuple, the first aggregated object features, and the relation features, the following operations can be performed: read the object embedding vector group corresponding to the object group in the tuple from the first aggregated object features, and read the relation embedding vector corresponding to the object relation in the tuple from the relation features; input the object embedding vector group and the relation embedding vector into the model to be trained to calculate the score and obtain the first test score of the tuple.
[0066] The process of determining the second object embedding vector from the second aggregated object features based on the tuple, and determining the second relation embedding vector from the relation set, can be implemented as follows: read the second object embedding vector group corresponding to the object group in the tuple from the second aggregated object features, and read the second relation embedding vector corresponding to the object relation in the tuple from the relation features of the terminal where the anomaly occurred; input the second object embedding vector and the second relation embedding vector into the model to be trained for score calculation to obtain the second test score of the tuple; determine the anomaly prevention and control index of the first test terminal based on the first test score and the second test score.
[0067] It should be noted that the determination process of the first test score and the second test score is similar and can be referred to each other. The calculation time interval between the first test score and the second test score is less than the preset interval threshold. The calculation time interval between the first test score and the second test score can be as small as possible. That is, the time interval between obtaining the first aggregate object feature and calculating the first test score and obtaining the second aggregate object feature and calculating the second test score is less than the preset interval threshold. The preset interval threshold can be as small as possible.
[0068] In one optional implementation of this embodiment, to further improve the accuracy of the anomaly prevention and control indicators, the following operation is performed during the process of determining the anomaly prevention and control indicators based on the first test score and the second test chamber score:
[0069] Calculate the score ratio based on the first test score and the second test score, and determine whether the score ratio is greater than the preset ratio threshold of the terminal where the anomaly occurred;
[0070] If not, the abnormal control indicator is determined to be a successful control measure; if yes, the abnormal control indicator is determined to be a failed control measure.
[0071] Specifically, the ratio of the first test score to the second test score is calculated, and it is determined whether the ratio is greater than the preset ratio threshold of the terminal where the anomaly occurred. If yes, it means that the tuple is included in the tuple set of the first test terminal, that is, it means that the tuple set (training sample) of the first test terminal has been attacked or leaked, and the anomaly prevention and control indicator is determined to be a failure. If no, it means that the tuple is not included in the tuple set of the first test terminal, and the anomaly prevention and control indicator is determined to be a success.
[0072] The process of determining the anomaly prevention and control indicators of the first test terminal in the terminal testing dimension described above can remain within the normal federated learning protocol. That is, although anomaly testing is being conducted, federated learning training is still ongoing, which can be considered a "passive attack." However, in practical applications, in order to enhance the anomaly testing effect, i.e., to enhance the attack strength or effect, an "active attack" can be introduced. This is achieved by inverting the tuples mentioned above to enhance the attack strength, thereby determining the anomaly prevention and control indicators. In another optional implementation provided in this embodiment, in the process of determining the anomaly prevention and control indicators of the first test terminal in the terminal testing dimension based on the aggregated object features, the object features of the anomaly-occurring terminal, and the relational features, the following operation is performed: a tuple is constructed based on the object features of the anomaly-occurring terminal, the relational features, and the aggregated object features.
[0073] Read the object embedding vector group corresponding to the object group in the tuple from the aggregated object features, and read the relation embedding vector corresponding to the object relation in the tuple from the relation features;
[0074] The specific embedding vector in the object embedding vector group is reversed, and the anomaly prevention and control index is calculated based on the relation embedding vector and the embedding vector group obtained by the reversal process.
[0075] The inversion process includes performing specific operations on a specific embedding vector, such as multiplying the specific embedding vector by (-1), that is, changing a positive specific embedding vector to a negative one, and a negative specific embedding vector to a positive one. The specific embedding vector may be the embedding vector corresponding to the tail entity t.
[0076] Specifically, based on the aggregated object features and the object features of the anomaly-occurring terminal, the intersection of the object set of the anomaly-occurring terminal and the object set of the first test terminal is calculated, and an object group is selected from the intersection object; the object relationship is read from the relationship set of the anomaly-occurring terminal according to the object group, a tuple is constructed based on the object group and the object relationship, the object embedding vector group corresponding to the object group in the tuple is read from the aggregated object features, and the relationship embedding vector corresponding to the object relationship in the tuple is read from the relationship features; a specific embedding vector in the object embedding vector group is reversed, and a test score is calculated based on the relationship embedding vector and the embedding vector group obtained by the reversed processing, and the anomaly prevention and control index of the first test terminal is determined based on the test score; the process of calculating the test score and determining the anomaly prevention and control index based on the test score is similar to the above, and will not be repeated here in this embodiment.
[0077] Furthermore, the process of determining the anomaly prevention and control index of the first test terminal under the terminal testing dimension based on the aggregated object features, the object features of the anomaly-occurring terminal, and the relation features can also be implemented in the following way: A tuple is constructed based on the object features of the anomaly-occurring terminal, the relation features of the anomaly-occurring terminal, and the first aggregated object features; object embedding vector groups corresponding to object groups in the tuple are read from the first aggregated object features, and relation embedding vectors corresponding to object relations in the tuple are read from the relation features of the anomaly-occurring terminal; specific embedding vectors in the object embedding vector groups are reversed, and a first test score is calculated based on the relation embedding vectors and the embedding vector groups obtained after the reversal; a second object embedding vector group is determined from the second aggregated object features based on the tuple, and a second relation embedding vector is determined from the relation features; a second test score is calculated based on the second object embedding vectors and the second relation embedding vectors; the anomaly prevention and control index is determined based on the first test score and the second test score. The process of calculating the second test score and determining the anomaly prevention and control index based on the first test score and the second test score is similar to the above process, and will not be described again in this embodiment.
[0078] It should be noted that step S204 can be executed through the anomaly-generating terminal. That is, step S204 can be replaced by the anomaly-generating terminal determining the anomaly prevention and control indicators of the first test terminal based on the aggregated object characteristics, the object characteristics and relationship characteristics of the anomaly-generating terminal, and forming a new implementation method with other processing steps provided in this embodiment. Correspondingly, each optional implementation method in this embodiment can also be executed on the anomaly-generating terminal.
[0079] In addition, step S204 can also be replaced by determining the anomaly prevention and control indicators of the first test terminal under the terminal testing dimension based on the aggregated object characteristics, the object characteristics and relationship characteristics of the anomaly-occurring terminal, and forming a new implementation method with other processing steps provided in this embodiment; wherein, the terminal testing dimension includes the dimension of the terminal as the anomaly-occurring party, that is, selecting a terminal as the attacker for testing among the terminals of the federated learning platform.
[0080] Step S206: Based on the object characteristics of the second test terminal corresponding to the anomaly occurrence server, calculate the relationship evaluation parameters between objects in the object set of the second test terminal.
[0081] Based on the aggregated object characteristics, the object characteristics and relationship characteristics of the anomaly-occurring terminal, the anomaly prevention and control indicators of the first test terminal are determined. In this step, the relationship evaluation parameters between objects in the object set of the second test terminal are calculated by using the object characteristics of the second test terminal corresponding to the anomaly-occurring server.
[0082] The anomaly generation server described in this embodiment includes servers in the federated learning platform that generate anomalies. Specifically, the anomaly generation server can be an attack server, that is, a server that acts as an attacker during the model training process of the graph embedding model through federated learning. Optionally, the federated learning platform may contain one server (central server), in which case the anomaly generation server is a server in the federated learning platform. Alternatively, the federated learning platform may contain multiple servers, in which case the anomaly generation server is randomly determined from among the servers in the federated learning platform.
[0083] The second test terminal refers to the target terminal of the server that caused the anomaly. Specifically, it can be the target terminal of the attacking server. For example, if the server that caused the anomaly maliciously steals the training sample data of the graph embedding model of the second test terminal, the second test terminal is the target terminal of the server that caused the anomaly to maliciously steal data.
[0084] The object features of the second test terminal include the entity features of the second test terminal. These object features can be object embedding matrices (e.g., entity embedding matrices). Specifically, they can be the updated entity embedding matrices of the second test terminal in each terminal of the federated learning platform during the model training process of the graph embedding model described above. The updated entity embedding matrix includes the updated entity embedding matrix of the second test terminal during any model iteration training process. The updated object embedding matrix of the second test terminal can be used with E... v This indicates that the object characteristics of the second test terminal can be represented by E. v express.
[0085] The object set of the second test terminal refers to a set of one or more objects of the second test terminal; the relationship evaluation parameters include evaluation parameters calculated or determined by the user to determine the connection relationship between each object, which may specifically be the difference in the object embedding vectors corresponding to each object.
[0086] In one optional implementation of this embodiment, during the process of calculating the relationship evaluation parameters between objects in the object set of the second test terminal based on the object characteristics of the second test terminal corresponding to the anomaly occurrence server, the following operations are performed:
[0087] Based on the object identifiers of every two objects in the object set of the second test terminal, the object embedding vector of every two objects is determined in the object features of the second test terminal;
[0088] Based on the object embedding vectors of each pair of objects, calculate the embedding vector parameters of each pair of objects.
[0089] The embedding vector parameters include parameters that characterize the vector relationship between the object embedding vectors of each of the two objects, such as the embedding vector difference between the object embedding vectors of each object.
[0090] Specifically, based on the object identifier of each object in every two objects, the object embedding vector of each object is determined in the object embedding matrix of the second test terminal, and the object embedding vector of each object is used to calculate the embedding vector difference between each two objects.
[0091] It should be added that step S206 can be replaced by the exception server calculating the relationship evaluation parameters between objects in the object set of the second test terminal based on the object characteristics of the second test terminal corresponding to the exception server, and forming a new implementation method with other processing steps provided in this embodiment.
[0092] Step S208: Determine the relationship status between the objects based on the relationship evaluation parameters, and determine the anomaly prevention and control indicators of the second test terminal based on the relationship status.
[0093] The above-mentioned method uses the object characteristics of the second test terminal corresponding to the server where the anomaly occurred to calculate the relationship evaluation parameters between each object in the object set of the second test terminal. In this step, in order to improve the comprehensiveness of the test indicators of the federated learning platform, the relationship status between each object can be determined according to the relationship evaluation parameters, and the anomaly prevention and control indicators of the second test terminal can be determined according to the relationship status.
[0094] The relational states described in this embodiment include the connection states between objects in the object set of the second test terminal, that is, the connection states of each object in the knowledge graph of the second test terminal; the relational states can be the connection states between any two objects. The anomaly prevention and control indicators of the second test terminal include indicators for preventing attacks by the second test terminal against servers where anomalies occur, such as the server maliciously stealing training sample data from the graph embedding model of the second test terminal. These anomaly prevention and control indicators represent the indicators for preventing the second test terminal from maliciously stealing training sample data by the server where anomalies occur.
[0095] In practical implementation, to improve the efficiency of determining the relationship status between objects, a dataset can be introduced. This dataset can be a publicly available free dataset or a dataset obtained through purchase. The introduced dataset is used to first determine whether there are connections between the objects. In an optional implementation provided in this embodiment, the following operations are performed during the process of determining the relationship status between the objects based on the relationship evaluation parameters:
[0096] The number of relationships of the second test terminal is determined based on the dataset, and the embedding vector parameters between the objects are clustered based on the number of relationships to obtain multiple clusters;
[0097] Determine the target location of each of the multiple clusters, and calculate the position distance between the position of the embedding vector parameter contained in each cluster and the target location;
[0098] Select vector parameters whose positional distance is less than a preset distance threshold from the embedding vector parameters between the objects, and determine the relationship state between the two objects corresponding to the selected vector parameters as a connection state.
[0099] The number of relationships in the second test terminal includes the number of relationships in the relationship set of the second terminal. The embedding vector parameters between each object include vector differences; each vector difference represents the vector difference between the object embedding vectors of every two objects. The target location includes the center location of each type of cluster.
[0100] For example, the embedding vector parameter between objects is R. S Based on the number of relationships, R S The embedding vectors in R are clustered to obtain a target number of clusters; the target number is determined based on the number of relations; for example, if the number of relations is m, then for R... S The embedded vectors in the data are clustered to obtain 2m clusters.
[0101] In the specific execution process, when there are connections between objects, in order to improve the accuracy of anomaly prevention and control indicators, the dataset can be used to find the real relationships between connected objects. In an optional implementation method provided in this embodiment, the following operations are performed in the process of determining the anomaly prevention and control indicators of the second test terminal based on the relationship status:
[0102] If the relationship between two objects is a connection, query the object relationship between the two objects in the dataset based on the object identifiers of the two objects;
[0103] Determine the anomaly prevention and control indicators of the second test terminal based on the query results;
[0104] If the relationship between two objects is not connected, no action needs to be taken.
[0105] In addition, based on the above-mentioned determination that the relationship between the two objects corresponding to the selected vector parameters is a connection state, the object relationship between the two objects can be queried in the dataset based on the object identifiers of the two objects; and the anomaly prevention and control indicators of the second test terminal can be determined according to the query results.
[0106] In the process of querying the object relationship between the two objects in the dataset based on their object identifiers, this embodiment provides an optional implementation method in which the following operation is performed:
[0107] Based on the object identifier, detect whether each of the two objects is contained in each of the two target objects in the dataset;
[0108] If yes, the object relationship between the two target objects is taken as the object relationship between the two objects; otherwise, no processing is required.
[0109] For example, in the dataset there exist (ε1, r) aux If h∈ε1 and t∈ε2 among the two objects, then r aux Let h and t be the object relationship between two objects.
[0110] In the process of determining the anomaly prevention and control indicators of the second test terminal based on the query results, in one optional implementation of this embodiment, the following operation is performed:
[0111] Construct a target tuple based on the two objects and the object relationship obtained from the query;
[0112] If the target tuple is included in the tuple set of the second test terminal, the abnormal prevention and control indicator of the second test terminal is determined to be a prevention and control failure.
[0113] If the target tuple is not included in the tuple set of the second test terminal, the anomaly prevention and control indicator of the second test terminal is determined to be successful.
[0114] It should be added that step S208 can be replaced by the exception server determining the relationship status between the objects according to the relationship evaluation parameters, and determining the exception prevention and control indicators of the second test terminal according to the relationship status, and forming a new implementation method with other processing steps provided in this embodiment;
[0115] Alternatively, step S208 can be replaced by determining the relationship status between the objects based on the relationship evaluation parameters, and determining the anomaly prevention and control indicators of the second test terminal under the server test dimension based on the relationship status, and forming a new implementation method with other processing steps provided in this embodiment; the server test dimension here refers to the dimension of testing the server as an attacker.
[0116] Step S210: Send the anomaly prevention and control indicators of the first test terminal and the anomaly prevention and control indicators of the second test terminal to the test evaluation platform to determine the test indicators of the federated learning platform.
[0117] The relationship status between the objects is determined based on the relationship evaluation parameters, and the anomaly prevention and control indicators of the second test terminal are determined based on the relationship status. In this step, the anomaly prevention and control indicators of the first test terminal and the anomaly prevention and control indicators of the second test terminal are sent to the test evaluation platform to determine the test indicators of the federated learning platform.
[0118] The testing and evaluation platform described in this embodiment refers to a platform for determining the testing metrics of the federated learning platform. These testing metrics include indicators characterizing the degree of privacy protection of the federated learning platform, representing its privacy protection performance, i.e., data security indicators. The testing metrics can also be terminal testing metrics of the federated learning platform, i.e., the privacy protection performance of the terminal.
[0119] In practice, when determining the test metrics for the federated learning platform, the evaluation metrics for the first test terminal can be calculated based on the anomaly prevention and control metrics for the first test terminal, and the evaluation metrics for the second test terminal can be calculated based on the anomaly prevention and control metrics for the second test terminal. The test metrics for the federated learning platform are then determined based on the evaluation metrics of the first and / or second test terminals. These evaluation metrics may include test accuracy, recall, etc.
[0120] In addition, the testing and evaluation platform can also determine the target model parameters based on the evaluation indicators under different model parameters.
[0121] It should be added that step S210 can be replaced by sending the anomaly prevention and control indicators of the first test terminal, the anomaly prevention and control indicators of the second test terminal, and / or the model training results of the graph embedding model to the test evaluation platform to determine the test indicators of the federated learning platform, and forming a new implementation method with other processing steps provided in this embodiment.
[0122] In a specific implementation, after sending the anomaly prevention and control indicators of the first test terminal and the second test terminal to the test evaluation platform for execution, in an optional implementation of this embodiment, the following operation is also performed: performing recommendation processing of the federated learning platform based on the test indicators.
[0123] It should be added that there is no specific limitation on the execution order of steps S204 and steps S206 to S208. Step S204 can be executed first, followed by steps S206 to S208; steps S206 to S208 can be executed first, followed by step S204; or steps S204 can be executed simultaneously with steps S206 to S208.
[0124] The following example illustrates the application of a testing method provided in this embodiment to a knowledge graph embedding model scenario. (See also...) Figure 3 The testing and processing method applied to knowledge graph embedding model scenarios includes the following steps.
[0125] Step S302: Obtain the aggregated entity embedding matrix during the model training process of the knowledge graph embedding model through federated learning.
[0126] It should be noted that the aggregated entity embedding matrix may include a first aggregated entity embedding matrix and / or a second aggregated entity embedding matrix.
[0127] Step S304: Based on the first aggregated entity embedding matrix and the entity embedding matrix of the anomaly occurrence terminal, calculate the intersection entities of the object set of the anomaly occurrence terminal and the object set of the first test terminal, and select entity pairs from the intersection entities.
[0128] Step S306: Read the entity relationship in the relationship set of the abnormal terminal according to the entity pair, read the entity embedding vector pair corresponding to the entity pair in the triplet from the first aggregated entity embedding matrix, and read the relationship embedding vector corresponding to the entity relationship in the triplet from the relationship embedding matrix of the abnormal terminal.
[0129] Step S308: Input the entity embedding vector pairs and relation embedding vectors into the model to be trained to calculate the score and obtain the first test score.
[0130] Step S310: Calculate the second test score based on the second aggregated entity embedding matrix, the entity embedding matrix of the anomaly occurrence terminal, and the relationship embedding matrix of the anomaly occurrence terminal.
[0131] Step S312: Calculate the score ratio based on the first test score and the second test score. If the score ratio is less than the preset ratio threshold of the terminal where the anomaly occurred, determine that the anomaly prevention and control indicator of the first test terminal is successful.
[0132] Step S314: Based on the entity identifiers of every two entities in the entity set of the second test terminal, determine the entity embedding vector of every two entities in the entity embedding matrix of the second test terminal.
[0133] Step S316: Based on the entity embedding vectors of each pair of entities, calculate the difference between the embedding vectors of each pair of entities, and determine the relationship state of each pair of entities based on the difference between the embedding vectors of each pair of entities.
[0134] Step S318: If the relationship between the two entities is in a connected state, query the entity relationship between the two entities in the dataset based on the entity identifiers of the two entities, and determine the anomaly prevention and control indicators of the second test terminal based on the query results.
[0135] Step S320: Send the anomaly prevention and control indicators of the first test terminal and the second test terminal to the test evaluation platform to determine the test indicators of the federated learning platform.
[0136] An embodiment of a test processing device provided in this specification is as follows:
[0137] In the above embodiments, a test processing method is provided, and correspondingly, a test processing device is also provided, which will be described below with reference to the accompanying drawings.
[0138] Reference Figure 4 The diagram shows a schematic representation of a test processing apparatus embodiment provided in this embodiment.
[0139] Since the apparatus embodiments correspond to the method embodiments, the descriptions are relatively simple. For relevant parts, please refer to the corresponding descriptions of the method embodiments provided above. The apparatus embodiments described below are merely illustrative.
[0140] This embodiment provides a test processing device running on a federated learning platform, the device comprising:
[0141] The feature acquisition module 402 is configured to acquire features of aggregated objects during the model training process of graph embedding models through federated learning;
[0142] The first indicator determination module 404 is configured to determine the anomaly prevention and control indicators of the first test terminal based on the aggregated object characteristics, the object characteristics and relationship characteristics of the anomaly occurrence terminal.
[0143] The parameter calculation module 406 is configured to calculate the relationship evaluation parameters between objects in the object set of the second test terminal based on the object characteristics of the second test terminal corresponding to the anomaly occurrence server.
[0144] The second indicator calculation module 408 is configured to determine the relationship status between the objects based on the relationship evaluation parameters, and to determine the anomaly prevention and control indicators of the second test terminal based on the relationship status.
[0145] The indicator sending module 410 is configured to send the anomaly prevention and control indicators of the first test terminal and the anomaly prevention and control indicators of the second test terminal to the test evaluation platform to determine the test indicators of the federated learning platform.
[0146] The following is an embodiment of a test processing device provided in this specification:
[0147] Corresponding to the test processing method described above, based on the same technical concept, one or more embodiments of this specification also provide a test processing device for executing the test processing method provided above. Figure 5 This is a schematic diagram of the structure of a test processing device provided for one or more embodiments of this specification.
[0148] This embodiment provides a test processing device that runs on a federated learning platform. The device includes:
[0149] like Figure 5 As shown, the test processing device can vary significantly due to differences in configuration or performance. It may include one or more processors 501 and memory 502, and the memory 502 may store one or more application programs or data. The memory 502 may be temporary or persistent storage. The application programs stored in the memory 502 may include one or more modules (not shown), each module may include a series of computer-executable instructions in the test processing device. Furthermore, the processor 501 may be configured to communicate with the memory 502 and execute the series of computer-executable instructions in the memory 502 on the test processing device. The test processing device may also include one or more power supplies 503, one or more wired or wireless network interfaces 504, one or more input / output interfaces 505, one or more keyboards 506, etc.
[0150] In one specific embodiment, the test processing apparatus includes a memory and one or more programs, wherein the one or more programs are stored in the memory, and the one or more programs may include one or more modules, and each module may include a series of computer-executable instructions for use in the test processing apparatus, and is configured to be executed by one or more processors. The one or more programs include computer-executable instructions for performing the following:
[0151] Obtain the features of aggregated objects during the training process of graph embedding models using federated learning;
[0152] Based on the aggregated object characteristics, the object characteristics and relationship characteristics of the abnormal occurrence terminal, the abnormal prevention and control indicators of the first test terminal are determined.
[0153] Based on the object characteristics of the second test terminal corresponding to the anomaly occurrence server, calculate the relationship evaluation parameters between objects in the object set of the second test terminal;
[0154] The relationship status between the objects is determined based on the relationship evaluation parameters, and the anomaly prevention and control indicators of the second test terminal are determined based on the relationship status.
[0155] The anomaly prevention and control indicators of the first test terminal and the second test terminal are sent to the test evaluation platform to determine the test indicators of the federated learning platform.
[0156] This specification provides an example of a storage medium as follows:
[0157] Corresponding to the test processing method described above, and based on the same technical concept, one or more embodiments of this specification also provide a storage medium.
[0158] The storage medium provided in this embodiment is used to store computer-executable instructions, which, when executed by a processor, implement the following process:
[0159] Obtain the features of aggregated objects during the training process of graph embedding models using federated learning;
[0160] Based on the aggregated object characteristics, the object characteristics and relationship characteristics of the abnormal occurrence terminal, the abnormal prevention and control indicators of the first test terminal are determined.
[0161] Based on the object characteristics of the second test terminal corresponding to the anomaly occurrence server, calculate the relationship evaluation parameters between objects in the object set of the second test terminal;
[0162] The relationship status between the objects is determined based on the relationship evaluation parameters, and the anomaly prevention and control indicators of the second test terminal are determined based on the relationship status.
[0163] The anomaly prevention and control indicators of the first test terminal and the second test terminal are sent to the test evaluation platform to determine the test indicators of the federated learning platform.
[0164] It should be noted that the embodiments of a storage medium described in this specification and the embodiments of a test processing method described in this specification are based on the same inventive concept. Therefore, the specific implementation of this embodiment can be referred to the implementation of the corresponding method described above, and the repeated parts will not be described again.
[0165] The various embodiments in this specification are described in a progressive manner. For the same or similar parts between the various embodiments, please refer to each other. Each embodiment focuses on describing the differences from other embodiments. For example, the device embodiment, equipment embodiment, and storage medium embodiment are all similar to the method embodiment, so the description is relatively simple. For reading the relevant content of the device embodiment, equipment embodiment, and storage medium embodiment, please refer to the description of the method embodiment.
[0166] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.
[0167] In the 1930s, improvements to a technology could be clearly distinguished as either hardware improvements (e.g., improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the methodology). However, with technological advancements, many improvements to the methodology today can be considered direct improvements to the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved methodology into the hardware circuit. Therefore, it cannot be said that an improvement to the methodology cannot be implemented using a hardware physical module. For example, a Programmable Logic Device (PLD) (e.g., a Field Programmable Gate Array (FPGA)) is such an integrated circuit whose logic function is determined by the user programming the device. Designers can program a digital system themselves to "integrate" it onto a PLD, without needing chip manufacturers to design and manufacture dedicated integrated circuit chips. Furthermore, nowadays, instead of manually manufacturing integrated circuit chips, this programming is mostly implemented using "logic compiler" software. Similar to the software compiler used in program development, the original code before compilation must be written in a specific programming language, called a Hardware Description Language (HDL). There are many HDLs, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Comell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, and RHDL (Ruby Hardware Description Language). Currently, the most commonly used are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should understand that by simply performing some logic programming on the method flow using one of these hardware description languages and programming it into an integrated circuit, the hardware circuit implementing the logical method flow can be easily obtained.
[0168] The controller can be implemented in any suitable manner. For example, it can take the form of a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro)processor, logic gates, switches, application-specific integrated circuits (ASICs), programmable logic controllers, and embedded microcontrollers. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicon Labs C8051F320. A memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art will also recognize that, in addition to implementing the controller in purely computer-readable program code form, the same functionality can be achieved by logically programming the method steps to make the controller take the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers. Therefore, such a controller can be considered a hardware component, and the means included therein for implementing various functions can also be considered as structures within the hardware component. Alternatively, the means for implementing various functions can be considered as both software modules implementing the method and structures within the hardware component.
[0169] The systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, a computer can be, for example, a personal computer, laptop computer, cellular phone, camera phone, smartphone, personal digital assistant, media player, navigation device, email device, game console, tablet computer, wearable device, or any combination of these devices.
[0170] For ease of description, the above apparatus is described by dividing it into various functional units. Of course, when implementing the embodiments of this specification, the functions of each unit can be implemented in one or more software and / or hardware.
[0171] Those skilled in the art will understand that one or more embodiments of this specification can be provided as a method, system, or computer program product. Therefore, one or more embodiments of this specification may take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this specification may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0172] This specification is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this specification. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create a machine for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0173] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0174] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0175] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0176] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0177] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0178] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0179] One or more embodiments of this specification can be described in the general context of computer-executable instructions, such as program modules, that are executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform a particular task or implement a particular abstract data type. One or more embodiments of this specification can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.
[0180] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to interchangeably. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.
[0181] The above description is merely an embodiment of this document and is not intended to limit the scope of this document. Various modifications and variations can be made to this document by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this document should be included within the scope of the claims of this document.
Claims
1. A test processing method applied to a federated learning platform, the method comprising: obtaining aggregated object features in a model training process of a graph embedding model through federated learning; determining an abnormality prevention index of a first test terminal based on the aggregated object features, object features and relationship features of a terminal where an abnormality occurs; determining object embedding vectors of each two objects in an object set of the second test terminal in the object features of the second test terminal based on object identifiers of the each two objects; calculating embedding vector parameters of the each two objects based on the object embedding vectors of the each two objects; determining a relationship quantity of the second test terminal according to a data set, and performing clustering processing on the embedding vector parameters between the objects based on the relationship quantity to obtain a plurality of class clusters; determining target positions of the class clusters, and calculating position distances between positions of embedding vector parameters contained in the class clusters and the target positions; selecting vector parameters with position distances less than a preset distance threshold from the embedding vector parameters between the objects, and determining a relationship state between two objects corresponding to the selected vector parameters as a connection state, if the relationship state between two objects is a connection state, querying object relationships of the two objects in a data set based on object identifiers of the two objects; determining an abnormality prevention index of the second test terminal according to a query result; sending the abnormality prevention index of the first test terminal and the abnormality prevention index of the second test terminal to a test evaluation platform to determine a test index of the federated learning platform.
2. The method of claim 1, wherein the determining an abnormality prevention index of a first test terminal based on the aggregated object features, object features and relationship features of a terminal where an abnormality occurs comprises: calculating intersection objects of an object set of the terminal where an abnormality occurs and an object set of the first test terminal based on the aggregated object features and the object features of the terminal where an abnormality occurs, and selecting an object group from the intersection objects; reading object relationships in a relationship set of the terminal where an abnormality occurs according to the object group, and calculating the abnormality prevention index based on the relationship features and a multi-tuple constructed based on the object group and the object relationships.
3. The method of claim 2, wherein the calculating the abnormality prevention index based on the relationship features and the multi-tuple constructed based on the object group and the object relationships comprises: reading object embedding vector groups corresponding to the object group in the multi-tuple from the aggregated object features, and reading relationship embedding vectors corresponding to the object relationships in the multi-tuple from the relationship features; inputting the object embedding vector groups and the relationship embedding vectors into a to-be-trained model to perform score calculation, obtaining a first test score of the multi-tuple, and determining the abnormality prevention index based on the first test score.
4. The method of claim 2, wherein the calculating the abnormality prevention index based on the relationship features and the multi-tuple constructed based on the object group and the object relationships comprises: According to the multi-tuple, the first aggregation object feature, and the relationship feature, a first test score of the multi-tuple is calculated; Based on the multi-tuple, a second object embedding vector group is determined from a second aggregation object feature, and a second relationship embedding vector is determined from the relationship feature; Based on the second object embedding vector group and the second relationship embedding vector, a second test score of the multi-tuple is calculated, and the abnormal prevention and control index is determined according to the first test score and the second test score.
5. The method of claim 4, wherein the abnormal prevention and control index is determined according to the first test score and the second test score, comprising: calculating a score ratio according to the first test score and the second test score, and determining whether the score ratio is greater than a preset ratio threshold of the abnormal occurrence terminal; if not, determining that the abnormal prevention and control index is a prevention and control success.
6. The method of claim 1, wherein the abnormal prevention and control index of the first test terminal is determined based on the aggregation object feature, the object feature of the abnormal occurrence terminal, and the relationship feature, comprising: constructing a multi-tuple based on the object feature of the abnormal occurrence terminal, the relationship feature, and the aggregation object feature; reading an object embedding vector group corresponding to an object group in the multi-tuple from the aggregation object feature, and reading a relationship embedding vector corresponding to an object relationship in the multi-tuple from the relationship feature; inverting a specific embedding vector in the object embedding vector group, and calculating the abnormal prevention and control index based on the relationship embedding vector and the embedding vector group obtained by the inversion processing.
7. The method of claim 1, wherein the abnormal prevention and control index of the second test terminal is determined according to the query result, comprising: constructing a target multi-tuple according to the object relationship of the two objects and the query; if the target multi-tuple is contained in a multi-tuple set of the second test terminal, determining that the abnormal prevention and control index of the second test terminal is a prevention and control failure.
8. The method of claim 1, wherein the object relationship of the two objects is queried in a data set based on object identifiers of the two objects, comprising: based on the object identifiers, detecting whether each object in the two objects is contained in each object of two target objects in the data set; if yes, taking the object relationship of the two target objects as the object relationship of the two objects.
9. The method of claim 1, wherein the graph embedding model is obtained by training in the following manner: each terminal of the federated learning inputs a multi-tuple and a target multi-tuple into a to-be-trained model to calculate scores, to obtain a first score of the multi-tuple and a second score of the target multi-tuple; each terminal calculates a training loss based on the first score and the second score, and updates an entity embedding matrix and a relationship embedding matrix of the to-be-trained model based on the training loss, and uploads the updated entity embedding matrix to a server of the federated learning; the server aggregates the updated entity embedding matrix of each terminal, and sends an aggregated entity feature obtained by the aggregation to each terminal.
10. The method of claim 9, wherein the multi-tuple is randomly selected from a set of multi-tuples of the terminals, and the target multi-tuple is obtained by replacing a target entity in the multi-tuple with an entity selected from the set of entities of the terminals.
11. The method of claim 1, further comprising, after the operation of sending the anomaly prevention and control indicators of the first test terminal and the anomaly prevention and control indicators of the second test terminal to the test evaluation platform: performing a recommendation process of the federated learning platform according to the test indicators.
12. A test processing apparatus running on a federated learning platform, the apparatus comprising: a feature acquisition module configured to acquire aggregated object features in a model training process of a graph embedding model through federated learning; a first indicator determination module configured to determine anomaly prevention and control indicators of a first test terminal based on the aggregated object features, object features of an abnormal terminal, and relationship features; a parameter calculation module configured to determine object embedding vectors of each two objects in an object set of a second test terminal in object features of the second test terminal based on object identifiers of the each two objects, and calculate embedding vector parameters of the each two objects based on the object embedding vectors of the each two objects; a second indicator calculation module configured to determine a relationship quantity of the second test terminal according to a data set, and perform clustering processing on the embedding vector parameters between the objects based on the relationship quantity to obtain a plurality of class clusters; determine target positions of each class cluster in the plurality of class clusters, and calculate position distances between positions of embedding vector parameters contained in the each class cluster and the target positions; select vector parameters with position distances less than a preset distance threshold from the embedding vector parameters between the objects, and determine a relationship state between two objects corresponding to the selected vector parameters as a connection state, if the relationship state between the two objects is the connection state, query object relationships of the two objects in the data set based on object identifiers of the two objects; and determine anomaly prevention and control indicators of the second test terminal according to a query result. an indicator sending module configured to send the anomaly prevention and control indicators of the first test terminal and the anomaly prevention and control indicators of the second test terminal to a test evaluation platform to determine test indicators of the federated learning platform.
13. A test processing device, comprising: a processor; and a memory configured to store computer-executable instructions that, when executed, cause the processor to: acquire aggregated object features in a model training process of a graph embedding model through federated learning; determine anomaly prevention and control indicators of a first test terminal based on the aggregated object features, object features of an abnormal terminal, and relationship features; determine object embedding vectors of each two objects in an object set of a second test terminal in object features of the second test terminal based on object identifiers of the each two objects; calculate embedding vector parameters of the each two objects based on the object embedding vectors of the each two objects. According to the data set, the number of relationships of the second test terminal is determined, and the embedding vector parameters between the objects are clustered based on the number of relationships, to obtain a plurality of class clusters; The target position of each class cluster in the plurality of class clusters is determined, and the position distance between the embedding vector parameters contained in each class cluster and the target position is calculated. From the embedding vector parameters between the objects, the vector parameters with a position distance less than a preset distance threshold are selected, and the relationship state between the two objects corresponding to the selected vector parameters is determined as a connection state. If the relationship state between the two objects is a connection state, the object relationship of the two objects is queried in the data set based on the object identifier of the two objects. According to the query result, the abnormal prevention and control index of the second test terminal is determined; The abnormal prevention and control index of the first test terminal and the abnormal prevention and control index of the second test terminal are sent to the test evaluation platform to determine the test index of the federated learning platform.
Citation Information
Patent Citations
Abnormity processing method and device for federated learning and electronic equipment
CN112734045A
Federated learning-based equipment anomaly monitoring method and system, storage medium and terminal
CN112862347A