Federal knowledge graph representation learning method, system, device and medium
By training and aggregating the global neural network model on the client, the problem of large information transmission burden in federated knowledge graph representation learning is solved, the model complexity and parameter quantity are simplified, and the system performance is improved.
Patent Information
- Application Number
- CN202510153142.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-12
- Publication Date
- 2025-03-14
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing federal knowledge graph representation learning methods are burdened with a large burden on information transmission between servers and clients, resulting in a degradation of system performance.
By building a local knowledge graph and a local knowledge graph representation model on the client, downloading the global neural network model on the server side, training it, obtaining the target neural network model and uploading it to the server side for aggregation, reducing the burden of information transmission.
The complexity and parameter quantity of the global model are simplified, the communication burden of the entire model during training is significantly reduced, and the system performance is improved.
Smart Images

Figure CN119623606A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of machine learning technology, and in particular to a method, system, device and medium for learning a federated knowledge graph representation. Background Art
[0002] Federated knowledge graph representation refers to the representation learning of knowledge graphs in a distributed environment through a federated learning mechanism, while ensuring the privacy and security of data. Existing federated knowledge graph representation learning methods usually adopt a distributed training strategy of server-client interaction. During the learning process, the server and client need to perform a large amount of information interaction to complete the training and global aggregation of the model, which will cause a great burden on the information transmission between the server and the client. Summary of the invention
[0003] In order to reduce the burden of information transmission between the server and the client during the learning process of federated knowledge graph representation, the present application provides a method, system, device and medium for learning federated knowledge graph representation.
[0004] In the first aspect, the present application provides a method for learning a federated knowledge graph representation, which is applied to a client and includes: Constructing a local knowledge graph and a local knowledge graph representation model; there are multiple entities in the local knowledge graph, and the local knowledge graph representation model is used to represent the relationship between each entity; Downloading a global neural network model from the server, determining neighbor entities corresponding to each of the entities according to the local knowledge graph representation model, and aggregating each of the entities and the neighbor entities corresponding to each of the entities through the global neural network model to obtain a target representation vector for each entity; Using the target representation vector of each entity to update the global neural network model, to obtain a target neural network model; The target neural network model is uploaded to the server, and the target neural network models uploaded by all clients are aggregated through the server to obtain a target federated knowledge graph representation model.
[0005] In one implementation, the training process of the local knowledge graph representation model is: Step 1: Obtain local information in the local knowledge graph, where each piece of local information is in the form of a triple; Step 2: Generate a negative sample corresponding to each triplet, and use the triplet and the negative sample as a training set; Step 3: Input the entity in the local knowledge graph into the knowledge graph representation model to be trained, and output the target triple corresponding to the entity; Step 4: Calculate the loss function of the target triple. If the loss function is greater than or equal to a preset threshold, adjust the parameters of the knowledge graph representation model to be trained to obtain an intermediate knowledge graph representation model, and replace the knowledge graph to be trained with the intermediate knowledge graph representation model. Repeat steps three and four until the loss function is less than the preset threshold, and use the intermediate knowledge graph representation model corresponding to the time when the loss function is less than the preset threshold as the local knowledge graph representation model.
[0006] In one embodiment, the loss function is expressed as:
[0007] in, is a triple, , is the head entity, It's a relationship. Is the tail entity.
[0008] In one embodiment, the global neural network model includes a multi-layer graph attention network, and the global neural network model is used to aggregate each of the entities and the neighbor entities corresponding to each of the entities to obtain a target representation vector for each entity, including: Using the entity as input data of a first-layer graph attention network, obtaining neighbor entities corresponding to the entity through the first-layer graph attention network, aggregating the entity with the neighbor entities, and outputting a representation vector of the entity; The representation vector is used as the input data of the next layer of graph attention network and continues to be aggregated until the last layer of graph attention network completes aggregation, and the output data of the last layer of graph attention network is used as the target representation vector.
[0009] In one embodiment, the method further comprises: The local knowledge graph representation model is updated using the representation vector of each entity to obtain a target knowledge graph representation model.
[0010] In one implementation, the target neural network model uploaded by all clients is aggregated by the server to obtain a target federated knowledge graph representation model, including: Aggregate the target neural network models uploaded by all clients to obtain an initial federated knowledge graph representation model; Determining whether the initial federated knowledge graph representation model converges; If it has not converged, the target neural network model is sent to the corresponding target client, and the target neural network model is further trained through the target client and the target knowledge graph representation model to obtain a trained neural network model; Upload the neural network model trained by each client to the server, aggregate the trained neural network model through the server, and obtain a trained federated knowledge graph representation model; Determine whether the trained federated knowledge graph representation model converges. If so, use the trained federated knowledge graph representation model as the target trained federated knowledge graph representation model.
[0011] In one embodiment, aggregating the target neural network models uploaded by all clients includes: The target neural network model is aggregated by an aggregation function, and the aggregation function is:
[0012] in, Indicates the number of clients. For the Clients, For the The target neural network model uploaded by the client.
[0013] In the second aspect, the present application provides a federated knowledge graph representation learning system, including: A construction module is used to construct a local knowledge graph and a local knowledge graph representation model; there are multiple entities in the local knowledge graph, and the local knowledge graph representation model is used to represent the relationship between each entity; A first aggregation module is used to download a global neural network model from a server, determine a neighbor entity corresponding to each entity according to the local knowledge graph representation model, and aggregate each entity and the neighbor entity corresponding to each entity through the global neural network model to obtain a target representation vector for each entity; An updating module, used to update the global neural network model using the target representation vector of each entity to obtain a target neural network model; The second aggregation module is used to upload the target neural network model to the server side, and aggregate the target neural network models uploaded by all clients through the server side to obtain a target federated knowledge graph representation model.
[0014] In a third aspect, the present application provides a computer device, comprising a processor and a memory, wherein the memory stores a computer program, and the processor is used to execute the computer program to implement the federated knowledge graph representation learning method described in the first aspect.
[0015] In a fourth aspect, the present application provides a computer storage medium storing a computer program, which, when executed on a processor, implements the federated knowledge graph representation learning method described in the first aspect.
[0016] The embodiments of the present application have the following beneficial effects: The federated knowledge graph representation learning method provided in this application is to download the global neural network model from the server to the client, train the global neural network model through the local knowledge graph model of the client, and then upload the trained target neural network model to the server. This greatly simplifies the complexity and parameter quantity of the global model and effectively reduces the communication burden of the entire model during the training process. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solution of the present application, the following is a brief introduction to the drawings required for use in the embodiments. It should be understood that the following drawings only illustrate certain embodiments of the present application and should not be regarded as limiting the scope of protection of the present application. For ordinary technicians in this field, other related drawings can also be obtained based on these drawings without creative work.
[0018] Figure 1 A schematic diagram of a process flow of a federated knowledge graph representation learning method provided in an embodiment of the present application is shown; Figure 2 A schematic diagram of a process for obtaining a target representation vector provided in an embodiment of the present application is shown; Figure 3 A schematic diagram showing the principle of a method for obtaining a target federated knowledge graph representation model provided in an embodiment of the present application is shown; Figure 4 A schematic diagram of the framework structure of a federated knowledge graph representation learning system provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0019] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments.
[0020] The components of the embodiments of the present application generally described and shown in the drawings herein may be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0021] Hereinafter, the terms "including", "having" and their cognates, which may be used in various embodiments of the present application, are intended only to indicate specific features, numbers, steps, operations, elements, components, or combinations of the foregoing items, and should not be understood as first excluding the existence of one or more other features, numbers, steps, operations, elements, components, or combinations of the foregoing items or adding the possibility of one or more features, numbers, steps, operations, elements, components, or combinations of the foregoing items.
[0022] Furthermore, the terms “first”, “second”, “third”, etc. are merely used for distinguishing descriptions and are not to be understood as indicating or implying relative importance.
[0023] Unless otherwise defined, all terms (including technical terms and scientific terms) used herein have the same meanings as those generally understood by those skilled in the art to which the various embodiments of the present application belong. The terms (such as those defined in generally used dictionaries) will be interpreted as having the same meanings as the contextual meanings in the relevant technical field and will not be interpreted as having idealized meanings or overly formal meanings unless clearly defined in the various embodiments of the present application.
[0024] In conjunction with the accompanying drawings, some embodiments of the present application are described in detail below. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.
[0025] Federated knowledge graph representation learning is an important progress in the field of knowledge graph research. This type of method combines the mechanism of federated learning with knowledge graph representation learning, and explores methods for collaborative training using knowledge graphs from multiple sources in a distributed environment while maintaining data privacy and security. Federated knowledge graph representation learning adopts a distributed training strategy of server and client interaction. Its core is to ensure that the knowledge graph data of each client can be securely stored on the local server without the need for centralized data transmission or storage.
[0026] The existing federated knowledge graph representation learning model is mainly implemented using the architecture of a unified global knowledge graph model. The specific process is as follows: define a unified global knowledge graph model that contains all client entities and relationships; during the client download process, download the corresponding model parameters in the global model according to the entities and relationships contained in its local knowledge graph, and complete local data training; upload the locally trained model parameters back to the server, and complete the aggregation operation in the server to achieve information integration. However, in complex scenarios, the knowledge graphs of different clients will have huge differences in domains and distributions, which will lead to an overly large unified global knowledge graph representation model. During the training process, this large global model needs to be transmitted multiple rounds between the server and the client, which brings a huge transmission burden to the system and seriously reduces the scope of application of this technology.
[0027] Reference Figure 1 , Figure 1 A flowchart of a method for learning a federated knowledge graph representation provided in this embodiment is provided. The method is applied to a client and can reduce the burden of information transmission between the client and the server. The method includes: S101. Construct a local knowledge graph and a local knowledge graph representation model; there are multiple entities in the local knowledge graph, and the local knowledge graph representation model is used to represent the relationship between each entity.
[0028] Define the knowledge graph as ,in They represent entities, relations, and triples contained in the knowledge graph, respectively. In the knowledge graph, a node represents an entity, an edge type represents a relation, and a triple represents a piece of information in the knowledge graph.
[0029] The definition of a triple is ,in is the head entity, It's a relationship. is the tail entity. In knowledge graph representation learning, it is necessary to learn low-dimensional representation vectors for entities and relations. , represents the dimension of the vector, is a low-dimensional representation of entity V, It is a low-dimensional representation of the relation R. These representation vectors need to reflect the original structural information of the knowledge graph.
[0030] S102. Download the global neural network model from the server, determine the neighbor entities corresponding to each of the entities according to the local knowledge graph representation model, aggregate each of the entities and the neighbor entities corresponding to each of the entities through the global neural network model, and obtain a target representation vector for each entity.
[0031] In the scenario of federated knowledge graph representation learning, there is a global server and multiple clients , the server and the client interact to upload and download models, but there is no data interaction between the clients to avoid data leakage. There is a global model on the server side ,In order to achieve efficient transmission between the server and the client, this application defines the global model as a global ,multilayer graph neural network. Compared with other neural networks, ,graph neural network can effectively aggregate the neighbor information of the ,entity, so as to better reflect its structural characteristics in the ,process of representation learning.
[0032] Usually the knowledge graph on the server side is defined as the total knowledge graph, and each client also has its own local knowledge graph. The information in the local knowledge graph is part of the total knowledge graph.
[0033] On each client There is a local knowledge graph representation model in ,This model adopts the classic TransE model structure. The TransE model regards the relationship between entities as a translation operation, has a simple structure, is easy to train in complex knowledge graphs, and has good results.
[0034] Each client can download the global neural network model from the server, and then use the local knowledge graph representation model to determine the neighbor entities of each entity in the local knowledge graph, and then use the global neural network model to aggregate the entities and neighbor entities to obtain the target representation vector corresponding to each entity.
[0035] S103. Using the target representation vector of each entity, the global neural network model is updated to obtain a target neural network model.
[0036] Since the entity types and numbers on the server side are different from those in the local knowledge graph of the client, the aggregation method and final result of the global neural network model downloaded from the server side will also be affected by the entity types and numbers on the server side. Therefore, it is necessary to update the global neural network model with the target representation vector of each entity obtained by the client in order to obtain the final target neural network model.
[0037] S104. Upload the target neural network model to the server, and aggregate the target neural network models uploaded by all clients through the server to obtain a target federated knowledge graph representation model.
[0038] Each client uploads its updated target neural network model to the server, and the server aggregates all target neural network models to obtain the target federated knowledge graph representation model.
[0039] This embodiment downloads the global neural network model of the server to the client, trains the global neural network model through the local knowledge graph model of the client, and then uploads the trained target neural network model to the server. This greatly simplifies the complexity and parameter quantity of the global model and effectively reduces the communication burden of the entire model during the training process.
[0040] In one implementation, the training process of the local knowledge graph representation model is: Step 1: Obtain local information in the local knowledge graph, where each piece of local information is in the form of a triple; Step 2: Generate a negative sample corresponding to each triplet, and use the triplet and the negative sample as a training set; Step 3: Input the entity in the local knowledge graph into the knowledge graph representation model to be trained, and output the target triple corresponding to the entity; Step 4: Calculate the loss function of the target triple. If the loss function is greater than or equal to a preset threshold, adjust the parameters of the knowledge graph representation model to be trained to obtain an intermediate knowledge graph representation model, and replace the knowledge graph to be trained with the intermediate knowledge graph representation model. Repeat steps three and four until the loss function is less than the preset threshold, and use the intermediate knowledge graph representation model corresponding to the time when the loss function is less than the preset threshold as the local knowledge graph representation model.
[0041] The local knowledge graph representation model can adopt the TransE model structure. The TransE model is a translation distance model for knowledge graph embedding. Its core idea is to embed the entities and relationships in the knowledge graph into a low-dimensional vector space and represent the relationship between entities through simple vector addition.
[0042] The expression of the loss function is:
[0043] in, is a triple, , is the head entity, It's a relationship. Is the tail entity.
[0044] In order to improve the model's learning effect on the knowledge graph structure information, negative samples are additionally introduced into the training objectives of the TransE model to enhance the model's ability to distinguish the knowledge graph structure during learning. The negative sample is constructed by random replacement, that is, for the triple , random replacement or for , and ensure that the negative samples obtained In the actual model training process, a fixed number of negative samples are generated for each triple and added to the training data.
[0045] Each entity has a corresponding triplet. When the entity is input into the local knowledge graph representation model, the corresponding triplet can be output. Therefore, the local knowledge graph representation model can be trained based on the entity and the triplet corresponding to the entity, and the loss function can be used to evaluate whether the model is trained.
[0046] This embodiment obtains the triplet corresponding to each entity, generates the corresponding negative sample based on the triplet, and uses the triplet and negative sample to train the local knowledge graph representation model, thereby enhancing the model's ability to distinguish the knowledge graph structure.
[0047] Reference Figure 2 , the global neural network model includes a multi-layer graph attention network, and step S102 includes: steps S1021-S1022.
[0048] S1021. Use the entity as input data of the first-layer graph attention network, obtain the neighbor entity corresponding to the entity through the first-layer graph attention network, aggregate the entity with the neighbor entities, and output the representation vector of the entity.
[0049] S1022. Use the representation vector as input data of the next layer of graph attention network and continue to aggregate until the last layer of graph attention network completes aggregation, and use the output data of the last layer of graph attention network as the target representation vector.
[0050] Specifically, a multi-layer graph attention network is used as a global neural network model. The neural network aggregates the neighbors of an entity into the entity's representation vector, and can distinguish the impact of different relationship types on entity aggregation during the aggregation process.
[0051] Defining Entities The neighbors in the knowledge graph are , the first-layer graph attention network aggregates the information of neighbors into entities, i.e. ,in is the initial representation vector of the entity, is the initial representation vector of the neighbor entity. is the attention weight calculation method associated with the relationship, that is, , , is the mapping vector associated with the relationship. Similarly, the entity After The output after the layer graph attention network becomes ,in and It is The output of the layer graph attention network. Layer Graph Attention Network, Entity Can get Jump to the neighbor's information, thus greatly enriching its background information.
[0052] This embodiment uses a multi-layer graph attention network as a global neural network model, and aggregates the neighbor information of an entity multiple times through the multi-layer graph attention network, thereby strengthening the connection between the entity and other entities and enriching the background information of the entity.
[0053] In one embodiment, the method further comprises: The local knowledge graph representation model is updated using the representation vector of each entity to obtain a target knowledge graph representation model.
[0054] Specifically, after the entities are aggregated through the global neural network model, the relationship between each entity is re-determined. Therefore, the local knowledge graph representation model, namely the TransE model, needs to be synchronously updated based on the aggregated information.
[0055] For entities , which is done through a global graph neural network After aggregating neighbor information, , the corresponding local TransE model for triples The loss function becomes After further combining negative sample generation, the objective function of the entire client update is:
[0056] in is the set of negative samples, is a hyperparameter of the edge ranking loss, is the loss function corresponding to negative samples.
[0057] This embodiment updates the local knowledge graph representation model through aggregated information, and updates the loss function of the model and the objective function of the client, so that the model and the client meet the requirements of the aggregated information.
[0058] Reference Figure 3 , Figure 3 A schematic diagram showing the principle of a method for acquiring a target federated knowledge graph representation model is shown.
[0059] In one implementation, the target neural network model uploaded by all clients is aggregated by the server to obtain a target federated knowledge graph representation model, including: Aggregate the target neural network models uploaded by all clients to obtain an initial federated knowledge graph representation model; Determining whether the initial federated knowledge graph representation model converges; If it has not converged, the target neural network model is sent to the corresponding target client, and the target neural network model is further trained through the target client and the target knowledge graph representation model to obtain a trained neural network model; Upload the neural network model trained by each client to the server, aggregate the trained neural network model through the server, and obtain a trained federated knowledge graph representation model; Determine whether the trained federated knowledge graph representation model converges. If so, use the trained federated knowledge graph representation model as the target trained federated knowledge graph representation model.
[0060] like Figure 3 As shown, each client downloads the corresponding global neural network model from the server, and then trains and updates the global neural network model, and then returns it to the server. The above client trains and updates the global neural network model, and then performs multiple rounds of aggregation iterative process on the server until the global neural network converges or reaches the specified number of iterations, thereby obtaining the federated knowledge graph representation model that has finally completed the training.
[0061] The target neural network model is aggregated by an aggregation function, and the aggregation function is:
[0062] in, Indicates the number of clients. For the Clients, For the The target neural network model uploaded by the client.
[0063] In this embodiment, the global neural network model is trained and updated through the client, and then multiple rounds of iterative aggregation process are performed through the server, so that the global neural network converges to ensure that the final federated knowledge graph representation model meets the preset requirements.
[0064] Reference Figure 4 , the present application provides a federated knowledge graph representation learning system 400, including: A construction module 401 is used to construct a local knowledge graph and a local knowledge graph representation model; there are multiple entities in the local knowledge graph, and the local knowledge graph representation model is used to represent the relationship between each entity; The first aggregation module 402 is used to download the global neural network model from the server, determine the neighbor entities corresponding to each of the entities according to the local knowledge graph representation model, and aggregate each of the entities and the neighbor entities corresponding to each of the entities through the global neural network model to obtain a target representation vector for each entity; An updating module 403, configured to update the global neural network model using the target representation vector of each entity to obtain a target neural network model; The second aggregation module 404 is used to upload the target neural network model to the server, and aggregate the target neural network models uploaded by all clients through the server to obtain a target federated knowledge graph representation model.
[0065] It can be understood that the federated knowledge graph representation learning system of this embodiment corresponds to the federated knowledge graph representation learning method of the above-mentioned embodiment, and the optional options in the above-mentioned embodiment are also applicable to this embodiment, so they will not be repeated here.
[0066] The present application also provides a computer device. Exemplarily, the computer device includes a processor and a memory, wherein the memory stores a computer program, and the processor runs the computer program to enable the computer device to execute the functions of each module in the above-mentioned federated knowledge graph representation learning method or the above-mentioned federated knowledge graph representation learning system.
[0067] Among them, the processor can be an integrated circuit chip with signal processing capabilities. The processor can be a general-purpose processor, including a central processing unit (CPU), a graphics processing unit (GPU), a network processor (NP), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or at least one of other programmable logic devices, discrete gates or transistor logic devices, and discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc., which can implement or execute the methods, steps and logic block diagrams disclosed in the embodiments of the present application.
[0068] The memory may be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electric erasable programmable read-only memory (EEPROM), etc. The memory is used to store a computer program, and the processor may execute the computer program accordingly after receiving an execution instruction.
[0069] The present application also provides a computer storage medium for storing the computer program used in the above-mentioned computer device. The computer storage medium may be a readable storage medium, or a non-volatile storage medium or a volatile storage medium. For example, the computer storage medium may include but is not limited to: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.
[0070] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and structure diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in an alternative implementation, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the structure diagram and / or the flow diagram, and the combination of boxes in the structure diagram and / or the flow diagram, can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0071] In addition, the functional modules or units in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
[0072] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a computer device (which can be a smart phone, a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application.
[0073] The above description is only a specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application.
Claims
1. A method for learning a federated knowledge graph representation, characterized in that: Applied to the client, including: Constructing a local knowledge graph and a local knowledge graph representation model; there are multiple entities in the local knowledge graph, and the local knowledge graph representation model is used to represent the relationship between each entity; Downloading a global neural network model from the server, determining neighbor entities corresponding to each of the entities according to the local knowledge graph representation model, and aggregating each of the entities and the neighbor entities corresponding to each of the entities through the global neural network model to obtain a target representation vector for each entity; Using the target representation vector of each entity to update the global neural network model, to obtain a target neural network model; The target neural network model is uploaded to the server, and the target neural network models uploaded by all clients are aggregated through the server to obtain a target federated knowledge graph representation model.
2. The method for learning a federated knowledge graph representation according to claim 1, characterized in that: The training process of the local knowledge graph representation model is as follows: Step 1: Obtain local information in the local knowledge graph, where each piece of local information is in the form of a triple; Step 2: Generate a negative sample corresponding to each triplet, and use the triplet and the negative sample as a training set; Step 3: Input the entity in the local knowledge graph into the knowledge graph representation model to be trained, and output the target triple corresponding to the entity; Step 4: Calculate the loss function of the target triple. If the loss function is greater than or equal to a preset threshold, adjust the parameters of the knowledge graph representation model to be trained to obtain an intermediate knowledge graph representation model, and replace the knowledge graph to be trained with the intermediate knowledge graph representation model. Repeat steps three and four until the loss function is less than the preset threshold, and use the intermediate knowledge graph representation model corresponding to the time when the loss function is less than the preset threshold as the local knowledge graph representation model.
3. The method for learning a federated knowledge graph representation according to claim 2, characterized in that: The expression of the loss function is: in, is a triple, , is the head entity, It's a relationship. Is the tail entity.
4. The method for learning a federated knowledge graph representation according to claim 1, characterized in that: The global neural network model includes a multi-layer graph attention network, and each entity and its corresponding neighbor entities are aggregated through the global neural network model to obtain a target representation vector for each entity, including: Using the entity as input data of a first-layer graph attention network, obtaining neighbor entities corresponding to the entity through the first-layer graph attention network, aggregating the entity with the neighbor entities, and outputting a representation vector of the entity; The representation vector is used as the input data of the next layer of graph attention network and continues to be aggregated until the last layer of graph attention network completes aggregation, and the output data of the last layer of graph attention network is used as the target representation vector.
5. The method for learning a federated knowledge graph representation according to claim 1, characterized in that: The method further comprises: The local knowledge graph representation model is updated using the representation vector of each entity to obtain a target knowledge graph representation model.
6. The method for learning a federated knowledge graph representation according to claim 5, characterized in that: The target neural network model uploaded by all clients is aggregated by the server to obtain a target federated knowledge graph representation model, including: Aggregate the target neural network models uploaded by all clients to obtain an initial federated knowledge graph representation model; Determining whether the initial federated knowledge graph representation model converges; If it has not converged, the target neural network model is sent to the corresponding target client, and the target neural network model is further trained through the target client and the target knowledge graph representation model to obtain a trained neural network model; Upload the neural network model trained by each client to the server, aggregate the trained neural network model through the server, and obtain a trained federated knowledge graph representation model; Determine whether the trained federated knowledge graph representation model converges. If so, use the trained federated knowledge graph representation model as the target trained federated knowledge graph representation model.
7. The method for learning a federated knowledge graph representation according to claim 1, characterized in that: The aggregating the target neural network models uploaded by all clients includes: The target neural network model is aggregated by an aggregation function, and the aggregation function is: in, Indicates the number of clients. For the Clients, For the The target neural network model uploaded by the client.
8. A federated knowledge graph representation learning system, characterized in that: include: A construction module is used to construct a local knowledge graph and a local knowledge graph representation model; there are multiple entities in the local knowledge graph, and the local knowledge graph representation model is used to represent the relationship between each entity; A first aggregation module is used to download a global neural network model from a server, determine a neighbor entity corresponding to each entity according to the local knowledge graph representation model, and aggregate each entity and the neighbor entity corresponding to each entity through the global neural network model to obtain a target representation vector for each entity; An updating module, used for updating the global neural network model using the target representation vector of each entity to obtain a target neural network model; The second aggregation module is used to upload the target neural network model to the server side, and aggregate the target neural network models uploaded by all clients through the server side to obtain a target federated knowledge graph representation model.
9. A computer device, characterized in that: The computer device includes a processor and a memory, the memory stores a computer program, and the processor is used to execute the computer program to implement the federated knowledge graph representation learning method described in any one of claims 1-7.
10. A computer storage medium, characterized in that: It stores a computer program, which, when executed on a processor, implements the federated knowledge graph representation learning method according to any one of claims 1-7.
Citation Information
Patent Citations
Federal knowledge graph representation learning method and system based on reconstructed network
CN119005319A
Cited By
Federal learning-based teaching model training and teaching task processing method and device
CN121388844A
Federated learning based teaching model training and teaching task processing method and device
CN121388844B