A method for generating and processing family knowledge graphs

By training vectors of targets and their associations in the family knowledge graph, unpredictable intermediate vectors are generated, which solves the problem of privacy security after information in the family knowledge graph is stolen, and achieves higher data privacy protection.

CN113468547BActive Publication Date: 2025-05-13HISENSE GRP HLDG CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010686371.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-07-16
Publication Date
2025-05-13
Estimated Expiration
2040-07-16

AI Technical Summary

Technical Problem

After the information stored in the existing home knowledge graph is stolen, the privacy and security of the data stored in the home knowledge graph cannot be guaranteed.

Method used

By training the vectors of the target family's sample set of targets and their correlations, unpredictable intermediate vectors are generated and the correspondence of these vectors are saved to ensure that even if the data is stolen, the thief cannot interpret its meaning.

Benefits of technology

Improves the privacy and security of data stored in the home knowledge graph to prevent information leakage and unauthorized operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113468547B_ABST
    Figure CN113468547B_ABST
Patent Text Reader

Abstract

The present application discloses a method for generating and processing data of a family knowledge graph. Since the present application uses vectors to represent the first target in the target family sample set and the association relationship corresponding to the first target, and the vector is obtained by continuous personalized training based on the randomly generated vector and the first target in the target family and the association relationship corresponding to the first target, the vector corresponding to the first target and the association relationship in the target family is unpredictable. Even if the data output by the electronic device querying the family knowledge graph is subsequently stolen, the thief cannot interpret the meaning of the vector in the stolen data, nor can he determine the first target to which the stolen attribute information belongs, thereby improving the privacy security of the data stored in the family knowledge graph.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of smart home devices, and in particular to a method, device, equipment and medium for generating and processing data of a family knowledge graph. Background Art

[0002] In the prior art, the family knowledge graph, as a graph database, stores a large amount of personal information of users in the family. Based on the data stored in the family knowledge graph, corresponding processing can be performed to provide services to users. Among them, because the data stored in the family knowledge graph are all personal information of users in the family scene, this information has a high degree of privacy. When a user initiates a service request through a client, it is usually necessary to obtain sufficient user information from the family knowledge graph in order to provide services to the user. Therefore, how to ensure the privacy security of the family knowledge graph is an issue that people are increasingly concerned about.

[0003] In actual application, if services can be provided to users by directly performing queries and other processing on an electronic device that queries the family knowledge graph based on the data stored therein, then as long as the security of the electronic device that queries the family knowledge graph is guaranteed, the security of the data stored therein can be guaranteed.

[0004] Since in the above method, the electronic device for querying the family knowledge graph can only provide functions such as query, reasoning, association, etc., and cannot perform complex processing such as recommendation, prediction, classification, etc., the electronic device can only provide some simple services to the user. For some services that require a lot of complex processing, such as recommendation, analysis, prediction, etc., to provide to the user, the electronic device for querying the family knowledge graph obtains the identification information and target association relationship of the target contained in the data query request sent by the server, performs corresponding processing, and sends the target attribute information corresponding to the target and other targets with target association relationships to the server, where the target is a person, an object, a room, etc. Then, after the server obtains the data sent by the electronic device, it performs corresponding processing, thereby feeding back the encapsulated processing result (Response) to the user's client. Finally, the client receives the processing result sent by the server and provides services to the user according to the processing result.

[0005] Because in the above method, in the process of sending the target, other targets that have a target association relationship with the target, and their corresponding target attribute information to the server, if the server is not a user's home edge processing device, or is a third-party supervision device, only the security of the electronic device that queries the family knowledge graph is guaranteed, and the privacy security of the data stored in the family knowledge graph cannot be guaranteed. It may happen that the target, other targets that have a target association relationship with the target, and their corresponding attribute information are illegally stolen, and the stolen data are displayed in plain text. The thief can easily interpret the information of the target family, and then perform illegal operations on the target family's information such as information leakage, information resale, unauthorized storage, unauthorized forwarding, etc., resulting in the inability to guarantee the privacy security of the data stored in the family knowledge graph. Summary of the invention

[0006] The present application provides a method, device, equipment and medium for generating and processing data of a family knowledge graph, so as to solve the problem that after the information in the existing family knowledge graph is stolen, the privacy security of the data stored in the family knowledge graph cannot be guaranteed.

[0007] In a first aspect, the present application provides a method for generating a family knowledge graph, the method comprising:

[0008] The first intermediate state vector of the first identification information corresponding to the first target in the target family sample set is trained, and the second intermediate state vector of the second identification information of the association relationship corresponding to the first target is trained, until the loss value determined according to the first difference between the distance between the two first intermediate state vectors with the association relationship and the distance between the second intermediate state vector corresponding to the association relationship and the preset standard vector, and the distance threshold corresponding to the association relationship determined by the current training satisfies the preset convergence condition, the first intermediate state vector is determined as the first vector, and the second intermediate state vector is determined as the second vector;

[0009] Save the correspondence between the association relationship and the second identification information, as well as the correspondence between the first identification information, the first vector, the second identification information and the second vector, and save the correspondence between the first vector and the attribute information of the first target in the target family sample set.

[0010] In a second aspect, the present application also provides a data processing method, the method comprising:

[0011] Determine, according to the third identification information corresponding to the second target carried in the acquired data query request, the target association relationship, and the stored family knowledge graph of the target family, a third vector corresponding to the third identification information and a fourth vector corresponding to the target association relationship;

[0012] Acquire a fifth vector from the saved vectors, the distance between the fifth vector and the third vector being equal to the distance between the fourth vector and the preset standard vector;

[0013] The third vector, the fifth vector and their corresponding target attribute information are sent.

[0014] In a third aspect, the present application also provides a data processing method, the method comprising:

[0015] Based on the obtained service request, generate and send a data query request carrying the third identification information corresponding to the second target and the target association relationship;

[0016] Obtaining the third vector, the fifth vector and their corresponding target attribute information;

[0017] Determining the target identification information corresponding to the third vector and the fifth vector respectively according to the pre-stored correspondence between the vector and the identification information;

[0018] According to the target identification information and the target attribute information corresponding thereto, corresponding processing is performed, and the processing result is generated and sent.

[0019] In a fourth aspect, the present application further provides a device for generating a family knowledge graph, the device comprising:

[0020] A training unit, used for training a first intermediate state vector of a first identification information corresponding to a first target in a target family sample set, and a second intermediate state vector of a second identification information of an association relationship corresponding to the first target, until a loss value determined according to a first difference between a distance between two first intermediate state vectors having the association relationship and a distance between a second intermediate state vector corresponding to the association relationship and a preset standard vector, and a distance threshold corresponding to the association relationship determined by current training, satisfies a preset convergence condition, and the first intermediate state vector is determined as a first vector, and the second intermediate state vector is determined as a second vector;

[0021] A storage unit is used to store the correspondence between the association relationship and the second identification information, as well as the correspondence between the first identification information, the first vector, the second identification information and the second vector, and to store the correspondence between the first vector and the attribute information of the first target in the target family sample set.

[0022] In a fifth aspect, the present application further provides a data processing device, the device comprising:

[0023] A determination module, configured to determine, according to the third identification information corresponding to the second target carried in the acquired data query request, the target association relationship, and the stored family knowledge graph of the target family, a third vector corresponding to the third identification information and a fourth vector corresponding to the target association relationship;

[0024] An acquisition module, used for acquiring, from the stored vectors, a fifth vector whose distance from the third vector is equal to the distance between the fourth vector and the preset standard vector;

[0025] A sending module is used to send the third vector, the fifth vector and their corresponding target attribute information.

[0026] In a sixth aspect, the present application further provides a data processing device, the device comprising:

[0027] A sending unit, configured to generate and send a data query request carrying third identification information corresponding to the second target and a target association relationship based on the acquired service request;

[0028] An acquisition unit, used for acquiring the third vector, the fifth vector and target attribute information corresponding thereto;

[0029] a determining unit, configured to determine the target identification information corresponding to the third vector and the fifth vector respectively according to a pre-stored correspondence relationship between the vector and the identification information;

[0030] A processing unit, used to perform corresponding processing according to the target identification information and the target attribute information corresponding thereto, and generate a processing result;

[0031] The sending unit is further used to send the processing result.

[0032] In the seventh aspect, the present application also provides an electronic device, which includes at least a processor and a memory, and the processor is used to implement the steps of the method for generating a family knowledge graph as described above when executing a computer program stored in the memory, or implement the steps of the data processing method of the electronic device applied to query the family knowledge graph as described above, or implement the steps of the data processing method applied to the server as described above.

