Equipment control method and device, equipment and storage medium
By constructing a digital twin model and generating equipment control commands based on state comparison and transition conditions, the accuracy and timeliness issues in equipment control strategies are solved, achieving efficient and accurate equipment state switching control.
Patent Information
- Application Number
- CN202511686151.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-17
- Publication Date
- 2026-02-10
AI Technical Summary
In the prior art, the device control strategy is highly dependent on the accuracy and timeliness of the state switching command, which makes it easy to generate errors or fail to execute the device state switching action on time when there are parameter deviations or transmission delays.
By constructing a digital twin model of the target physical device, including a state model and state transition conditions, the system determines whether device switching is necessary based on the comparison between the current state and the target state and the state transition conditions, and generates instructions that match the device control strategy for control.
It enables efficient and accurate control of target physical devices for state switching, improves the reliability and flexibility of device control, and reduces the cost and time delay of device state switching.
Smart Images

Figure CN121500764A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of device control and the field of digital twinning, and in particular to a device control method and device, apparatus and storage medium. BACKGROUND
[0002] Digital twinning technology, as a technology for realizing the interactive fusion of the physical world and the information world by constructing a digital mirror image of a physical entity, has been widely applied to scenarios such as device monitoring, simulation, control and predictive maintenance.
[0003] At present, the way to realize device control is often to issue a state switching instruction to a digital twin model corresponding to a target physical device, generate a device control strategy based on the instruction by the digital twin model, and drive the target physical device to perform a state switching operation according to the device control strategy.
[0004] However, since the existing technology has strong dependence on the accuracy and timeliness of the state switching instruction, if there is a parameter deviation or transmission delay in the state switching instruction, it will directly lead to an error in the generation of the device control strategy, or the device state switching action cannot be performed on time. SUMMARY
[0005] The present application provides a device control method, apparatus, device and storage medium, which can realize efficient and accurate control of the target physical device to switch states.
[0006] In a first aspect, an embodiment of the present application provides a device control method, comprising:
[0007] obtaining a target physical device and constructing a digital twin model corresponding to the target physical device;
[0008] The digital twin model includes a state model, and the state model includes a current state, a target state and at least one state transition condition corresponding to the target physical device.
[0009] According to the comparison result of the current state and the target state, and / or the state transition condition, it is determined whether the target physical device needs to be controlled to switch states;
[0010] When it is determined that the target physical device needs to be controlled to switch states, the target state transition condition satisfied by the target physical device is obtained, and a device control strategy matched with the target state transition condition is determined;
[0011] A device control instruction corresponding to the device control strategy is generated, and the device control instruction is sent to the target physical device to control the target physical device to execute the device control instruction.
[0012] In a second aspect, an embodiment of the present application further provides a device control apparatus, comprising:
[0013] The twin model building module is used to acquire the target physical device and build a digital twin model corresponding to the target physical device.
[0014] The digital twin model includes a state model, which includes the current state of the target physical device, the target state, and at least one state transition condition.
[0015] The state transition judgment module is used to determine whether it is necessary to control the target physical device to perform a state transition based on the comparison result between the current state and the target state, and / or the state transition conditions.
[0016] The control strategy generation module is used to obtain the target state transition conditions that the target physical device needs to meet when it is determined that the target physical device needs to switch states, and to determine the device control strategy that matches the target state transition conditions.
[0017] The device control module is used to generate device control instructions corresponding to the device control strategy and send the device control instructions to the target physical device to control the target physical device to execute the device control instructions.
[0018] Thirdly, embodiments of the present invention also provide an electronic device, the electronic device comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to execute the device control method provided in any embodiment of the present invention.
[0019] Fourthly, embodiments of the present invention also provide a computer-readable storage medium storing computer instructions that, when executed by a processor, implement the device control method provided in any embodiment of the present invention.
[0020] The technical solution of this invention solves the problem of existing technologies that are highly dependent on the accuracy and timeliness of state switching instructions. This is because existing technologies, when there are parameter deviations or transmission delays in the state switching instructions, are prone to errors in generating the device control strategy or failing to execute the device state switching action on time. The invention achieves efficient and accurate control of the target physical device for state switching. This is achieved by constructing a digital twin model corresponding to the target physical device; determining whether state switching needs to be controlled based on the state model in the digital twin model; when state switching instructions have parameter deviations or transmission delays, the target physical device is controlled for state switching.
[0021] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0022] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0023] Figure 1 This is a flowchart of a device control method provided according to Embodiment 1 of the present invention;
[0024] Figure 2 This is a flowchart of another device control method provided according to Embodiment 2 of the present invention;
[0025] Figure 3 This is a schematic diagram of the structure of a device control apparatus according to Embodiment 3 of the present invention;
[0026] Figure 4 This is a schematic diagram of the structure of an electronic device provided in Embodiment 4 of the present invention. Detailed Implementation
[0027] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0028] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention 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 the invention 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 a 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.
[0029] Example 1
[0030] Figure 1 This is a flowchart of a device control method according to Embodiment 1 of the present invention. This embodiment is applicable to the situation of state control of target physical devices based on digital twin technology. The method can be executed by a device control device, which can be implemented in hardware and / or software and can be configured in an electronic device such as a computer.
[0031] like Figure 1 As shown, this embodiment discloses a device control method, including:
[0032] S110. Obtain the target physical device and construct a digital twin model corresponding to the target physical device; wherein, the digital twin model includes a state model, which includes the current state of the target physical device, the target state, and at least one state transition condition.
[0033] In this embodiment, the target physical device can be understood as a device whose current state needs to be continuously monitored to determine if it is in the target state, and which triggers a state switch when its current state is not in the target state, such as a water pump, a fan, and a sensor. The current state can be understood as the actual state of the target physical device. The target state can be understood as the state that the user expects the target physical device to maintain. The state transition condition can be understood as the precondition that must be met to control the target physical device to switch from its current state to the target state. There can be various state transition conditions, such as the target physical device's current state meeting predefined state change requirements, or related devices being in a controllable state. It is worth noting that the state change requirement can be a boundary requirement within the target state, or a predefined change requirement unrelated to the target state; this embodiment does not impose any limitations on this.
[0034] In this step, specifically, a state model corresponding to the target physical device can be configured based on the current state, the target state, and at least one state transition condition. Then, digital twin technology can be used to construct a digital twin model corresponding to the target physical device based on its geometric attributes, physical attributes, and state model.
[0035] S120. Based on the comparison between the current state and the target state, and / or the state transition conditions, determine whether it is necessary to control the target physical device to switch states.
[0036] Specifically, based on the comparison between the current state and the target state, determining whether it is necessary to control the target physical device to switch states can include: if the current state and the target state are the same, determining that it is necessary to control the target physical device to switch states; if the current state and the target state are different, determining that it is not necessary to control the target physical device to switch states.
[0037] Based on the comparison between the current state and the target state, and the state transition conditions, determine whether it is necessary to control the target physical device to switch states. This can include: if the current state and the target state are the same, determining whether it is necessary to control the target physical device to switch states; if the current state and the target state are different, determining whether it is necessary to control the target physical device to switch states based on the state transition conditions.
[0038] Based on the state transition conditions, determining whether to control the target physical device to switch states can include: if the target physical device meets all state transition conditions, then controlling the target physical device to switch states is required; if the target physical device does not meet all state transition conditions, then controlling the target physical device to switch states is not required.
[0039] Optionally, before determining whether it is necessary to control the target physical device to switch states based on the comparison results between the current state and the target state, and / or the state transition conditions, the method further includes: displaying a state model configuration interface to the user in response to the state model configuration operation triggered by the user for the target physical device; and generating a state model corresponding to the digital twin model in response to the target state and state transition conditions configured by the user on the state model configuration interface.
[0040] Specifically, upon receiving the target state input by the user on the state model configuration interface, and at least one state transition condition corresponding to the target state, a state model corresponding to the digital twin model can be generated based on the target state and the corresponding state transition condition.
[0041] The advantage of this setup is that, compared to generating a state model based on application code, the technical solution in this embodiment obtains the state model based on the state model configuration interface. This allows for modification of the target state and state transition conditions without modifying the application code, thereby improving the flexibility and maintainability of state switching control over the target physical device.
[0042] S130. When it is determined that the target physical device needs to be controlled to switch states, the target state transition conditions satisfied by the target physical device are obtained, and the device control strategy matching the target state transition conditions is determined.
[0043] In this embodiment, the target state transition condition can be understood as the state transition condition that has been triggered by the target physical device. The device control strategy can be used to control the target physical device to switch from its current state to the target state.
[0044] In this step, specifically, if it is determined whether the target physical device needs to switch states based solely on the comparison between the current state and the target state, the target state transition conditions that the target physical device must meet can be determined based on the current environmental data and / or current operating data of the target physical device.
[0045] If it is determined whether the target physical device needs to be controlled to switch states based on the state transition conditions, the current state, and the target state, or only based on the state transition conditions, the target state transition conditions already determined in S120 can be directly obtained.
[0046] After obtaining the target state transition conditions satisfied by the target physical device, a device control strategy matching the target state transition conditions can be generated using a pre-built control strategy generation model, based on the current state, target state, and target state transition conditions. Alternatively, a predefined control strategy table can be queried based on the target state transition conditions to obtain the device control strategy matching the target state transition conditions. The control strategy table contains multiple sets of correspondences between state transition conditions and device control strategies.
[0047] S140. Generate device control instructions corresponding to the device control strategy and send the device control instructions to the target physical device to control the target physical device to execute the device control instructions.
[0048] In this step, specifically, device control commands corresponding to the device control strategy can be generated based on the target communication protocol followed by the target physical device. Alternatively, the information forwarding device corresponding to the target physical device can be obtained, and device control commands corresponding to the device control strategy can be generated based on the information communication protocol followed by the information forwarding device.
[0049] The technical solution of this embodiment obtains the target physical device and constructs a digital twin model corresponding to the target physical device. The digital twin model includes a state model, which includes the current state of the target physical device, a target state, and at least one state transition condition. Based on the comparison between the current state and the target state, and / or the state transition condition, it is determined whether the target physical device needs to be controlled for a state switch. When it is determined that the target physical device needs to be controlled for a state switch, the target state transition condition satisfied by the target physical device is obtained, and a device control strategy matching the target state transition condition is determined. A device control command corresponding to the device control strategy is generated, and the device control command is sent to the target physical device to control the target physical device to execute the device control command. This technical means solves the problem of existing technologies that are highly dependent on the accuracy and timeliness of state switching commands. When there are parameter deviations or transmission delays in the state switching commands, it is easy to cause errors in the generation of device control strategies or failure to execute device state switching actions on time. This can achieve efficient and accurate control of the target physical device for state switching.
[0050] Example 2
[0051] Figure 2 This is a flowchart of another device control method provided according to Embodiment 2 of the present invention. This embodiment is a further optimization and extension based on the above embodiments, and can be combined with various optional technical solutions in the above embodiments.
[0052] like Figure 2 As shown, this embodiment discloses a device control method, including:
[0053] S210. Obtain the target physical device and construct a digital twin model corresponding to the target physical device; wherein, the digital twin model includes a state model, which includes the current state of the target physical device, the target state, and at least one state transition condition.
[0054] Taking a water tank as an example, the target state of the water tank can be configured as follows: the current liquid level is neither higher than a preset maximum level nor lower than a preset minimum level. Two state transition conditions can be configured: the current liquid level is lower than the preset minimum level, and the water pump is in a controllable state. Then, the current liquid level of the water tank can be obtained, and based on the current liquid level, the target state, and the state transition conditions, a state model corresponding to the water tank can be generated. Finally, a digital twin model corresponding to the water tank can be constructed based on the state model.
[0055] S220. Determine whether the current state is consistent with the target state. If yes, execute S230; otherwise, execute S240.
[0056] Continuing with the previous example, we can determine whether the current liquid level in the water tank is higher than the preset maximum liquid level and lower than the preset minimum liquid level. If the current liquid level in the water tank is neither higher than the preset maximum liquid level nor lower than the preset minimum liquid level, it is determined that there is no need to control the target physical device to switch states, and the system continuously monitors whether the current liquid level in the water tank has reached the target state. If the current liquid level in the water tank is higher than the preset maximum liquid level or lower than the preset minimum liquid level, it is determined whether to control the target physical device to switch states based on the state transition conditions.
[0057] S230. Determine that it is not necessary to control the target physical device to switch states, and return to perform the operation of judging whether the current state is consistent with the target state, until the predefined loop termination condition is reached.
[0058] In this embodiment, there can be multiple loop termination conditions, such as the user triggering a loop termination operation, the loop monitoring duration exceeding a predefined first duration threshold, or the loop monitoring count reaching a predefined first count threshold.
[0059] The above settings allow for continuous monitoring of whether the current state of the target physical device matches the target state, thus ensuring the operational reliability of the target physical device.
[0060] S240. Based on the state transition conditions, determine whether it is necessary to control the target physical device to switch states.
[0061] In this step, specifically, it is determined whether the target physical device needs to be controlled to switch states, based on whether it meets all state transition conditions. Alternatively, it can be determined whether the target physical device needs to be controlled to switch states based on the type of state transition conditions it meets.
[0062] Optionally, depending on whether the target physical device meets all state transition conditions, it is determined whether the target physical device needs to be controlled to switch states, including: determining whether the target physical device meets all state transition conditions based on the target physical device's current environmental data and / or current operating data; if the target physical device meets all state transition conditions, it is determined that the target physical device needs to be controlled to switch states; if the target physical device does not meet all state transition conditions, it is determined that the target physical device does not need to be controlled to switch states.
[0063] The current environmental data reflects the connection status between the target physical device and associated devices, which can be either connected or disconnected. The current operational data refers to the operational data of the target physical device itself.
[0064] Specifically, if the state transition condition is that the current state of the target physical device meets predefined state change requirements, then based on the current operating data of the target physical device, it can be determined whether the target physical device meets all state transition conditions. If the state transition condition is that the associated devices related to the target physical device are in a controllable state, then based on the current environmental data of the target physical device, it can be determined whether the target physical device meets all state transition conditions. If the state transition conditions include both the current state of the target physical device meeting predefined state change requirements and the associated devices related to the target physical device being in a controllable state, then based on the current environmental data and current operating data of the target physical device, it can be determined whether the target physical device meets all state transition conditions.
[0065] Taking the conditions for state transition, including the target physical device's current state meeting predefined state change requirements and related equipment being in a controllable state, as an example, if based on the current environmental and operational data of the water tank, it is determined that the current liquid level in the tank is below the preset minimum level, and the water replenishment pump is in a controllable state, then it can be determined that the target physical device needs to be controlled to switch states. If, based on the current environmental and operational data of the water tank, it is determined that the current liquid level in the tank is above the preset minimum level, or the water replenishment pump is out of control, then it can be determined that the target physical device does not need to be controlled to switch states.
[0066] The advantage of this setting is that by comparing the current state with the target state and the state transition conditions, it can be determined whether the target physical device needs to be controlled to switch states. This allows for a more accurate determination of whether the target physical device needs to be controlled to switch states, thereby improving the reliability of the state transition results and increasing user satisfaction.
[0067] S250. When it is determined that the target physical device needs to be controlled to switch states, the target state transition conditions satisfied by the target physical device are obtained from all the state transition conditions in the state model, and the device control strategy that matches the target state transition conditions is determined.
[0068] For example, when the target state transition condition is that the current liquid level is lower than the preset minimum liquid level and the water replenishment pump is in a controllable state, it can be considered that the water tank has consumed too much water and has not been replenished in time. At this time, it can be determined that the equipment control strategy is to turn on the water replenishment pump to replenish the water tank.
[0069] S260. Obtain the target communication protocol followed by the target physical device, and generate device control instructions corresponding to the device control strategy based on the target communication protocol.
[0070] In this embodiment, the target communication protocol can be of various types, such as the OPC Unified Architecture (OPC UA) protocol, the industrial fieldbus protocol, and the Message Queuing Telemetry Transport (MQTT) protocol.
[0071] S270. Send the device control command to the target physical device to control the target physical device to execute the device control command.
[0072] Optionally, after sending the device control command to the target physical device, the method further includes: obtaining the actual state of the target physical device after executing the device control command; updating the current state recorded in the state model according to the actual state, and returning the operation to determine whether it is necessary to control the target physical device to perform a state switching based on the comparison result between the current state and the target state, and / or the state transition condition, until a predefined loop termination condition is reached.
[0073] Specifically, the current state recorded in the state model can be directly updated to the actual state. Alternatively, the current state recorded in the state model can be updated based on the actual state, the target state, and the comparison result.
[0074] Furthermore, updating the current state recorded in the state model based on the actual state, the target state, and the comparison result may include: determining whether the current state is consistent with the target state; if so, updating the current state recorded in the state model to the actual state; if not, returning to the operation of sending the device control command to the target physical device until the actual state is consistent with the target state, and then updating the current state recorded in the state model to the actual state.
[0075] There are several possible conditions for terminating the status update, such as the number of times device control commands are sent to the target physical device reaches a predefined second threshold, or the duration of the process of updating the current status exceeds a second duration threshold.
[0076] Specifically, when the current state and the target state are inconsistent, it can be determined whether a predefined state update termination condition has been met. If the predefined state update termination condition has not been met, the operation of sending device control commands to the target physical device is returned until the actual state matches the target state. Then, the current state recorded in the state model is updated to the actual state, or the device control flow is terminated and a fault message for the target physical device is sent to the user when the predefined state update termination condition is met.
[0077] The advantage of this setup is that by introducing a closed-loop feedback mechanism, it can ensure that the current state of the device recorded in the digital twin model is always highly consistent with the actual state of the target physical device, thus providing a reliable data foundation for subsequent simulation of various device control operations.
[0078] The technical solution in this embodiment determines whether a state switch of the target physical device is needed by comparing the current state with the target state and considering the state transition conditions. This allows for a more accurate determination of whether a state switch is necessary, thereby improving the reliability of the state switch results and enhancing user satisfaction. Secondly, by introducing a closed-loop feedback mechanism, it ensures that the current state of the device recorded in the digital twin model remains highly consistent with the actual state of the target physical device, thus providing a reliable data foundation for subsequent simulations of various device control operations.
[0079] To illustrate the device control method and its effects in this invention in detail, the following description uses a device control system that applies the device control method of this invention as an example: The device control system includes a control logic editing tool, a rule engine, and a control action executor. The rule engine is communicatively connected to both the control logic editing tool and the control action executor.
[0080] Specifically, the control logic editing tool can respond to user-triggered state model configuration operations for target physical devices, displaying a state model configuration interface to the user, and generating a state model corresponding to the digital twin model in response to the target state and state transition conditions configured by the user on the state model configuration interface. Furthermore, the control logic editing tool can also encapsulate the computational logic of the state model into a standardized interface, enabling the rule engine to invoke the current state, target state, and state transition conditions in the state model. Based on the model encapsulation function of the control logic editing tool, the rule engine can determine whether it is necessary to control the target physical device to switch states based on the comparison results between the current state and the target state, and / or the state transition conditions.
[0081] Furthermore, the rule engine can also be used to, when it is determined that a state transition of the target physical device needs to be controlled, obtain the target state transition condition satisfied by the target physical device from all state transition conditions in the state model, and determine the device control strategy matching the target state transition condition; when it is determined that a state transition of the target physical device does not need to be controlled, it returns to the operation of determining whether a state transition of the target physical device needs to be controlled based on the comparison result between the current state and the target state, and / or the state transition condition, until a predefined loop termination condition is reached. The control action executor can be used to receive the device control strategy sent by the rule engine, generate device control instructions corresponding to the device control strategy, and send the device control instructions to the target physical device. In addition, the control action executor can also be used to obtain the actual state of the target physical device after executing the device control instructions; update the current state recorded in the state model according to the actual state, and return to the operation of determining whether a state transition of the target physical device needs to be controlled based on the comparison result between the current state and the target state, and / or the state transition condition, until a predefined loop termination condition is reached.
[0082] The advantage of this setup is that, compared to existing technologies that directly write device control strategy generation methods through application code, the technical solution of this invention, by setting a rule engine in the device control system, can integrate more complex algorithms, such as optimization algorithms and deep learning models, to generate the optimal device control strategy, thereby reducing the cost of device state switching and improving the efficiency of device state switching.
[0083] Example 3
[0084] Figure 3 This is a schematic diagram of a device control apparatus according to Embodiment 3 of the present invention. This embodiment is applicable to situations where the state of a target physical device is controlled based on digital twin technology. The device control apparatus can be implemented in hardware and / or software and can be configured in electronic devices such as computers.
[0085] like Figure 3 As shown, the device control apparatus disclosed in this embodiment includes:
[0086] The twin model construction module 31 is used to acquire the target physical device and construct a digital twin model corresponding to the target physical device;
[0087] The digital twin model includes a state model, which includes the current state of the target physical device, the target state, and at least one state transition condition.
[0088] The state transition judgment module 32 is used to determine whether it is necessary to control the target physical device to perform a state transition based on the comparison result between the current state and the target state, and / or the state transition conditions.
[0089] The control strategy generation module 33 is used to obtain the target state transition conditions that the target physical device needs to meet when it is determined that the target physical device needs to switch states, and to determine the device control strategy that matches the target state transition conditions.
[0090] The device control module 34 is used to generate device control instructions corresponding to the device control strategy and send the device control instructions to the target physical device to control the target physical device to execute the device control instructions.
[0091] The technical solution in this embodiment, through the cooperation of the twin model construction module 31, the state switching judgment module 32, the control strategy generation module 33, and the device control module 34, solves the problem that the existing technology, which is highly dependent on the accuracy and timeliness of the state switching command, is prone to errors in the generation of the device control strategy or failure to execute the device state switching action on time when there are parameter deviations or transmission delays in the state switching command. It can achieve efficient and accurate control of the target physical device to perform state switching.
[0092] Optionally, the state transition judgment module 32 includes:
[0093] The state transition judgment unit is used to determine whether the current state is consistent with the target state; if so, it determines that it is not necessary to control the target physical device to perform a state transition; if not, it determines whether it is necessary to control the target physical device to perform a state transition based on at least one state transition condition.
[0094] Optionally, the state transition judgment unit is specifically used to: when the current state is inconsistent with the target state, determine whether the target physical device meets all state transition conditions based on the current environmental data and / or current operating data of the target physical device; if the target physical device meets all state transition conditions, determine that the target physical device needs to be controlled to perform a state transition; if the target physical device does not meet all state transition conditions, determine that the target physical device does not need to be controlled to perform a state transition.
[0095] Optionally, the device control module 34 is specifically used to: obtain the target communication protocol followed by the target physical device, and generate device control instructions corresponding to the device control strategy based on the target communication protocol.
[0096] Optionally, the device further includes a status update module, which includes:
[0097] The actual state acquisition unit is used to acquire the actual state of the target physical device after executing the device control command;
[0098] The state update unit is used to update the current state recorded in the state model according to the actual state, and return the execution result based on the comparison between the current state and the target state, and / or the state transition condition, to determine whether it is necessary to control the target physical device to perform a state switch operation, until the predefined loop termination condition is reached.
[0099] Optionally, the state update unit is specifically used to: determine whether the current state is consistent with the target state; if yes, update the current state recorded in the state model to the actual state; if no, if the predefined state update termination condition is not met, return to the operation of sending the device control command to the target physical device until the actual state is consistent with the target state, and then update the current state recorded in the state model to the actual state.
[0100] Optionally, the device also includes a state model configuration module, which is used to: display a state model configuration interface to the user in response to a state model configuration operation triggered by the user for the target physical device; and generate a state model corresponding to the digital twin model in response to the target state and state transition conditions configured by the user on the state model configuration interface.
[0101] The device control apparatus provided in this embodiment of the invention can execute the device control method provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects for executing the method. Content not described in detail in this embodiment can be referred to the description in any method embodiment of this application.
[0102] Example 4
[0103] Figure 4 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown.
[0104] like Figure 4 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 can also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0105] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0106] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as device control methods.
[0107] In some embodiments, the device control method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the device control method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform the device control method by any other suitable means (e.g., by means of firmware).
[0108] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0109] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0110] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0111] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0112] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0113] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.
[0114] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.
[0115] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A device control method, characterized in that, The method includes: Obtain the target physical device and construct a digital twin model corresponding to the target physical device; The digital twin model includes a state model, which includes the current state of the target physical device, the target state, and at least one state transition condition. Based on the comparison result between the current state and the target state, and / or the state transition conditions, determine whether it is necessary to control the target physical device to switch states; When it is determined that the target physical device needs to be controlled to switch states, the target state transition conditions satisfied by the target physical device are obtained, and a device control strategy matching the target state transition conditions is determined. Generate a device control command corresponding to the device control strategy, and send the device control command to the target physical device to control the target physical device to execute the device control command.
2. The method according to claim 1, characterized in that, Based on the comparison between the current state and the target state, and the state transition conditions, determine whether it is necessary to control the target physical device to switch states, including: Determine whether the current state is consistent with the target state; If so, then it is determined that there is no need to control the target physical device to switch states; If not, then based on the at least one state transition condition, determine whether it is necessary to control the target physical device to switch states.
3. The method according to claim 2, characterized in that, Determining whether to control the target physical device to switch states based on the at least one state transition condition includes: Based on the current environmental data and / or current operating data of the target physical device, determine whether the target physical device meets all state transition conditions; If the target physical device meets all state transition conditions, it is determined that the target physical device needs to be controlled to switch states. If it is determined that the target physical device does not meet all the state transition conditions, it is determined that it is not necessary to control the target physical device to switch states.
4. The method according to claim 1, characterized in that, Generate device control instructions corresponding to the device control strategy, including: Obtain the target communication protocol followed by the target physical device, and generate device control instructions corresponding to the device control strategy based on the target communication protocol.
5. The method according to claim 1, characterized in that, After sending the device control command to the target physical device, the method further includes: Obtain the actual state of the target physical device after executing the device control command; Based on the actual state, the current state recorded in the state model is updated, and the process returns to determine whether it is necessary to control the target physical device to perform a state switching operation based on the comparison result between the current state and the target state, and / or the state transition condition, until a predefined loop termination condition is reached.
6. The method according to claim 5, characterized in that, Based on the actual state, the current state recorded in the state model is updated, including: Determine whether the current state is consistent with the target state; If so, the current state recorded in the state model is updated to the actual state; If not, if the predefined state update termination condition is not met, the operation of sending the device control command to the target physical device will be returned until the actual state is consistent with the target state, at which point the current state recorded in the state model will be updated to the actual state.
7. The method according to claim 1, characterized in that, Before determining whether it is necessary to control the target physical device to switch states based on the comparison result between the current state and the target state, and / or the state transition conditions, the method further includes: In response to a user's state model configuration operation triggered for a target physical device, the state model configuration interface is displayed to the user. In response to the target state and state transition conditions configured by the user on the state model configuration interface, a state model corresponding to the digital twin model is generated.
8. A device control apparatus, characterized in that, The device includes: A twin model construction module is used to acquire a target physical device and construct a digital twin model corresponding to the target physical device. The digital twin model includes a state model, which includes the current state corresponding to the target physical device, the target state, and at least one state transition condition. The state transition judgment module is used to determine whether it is necessary to control the target physical device to perform a state transition based on the comparison result between the current state and the target state, and / or the state transition conditions. The control strategy generation module is used to obtain the target state transition conditions satisfied by the target physical device when it is determined that the target physical device needs to be controlled to switch states, and to determine the device control strategy that matches the target state transition conditions. The device control module is used to generate device control instructions corresponding to the device control strategy and send the device control instructions to the target physical device to control the target physical device to execute the device control instructions.
9. An electronic device, characterized in that, The electronic device includes: At least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the device control method of any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that, when executed by a processor, implement the device control method of any one of claims 1-7.
Citation Information
Patent Citations
Multi-model smooth and stable switching control method for increase and decrease of state variables
CN105425593A
Production line simulation method based on digital twinning and related equipment thereof
CN116796504A
Robot control method, device and equipment based on state machine and storage medium
CN117047758A
Load flow calculation and simulation control method and system of digital twin power grid
CN120524842A
Digital twin interaction control system based on fusion of vision and touch of robot
CN120773034A