Linkage scene construction method and device
Through speech recognition and semantic analysis, a logical link tree for linkage scenarios for IoT devices is constructed, which solves the problems of complexity and low efficiency of linkage scenario construction in the existing technology, and realizes convenient and efficient linkage scenario construction.
Patent Information
- Application Number
- CN202411724572.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-28
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2044-11-28
AI Technical Summary
In the prior art, the construction of a linkage scenario for multiple IoT devices requires users to conduct professional manual configuration, and after adding new devices, new linkage scenarios need to be rebuilt, resulting in large workload and low construction efficiency.
Through speech recognition and semantic analysis, a logical link tree is built to represent the event execution path, and a node object is determined to implement event linkage rules.
It realizes a more convenient way to build linkage scenarios, reduces user operation complexity and workload, improves the efficiency of building linkage scenarios, and supports a variety of types of IoT devices and event forms.
Smart Images

Figure CN119724175A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of Internet of Things, and specifically to a linkage scene construction method and device. Background Art
[0002] With the development of the Internet of Things industry, intelligent IoT devices have gradually penetrated into people's daily lives. Compared with controlling a single IoT device, the linkage of multiple IoT devices can produce more powerful, smarter, and more advanced functions to meet the diverse needs of users.
[0003] In related technologies, in order to build linkage scenarios for multiple IoT devices, users can define linkage rules between multiple IoT devices through visual manual configuration, and deploy the linkage rules to the cloud or edge. Then, the IoT detects the data of each IoT device to determine whether the execution time or device status and other conditions are met to achieve linkage between multiple IoT devices. In addition to the professional requirements for users, the defined linkage rules are more based on the physical model of IoT devices. After adding new IoT devices, new linkage scenarios need to be rebuilt from scratch, which greatly increases the workload and reduces the efficiency of building linkage scenarios. Summary of the invention
[0004] In order to efficiently construct a linkage scene, the present application provides a linkage scene construction method and device. The technical solution is as follows:
[0005] In a first aspect, the present application provides a linkage scene construction method, the method comprising:
[0006] In response to the user's linkage scene construction instruction, voice recognition processing is performed to obtain voice text information to be processed;
[0007] Performing semantic analysis on the speech text information to be processed to obtain target semantic information; the target semantic information indicates the personalized needs of the user for the linkage scenario;
[0008] According to the target semantic information, a logical link tree corresponding to the linkage scenario is constructed; the logical link tree indicates an execution path between node events of each tree node in at least one tree node; the type of the node event is any one of a trigger event, a calculation event or a control event;
[0009] Determine, according to the logical link tree, a node object of each tree node, wherein the type of the node object is any one of a local IoT device, an external medium, or a logical object;
[0010] According to the logical link tree and the node objects of each tree node, a linkage scene link tree for the linkage scene is obtained, so that the node object executes the node event of the corresponding tree node based on the execution path; the linkage scene link tree indicates the event linkage rules between the node objects of each tree node in the linkage scene.
[0011] In an optional embodiment, the method further includes:
[0012] Obtaining attribute information of the user;
[0013] The step of performing semantic analysis on the speech text information to be processed to obtain target semantic information includes:
[0014] The speech text information to be processed and the attribute information are subjected to semantic analysis to obtain the target semantic information.
[0015] In an optional embodiment, the method further includes:
[0016] Get new local IoT devices;
[0017] According to the newly added IoT device, update the node object of each tree node;
[0018] According to the updated node object of each tree node, the linkage scene link tree is updated to obtain a target linkage scene link tree.
[0019] In an optional embodiment, constructing a logical link tree corresponding to the linkage scenario according to the target semantic information includes:
[0020] Generate a target trigger event set, a target calculation event set and a target control event set according to the target semantic information;
[0021] Performing logic analysis on at least one target trigger event in the target trigger event set to determine a first logical relationship between the at least one target trigger event;
[0022] Performing logic analysis on at least one target computing event in the target computing event set to determine a second logical relationship between the at least one target computing event;
[0023] Performing logic analysis on at least one target control event in the target control event set to determine a third logical relationship between the at least one target control event;
[0024] According to the first logical relationship, the second logical relationship, the third logical relationship and the preset event basic execution order, a logical link tree corresponding to the linkage scenario is constructed.
[0025] In an optional embodiment, the method further includes:
[0026] Determine a first priority weight corresponding to each target trigger event in the at least one target trigger event;
[0027] Determine a second priority weight corresponding to each target computing event in the at least one target computing event;
[0028] Determining a third priority weight corresponding to each target control event in the at least one target control event;
[0029] Optimizing the first logical relationship according to the first priority weight corresponding to each target triggering event to obtain a first target logical relationship;
[0030] According to the second priority weight corresponding to each target calculation event, the second logical relationship is optimized to obtain a second target logical relationship;
[0031] According to the third priority weight corresponding to each target control event, the third logical relationship is optimized to obtain a third target logical relationship;
[0032] The step of constructing a logical link tree corresponding to the linkage scenario according to the first logical relationship, the second logical relationship, the third logical relationship and a preset event basic execution order includes:
[0033] According to the first target logical relationship, the second target logical relationship, the third target logical relationship and the preset event basic execution order, a logical link tree corresponding to the linkage scenario is constructed.
[0034] In an optional embodiment, constructing a logical link tree corresponding to the linkage scenario according to the target semantic information includes:
[0035] At least one linkage event group is generated according to the target semantic information; each event linkage group in the at least one linkage event group includes at least one or more of a trigger event subset, a calculation event subset or a control event subset;
[0036] According to the at least one linkage event group, correspondingly construct at least one logical link branch;
[0037] determining a fourth logical relationship between the at least one linkage event group;
[0038] The logical link tree is constructed according to the at least one logical link branch and the fourth logical relationship.
[0039] In an optional embodiment, constructing a logical link tree corresponding to the linkage scenario according to the target semantic information includes:
[0040] According to the target semantic information, construct an initial logical link tree corresponding to the linkage scenario;
[0041] Decomposing the initial logical link tree to obtain at least one initial logical link branch;
[0042] Performing a logic check on each initial logical link branch of the at least one initial logical link branch to obtain a check result;
[0043] When the verification result indicates that each of the initial logical link branches does not have a repeated node event and each of the initial logical link branches is not a closed-loop link, the initial logical link tree is used as the logical link tree corresponding to the linkage scenario.
[0044] In an optional embodiment, determining the node object of each tree node according to the logical link tree includes:
[0045] According to the type of the node event of each tree node or the data type corresponding to the node event of each tree node, a corresponding node object is configured for each tree node.
[0046] In an optional embodiment, the method further includes:
[0047] The linkage scene link tree for the linkage scene is synchronized to the cloud and the target node object corresponding to at least one target tree node; the at least one target tree node is a tree node in the logical link tree, and the type of the target node object is a local IoT device.
[0048] In a second aspect, the present application provides a linkage scene construction device, the device comprising:
[0049] A speech recognition module is used to respond to the user's linkage scene construction instruction, perform speech recognition processing, and obtain speech text information to be processed;
[0050] A semantic analysis module, used for performing semantic analysis on the speech text information to be processed to obtain target semantic information; the target semantic information indicates the personalized needs of the user for the linkage scenario;
[0051] A logical link tree construction module, used to construct a logical link tree corresponding to the linkage scenario according to the target semantic information; the logical link tree indicates an execution path between node events of each tree node in at least one tree node; the type of the node event is any one of a trigger event, a calculation event or a control event;
[0052] A node object determination module, used to determine the node object of each tree node according to the logical link tree, wherein the type of the node object is any one of a local IoT device, an external medium or a logical object;
[0053] A linkage scene link tree construction module is used to obtain a linkage scene link tree for the linkage scene according to the logical link tree and the node object of each tree node, so that the node object executes the node event of the corresponding tree node based on the execution path; the linkage scene link tree indicates the event linkage rules between the node objects of each tree node in the linkage scene.
[0054] In a third aspect, the present application provides a computer-readable storage medium, in which at least one instruction or at least one program is stored, and the at least one instruction or the at least one program is loaded and executed by a processor to implement a linkage scene construction method as described in the first aspect.
[0055] In a fourth aspect, the present application provides a computer device, comprising a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by the processor to implement a linkage scene construction method as described in the first aspect.
[0056] In a fifth aspect, the present application provides a computer program product, which includes computer instructions, and when the computer instructions are executed by a processor, a linkage scene construction method as described in the first aspect is implemented.
[0057] The present application provides a method and device for constructing a linkage scene, which has the following technical effects:
[0058] The solution provided by the present application provides a more convenient way to construct a linkage scene - a voice construction method, which can respond to the user's linkage scene construction instructions, perform voice recognition processing, and obtain voice text information to be processed; perform semantic analysis processing on the voice text information to be processed to obtain target semantic information, and the target semantic information indicates the user's personalized needs for the linkage scene; and then, according to the target semantic information, a logical link tree corresponding to the linkage scene can be constructed, the logical link tree indicates the execution path between the node events of each tree node in at least one tree node, and the type of the node event is any one of a trigger event, a calculation event or a control event; according to the logical link tree, the node object of each tree node is determined, and the type of the node object is any one of a local IoT device, an external medium or a logical object; according to the logical link tree and the node object of each tree node, a linkage scene link tree for the linkage scene is obtained, so that the node object executes the node event of the corresponding tree node based on the execution path, and the linkage scene link tree indicates the event linkage rules between the node objects of each tree node in the linkage scene. The technical solution provided by the present application first constructs a logical link tree for the linkage scenario according to the target semantic information, which is used to indicate the execution path of each event in the linkage scenario. On this basis, a corresponding execution object or data object is configured for each event to execute the corresponding event according to the execution path, thereby constructing a linkage scenario that meets the user's personalized needs. The logical link tree is not affected by the addition, deletion or modification of objects, and can facilitate the update of objects and the linkage scene link tree, thereby improving the efficiency of linkage scene construction. In addition, the objects involved in the technical solution provided by the present application are not limited to IoT devices, but also introduce external media and logical objects, which can enrich the forms of trigger events, calculation events, and control events, thereby realizing more diverse linkage scenarios.
[0059] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present application or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0061] Figure 1 It is a schematic diagram of an implementation environment of a linkage scene construction method provided in an embodiment of the present application;
[0062] Figure 2 It is a flowchart of a linkage scene construction method provided in an embodiment of the present application;
[0063] Figure 3 It is a schematic diagram of a process of building a logical link tree provided by an embodiment of the present application;
[0064] Figure 4 is a schematic diagram of a first logical relationship, a second logical relationship, and a third logical relationship provided in an embodiment of the present application;
[0065] Figure 5 It is another flow chart of building a logical link tree provided by an embodiment of the present application;
[0066] Figure 6 It is a schematic diagram of a logical link branch constructed by two linkage event groups provided in an embodiment of the present application;
[0067] Figure 7(1) to Figure 7(3) It is a schematic diagram of various event execution paths and linkage rules provided by the embodiment itself;
[0068] Figure 8 It is a flow chart of a logic check provided in an embodiment of the present application;
[0069] Fig. 9 is a schematic diagram of a linkage scene construction device provided in an embodiment of the present application;
[0070] Fig.10 It is a schematic diagram of the hardware structure of a device for implementing a linkage scene construction method provided in an embodiment of the present application. DETAILED DESCRIPTION
[0071] The embodiments of the present application provide a method and device for constructing a linkage scene. The technical solutions 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 are within the scope of protection of this application. Examples of the embodiments are shown in the drawings, where the same or similar numbers throughout represent the same or similar elements or elements with the same or similar functions.
[0072] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings 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 where appropriate, so that the embodiments of the present application described herein can be implemented in an order 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, a process, method, system, product or server that includes 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 devices.
[0073] It is understandable that in the specific implementation of the present application, related data such as user attribute information is involved. When the above embodiments of the present application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.
[0074] See also Figure 1 , which is a schematic diagram of an implementation environment of a linkage scene construction method provided in an embodiment of the present application, such as Figure 1 As shown, the implementation environment may include a client 01, an IoT management device 02, a server 03, and local IoT devices 03 to 09.
[0075] Specifically, the client 01 may include devices such as smart phones, desktop computers, tablet computers, laptops, vehicle terminals, digital assistants, smart wearable devices, and voice interaction devices, and may also include software running in the device, such as web pages provided to users by some service providers, or applications provided to users by these service providers. Specifically, the client 01 may be used for users to input linkage scene construction instructions in voice format. The client 01 may also be used to perform voice recognition and semantic analysis on the linkage scene construction instructions to obtain target semantic information indicating the user's personalized needs for the linkage scene. The client 01 can send the target semantic information to the IoT management device 02 based on the communication network, so that the IoT management device 02 constructs a logical link tree corresponding to the linkage scene according to the target semantic information, and determines the node object of each tree node in the logical link tree. The node object can be any one or more of the local IoT devices 03 to 09, or can be an external medium such as temperature and humidity, or a logical object such as a device shadow in the cloud. Then, according to the logical link tree and the node object of each tree node, a linkage scene link tree for the linkage scene is configured, so that the node object executes the node event of the corresponding tree node based on the execution path indicated by the logical link tree.
[0076] Specifically, the server 02 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network) and basic cloud computing services such as big data and artificial intelligence platforms. The server 02 may include a network communication unit, a processor, a memory, and the like. The terminal and the server may be directly or indirectly connected via wired or wireless communication, which is not limited in this application. Specifically, the server 02 can be used to receive the linkage scene link tree constructed by the IoT management device 02 and store it in the cloud.
[0077] In another specific embodiment provided in the embodiment of the present application, the client 01 may execute the construction of the logical link tree and the linkage scene link tree, configure the local IoT device involved through the client 01, and synchronize the linkage scene link tree corresponding to the constructed linkage scene to the cloud through the client 01. The above is an example of the implementation environment of the embodiment of the present application and is not intended to be limiting.
[0078] The embodiments of the present application can also be implemented in combination with cloud technology. Cloud technology refers to a hosting technology that unifies a series of resources such as hardware, software and network in a wide area network or a local area network to realize the calculation, storage, processing and sharing of data. It can also be understood as a general term for network technology, information technology, integration technology, management platform technology and application technology based on the cloud computing business model application. Cloud technology needs to be supported by cloud computing. Cloud computing is a computing model that distributes computing tasks on a resource pool composed of a large number of computers, so that various application systems can obtain computing power, storage space and information services as needed. The network that provides resources is called a "cloud". Specifically, the server 02 and the database are located in the cloud, and the server 02 can be a physical machine or a virtualized machine.
[0079] The following introduces a linkage scene construction method provided by this application. Figure 2 It is a flowchart of a linkage scene construction method provided in an embodiment of the present application. The present application provides method operation steps as described in the embodiment or flowchart, but may include more or fewer operation steps based on conventional or non-creative labor. The order of steps listed in the embodiment is only one way of executing the steps among many orders, and does not represent the only order of execution. When the actual system or server product is executed, it can be executed in sequence or in parallel according to the method shown in the embodiment or the accompanying drawings (for example, in a parallel processor or multi-threaded processing environment). Please refer to Figure 2 A linkage scene construction method provided in an embodiment of the present application may include the following steps:
[0080] S210: In response to the user's linkage scene construction instruction, voice recognition processing is performed to obtain voice text information to be processed.
[0081] In the embodiment of the present application, the user can start the construction of the linkage scene by voice, which reduces the requirements for the user's professional knowledge and operation ability. The linkage scene construction instruction is a voice signal that instructs the construction of the linkage scene.
[0082] In a specific embodiment, the collected linkage scene construction instructions are used to filter the voice signal to extract high-purity human voice signals as much as possible; the filtered human voice signals are framed to identify morphemes, and then the identified morphemes are combined into words and sentences to obtain the voice text information to be processed.
[0083] In a specific embodiment, the user may also manually input text that may indicate the construction of a linkage scenario as text information to be processed by semantic analysis.
[0084] S220: Perform semantic analysis on the speech text information to be processed to obtain target semantic information.
[0085] In an embodiment of the present application, the target semantic information indicates the user's personalized needs for the linkage scene, including but not limited to the time, place, person, IoT device, etc. corresponding to the linkage scene, the scene theme, scene content and scene function of the linkage scene.
[0086] In a specific embodiment, the above-mentioned target semantic information is obtained by performing semantic analysis methods such as text segmentation, topic classification, entity recognition, etc. on the speech text information to be processed.
[0087] In a specific embodiment, the above method further includes:
[0088] Obtain the user's attribute information, which may include but is not limited to the user's living habits data, body shape index data, physical health status data, dietary preference data, etc.
[0089] Step S220 may be specifically implemented as follows:
[0090] The speech text information and attribute information to be processed are semantically analyzed to obtain target semantic information.
[0091] That is, in the process of semantic analysis and processing, in addition to the voice text information to be processed currently indicated by the user, the user's attribute information can also be combined to improve the adaptability of the target semantic information to the user's needs, thereby meeting the user's personalized needs.
[0092] S230: Construct a logical link tree corresponding to the linkage scenario according to the target semantic information.
[0093] In an embodiment of the present application, the logical link tree includes at least one tree node and a connection relationship between at least one tree node, each tree node in the at least one tree node corresponds to a node event, and the type of the node event is any one of a trigger event, a calculation event, or a control event. The logical link tree can indicate the execution path between the node events of each tree node in the at least one tree node.
[0094] In an embodiment of the present application, a trigger event is used to perform a trigger judgment for a computing event or a control event related to the execution path. The trigger event is the entrance to the execution path. The judgment of whether to trigger a related computing event or a control event can be made by sensing the IoT data. The IoT data may include but is not limited to device status data, time data, external environment data, etc. The computing event is used to perform a conditional judgment for a control event or a trigger event related to the execution path. The computing event is a decision-making checkpoint of the execution path. It can integrate a variety of IoT data and perform calculations and judgments on execution conditions such as preset data indicators or linkage event feasibility based on the integrated data. The control event is the target action of the execution path. By executing the set action, the state of the specified device is controlled or the information interaction between people, devices, environment, cloud, etc. is realized, or the event execution result is fed back to the next tree node of the logical link tree.
[0095] In a specific embodiment, the node event of each tree node may be described in the form of an event function or an event process.
[0096] In a specific embodiment, at least one node event is determined based on the target semantic information, and based on the dependency relationship between at least one node event, an execution path between at least one node event is constructed, the node events correspond one-to-one to the tree nodes, and the execution path between at least one node event corresponds to the connection relationship between at least one tree node.
[0097] In a specific embodiment, Figure 3 As shown, step S230 may be implemented as follows:
[0098] S310: Generate a target trigger event set, a target calculation event set, and a target control event set according to the target semantic information.
[0099] That is, according to the target semantic information, at least one determined node event can be first divided according to the type of event to obtain a target trigger event set including at least one target trigger event, a target computing event set including at least one target computing event, and a target control event set including at least one target control event.
[0100] S320: Performing logic analysis on at least one target trigger event in the target trigger event set to determine a first logical relationship between at least one target trigger event.
[0101] S330: Performing logic analysis on at least one target computing event in the target computing event set to determine a second logical relationship between at least one target computing event.
[0102] S340: Performing logic analysis on at least one target control event in the target control event set to determine a third logical relationship between at least one target control event.
[0103] In step S320-step S340, a logical analysis is performed on the dependency relationship between at least one target trigger event to obtain a first logical relationship; a logical analysis is performed on the dependency relationship between at least one target calculation event to obtain a second logical relationship; a logical analysis is performed on the dependency relationship between at least one target control event to obtain a third logical relationship. Exemplarily, the logical relationship may include but is not limited to equal to, less than, greater than, less than or equal to, greater than or equal to, not equal to, increase to, decrease to, jump to, no longer be, etc., and may be described by a logical expression, such as E1||E2, E3&&E4, etc.
[0104] S350: Construct a logical link tree corresponding to the linkage scenario according to the first logical relationship, the second logical relationship, the third logical relationship and the preset event basic execution order.
[0105] In a specific embodiment, the preset event-based execution order can be the event order of TCA, where T represents a trigger event, C represents a calculation event, and A represents a control event. According to the first logical relationship corresponding to the target trigger event set, the second logical relationship corresponding to the target calculation event set, the third logical relationship corresponding to the target control event set, and the preset event-based execution order, the execution path between at least one target trigger event, at least one target calculation event, and at least one target control event can be determined.
[0106] Figure 4 is a schematic diagram of a first logical relationship, a second logical relationship, and a third logical relationship provided in an embodiment of the present application, such as Figure 4 As shown, the first logical relationship, the second logical relationship and the third logical relationship are a one-way graph in data structure. Figure 4 The arrows in indicate the preset event-based execution order, the target trigger event set includes T1, T2 and T3, the target calculation event set includes C1, C2, C3 and C4, and the target control event set includes A1, A2 to An. The first logical relationship, the second logical relationship and the third logical relationship can be as follows Figure 4 As shown in , A1, A2 to An are control events that can be executed in parallel, A1, A2 to An are independent of each other, and the failure of execution of any control event does not affect the execution of other control events.
[0107] Optionally, the above method may further include:
[0108] S351: Determine a first priority weight corresponding to each target trigger event in at least one target trigger event.
[0109] S352: Determine a second priority weight corresponding to each target computing event in at least one target computing event.
[0110] S353: Determine a third priority weight corresponding to each target control event in at least one target control event.
[0111] Feasibly, the priority weight of each event can be determined based on the frequency of occurrence of the event, the amount of data required for the event, etc. For example, the lower the frequency of occurrence of the event and the smaller the amount of data required, the higher the priority, thereby reducing the amount of data to be perceived and calculated for executing the interrupt or identifying the situation, thereby improving processing efficiency.
[0112] S354: Optimize the first logical relationship according to the first priority weight corresponding to each target triggering event to obtain a first target logical relationship.
[0113] S355: Optimize the second logical relationship according to the second priority weight corresponding to each target calculation event to obtain a second target logical relationship.
[0114] S356: Optimize the third logical relationship according to the third priority weight corresponding to each target control event to obtain a third target logical relationship.
[0115] Feasibly, compared with the first logical relationship, the first target logical relationship can put the target trigger event with the first priority weight in the front row in the expression, so that the program will give priority to executing the target trigger event with the first priority weight. The second target logical relationship and the third target logical relationship can be obtained in the same way.
[0116] S357: Construct a logical link tree corresponding to the linkage scenario according to the first target logical relationship, the second target logical relationship, the third target logical relationship and the preset event basic execution order.
[0117] Step S357 may refer to the aforementioned embodiment and will not be described in detail here.
[0118] In a specific embodiment, Figure 5 As shown, step S230 can also be implemented as follows:
[0119] S410: Generate at least one linkage event group according to target semantic information.
[0120] In a specific embodiment, each event linkage group in at least one linkage event group includes at least one or more of a trigger event subset, a calculation event subset, or a control event subset.
[0121] In a specific embodiment, at least one node event can be divided into at least one linkage event group according to the dependency relationship between at least one node event, and each event linkage group includes at least one or more of a trigger event subset, a calculation event subset, or a control event subset, that is, each event linkage group can include at least one trigger event, one calculation event, or one control event. The node events included in the linkage event group constitute a certain logical relationship.
[0122] S420: Construct at least one logical link branch according to at least one linkage event group.
[0123] According to the types of node events in each linkage event group in at least one linkage event group and their logical relationships, a logical link branch corresponding to each linkage event group is constructed. The logical link branch can indicate the execution path and linkage rules between the node events in the corresponding linkage event group.
[0124] S430: Determine a fourth logical relationship between at least one linkage event group.
[0125] It is feasible to perform logic analysis between each linkage event group in at least one linkage event group, so as to construct a fourth logical relationship between at least one linkage event.
[0126] S440: Construct a logical link tree according to at least one logical link branch and the fourth logical relationship.
[0127] According to at least one logical link branch and the fourth logical relationship, the execution path and linkage rules between each logical link branch in at least one logical link branch are determined. For example, after a group of linked trigger events, calculation events and control events, another group of trigger events is entered, or after a group of linked calculation events, the control events of this group and the trigger events of another group are executed, thereby improving the complexity of the linkage scenario and meeting more diverse linkage needs.
[0128] Figure 6 This is a schematic diagram of a logical link branch constructed by two linkage event groups provided in an embodiment of the present application, wherein one linkage event group includes a trigger event T1, a calculation event C1 and a control event A1, and the other linkage event group includes a trigger event T2, a calculation event C2 and a trigger event T3. When the execution result of the calculation event C1 indicates that the control event A1 can be executed, the trigger event T2 is executed.
[0129] Figure 7(1) to Figure 7(3) It is a schematic diagram of various event execution paths and linkage rules provided by the embodiment itself, wherein handleTouch() represents the execution program of the trigger event, handleCondition() represents the execution program of the calculation event, handleCmd() represents the execution program of the control event, waitTouchCallback() represents the callback program of the trigger event, and waitCmdCallback() represents the callback program of the control event.
[0130] In a specific embodiment, Figure 8 As shown, the above method may also include:
[0131] S510: Construct an initial logic link tree corresponding to the linkage scenario according to the target semantic information.
[0132] The construction of the initial logical link tree may refer to the aforementioned embodiment and will not be described in detail here.
[0133] S520: Decompose the initial logical link tree to obtain at least one initial logical link branch.
[0134] It is feasible to perform a traversal indexing of tree nodes on the initial logical link tree to decompose the initial logical link tree into at least one initial logical link branch, and each initial logical link branch is a unidirectional graph.
[0135] S530: Perform a logic check on each initial logical link branch in at least one initial logical link branch to obtain a check result.
[0136] Optionally, the node events of the tree nodes included in each initial logical link branch may be tested for repeatability, and the closedness of the execution path indicated by each initial logical link branch may be tested.
[0137] S540: When the verification result indicates that each initial logical link branch does not have a repeated node event and each initial logical link branch is not a closed-loop link, the initial logical link tree is used as the logical link tree corresponding to the linkage scenario.
[0138] Based on the aforementioned embodiment, when the first detection result obtained by performing repeatability detection on the node events of the tree nodes contained in each initial logical link branch indicates that there are no repeated node events for each initial logical link branch, and the second detection result obtained by performing detection on the closedness of the execution path indicated by each initial logical link branch indicates that each initial logical link branch is not a closed-loop link, that is, if the verification of the initial logical link tree passes, the initial logical link tree can be used as the logical link tree corresponding to the linkage scenario, otherwise the initial logical link tree needs to be rebuilt.
[0139] In addition, mutual exclusivity detection may be performed on the node events of the tree nodes contained in each initial logical link branch. When the third detection result obtained indicates that the node events of the tree nodes contained in each initial logical link branch are not mutually exclusive, the verification passes.
[0140] S240: Determine the node object of each tree node according to the logical link tree.
[0141] In the embodiment of the present application, the type of the node object is any one of a local IoT device, an external medium or a logical object, wherein the external medium may be weather, temperature, humidity, PM25, etc., and the logical object may be a virtual process or a device shadow in the cloud, etc.
[0142] In a specific embodiment, a corresponding node object is configured for each tree node according to the type of the node event of each tree node, the data type corresponding to the node event of each tree node, and / or the function that the node event of each tree node needs to implement.
[0143] S250: Obtain a linkage scene link tree for the linkage scene according to the logical link tree and the node object of each tree node, so that the node object executes the node event of the corresponding tree node based on the execution path.
[0144] In an embodiment of the present application, the linkage scene link tree indicates event linkage rules between node objects of each tree node in the linkage scene.
[0145] In a specific embodiment, according to the configured node object of each tree node, the execution program of the node event of each tree node in the logical link tree is instantiated to obtain a linkage scene link tree for the linkage scene.
[0146] In a specific embodiment, the above method may further include:
[0147] S261: Obtain local newly added IoT devices.
[0148] S262: Update the node object of each tree node in the logical link tree according to the newly added IoT device.
[0149] S263: Update the linkage scene link tree according to the updated node object of each tree node to obtain the target linkage scene link tree.
[0150] In the above embodiment, when a new IoT device is added locally, there is no need to rebuild the linkage scene link tree from scratch. Instead, the node objects are updated based on the logical link tree, which reduces the workload required for the update and improves processing efficiency.
[0151] In a specific embodiment, the above method may further include:
[0152] The linkage scene link tree for the linkage scene is synchronized to the cloud and the target node object corresponding to at least one target tree node; at least one target tree node is a tree node in the logical link tree, and the type of the target node object is a local IoT device.
[0153] It can be seen from the above embodiments that a linkage scene construction method provided by the present application provides a more convenient linkage scene construction method - a voice construction method, which can respond to the user's linkage scene construction instruction, perform voice recognition processing, and obtain the voice text information to be processed; perform semantic analysis processing on the voice text information to be processed to obtain target semantic information, and the target semantic information indicates the user's personalized needs for the linkage scene; and then, according to the target semantic information, a logical link tree corresponding to the linkage scene can be constructed, and the logical link tree indicates the execution path between the node events of each tree node in at least one tree node, and the type of the node event is any one of a trigger event, a calculation event or a control event; according to the logical link tree, the node object of each tree node is determined, and the type of the node object is any one of a local IoT device, an external medium or a logical object; according to the logical link tree and the node object of each tree node, a linkage scene link tree for the linkage scene is obtained, so that the node object executes the node event of the corresponding tree node based on the execution path, and the linkage scene link tree indicates the event linkage rules between the node objects of each tree node in the linkage scene. The technical solution provided by the present application first constructs a logical link tree for the linkage scenario according to the target semantic information, which is used to indicate the execution path of each event in the linkage scenario. On this basis, a corresponding execution object or data object is configured for each event to execute the corresponding event according to the execution path, thereby constructing a linkage scenario that meets the user's personalized needs. The logical link tree is not affected by the addition, deletion or modification of objects, and can facilitate the update of objects and the linkage scene link tree, thereby improving the efficiency of linkage scene construction. In addition, the objects involved in the technical solution provided by the present application are not limited to IoT devices, but also introduce external media and logical objects, which can enrich the forms of trigger events, calculation events, and control events, thereby realizing more diverse linkage scenarios.
[0154] The present application embodiment also provides a joint scene construction device 900, such as Fig. 9 As shown, the device 900 may include:
[0155] The speech recognition module 910 is used to perform speech recognition processing in response to the user's linkage scene construction instruction to obtain speech text information to be processed;
[0156] The semantic analysis module 920 is used to perform semantic analysis on the speech text information to be processed to obtain target semantic information; the target semantic information indicates the personalized needs of the user for the linkage scenario;
[0157] A logic link tree construction module 930 is used to construct a logic link tree corresponding to the linkage scenario according to the target semantic information; the logic link tree indicates an execution path between node events of each tree node in at least one tree node; the type of the node event is any one of a trigger event, a calculation event or a control event;
[0158] A node object determination module 940 is used to determine the node object of each tree node according to the logical link tree, where the type of the node object is any one of a local IoT device, an external medium or a logical object;
[0159] The linkage scene link tree construction module 950 is used to obtain the linkage scene link tree for the linkage scene according to the logical link tree and the node object of each tree node, so that the node object executes the node event of the corresponding tree node based on the execution path; the linkage scene link tree indicates the event linkage rules between the node objects of each tree node in the linkage scene.
[0160] In one embodiment of the present application, the device 900 may further include:
[0161] An attribute information acquisition unit, used to acquire the attribute information of the user;
[0162] The semantic analysis module 920 may include:
[0163] The semantic analysis unit is used to perform semantic analysis on the speech text information to be processed and the attribute information to obtain the target semantic information.
[0164] In one embodiment of the present application, the device 900 may further include:
[0165] A new device acquisition unit is used to acquire new local IoT devices;
[0166] A node object updating unit, configured to update the node object of each tree node according to the newly added IoT device;
[0167] The linkage scene link tree updating unit is used to update the linkage scene link tree according to the updated node object of each tree node to obtain a target linkage scene link tree.
[0168] In one embodiment of the present application, the logical link tree construction module 930 may include:
[0169] An event set generating unit, used for generating a target trigger event set, a target calculation event set and a target control event set according to the target semantic information;
[0170] A first logic analysis unit, configured to perform logic analysis on at least one target trigger event in the target trigger event set to determine a first logical relationship between the at least one target trigger event;
[0171] A second logic analysis unit, configured to perform logic analysis on at least one target computing event in the target computing event set to determine a second logic relationship between the at least one target computing event;
[0172] A third logic analysis unit, configured to perform logic analysis on at least one target control event in the target control event set to determine a third logic relationship between the at least one target control event;
[0173] The first logical link tree construction unit is used to construct a logical link tree corresponding to the linkage scenario according to the first logical relationship, the second logical relationship, the third logical relationship and the preset event basic execution order.
[0174] In one embodiment of the present application, the device 900 may further include:
[0175] A first priority weight determination unit, configured to determine a first priority weight corresponding to each target trigger event in the at least one target trigger event;
[0176] A second priority weight determination unit, configured to determine a second priority weight corresponding to each target computing event in the at least one target computing event;
[0177] A third priority weight determination unit, configured to determine a third priority weight corresponding to each target control event in the at least one target control event;
[0178] A first logical relationship optimization unit, configured to optimize the first logical relationship according to a first priority weight corresponding to each target triggering event to obtain a first target logical relationship;
[0179] A second logical relationship optimization unit, configured to optimize the second logical relationship according to a second priority weight corresponding to each target calculation event to obtain a second target logical relationship;
[0180] A third logical relationship optimization unit, configured to optimize the third logical relationship according to a third priority weight corresponding to each target control event to obtain a third target logical relationship;
[0181] The first logical link tree construction unit may include:
[0182] The first logical link tree construction subunit is used to construct a logical link tree corresponding to the linkage scenario according to the first target logical relationship, the second target logical relationship, the third target logical relationship and the preset event basic execution order.
[0183] In one embodiment of the present application, the logical link tree construction module 930 may include:
[0184] An event grouping unit, configured to generate at least one linkage event group according to the target semantic information; each event linkage group in the at least one linkage event group includes at least one or more of a trigger event subset, a calculation event subset, or a control event subset;
[0185] A logical link branch construction unit, configured to construct at least one logical link branch corresponding to the at least one linkage event group;
[0186] a fourth logic analysis unit, configured to determine a fourth logic relationship between the at least one linkage event group;
[0187] The second logical link tree construction unit is used to construct the logical link tree according to the at least one logical link branch and the fourth logical relationship.
[0188] In one embodiment of the present application, the logical link tree construction module 930 may include:
[0189] A third logical link tree construction unit, configured to construct an initial logical link tree corresponding to the linkage scenario according to the target semantic information;
[0190] A decomposition unit, configured to decompose the initial logical link tree to obtain at least one initial logical link branch;
[0191] A logic check unit, configured to perform a logic check on each initial logical link branch in the at least one initial logical link branch to obtain a check result;
[0192] The fourth logical link tree construction unit is used to use the initial logical link tree as the logical link tree corresponding to the linkage scenario when the verification result indicates that there is no repeated node event in each initial logical link branch and each initial logical link branch is not a closed-loop link.
[0193] In one embodiment of the present application, the node object determination module 940 may include:
[0194] The node object determination unit is used to configure a corresponding node object for each tree node according to the type of the node event of each tree node or the data type corresponding to the node event of each tree node.
[0195] In one embodiment of the present application, the device 900 may further include:
[0196] A synchronization module is used to synchronize the linkage scene link tree for the linkage scene to the cloud and a target node object corresponding to at least one target tree node; the at least one target tree node is a tree node in the logical link tree, and the type of the target node object is a local IoT device.
[0197] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program with a predetermined function, and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories) or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.
[0198] It should be noted that the device provided in the above embodiment, when implementing its functions, is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device and method embodiments provided in the above embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.
[0199] An embodiment of the present application provides a computer device, which includes a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by the processor to implement a linkage scene construction method provided in the above method embodiment.
[0200] Fig.10A schematic diagram of the hardware structure of a device for implementing a linkage scene construction method provided in an embodiment of the present application is shown, and the device may participate in or include the apparatus or system provided in an embodiment of the present application. Fig.10 As shown, the device 10 may include one or more (1002a, 1002b, ..., 1002n are used to illustrate) processors 1002 (the processor 1002 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 1004 for storing data, and a transmission device 1006 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the I / O interface), a network interface, a power supply and / or a camera. It can be understood by those skilled in the art that Fig.10 The structure shown is for illustration only and does not limit the structure of the electronic device. Fig.10 More or fewer components as shown, or with Fig.10 Different configurations are shown.
[0201] It should be noted that the one or more processors 1002 and / or other data processing circuits described above may generally be referred to herein as "data processing circuits". The data processing circuits may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuit may be a single independent processing module, or may be incorporated in whole or in part into any of the other components in the device 10 (or mobile device). As involved in the embodiments of the present application, the data processing circuit acts as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).
[0202] The memory 1004 can be used to store software programs and modules of application software, such as program instructions / data storage devices corresponding to the methods in the embodiments of the present application. The processor 1002 executes various functional applications and data processing by running the software programs and modules stored in the memory 1004, that is, realizing the above-mentioned method of building a linkage scene. The memory 1004 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 1004 may further include a memory remotely arranged relative to the processor 1002, and these remote memories may be connected to the device 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0203] The transmission device 1006 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the device 10. In one example, the transmission device 1006 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 1006 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0204] The display may be, for example, a touch screen liquid crystal display (LCD) that may enable a user to interact with a user interface of device 10 (or mobile device).
[0205] An embodiment of the present application also provides a computer-readable storage medium, which can be set in a server to store at least one instruction or at least one program related to a linkage scene construction method in a method embodiment. The at least one instruction or the at least one program is loaded and executed by the processor to implement a linkage scene construction method provided in the above method embodiment.
[0206] Optionally, in this embodiment, the storage medium may be located in at least one of the multiple network servers of the computer network. Optionally, in this embodiment, the storage medium may include, but is not limited to, various media that can store program codes, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.
[0207] The embodiment of the present invention also provides a computer program product or a computer program, wherein the computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes a linkage scene construction method provided in the above various optional implementations.
[0208] It should be noted that the above-mentioned sequence of the embodiments of the present application is for description only and does not represent the advantages and disadvantages of the embodiments. The above-mentioned specific embodiments of the present application are described. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0209] Each embodiment in this application is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device, equipment and storage medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0210] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
[0211] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.
Claims
1. A linkage scene construction method, characterized in that: The method comprises: In response to the user's linkage scene construction instruction, voice recognition processing is performed to obtain voice text information to be processed; Performing semantic analysis on the speech text information to be processed to obtain target semantic information; the target semantic information indicates the personalized needs of the user for the linkage scenario; According to the target semantic information, a logical link tree corresponding to the linkage scenario is constructed; the logical link tree indicates an execution path between node events of each tree node in at least one tree node; the type of the node event is any one of a trigger event, a calculation event or a control event; Determine, according to the logical link tree, a node object of each tree node, wherein the type of the node object is any one of a local IoT device, an external medium, or a logical object; According to the logical link tree and the node objects of each tree node, a linkage scene link tree for the linkage scene is obtained, so that the node object executes the node event of the corresponding tree node based on the execution path; the linkage scene link tree indicates the event linkage rules between the node objects of each tree node in the linkage scene.
2. The method according to claim 1, characterized in that The method further comprises: Obtaining attribute information of the user; The performing semantic analysis on the speech text information to be processed to obtain target semantic information includes: The speech text information to be processed and the attribute information are subjected to semantic analysis to obtain the target semantic information.
3. The method according to claim 1, characterized in that The method further comprises: Get new local IoT devices; According to the newly added IoT device, update the node object of each tree node; According to the updated node object of each tree node, the linkage scene link tree is updated to obtain a target linkage scene link tree.
4. The method according to claim 1, characterized in that: The step of constructing a logical link tree corresponding to the linkage scenario according to the target semantic information includes: Generate a target trigger event set, a target calculation event set and a target control event set according to the target semantic information; Performing logic analysis on at least one target trigger event in the target trigger event set to determine a first logical relationship between the at least one target trigger event; Performing logic analysis on at least one target computing event in the target computing event set to determine a second logical relationship between the at least one target computing event; Performing logic analysis on at least one target control event in the target control event set to determine a third logical relationship between the at least one target control event; According to the first logical relationship, the second logical relationship, the third logical relationship and the preset event basic execution order, a logical link tree corresponding to the linkage scenario is constructed.
5. The method according to claim 4, characterized in that The method further comprises: Determine a first priority weight corresponding to each target trigger event in the at least one target trigger event; Determine a second priority weight corresponding to each target computing event in the at least one target computing event; Determining a third priority weight corresponding to each target control event in the at least one target control event; Optimizing the first logical relationship according to the first priority weight corresponding to each target triggering event to obtain a first target logical relationship; According to the second priority weight corresponding to each target calculation event, the second logical relationship is optimized to obtain a second target logical relationship; According to the third priority weight corresponding to each target control event, the third logical relationship is optimized to obtain a third target logical relationship; The step of constructing a logical link tree corresponding to the linkage scenario according to the first logical relationship, the second logical relationship, the third logical relationship and a preset event basic execution order includes: According to the first target logical relationship, the second target logical relationship, the third target logical relationship and the preset event basic execution order, a logical link tree corresponding to the linkage scenario is constructed.
6. The method according to claim 1, characterized in that The step of constructing a logical link tree corresponding to the linkage scenario according to the target semantic information includes: At least one linkage event group is generated according to the target semantic information; each event linkage group in the at least one linkage event group includes at least one or more of a trigger event subset, a calculation event subset or a control event subset; According to the at least one linkage event group, correspondingly construct at least one logical link branch; determining a fourth logical relationship between the at least one linkage event group; The logical link tree is constructed according to the at least one logical link branch and the fourth logical relationship.
7. The method according to claim 1, characterized in that The step of constructing a logical link tree corresponding to the linkage scenario according to the target semantic information includes: According to the target semantic information, construct an initial logical link tree corresponding to the linkage scenario; Decomposing the initial logical link tree to obtain at least one initial logical link branch; Performing a logic check on each initial logical link branch of the at least one initial logical link branch to obtain a check result; When the verification result indicates that each of the initial logical link branches does not have a repeated node event and each of the initial logical link branches is not a closed-loop link, the initial logical link tree is used as the logical link tree corresponding to the linkage scenario.
8. The method according to claim 1, characterized in that: Determining the node object of each tree node according to the logical link tree includes: According to the type of the node event of each tree node or the data type corresponding to the node event of each tree node, a corresponding node object is configured for each tree node.
9. The method according to claim 1, characterized in that: The method further comprises: The linkage scene link tree for the linkage scene is synchronized to the cloud and the target node object corresponding to at least one target tree node; the at least one target tree node is a tree node in the logical link tree, and the type of the target node object is a local IoT device.
10. A linkage scene construction device, characterized in that: The device comprises: A speech recognition module is used to respond to the user's linkage scene construction instruction, perform speech recognition processing, and obtain speech text information to be processed; A semantic analysis module, used for performing semantic analysis on the speech text information to be processed to obtain target semantic information; the target semantic information indicates the personalized needs of the user for the linkage scenario; A logical link tree construction module, used to construct a logical link tree corresponding to the linkage scenario according to the target semantic information; the logical link tree indicates an execution path between node events of each tree node in at least one tree node; the type of the node event is any one of a trigger event, a calculation event or a control event; A node object determination module, used to determine the node object of each tree node according to the logical link tree, wherein the type of the node object is any one of a local IoT device, an external medium or a logical object; A linkage scene link tree construction module is used to obtain a linkage scene link tree for the linkage scene according to the logical link tree and the node object of each tree node, so that the node object executes the node event of the corresponding tree node based on the execution path; the linkage scene link tree indicates the event linkage rules between the node objects of each tree node in the linkage scene.
Citation Information
Patent Citations
Family scene linkage smart home system based on voice recognition and control method and control device thereof
CN112558491A
Linkage scene execution method and device, storage medium and electronic equipment
CN113593545A
Equipment linkage model configuration method based on industry Internet of Things scene
CN115460051A
Scene creation method and device, storage medium and electronic equipment
CN115695065A
Equipment data transfer method and equipment based on Internet of Things platform, and medium
CN116016584A