[0033] In the eighth aspect, the present application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the method for generating a family knowledge graph as described above, or implements the steps of the data processing method for an electronic device applied to query a family knowledge graph as described above, or implements the steps of the data processing method applied to a server as described above.

[0034] Since the present application uses vectors to represent the first target in the target family sample set and the association relationship corresponding to the first target, and the vector is obtained by continuous personalized training based on the randomly generated vector and the first target in the target family and the association relationship corresponding to the first target, the vector corresponding to the first target and the association relationship in the target family is unpredictable. Even if the data output by the electronic device that queries the family knowledge graph is subsequently stolen, the thief cannot interpret the meaning of the vector in the stolen data, nor can he determine the first target to which the stolen attribute information belongs, thereby improving the privacy security of the data stored in the family knowledge graph. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0036] Figure 1 A schematic diagram of a process for generating a family knowledge graph provided in some embodiments of the present application;

[0037] Figure 2 A specific flow chart for generating a family knowledge graph provided for some embodiments of the present application;

[0038] Figure 3 A schematic diagram of a data processing flow provided for some embodiments of the present application;

[0039] Figure 4 A schematic diagram of the structure of an existing family knowledge graph provided for some embodiments of the present application;

[0040] Figure 5 A schematic diagram of a specific data processing flow provided for some embodiments of the present application;

[0041] Figure 6 A schematic diagram of another data processing flow provided for some embodiments of the present application;

[0042] Figure 7 A schematic diagram of the structure of a device for generating a family knowledge graph provided in some embodiments of the present application;

[0043] Figure 8 A schematic diagram of the structure of a data processing device provided in some embodiments of the present application;

[0044] Fig. 9 A schematic diagram of the structure of another data processing device provided in some embodiments of the present application;

[0045] Fig.10 A schematic diagram of the structure of an electronic device provided for some embodiments of the present application;

[0046] Fig.11 A schematic diagram of the structure of an electronic device provided for some embodiments of the present application;

[0047] Fig.12 A schematic diagram of the structure of an electronic device provided for some embodiments of the present application. DETAILED DESCRIPTION

[0048] In order to improve the privacy security of data stored in a family knowledge graph, the present application provides a method, device, equipment and medium for generating and processing data of a family knowledge graph.

[0049] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.

[0050] In the actual application process, when the user wants the client to provide the corresponding service, the client will receive the request statement input by the user, and then the client will initiate a service request (Request) to the server. The service request contains the identification information and request information of the target. The request information can be the request statement input by the user, or the type of service requested by the user and the target association relationship obtained according to the request statement input by the user. Secondly, the server processes the service request sent by the client accordingly, generates a data query request (Query) carrying the identification information of the target and the target association relationship, and sends it to the electronic device that queries the family knowledge graph. The electronic device that queries the family knowledge graph parses the data query request, obtains the identification information and the target association relationship of the target, and then performs corresponding processing, and sends the target, other targets with target association relationships with the target, and their corresponding target attribute information to the server, so that the server sends the encapsulated processing result (Response) to the client. The client receives the response sent by the server carrying the processing result, and provides services to the user according to the processing result.

[0051] Figure 1 A schematic diagram of a process for generating a family knowledge graph provided in some embodiments of the present application, the process comprising:

[0052] S101: Train the first intermediate state vector of the first identification information corresponding to the first target in the target family sample set, and the second intermediate state vector of the second identification information of the association relationship corresponding to the first target, until the loss value determined based on the first difference between the distance between the two first intermediate state vectors with the association relationship and the distance between the second intermediate state vector corresponding to the association relationship and the preset standard vector, and the distance threshold corresponding to the association relationship determined by the current training meets the preset convergence condition, and the first intermediate state vector is determined as the first vector, and the second intermediate state vector is determined as the second vector.

[0053] The method for generating a family knowledge graph provided in this application is applied to an electronic device, which may be a smart device or a server. For example, the smart device may be a smart brain, a smart housekeeper server, or other devices.

[0054] In the present application, each first target with an associated relationship in the target family and its corresponding attribute information can be collected in advance, and the identification information corresponding to each first target (for the sake of ease of description, recorded as the first identification information) can be determined to determine the target family sample set. Each first target in the target family, the corresponding association relationship, and the corresponding attribute information can be determined by the electronic device that generates the family knowledge graph based on the acquired collection information in the target family, or can be received from other devices. Among them, the collection information in the target family can be sent by the electronic device that generates the family knowledge graph and received from the smart device in the target family, or it can be collected by the electronic device that generates the family knowledge graph itself, and no specific limitation is made here.

[0055] In the present application, the first target can be a person, or an object such as a TV, refrigerator, or a room such as a living room, bedroom, or study. The first identification information corresponding to each first target is used to uniquely identify the information of the first target in the target family. The first identification information can be the name of the first target, such as "Zhang San", "Refrigerator", "Living Room", etc., or other identifications. As long as the information that can uniquely identify the first target can be used as the first identification information corresponding to the first target. In addition, when the first target is a person, the first identification information corresponding to the first target can also be the identity of the first target in the target family, such as "Dad", "Mom", etc.

[0056] Among them, the association relationship between the first targets with an association relationship is directed. For example, based on the collected information that the "mom" in the target family often uses the refrigerator, the first target "mom", the first target "refrigerator", and the association relationship between the first target "mom" and the first target "refrigerator" are determined to be a use relationship of the first target "mom" using the first target "refrigerator"; based on the collected information that the refrigerator is located in the kitchen of the target family, the first target "refrigerator", the first target "kitchen", and the association relationship between the first target "refrigerator" and the first target "kitchen" are determined to be a location relationship of the first target "refrigerator" being located in the first target "kitchen".

[0057] In order to facilitate the subsequent generation of the family knowledge graph of the target family, the identification information corresponding to the association relationship existing in the target family sample set can also be determined (for the convenience of description, recorded as the second identification information). Specifically, the second identification information can be a textual representation of the association relationship, such as "located in relationship", "father-child relationship", "use relationship", etc., or other identifications. As long as the information can uniquely identify the association relationship, it can be used as the second identification information of the association relationship.

[0058] In the present application, after obtaining the target family sample set, corresponding processing is performed based on the association relationship between any two first targets with an association relationship in the target family sample set, and the attribute information corresponding to each first target, so as to generate a family knowledge graph of the target family.

[0059] In order to improve the security of the data stored in the generated family knowledge graph, in the present application, the first identification information corresponding to each first target and its corresponding association relationship are represented by vectors in the family knowledge graph. Even if the data stored in the subsequent family knowledge graph is stolen, the thief cannot know each first target in the target family and the relationship between the first targets, and thus cannot interpret the meaning of the vector queried in the family knowledge graph, thereby improving the privacy security of the data stored in the family knowledge graph. Specifically, for the first identification information corresponding to any two first targets with an association relationship in the target family sample set, first randomly generate the second intermediate state vector corresponding to the association relationship and the first intermediate state vector corresponding to each first identification information. Then, training is performed based on each generated first intermediate state vector and second intermediate state vector to determine the second vector corresponding to each association relationship and the first vector corresponding to each first identification information.

[0060] Among them, each dimensional element in the second intermediate state vector of the preset dimension corresponding to the second identification information is randomly assigned a value, and each dimensional element in the first intermediate state vector of the preset dimension corresponding to each first identification information is assigned a value respectively.

[0061] It should be noted that each randomly generated second intermediate state vector and each first intermediate state vector may be the same or different.

[0062] In general, the family knowledge graph of the target family not only stores the first identification information corresponding to each first target, but also stores the directed association relationship between the first targets with which there is an association relationship. Based on this, in the present application, the association relationship between the first targets can be reflected by the distance between the first vectors. Among them, the distance between the first vectors corresponding to the two first targets with which there is an association relationship (for the convenience of description, recorded as the first distance) should be the distance between the second vector corresponding to the corresponding association relationship and the preset standard vector (for the convenience of description, recorded as the second distance). The preset standard vector can be represented as any vector in the vector space where the first vector and the second vector are located. For example, if the vector space where the first vector and the second vector are located is a three-dimensional vector space, the preset standard vector can be (0,0,0).

[0063] For example, the first target A is the father of the first target A, and the association relationship between the first target A and the first target A is a parent-child relationship. Then the first distance between the first vectors corresponding to the first target A and the first target A respectively should be equal to the second distance between the second vector corresponding to the parent-child relationship and the preset standard vector.

