Construction method and device for smart home knowledge graph, and electronic equipment
By employing a conditional normalized flow model and generative adversarial networks to perform hierarchical processing and sparse node completion on the smart home knowledge graph, the problems of data sparsity, unclear hierarchical structure, and data alignment difficulties in the smart home knowledge graph are solved, thus achieving high-quality knowledge graph construction.
Patent Information
- Application Number
- CN202510877992.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-27
- Publication Date
- 2025-10-28
AI Technical Summary
When constructing knowledge graphs in the smart home field, there are problems such as insufficient effective processing methods for sparse data, difficulty in establishing a clear hierarchical structure, and difficulty in data alignment, resulting in low quality of knowledge graphs.
The conditional normalized flow model is used to extract features and perform hierarchical processing on the data. Entities and relationships are hierarchically processed through vector representation and clustering algorithms. Generative adversarial networks are used to complete sparse nodes. Features are fused by combining deep learning and generative adversarial networks to generate reasonable attribute values and connection relationships.
It significantly improves the quality of the smart home knowledge graph, ensures the diversity and integrity of the data, enhances the organization and understandability of the knowledge graph, and strengthens the completeness and accuracy of the knowledge graph.
Smart Images

Figure CN120851157A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of smart home technology, such as a method and apparatus for constructing a smart home knowledge graph, and electronic equipment. Background Art
[0002] Building knowledge graphs in the smart home field currently faces numerous challenges. Due to the complexity and diversity of smart home systems, knowledge graph data comes from a wide range of sources and formats, including product specifications from device manufacturers, user behavior data, sensor data, and academic literature. This makes data integration and processing difficult, easily leading to problems such as data sparsity, low quality, and inconsistency.
[0003] To construct a knowledge graph for smart homes, a method for building a knowledge graph based on big data from smart communities has been disclosed, including: acquiring data; extracting knowledge from semi-structured and unstructured data to form second structured data; integrating the first structured data to form a preliminary smart community knowledge graph; knowledge representation: representing the second structured data and the first structured data; knowledge fusion: linking entities, relationships, and entity attributes in the second structured data and merging knowledge; resolving conflicts in the smart community knowledge graph construction process; and updating the smart community knowledge graph: updating the data schema layer and the data layer.
[0004] In the process of implementing the embodiments of this disclosure, at least the following problems were found in the related art:
[0005] It has shortcomings in dealing with specific problems in the field of smart homes, such as the lack of effective methods for processing sparse data, difficulty in establishing a clear hierarchical structure, susceptibility to overfitting, and difficulty in data alignment.
[0006] It should be noted that the information disclosed in the background section above is only used to enhance the understanding of the background of this application, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention
[0007] To provide a basic understanding of some aspects of the disclosed embodiments, a brief summary is given below. This summary is not intended as a general commentary, nor is it intended to identify key / important components or describe the scope of protection of these embodiments, but rather as a prelude to the detailed description that follows.
[0008] This disclosure provides a method, apparatus, and electronic device for constructing a smart home knowledge graph, thereby improving the quality of the constructed smart home knowledge graph.
[0009] In some embodiments, the method for constructing a smart home knowledge graph includes: converting collected data sources into vector representations to obtain a dataset as input to a conditionally normalized flow model; training the conditionally normalized flow model based on the dataset; performing hierarchical processing on the initial knowledge graph of the smart home using the conditionally normalized flow model; and completing the sparse nodes in the initial knowledge graph to obtain the smart home knowledge graph.
[0010] Optionally, a conditionally normalized flow model is trained based on the dataset, including: dividing the dataset into a training set, a validation set, and a test set; extracting data information from the training set to construct an initial model; selecting an optimization algorithm based on the data characteristics to train the initial model and obtain the conditionally normalized flow model; and inputting the validation set and the test set into the obtained conditionally normalized flow model to obtain the output metrics of the model to evaluate the model performance.
[0011] Optionally, an optimization algorithm is selected based on the characteristics of the data to train the initial model, including: adjusting the parameters of the initial model according to the regularization term; collecting the performance metrics of the model until the performance metrics no longer improve and then stopping the adjustment of the parameters of the initial model.
[0012] Optionally, extracting data information from the training set to construct an initial model includes: assigning different weights to data information from different sources in the training set; performing feature fusion on data information with different weights through deep learning or generative adversarial networks to obtain fused data; and using the fused data to construct an initial model.
[0013] Optionally, the initial knowledge graph of the smart home is processed hierarchically using the conditional normalized flow model, including: extracting features from entities and relationships in the initial knowledge graph using the conditional normalized flow model to obtain high-dimensional feature vectors; and clustering the high-dimensional feature vectors using a clustering algorithm to divide entities and relationships into different levels.
[0014] Optionally, the sparse nodes of information in the initial knowledge graph are completed, including: learning the distribution of the dataset using a conditional normalized flow model to generate new data; and using the new data as detailed information for the sparse nodes.
[0015] Optionally, after collecting the data source, the process also includes: cleaning and preprocessing the data source; and fusing the data source with the initial knowledge graph.
[0016] Optionally, after obtaining the smart home knowledge graph, the process also includes: acquiring and evaluating the metrics output by the smart home knowledge graph; and iterating the smart home knowledge graph based on the evaluation results.
[0017] In some embodiments, the apparatus for building a smart home knowledge graph includes a processor and a memory storing program instructions, the processor being configured to execute the method for building a smart home knowledge graph as described above when the program instructions are executed.
[0018] In some embodiments, the electronic device includes: an electronic device body; and the above-described apparatus for building a smart home knowledge graph, mounted on the electronic device body.
[0019] The method, apparatus, and electronic device for constructing a knowledge graph for smart homes provided in this disclosure can achieve the following technical effects:
[0020] First, the collected multi-source data is transformed into vector representations to form a unified dataset, which serves as input to the Conditional Normalized Flow (CMFL) model. This ensures that the diversity and integrity of the data are preserved. Second, the CMFL model is trained based on this dataset, effectively extracting complex features from the data, especially significantly improving the feature extraction capability for sparse data, thereby enhancing the quality of the knowledge graph. The trained model is then used to perform hierarchical processing on the initial knowledge graph of the smart home, mapping entities and relationships to different conceptual layers, making the knowledge graph more organized and understandable, and providing a better foundation for subsequent analysis and applications. Finally, for nodes with sparse information in the initial knowledge graph, the model's generative capabilities and external knowledge sources are used to complete the details, further enriching the knowledge graph's detailed information.
[0021] Thus, through layered processing and detailed completion, the embodiments of this disclosure enable the smart home knowledge graph to more comprehensively reflect various entities and relationships in the smart home domain, greatly improving the quality of the smart home knowledge graph.
[0022] The above general description and the description below are exemplary and illustrative only and are not intended to limit this application. Attached Figure Description
[0023] One or more embodiments are illustrated by way of example with reference to the accompanying drawings. These illustrations and drawings do not constitute a limitation on the embodiments. Elements having the same reference numerals in the drawings are shown as similar elements. The drawings are not to be scaled. And wherein:
[0024] Figure 1 This is a schematic diagram of the hardware environment for the method of constructing a knowledge graph for a smart home provided in this embodiment of the disclosure;
[0025] Figure 2 This is a schematic diagram of a method for constructing a knowledge graph for a smart home provided in an embodiment of this disclosure;
[0026] Figure 3This is a schematic diagram of another method for constructing a knowledge graph for a smart home provided in this embodiment of the disclosure;
[0027] Figure 4 This is a schematic diagram of another method for constructing a knowledge graph for a smart home provided in this embodiment of the disclosure;
[0028] Figure 5 This is a schematic diagram of another method for constructing a knowledge graph for a smart home provided in this embodiment of the disclosure;
[0029] Figure 6 This is a schematic diagram of another method for constructing a knowledge graph for a smart home provided in this embodiment of the disclosure;
[0030] Figure 7 This is a schematic diagram of an apparatus for constructing a knowledge graph for a smart home, provided in an embodiment of this disclosure. Detailed Implementation
[0031] To provide a more detailed understanding of the features and technical content of the embodiments of this disclosure, the implementation of the embodiments of this disclosure will be described in detail below with reference to the accompanying drawings. The accompanying drawings are for illustrative purposes only and are not intended to limit the embodiments of this disclosure. In the following technical description, for ease of explanation, several details are used to provide a full understanding of the disclosed embodiments. However, one or more embodiments may still be implemented without these details. In other cases, well-known structures and devices may be simplified in their depiction to simplify the drawings.
[0032] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate for the embodiments of this disclosure described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion.
[0033] Unless otherwise stated, the term "multiple" means two or more.
[0034] In this embodiment of the disclosure, the character " / " indicates that the objects before and after it are in an "or" relationship. For example, A / B means: A or B.
[0035] The term "and / or" describes an association between objects, indicating that three relationships can exist. For example, A and / or B means: A or B, or A and B.
[0036] The term "correspondence" can refer to an association or binding relationship. The correspondence between A and B means that there is an association or binding relationship between A and B.
[0037] With the continuous development of intelligent technologies, the smart home field is rapidly emerging. A smart home system encompasses numerous intelligent devices, sensors, and services, among which complex relationships exist. As a powerful knowledge representation and reasoning tool, the smart home knowledge graph has enormous application potential in this field. It can effectively organize and represent various entities (such as devices, users, and scenarios) and relationships (such as control relationships, connectivity relationships, and usage relationships) within a smart home, providing strong support for the analysis, decision-making, and innovation of smart home systems.
[0038] According to one aspect of the embodiments of this application, a method for constructing a knowledge graph for smart homes is provided. This method for constructing a knowledge graph for smart homes is widely applicable to whole-house intelligent digital control application scenarios such as smart homes, smart home ecosystems, and intelligence house ecosystems. Optionally, in this embodiment, the above-described method for constructing a knowledge graph for smart homes can be applied to, for example... Figure 1 The hardware environment shown consists of smart home device 102 and server 104. Figure 1 As shown, server 104 is connected to smart home device 102 via a network and can be used to provide services (such as application services) to terminals or clients installed on terminals. A database can be set up on the server or independently of the server to provide data storage services for server 104. Cloud computing and / or edge computing services can be configured on the server or independently of the server to provide data processing services for server 104.
[0039] The aforementioned networks may include, but are not limited to, at least one of the following: wired network, wireless network. The aforementioned wired network may include, but is not limited to, at least one of the following: wide area network, metropolitan area network, local area network. The aforementioned wireless network may include, but is not limited to, at least one of the following: Wi-Fi (Wireless Fidelity), Bluetooth. Smart home devices 102 may not be limited to PCs, mobile phones, tablets, smart air conditioners, smart range hoods, smart refrigerators, smart ovens, smart stoves, smart washing machines, smart water heaters, smart washing equipment, smart dishwashers, smart projectors, smart TVs, smart clothes racks, smart curtains, smart audio-visual equipment, smart sockets, smart speakers, smart speakers, smart fresh air systems, smart kitchen and bathroom equipment, smart bathroom equipment, smart robot vacuum cleaners, smart window cleaning robots, smart mopping robots, smart air purifiers, smart steam ovens, smart microwave ovens, smart water heaters, smart air purifiers, smart water dispensers, smart door locks, etc.
[0040] It should be understood that Figure 1The number of smart home devices and servers shown is merely illustrative. Depending on actual needs, there can be any number of smart home devices and servers. For example, one server can correspond to multiple smart home devices.
[0041] It should be noted that the method for constructing a knowledge graph for smart homes provided in this disclosure is generally executed by a mobile terminal, home appliances, a router, and a cloud server. Correspondingly, the network access device for home appliances is generally set in the mobile terminal, home appliances, router, and cloud server.
[0042] Combination Figure 2 As shown, this disclosure provides a method for constructing a knowledge graph for smart homes, including:
[0043] S201, the server converts the collected data sources into vector representations and uses the dataset as input to the conditionally normalized flow model.
[0044] S202, the server trains a conditionally normalized flow model based on the dataset.
[0045] S203, the server uses the conditional normalized flow model to perform layered processing on the initial knowledge graph of the smart home.
[0046] S204, the server completes the sparse nodes in the initial knowledge graph to obtain the smart home knowledge graph.
[0047] The method for constructing a knowledge graph for smart homes, as provided in this disclosure, transforms collected multi-source data (such as text, database records, expert knowledge, etc.) into vector representations, forming a unified dataset that serves as input to a conditionally normalized flow model. This process utilizes natural language processing techniques and feature extraction methods to convert data of different formats into vector forms suitable for model processing, ensuring the preservation of data diversity and integrity. Next, a conditionally normalized flow model is trained based on this dataset. Through the design of encoders, decoders, and invertible transformation functions, this model effectively extracts complex features from the data. In particular, the sparse data-aware encoder significantly improves the feature extraction capability for sparse data, thereby enhancing the quality of the knowledge graph. The trained model is then used to perform hierarchical processing on the initial knowledge graph for smart homes. Through clustering algorithms and domain knowledge, entities and relationships are mapped to different conceptual layers, making the knowledge graph more organized and understandable, providing a better foundation for subsequent analysis and applications. Finally, for nodes with sparse information in the initial knowledge graph, the model's generative capabilities and external knowledge sources are used to complete the details. By combining generative models such as generative adversarial networks or variational autoencoders, reasonable attribute values and connection relationships are generated, further refining the detailed information of the knowledge graph. Thus, through layered processing and detail completion, this embodiment of the disclosure enables the smart home knowledge graph to more comprehensively reflect various entities and relationships in the smart home domain, significantly improving the completeness and accuracy of the knowledge graph and greatly enhancing its quality.
[0048] Optionally, a conditionally normalized flow model is trained based on the dataset, including: dividing the dataset into a training set, a validation set, and a test set; extracting data information from the training set to construct an initial model; selecting an optimization algorithm based on the data characteristics to train the initial model and obtain the conditionally normalized flow model; and inputting the validation set and the test set into the obtained conditionally normalized flow model to obtain the output metrics of the model to evaluate the model performance.
[0049] In this embodiment, the dataset is first divided into training, validation, and test sets. Stratified sampling and other methods ensure consistent distribution across datasets, providing a reliable data foundation for model training and evaluation. Next, an initial model is constructed using the data from the training set. The design of the encoder, decoder, and invertible transformation function enables the model to effectively extract complex features from the data, particularly for sparse data. During model training, appropriate optimization algorithms, such as Adam, RMSprop, or Adagrad, are selected based on the data characteristics. Strategies such as dynamically adjusting the learning rate and employing early stopping are used to prevent overfitting and improve the model's generalization ability. After training, the validation and test sets are input into the obtained conditionally normalized flow model. The model's performance is comprehensively evaluated by calculating the output metrics (such as accuracy, recall, and F1 score).
[0050] This process not only ensures a good fit of the model to the training data, but more importantly, it verifies the model's generalization ability and stability on unseen data through evaluation on the validation and test sets. These steps effectively address issues such as data sparsity, low quality, and model overfitting in the construction of smart home knowledge graphs, significantly improving the quality and application effectiveness of the knowledge graph and providing a solid technical foundation for intelligent analysis, decision support, and innovative applications in the smart home field.
[0051] Optionally, an optimization algorithm is selected based on the characteristics of the data to train the initial model, including: selecting an optimization algorithm based on the size, complexity, and sparsity of the data, and adjusting the learning rate of the optimization algorithm; adjusting the parameters of the initial model using the optimization algorithm based on the regularization term; collecting the performance metrics of the model, and stopping the adjustment of the parameters of the initial model when the performance metrics no longer improve.
[0052] In this embodiment, firstly, a suitable optimization algorithm, such as Adam, RMSprop, or Adagrad, is selected based on the characteristics of the data (e.g., size, complexity, and sparsity). Generally, the Adam algorithm is suitable for large-scale data, the RMSprop algorithm can be chosen for highly complex data, while the Adagrad algorithm is suitable for sparse data. Adaptive learning rate adjustment can effectively accelerate the model's convergence process while avoiding training instability caused by improper learning rate settings.
[0053] After selecting a suitable optimization algorithm, the model is trained using this algorithm. During training, regularization terms (such as L1 or L2 regularization) are introduced to adjust the initial model parameters. Regularization terms prevent overfitting and improve the model's generalization ability by constraining the magnitude of the model parameters. For example, L1 regularization can promote the sparsity of model parameters, thereby selecting more representative features. L2 regularization, on the other hand, makes the model parameters smoother by limiting the sum of squares of the parameters, avoiding the impact of excessively large parameter values on model performance.
[0054] During training, performance metrics of the model are continuously collected, such as training loss, validation loss, accuracy, recall, and F1 score. These metrics reflect the model's performance on training and validation data in real time. When performance metrics no longer improve over several consecutive training epochs, the parameters of the initial model are no longer adjusted. This effectively avoids overfitting the model on the training data while preserving its generalization ability on unseen data. These steps enable efficient training and optimization of the initial model. The introduction of regularization terms effectively prevents overfitting, and the selection and dynamic adjustment of the optimization algorithm accelerate the model's convergence speed. Ultimately, these factors collectively improve the performance and generalization ability of the conditional normalized flow model.
[0055] Optionally, extracting data information from the training set to construct an initial model includes: assigning different weights to data information from different sources in the training set; performing feature fusion on data information with different weights through deep learning or generative adversarial networks to obtain fused data; and using the fused data to construct an initial model.
[0056] Specifically, the first step is to assign different weights to data from different sources in the training set. Data sources may include device logs, user behavior data, expert knowledge, academic literature, etc., and the importance and reliability of data from different sources vary within the knowledge graph. For example, technical specifications provided by device manufacturers may have high accuracy, while user behavior data, although noisy, can reflect actual usage scenarios. Therefore, it is necessary to assign weights to each data source based on factors such as data authority, timeliness, and relevance, using expert experience or data-driven methods.
[0057] Deep learning techniques or generative adversarial networks (GANs) are used to fuse features from data with different weights. Deep learning models (such as multilayer perceptrons, convolutional neural networks, or recurrent neural networks) can automatically extract high-level features from data and fuse features from different sources through weighted summation, feature concatenation, or attention mechanisms. GANs, through adversarial training between generators and discriminators, generate more realistic and accurate fused data, further improving feature quality. During the fusion process, the weights ensure that features from important data sources dominate the fused result while also considering information from other data sources, thus improving the model's adaptability to data diversity.
[0058] Finally, an initial model is constructed using the fused data. This model can be an architecture based on conditionally normalized flow, or another suitable for handling complex data relationships. The initial model constructed in this way can better capture the complex characteristics and intrinsic relationships of data in the smart home domain, while reducing noise and inconsistencies caused by differences in data sources.
[0059] This significantly improves the feature representation ability and generalization performance of the initial model. By assigning different weights to data from different sources, the model can more accurately reflect the actual needs and scenarios in the smart home field. Feature fusion further enhances the model's ability to understand complex data, exhibiting stronger robustness when dealing with sparse, noisy, and multi-source data.
[0060] Optionally, the initial knowledge graph of the smart home is processed hierarchically using the conditional normalized flow model, including: extracting features from entities and relationships in the initial knowledge graph using the conditional normalized flow model to obtain high-dimensional feature vectors; and clustering the high-dimensional feature vectors using a clustering algorithm to divide entities and relationships into different levels.
[0061] Combination Figure 3 As shown, this disclosure provides another method for constructing a knowledge graph for smart homes, including:
[0062] S301, the server converts the collected data sources into vector representations and uses the dataset as input to the conditionally normalized flow model.
[0063] S302, the server trains a conditionally normalized flow model based on the dataset.
[0064] S303, the server uses the conditional normalized flow model to extract features from entities and relations in the initial knowledge graph to obtain high-dimensional feature vectors.
[0065] S304, the server uses a clustering algorithm to cluster high-dimensional feature vectors to divide entities and relationships into different levels.
[0066] S305, the server completes the sparse nodes in the initial knowledge graph to obtain the smart home knowledge graph.
[0067] In this embodiment, the trained conditionally normalized flow model is first applied to entities and relations in the initial knowledge graph. The encoder part of the model extracts features from the entities and relations, transforming them into high-dimensional feature vectors. These high-dimensional feature vectors effectively capture the core semantic information and complex features of entities and relations, providing a rich semantic foundation for subsequent hierarchical processing.
[0068] Clustering algorithms (such as K-Means and hierarchical clustering) are used to perform cluster analysis on the extracted high-dimensional feature vectors. Clustering can group entities and relationships with similar characteristics into the same level, thus forming a hierarchical knowledge graph structure with clear semantic and functional divisions. For example, in the smart home field, sensor devices may be clustered into a lower level, controller devices into an intermediate level, and actuator devices into a higher level. The hierarchical structure not only reflects the level of abstraction of entities and relationships but also clearly demonstrates the functions and interaction patterns of entities in the smart home system.
[0069] The feature extraction capability of the conditionally normalized flow model ensures that high-dimensional feature vectors accurately reflect the semantic information of entities and relationships, providing high-quality input for clustering. Secondly, clustering algorithms can automatically discover the inherent structure in the data, resulting in hierarchical results with good semantic consistency and functional relevance. Hierarchical processing not only improves the organization and understandability of the knowledge graph but also provides a clearer hierarchical division for subsequent analysis and applications. For example, in fault diagnosis, entities and relationships at relevant levels can be quickly located; in energy management, the collaborative operation of equipment can be optimized based on the hierarchical structure. Furthermore, hierarchical processing simplifies the complexity of the knowledge graph, reduces the computational cost of subsequent processing, and improves the overall efficiency of the system.
[0070] Optionally, the sparse nodes of information in the initial knowledge graph are completed, including: learning the distribution of the dataset using a conditional normalized flow model to generate new data; and using the new data as detailed information for the sparse nodes.
[0071] Combination Figure 4 As shown, this disclosure provides another method for constructing a knowledge graph for smart homes, including:
[0072] S401, the server converts the collected data sources into vector representations, and obtains the dataset as input to the conditionally normalized flow model.
[0073] S402, the server trains a conditionally normalized flow model based on the dataset.
[0074] S403, the server uses the conditional normalized flow model to perform layered processing on the initial knowledge graph of the smart home.
[0075] S404: The server uses a conditionally normalized flow model to learn the distribution of the dataset and generate new data.
[0076] S405, the server uses the new data as detailed information for sparse nodes.
[0077] In this embodiment, a trained Conditional Normalized Flow (CDFlow) model is used to learn the overall distribution of the dataset. The CDFlow model, through its generative capabilities, can capture the inherent characteristics and distribution patterns of the data, thus providing a theoretical basis for generating new data. Based on the learned data distribution, the model can generate new data samples that are similar to existing data but also possess diversity. These new data samples maintain semantic and structural consistency with the original data but can fill in missing information in sparse nodes of the knowledge graph. For example, for a smart device node, if certain attributes (such as power range, applicable scenarios, etc.) are missing, the model can generate reasonable attribute values as detailed information based on the characteristics of other similar devices, and use the generated new data as detailed information to complete the sparse node. This not only enriches the content of the knowledge graph but also enhances the correlation between sparse nodes and other nodes. Through detailed completion, sparse nodes can be better integrated into the overall structure of the knowledge graph, thereby improving the overall quality and usability of the knowledge graph.
[0078] Optionally, after collecting the data source, the process also includes: cleaning and preprocessing the data source; and fusing the data source with the initial knowledge graph.
[0079] Combination Figure 5 As shown, this disclosure provides another method for constructing a knowledge graph for smart homes, including:
[0080] S501, the server cleans and preprocesses the data source.
[0081] In S502, the server merges the data source with the initial knowledge graph.
[0082] In S503, the server converts the collected data sources into vector representations and uses the dataset as input to the conditionally normalized flow model.
[0083] S504, the server trains a conditionally normalized flow model based on the dataset.
[0084] S505, the server uses the conditional normalized flow model to perform layered processing on the initial knowledge graph of the smart home.
[0085] S506, the server completes the sparse nodes in the initial knowledge graph to obtain the smart home knowledge graph.
[0086] In this embodiment, the collected multi-source data (such as device logs, user behavior data, expert knowledge, etc.) is first cleaned to remove noisy data, fill in missing values, and standardize the data format. For example, outliers are detected and removed by setting thresholds, missing data is filled using statistical methods, or different types of data are converted into a unified format through standardization. Next, data preprocessing is performed, including feature extraction and vectorization. Text data is converted into word vectors, numerical data is normalized, and categorical data is encoded, thereby transforming the multi-source data into a vector form suitable for model processing, thus ensuring data quality and consistency.
[0087] The cleaned and preprocessed data is then fused with the initial knowledge graph. Entity recognition technology identifies entities in the data source and matches them with nodes in the knowledge graph. Relationship extraction technology extracts relationships between entities from the data source and aligns them with relationships in the knowledge graph. For example, named entity recognition algorithms match device names from external data with device nodes in the knowledge graph, or extract connections between devices from user reviews and add them to the knowledge graph. Furthermore, data fusion strategies, such as weighted averaging or feature concatenation, are employed to merge attribute values from external data with attribute values of corresponding nodes in the knowledge graph, further enriching the knowledge graph's content.
[0088] Optionally, after obtaining the smart home knowledge graph, the process also includes: acquiring and evaluating the metrics output by the smart home knowledge graph; and iterating the smart home knowledge graph based on the evaluation results.
[0089] Combination Figure 6 As shown, this disclosure provides another method for constructing a knowledge graph for smart homes, including:
[0090] S601, the server converts the collected data sources into vector representations and uses the dataset as input to the conditionally normalized flow model.
[0091] S602, the server trains and obtains a conditionally normalized flow model based on the dataset.
[0092] S603, the server uses the conditional normalized flow model to perform layered processing on the initial knowledge graph of the smart home.
[0093] S604, the server completes the sparse nodes in the initial knowledge graph to obtain the smart home knowledge graph.
[0094] S605: The server acquires and evaluates the metrics output by the smart home knowledge graph.
[0095] S606: The server iterates the smart home knowledge graph based on the evaluation results.
[0096] In this embodiment, a comprehensive evaluation metric system is first required to measure the performance of the knowledge graph. Metrics typically include completeness (e.g., node coverage and relationship coverage), accuracy (e.g., data accuracy and relationship accuracy), consistency (e.g., data format consistency and semantic consistency), and usability (e.g., support for smart home scenarios). By quantitatively evaluating the metrics output by the knowledge graph, its performance in different aspects can be intuitively understood.
[0097] The knowledge graph is iteratively optimized based on the evaluation results. If the evaluation shows insufficient completeness of the knowledge graph, the coverage of nodes and relationships can be increased by adjusting the data collection strategy or optimizing the model's generation capabilities. If the accuracy is low, further data source cleaning, optimization of feature extraction methods, or adjustment of the model's regularization parameters are needed to reduce noise and erroneous information. Consistency issues can be addressed by standardizing data formats, unifying semantic definitions, or optimizing data fusion strategies. Furthermore, the hierarchical structure of the knowledge graph can be adjusted based on the evaluation results, the detail completion strategy can be optimized, or new data sources can be introduced to enhance the knowledge graph's usability.
[0098] Combination Figure 7 As shown, this disclosure provides an apparatus 70 for constructing a knowledge graph for a smart home, including a processor 700 and a memory 701. Optionally, the apparatus 70 may further include a communication interface 702 and a bus 703. The processor 700, communication interface 702, and memory 701 can communicate with each other via the bus 703. The communication interface 702 can be used for information transmission. The processor 700 can call logical instructions in the memory 701 to execute the method for constructing a knowledge graph for a smart home as described in the above embodiments.
[0099] Furthermore, the logic instructions in the aforementioned memory 701 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium.
[0100] The memory 701, as a computer-readable storage medium, can be used to store software programs and computer-executable programs, such as program instructions / modules corresponding to the methods in the embodiments of this disclosure. The processor 700 executes functional applications and data processing by running the program instructions / modules stored in the memory 701, thereby implementing the method for constructing a smart home knowledge graph in the above embodiments.
[0101] The memory 701 may include a program storage area and a data storage area. The program storage area may store the operating system and application programs required for at least one function; the data storage area may store data created based on the use of the terminal device. Furthermore, the memory 701 may include high-speed random access memory and may also include non-volatile memory.
[0102] This disclosure provides an electronic device, including: an electronic device body, and the aforementioned apparatus for constructing a smart home knowledge graph. The apparatus for constructing a smart home knowledge graph is mounted on the electronic device body. The mounting relationship described herein is not limited to placement within the electronic device body, but also includes mounting connections with other components of the electronic device, including but not limited to physical connections, electrical connections, or signal transmission connections. Those skilled in the art will understand that the apparatus for constructing a smart home knowledge graph can be adapted to suitable electronic device bodies to achieve other feasible embodiments.
[0103] The technical solutions of this disclosure can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes one or more instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in this disclosure. The aforementioned storage medium can be a non-transitory storage medium, such as a USB flash drive, external hard drive, read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk, etc., and other media capable of storing program code.
[0104] The foregoing description and accompanying drawings fully illustrate embodiments of this disclosure to enable those skilled in the art to practice them. Other embodiments may include structural, logical, electrical, procedural, and other changes. The embodiments represent only possible variations. Individual components and functions are optional unless explicitly required, and the order of operation may vary. Parts and features of some embodiments may be included in or replace parts and features of other embodiments. Moreover, the terminology used in this application is for describing embodiments only and is not intended to limit the claims. As used in the description of embodiments and claims, the singular forms “a,” “an,” and “the” are intended to equally include the plural forms unless the context clearly indicates otherwise. Similarly, the term “and / or” as used in this application means including one or more of the associated listed items and all possible combinations thereof. Additionally, when used in this application, the term "comprise" and its variations "comprises" and / or "comprising" refer to the presence of stated features, integrals, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components, and / or groups thereof. Without further limitations, an element defined by the phrase "comprises a..." does not exclude the presence of other identical elements in the process, method, or apparatus that includes said element. In this document, each embodiment may focus on the differences from other embodiments, and similar or identical parts between embodiments can be referred to mutually. For methods, products, etc., disclosed in the embodiments, if they correspond to the method section disclosed in the embodiments, the relevant parts can be referred to the description of the method section.
[0105] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the embodiments of this disclosure. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0106] The methods and products (including but not limited to devices and equipment) disclosed in the embodiments herein can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For instance, the division of units may be merely a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to implement this embodiment according to actual needs. In addition, the functional units in the embodiments of this disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0107] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than that shown in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. In the descriptions corresponding to the flowcharts and block diagrams in the accompanying drawings, the operations or steps corresponding to different blocks may also occur in a different order than disclosed in the description, and sometimes there is no specific order between different operations or steps. For example, two consecutive operations or steps may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. Each block in a block diagram and / or flowchart, and combinations of blocks in a block diagram and / or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
Claims
1. A method for constructing a knowledge graph for smart homes, characterized in that, include: The collected data sources are converted into vector representations to obtain the dataset as input to the conditionally normalized flow model; A conditionally normalized flow model is obtained by training the dataset. The initial knowledge graph of the smart home is processed in layers using the conditional normalized flow model. The sparse nodes in the initial knowledge graph are filled in to obtain the smart home knowledge graph.
2. The construction method according to claim 1, characterized in that, The conditionally normalized flow model is trained based on the dataset, including: The dataset is divided into a training set, a validation set, and a test set; Extract data from the training set to construct an initial model; Based on the characteristics of the data, an optimization algorithm is selected, the initial model is trained, and a conditionally normalized flow model is obtained. The conditionally normalized flow model is obtained by inputting the validation set and the test set, and the output metrics of the model are obtained to evaluate the model performance.
3. The construction method according to claim 2, characterized in that, Based on the characteristics of the data, an optimization algorithm is selected, and the initial model is trained, including: Select an optimization algorithm based on the size, complexity, and sparsity of the data, and adjust the learning rate of the optimization algorithm accordingly; The parameters of the initial model are adjusted based on the regularization term using an optimization algorithm; Collect performance metrics of the model until the performance metrics no longer improve, then stop adjusting the parameters of the initial model.
4. The construction method according to claim 2, characterized in that, Extracting data information from the training set to build an initial model includes: Different weights are assigned to data from different sources in the training set; By using deep learning or generative adversarial networks to fuse features of data information with different weights, fused data can be obtained. Build an initial model using the fused data.
5. The construction method according to any one of claims 1 to 4, characterized in that, The initial knowledge graph of the smart home is processed hierarchically using the conditionally normalized flow model, including: The conditionally normalized flow model is used to extract features from entities and relations in the initial knowledge graph to obtain high-dimensional feature vectors. Clustering algorithms are used to cluster high-dimensional feature vectors to classify entities and relationships into different levels.
6. The construction method according to any one of claims 1 to 4, characterized in that, Complete the sparse nodes of information in the initial knowledge graph, including: The distribution of the dataset is learned using a conditionally normalized flow model to generate new data; The new data is used as detailed information for sparse nodes.
7. The construction method according to any one of claims 1 to 4, characterized in that, After the data source is collected, it also includes: Clean and preprocess the data source; Data fusion is performed between the data source and the initial knowledge graph.
8. The construction method according to any one of claims 1 to 4, characterized in that, After obtaining the smart home knowledge graph, it also includes: Obtain and evaluate the metrics output by the smart home knowledge graph; The smart home knowledge graph is iterated based on the evaluation results.
9. An apparatus for constructing a knowledge graph for a smart home, comprising a processor and a memory storing program instructions, characterized in that, The processor is configured to execute, when running the program instructions, the method for constructing a knowledge graph for a smart home as described in any one of claims 1 to 8.
10. An electronic device, characterized in that, include: The electronic device itself; The apparatus for constructing a knowledge graph for a smart home as described in claim 9 is installed on the electronic device body.