Community Knowledge Graph Construction and Query Method for Residents' Attribute Information
By creating biometric nodes in the community knowledge graph and verifying the identity of the query user, the problem of low security in the existing technology of residents' attribute information query is solved, and the security query of information in the community is realized.
Patent Information
- Application Number
- CN202010812176.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-08-13
- Publication Date
- 2025-07-22
- Estimated Expiration
- 2040-08-13
AI Technical Summary
The existing methods for querying residents' attribute information are low in security. Non-community residents can query the information of community residents by obtaining their ID numbers, resulting in information leakage.
Create nodes identified by biometric feature vectors in the community knowledge graph, save residents' attribute information, and query the user's identity through biometric verification. Only when matching the target feature vectors are matched, attribute information is allowed to be queried.
It improves the security of queries of residents' attribute information, prevents non-community residents from obtaining information, and ensures that queries are allowed only after the query user's identity verification is passed.
Smart Images

Figure CN113495993B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical fields of smart communities and artificial intelligence knowledge graphs, and particularly relates to a method for constructing a community knowledge graph and querying the attribute information of residents. Background Art
[0002] With the rapid development of big data and artificial intelligence, as an important part of artificial intelligence technology, the community knowledge graph has been widely applied in fields such as finance, agriculture, e-commerce, medical care, electronics, and transportation due to its powerful semantic processing, interconnection organization, information retrieval, and knowledge reasoning capabilities. The community knowledge graph is a huge semantic network graph that describes various concepts and their relationships existing in the real world by representing concepts through nodes and relationships through edges.
[0003] In the field of community services, there are also methods for querying the attribute information of residents based on the community knowledge graph. However, in the current methods for querying the attribute information of residents, the current query user inputs the ID number. As long as the node corresponding to the ID number can be located in the pre-constructed community knowledge graph, the attribute information of the resident can be queried, without considering whether the current query user is the user corresponding to the ID number. Therefore, it is possible that other people who are not residents of this community can query the attribute information of the residents of this community after obtaining the ID numbers of the residents of this community, resulting in the problem of leakage of the attribute information of the residents. Therefore, the security of the existing methods for querying the attribute information of residents is relatively low. Summary of the Invention
[0004] This application provides a method for constructing a community knowledge graph, a method for querying the attribute information of residents based on the community knowledge graph, an apparatus, a device, and a medium, so as to solve the problem of relatively low security of the existing methods for querying the attribute information of residents.
[0005] In a first aspect, this application provides a method for constructing a community knowledge graph, and the method includes:
[0006] Obtain any sample data in the sample set, where the sample data includes the feature vector of the biometric characteristics of the resident and the attribute information of the resident, and the biometric characteristics are voiceprint characteristics and / or face characteristics;
[0007] For the feature vector in the sample data, if the node corresponding to the feature vector does not exist in the community knowledge graph, create a first target node identified by the feature vector in the community knowledge graph, and save the attribute information of the resident in the sample data for the first target node;
[0008] According to the social relationships of the residents recorded in the attribute information of the first target node, search for the attribute information saved by the community knowledge graph for the established nodes, connect the second target nodes that have social relationships with the first target node, and save the social relationships corresponding to the connections between the first target node and the second target nodes.
[0009] In a second aspect, the present application provides a method for querying attribute information of residents based on a community knowledge graph, the method comprising:
[0010] According to the feature vector of the biometric characteristics of the query user obtained, in the pre-constructed community knowledge graph, determine whether there is a fifth target node corresponding to a target feature vector that matches the feature vector, where the biometric characteristics are voiceprint characteristics and / or face characteristics;
[0011] If there is, then according to the query voice information input by the query user and the pre-saved template, determine the target information to be queried, search for a sixth target node in the community knowledge graph that meets the conditions corresponding to the target information, and output the attribute information of the residents saved for the sixth target node.
[0012] In a third aspect, the present application provides a community knowledge graph construction device, the device comprising:
[0013] An acquisition module, configured to acquire any sample data in a sample set, where the sample data includes a feature vector of the biometric characteristics of a resident and the attribute information of the resident, where the biometric characteristics are voiceprint characteristics and / or face characteristics;
[0014] A creation module, configured to, for the feature vector in the sample data, if there is no node corresponding to the feature vector in the community knowledge graph, create a first target node identified by the feature vector in the community knowledge graph, and save the attribute information of the resident in the sample data for the first target node;
[0015] A connection module, configured to according to the social relationships of the residents recorded in the attribute information of the first target node, search for the attribute information saved by the community knowledge graph for the established nodes, connect the second target nodes that have social relationships with the first target node, and save the social relationships corresponding to the connections between the first target node and the second target nodes.
[0016] In a fourth aspect, the present application provides a device for querying attribute information of residents based on a community knowledge graph, the device comprising:
[0017] A determination module, configured to determine, according to the feature vector of the biometric feature of the query user obtained, whether there is a fifth target node corresponding to a target feature vector that matches the feature vector in the pre-constructed community knowledge graph, where the biometric feature is a voiceprint feature and / or a face feature;
[0018] A search module, configured to, if there is the fifth target node, determine the target information to be queried according to the query voice information input by the query user and the pre-saved template, and search for a sixth target node in the community knowledge graph that meets the conditions corresponding to the target information;
[0019] An output module, configured to output the attribute information of the resident saved for the sixth target node.
[0020] In a fifth aspect, the present application further provides an electronic device, where the electronic device includes a processor and a memory, the memory is used to store program instructions, and the processor is used to implement the steps of any one of the above-mentioned community knowledge graph construction methods when executing the computer program stored in the memory.
[0021] In a sixth aspect, the present application further provides an electronic device, where the electronic device includes a processor and a memory, the memory is used to store program instructions, and the processor is used to implement the steps of any one of the above-mentioned methods for querying the attribute information of residents based on a community knowledge graph when executing the computer program stored in the memory.
[0022] In a seventh aspect, the present application further provides a computer-readable storage medium, which stores a computer program, and the computer program implements the steps of any one of the above-mentioned community knowledge graph construction methods when executed by a processor.
[0023] In an eighth aspect, the present application further provides a computer-readable storage medium, which stores a computer program, and the computer program implements the steps of any one of the above-mentioned methods for querying the attribute information of residents based on a community knowledge graph when executed by a processor.
[0024] The present application provides a method for constructing a community knowledge graph, a method for querying the attribute information of residents based on a community knowledge graph, a device, a device and a medium. Since in the present application, before starting to query the attribute information of residents, according to the feature vector of the biometric feature of the query user and the pre-constructed community knowledge graph, it is determined whether there is a fifth target node corresponding to a target feature vector that matches the feature vector in the community knowledge graph, and only when it is determined that there is the target feature vector, the query user is allowed to query the attribute information of residents, thereby improving the security of the method for querying the attribute information of residents. Description of the Drawings
[0025] To more clearly illustrate the technical solutions in the present application, the following will briefly introduce the attached drawings required for the description of the embodiments. Obviously, the attached drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other attached drawings can also be obtained based on these drawings.
[0026] Figure 1 Schematic diagram of the process of a method for constructing a community knowledge graph of residents' attribute information provided by some embodiments of the present application;
[0027] Figure 2 Schematic diagram of the complete process of a method for querying residents' attribute information based on a community knowledge graph provided by some embodiments of the present application;
[0028] Figure 3 Schematic diagram of the visualization effect of a community knowledge graph provided by some embodiments of the present application;
[0029] Figure 4 Schematic diagram of the complete process of a method for querying residents' attribute information based on a community knowledge graph provided by some embodiments of the present application;
[0030] Figure 5 Schematic diagram of the structure of a device for constructing a community knowledge graph provided by some embodiments of the present application;
[0031] Figure 6 Schematic diagram of the structure of a device for querying residents' attribute information based on a community knowledge graph provided by some embodiments of the present application;
[0032] Figure 7 Schematic diagram of the structure of an electronic device provided by some embodiments of the present application;
[0033] Figure 8 Schematic diagram of the structure of an electronic device provided by some embodiments of the present application. Detailed implementation manners
[0034] To improve the security of the method for querying residents' attribute information, the present application provides a method for constructing a community knowledge graph, a method for querying residents' attribute information based on a community knowledge graph, a device, a device, and a medium.
[0035] To make the purpose, technical solutions, and advantages of the present application clearer, the following will further describe the present application in detail with reference to the attached drawings. Obviously, the described embodiments are only some embodiments of the present application, rather than all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present application.
[0036] In this application, in order to facilitate the residents in the same community to query the attribute information of the residents living in this community, and to prevent non-residents of this community from querying the attribute information of the residents and improve the security of the method for querying the attribute information of the residents, the eigenvector of the biometric feature of the query user is obtained in this application, and in the pre-constructed community knowledge graph, it is determined whether there is a fifth target node that matches the eigenvector. When it is determined that there is such a fifth target node, the target information to be queried is determined according to the query voice information input by the query user and the pre-saved template, the sixth target node that meets the corresponding conditions of the target information is searched in this community knowledge graph, and the attribute information of the residents included in the sixth target node is output.
[0037] Figure 1 FIG. 4 is a schematic diagram of the process of a method for constructing a community knowledge graph of the attribute information of residents provided in some embodiments of this application. The method includes the following steps:
[0038] S101: Obtain any sample data in the sample set, where the sample data includes the eigenvector of the biometric feature of the resident and the attribute information of the resident, and the biometric feature is a voiceprint feature and / or a face feature.
[0039] The method for constructing the community knowledge graph provided in this application is applied to an electronic device, which can be an intelligent terminal such as a smart phone, a PC, a tablet computer, etc., or a server.
[0040] The sample data in the sample set is the data of residents obtained in advance, and any sample data therein includes the eigenvector of the biometric feature of the resident and the attribute information of the resident. Among them, the attribute information of the resident includes information such as the name, gender, ID number, phone number, home address, and hobbies of the resident. If the resident is in school or at work, the attribute information of the resident also includes the school or work unit of the resident; the eigenvector of the resident can be the eigenvector of the voiceprint feature of the resident, or the eigenvector of the face feature of the resident, or the eigenvector including the voiceprint feature and the face feature.
[0041] Table 1 shows the sample data of residents provided in some embodiments of this application. As shown in Table 1, the sample data includes the following content:
[0042]
[0043] Table 1
[0044] In this application, in order to ensure the accuracy of data query and improve the efficiency of data query, the sample data can also be preprocessed. Taking the sample data in Table 1 as an example, the specific code is as follows:
[0045]
[0046] S102: For the feature vector in the sample data, if there is no node corresponding to the feature vector in the community knowledge graph, create a first target node identified by the feature vector in the community knowledge graph, and save the attribute information of the resident in the sample data for the first target node.
[0047] After obtaining any sample data in the sample set, since the sample data contains the feature vector of the resident and the attribute information of the resident, and the feature vector of the resident uniquely identifies the resident, it is possible to determine whether there is a node corresponding to the feature vector in the community knowledge graph based on the feature vector of the resident. If there is a node corresponding to the feature vector in the community knowledge graph, it means that there is already a node of the resident corresponding to the sample data in the community knowledge graph. If not, it means that there is no node of the resident corresponding to the sample data in the community knowledge graph. Create a first target node corresponding to the feature vector in the community knowledge graph, and save the attribute information of the resident in the sample data for the first target node.
[0048] S103: According to the social relationship of the resident recorded in the attribute information of the resident included in the first target node, search for the attribute information saved by the community knowledge graph for the established nodes, connect the second target nodes that have a social relationship with the first target node, and save the social relationship corresponding to the connection between the first target node and the second target node.
[0049] After creating the first target node corresponding to the feature vector, the resident corresponding to the feature vector may have an association relationship, that is, a social relationship, with other residents. The social relationship is saved in the attribute information of the resident, and the social relationship may be at least one of, for example, parent-child relationship, spousal relationship, friendship, colleague relationship, and classmate relationship, etc.
[0050] Therefore, in order to construct a complete community knowledge graph, in this application, it is necessary to determine which nodes in the community knowledge graph the first target node should be connected to. Specifically, search according to the attribute information included in the sample data to obtain the social relationship of the resident in the attribute information.
[0051] According to the social relationship of the resident recorded in the attribute information of the resident included in the sample data, the electronic device saves the attribute information for the established nodes in the community knowledge graph, and searches in the attribute information to determine the second target nodes that have a social relationship with the first target node.
[0052] For example, if the social relationships of the resident store the names of the residents who are friends with the resident, in the community knowledge graph, the electronic device searches the attribute information saved for the established nodes for nodes whose attribute information contains the name, and uses the nodes containing the name as the second target nodes that have a friend relationship with the first target node.
[0053] After the electronic device determines the second target node, for the convenience of subsequent queries, the electronic device establishes a connection between the first target node and the second target node, and saves the social relationship corresponding to the connection between the first target node and the second target node.
[0054] The sample set contains a large amount of sample data. The above operations are performed on each sample data. After the operations are completed, the community knowledge graph is constructed.
[0055] In this application, the community knowledge graph is stored in a highly scalable distributed (JanusGraph) graph database to achieve explicit and implicit full-dimensional data association. An open-source distributed database system (cassandra) is used as the storage backend of the graph database, and a search server (elasticsearch) is used as the search engine of the graph database.
[0056] In order to construct the community knowledge graph, based on the above embodiments, in this application, the method further includes:
[0057] Determine whether the identification information of the school or unit of the resident is recorded in the social relationships of the resident in the sample data. If it exists, create a third target node identified by the identification information of the school or unit in the community knowledge graph, connect the first target node and the third target node, and save the social relationship corresponding to the connection between the first target node and the third target node;
[0058] Save the relevant information of the school or unit recorded in the social relationship for the third target node.
[0059] In this application, for the convenience of subsequent queries, in constructing the community knowledge graph, in addition to constructing nodes corresponding to residents, nodes of the schools or units of the residents can also be constructed.
[0060] Therefore, after obtaining any sample data in the sample set, for the obtained sample data, it can also be determined whether the identification information of the school or unit of the resident is recorded in the social relationships of the resident. In some embodiments, the identification information of the school or unit is the name of the school or unit.
[0061] When the identification information of the school or unit of the resident is recorded in determining the social relationship of the resident of the sample data, the electronic device creates a third target node identified by the identification information of the school or unit in the community knowledge graph.
[0062] Since the identification information of the school of the resident is recorded in the social relationship of the resident, it indicates that the resident has a school-going relationship with the school. Therefore, the electronic device also needs to connect the first target node corresponding to the resident and the third target node corresponding to the school, and save the school-going relationship corresponding to the connection between the first target node and the third target node.
[0063] When the identification information of the unit of the resident is recorded in the social relationship of the resident, it indicates that the resident has a working relationship with the unit. Therefore, the electronic device also needs to connect the first target node corresponding to the resident and the third target node corresponding to the school, and save the working relationship corresponding to the connection between the first target node and the third target node.
[0064] After creating the third target node identified by the identification information of the school or unit in the community knowledge graph, for the convenience of residents' query, in this application, the electronic device also needs to save the relevant information of the school or unit recorded in the social relationship for the third target node. Among them, in this application, the relevant information of the school or unit includes at least one of the address, contact information, etc. of the school or unit.
[0065] In order to realize the construction of the community knowledge graph, on the basis of the above embodiments, in this application, the method further includes:
[0066] If there is a first target node identified by the feature vector in the community knowledge graph, update the attribute information of the resident saved in the first target node in the community knowledge graph according to the attribute information of the resident in the sample data containing the feature vector.
[0067] If there is a first target node identified by the feature vector in the community knowledge graph, compared with the attribute information of the resident in the sample data containing the feature vector obtained, since the attribute information of the resident saved in the first target node in the community knowledge graph may be short or changed, therefore, in this application, it is also necessary to update the attribute information of the resident saved in the first target node.
[0068] The electronic device updates the attribute information of the resident saved in the first target node in the community knowledge graph according to the attribute information of the resident in the sample data containing the feature vector.
[0069] Specifically, for each piece of attribute information of the resident in the sample data containing the feature vector obtained by the electronic device, it determines whether the attribute information exists in the attribute information of the resident saved in the first target node of the community knowledge graph. If it does not exist, the electronic device adds the attribute information to the attribute information of the resident saved in the first target node.
[0070] The electronic device determines whether the attribute information in the sample data containing the feature vector is the same as the attribute information of the resident saved in the first target node of the community knowledge graph for each piece of attribute information of the resident in the sample data containing the feature vector. If they are not the same, the electronic device replaces the attribute information of the resident saved in the first target node of the community knowledge graph with the attribute information in the sample data.
[0071] For example, when the telephone number of the resident saved in the first target node of the community knowledge graph by the electronic device is different from the telephone number of the resident in the sample data containing the feature vector, the electronic device replaces the telephone number of the resident saved in the first target node of the community knowledge graph with the telephone number of the resident in the sample data containing the feature vector.
[0072] Because after the attribute information is updated, the social relationships recorded therein may also change. To ensure the accuracy of the constructed community knowledge graph, based on the above embodiments, in this application, the method further includes:
[0073] According to the updated social relationship of the resident saved in the first target node, for the second target node that has a social relationship with and is connected to the first target node, update the social relationship corresponding to the connection between the first target node and the second target node;
[0074] According to the updated social relationship of the resident saved in the first target node, search for the attribute information of the nodes in the community knowledge graph that are not connected to the first target node, connect to the fourth target node that has a social relationship with the first target node, and save the social relationship corresponding to the connection between the first target node and the fourth target node.
[0075] In this application, after the attribute information of the resident saved in the first target node is updated, since the social relationship of the resident in the attribute information may also be updated, it is also necessary to update the social relationship corresponding to the connection between the first target node and the second target node that has been established before in this application.
[0076] Specifically, when the electronic device determines that the first node is connected to the second node according to the social relationships of the residents saved for the updated first target node, if the social relationship associated with the second connection changes, the electronic device updates the social relationship corresponding to the connection between the first target node and the second target node.
[0077] For example, before the update, the social relationship corresponding to the connection between the first target node and the second target node that has been constructed is a friendship. In the social relationships of the residents after the update, the social relationship between the resident corresponding to the first target node and the resident corresponding to the second target node becomes a spousal relationship. Then, for the second target node, the electronic device updates the social relationship corresponding to the connection between the first target node and the second target node from friendship to spousal relationship.
[0078] According to the social relationships of the residents saved for the updated first target node, since there will also be new social relationships in the social relationships of the updated residents, the electronic device also needs to establish connections between the first target node and the nodes in the community knowledge graph according to the new social relationships.
[0079] Specifically, the electronic device searches for the attribute information of the nodes in the community knowledge graph that are not connected to the first target node according to the social relationships of the residents saved for the updated first target node, and determines a fourth target node that has a social relationship with the first target node in the attribute information.
[0080] For example, the names of the residents who are friends with the resident are saved in the social relationships of the resident. In the community knowledge graph, the electronic device searches for the nodes whose attribute information contains the name among the attribute information of the nodes in the community knowledge graph that are not connected to the first target node, and uses the nodes containing the name as the fourth target node that has a friendship with the first target node.
[0081] After the electronic device determines the fourth target node, for the convenience of subsequent queries, the electronic device establishes a connection between the first target node and the fourth target node, and saves the social relationship corresponding to the connection between the first target node and the fourth target node.
[0082] Figure 2 The figure is a schematic process diagram of a method for querying attribute information of residents based on a community knowledge graph provided by some embodiments of the present application. The process includes the following steps:
[0083] S201: According to the feature vector of the biometric characteristics of the query user obtained, determine whether there is a fifth target node corresponding to the target feature vector that matches the feature vector in a pre-constructed community knowledge graph, where the biometric characteristics are voiceprint characteristics and / or face characteristics.
[0084] The method for querying attribute information of residents based on a community knowledge graph provided in this application is applied to an electronic device, which can be an intelligent terminal such as a smart phone, a PC, a tablet computer, etc., or a server. Among them, the electronic device to which this query method is applied and the electronic device to which this community knowledge graph construction method is applied can be the same or different.
[0085] In this application, after the electronic device determines that there is a query user who wants to query the attribute information of a resident, in order to improve the security of the method for querying the attribute information of residents, the electronic device needs to obtain the feature vector of the biometric characteristics of the query user.
[0086] Among them, if the electronic device is an intelligent terminal, the method for the intelligent terminal to determine that there is a query user who wants to query the attribute information of a resident is a prior art. For example, when the intelligent terminal receives a click signal when the user clicks the query button on the display screen, it determines that it has received the user's query instruction and determines that there is a query user who wants to query the attribute information of a resident; it can also determine that there is a query user who wants to query the attribute information of a resident when it determines that there is a keyword "query" in the received voice information. This application does not limit this.
[0087] If the electronic device is a server, when the electronic device determines that there is a query user who wants to query the attribute information of a resident, it sends the determination information of the existence of the query user to the server, and it is the server that determines that there is a query user who wants to query the attribute information of a resident.
[0088] In this application, in order to improve the security of the method for querying the attribute information of residents, the biometric characteristics can be voiceprint characteristics or face characteristics. In a possible embodiment, the biometric characteristics include voiceprint characteristics and face characteristics.
[0089] To obtain the feature vector of the biometric feature of the query user, if the electronic device is a smart terminal, at least one of an image acquisition device and a sound acquisition device is installed on the smart terminal. When the biometric feature is a voiceprint feature, the sound acquisition device of the smart terminal acquires the voice information of the query user, and based on the pre-trained voiceprint feature extraction model, processes the voice information to determine the feature vector of the voiceprint feature of the voice information. When the biometric feature is a face feature, the image acquisition device of the smart terminal acquires the face image of the query user, and based on the pre-trained face feature extraction model, processes the acquired face image of the query user to determine the feature vector of the face feature of the face image. When the biometric feature includes a voiceprint feature and a face feature, the sound acquisition device of the smart terminal acquires the voice information of the query user, and based on the pre-trained voiceprint feature extraction model, determines the feature vector of the voiceprint feature of the voice information. The image acquisition device acquires the face image of the query user, and based on the pre-trained face feature extraction model, determines the feature vector of the face feature of the face image.
[0090] If the electronic device is a server, the server receives the voice information of the query user acquired by the sound acquisition device of the smart terminal, and based on the pre-trained voiceprint feature extraction model, determines the feature vector of the voiceprint feature of the voice information. The server receives the face image of the query user acquired by the image acquisition device of the smart terminal, and based on the pre-trained face feature extraction model, determines the feature vector of the face feature.
[0091] In this application, in order to determine whether the query user is a resident of the community, a community knowledge graph is also pre-constructed in the electronic device. Among them, the community knowledge graph is constructed based on the attribute information of each resident in the community and the feature vector of the biometric feature, which has been described in the above embodiments.
[0092] After the electronic device obtains the feature vector of the biometric feature of the query user, in the community knowledge graph, for each feature vector that identifies the node, it is determined whether there is a target feature vector that matches the feature vector of the biometric feature of the query user. Specifically, that is, the similarity between the feature vector of the biometric feature of the query user and the feature vector corresponding to each node in the community knowledge graph is determined, and it is determined whether there is a similarity that meets the set threshold. If so, it is determined that the target feature vector corresponding to the similarity that meets the set threshold matches the feature vector of the biometric feature of the query user. If not, it is determined that there is no target feature vector in the community knowledge graph that matches the feature vector of the biometric feature of the query user.
[0093] When the biometric feature is a voiceprint feature, the electronic device determines whether there is a fifth target node corresponding to a target feature vector that matches the feature vector of the voiceprint feature in the pre-constructed community knowledge graph; when the biometric feature is a face feature, the electronic device determines whether there is a fifth target node corresponding to a target feature vector that matches the feature vector of the face feature in the pre-constructed community knowledge graph; when the biometric features are voiceprint feature and face feature, the electronic device determines whether there is a sub-voiceprint feature vector of the feature vector that matches the feature vector of the voiceprint feature and a sub-face feature vector of the feature vector that matches the feature vector of the face feature in the pre-constructed community knowledge graph. If so, the electronic device determines that the feature vector is a target feature vector that matches the feature vectors of both the voiceprint feature and the face feature of the query user.
[0094] S202: If so, based on the query voice information input by the query user and the templates saved in advance, determine the target information to be queried.
[0095] In this application, if there is a fifth target node corresponding to a target feature vector that matches the feature vector of the biometric feature of the query user in the community knowledge graph, the electronic device determines that the query user can query the attribute information of the residents saved in the community knowledge graph.
[0096] To determine the target information to be queried by the query user, the electronic device has pre-saved templates for various questions that the query voice information input by the user may correspond to. The electronic device determines the target information to be queried by the query user based on the query voice information and the templates saved in advance.
[0097] Among them, the method of determining the target information to be queried based on the query voice information and the templates saved in advance is a prior art, and this application will not elaborate on it.
[0098] S203: If not, output a prompt message indicating that the attribute information of the residents cannot be queried.
[0099] In this application, if there is no fifth target node corresponding to a target feature vector that matches the feature vector of the biometric feature of the query user in the community knowledge graph, the electronic device determines that the query user cannot query the attribute information of the residents and outputs a prompt message indicating that the query user cannot query the attribute information of the residents.
[0100] Specifically, if the electronic device is a smart terminal, the smart terminal can output the prompt message in text form through the display device of the smart terminal; or it can output the prompt message in voice form through the sound output device of the smart terminal.
[0101] If the electronic device is a server, the server can output the prompt message in text form through a display device connected to the server; or it can output the prompt message in voice form through a voice output device connected to the server.
[0102] S204: Search for a sixth target node in the community knowledge graph that meets the conditions corresponding to the target information, and output the attribute information of the residents saved for the sixth target node.
[0103] After the electronic device determines the target information to be queried by the query user, the electronic device traverses and searches in the community knowledge graph to determine a sixth target node in the community knowledge graph that meets the conditions corresponding to the target information.
[0104] In this application, the sixth target node in the community knowledge graph that meets the conditions corresponding to the target information means that there is a direct relationship between the sixth target node and the target information, such as a connection relationship, an inclusion relationship, etc. Among them, the number of sixth target nodes that meet the target information in the community knowledge graph may be 1 or multiple.
[0105] In this application, the nodes in the community knowledge graph contain the attribute information of the residents corresponding to the nodes. After determining the sixth target node that meets the target information in the community knowledge graph, for the sixth target node, the electronic device determines the attribute information of the residents saved for the sixth target node and then outputs the attribute information of the residents.
[0106] If the electronic device is a smart terminal, the smart terminal can output the attribute information of the residents in text form on the display device of the smart terminal. For example, the attribute information output in text form on the display screen of the smart terminal, or it can also output the attribute information in voice form through the voice output device of the smart terminal. For example, output the attribute information in voice form through a speaker. This application does not limit this.
[0107] If the electronic device is a server, the server can display the attribute information in text form through a terminal connected to the server; or it can output the attribute information in voice form through a terminal connected to the server.
[0108] Since in this application, before starting to query the attribute information of the residents, according to the feature vector of the biometric characteristics of the query user and the pre-constructed community knowledge graph, it is judged whether there is a fifth target node in the community knowledge graph that matches the target feature vector corresponding to the feature vector. Only when it is determined that there is the fifth target node can it be determined that the query user is the resident corresponding to the fifth target node in the community knowledge graph. Therefore, the query user is allowed to query the attribute information of the residents, thereby improving the security of the method for querying the attribute information of the residents.
[0109] To accurately find the sixth target node in the community knowledge graph that meets the target information, based on the above embodiments, in this application, the process of finding the sixth target node in the community knowledge graph that meets the target information includes:
[0110] If the target information to be queried is the seventh target node, find the sixth target node in the community knowledge graph that has a connection relationship with the seventh target node;
[0111] If the target information to be queried is the target keyword, find the sixth target node in the community knowledge graph whose resident's attribute information contains the target keyword.
[0112] In this application, the target information to be queried by the query user may be a node or a keyword. To accurately find the sixth target node in the community knowledge graph that meets the target information, when the target information to be queried is the seventh target node, the electronic device finds the sixth target node in the community knowledge graph that has a connection relationship with the seventh target node. Among them, since it is a query for the attribute information of community residents, the sixth target node is the node corresponding to the resident.
[0113] Figure 3 The following is a schematic diagram of the visualization effect of a community knowledge graph of residents provided by some embodiments of this application. As Figure 3 shown, if the target information to be queried is the seventh target node, the seventh target node can be a node corresponding to a resident, a node corresponding to a school, or a node corresponding to a unit. Figure 3 The people 1 - people 17 in Figure 3 are the nodes corresponding to the residents, Figure 3 the school 1 in
[0114] is the node corresponding to the school, Figure 2 and the units 1 - units 3 in
[0115] are the nodes corresponding to the units. Figure 3 When the seventh target node is person 18, the electronic device finds the sixth target node in the community knowledge graph that has a connection relationship with person 18. As
[0116] Specifically, in this application, the Gremlin query language is used to find the attribute information of the residents of the third target node connected to School 1. Taking School 1 as Qingdao Wangbu Primary School as an example, the specific code is as follows:
[0117] graph = JanusGraphFactory.open('conf / janusgraph-cassandra-es.properties')
[0118] m = graph.openManagement()
[0119] g = graph.traversal()
[0120] The above code realizes opening the community knowledge graph of residents that has been created.
[0121] g.V().has('school', 'Qingdao Wangbu Primary School').in('study').values('name')
[0122] Among them, g.V() means traversing all nodes; g.V().has('school', 'Qingdao Wangbu Primary School') means querying the seventh target node with the school attribute being Qingdao Wangbu Primary School; the output of g.V().has('school', 'Qingdao Wangbu Primary School').in('study').values('name') is the names of all the sixth target nodes that point to the nodes meeting the requirements through the relationship study. The output attribute information of the residents is the names of Person 2 and Person 11, and the relationship between Person 2 and Person 11 is a classmate relationship.
[0123] When the seventh target node is Unit 2, the electronic device searches in the community knowledge graph for the sixth target node connected to Unit 2, such as Figure 3 As shown, the sixth target nodes connected to Unit 2 include Person 15 and Person 17.
[0124] Taking Unit 2 as Hisense as an example, to find the attribute information of the residents of the sixth target node connected to Hisense in the community knowledge graph, the specific code is as follows:
[0125] graph = JanusGraphFactory.open('conf / janusgraph-cassandra-es.properties')
[0126] m = graph.openManagement()
[0127] g = graph.traversal()
[0128] g.V().has('unite_name', 'Hisense').in('work').values('name') # Discover colleague relationships.
[0129] The output of the resident's attribute information is the names of Person 15 and Person 17, and the relationship between Person 15 and Person 17 is a colleague relationship.
[0130] In this application, when the target information to be queried is a target keyword, the electronic device traverses and searches in the community knowledge graph for the attribute information of residents including the sixth target node of the target keyword.
[0131] When the target keyword is "mahjong", search in the community knowledge graph for the attribute information of residents including the sixth target node of mahjong. The code is as follows:
[0132] graph = JanusGraphFactory.open('conf / janusgraph-cassandra-es.properties')
[0133] m = graph.openManagement()
[0134] g = graph.traversal()
[0135] g.V().has('hobby','mahjong').values('name')
[0136] Among them, g.V() represents traversing all nodes, g.V().has('hobby','mahjong') represents finding the seventh target node with the hobby attribute of mahjong, and g.V().has('hobby','mahjong').values('name') outputs the names of all nodes that point to the satisfied sixth target nodes with the relationship hobby.
[0137] In order to improve the security of the output resident's attribute information, based on the above embodiments, in this application, before outputting the resident's attribute information saved for the sixth target node, the method further includes:
[0138] Determine the permission information included in the attribute information of the resident of the fifth target node, where the permission information is administrator permission or non - administrator permission;
[0139] The output of the resident's attribute information saved for the sixth target node includes:
[0140] Output the attribute information of the residents saved for the sixth target node according to the permission information.
[0141] In this application, in order to improve the security of the output attribute information of the residents, in this application, the attribute information of the residents corresponding to the nodes of the residents in the community knowledge graph also includes permission information. According to the feature vector of the biometric characteristics of the query user, it is also necessary to determine the permission information included in the attribute information of the residents of the fifth target node corresponding to the query user.
[0142] Among them, the permission information is the administrator permission or the non - administrator permission. The administrator permission is the permission of the community administrator in the community who has been authorized by the residents to view the attribute information of all residents. The community administrator is also a resident of the community. The non - administrator permission is the permission of an ordinary resident in the community who has not been authorized by the residents and cannot view the attribute information of all residents.
[0143] After the electronic device determines the permission information included in the attribute information of the residents of the fifth target node, in order to ensure the security of the attribute information of the residents included in the sixth target node to be output, the electronic device also needs to output the attribute information of the residents saved for the sixth target node according to the permission information, and determine whether to protect the attribute information of the residents of the sixth target node to be output, that is, determine whether to perform desensitization processing on the attribute information of the residents of the sixth target node before outputting.
[0144] Among them, when the attribute information of the residents is the attribute information of the residents output in text form on the display device, the desensitization processing of the attribute information of the residents of the sixth target node by the electronic device can be to perform blurring processing on the attribute information of the residents, or to replace some of the attribute information of the residents in the attribute information of the residents with "*". Specifically, this application does not limit this. When the attribute information of the residents is the attribute information of the residents in voice form output by the voice output device, the output after the desensitization processing of the attribute information of the residents of the sixth target node by the electronic device is to replace some of the attribute information of the residents in the attribute information of the residents with "*" and output the attribute information of the residents in voice form.
[0145] In this application, based on the community knowledge graph, the community administrator can solve problems such as neighborhood relations, interest-based making friends, and community interactions in the community. For example, by inferring from the community knowledge graph that the children of residents are classmates, the community administrator creates a WeChat group for the same school and recommends residents in need to join the group. To join the group, voiceprint verification or face identity verification is required to prevent other illegal personnel from joining the group to steal relevant personal information. If something urgent happens at one's home and they can't pick up or drop off their child at school, they can entrust the parent of their child's classmate to help. The safety of the child is guaranteed. Similarly, the colleague relationship between residents can also be mined. Residents without a car can take a ride with their colleagues on rainy days. By inferring from the community knowledge graph that residents have common hobbies, the community administrator creates a WeChat group for the same hobby and recommends residents in need to join the group. To join the group, voiceprint verification or face identity verification is required. For example, single male and female residents with common hobbies can be provided with opportunities to make friends. When there are activities in the community, residents with the same hobby can be organized to participate in the activities, such as organizing the elderly with the same interest to play mahjong or cards. This can not only prevent Alzheimer's disease and contribute to good health but also enhance the feelings among residents and they can help each other when needed.
[0146] Based on the above embodiments, in order to more precisely improve the security of the output resident attribute information, in this application, outputting the resident attribute information saved for the sixth target node according to the permission information includes:
[0147] If the permission information is a non-administrator permission, desensitize the privacy information in the resident attribute information saved for the sixth target node, and output the desensitized attribute information, where the privacy information includes ID number, phone number, and home address;
[0148] If the permission information is an administrator permission, directly output the resident attribute information saved for the sixth target node.
[0149] After the electronic device determines the permission information included in the resident attribute information of the fifth target node, if the permission information is a non-administrator permission, in order to enable the query user to query the resident attribute information while ensuring the security of the resident attribute information, the electronic device desensitizes the privacy information in the resident attribute information saved for the sixth target node, and then outputs the desensitized resident attribute information.
[0150] In this application, the privacy information in the attribute information of the resident includes the ID number, phone number, and home address. Specifically, when the electronic device performs desensitization processing on the ID number in the attribute information of the resident, the electronic device only displays the first four digits of the ID number, and the last 14 digits of the ID number are replaced by a single asterisk, for example, 3729*; when the electronic device performs desensitization processing on the phone number in the attribute information of the resident, the electronic device only displays the first eight digits of the phone number, and the last three digits of the phone number are replaced by three asterisks, for example, 15265235***; when the electronic device performs desensitization processing on the address information in the attribute information of the resident, the electronic device replaces the numbers before "building", "unit", and "room" with asterisks, for example, * building * unit * room.
[0151] If the permission information is the administrator permission, in order to facilitate the administrator to contact the resident corresponding to the sixth target node according to the attribute information of the resident queried, in this application, the electronic device directly outputs the attribute information of the resident saved for the sixth target node, that is, the privacy information in the attribute information of the resident included in the sixth target node is output normally without being replaced by asterisks.
[0152] In order to ensure the integrity of the attribute information of the resident output when the query user queries himself or his relatives, on the basis of the above embodiments, in this application, after the permission information is determined to be non-administrator permission and before desensitization processing is performed on the privacy information in the attribute information of the resident saved for the sixth target node, the method further includes:
[0153] Determine whether the feature vector of the fifth target node matches the feature vector of the sixth target node, or determine whether the home address of the fifth target node is the same as the home address of the sixth target node. If both judgment results are negative, then perform the step of desensitizing the privacy information in the attribute information of the resident saved for the sixth target node.
[0154] When the electronic device determines that the permission information included in the attribute information of the resident of the fifth target node corresponding to the query user is non-administrator permission, since the sixth target node found by the electronic device in the community knowledge graph may be the fifth target node, or the relationship between the sixth target node and the fifth target node is a relative relationship, therefore, even if the permission information of the query user is non-administrator permission, the query user can still query all the attribute information of the residents of the sixth target node.
[0155] Specifically, after the electronic device determines the attribute information of the residents included in the sixth target node, it determines whether the feature vector of the sixth target node matches the feature vector of the fifth target node, or determines whether the home address in the attribute information of the residents of the fifth target node is the same as the home address in the attribute information of the residents of the sixth target node. If both judgment results are negative, it means that the sixth target node is not the fifth target node, and the relationship between the sixth target node and the fifth target node is not a family relationship. Therefore, the query user cannot query the attribute information of all the residents of the sixth target node.
[0156] Therefore, the electronic device also needs to desensitize the privacy information in the attribute information for the residents' attribute information saved for the sixth target node, and output the attribute information after desensitization.
[0157] In order to ensure the integrity of the residents' attribute information output when the query user queries himself or his relatives, in this application, if any judgment result is positive, the residents' attribute information saved for the sixth target node is directly output.
[0158] If the electronic device determines that the feature vector of the sixth target node matches the feature vector of the fifth target node, it means that the sixth target node and the fifth target node are the same node. The electronic device finds the attribute information of the query user himself in the community knowledge graph. Therefore, the electronic device does not desensitize the privacy information in the attribute information of the residents included in the sixth target node to be output.
[0159] When the electronic device determines that the home address in the attribute information of the residents of the fifth target node is the same as the home address in the attribute information of the residents of the sixth target node, the electronic device determines that the residents corresponding to the sixth target node and the query user live at the same home address. The residents corresponding to the sixth target node and the query user belong to a family relationship, and the family relationship includes a spousal relationship and a parent-child relationship. The electronic device finds the attribute information of the query user's relatives in the community knowledge graph. Therefore, the electronic device does not desensitize the privacy information in the attribute information of the residents of the sixth target node to be output.
[0160] Figure 4 The following is a complete process schematic diagram of a method for querying residents' attribute information based on a community knowledge graph provided by some embodiments of this application. The process includes the following steps:
[0161] S401: According to the feature vector of the biometric feature of the query user obtained, in the pre-constructed community knowledge graph, determine whether there is a fifth target node corresponding to a target feature vector that matches the feature vector, where the biometric feature is a voiceprint feature and / or a face feature.
[0162] S402: If it exists, determine the target information to be queried according to the query voice information input by the query user and the pre - saved template.
[0163] S403: If the target information to be queried is the seventh target node, find the sixth target node in the community knowledge graph that has a connection relationship with the seventh target node; if the target information to be queried is the target keyword, find the sixth target node in the community knowledge graph whose resident's attribute information contains the target keyword.
[0164] S404: Determine the permission information included in the resident's attribute information of the fifth target node, where the permission information is administrator permission or non - administrator permission.
[0165] S405: Determine whether the permission information is administrator permission. If so, enter S406; if not, enter S407.
[0166] S406: If the permission information is administrator permission, do not desensitize the privacy information in the resident's attribute information included in the sixth target node to be output, and enter S410.
[0167] S407: If the permission information is non - administrator permission, determine whether the feature vector of the fifth target node matches the feature vector of the sixth target node, or determine whether the home address of the fifth target node is the same as the home address of the sixth target node. If any of the above judgment results is yes, enter S408; if both judgment results are no, enter S409.
[0168] S408: Do not desensitize the privacy information in the resident's attribute information included in the sixth target node to be output, and enter S410.
[0169] S409: Desensitize the privacy information in the resident's attribute information included in the sixth target node to be output, and enter S310.
[0170] S410: Output the resident's attribute information included in the sixth target node.
[0171] In order to accurately determine the target information to be queried by the query user, based on the above - mentioned embodiments, in this application, the determining the target information to be queried according to the query voice information input by the query user and the pre - saved template includes:
[0172] Based on the query voice information input by the query user, determine the text information corresponding to the query voice information based on the speech recognition model;
[0173] Determine a target template in the pre - saved templates that matches the text information according to the text information;
[0174] Determine the target information to be queried in the community knowledge graph according to the text information and the target template.
[0175] In this application, when the electronic device determines that there is a fifth target node corresponding to a target feature vector that matches the feature vector of the biometric characteristics of the query user in the pre - constructed community knowledge graph, the electronic device can determine the target information to be queried by the query user according to the query voice information input by the query user.
[0176] Specifically, the electronic device inputs the query voice information into an existing speech recognition model according to the query voice information input by the query user, and the speech recognition model processes the query voice information to determine the text information corresponding to the query voice information.
[0177] The electronic device determines the similarity between each template and the text information in the pre - saved templates according to the text information and the pre - saved templates, and uses the template with a similarity greater than a set threshold as the target template that matches the text information. Among them, the set threshold is pre - set by the user.
[0178] According to the text information and the determined target template, the electronic device determines the target information to be queried by the query user in the pre - constructed community knowledge graph.
[0179] For example, if the voice information input by the query user is "the attribute information of the residents in my school / company / with the same hobbies", the target template that matches the text information of this voice information is "the attribute information of the residents in my same *", and the electronic device determines that the target information to be queried by the query user in the community knowledge graph is the information corresponding to "same *" saved in the fifth target node.
[0180] If the voice information input by the query user is "the attribute information of the residents in my daughter's school / company / with the same hobbies", the target template that matches the text information of this voice information is "the attribute information of the residents in my *'s same *", and the electronic device determines that the target information to be queried by the query user in the community knowledge graph is the information corresponding to "same *" saved in the node corresponding to the daughter of the fifth target node.
[0181] If the voice information input by the query user is "attribute information of residents with the same school / company / same hobby as Zhang San", the target template matching the text information of the voice information is "*'s residents with the same *'s attribute information". The electronic device determines the target information to be queried by the query user in the community knowledge graph as the information corresponding to "the same *" of the node corresponding to Zhang San.
[0182] If the voice information input by the query user is "attribute information of residents with the same Qingdao Wangbu Primary School", the target template matching the text information of the voice information is "residents with the same *'s attribute information". The electronic device determines the target information to be queried by the query user in the community knowledge graph as Qingdao Wangbu Primary School.
[0183] In this application, the electronic device queries the attribute information of residents based on the Django framework. Each Django framework contains multiple apps. The apps are relatively independent but also related. All apps share project resources. There is a terminal entrance below the project. The electronic device inputs commands through this terminal entrance to create an app module named myapp.
[0184] In the architecture of this Django, there is urls.py. The routing is located in this urls file. The routing maps the url input by the electronic device to the corresponding business processing logic. The business processing logic is located in views.py inside myapp. The business processing logic mainly includes: matching the text information corresponding to the query voice information according to the query voice information input by the query user and the templates in the pre-saved aiml template library. After successful matching, return the target information, and call the corresponding function according to the type of the target information to implement converting the text information into a community knowledge graph query language to query the community knowledge graph and return the query result.
[0185] Based on the above embodiments, Figure 5 The following is a schematic structural diagram of a community knowledge graph construction device provided by some embodiments of this application. The device includes:
[0186] An acquisition module 501, configured to acquire any sample data in the sample set, where the sample data includes a feature vector of the biometric characteristics of a resident and the attribute information of the resident, and the biometric characteristic is a voiceprint characteristic and / or a face characteristic;
[0187] A creation module 502, configured to, for the feature vector in the sample data, if there is no node corresponding to the feature vector in the community knowledge graph, create a first target node identified by the feature vector in the community knowledge graph, and save the attribute information of the resident in the sample data for the first target node;
[0188] A connection module 503, configured to find, according to the social relationships of the residents recorded in the attribute information of the residents included in the first target node, the attribute information saved by the community knowledge graph for the established nodes, connect a second target node having a social relationship with the first target node, and save the social relationship corresponding to the connection between the first target node and the second target node.
[0189] Based on the above embodiments, Figure 6 The following is a schematic structural diagram of an apparatus for querying attribute information of residents based on a community knowledge graph provided by some embodiments of the present application. The apparatus includes:
[0190] A determination module 601, configured to determine, according to the feature vector of the biometric feature of the query user obtained, whether there is a fifth target node corresponding to a target feature vector matching the feature vector in the pre-constructed community knowledge graph, where the biometric feature is a voiceprint feature and / or a face feature;
[0191] A search module 602, configured to, if there is the fifth target node, determine the target information to be queried according to the query voice information input by the query user and the pre-saved template, and search for a sixth target node in the community knowledge graph that meets the conditions corresponding to the target information;
[0192] An output module 603, configured to output the attribute information of the residents saved for the sixth target node.
[0193] Figure 7 The following is a schematic structural diagram of an electronic device provided by some embodiments of the present application. Based on the above embodiments, the present application further provides an electronic device, including a processor 701, a communication interface 702, a memory 703, and a communication bus 704. Among them, the processor 701, the communication interface 702, and the memory 703 communicate with each other through the communication bus 704;
[0194] The memory 703 stores a computer program, and when the program is executed by the processor 701, the processor 701 is caused to execute the following steps:
[0195] Obtain any sample data in the sample set, where the sample data includes the feature vector of the biometric feature of the resident and the attribute information of the resident, where the biometric feature is a voiceprint feature and / or a face feature;
[0196] For the feature vector in the sample data, if there is no node corresponding to the feature vector in the community knowledge graph, create a first target node identified by the feature vector in the community knowledge graph, and save the attribute information of the residents in the sample data for the first target node;
[0197] According to the social relationships of the residents recorded in the attribute information of the residents included in the first target node, search for the attribute information saved by the community knowledge graph for the established nodes, connect the second target nodes that have social relationships with the first target node, and save the social relationships corresponding to the connections between the first target node and the second target nodes.
[0198] The communication bus mentioned in the above electronic device may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of simplicity, only a thick line is used in the figure to represent it, but it does not mean that there is only one bus or one type of bus.
[0199] The communication interface 702 is used for communication between the above electronic device and other devices.
[0200] The memory may include a Random Access Memory (RAM), and may also include a Non-Volatile Memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located far from the aforementioned processor.
[0201] The above processor may be a general-purpose processor, including a central processing unit, a Network Processor (NP), etc.; it may also be a Digital Signal Processing (DSP), an application-specific integrated circuit, a field programmable gate array, or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0202] In this application, for the concepts, explanations, detailed descriptions, and other steps related to the technical solutions provided in this application involved in the electronic device, please refer to the descriptions of these contents in the foregoing method or other embodiments, and will not be elaborated here.
[0203] Figure 8A schematic structural diagram of an electronic device provided for some embodiments of the present application. On the basis of the above embodiments, the present application further provides an electronic device, including a processor 801, a communication interface 802, a memory 803, and a communication bus 804. Among them, the processor 801, the communication interface 802, and the memory 803 complete mutual communication through the communication bus 804;
[0204] A computer program is stored in the memory 803. When the program is executed by the processor 801, the processor 801 is caused to execute the following steps:
[0205] According to the obtained feature vector of the biometric characteristics of the query user, in the pre-constructed community knowledge graph, determine whether there is a fifth target node corresponding to the target feature vector that matches the feature vector, where the biometric characteristics are voiceprint characteristics and / or face characteristics;
[0206] If it exists, then according to the query voice information input by the query user and the pre-saved template, determine the target information to be queried, search for the sixth target node in the community knowledge graph that meets the corresponding conditions of the target information, and output the attribute information of the resident saved for the sixth target node.
[0207] The communication bus mentioned in the above electronic device may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of convenience of representation, only a thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0208] The communication interface 802 is used for communication between the above electronic device and other devices.
[0209] The memory may include a Random Access Memory (RAM), and may also include a Non-Volatile Memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located far from the aforementioned processor.
[0210] The above-mentioned processor may be a general-purpose processor, including a central processing unit, a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit, a field programmable gate array, or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0211] Regarding the concepts, explanations, detailed descriptions, and other steps related to the technical solution provided in this application in the electronic device involved in this application, please refer to the descriptions of these contents in the foregoing method or other embodiments, and will not be elaborated here.
[0212] Based on the above-mentioned embodiments, the present application further provides a computer-readable storage medium, which stores a computer program, and the computer program is executed by a processor as follows:
[0213] Obtain any sample data in the sample set, where the sample data contains a feature vector of the biometric characteristics of a resident and the attribute information of the resident, and wherein the biometric characteristics are voiceprint characteristics and / or face characteristics;
[0214] For the feature vector in the sample data, if there is no node corresponding to the feature vector in the community knowledge graph, create a first target node identified by the feature vector in the community knowledge graph, and save the attribute information of the resident in the sample data for the first target node;
[0215] According to the social relationship of the resident recorded in the attribute information of the resident included in the first target node, search for the attribute information saved by the community knowledge graph for the established nodes, connect the second target node having a social relationship with the first target node, and save the social relationship corresponding to the connection between the first target node and the second target node.
[0216] Based on the above-mentioned embodiments, the present application further provides a computer-readable storage medium, which stores a computer program, and the computer program is executed by a processor as follows:
[0217] According to the feature vector of the biometric characteristics of the query user obtained, determine whether there is a fifth target node corresponding to a target feature vector that matches the feature vector in the pre-constructed community knowledge graph, where the biometric characteristics are voiceprint characteristics and / or face characteristics;
[0218] If it exists, based on the query voice information input by the query user and the pre-saved template, determine the target information to be queried, search for the sixth target node in the community knowledge graph that meets the corresponding conditions of the target information, and output the attribute information of the residents saved for the sixth target node.
[0219] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0220] The present application is described with reference to the flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to the present application. It should be understood that each flow and / or block in the flowchart and / or block diagram, as well as the combination of flows and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing devices generate a device for implementing the specified functions in Figure 1 one or more of the processes Figure 1 or multiple processes and / or blocks
[0221] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, such that the instructions stored in the computer-readable memory generate a manufactured article including an instruction device, and the instruction device implements the specified functions in Figure 1 one or more of the processes Figure 1 or multiple processes and / or blocks
[0222] These computer program instructions can also be loaded onto a computer or other programmable data processing device, such that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process, and thus the instructions executed on the computer or other programmable device provide steps for implementing the specified functions in Figure 1 one or more of the processes Figure 1 or multiple processes and / or blocks
[0223] Obviously, those skilled in the art can make various changes and modifications to this application without departing from the spirit and scope of this application. Thus, if these modifications and variations of this application fall within the scope of the claims of this application and their equivalent technologies, this application is also intended to include these modifications and variations.
Claims
1. A method for constructing a community knowledge graph, characterized in that, The method includes: Obtain any sample data in the sample set, where the sample data includes a feature vector of the biometric characteristics of a resident and the attribute information of the resident, and wherein the biometric characteristics are voiceprint characteristics and / or face characteristics; For the feature vector in the sample data, if there is no node corresponding to the feature vector in the community knowledge graph, create a first target node identified by the feature vector in the community knowledge graph, and save the attribute information of the resident in the sample data for the first target node; According to the social relationships of the residents recorded in the attribute information of the residents included in the first target node, search for the attribute information saved by the community knowledge graph for the established nodes, connect the second target nodes having social relationships with the first target node, and save the social relationships corresponding to the connections between the first target node and the second target nodes; The method further includes: Judge whether the identification information of the school or unit of the resident is recorded in the social relationships of the resident in the sample data. If it exists, create a third target node identified by the identification information of the school or unit in the community knowledge graph, connect the first target node and the third target node, and save the social relationships corresponding to the connections between the first target node and the third target nodes; Save the relevant information of the school or unit recorded in the social relationship for the third target node; Wherein, the attribute information of the resident includes permission information, and the permission information is administrator permission or non - administrator permission; the permission information is used to determine whether to perform desensitization processing on the privacy information in the retrieved attribute information of the resident according to the permission information during the query process of the attribute information of the resident.
2. The method according to claim 1, wherein The method further includes: If there is a first target node identified by the feature vector in the community knowledge graph, update the attribute information of the resident saved for the first target node in the community knowledge graph according to the attribute information of the resident in the obtained sample data including the feature vector.
3. The method according to claim 2, wherein The method further includes: According to the social relationships of the residents saved for the updated first target node, for the second target nodes having social relationships with and connected to the first target node, update the social relationships corresponding to the connections between the first target node and the second target nodes; According to the social relationships of the residents saved for the updated first target node, search for the attribute information of the nodes not connected to the first target node in the community knowledge graph, connect the fourth target nodes having social relationships with the first target node, and save the social relationships corresponding to the connections between the first target node and the fourth target nodes.
4. A method for querying attribute information of residents, characterized in that, The method includes: According to the feature vector of the biometric characteristics of the query user obtained, determine whether there is a fifth target node corresponding to the target feature vector that matches the feature vector in the pre - constructed community knowledge graph, and wherein the biometric characteristics are voiceprint characteristics and / or face characteristics; If it exists, based on the query voice information input by the query user and the pre-saved template, determine the target information to be queried, search for the sixth target node in the community knowledge graph that meets the conditions corresponding to the target information, and output the attribute information of the residents saved for the sixth target node; Among them, the determining the target information to be queried according to the query voice information input by the query user and the pre-saved template includes: Based on the query voice information input by the query user, determine the text information corresponding to the query voice information based on the voice recognition model; Determine the target template in the pre-saved template that matches the text information according to the text information; Determine the target information to be queried in the community knowledge graph according to the text information and the target template; Among them, before outputting the attribute information of the residents saved for the sixth target node, the method further includes: Determine the permission information included in the attribute information of the residents of the fifth target node, where the permission information is administrator permission or non-administrator permission; If the permission information is non-administrator permission, determine whether the feature vector of the fifth target node matches the feature vector of the sixth target node, or determine whether the home address of the fifth target node is the same as the home address of the sixth target node. If both judgment results are negative, desensitize the privacy information in the attribute information of the residents saved for the sixth target node, and output the desensitized attribute information, where the privacy information includes ID number, phone number, and home address.
5. The method according to claim 4, characterized in that, The searching for the sixth target node in the community knowledge graph that meets the conditions corresponding to the target information includes: If the target information to be queried is the seventh target node, search for the sixth target node in the community knowledge graph that is connected to the seventh target node; If the target information to be queried is the target keyword, search for the sixth target node in the community knowledge graph whose resident attribute information contains the target keyword.
6. The method according to claim 4, wherein The method further includes: If the permission information is administrator permission, directly output the attribute information of the residents saved for the sixth target node.
7. The method according to claim 4, wherein If any one of the judgment results is positive, directly output the attribute information of the residents saved for the sixth target node.
Citation Information
Patent Citations
Social relationship determination method, device and apparatus, and computer-readable storage medium
CN109543078A
Method for constructing map and related device
CN109829072A
Voice assisting method and device based on knowledge graph
CN110781280A