[0064] In the present application, after obtaining the randomly generated first intermediate state vector corresponding to each first target and the second intermediate state vector corresponding to each association relationship based on the above embodiment, personalized training can be continuously performed according to each first target in the target family and the corresponding association relationships, so as to obtain the first vector corresponding to each first target in the target family and the second vector corresponding to each association relationship.

[0065] Specifically, in each training, for any two first intermediate state vectors with an associated relationship determined in the current training, the first distance between the two first intermediate state vectors and the second distance between the second intermediate state vector corresponding to the associated relationship and the preset standard vector are determined, and the sub-loss value is determined according to the first difference between the first distance and the second distance, and the distance threshold corresponding to the associated relationship determined in the current training. The loss value is determined according to the sum of each sub-loss value determined in the current training, and it is judged whether the loss value meets the preset convergence condition. If it is determined that the loss value does not meet the preset convergence condition, it means that the first distance between any two first intermediate state vectors with an associated relationship cannot reflect their corresponding associated relationship, then each second intermediate state vector determined in the current training, at least one-dimensional element value in each first intermediate state vector, and the distance threshold corresponding to each associated relationship are adjusted respectively, that is, each second intermediate state vector determined in the current training, each first intermediate state vector, and the distance threshold corresponding to each associated relationship are trained next time.

[0066] In the present application, according to each first target in the target family and the corresponding association relationships, each determined second intermediate state vector and each first intermediate state vector are continuously trained until the loss value determined based on the above embodiment meets the preset convergence condition, which means that the training of the second vector and each first vector is completed, and the second intermediate state vector determined by the current training is determined as the second vector, and the first intermediate state vector determined by the current training is determined as the first vector.

[0067] It should be noted that due to different target families, the first targets and association relationships in the target family sample set of the target family will be different. Therefore, the first vector corresponding to the first target in each target family and the second vector corresponding to the association relationship determined according to the method in the above embodiment will also be different and not unique. The family knowledge graph generated subsequently will also be different due to different target families.

[0068] S102: Save the correspondence between the association relationship and the second identification information, as well as the correspondence between the first identification information, the first vector, the second identification information and the second vector, and save the correspondence between the first vector and the attribute information of the first target in the target family sample set.

[0069] In actual application, the electronic device that queries the family knowledge graph can query the vector corresponding to the second target in the family knowledge graph (for the convenience of description, recorded as the third vector) and the vector corresponding to the target association relationship (for the convenience of description, recorded as the fourth vector) based on the identification information (for the convenience of description, recorded as the third identification information) and the target association relationship of the target (for the convenience of description, recorded as the second target) carried in the received data query request, as well as the saved family knowledge graph of the target family.

[0070] Therefore, in order to facilitate subsequent data query based on the family knowledge graph of the target family, in the present application, after determining the second vector corresponding to the second identification information of each association relationship in the target family sample set and the first vector corresponding to each first target, the correspondence between the association relationship and the second identification information is saved, so that the electronic device that subsequently queries the family knowledge graph can determine the identification information corresponding to the target association relationship based on the correspondence between the association relationship and the second identification information, and thus query the data based on the identification information corresponding to the target association relationship and the third identification information corresponding to the second target, as well as the saved family knowledge graph of the target family.

[0071] Since each first target and each association relationship in the family knowledge graph generated by the present application are expressed as vectors. Therefore, in order to facilitate the subsequent determination of the target in the family knowledge graph that has a target association relationship with the second target (for the convenience of explanation, that is, the third target) based on the queried identification information, the correspondence between each first identification information and its corresponding first vector, and each second identification information and its corresponding second vector is also saved, that is, the correspondence between the identification information and the vector is established. When the electronic device that subsequently queries the family knowledge graph obtains the identification information corresponding to the target association relationship and the identification information corresponding to the second target, the third vector corresponding to the third identification information and the fourth vector corresponding to the identification information corresponding to the target association relationship are determined based on the correspondence between the identification information and the vector, so as to determine the vector corresponding to the third target that has a target association relationship with the second target (for the convenience of description, it is recorded as the fifth vector).

[0072] In order to obtain the attribute information corresponding to the queried target through the family knowledge graph, in this application, the correspondence between each first vector and the attribute information of the first target in the target family sample set corresponding to it is also saved, that is, the correspondence between the vector and the attribute information is established. After the electronic device that subsequently queries the family knowledge graph determines the third vector and the fifth vector based on the above embodiment, the target attribute information corresponding to the third vector and the fifth vector is determined according to the pre-saved correspondence between the vector and the attribute information, that is, the target attribute information corresponding to the second target and the third target is determined.

[0073] Since the present application uses vectors to represent the first target in the target family sample set and the association relationship corresponding to the first target, and the vector is obtained by continuous personalized training based on the randomly generated intermediate state vector and the first target in the target family and the association relationship corresponding to the first target, the vector corresponding to the first target and the association relationship in the target family is unpredictable. Even if the data output by the electronic device that queries the family knowledge graph is subsequently stolen, the thief cannot interpret the meaning of the vector in the stolen data, nor can he determine the first target to which the stolen attribute information belongs, thereby improving the privacy security of the data stored in the family knowledge graph.

[0074] In order to obtain the family knowledge graph of the target family, based on the above embodiment, in this application, whether the loss value satisfies the preset convergence condition is determined, including:

[0075] If the loss value is less than a preset loss threshold, determining that the loss value satisfies a preset convergence condition; and / or

[0076] If the loss value is the minimum loss value, it is determined that the loss value satisfies a preset convergence condition.

[0077] Based on the above embodiments, it can be known that when it is determined that the loss value satisfies the preset convergence condition, it means that each second vector and each first vector have been obtained, then the training of each second intermediate state vector and each first intermediate state vector is stopped, and each second intermediate state vector and each first intermediate state vector determined by the current training are used as each second vector and each first vector respectively, and then subsequent processing is performed according to each first vector and each second vector to generate a family knowledge graph of the target family.

[0078] The determination of whether the loss value meets the preset convergence condition may include the following methods:

[0079] Method 1: In the present application, a loss threshold is preset. When the loss value determined based on the sum of each sub-loss value obtained in the training is less than the preset loss threshold, it is determined that the loss value meets the preset convergence condition.

[0080] Among them, when setting the preset loss threshold, different values ​​are set according to different scenarios. If there are strict requirements on the generated first vector and second vector, the loss threshold can be set smaller; if the purpose is to reduce the number of training times for the first vector and the second vector, the loss threshold can be set larger, but not too large, and can be flexibly set according to actual needs, which will not be described in detail here.

[0081] Method 2: In this application, by continuously adjusting the distance threshold corresponding to each second intermediate state vector, each first intermediate state vector, and each association relationship determined by the current training, different sub-loss values ​​can be obtained, thereby obtaining different loss values ​​according to the sum of different sub-loss values. When the loss value obtained by this training is determined to be the minimum loss value according to each loss value that has been determined, it is determined that the loss value meets the preset convergence condition.

[0082] Method 3: In the present application, Method 1 and Method 2 may also be combined, that is, if the determined loss value is both smaller than a preset loss threshold and is a minimum loss value, then the determined loss value satisfies a preset convergence condition.

[0083] In specific implementation, it can be combined with demand and according to any of the above methods to determine whether the currently determined loss value meets the preset convergence condition, so as to determine whether the training of each first intermediate state vector and each second intermediate state vector in the family knowledge graph of the target family is completed.

[0084] In a possible implementation, determining the loss value according to a first difference between the distance between the two first intermediate state vectors having the association relationship and the distance between the second intermediate state vector corresponding to the association relationship and a preset standard vector, and a distance threshold corresponding to the association relationship determined by the current training includes:

[0085] Determine a second difference between a distance threshold corresponding to the association relationship determined in the current training and the first difference;

[0086] Based on the second difference, a loss value is determined.

[0087] In the present application, when determining the loss value, firstly, for any two first targets with an associated relationship in the target family sample set, the first identification information corresponding to the first intermediate state vectors corresponding to the first targets with an associated relationship is obtained, and the second distance between the second intermediate state vector corresponding to the associated relationship and the preset standard vector is obtained, and then the first difference is determined based on the difference between the first distance and the second distance, and the distance threshold corresponding to the associated relationship determined by the current training is obtained, and the second difference between the distance threshold and the first difference is determined. Finally, the sub-loss value is determined based on each second difference. Then the loss value is determined based on the sum of each sub-loss value.

[0088] Based on this, in this embodiment, the method for determining the loss value can be determined by the following formula:

[0089]

