Construction method and device of scene knowledge graph based on thinking chain, application method and electronic equipment
Patent Information
- Application Number
- CN202411075522.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-07
- Publication Date
- 2024-11-12
- Estimated Expiration
- 2044-08-07
AI Technical Summary
The existing smart home control system lacks an in-depth understanding of user behavior and cannot accurately generate scenarios that meet user needs.
Using a scenario knowledge graph construction method based on thinking chain, by constructing an initial knowledge graph, the user's thinking chain is acquired, and transformed into the relationship edges of the connecting nodes of the knowledge graph, calculating the relationship weight, adjusting the link weight, and managing global factors. To generate target scenarios that meet user needs.
It has achieved an in-depth understanding of user behavior, can generate scenarios that meet user needs more accurately, and improves the intelligence of the user experience and system.
Smart Images

Figure CN118940830A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of smart home, and specifically, to a method and device for constructing a scene knowledge graph based on a thought chain, an application method, and an electronic device. Background Art
[0002] Smart home uses communication technology, network technology, security technology and automatic control technology to establish efficient residential facilities and home management systems to improve home safety, convenience, comfort, energy saving and environmental protection.
[0003] As the Internet of Things and artificial intelligence technologies become increasingly mature, the smart home industry is developing rapidly, requiring the system to generate scenarios that meet user needs.
[0004] The related art discloses a smart home control system that controls home appliances through voice commands.
[0005] In the process of implementing the embodiments of the present disclosure, it is found that there are at least the following problems in the related art:
[0006] The related technology controls home appliances through predefined commands and manually set commands, lacks a deep understanding of user behavior, and cannot accurately generate scenarios that meet user needs.
[0007] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present application, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention
[0008] In order to provide a basic understanding of some aspects of the disclosed embodiments, a brief summary is given below. The summary is not an extensive review, nor is it intended to identify key / critical components or delineate the scope of protection of these embodiments, but rather serves as a prelude to the detailed description that follows.
[0009] The embodiments of the present application provide a method and device for constructing a scene knowledge graph based on a thought chain, an application method, and an electronic device, which can more accurately generate scenes that meet user needs.
[0010] In some embodiments, the method for constructing a scene knowledge graph based on a thought chain includes: constructing an initial knowledge graph; wherein the nodes of the initial knowledge graph represent associated entities for realizing a target scene; obtaining a user's thought chain; wherein the thought chain represents an interaction mode between a user and a smart home device, and / or a behavior path between smart home devices; converting the thought chain into a relationship edge connecting the nodes of the initial knowledge graph to obtain a scene knowledge graph, so as to obtain the optimal path for realizing the target scene according to the scene knowledge graph; wherein the relationship edge represents the implementation path of the connecting nodes.
[0011] Optionally, obtaining the user's thought chain includes: creating an event sequence for the user based on smart home device data and environmental data in a database; wherein the event sequence includes user operation change events, device state change events, and environmental condition change events; inputting the user's event sequence into a deep learning model to obtain a behavior pattern output by the deep learning model; wherein the behavior pattern represents a combination of events occurring in a specific order in the event sequence; matching the user with the behavior pattern to obtain the user's thought chain.
[0012] Optionally, smart home device data and environmental data are obtained in the following manner: an original database is obtained; wherein the original data includes user operation data, device response data, device status data and environmental parameter data; the original data in the original database is formatted so that the format of the original data matches the input end of the deep learning model; feature screening is performed on the format-converted original data to obtain smart home device data and environmental data, and the smart home device data and environmental data are stored in the database.
[0013] Optionally, the thought chain is converted into the relationship edges of the connecting nodes of the initial knowledge graph, including: marking the node status and priority classification of the connecting nodes; decomposing the thought chain into one or more relationship edges, and adding them to the connecting nodes corresponding to the relationship edges; assigning corresponding attributes to each relationship edge; wherein the attributes include type, direction and relationship weight.
[0014] Optionally, the relationship weight is calculated in the following manner: according to the user behavior log, the frequency of each event sequence in the thought chain is calculated; and the calculated frequency is mapped to the relationship weight.
[0015] Optionally, assigning corresponding attributes to each relationship edge includes: regularizing the relationship weight so that the relationship weight is within a threshold range; and assigning the relationship weight of each event sequence in the thought chain to the relationship edge corresponding to each event sequence.
[0016] Optionally, the method for constructing a scene knowledge graph based on a thought chain also includes: collecting user feedback data; adjusting the link weights of local links of the thought chain according to the user feedback data; and / or managing global factors of the scene knowledge graph according to the user feedback data; wherein the global factors include relationship edge weights and thought chain length scales.
[0017] In some embodiments, the application method of the scenario knowledge graph based on the thought chain includes: determining the user's current state and environmental parameters; based on the user's current state and environmental parameters, using the scenario knowledge graph as described above to search for the optimal path to achieve the target scene; sending control instructions to the smart device in the order of the optimal path, controlling the smart device to perform operations to generate the target user scene.
[0018] In some embodiments, the device for constructing a scene knowledge graph based on a thought chain includes a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to execute through the computer program: a method for constructing a scene knowledge graph based on a thought chain as described above; or an application method for a scene knowledge graph based on a thought chain as described above.
[0019] In some embodiments, the electronic device includes: an electronic device body; and a device for constructing a scene knowledge graph based on a thinking chain as described above, which is installed on the electronic device body.
[0020] The method, storage medium, and electronic device for generating a scene provided in the embodiments of the present application can achieve the following technical effects:
[0021] In the embodiment of the present application, the user's thought chain is obtained to determine the user's needs. The thought chain is converted into the relationship edge of the connection node of the initial knowledge graph, and a scenario knowledge graph can be constructed in combination with the user's needs to obtain the optimal path to achieve the target scenario based on the scenario knowledge graph, and generate a target scenario that meets the user's needs. Compared with the lack of in-depth understanding of user behavior in related technologies, the scenario knowledge graph in the embodiment of the present application is constructed based on the user's thought chain. Therefore, the use of this application can more deeply understand the user's behavior, and then, can more accurately generate scenarios that meet user needs.
[0022] The above general description and the following description are exemplary and explanatory only and are not intended to limit the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0024] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0025] Figure 1 It is a hardware environment schematic diagram of a method for constructing a scene knowledge graph based on a thought chain according to an embodiment of the present application;
[0026] Figure 2 It is a schematic diagram of a method for constructing a scene knowledge graph based on a thought chain provided in an embodiment of the present application;
[0027] Figure 3 It is a partial schematic diagram of a knowledge graph provided in an embodiment of the present application;
[0028] Figure 4 is a schematic diagram of another method for constructing a scene knowledge graph based on a thought chain provided in an embodiment of the present application;
[0029] Figure 5 It is a schematic diagram of an application method of a scene knowledge graph based on a thought chain provided in an embodiment of the present application;
[0030] Figure 6 It is a schematic diagram of a device for constructing a scene knowledge graph based on a thought chain provided in an embodiment of the present application. DETAILED DESCRIPTION
[0031] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0032] It should be noted that the terms "first", "second" etc. in the technical solutions recorded in the present application are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable in appropriate circumstances, so that the embodiments of the present application described herein can be implemented in a sequence other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, the process, method, system, product or equipment comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or equipment.
[0033] According to one aspect of the embodiments of the present application, a method for constructing a scene knowledge graph based on a thought chain is provided. The method for constructing a scene knowledge graph based on a thought chain is widely used in smart home (Smart Home), smart home, smart home device ecology, smart residential (Intelligence House) ecology and other whole-house intelligent digital control application scenarios. Optionally, in this embodiment, the above-mentioned method for constructing a scene knowledge graph based on a thought chain can be applied to Figure 1 In the hardware environment composed of the terminal device 102 and the server 104 shown in FIG. Figure 1 As shown, the server 104 is connected to the terminal device 102 via a network, and can be used to provide services (such as application services, etc.) for the terminal or a client installed on the terminal. A database can be set on the server or independently of the server to provide data storage services for the server 104. Cloud computing and / or edge computing services can be configured on the server or independently of the server to provide data computing services for the server 104.
[0034] The network may include but is not limited to at least one of the following: wired network, wireless network. The wired network may include but is not limited to at least one of the following: wide area network, metropolitan area network, local area network, and the wireless network may include but is not limited to at least one of the following: WIFI (Wireless Fidelity), Bluetooth. The terminal device 102 may be but is not limited to a PC, a mobile phone, a tablet computer, a smart air conditioner, a smart range hood, a smart refrigerator, a smart oven, a smart stove, a smart washing machine, a smart water heater, a smart washing device, a smart dishwasher, a smart projection device, a smart TV, a smart clothes drying rack, a smart curtain, a smart audio and video, a smart socket, a smart speaker, a smart fresh air device, a smart kitchen and bathroom device, a smart bathroom device, a smart sweeping robot, a smart window cleaning robot, a smart mopping robot, a smart air purification device, a smart steamer, a smart microwave oven, a smart kitchen treasure, a smart purifier, a smart water dispenser, a smart door lock, etc.
[0035] It should be understood that Figure 1 The number of terminal devices and servers in the figure is only for illustration. According to actual needs, there may be any number of terminal devices and servers. For example, one terminal device may correspond to multiple servers.
[0036] Combination Figure 2 As shown, the embodiment of the present application provides a method for constructing a scene knowledge graph based on a thought chain, including:
[0037] S201, the server constructs an initial knowledge graph; wherein the nodes of the initial knowledge graph represent associated entities that realize the target scenario.
[0038] S202, the server obtains the user's thought chain; wherein the thought chain represents the interaction mode between the user and the smart home device, and / or the behavior path between the smart home devices.
[0039] S203, the server converts the thought chain into the relationship edge of the connection node of the initial knowledge graph, obtains the scene knowledge graph, and obtains the optimal path to realize the target scene according to the scene knowledge graph; wherein the relationship edge represents the realization path of the connection node.
[0040] By adopting the method for constructing a scene knowledge graph based on a thought chain provided in an embodiment of the present application, the user's thought chain is obtained and the user's needs can be determined. The thought chain is converted into the relationship edge of the connection node of the initial knowledge graph, and a scene knowledge graph can be constructed in combination with the user's needs, so as to obtain the optimal path to achieve the target scene according to the scene knowledge graph, and generate a target scene that meets the user's needs. Compared with the lack of in-depth understanding of user behavior in related technologies, the scene knowledge graph in the embodiment of the present application is constructed based on the user's thought chain. Therefore, the use of this application can more deeply understand the user's behavior, and then, it can more accurately generate scenes that meet user needs. By way of example, the optimal path can be the shortest path. In actual applications, control instructions are sent to the corresponding smart devices in sequence according to the searched path order until all operations are completed and the entire target scene is generated. Figure 2 In the embodiment shown, the method is run on a server. In other embodiments, the method can also be run on a terminal device, which is not described in detail. In actual applications, the steps implemented by the terminal device and the server can be set according to actual conditions.
[0041] Optionally, obtaining the user's thought chain includes: creating an event sequence for the user based on smart home device data and environmental data in a database; wherein the event sequence includes user operation change events, device state change events, and environmental condition change events; inputting the user's event sequence into a deep learning model to obtain a behavior pattern output by the deep learning model; wherein the behavior pattern represents a combination of events occurring in a specific order in the event sequence; matching the user with the behavior pattern to obtain the user's thought chain.
[0042] In the disclosed embodiment, the event sequence of each user is input into the deep learning model, and the event combination occurring in a specific order is output, thereby obtaining a thought chain reflecting the event combination. In this way, the constructed thought chain can reflect the user's behavior habits and preferences, help predict future scenarios, and further enhance the user's experience.
[0043] Optionally, data is collected from smart home devices and environmental sensors, and the data is preprocessed to obtain smart home device data and environmental data. In this way, high-quality, well-structured, and easy-to-process or analyze data can be obtained, providing a basis for building a thinking chain.
[0044] Optionally, smart home device data and environmental data are obtained in the following manner: an original database is obtained; wherein the original data includes user operation data, device response data, device status data and environmental parameter data; the original data in the original database is formatted so that the format of the original data matches the input end of the deep learning model; feature screening is performed on the format-converted original data to obtain smart home device data and environmental data, and the smart home device data and environmental data are stored in the database.
[0045] First, data can be collected periodically according to the set collection frequency and accuracy. For example, temperature and humidity can be collected every 5 minutes, and activity logs can be collected in real time based on event triggers. In addition, the collected data is converted into data in a unified format that meets the requirements, such as standardization of date data and time data, unification of abbreviations and symbols, unification of units, and encoding of enumerated type data. Various types of home data from multiple sensors and devices at multiple time points can be obtained to form a raw data set that fully covers the smart home.
[0046] Then, the original data set is preprocessed, which includes data cleaning, processing missing values, and extracting features.
[0047] Data cleaning can include removing data from the original data set that is significantly out of the normal range or significantly different from the majority of data, and correcting or removing corrupted or erroneous log entries.
[0048] Handling missing values can include deleting records with missing values, using simple interpolation (such as mean interpolation for numerical variables and mode interpolation for categorical variables) or complex prediction methods (such as regression algorithms, K-nearest neighbor algorithms) to fill in the missing values.
[0049] Feature extraction can include calculating statistical features (such as device power-on time and frequency) based on historical records, generating interactive features (such as the number of times the TV and air conditioner are turned on at the same time), and then using expert experience selection or univariate statistical testing or stepwise regression or model-based selection and other methods to screen out the features that are most helpful for prediction.
[0050] For example, the collected data may include the specific time when users turn on and off the TV every day. These times are not intuitive and easy to understand. By extracting features and converting the above data into the average number of hours users watch TV every day, it is easier to understand users' TV viewing habits.
[0051] Optionally, the collected data is classified and saved in a collection database, so that subsequent processing and analysis can be facilitated.
[0052] For example, a powerful and easy-to-operate database system (such as SQL) may be used for operation, while a regular backup mechanism is set up to prevent data loss.
[0053] Optionally, the thought chain is converted into the relationship edges of the connecting nodes of the initial knowledge graph, including: marking the node status and priority classification of the connecting nodes; decomposing the thought chain into one or more relationship edges, and adding them to the connecting nodes corresponding to the relationship edges; assigning corresponding attributes to each relationship edge; wherein the attributes include type, direction and relationship weight.
[0054] The nodes include nodes representing users, and / or nodes representing devices, and / or nodes representing environments, and / or nodes representing scenes, and / or nodes representing time, and / or nodes representing locations. Some nodes are labeled with importance; some or all nodes are labeled with priority. This can help make more accurate decisions when searching for paths, and make the knowledge graph have richer and more diverse relationships, and more accurately show the interactive relationships between various devices, users and environments in the real environment.
[0055] In this way, using the user's thought chain as the relationship edge connecting the nodes can better understand the user's intentions and preferences, help better predict the user's future needs, and then more accurately generate scenarios that meet the user's needs and provide personalized services to the user. The knowledge graph can more efficiently process and analyze large amounts of data and information, which helps speed up the decision-making process and improve the system's response speed, thereby improving the user experience. In addition, the knowledge graph can more clearly display the decision-making process and reasoning path, which helps to improve the interpretability of the system and thus improve the intelligence of the system.
[0056] It should be understood that the nodes in the knowledge graph represent entities, and the edges in the knowledge graph represent the relationships between entities. The relationships between entities include compatibility between devices, and / or the interaction relationship between devices, and / or the user's operation behavior, and / or the change relationship of environmental status, and / or the time interval, and / or the position relationship between devices, and / or the relationship between the user's location and each device. For example, node attributes include priority, and / or status level. Relationship edge attributes include relationship weight, and / or type, and / or direction.
[0057] For example, graph database tools (such as Neo4j, JanusGraph) can be used to create and store knowledge graphs, which is conducive to efficiently storing and querying graph data.
[0058] More specifically, each device in the smart home environment and the environmental status that may affect the operation of the device are set up with corresponding nodes in the knowledge graph. The node attribute priority represents the importance of the entity in a specific operation or decision-making process. For example, when performing a series of device control operations, devices with high priority can be responded to first. Priorities can be classified according to response speed or stability. The node attribute status level represents the position or scope of action of the entity in the entire system. For example, the device associated with the core operation can be marked as a high-status node, which may directly affect the entire home environment status. Through such attribute marking, the highest or secondary priority operations can be found more quickly under specific conditions.
[0059] In practical applications, such as Figure 3 As shown, Figure 3 It is a knowledge graph constructed based on a chain of thoughts in which a user turns on the TV to watch the news channel, then adjusts the TV volume and finally turns off the TV. Figure 3The example includes four nodes: User, TV, News Channel, and Volume Adjustment. The arrows between each pair of nodes represent the transition from one state to another, and the text on the arrows represents the user's operation. For example, the edge from the User node to the TV node represents the user's operation of turning on the TV, the edge from the TV node to the News Channel node represents the user's operation of switching to the News Channel, the edge from the News Channel node to the Volume Adjustment node represents the user's operation of adjusting the volume, and the edge from the Volume Adjustment node to the TV node represents the user's operation of turning off the TV.
[0060] Optionally, each thought chain is used as one or more relationship edges, and each relationship edge has a set relationship weight. In this way, the user's thought chain is represented in the knowledge graph, which enables the knowledge graph to more accurately describe the user's behavior pattern, thereby more accurately generating personalized scenes according to the current environmental state, and facilitating more accurate and intelligent automatic control of home scene generation.
[0061] For example, continuous operations can be represented as a path from one device or state to another device or state, including environmental conditions. The thought chain reflects the interaction between devices and the interaction between users and devices. Therefore, the thought chain reflects the user's behavior path. Placing the thought chain in the knowledge graph can more intuitively reflect the above interaction relationship.
[0062] Optionally, the weight of each relationship edge is determined according to the thought chain. In this way, the system can more accurately understand user needs and predict future behaviors, and further generate personalized smart home scenarios.
[0063] In practical applications, the edges of the knowledge graph have corresponding relationship weight values, which indicate the importance of the user behavior pattern corresponding to the user behavior sequence on this edge. For example, the higher the relationship weight value, the more important the user behavior pattern corresponding to the user behavior sequence on this edge.
[0064] Optionally, the relationship weight is calculated in the following manner: according to the user behavior log, the frequency of each event sequence in the thought chain is calculated; and the calculated frequency is mapped to the relationship weight.
[0065] In this way, by mapping the frequency of each operation sequence to a relationship weight, it is helpful to find the operation habits of the user in the scenario set by the relationship weight and better understand the user's behavior. In addition, the frequency of each behavior event sequence in the user's thought chain is calculated based on the user's behavior log, which can better understand the user's behavior and preferences and help predict user behavior.
[0066] For example, the frequency of occurrence of each behavioral event sequence can be directly assigned to the weight of the corresponding edge in the knowledge graph. Alternatively, the frequency of occurrence of the behavioral event sequence can be assigned to the weight of the corresponding edge in the knowledge graph in a nonlinear manner (such as a logarithmic function). In the case where the thought chain contains two or more consecutive operations, it is necessary to update the weights of all corresponding edges between entities connecting the above operations. For example, the user behavior log records a series of operations performed by the user in the system, such as turning on the TV first, then turning on the air conditioner, and then opening the TV cabinet drawer to take the remote control every night.
[0067] Optionally, assigning corresponding attributes to each relationship edge includes: regularizing the relationship weight so that the relationship weight is within a threshold range; and assigning the relationship weight of each event sequence in the thought chain to the relationship edge corresponding to each event sequence.
[0068] The weights are regularized. This can reduce the impact of large differences in weights for different users due to differences in behavior patterns or the number of devices used by different users.
[0069] For example, the regularization process may include normalization. In practical applications, the effective threshold range of the weight may also be set to constrain the effectiveness of the threshold. For example, the effective threshold range is set to 0.01 to 10.
[0070] Optionally, the method for constructing a scene knowledge graph based on a thought chain also includes: collecting user feedback data; adjusting the link weights of local links of the thought chain according to the user feedback data; and / or managing global factors of the scene knowledge graph according to the user feedback data; wherein the global factors include relationship edge weights and thought chain length scales.
[0071] Combination Figure 4 As shown, the embodiment of the present application provides another method for constructing a scene knowledge graph based on a thought chain, including:
[0072] S401, the server constructs an initial knowledge graph; wherein the nodes of the initial knowledge graph represent associated entities that realize the target scenario.
[0073] S402, the server obtains the user's thought chain; wherein the thought chain represents the interaction mode between the user and the smart home device, and / or the behavior path between the smart home devices.
[0074] S403, the server converts the thought chain into the relationship edge of the connection node of the initial knowledge graph, obtains the scene knowledge graph, and obtains the optimal path to realize the target scene according to the scene knowledge graph; wherein the relationship edge represents the realization path of the connection node.
[0075] S404: The server collects user feedback data.
[0076] S405, the server adjusts the link weight of the local link of the thought chain according to the user's feedback data; and / or manages the global factors of the scene knowledge graph according to the user's feedback data; wherein the global factors include the relationship edge weight and the length scale of the thought chain.
[0077] In the disclosed embodiments, user feedback data can be used as an optimization resource, such as collected through user surveys, evaluations, etc. The system performance can be analyzed and improved by centrally processing the collected data. The continuous optimization process may involve adjustment of deep learning model parameters to generate new machine learning algorithms. On the one hand, some links can be locally optimized based on user feedback or actual effects, such as special strategy processing for weaknesses, increasing or decreasing local link weights, and so on. On the other hand, a reinforcement learning algorithm is used to globally coordinate and manage the entire graph with the goal of maximum utility or a custom reward function, including updating global factors such as edge weights or the length and scale of the thinking chain. The system can be made to have strong self-improvement and adaptability, and can generate user scenarios more accurately, thereby enhancing the user experience.
[0078] For example, after local adjustments or global optimization, you can re-update the thinking chain and build the knowledge graph to conduct a new round of iterative updates, or you can restart the entire process, including starting from data collection.
[0079] For example, you can set up evaluation reminders to evaluate the performance of the knowledge graph and the entire system, which helps improve the performance of the system.
[0080] Optionally, an automated processing module may be provided to centrally process the collected data. The automated processing module includes a deep learning model and adjusts parameters of the model according to the collected data, thereby improving the performance of the entire system.
[0081] Optionally, a security check may be performed on the process of implementing the above-mentioned method for generating scenarios, thereby reducing the probability of sensitive data leakage and the probability of dangerous events.
[0082] Optionally, when new devices are connected, and / or the hardware environment changes, and / or the hardware is upgraded, and / or the user needs change, and / or new functions are developed, the knowledge graph is re-evaluated and updated. In this way, the knowledge graph can be kept up to date, the adaptability of the system can be improved, and better services can be provided to users, improving the user experience.
[0083] Optionally, the algorithm of the search path process is updated, so that the query efficiency can be improved and the system stability can be increased without affecting the user experience.
[0084] Combination Figure 5 As shown, the embodiment of the present application provides an application method of a scene knowledge graph based on a thought chain, including:
[0085] S501, the server determines the user's current state and environmental parameters.
[0086] S502: The server uses the scene knowledge graph to search for the optimal path to the target scene based on the user's current state and environmental parameters.
[0087] S503: The server sends a control instruction to the smart device in the order of the optimal path to control the smart device to perform an operation to generate a target user scenario.
[0088] In the disclosed embodiment, the user's needs can be better predicted. The optimal path that meets the user's needs is searched in the knowledge graph, and control instructions are sent in the order of the optimal path to control the corresponding smart device to perform the operations in the path, so that the user's needs can be understood more accurately and a target user scenario that meets the user's needs can be generated.
[0089] Optionally, searching the knowledge graph for the optimal path to achieve the target scenario includes searching the knowledge graph for the shortest path to achieve the target scenario using a Dijkstra algorithm. In this way, the shortest path can be effectively searched.
[0090] In practical applications, for example, if the target user scenario is a waking-up scenario, the specific steps for using the Dijkstra algorithm to search the knowledge graph for the shortest path to achieve the target scenario are as follows: first, set the starting entity, which can be a bedroom; then create a collection to save the nodes for which the shortest paths have been found, and create a dictionary or array to save the shortest path weights from the starting entity to each node; then, from the nodes for which the shortest paths have not been found, select a node with the smallest currently known shortest path weight from the starting node to the node, perform relaxation operations on all the selected nodes, and iterate until the shortest paths for all nodes are found or the shortest path to a specific target node is found.
[0091] Optionally, searching the knowledge graph for the optimal path to achieve the target scenario includes searching the knowledge graph for the shortest path to achieve the target scenario using an A* algorithm. In this way, the A* algorithm combines the Dijkstra algorithm and the heuristic search to find the shortest path more efficiently.
[0092] Optionally, searching the knowledge graph for the optimal path to achieve the target scenario includes searching the knowledge graph for the shortest path to achieve the target scenario using the Bellman-Ford algorithm. In this way, the situation where there are negative weight edges in the knowledge graph can be handled, and the shortest path can be searched more effectively.
[0093] Optionally, searching the knowledge graph for the optimal path to achieve the target scenario includes searching the knowledge graph for the shortest path to achieve the target scenario using Floyd-Warshall. In this way, it can be better applied to the case where the knowledge graph is a dense graph, so as to more effectively search for the shortest path.
[0094] Combination Figure 6 As shown, an embodiment of the present application provides a device 60 for constructing a scene knowledge graph based on a thinking chain, including a processor (processor) 600 and a memory (memory) 601. Optionally, the device 60 may also include a communication interface (Communication Interface) 602 and a bus 603. Among them, the processor 600, the communication interface 602, and the memory 601 can communicate with each other through the bus 603. The communication interface 6702 can be used for information transmission. The processor 600 can call the logical instructions in the memory 601 to execute the method for constructing a scene knowledge graph based on a thinking chain of the above embodiment.
[0095] In addition, the logic instructions in the memory 601 described above can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product.
[0096] The memory 601 is a computer-readable storage medium that can be used to store software programs and computer executable programs, such as program instructions / modules corresponding to the method in the embodiment of the present application. The processor 600 executes the function application and data processing by running the program instructions / modules stored in the memory 601, that is, the method for constructing a scene knowledge graph based on the thinking chain in the above embodiment is realized.
[0097] The memory 601 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application required for at least one function; the data storage area may store data created according to the use of the terminal device, etc. In addition, the memory 601 may include a high-speed random access memory and may also include a non-volatile memory.
[0098] The technical solution of the embodiment of the present application can be embodied in the form of a software product, which is stored in a storage medium and includes one or more instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in the embodiment of the present application. The aforementioned storage medium can be a non-transient storage medium, such as: a USB flash drive, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a disk or an optical disk, and other media that can store program codes.
[0099] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A method for constructing a scene knowledge graph based on a thought chain, characterized in that: include: Constructing an initial knowledge graph; wherein the nodes of the initial knowledge graph represent associated entities that realize the target scenario; Acquire the user's thought chain; wherein the thought chain represents the interaction mode between the user and the smart home device, and / or the behavior path between the smart home devices; The thought chain is converted into the relationship edges of the connection nodes of the initial knowledge graph to obtain the scene knowledge graph, so as to obtain the optimal path to realize the target scene according to the scene knowledge graph; wherein the relationship edges represent the realization path of the connection nodes.
2. The method for constructing a scene knowledge graph based on a thought chain according to claim 1 is characterized in that: Get the user's thought chain, including: Creating a user's event sequence based on the smart home device data and environment data in the database; wherein the event sequence includes a user operation change event, a device state change event, and an environment condition change event; Inputting the user's event sequence into the deep learning model to obtain a behavior pattern output by the deep learning model; wherein the behavior pattern represents a combination of events occurring in a specific order in the event sequence; Match users with behavioral patterns to obtain the user's thought chain.
3. The method for constructing a scene knowledge graph based on a thought chain according to claim 2 is characterized in that: Obtain smart home device data and environment data as follows: Obtaining an original database; wherein the original data includes user operation data, device response data, device status data and environmental parameter data; Convert the raw data in the original database to match the format of the input of the deep learning model; The raw data after format conversion is subjected to feature screening to obtain smart home device data and environmental data, and the smart home device data and environmental data are stored in a database.
4. The method for constructing a scene knowledge graph based on a thought chain according to claim 1 is characterized in that: Converting the thought chain into the relationship edges of the connection nodes of the initial knowledge graph includes: Label the node status and priority classification of connected nodes; Decomposing the thought chain into one or more relationship edges, and adding them to connection nodes corresponding to the relationship edges; Assign corresponding attributes to each relationship edge; the attributes include type, direction and relationship weight.
5. The method for constructing a scene knowledge graph based on a thought chain according to claim 4 is characterized in that: The relationship weight is calculated as follows: According to the user behavior log, calculate the frequency of each event sequence in the thought chain; Map the calculated frequencies to relationship weights.
6. The method for constructing a scene knowledge graph based on a thought chain according to claim 4 is characterized in that: Give each relationship edge corresponding attributes, including: Regularize the relationship weights so that they are within the threshold range; The relationship weight of each event sequence in the thought chain is assigned to the relationship edge corresponding to each event sequence.
7. The method for constructing a scene knowledge graph based on a thought chain according to any one of claims 1 to 6, characterized in that: Also includes: Collect user feedback data; According to the user's feedback data, adjust the link weight of the local link of the thought chain; and / or, Based on user feedback data, manage the global factors of the scenario knowledge graph; among them, the global factors include relationship edge weights and thought chain length scale.
8. An application method of scene knowledge graph based on thought chain, characterized in that: include: Determine the user's current state and environmental parameters; Based on the user's current state and environmental parameters, the optimal path to the target scene is searched using the scene knowledge graph as described in any one of claims 1 to 7; Send control instructions to smart devices in the order of the optimal path to control the smart devices to perform operations to generate target user scenarios.
9. A device for constructing a scene knowledge graph based on a thought chain, comprising a memory and a processor, characterized in that: The memory stores a computer program, and the processor is configured to execute, through the computer program: A method for constructing a scene knowledge graph based on a thought chain as claimed in any one of claims 1 to 7; or, The application method of the scene knowledge graph based on the thought chain as described in claim 8.
10. An electronic device, characterized in that: include: Electronic device body; The device for constructing a scene knowledge graph based on a thought chain as described in claim 9 is installed on the electronic device body.
Citation Information
Patent Citations
Data processing method and system based on thinking chain and knowledge graph
CN116955560A
Language model training method and device and computer readable storage medium
CN117669767A
Family health service robot based on multi-modal large model and intelligent interaction method
CN118039057A
Cited By
Corpus processing method and apparatus based on paradigm evolution, and device, medium, and product
WO2026152886A1
