Equipment control method and device, storage medium and electronic device
By obtaining the operation path that matches the current scenario in the target state transition model and verifying the path, the problem of large equipment scale and redundancy in the traditional state transition model is solved, and the real-time performance and reliability of equipment control are improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-26
- Publication Date
- 2026-04-03
AI Technical Summary
Traditional state transition models involve large-scale and redundant equipment, leading to problems such as low real-time control and verification efficiency.
By obtaining the target operation path that matches the current scenario requirements from the target state transition model and performing path verification processing, an operation execution strategy is generated, including device clustering, path folding, and path verification, thereby optimizing device control operations.
The structure of the state transition model was simplified, improving verification efficiency and the real-time performance and reliability of device control.
Smart Images

Figure CN121785152A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of smart devices, and more specifically, to a device control method, apparatus, storage medium, and electronic device. Background Technology
[0002] In the collaborative control of intelligent devices, state transition models are widely used to describe the concurrent and synchronous behavior of device operations. For example, Petri nets are a classic state transition model that uses place nodes to represent device states, transition nodes to represent operation triggers, and tokens to represent resource flows for graphical modeling, formally expressing the interaction logic of multiple devices. For instance, when a user triggers "cinema mode," a Petri net can be modeled as a sequence of turning off the lights (transition 1) – dimming the lights (place A) – starting the projector (transition 2). However, traditional state transition models require separate modeling for each device, leading to an exponential increase in the number of nodes with the scale of the devices. For example, 20 devices would require over 400,000 nodes, resulting in redundant model structure, massive scale, and excessively long model verification time, making it difficult to meet the real-time requirements of device control. Summary of the Invention
[0003] This application provides a device control method, apparatus, storage medium, and electronic device, with the aim of simplifying the structure of the state transition model, improving the verification efficiency of the state transition model, and optimizing the real-time performance and reliability of device control.
[0004] According to one aspect of the embodiments of this application, a device control method is provided, including:
[0005] In the target state transition model, a target operation path matching the current scenario requirements is obtained; the target operation path includes at least one operation path node.
[0006] Perform path verification processing on the target operation path to obtain the path verification result;
[0007] An operation execution strategy is generated based on the path verification result, and device control operations are performed according to the operation execution strategy.
[0008] Optionally, the operation path nodes include target library nodes and target transition nodes;
[0009] Before obtaining the target operation path that matches the current scenario requirements, the method further includes:
[0010] Perform device clustering on the target global devices to obtain the device clustering results;
[0011] The target library node and the target transition node are constructed based on the device clustering results.
[0012] The target state transition model is constructed based on the target library node and the target transition node.
[0013] Optionally, the operation path node includes a path folding node;
[0014] Before obtaining the target operation path that matches the current scenario requirements, the method further includes:
[0015] Based on the device operation log, at least one operation path to be folded is obtained from the target state transition model whose historical execution frequency exceeds a preset folding threshold.
[0016] Each of the operation paths to be folded is constructed as a path folding node, and each of the operation paths to be folded is replaced with the corresponding path folding node in the target state transition model.
[0017] Optionally, the step of performing path verification processing on the target operation path to obtain a path verification result includes:
[0018] Obtain the preset verification rules corresponding to the target operation path;
[0019] The target operation path is traversed to determine whether there is a control operation conflict in the target operation path according to the preset verification rules, and the path verification result is obtained.
[0020] Optionally, generating the operation execution strategy based on the path verification result includes:
[0021] If a control operation conflict is determined to exist in the target operation path, an operation priority strategy is obtained;
[0022] The operation execution strategy is generated based on the operation priority strategy and the target operation path.
[0023] Optionally, after generating the operation execution strategy based on the operation priority strategy and the target operation path, the method further includes:
[0024] Update the target operation path in the target state transition model according to the operation execution strategy.
[0025] Optionally, generating the operation execution strategy based on the path verification result includes:
[0026] If it is determined that there is no control operation conflict in the target operation path, the device priority policy corresponding to the target operation path is obtained;
[0027] The operation execution strategy is generated based on the device priority strategy and the target operation path.
[0028] According to another aspect of the embodiments of this application, a device control apparatus is provided, comprising:
[0029] The path acquisition module is used to acquire a target operation path that matches the current scenario requirements in the target state transition model; the target operation path includes at least one operation path node.
[0030] The path verification module is used to perform path verification processing on the target operation path and obtain the path verification result.
[0031] The device control module is used to generate an operation execution strategy based on the path verification result, and to execute device control operations according to the operation execution strategy.
[0032] According to another aspect of the embodiments of this application, a computer-readable storage medium is provided, the computer-readable storage medium including a stored program, wherein the program, when executed, performs the device control method provided in any embodiment of the present invention.
[0033] According to another aspect of the present application, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute, through the computer program, a device control method provided in any embodiment of the present invention.
[0034] This application provides a device control method, apparatus, storage medium, and electronic device. By obtaining a target operation path matching the current scenario requirements from a target state transition model, and the target operation path including at least one operation path node, and then performing path verification processing on the target operation path to obtain an operation execution strategy, the device control operation is executed according to the operation execution strategy. This solves the problem of reduced real-time performance of device control caused by the redundancy and large scale of traditional state transition models, simplifies the structure of the state transition model, improves the verification efficiency of the state transition model, and optimizes the real-time performance and reliability of device control. Attached Figure Description
[0035] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0036] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0037] Figure 1 This is a schematic diagram of the hardware environment for an interaction method of a smart device according to an embodiment of this application;
[0038] Figure 2 This is a flowchart of a device control method provided in an embodiment of the present invention;
[0039] Figure 3 This is a schematic diagram of the structure of a device control apparatus provided in an embodiment of the present invention;
[0040] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0041] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0042] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0043] According to one aspect of the embodiments of this application, a device control method is provided. This device control method is widely used in whole-house intelligent digital control application scenarios such as smart homes, smart home ecosystems, and intelligencehouse ecosystems. Optionally, in this embodiment, the above-mentioned device control method can be applied to, for example... Figure 1 The hardware environment shown consists of terminal device 102 and server 104. For example... Figure 1 As shown, server 104 is connected to terminal device 102 via a network and can be used to provide services (such as application services) to the terminal or clients installed on the terminal. A database can be set up on the server or independently of the server to provide data storage services for server 104. Cloud computing and / or edge computing services can be configured on the server or independently of the server to provide data processing services for server 104.
[0044] The aforementioned network may include, but is not limited to, at least one of the following: wired network, wireless network. The aforementioned wired network may include, but is not limited to, at least one of the following: wide area network, metropolitan area network, local area network. The aforementioned wireless network may include, but is not limited to, at least one of the following: Wi-Fi (Wireless Fidelity), Bluetooth. The terminal device 102 may not be limited to PC, mobile phone, tablet computer, smart air conditioner, smart range hood, smart refrigerator, smart oven, smart stove, smart washing machine, smart water heater, smart washing equipment, smart dishwasher, smart projector, smart TV, smart clothes rack, smart curtains, smart audio-visual equipment, smart socket, smart speaker, smart speaker box, smart fresh air equipment, smart kitchen and bathroom equipment, smart bathroom equipment, smart robot vacuum cleaner, smart window cleaning robot, smart mopping robot, smart air purifier, smart steam oven, smart microwave oven, smart water heater, smart air purifier, smart water dispenser, smart door lock, etc.
[0045] This embodiment provides a device control method for controlling intelligent devices in a scenario. Figure 2 A flowchart of a device control method provided in an embodiment of the present invention includes the following steps:
[0046] Step 210: In the target state transition model, obtain the target operation path that matches the current scenario requirements.
[0047] The target operation path includes at least one operation path node. Specifically, the target state transition model can be a pre-constructed state transition model based on the device to be controlled in the current scenario, such as a Petri net model. The target operation path can be a single operation path node or an operation path composed of multiple operation path nodes used to represent a specific device control process in the target state transition model. The device control process represented by it can enable the device control operation to meet the requirements of the current scenario, such as an operation chain in a Petri net model.
[0048] The current scenario requirement can be the need to control any device in the current scenario. It can be automatically sensed based on the scenario environment through pre-setting or learning from historical data, such as sensing when a user leaves work and automatically obtaining the current scenario requirement of turning on the lights and air conditioning. Alternatively, it can be obtained based on the user's trigger operation, such as when the user selects "turn on the lights" or triggers "cinema mode" through the corresponding user terminal, in which case the corresponding current scenario requirement can be determined. The current scenario requirement can be obtained in any way that can be achieved using the relevant technologies in this field, and is not limited here.
[0049] In this embodiment, the target state transition model may include at least one operation path, and each operation path may include at least one operation path node. A single operation path node may represent any device state or an operation performed on any device. Therefore, any operation path may include multiple operation path nodes to represent a device control process in which an operation in an operation path node changes the device state in other operation path nodes in the operation path. For example, the target operation path may be "Turn off the lights (node 1) - dim the lights (node 2) - start the projector (node 3)". A single operation path node may also represent a device control process in which any operation changes the device state. Therefore, any operation path may include only a single operation path node. For example, the above "Turn off the lights - dim the lights - start the projector" may be used as an operation path node.
[0050] In one optional implementation, the operation path node may include a target place node and a target transition node. The target place node may be an operation path node representing a device state, and the target transition node may be an operation path node representing an operation on the device.
[0051] Accordingly, before obtaining the target operation path that matches the current scenario requirements, it may also include: performing device clustering processing on the target global devices to obtain device clustering results; constructing target place nodes and target transition nodes based on the device clustering results; and constructing a target state transition model based on the target place nodes and target transition nodes.
[0052] The target global device can be any controllable device present in the current scene. Device clustering can be an operation that groups devices based on feature similarity, grouping multiple devices with high feature similarity into a single device group. The device clustering result can be one or more device groups or devices obtained through device clustering.
[0053] In this embodiment, the target global device can be a device within the scene that is pre-sensed and whose relevant device data can be obtained. It can be obtained through any method achievable using relevant technologies in the art, preferably through automatic identification. Specifically, this can include: scanning protocols such as mDNS (Multicast Domain Name System), UPnP (Universal Plug and Play), and BLE (Bluetooth Low Energy) broadcasting within the local area network; reading the device registry of the smart gateway or IoT (Internet of Things) platform; and identifying the brand and model using device fingerprints, such as MAC OUI (Media Access Control Organizationally Unique Identifier) and HTTP User-Agent (Hypertext Transfer Protocol User-Agent). Optionally, the target global device can also be manually added by the user. By prompting the user to add relevant device data, such as brand, function type, and communication protocol, devices in the scene that cannot be automatically identified can be identified as target global devices.
[0054] Specifically, the target global devices are clustered, preferably based on their functional semantics and communication protocol characteristics, aggregating target global devices with similar functions and / or compatible protocols into device groups, such as air conditioning device groups and security device groups. Optionally, an improved DBSCAN algorithm (Density-Based Spatial Clustering of Applications with Noise) can be used to automatically classify devices by calculating the cosine similarity between device feature vectors, obtaining the device clustering results. For example, air conditioners of brand A and brand B are highly similar because their cooling functions and communication protocols are both greater than 0.9, and can be classified into the same device group. Preferably, the device clustering results can be a structured list of device groups.
[0055] Furthermore, target place nodes and target transition nodes can be constructed based on the device clustering results. Target place nodes can be constructed based on devices and / or device groups in the device clustering results, and these target place nodes can be used to represent the state of a device or device group. Target transition nodes can be constructed based on the control operations of the device or device group's state. Therefore, a target state transition model can be constructed based on the target place nodes and target transition nodes.
[0056] In one optional implementation, the operation path node may include a path folding node. The path folding node can be a node used to represent a device control process that alters the state of any device through any operation.
[0057] Accordingly, before obtaining the target operation path that matches the current scenario requirements, it may also include: obtaining at least one operation path to be folded in the target state transition model based on the device operation log, whose historical execution frequency exceeds a preset folding threshold; constructing each operation path to be folded as a path folding node, and replacing each operation path to be folded with the corresponding path folding node in the target state transition model.
[0058] The device operation log records data on the operation process of controlling the device within a historical timeframe in the current scenario. The historical execution frequency is the frequency of any operation process controlling the device within a historical timeframe. The preset folding threshold is a pre-set threshold for the historical execution frequency, used to determine if the frequency of any operation process controlling the device within a historical timeframe is sufficiently high. In this case, the operation path to be folded can be the operation path representing the operation process controlling the device with a sufficiently high frequency within a historical timeframe.
[0059] Specifically, automatic or manual control operations on the device within a historical period can be recorded in the device operation log. The historical execution frequency of any control operation path can then be obtained from the log. If the historical execution frequency exceeds a preset folding threshold, it can be determined that the control operation corresponding to that path occurs frequently and can be identified as a path to be folded. This path can then be further constructed as a path folding node in the target state transition model, replacing the original operation path. This reduces the node size and simplifies the structure of the target state transition model. Furthermore, when the operation represented by the path to be folded needs to be executed again, the corresponding path folding node can be directly obtained, saving time on path verification and improving the real-time performance of device control.
[0060] Based on the above implementation methods, optionally, new operation paths to be folded can be obtained in real time or periodically from the device operation log; alternatively, operation paths to be folded can be obtained from template creation operations, where the template creation operation can be an operation where the user manually creates the device control operation process as the operation path through the user terminal. The above implementation methods can achieve continuous updating and simplification of the target state transition model.
[0061] It should be noted that the above method for constructing a target state transition model based on target place nodes, target transition nodes, and / or path folding nodes can be used in the initial construction of the target state transition model; it can also be used to optimize an already constructed original state transition model to obtain the target state transition model. Specifically, this can include: parsing the place nodes and transition nodes in the original state transition model; performing device clustering based on device tags, such as "device_id=AC_Mijia", and optimizing the model structure composed of place nodes and transition nodes according to the clustering results; identifying the operation path to be folded, constructing it, and replacing it with path folding nodes; outputting the optimized target state transition model; optionally, the optimized target state transition model can also be verified to ensure its correctness and rationality.
[0062] Step 220: Perform path verification processing on the target operation path to obtain the path verification result.
[0063] The path verification process can be used to determine whether the device control operation process represented by the target operation path is safe and executable. The path verification result can describe whether the device control operation process represented by the target operation path is safe and executable.
[0064] Specifically, by performing path verification processing on the target operation path, it can be determined whether the device control operation process represented by the target operation path is safe and executable, or whether there is a conflict in the device control operation process represented by the target operation path. For example, the simultaneous start of air conditioning cooling and humidifier will cause a decrease in environmental comfort, or the simultaneous control of multiple devices will cause conflicts such as competing for the same resource, thereby generating path verification results.
[0065] In an optional implementation, performing path verification processing on the target operation path to obtain a path verification result may include: obtaining a preset verification rule corresponding to the target operation path; performing operation path traversal on the target operation path to determine whether there is a control operation conflict in the target operation path according to the preset verification rule, and obtaining a path verification result.
[0066] Among these, the preset verification rules can be pre-defined rules for path verification processing, which can be used to determine whether the operation process controlled by any device is safe and executable. Operation path traversal can be the process of traversing the target operation path to determine the complete device control operation process it represents. Control operation conflict can be a situation where the operation process cannot be executed safely.
[0067] Specifically, preset verification rules can be set for all devices. These rules include limitations on the safety and feasibility of all device control operations. For example, rules could be set to prevent mutual exclusion between "air conditioning cooling mode" and "humidifier high humidity mode" due to condensation risks, or rules to prevent circuit overload caused by the simultaneous operation of multiple high-power devices. Specific numerical conditions could also be included, such as rules to determine conflicts based on the temperature-humidity coupling formula: Temp < 25℃ & Humidity < 70%. Once the target operation path is determined, preset verification rules corresponding to the target operation path can be obtained from all preset verification rules. Specifically, these can be preset verification rules related to the devices and / or groups of devices involved in the device control operation process represented by the target operation path. By traversing the target operation path, it can be determined whether there are control operation conflicts, thereby generating corresponding path verification results. In an optional implementation, the formal verification tool Z3 theorem prover can be used for operation path traversal. The Z3 engine can determine whether there are control operation conflicts in the target operation path based on the preset verification rules.
[0068] The above implementation method can perform path verification processing after determining the matching target operation path according to the current scenario requirements, thus eliminating the need to pre-traverse and verify all operation paths in the target state transition model, saving system resources. Furthermore, since the target operation path in the target state transition can include at least one operation path node, and the number of operation path nodes is relatively small, the path verification processing based on the above implementation method will not affect the real-time performance of device control. Optionally, the above method for performing path verification processing on the target operation path can also be applied to perform path verification processing on all operation paths of the target state transition model after its construction, to detect the correctness and rationality of the target state transition model, and to optimize the target state transition model based on the path verification results. Because the target state transition model provided in this embodiment is small in scale and simple in structure, path verification processing based on traversal can also save system resources and improve efficiency compared to existing technologies.
[0069] In an optional implementation, after constructing the target state transition model, the method may further include: if an update access device is detected in the target global device, associating the update access device with a matching target library node according to the device clustering rules of the device clustering process; and updating the preset verification rules according to the update access device.
[0070] The updated access devices can include newly added devices in the current scenario and / or devices whose device data has been updated. The device clustering rules can be the device grouping rules on which the device clustering process is based.
[0071] Specifically, when an update access device is detected in the scenario, according to the device clustering rules, if it is determined that the update access device and the device or device group represented by the existing target library node can be classified into the same device group, the update access device can be associated with the corresponding target library node, and the preset verification rules can be updated accordingly.
[0072] S230. Generate an operation execution strategy based on the path verification result, and execute device control operations according to the operation execution strategy.
[0073] The operation execution strategy can include specific operations to control the equipment, and can realize the equipment control operation process represented by the target operation path or the equipment control effect achieved by the process.
[0074] Specifically, if the path verification results determine that the device control operation process represented by the target operation path is safe and executable, an operation execution strategy can be directly generated based on the description of the target operation path. If the path verification results determine that the device control operation process represented by the target operation path has conflicts, such as simultaneous start-up of air conditioning and humidifier causing a decrease in environmental comfort, or simultaneous control of multiple devices causing conflicts such as competing for the same resources, the operation process of the target operation path can be adjusted to obtain an operation execution strategy that is safe and executable while achieving the same device control effect as the target operation path. Optionally, generating an operation execution strategy may specifically include determining the execution order and time interval of the device control operations in the target operation path; furthermore, the preferred operation execution strategy may be a queue of operation instructions with timestamps, such as "T=0s: turn off the lights; T=2s: start the air conditioner; T=300s: start the humidifier".
[0075] In an optional implementation, generating an operation execution strategy based on the path verification result may include: obtaining an operation priority strategy when it is determined that there is a control operation conflict in the target operation path; and generating an operation execution strategy based on the operation priority strategy and the target operation path.
[0076] Among them, the operation priority strategy can be a pre-determined priority order for the execution of control operations among different devices and / or groups of devices.
[0077] Specifically, when control operation conflicts exist in the target operation path, an operation priority strategy can be obtained. Based on the priority order of control operation execution among different backup and / or device groups described in the operation priority strategy, the device control operation process described in the target operation path is adjusted to a safe and executable operation process, thereby obtaining an operation execution strategy. Preferably, the operation execution strategy can be determined to prioritize the execution of control operations with higher priority, and automatically suspend or delay the execution of control operations with lower priority. For example, the operation priority strategy may include a higher priority for control operations on security device groups than for control operations on environmental device groups. In the case where simultaneous activation of security devices and environmental devices in the target operation path causes communication channel contention, the operation execution strategy can be determined to activate the security devices first, followed by the environmental devices.
[0078] In an optional implementation, after generating the operation execution strategy based on the operation priority strategy and the target operation path, the method may further include: updating the target operation path in the target state transition model based on the operation execution strategy.
[0079] In the above implementation, if a control operation conflict is determined based on a preset verification rule, it can be concluded that the target operation path in the target state transition model is not constructed reasonably. In addition to generating an operation execution strategy to respond to the current scenario requirements, the target operation path can also be updated according to the generated operation execution strategy so that the updated target operation path can represent the operation process in the operation execution strategy. This way, when the updated target operation path needs to be executed later, the original control operation conflict can be handled without repeating it.
[0080] In an optional implementation, generating an operation execution strategy based on the path verification result may include: obtaining the device priority strategy corresponding to the target operation path when it is determined that there is no control operation conflict in the target operation path; and generating an operation execution strategy based on the device priority strategy and the target operation path.
[0081] Among them, the device priority strategy can be a pre-determined priority order for the execution of control operations among different devices in the same device group.
[0082] Specifically, if there are no control operation conflicts in the target operation path, an operation execution strategy can be generated based on the operation process described in the target operation path. Furthermore, considering that there are state descriptions and / or control operations for the device group in the operation process, and that any part of the device group can be identified for control in actual execution, the corresponding device priority strategy can be obtained. Thus, any device in the device group involved in the target operation path that needs to be controlled can be identified based on the device priority strategy, and an operation execution strategy can be generated.
[0083] In the above embodiments, the device priority strategy may include a preset fixed priority order among different devices in the same device group, or it may include rules for determining the priority order. For example, it may include determining the user's device usage habits and preferences based on device operation logs, and setting a higher priority for devices in the same device group that are used more frequently by the user; it may also include rules for determining the priority order based on the current scenario requirements, for example, if the current scenario requires the device to achieve the lowest power consumption, then a higher priority may be set for devices in the same device group that have a higher energy efficiency ratio; or it may include rules for determining the priority order based on user operations, for example, if the user can explicitly specify a device in the same device group, then that device has the highest priority.
[0084] Alternatively, after associating the update access device with the matching target repository node, the device priority policy can also be updated accordingly.
[0085] The above implementation method obtains the target operation path that matches the current scenario requirements in the target state transition model. The target operation path includes at least one operation path node. Then, the target operation path is verified to obtain the operation execution strategy. The device control operation is then executed according to the operation execution strategy. This solves the problem of reduced real-time performance of device control caused by the redundancy and large scale of the traditional state transition model. It simplifies the structure of the state transition model, improves the verification efficiency of the state transition model, and optimizes the real-time performance and reliability of device control.
[0086] According to another aspect of the embodiments of the present invention, Figure 3 This is a schematic diagram of the structure of a device control apparatus provided in an embodiment of the present invention, as shown below. Figure 3 As shown, the device includes a path acquisition module 310, a path verification module 320, and a device control module 330, wherein:
[0087] The path acquisition module 310 is used to acquire a target operation path that matches the current scenario requirements in the target state transition model; the target operation path includes at least one operation path node.
[0088] Path verification module 320 is used to perform path verification processing on the target operation path and obtain path verification results;
[0089] The device control module 330 is used to generate an operation execution strategy based on the path verification result, and to execute device control operations according to the operation execution strategy.
[0090] In an optional implementation, the operation path node may include a target place node and a target transition node; the device control device may further include: a model building module, used to perform device clustering processing on the target global devices to obtain device clustering results; to build the target place node and the target transition node based on the device clustering results; and to build the target state transition model based on the target place node and the target transition node.
[0091] In an optional implementation, the operation path node may include a path folding node; the device control device may further include: a model building module, configured to obtain at least one operation path to be folded in the target state transition model based on the device operation log, wherein the historical execution frequency exceeds a preset folding threshold; construct each of the operation paths to be folded into a path folding node, and replace each of the operation paths to be folded with the corresponding path folding node in the target state transition model.
[0092] In an optional implementation, the path verification module 320 can be specifically used to obtain the preset verification rules corresponding to the target operation path; perform operation path traversal on the target operation path to determine whether there is a control operation conflict in the target operation path according to the preset verification rules, and obtain the path verification result.
[0093] In an optional implementation, the device control module 330 may be specifically used to: obtain an operation priority strategy when it is determined that there is a control operation conflict in the target operation path; and generate the operation execution strategy according to the operation priority strategy and the target operation path.
[0094] In an optional implementation, the device control module 330 can also be used to: update the target operation path in the target state transition model according to the operation execution strategy.
[0095] In an optional implementation, the device control module 330 may be specifically used to: obtain the device priority policy corresponding to the target operation path when it is determined that there is no control operation conflict in the target operation path; and generate the operation execution policy according to the device priority policy and the target operation path.
[0096] According to another aspect of the embodiments of the present invention, Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present invention, such as... Figure 4 As shown, the electronic device includes a processor 410, a memory 420, an input device 430, and an output device 440; the number of processors 410 in the electronic device can be one or more. Figure 4 Taking a processor 410 as an example; the processor 410, memory 420, input device 430, and output device 440 in the electronic device can be connected via a bus or other means. Figure 4 Taking the example of a connection between China and Israel via a bus.
[0097] The memory 420, as a computer-readable storage medium, can be used to store software programs, computer-executable programs, and modules, such as the program instructions / modules corresponding to the device control method in this embodiment of the invention (e.g., the path acquisition module 310, path verification module 320, and device control module 330 in the device control device). The processor 410 executes various functional applications and data processing of the electronic device by running the software programs, instructions, and modules stored in the memory 420, thereby realizing the aforementioned device control method.
[0098] The memory 420 may primarily include a program storage area and a data storage area. The program storage area may store the operating system and at least one application program required for a given function; the data storage area may store data created based on terminal usage. Furthermore, the memory 420 may include high-speed random access memory and non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 420 may further include memory remotely located relative to the processor 410, which can be connected to the electronic device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0099] Input device 430 can be used to receive input digital or character information, and generate key signal inputs related to user settings and function control of the electronic device. It can also be a camera for acquiring images and a sound pickup device for acquiring audio data. Output device 440 may include display devices such as a screen, and audio devices such as a speaker. It should be noted that the specific composition of input device 430 and output device 440 can be set according to actual conditions. Processor 410 executes various functional applications and data processing of the electronic device by running software programs, instructions, and modules stored in memory 420.
[0100] According to another aspect of the present invention, the present invention also provides a computer-readable storage medium comprising a stored program, wherein the program, when executed, performs the following device control method:
[0101] In the target state transition model, a target operation path matching the current scenario requirements is obtained; the target operation path includes at least one operation path node.
[0102] Perform path verification processing on the target operation path to obtain the path verification result;
[0103] An operation execution strategy is generated based on the path verification result, and device control operations are performed according to the operation execution strategy.
[0104] Of course, the computer-executable instructions provided in the embodiments of the present invention are not limited to the method operations described above, but can also perform related operations in the device control method provided in any embodiment of the present invention.
[0105] Based on the above description of the implementation methods, those skilled in the art can clearly understand that the present invention can be implemented using software and necessary general-purpose hardware, and of course, it can also be implemented using hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory, hard disk, or optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0106] It is worth noting that in the embodiments of the above-mentioned device control device, the various units and modules included are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be realized; in addition, the specific names of each functional unit are only for easy differentiation and are not used to limit the scope of protection of the present invention.
[0107] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. A device control method, characterized in that, include: In the target state transition model, obtain the target operation path that matches the requirements of the current scenario; The target operation path includes at least one operation path node; Perform path verification processing on the target operation path to obtain the path verification result; An operation execution strategy is generated based on the path verification result, and device control operations are performed according to the operation execution strategy.
2. The method according to claim 1, characterized in that, The operation path nodes include target library nodes and target transition nodes; Before obtaining the target operation path that matches the current scenario requirements, the method further includes: Perform device clustering on the target global devices to obtain the device clustering results; The target library node and the target transition node are constructed based on the device clustering results. The target state transition model is constructed based on the target library node and the target transition node.
3. The method according to claim 1, characterized in that, The operation path nodes include path folding nodes; Before obtaining the target operation path that matches the current scenario requirements, the method further includes: Based on the device operation log, at least one operation path to be folded is obtained from the target state transition model whose historical execution frequency exceeds a preset folding threshold. Each of the operation paths to be folded is constructed as a path folding node, and each of the operation paths to be folded is replaced with the corresponding path folding node in the target state transition model.
4. The method according to claim 1, characterized in that, The path verification process for the target operation path, to obtain the path verification result, includes: Obtain the preset verification rules corresponding to the target operation path; The target operation path is traversed to determine whether there is a control operation conflict in the target operation path according to the preset verification rules, and the path verification result is obtained.
5. The method according to claim 1, characterized in that, The step of generating an operation execution strategy based on the path verification result includes: If a control operation conflict is determined to exist in the target operation path, an operation priority strategy is obtained; The operation execution strategy is generated based on the operation priority strategy and the target operation path.
6. The method according to claim 5, characterized in that, After generating the operation execution strategy based on the operation priority strategy and the target operation path, the method further includes: Update the target operation path in the target state transition model according to the operation execution strategy.
7. The method according to claim 2, characterized in that, The step of generating an operation execution strategy based on the path verification result includes: If it is determined that there is no control operation conflict in the target operation path, the device priority policy corresponding to the target operation path is obtained; The operation execution strategy is generated based on the device priority strategy and the target operation path.
8. A device control apparatus, characterized in that, include: The path acquisition module is used to obtain the target operation path that matches the current scenario requirements in the target state transition model. The target operation path includes at least one operation path node; The path verification module is used to perform path verification processing on the target operation path and obtain the path verification result. The device control module is used to generate an operation execution strategy based on the path verification result, and to execute device control operations according to the operation execution strategy.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein the program, when executed, performs the device control method according to any one of claims 1 to 7.
10. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to execute the device control method of any one of claims 1 to 7 through the computer program.