[0090] in is the first distance between the first intermediate state vector h′ corresponding to the first target h having the association relationship r and the first intermediate state vector t′ corresponding to the first target t, is the second distance between the second intermediate state vector r′ corresponding to the association relationship r and the preset standard vector, s(h, r, t) is the distance threshold corresponding to the association relationship r determined last time, η is an adjustment parameter, and its value can also be adjusted when training each second intermediate state vector and each first intermediate state vector, Trip is each second intermediate state vector and each first intermediate state vector determined in the current training.

[0091] In order to further ensure the security of the data stored in the family knowledge graph, based on the above embodiment, in the present application, before saving the correspondence between the first vector and the attribute information of the first target in the target family sample set, the method further includes:

[0092] If the attribute type corresponding to any sub-attribute information included in the attribute information of the first target matches any preset privacy attribute type, then obtain the value interval corresponding to the preset matching privacy attribute type, determine the target interval identification information corresponding to the target value interval where the sub-attribute information is located, and update the sub-attribute information according to the target interval identification information.

[0093] In actual application scenarios, the attribute information corresponding to the first target in the pre-collected target family sample set includes sub-attribute information that may be private attribute information, such as age, income, etc., and in general, sub-attribute information that is private attribute information has higher requirements for the privacy security of the family knowledge graph than sub-attribute information of other non-privacy attribute information. Therefore, in order to further ensure the security of sub-attribute information that is private attribute information stored in the family knowledge graph, in this application, the attribute type corresponding to each type of private attribute information is used as a private attribute type, and for each type of private attribute, each value interval corresponding to the private attribute type and the interval identification information corresponding to each value interval are set, so that the sub-attribute information of the private attribute information can be represented as the sub-attribute information of the private attribute information through the interval identification information in the future, thereby blurring the specific content of the sub-attribute information.

[0094] In the specific implementation process, for each sub-attribute information included in the attribute information corresponding to each first target, first determine whether the attribute type corresponding to the sub-attribute information matches any preset privacy attribute type. If it matches, it means that the sub-attribute information is privacy attribute information, then obtain each value interval corresponding to the preset matching privacy attribute type and its corresponding interval identification information. Then determine the target interval identification information corresponding to the target value interval where the sub-attribute information is located, and directly determine the target interval identification information as the sub-attribute information, that is, update the sub-attribute information according to the target interval identification information.

[0095] For example, the attribute information corresponding to the first target A includes sub-attribute information of age 28, height 168, weight 50, and income 5000, and the privacy attribute types include age and income. Then, age 28 is determined to be the privacy attribute information, and each value interval corresponding to the preset age is obtained. It is determined that age 28 is within the target value interval of [18,35]. Then, the target interval identification information corresponding to the target value interval of [18,35] is determined to be P21, and the target interval identification information P21 is determined as the age corresponding to the first target A.

[0096] After the sub-attribute information of the privacy attribute information included in the attribute information corresponding to each first target after training is updated based on the above-mentioned embodiment, the subsequent steps of saving the attribute information of each first vector and its corresponding first target in the target family sample set are performed.

[0097] Among them, when saving the attribute information of the first target in each vector and its corresponding target family sample set, for each first identification information, each sub-attribute information corresponding to the first identification information can be saved in correspondence with the first identification information, so that after the corresponding vector can be obtained through the identification information corresponding to the target, the attribute information of the first target corresponding to the vector can be determined.

[0098] During the process of the queried data being sent to the server by the electronic device that subsequently queries the family knowledge graph, the queried data may be stolen. After parsing the queried data, the thief directly obtains each vector carried in the data and each sub-attribute information corresponding to it, thereby deciphering each sub-attribute information corresponding to the target corresponding to the vector by cracking the meaning of the vector. Therefore, in order to further improve the security of the data stored in the family knowledge graph, in the present application, when saving the trained first vector and its corresponding attribute information, the sub-attribute information and each corresponding first vector can be saved for each sub-attribute information, to prevent subsequent thieves from stealing the queried data and directly deciphering each sub-attribute information corresponding to the vector by cracking the meaning represented by the vector.

[0099] For the convenience of description, Table 1 is a correspondence relationship between each sub-attribute information and each first vector corresponding thereto, determined for each sub-attribute information, provided in some embodiments of the present application.

[0100] <![CDATA[P 21 ]]> <![CDATA[P 22 ]]> <![CDATA[P 23 ]]> <![CDATA[P 11 ]]> <![CDATA[X C ]]> 0 0 <![CDATA[P 12 ]]> 0 0 <![CDATA[X A 、X B ]]> <![CDATA[P 13 ]]> 0 <![CDATA[X 甲 ]]> 0

[0101] Table 1

[0102] Among them, the value 0 in the above table means that there is no actual corresponding first vector, which is a null value.11 , P 12 , P 13 , P 21 , P 22 , P 23 All are sub-attribute information updated as interval identification information, X 甲 , X A , X B , X C These are the first vectors after training.

[0103] It should be noted that, in order to facilitate subsequent queries, when establishing a correspondence between each trained first vector and its corresponding attribute information, the correspondence may be mapped into a data table format.

[0104] In order to further prevent the information stored in the family knowledge graph from being interpreted by stealing the queried data sent to the server by the electronic device that queries the family knowledge graph, based on the above embodiment, in this application, the corresponding relationship between the first vector and the attribute information of the first target in the target family sample set is saved, including:

[0105] Obtaining the index value corresponding to the first vector;

[0106] Determine the encryption information corresponding to the index value according to a preset encryption algorithm;

[0107] The correspondence between the encrypted information and the attribute information of the first target in the target family sample set is saved.

[0108] In order to prevent the first vector from being interpreted by thieves, thereby affecting the privacy security of the data stored in the family knowledge graph, in this application, an encryption algorithm is preset, such as the RSA encryption algorithm, the AES encryption algorithm, etc., and the index value corresponding to each first vector is determined, so that the index value corresponding to each first vector can be encrypted separately according to the preset encryption algorithm.

[0109] The index value may be a number, a letter, or other forms, as long as it can uniquely identify the first vector.

[0110] Specifically, after the first vector corresponding to each first target is obtained based on the above embodiment, the index value corresponding to each first vector is obtained, and then the encrypted information corresponding to each index value is obtained according to the preset encryption algorithm. After the encrypted information corresponding to each index value is determined, the corresponding relationship between each encrypted information and the attribute information of the first target in the target family sample set corresponding to each encrypted information is saved.

[0111] Based on the description of the above embodiment, it can be known that when saving the corresponding relationship between each encrypted information and the attribute information of the first target in the target family sample set respectively corresponding to it, for each encrypted information, each sub-attribute information corresponding to the encrypted information can be saved correspondingly with the encrypted information. Of course, in order to further improve the security of the data stored in the family knowledge graph, for each sub-attribute information, the sub-attribute information and each corresponding encrypted information can be saved correspondingly.

[0112] In order to further ensure the security of the data stored in the family knowledge graph, in this application, the method also includes:

[0113] Interference encryption information and its corresponding attribute information are randomly generated and saved accordingly.

[0114] In order to confuse the real attribute information stored in the family knowledge graph, interference data can also be added to the correspondence between the saved encrypted information and the attribute information, that is, the randomly generated interference encrypted information and its corresponding attribute information are also saved accordingly.

[0115] The interference encryption information may be generated according to the timestamp of generating the interference encryption information and a preset encryption algorithm, or may be generated according to other methods. The method of generating the interference encryption information is not specifically limited here, as long as the generated interference encryption information is not consistent with any encryption information, and the length of the interference encryption information is consistent with the length of the encryption information. The privacy attribute information corresponding to the interference encryption information may be determined according to any interval identification information in each interval identification information corresponding to at least one privacy attribute type, or may be determined according to the attribute information corresponding to each first target, which is not specifically limited here either.

[0116] In a possible implementation, when adding interference data, for each value interval corresponding to each privacy attribute type, if it is determined that the value interval does not have corresponding first identification information, the interval identification information corresponding to the value interval is used as the sub-attribute information corresponding to the interference encryption information. For example, the interference encryption information is added to the position where 0 is located in the above Table 1, and each interval identification information corresponding to the position is determined as each sub-attribute information corresponding to the interference encryption information.

[0117] For example, the preset privacy attribute types include age and income. The first vectors in the target family sample set are a 甲 、a A 、a B 、a C , the attribute information corresponding to each first vector includes sub-attribute information of age, height, weight, and income. For specific index values ​​corresponding to each first vector and sub-attribute information included in the corresponding attribute information, see Table 2 below:

[0118] First Vector Index value age height weight income <![CDATA[a 甲 ]]> 1 66 175 75 6000 <![CDATA[a A ]]> 2 30 178 80 10000 <![CDATA[a B ]]> 3 28 165 60 9500 <![CDATA[a C ]]> 4 3 97 15 0

[0119] Table 2

[0120] For the privacy attribute type age, according to each preset interval corresponding to the age, the attribute information corresponding to each first vector is divided into value intervals for the sub-attribute information of age, and the target interval identification information corresponding to the target value interval where the age 66 is located is determined as P 13 , the target interval identification information corresponding to the target value interval of age 30 is P 12 , the target interval identification information corresponding to the target value interval where age 28 is located is also P 12 , the target interval identification information corresponding to the target value interval of age 3 is P 11 .

[0121] For the privacy attribute type income, according to each preset interval corresponding to the income, the attribute information corresponding to each first vector is divided into value intervals, and the target interval identification information corresponding to the target value interval where the income is 6000 is determined as P 22 , determine that the target interval identification information corresponding to the target value interval of income 10000 is P 23 , determine that the target interval identification information corresponding to the target value interval where the income is 9500 is also P 23 , determine the target interval identification information corresponding to the target value interval where income 0 is located as P 21 .

[0122] According to the identification information of each target interval determined above, it can be converted into the attribute-index table shown in Table 3:

[0123] <![CDATA[P 21 ]]> <![CDATA[P 22 ]]> <![CDATA[P 23 ]]> <![CDATA[P 11 ]]> 4 0 0 <![CDATA[P 12 ]]> 0 0 2,3 <![CDATA[P 13 ]]> 0 1 0

[0124] Table 3

[0125] For each non-zero index value in the attribute table, the encryption information corresponding to the index value is obtained according to a preset encryption algorithm, and the index value is updated with the generated encryption information.

[0126] In order to further ensure the security of the data stored in the family knowledge graph, for each index value of 0 in the above attribute-index table, the interference encryption information is determined according to the timestamp when the interference encryption information is generated and the preset algorithm, and the generated interference encryption information is used to update the index value of 0.

[0127] Table 4 is the attribute-encryption information table obtained by encrypting each index value:

[0128]

[0129]

[0130] Table 4

[0131] After encrypting each index value, the attribute-encryption information table is saved. In order to facilitate the subsequent query of the attribute information corresponding to each first vector in the family knowledge graph, each sub-attribute information corresponding to each encrypted information is saved according to the attribute-encryption information table. For example, {c408008caf765890838d04a1512a66ee854c0203:[P 11 ,P 21 ]}.

[0132] Figure 2 A specific flow chart for generating a family knowledge graph is provided for some embodiments of the present application, and the flow includes:

[0133] S201: Obtain first identification information corresponding to any two first targets that have an associated relationship in the target family sample set, second identification information of the associated relationship, and attribute information corresponding to each first target.

[0134] S202: Randomly generate a second intermediate state vector corresponding to the second identification information and a first intermediate state vector corresponding to each first identification information.

[0135] Since there are generally a large number of first targets with associated relationships in the target family sample set, the above operation is performed on any two first targets with associated relationships in the target family sample set to obtain the randomly generated first intermediate state vector corresponding to each first target and the second intermediate state vector corresponding to each associated relationship.

[0136] S203: For any two first intermediate state vectors that have an associated relationship determined in the current training, determine the sub-loss value based on the first difference between the distance between the two first intermediate state vectors and the distance between the corresponding second intermediate state vector and the preset standard vector, and the distance threshold corresponding to the associated relationship determined in the current training.

[0137] S204: Determine whether the loss value determined according to each sub-loss value meets the preset convergence condition. If so, execute S205; otherwise, execute S203.

[0138] S205: Determine the second intermediate state vector determined by the current training as the second vector, and determine the first intermediate state vector determined by the current training as the first vector. For each sub-attribute information included in the attribute information corresponding to each first target, if the attribute type corresponding to the sub-attribute information matches any preset privacy attribute type, obtain each value interval corresponding to the preset matching privacy attribute type, determine the target interval identification information corresponding to the target value interval where the sub-attribute information is located, and update the sub-attribute information according to the target interval identification information.

[0139] S206: Obtain the index value corresponding to each first vector, and determine the encryption information corresponding to each index value according to a preset encryption algorithm.

[0140] S207: For each sub-attribute information, determine the encryption information corresponding to each first vector corresponding to the sub-attribute information according to the sub-attribute information corresponding to each first vector, and save the corresponding relationship between the sub-attribute information and each corresponding encryption information.

[0141] S208: Save the corresponding relationship between the association relationship and the second identification information, and the corresponding relationship between the first identification information, the first vector, the second identification information, and the second vector.

[0142] The present application also provides a data processing method. Figure 3 A data processing flow diagram provided for some embodiments of the present application includes:

[0143] S301: Determine a third vector corresponding to the third identification information and a fourth vector corresponding to the target association relationship based on the third identification information corresponding to the second target carried in the acquired data query request, the target association relationship, and the stored family knowledge graph of the target family.

[0144] S302: Obtain a fifth vector from the saved vectors, the distance between which and the third vector is equal to the distance between the fourth vector and the preset standard vector.

[0145] S303: Send the third vector, the fifth vector and their corresponding target attribute information.

[0146] The data processing method provided in this application is applied to an electronic device for querying a family knowledge graph, and the electronic device may be a smart device or a server. For example, the smart device may be a smart brain, a smart housekeeper server, or other devices.

[0147] In actual application, when the user wants to provide corresponding services through the client in the home, such as turning on the air conditioner in the bedroom, recommending dinner content plans, etc., the request statement can be input through the client such as smart speakers and smart TVs. After receiving the request statement input by the user, the client can directly process the request statement locally to obtain the target association relationship and the type of service requested, and then generate a service request based on the third identification information of the second target, the target association relationship and the type of service requested, and send it to the server. The client can also directly generate a service request based on the third identification information of the second target and the request statement input by the user and send it to the server.

[0148] Among them, the client can obtain the third identification information corresponding to the second target through the user's voiceprint features, or obtain the third identification information corresponding to the second target by performing face recognition on the user. Of course, the device identification information of the client can also be used as the third identification information corresponding to the second target. Specifically, the method for obtaining the third identification information corresponding to the second target belongs to the prior art and will not be described in detail here.

[0149] The server processes the service request sent by the client accordingly, obtains the type of requested service, the third identification information of the second target and the target association relationship, and then initiates a data query request to the electronic device that queries the family knowledge graph. The data query request contains the third identification information of the second target and the target association relationship.

[0150] After the electronic device querying the family knowledge graph obtains the data query request sent by the server, the data query request is parsed to obtain the third identification information and target association relationship of the second target carried in the data query request. Since the data query request may carry multiple target association relationships, for each target association relationship, the following steps are performed to determine the third target that has a target association relationship with the second target:

[0151] According to the saved family knowledge graph, first determine the identification information corresponding to the target association relationship, then determine the third vector corresponding to the third identification information, and the fourth vector corresponding to the identification information corresponding to the target association relationship. Determine the distance between the fourth vector and the preset standard vector (for the convenience of description, the third distance). Then determine the vector whose distance from the third vector is equal to the third distance in the saved vectors (for the convenience of description, the fifth vector), and the target corresponding to the fifth vector is the third target that has a target association relationship with the second target.

[0152] After determining the fifth vector, according to the corresponding relationship between the saved vectors and the attribute information, obtain the target attribute information corresponding to the third vector and the fifth vector respectively. Send the third vector, the fifth vector, and their respective target attribute information to the server so that the server can perform corresponding processing based on the obtained data.

[0153] Among them, the electronic device for querying the family knowledge graph can be the same as or different from the above-mentioned electronic device for generating the family knowledge graph. When the electronic device for querying the family knowledge graph is different from the above-mentioned electronic device for generating the family knowledge graph, after the above-mentioned electronic device for generating the family knowledge graph generates the family knowledge graph of the target family based on the above embodiments, it can send the family knowledge graph of the target family and a preset encryption algorithm to the electronic device for querying the family knowledge graph, so that the electronic device for querying the family knowledge graph can query data based on the data processing method provided in this application.

[0154] In this application, in order to facilitate the server to extract the identification information corresponding to each target and its respective corresponding attribute information based on the data sent by the electronic device for querying the family knowledge graph, when the electronic device for querying the family knowledge graph determines to generate the family knowledge graph of the target family, it will send the corresponding relationship between the saved vectors and the identification information, that is, the corresponding relationship between each first identification information and the first vector, to the server. Subsequently, after the server obtains the third vector, the fifth vector, and their respective target attribute information sent by the electronic device for querying the family knowledge graph, according to the pre-saved corresponding relationship between the vectors and the identification information, it can determine the target identification information corresponding to the obtained third vector and fifth vector respectively. Then, perform corresponding processing on each target identification information and its respective corresponding target attribute information, generate a processing result, and send it to the client.

[0155] Among them, the process of the server processing each target identification information and its respective corresponding target attribute information belongs to the prior art and will not be elaborated here.

[0156] The client receives the processing result sent by the server and provides services to the user based on the processing result.

[0157] For example, assume that the service scenario is that user A's father, "Jia", comes to visit the children today, so user A发起 a service request for tonight's family dinner to the client, so that the server calculates tonight's dinner content, after-dinner entertainment activities, and generates a plan and relevant reminders and sends them to user A. In this scenario, the electronic device for querying the family knowledge graph queries the third identification information "Jia" corresponding to the second target and the target association relationships of'mother-child' and 'father-son' carried in the data query request sent by the server, then through the following method, loop calculate for each target association relationship to determine the third target that has this target association relationship with the second target.

[0158] Determine FamilyList = ['parent - child', 'father - son',...] according to each target association relationship;

[0159] For fl in FamilyList:

[0160] Res1 = g.V().has('id', 'A').both(fl);

[0161] Res2 = g.V().has('id', 'A').both(fl).both(fl);

[0162] Obtain the second target of this dinner and each third target Res1 ∪ Res2, that is, UserList = ['A', 'B', 'C', 'D'].

[0163] When each third target is obtained, the target attribute information corresponding to the second target and each third target can be calculated cyclically through the following method.

[0164] For user in UserList:

[0165] g.V().has('id', user).property('favorite food');

[0166] Obtain the favorite foods UserFood = ['potato', 'cauliflower', 'corn'] corresponding to the second target and each third target of this dinner.

[0167] The identification information corresponding to the second target and each third target obtained and their respective favorite foods can be output in list form.

[0168] In some possible implementation manners, obtaining the target attribute information corresponding to the third vector and the fifth vector respectively includes:

[0169] According to the pre - saved correspondence between the vector and the index value, obtain the target index values corresponding to the third vector and the fifth vector respectively;

[0170] According to the preset encryption algorithm, obtain the target encryption information corresponding to each of the target index values;

[0171] Determine the target attribute information corresponding to each of the target encryption information respectively.

[0172] It should be noted that in the translation, some content in the original text may need to be adjusted according to the actual context to ensure the accuracy and rationality of the translation. For example, in the Chinese text, there may be some unclear or inaccurate expressions, and the translation is adjusted as much as possible to make the English text more understandable. Also, the variable names like '甲' are assumed to be replaced with more meaningful names like 'A' in the translation for better readability. If there are specific requirements for these variable names, please let me know and I will make corresponding adjustments.In order to prevent the electronic device that queries the family knowledge graph from being stolen during the process of sending the queried data to the server, so that the thief can interpret the queried data, in the present application, the attribute information corresponding to each vector is saved corresponding to the corresponding encryption information. Specifically, the electronic device that queries the family knowledge graph determines the target index values ​​corresponding to the third vector and the fifth vector respectively according to the correspondence between the pre-saved vectors and the index values. Then, according to the preset encryption algorithm, the target encryption information corresponding to each target index value is obtained. Finally, according to the correspondence between the pre-saved encryption information and the attribute information, the target attribute information corresponding to each target encryption information is determined respectively, and the target encryption information corresponding to the third vector, the target encryption information corresponding to the fifth vector and their corresponding target attribute information are sent to the server.

[0173] In a possible implementation, in order to obfuscate the real data being sent, when the third vector, the fifth vector, and the target attribute information corresponding to each target encrypted information are sent to the server, the interference encrypted information and its corresponding attribute information are also sent to the server. Specifically, the method further includes:

[0174] Send interference encryption information and its corresponding attribute information.

[0175] Since the length of the interfered encrypted information is the same as that of the real encrypted information, the thief will not be able to determine which encrypted information in the stolen data is real and which encrypted information is interfered with based on the stolen data, thereby increasing the cost required for the thief to try to decrypt the encrypted information and making it impossible for the thief to determine which sub-attribute information is real based on the decrypted information.

[0176] On the basis of the above embodiment, in order to facilitate the subsequent server to decrypt the data sent by the electronic device that queries the knowledge graph and determine the attribute information corresponding to each target, in this application, after the electronic device that queries the family knowledge graph determines to generate the family knowledge graph of the target family, it also sends the corresponding relationship between the saved vector and the index value, that is, the corresponding relationship between each first vector and the index value, to the server, and agrees on a preset decryption algorithm. After the server obtains the target encryption information corresponding to the third vector sent by the electronic device that queries the family knowledge graph, the target encryption information corresponding to the fifth vector and the target attribute information corresponding to each vector, according to the preset decryption algorithm, the target index value corresponding to each target encryption information is obtained respectively. Then, according to the correspondence between the pre-saved vector and the index value, the target vector corresponding to each target index value is obtained respectively. Finally, according to the correspondence between the pre-saved vector and the identification information, the identification information corresponding to each target vector is determined, so as to facilitate the subsequent corresponding processing of each target identification information and its corresponding target attribute information, generate the processing result and send it to the client.

[0177] Among them, the attribute information corresponding to the third vector and the fifth vector obtained by the server includes the sub-attribute information of the privacy attribute information, which may be interval identification information. In order to facilitate the determination of the attribute information corresponding to each target, in this application, after the electronic device that queries the family knowledge graph determines to generate the family knowledge graph of the target family, it also sends the corresponding relationship between the preset value interval and the interval identification information to the server. When the server subsequently determines the target attribute information corresponding to each target identification information, for each sub-attribute information included in the target attribute information corresponding to each target identification information, if it is determined that the sub-attribute information is interval identification information, it means that the sub-attribute information may be privacy attribute information. Then, according to the correspondence between the pre-saved value interval and the interval identification information, the privacy attribute type to which the sub-attribute information of the interval identification information belongs and its corresponding target value interval are determined, and the target value interval is directly used as the sub-attribute information.

[0178] After each sub-attribute information of the interval identification information is updated, the server can determine the target attribute information corresponding to each target identification information, so as to perform subsequent processing.

[0179] Figure 4 A structural diagram of the existing family knowledge graph provided for some embodiments of the present application, as shown in the figure, is very likely to be deciphered by a thief. Based on the content displayed in the figure, it can be interpreted that target A and target C are in a parent-child relationship, and target A and target A are also in a parent-child relationship, etc., and the attribute information corresponding to each target can be obtained, thereby making it impossible to guarantee the privacy security of the data stored in the family knowledge graph.

[0180] Figure 5 A schematic diagram of a specific data processing flow provided for some embodiments of the present application, the flow includes:

[0181] If a request statement input by the user is received, the client generates a service request and sends it to the server.

[0182] The server processes the service request sent by the client accordingly, obtains the type of requested service, the third identification information of the second target and the target association relationship, and then initiates a data query request to the electronic device that queries the family knowledge graph. The data query request contains the third identification information of the second target and the target association relationship.

[0183] After the electronic device querying the family knowledge graph obtains the data query request sent by the server, the data query request is parsed to obtain the third identification information of the second target and the target association relationship carried in the data query request. According to the stored family knowledge graph, the third vector corresponding to the third identification information and the fourth vector corresponding to the target association relationship are determined; and the fifth vector whose distance from the third vector is equal to the distance between the fourth vector and the preset standard vector is obtained from the stored vectors.

[0184] The electronic device that queries the family knowledge graph determines the target index values ​​corresponding to the third vector and the fifth vector respectively according to the correspondence between the vector and the index value stored in advance. Then, according to the preset encryption algorithm, the target encryption information corresponding to each target index value is obtained. Finally, according to the correspondence between the encryption information and the attribute information, the target attribute information corresponding to each target encryption information is determined, and the target encryption information corresponding to the third vector and the fifth vector respectively, and the target attribute information corresponding to each target encryption information are sent to the server.

[0185] Among them, in order to further improve the security of data stored in the family knowledge graph in the above embodiment, when each target encrypted information and its corresponding attribute information are sent, part or all of the interference encrypted information and its corresponding attribute information are also sent to the server to confuse each target encrypted information and its corresponding attribute information.

[0186] After receiving the target attribute information corresponding to each target encrypted information sent by the electronic device that queries the family knowledge graph, the server obtains the target index value corresponding to each target encrypted information according to the preset decryption algorithm, determines the target vector corresponding to each target index value according to the correspondence between the pre-saved vector and the index value, and then determines the target identification information corresponding to each target vector according to the correspondence between the pre-saved vector and the identification information, thereby determining the target attribute information corresponding to each target identification information. Among them, for each sub-attribute information corresponding to each target identification information, if it is determined that the sub-attribute information is interval identification information, the target value interval corresponding to the interval identification information is determined according to the correspondence between the pre-saved value interval and the interval identification information, and the sub-attribute information is updated according to the target value interval. After each sub-attribute information that is interval identification information is updated, the server performs subsequent processing on each determined target identification information and its corresponding target attribute information.

[0187] The server feeds back the encapsulated processing results to the client.

[0188] Since the targets and their corresponding associations in the present application are represented as vectors in the stored family knowledge graph of the target family, the associations between the targets corresponding to the vectors are represented by the distance between the vectors, and the vectors are determined based on the targets in the target family and the associations corresponding to the targets. The vectors are unpredictable. Even if the data output by the electronic device that queries the family knowledge graph is subsequently stolen, the thief cannot know the first target in the target family and thus cannot interpret the meaning of the vector in the stolen data, nor can he determine the first target to which the stolen attribute information belongs, thereby improving the privacy security of the data stored in the family knowledge graph.

[0189] The present application also provides a data processing method. Figure 6 A schematic diagram of another data processing flow provided for some embodiments of the present application, the flow includes:

[0190] S601: Based on the obtained service request, generate and send a data query request carrying the third identification information corresponding to the second target and the target association relationship.

[0191] S602: Obtain the third vector, the fifth vector and their corresponding target attribute information.

[0192] S603: Determine the target identification information corresponding to the third vector and the fifth vector respectively according to the pre-stored correspondence between the vector and the identification information.

[0193] S604: Perform corresponding processing according to the target identification information and the target attribute information corresponding thereto, generate a processing result and send it.

[0194] In some embodiments, obtaining the third vector, the fifth vector and their corresponding target attribute information includes:

[0195] Obtain target encryption information corresponding to the third vector and the fifth vector, and target attribute information corresponding to them; wherein the target encryption information corresponding to any vector is determined according to a preset encryption algorithm and an index value corresponding to the vector;

[0196] The determining, according to the pre-stored correspondence between the vector and the identification information, the target identification information corresponding to the third vector and the fifth vector respectively includes:

[0197] According to a preset decryption algorithm, respectively obtain the target index values ​​corresponding to the target encrypted information;

[0198] According to the correspondence between the pre-saved vector and the index value, obtaining the target vector corresponding to the target index value;

[0199] The target identification information respectively corresponding to the target vectors is determined according to the pre-stored correspondence between the vectors and the identification information.

[0200] In some implementations, determining the target attribute information corresponding to the target identification information includes:

[0201] If the sub-attribute information included in the target attribute information corresponding to the target identification information is interval identification information, the target value interval corresponding to the interval identification information is determined according to the pre-saved correspondence between the value interval and the interval identification information, and the sub-attribute information is updated according to the target value interval.

[0202] It should be noted that the data processing method provided in this application is mainly applied to electronic devices, which may be servers or other electronic devices with complex processing capabilities. The specific implementation process has been described in the above embodiments and will not be repeated here.

[0203] This application also provides a device for generating a family knowledge graph. Figure 7 A schematic diagram of a structure of a device for generating a family knowledge graph provided in some embodiments of the present application, the device comprising:

[0204] A training unit 71 is used to train a first intermediate state vector of a first identification information corresponding to a first target in a target family sample set, and a second intermediate state vector of a second identification information of an association relationship corresponding to the first target, until a loss value determined based on a first difference between a distance between two first intermediate state vectors having the association relationship and a distance between a second intermediate state vector corresponding to the association relationship and a preset standard vector, and a distance threshold corresponding to the association relationship determined by current training satisfies a preset convergence condition, and the first intermediate state vector is determined as a first vector, and the second intermediate state vector is determined as a second vector;

[0205] The storage unit 72 is used to save the correspondence between the association relationship and the second identification information, as well as the correspondence between the first identification information, the first vector, the second identification information and the second vector, and save the correspondence between the first vector and the attribute information of the first target in the target family sample set.

[0206] Since the principle of solving the problem by the above-mentioned device for generating the family knowledge graph is similar to the method for generating the family knowledge graph, the repeated parts will not be repeated.

[0207] The present application also provides a data processing device, Figure 8 A schematic diagram of a data processing device structure provided in some embodiments of the present application, the device comprising:

[0208] A determination module 81 is used to determine a third vector corresponding to the third identification information and a fourth vector corresponding to the target association relationship according to the third identification information corresponding to the second target carried in the acquired data query request, the target association relationship, and the stored family knowledge graph of the target family;

[0209] An acquisition module 82, configured to acquire, from the stored vectors, a fifth vector whose distance from the third vector is equal to the distance between the fourth vector and the preset standard vector;

[0210] The sending module 83 is used to send the third vector, the fifth vector and their corresponding target attribute information.

[0211] Since the principle of solving the problem by the data processing device provided above is similar to the data processing method of the electronic device used for querying the knowledge graph, the repeated parts will not be repeated.

[0212] The present application also provides a data processing device, Fig. 9 A schematic diagram of the structure of another data processing device provided in some embodiments of the present application, the device comprising:

[0213] A sending unit, configured to generate and send a data query request carrying third identification information corresponding to the second target and a target association relationship based on the acquired service request;

[0214] An acquisition unit 91 is used to acquire the third vector, the fifth vector and target attribute information corresponding to them;

[0215] A determination unit 92, configured to determine the target identification information corresponding to the third vector and the fifth vector respectively according to a pre-stored correspondence relationship between the vector and the identification information;

[0216] The processing unit 93 is used to perform corresponding processing according to the target identification information and the target attribute information corresponding thereto, and generate a processing result;

[0217] The sending unit 91 is further configured to send the processing result.

[0218] Since the principle of solving the problem by the data processing device provided above is similar to the data processing method applied to the server, the repeated parts will not be repeated.

[0219] like Fig.10 This is a schematic diagram of an electronic device structure provided by some embodiments of the present application. Based on the above embodiments, the present application also provides an electronic device, such as Fig.10As shown, it includes: a processor 1001, a communication interface 1002, a memory 1003 and a communication bus 1004, wherein the processor 1001, the communication interface 1002, and the memory 1003 communicate with each other through the communication bus 1004;

[0220] The memory 1003 stores a computer program. When the program is executed by the processor 1001, the processor 1001 performs the following steps:

[0221] The first intermediate state vector of the first identification information corresponding to the first target in the target family sample set is trained, and the second intermediate state vector of the second identification information of the association relationship corresponding to the first target is trained, until the loss value determined according to the first difference between the distance between the two first intermediate state vectors with the association relationship and the distance between the second intermediate state vector corresponding to the association relationship and the preset standard vector, and the distance threshold corresponding to the association relationship determined by the current training satisfies the preset convergence condition, the first intermediate state vector is determined as the first vector, and the second intermediate state vector is determined as the second vector;

[0222] Save the correspondence between the association relationship and the second identification information, as well as the correspondence between the first identification information, the first vector, the second identification information and the second vector, and save the correspondence between the first vector and the attribute information of the first target in the target family sample set.

[0223] Since the principle of solving the problem by the above-mentioned electronic device is similar to the method of generating the family knowledge graph, the implementation of the above-mentioned electronic device can refer to the implementation of the method, and the repeated parts will not be repeated.

[0224] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0225] The communication interface 1002 is used for communication between the above electronic device and other devices.

[0226] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0227] The above-mentioned processor can be a general-purpose processor, including a central processing unit, a network processor (Network Processor, NP), etc.; it can also be a digital signal processing processor (Digital Signal Processing, DSP), an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, etc.

[0228] like Fig.11 This is a schematic diagram of an electronic device structure provided by some embodiments of the present application. Based on the above embodiments, the present application also provides an electronic device, such as Fig.11 As shown, it includes: a processor 1101, a communication interface 1102, a memory 1103 and a communication bus 1104, wherein the processor 1101, the communication interface 1102, and the memory 1103 communicate with each other through the communication bus 1104;

[0229] The memory 1103 stores a computer program. When the program is executed by the processor 1101, the processor 1101 performs the following steps:

[0230] Determine, according to the third identification information corresponding to the second target carried in the acquired data query request, the target association relationship, and the stored family knowledge graph of the target family, a third vector corresponding to the third identification information and a fourth vector corresponding to the target association relationship;

[0231] Acquire a fifth vector from the saved vectors, the distance between the fifth vector and the third vector being equal to the distance between the fourth vector and the preset standard vector;

[0232] The third vector, the fifth vector and their corresponding target attribute information are sent.

[0233] Since the principle of solving the problem by the above electronic device is similar to the data processing method, the implementation of the above electronic device can refer to the implementation of the method, and the repeated parts will not be repeated.

[0234] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0235] The communication interface 1102 is used for communication between the above electronic device and other devices.

[0236] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0237] The above-mentioned processor can be a general-purpose processor, including a central processing unit, a network processor (Network Processor, NP), etc.; it can also be a digital signal processing processor (Digital Signal Processing, DSP), an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, etc.

[0238] like Fig.12 This is a schematic diagram of an electronic device structure provided by some embodiments of the present application. Based on the above embodiments, the present application also provides an electronic device, such as Fig.12 As shown, it includes: a processor 1201, a communication interface 1202, a memory 1203 and a communication bus 1204, wherein the processor 1201, the communication interface 1202, and the memory 1203 communicate with each other through the communication bus 1204;

[0239] The memory 1203 stores a computer program. When the program is executed by the processor 1201, the processor 1201 performs the following steps:

[0240] Based on the obtained service request, generate and send a data query request carrying the third identification information corresponding to the second target and the target association relationship;

[0241] Obtaining the third vector, the fifth vector and their corresponding target attribute information;

[0242] Determining the target identification information corresponding to the third vector and the fifth vector respectively according to the pre-stored correspondence between the vector and the identification information;

[0243] According to the target identification information and the target attribute information corresponding thereto, corresponding processing is performed, and the processing result is generated and sent.

[0244] Since the principle of solving the problem by the above electronic device is similar to the data processing method, the implementation of the above electronic device can refer to the implementation of the method, and the repeated parts will not be repeated.

[0245] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0246] The communication interface 1202 is used for communication between the above electronic device and other devices.

[0247] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0248] The above-mentioned processor can be a general-purpose processor, including a central processing unit, a network processor (Network Processor, NP), etc.; it can also be a digital signal processing processor (Digital Signal Processing, DSP), an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, etc.

[0249] On the basis of the above embodiments, the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program executable by a processor, and when the program runs on the processor, the processor implements the following steps when executing:

[0250] The first intermediate state vector of the first identification information corresponding to the first target in the target family sample set is trained, and the second intermediate state vector of the second identification information of the association relationship corresponding to the first target is trained, until the loss value determined according to the first difference between the distance between the two first intermediate state vectors with the association relationship and the distance between the second intermediate state vector corresponding to the association relationship and the preset standard vector, and the distance threshold corresponding to the association relationship determined by the current training satisfies the preset convergence condition, the first intermediate state vector is determined as the first vector, and the second intermediate state vector is determined as the second vector;

[0251] Save the correspondence between the association relationship and the second identification information, as well as the correspondence between the first identification information, the first vector, the second identification information and the second vector, and save the correspondence between the first vector and the attribute information of the first target in the target family sample set.

[0252] Since the principle of solving the problem provided by the computer-readable medium is similar to the method for generating a family knowledge graph, after the processor executes the computer program in the computer-readable medium, the implemented steps can be referred to the implementation of the method, and the repeated parts will not be repeated.

[0253] On the basis of the above embodiments, the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program executable by a processor, and when the program runs on the processor, the processor implements the following steps when executing:

[0254] Determine, according to the third identification information corresponding to the second target carried in the acquired data query request, the target association relationship, and the stored family knowledge graph of the target family, a third vector corresponding to the third identification information and a fourth vector corresponding to the target association relationship;

[0255] Acquire a fifth vector from the saved vectors, the distance between the fifth vector and the third vector being equal to the distance between the fourth vector and the preset standard vector;

[0256] The third vector, the fifth vector and their corresponding target attribute information are sent.

[0257] Since the principle of solving the problem provided by the computer-readable medium is similar to the data processing method of the electronic device used to query the knowledge graph, after the processor executes the computer program in the above-mentioned computer-readable medium, the implemented steps can be referred to the implementation of the method, and the repeated parts will not be repeated.

[0258] On the basis of the above embodiments, the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program executable by a processor, and when the program runs on the processor, the processor implements the following steps when executing:

[0259] Based on the obtained service request, generate and send a data query request carrying the third identification information corresponding to the second target and the target association relationship;

[0260] Obtaining the third vector, the fifth vector and their corresponding target attribute information;

[0261] Determining the target identification information corresponding to the third vector and the fifth vector respectively according to the pre-stored correspondence between the vector and the identification information;

[0262] According to the target identification information and the target attribute information corresponding thereto, corresponding processing is performed, and the processing result is generated and sent.

[0263] Since the principle of solving the problem provided by the computer-readable medium is similar to the data processing method applied to the server, after the processor executes the computer program in the computer-readable medium, the implemented steps can be referred to the implementation of the method, and the repeated parts will not be repeated.

[0264] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0265] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0266] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0267] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0268] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A method for generating a family knowledge graph, characterized in that: The method comprises: The first intermediate state vector of the first identification information corresponding to the first target in the target family sample set is trained, and the second intermediate state vector of the second identification information of the association relationship corresponding to the first target is trained, until the loss value determined according to the first difference between the distance between the two first intermediate state vectors with the association relationship and the distance between the second intermediate state vector corresponding to the association relationship and the preset standard vector, and the distance threshold corresponding to the association relationship determined by the current training satisfies the preset convergence condition, the first intermediate state vector is determined as the first vector, and the second intermediate state vector is determined as the second vector; Save the correspondence between the association relationship and the second identification information, as well as the correspondence between the first identification information, the first vector, the second identification information and the second vector, and save the correspondence between the first vector and the attribute information of the first target in the target family sample set.

2. The method according to claim 1, characterized in that: Before saving the correspondence between the first vector and the attribute information of the first target in the target family sample set, the method further includes: If the attribute type corresponding to any sub-attribute information included in the attribute information of the first target matches any preset privacy attribute type, then obtain the value interval corresponding to the preset matching privacy attribute type, determine the target interval identification information corresponding to the target value interval where the sub-attribute information is located, and update the sub-attribute information according to the target interval identification information.

3. The method according to claim 1 or 2, characterized in that: The storing of the correspondence between the first vector and the attribute information of the first target in the target family sample set includes: Obtaining the index value corresponding to the first vector; Determine the encryption information corresponding to the index value according to a preset encryption algorithm; The correspondence between the encrypted information and the attribute information of the first target in the target family sample set is saved.

4. The method according to claim 3, characterized in that The method further comprises: Interference encryption information and its corresponding attribute information are randomly generated and saved accordingly.

5. The method according to claim 1, characterized in that Determine whether the loss value meets the preset convergence conditions, including: If the loss value is less than a preset loss threshold, determining that the loss value satisfies a preset convergence condition; and / or If the loss value is the minimum loss value, it is determined that the loss value satisfies a preset convergence condition.

6. The method according to claim 1, characterized in that The determining of the loss value according to the first difference between the distance between the two first intermediate state vectors having the association relationship and the distance between the second intermediate state vector corresponding to the association relationship and the preset standard vector, and the distance threshold corresponding to the association relationship determined by the current training includes: Determine a second difference between a distance threshold corresponding to the association relationship determined in the current training and the first difference; Based on the second difference, a loss value is determined.

7. A data processing method, characterized in that: The method comprises: According to the third identification information corresponding to the second target carried in the acquired data query request, the target association relationship, and the stored family knowledge graph of the target family, determine the third vector corresponding to the third identification information and the fourth vector corresponding to the target association relationship; wherein the family knowledge graph of the target family is generated based on the method for generating the family knowledge graph according to any one of claims 1 to 6; Acquire a fifth vector from the saved vectors, the distance between the fifth vector and the third vector being equal to the distance between the fourth vector and the preset standard vector; The third vector, the fifth vector and their corresponding target attribute information are sent.

8. The method according to claim 7, characterized in that Obtaining target attribute information corresponding to the third vector and the fifth vector respectively includes: According to the pre-saved correspondence between the vector and the index value, obtaining the target index values ​​corresponding to the third vector and the fifth vector respectively; According to a preset encryption algorithm, target encryption information corresponding to the target index values ​​is obtained; and target attribute information corresponding to the target encryption information is determined respectively.

9. The method according to claim 8, characterized in that The method further comprises: Send interference encryption information and its corresponding attribute information.

Citation Information

Patent Citations

  • Information processing method and device

    CN108733681A

  • Movie recommendation method and terminal

    CN110717099A