CN117411914A - Equipment control method and device, storage medium and electronic equipment - Google Patents

Equipment control method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN117411914A
CN117411914A CN202310186456.0A CN202310186456A CN117411914A CN 117411914 A CN117411914 A CN 117411914A CN 202310186456 A CN202310186456 A CN 202310186456A CN 117411914 A CN117411914 A CN 117411914A
Authority
CN
China
Prior art keywords
equipment
state
controlled
result
expected
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310186456.0A
Other languages
Chinese (zh)
Inventor
吴晓红
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen TCL New Technology Co Ltd
Original Assignee
Shenzhen TCL New Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen TCL New Technology Co Ltd filed Critical Shenzhen TCL New Technology Co Ltd
Priority to CN202310186456.0A priority Critical patent/CN117411914A/en
Publication of CN117411914A publication Critical patent/CN117411914A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
    • H04L67/125Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks involving control of end-device applications over a network
    • GPHYSICS
    • G16INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR SPECIFIC APPLICATION FIELDS
    • G16YINFORMATION AND COMMUNICATION TECHNOLOGY SPECIALLY ADAPTED FOR THE INTERNET OF THINGS [IoT]
    • G16Y40/00IoT characterised by the purpose of the information processing
    • G16Y40/30Control

Landscapes

  • Engineering & Computer Science (AREA)
  • Computing Systems (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Selective Calling Equipment (AREA)

Abstract

The application discloses a device control method, a device, a storage medium and electronic equipment, which relate to the technical field of Internet of things, wherein device control is applied to control equipment, equipment shadows corresponding to equipment to be controlled are maintained in the control equipment, and the method comprises the following steps: responding to a triggering control instruction, recording an expected result corresponding to the control instruction, and returning the expected result in advance locally; setting a state update timing, and monitoring whether the state update timing is reached; if the state updating timing arrives and the equipment to be controlled does not reach the expected state corresponding to the recorded expected result, actively acquiring the remote equipment state of the equipment to be controlled; and comparing the remote equipment state with the equipment shadow to obtain a first comparison result, wherein the first comparison result is used for updating the equipment state of the equipment to be controlled in the local. The method and the device can avoid the equipment state response problem caused by abnormal links, can rapidly and accurately respond to equipment control, and ensure the equipment control effect under a straight-through scene.

Description

Equipment control method and device, storage medium and electronic equipment
Technical Field
The application relates to the technical field of internet of things, in particular to a device control method, a device, a storage medium and electronic equipment.
Background
The internet of things mainly solves the communication between the Device end (Device end) corresponding to the Device to be controlled and the application end (App end) corresponding to the control Device through processing of a service end (such as Cloud (Cloud) or a server, etc.), and when the Device is controlled, the Device state of the Device end (Device end) is quickly synchronized, so that the experience of an actual user is directly affected. At present, during Device control, a service end generally maintains a Device shadow of a Device end (Device end) to enable a quick response application end (App end) to quickly respond to a Device state and further control the Device.
The existing mode only can solve the equipment state response problem caused by link instability, delay and other link abnormality between the server side and the equipment side, but cannot solve the equipment state response problem caused by link abnormality between the application side serving as a user contact and the server side, on the other hand, the application side needs to interact with the cloud to respond to equipment control, and the application side cannot respond to equipment control quickly and accurately, and further, the existing mode cannot guarantee the equipment control effect of the application side and the equipment side in direct scenes such as local area network control, edge calculation and the like.
Disclosure of Invention
The embodiment of the application provides a scheme, which can avoid the problem of equipment state response caused by abnormal links between the application end serving as the user contact and the service end, can quickly and accurately respond to equipment control, and ensures the equipment control effect under the direct scene of local area network control, edge calculation and the like.
The embodiment of the application provides the following technical scheme:
according to one embodiment of the application, a device control method is applied to a control device, wherein a device shadow corresponding to a device to be controlled is maintained in the control device, and the method comprises the following steps: responding to a control instruction triggering the equipment to be controlled, recording an expected result corresponding to the control instruction, and returning the expected result in advance locally; setting a state update timing for the control instruction, and monitoring whether the state update timing is reached; if the state updating timing arrives and the equipment to be controlled does not reach the recorded expected state corresponding to the expected result, actively acquiring the remote equipment state of the equipment to be controlled; and comparing the remote equipment state with the equipment shadow to obtain a first comparison result, wherein the first comparison result is used for updating the equipment state of the equipment to be controlled in the local.
In some embodiments of the present application, after the recording of the desired result corresponding to the control instruction, the method further includes: if the equipment updating state of the equipment to be controlled is obtained, determining whether the equipment updating state meets the expected result; and if the equipment updating state accords with the expected result, determining that the equipment to be controlled achieves the recorded expected state corresponding to the expected result.
In some embodiments of the present application, the method further comprises: comparing the equipment updating state with the equipment shadow to obtain a second comparison result; and updating the equipment state of the equipment to be controlled in the local area according to the second comparison result.
In some embodiments of the present application, after the device update status of the device to be controlled is determined to be in accordance with the desired result, the method further includes one of the following manners: removing the desired result from the storage location of the desired result; and adding a corresponding reached mark for the expected result, wherein the reached mark is used for indicating that the expected state corresponding to the expected result is reached.
In some embodiments of the present application, after the actively acquiring the remote device state of the device to be controlled, the method further includes: determining whether the remote device status meets the desired result; and if the remote equipment state accords with the expected result, determining that the equipment to be controlled achieves the recorded expected state corresponding to the expected result.
In some embodiments of the present application, after determining that the device to be controlled reaches the desired state corresponding to the recorded desired result if the remote device state meets the desired result, the method further includes one of the following manners: removing the desired result from the storage location of the desired result; and adding a corresponding reached mark for the expected result, wherein the reached mark is used for indicating that the expected state corresponding to the expected result is reached.
In some embodiments of the present application, before the responding to the control instruction for the device to be controlled, recording the expected result corresponding to the control instruction, the method further includes: responding to the starting of a control application, and acquiring the shadow equipment state of the equipment to be controlled; creating a device shadow of the device to be controlled locally according to the shadow device state; and after the device shadow is created, displaying a controller of the device to be controlled in the control application, wherein the control instruction is triggered in the controller.
According to one embodiment of the present application, an apparatus control device is applied to a control apparatus, where a device shadow corresponding to a device to be controlled is maintained in the control apparatus, and the apparatus includes: the result processing module is used for responding to a control instruction for the equipment to be controlled, recording an expected result corresponding to the control instruction and returning the expected result in advance locally; a timing setting module, configured to set a state update timing for the control instruction, and monitor whether the state update timing arrives; the state acquisition module is used for actively acquiring the remote equipment state of the equipment to be controlled if the state update timing arrives and the equipment to be controlled does not reach the recorded expected state corresponding to the expected result; and the comparison module is used for comparing the remote equipment state with the equipment shadow to obtain a first comparison result, and the first comparison result is used for updating the equipment state of the equipment to be controlled in the local.
In some embodiments of the present application, the apparatus further includes a status determination module configured to: if the equipment updating state of the equipment to be controlled is obtained, determining whether the equipment updating state meets the expected result; and if the equipment updating state accords with the expected result, determining that the equipment to be controlled achieves the recorded expected state corresponding to the expected result.
In some embodiments of the present application, the apparatus further includes an update module configured to: comparing the equipment updating state with the equipment shadow to obtain a second comparison result; and updating the equipment state of the equipment to be controlled in the local area according to the second comparison result.
In some embodiments of the present application, the apparatus further includes a post-processing module configured to implement one of the following: removing the desired result from the storage location of the desired result; and adding a corresponding reached mark for the expected result, wherein the reached mark is used for indicating that the expected state corresponding to the expected result is reached.
In some embodiments of the present application, the apparatus further comprises a desire check module for: determining whether the remote device status meets the desired result; and if the remote equipment state accords with the expected result, determining that the equipment to be controlled achieves the recorded expected state corresponding to the expected result.
In some embodiments of the present application, the method post-processing module is further configured to one of: removing the desired result from the storage location of the desired result; and adding a corresponding reached mark for the expected result, wherein the reached mark is used for indicating that the expected state corresponding to the expected result is reached.
In some embodiments of the present application, the apparatus further comprises a creation module for: responding to the starting of a control application, and acquiring the shadow equipment state of the equipment to be controlled; creating a device shadow of the device to be controlled locally according to the shadow device state; and after the device shadow is created, displaying a controller of the device to be controlled in the control application, wherein the control instruction is triggered in the controller.
According to another embodiment of the present application, a storage medium has stored thereon a computer program which, when executed by a processor of a computer, causes the computer to perform the method described in the embodiments of the present application.
According to another embodiment of the present application, an electronic device may include: a memory storing a computer program; and the processor reads the computer program stored in the memory to execute the method according to the embodiment of the application.
According to another embodiment of the present application, a computer program product or computer program includes computer instructions stored in a computer readable storage medium. The computer instructions are read from the computer-readable storage medium by a processor of a computer device, and executed by the processor, cause the computer device to perform the methods provided in the various alternative implementations described in the embodiments of the present application.
In this embodiment of the present application, a device shadow corresponding to a device to be controlled is maintained in a control device, where the control device may: responding to a control instruction triggering the equipment to be controlled, recording an expected result corresponding to the control instruction, and returning the expected result in advance locally; setting a state update timing for the control instruction, and monitoring whether the state update timing is reached; if the state updating timing arrives and the equipment to be controlled does not reach the recorded expected state corresponding to the expected result, actively acquiring the remote equipment state of the equipment to be controlled; and comparing the remote equipment state with the equipment shadow to obtain a first comparison result, wherein the first comparison result is used for updating the equipment state of the equipment to be controlled in the local.
In this way, by maintaining the device shadow corresponding to the device to be controlled in the control device, when a control command is triggered in the control device, and by recording an expected result and a state update timing, when a timeout is monitored and a desired state is not achieved, the remote device state is actively acquired and compared with the local device shadow to update the device state, on one hand, when the device is controlled, a link abnormality occurs between the control device and a server side, the control device serving as a user contact can also rapidly respond to the device state according to the local device shadow, on the other hand, when the timeout does not achieve the desired state in advance and the user device control is rapidly responded, the device state can be timely and accurately updated according to the local device shadow and the acquired remote device state of the control device, and on the whole, rapid and accurate user device control and state response can be realized.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly introduced below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 shows a flow chart of a device control method according to an embodiment of the present application.
Fig. 2 shows an architecture diagram of a device control system according to one embodiment of the present application.
Fig. 3 shows a block diagram of a device control apparatus according to one embodiment of the present application.
Fig. 4 shows a block diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by those skilled in the art based on the embodiments herein without making any inventive effort, are intended to be within the scope of the present application.
Fig. 1 schematically shows a flow chart of a device control method according to an embodiment of the present application. The execution main body of the device control method can be any control device with communication capability, such as a computer, a mobile phone, a smart watch, an XR device and the like.
The control device maintains a device shadow corresponding to the device to be controlled, as shown in fig. 1, and the control device may perform the device control method shown in fig. 1, and may include steps S110 to S140.
Step S110, responding to a control instruction for the equipment to be controlled, recording an expected result corresponding to the control instruction, and returning the expected result in advance locally; step S120, setting state update timing for the control instruction and monitoring whether the state update timing is reached; step S130, if the state update timing arrives and the equipment to be controlled does not reach the recorded expected state corresponding to the expected result, actively acquiring the remote equipment state of the equipment to be controlled; and step S140, comparing the remote equipment state with the equipment shadow to obtain a first comparison result, wherein the first comparison result is used for updating the equipment state of the equipment to be controlled in the local.
And the control equipment maintains the equipment shadow corresponding to the equipment to be controlled in advance, wherein the equipment shadow corresponding to the equipment to be controlled is the set of equipment states of the equipment to be controlled. The device state is a property inherent to the device, and generally refers to a relevant property that the device can control, such as a power switch state, an air conditioner temperature value, and the like. The device to be controlled may be a specific device entity that carries a firmware application, such as a smart air conditioner, a refrigerator, etc.
Firstly, a device shadow is added into a control device serving as a user contact and is decoupled from other ends, so that when a link is unstable, a network is not smooth and other link abnormal scenes are ensured, a server (for example, cloud) or a server or the like) is not required to obtain a device state, a state response can be performed by rapidly obtaining the device state according to the device shadow, and for example, a user can rapidly look up the device state when the link is abnormal. The device shadow can be maintained locally within a certain period of time, and the correct state of the responding device can be ensured as much as possible.
Further, the user triggers a control instruction for the device to be controlled in a control application (app) in the control device, the control device responds to the local trigger control instruction for the device to be controlled, the control device can disassemble the user control instruction into a single device state value, and for each device state value, an expected result corresponding to each device state value is added into an expected list for recording. And the expected result is directly returned to the user in advance, so that the user control can be responded to the user equipment control immediately and quickly.
Further, a state update timing is set for the control instruction, and the state update timing may be specified in advance, for example, 0.1 seconds or the like. And monitoring whether the state updating timing is reached, if the state updating timing is reached and the equipment to be controlled does not reach the expected state corresponding to the recorded expected result, further actively acquiring the remote equipment state of the equipment to be controlled under the condition that the link is not abnormal, wherein the remote equipment state is the real-time equipment state of the equipment to be controlled which is actively acquired.
The remote equipment state and the equipment shadow are compared to obtain a first comparison result, the equipment state actually achieved by the user equipment control which responds in advance can be accurately updated according to the first comparison result, furthermore, the equipment state actually achieved by the user equipment control can be timely and accurately updated under the condition of responding to the user equipment control in advance according to the equipment shadow which is locally maintained in advance, the equipment state can be further accurately checked based on the updated equipment shadow, and the user equipment control and the state response can be realized rapidly and accurately as a whole.
Furthermore, the device control mode can be reliably multiplexed to the control device (application end) and the device to be controlled (device end) under the direct scene of local area network control, edge calculation and the like, and has excellent device control effect.
As shown in fig. 2, in one scenario, the control Device (app end) and the Device to be controlled (Device end) may communicate through the Cloud (Cloud), and the control Device (app end) and the Device to be controlled (Device end) may also communicate through local area network control such as wifi/bluetooth/infrared, edge calculation, and virtual simulation. In this scenario, when the control Device (app end) controls the Device to be controlled (Device end), if a link abnormality occurs between the control Device and the server end, the control Device serving as a user contact may also quickly respond to the Device state according to a local Device Shadow (Device Shadow), on the other hand, when the expected state is not achieved in advance by quickly responding to the user Device control, the Device state may be timely and accurately updated according to the Device Shadow local to the control Device and the acquired remote Device state, so that quick and accurate user Device control and state response may be integrally achieved.
In this way, based on steps S110 to S140, by maintaining the device shadow corresponding to the device to be controlled in the control device, when the control command is triggered in the control device, by recording the expected result and the state update timing, when the expected state is not reached in the time-out is monitored, the remote device state is actively acquired and compared with the local device shadow to update the device state, on the one hand, when the device is controlled, the link abnormality occurs between the control device and the server, the control device serving as the user contact can also rapidly respond to the device state according to the local device shadow, on the other hand, when the user device is rapidly responded in advance, the device state can be timely and accurately updated according to the local device shadow of the control device and the acquired remote device state, on the whole, the rapid and accurate user device control and state response can be realized, further, the rapid response control effect of the control device and the device to be controlled in the direct scene such as local network control and edge calculation is also excellent, and the device control effect in the direct scene such as local network control and edge calculation is ensured.
Further alternative embodiments of the steps performed when performing plant control under the embodiment of fig. 1 are described below.
In one embodiment, before the responding to the control instruction for the device to be controlled and recording the expected result corresponding to the control instruction, the method further includes: responding to the starting of a control application, and acquiring the shadow equipment state of the equipment to be controlled; creating a device shadow of the device to be controlled locally according to the shadow device state; and after the device shadow is created, displaying a controller of the device to be controlled in the control application, wherein the control instruction is triggered in the controller.
In this embodiment, each time a control application (app) is started, a shadow device state of a device to be controlled is obtained, and a set of shadow device states is generated, so that a device shadow of the device to be controlled is created locally, and the shadow device state is the device state used for creating the device shadow.
After the shadow state is established, a controller of the equipment to be controlled can be displayed in the control application, and then a user can check the state of the equipment through the controller, the maintenance time of the shadow of the equipment can be as short as possible from the check time, and the equipment state response can be performed as accurately as possible according to the shadow of the equipment.
It will be appreciated that in other embodiments, the shadow state may be acquired at device start-up or user-triggered specific operations, creating the device shadow locally.
In one embodiment, after the recording of the desired result corresponding to the control instruction, the method further includes:
if the equipment updating state of the equipment to be controlled is obtained, determining whether the equipment updating state meets the expected result; and if the equipment updating state accords with the expected result, determining that the equipment to be controlled achieves the recorded expected state corresponding to the expected result.
When any device state of the device to be controlled is updated, the device update state may be obtained in the control device, for example, the device to be controlled actively responds to the control instruction to return to the device update state, where the device update state may be obtained before the state update timing arrives or may be obtained after the state update timing arrives.
If the control device side obtains the device update state of the device to be controlled, it can be determined whether the device update state accords with the expected result according to the recorded expected result, for example, the state value corresponding to the device update state is the same as the expected value corresponding to the expected result, and if not, the device update state accords with the expected result.
And if the equipment updating state accords with the expected result, determining that the equipment to be controlled achieves the expected state corresponding to the recorded expected result, otherwise, determining that the equipment to be controlled does not achieve the expected state corresponding to the recorded expected result.
Further, before the state update timing arrives, the state update information of the device to be controlled is not obtained, and it may also be considered that the device to be controlled does not achieve the desired state corresponding to the recorded desired result.
In one embodiment, the method further comprises: comparing the equipment updating state with the equipment shadow to obtain a second comparison result; and updating the equipment state of the equipment to be controlled in the local area according to the second comparison result.
And comparing the equipment updating state with the equipment shadow to obtain a second comparison result, wherein the second comparison result can be a difference value between the equipment updating state and the corresponding equipment state in the equipment shadow, and judging whether the corresponding equipment state in the equipment shadow needs to be updated or not according to the difference value. If the difference is not zero, the corresponding equipment state in the equipment shadow needs to be updated, and the updated equipment state can be notified to the user; if the difference is zero, the corresponding device state in the device shadow does not need to be updated.
Further, the remote device state and the device shadow are compared to obtain a first comparison result, where the first comparison result may be a difference between the remote device state and the device state corresponding to the device shadow, and whether the device state corresponding to the device shadow needs to be updated may be determined according to the difference. If the difference is not zero, the corresponding device state in the device shadow needs to be updated, and the updated device state can be notified to the user.
In one embodiment, after the device update status of the device to be controlled is determined to be in accordance with the desired result, the method further includes one of the following manners:
first, removing the desired result from a storage location of the desired result; in a second way, a corresponding achieved flag is added for the desired result, the achieved flag being used to indicate that a desired state corresponding to the desired result has been achieved.
After determining that the device update status meets the expected result, removing or marking the recorded expected result can avoid subsequent continuing to make a determination as to whether the expected status is achieved according to the expected result. Wherein in a first way the desired result is removed from the storage location of the desired result, e.g. from the desired list or from the desired list. Removing the desired result may reflect that a desired state corresponding to the desired result has been achieved. In a second way, a corresponding achieved mark is added to the expected result, and the expected state corresponding to the expected result can be determined to be achieved according to the achieved mark. If the expected state corresponding to the expected result is achieved, the remote equipment state is not acquired, and the updated equipment state is not taken to judge whether the expected result is met.
In one embodiment, after the actively acquiring the remote device state of the device to be controlled, the method further comprises: determining whether the remote device status meets the desired result; and if the remote equipment state accords with the expected result, determining that the equipment to be controlled achieves the recorded expected state corresponding to the expected result.
The control device side obtains the remote device state of the device to be controlled, and can determine whether the remote device state accords with the expected result according to the recorded expected result, for example, if the state value corresponding to the remote device state is the same as the expected value corresponding to the expected result, the remote device state accords with the expected result, and if not, the remote device state accords with the expected result.
And if the remote equipment state accords with the expected result, determining that the equipment to be controlled achieves the expected state corresponding to the recorded expected result, otherwise, determining that the equipment to be controlled does not achieve the expected state corresponding to the recorded expected result. And if the equipment to be controlled does not reach the expected state corresponding to the recorded expected result, the control instruction reaches the control expectation, and the equipment state can be accurately updated according to the comparison between the remote equipment state and the equipment shadow.
In one embodiment, after determining that the device to be controlled reaches the desired state corresponding to the recorded desired result if the remote device state meets the desired result, the method further includes one of the following manners: first, removing the desired result from a storage location of the desired result; in a second way, a corresponding achieved flag is added for the desired result, the achieved flag being used to indicate that a desired state corresponding to the desired result has been achieved.
After determining that the device to be controlled achieves the desired state corresponding to the recorded desired result, removing or marking the recorded desired result, so that the subsequent continuous judgment of whether the desired state is achieved according to the desired result can be avoided. Wherein in a first way the desired result is removed from the storage location of the desired result, e.g. from the desired list or from the desired list. Removing the desired result may reflect that a desired state corresponding to the desired result has been achieved. In a second way, a corresponding achieved mark is added to the expected result, and the expected state corresponding to the expected result can be determined to be achieved according to the achieved mark. If the expected state corresponding to the expected result is achieved, the remote equipment state is not acquired, and the updated equipment state is not taken to judge whether the expected result is met.
In order to facilitate better implementation of the device control method provided by the embodiment of the application, the embodiment of the application also provides a device control device based on the device control method. Where the meaning of the terms is the same as in the above-described device control method, specific implementation details may be referred to in the description of the method embodiments. Fig. 3 shows a block diagram of a device control apparatus according to one embodiment of the present application.
As shown in fig. 3, the device control apparatus 200 is applied to a control device, where a device shadow corresponding to a device to be controlled is maintained in the control device, and the device control apparatus 200 may include: the result processing module 210 may be configured to record an expected result corresponding to a control instruction for the device to be controlled in response to triggering the control instruction, and return the expected result locally in advance; the timing setting module 220 may be configured to set a status update timing for the control instruction and monitor whether the status update timing is reached; the state obtaining module 230 may be configured to actively obtain a remote device state of the device to be controlled if the state update timing arrives and the device to be controlled does not reach the recorded expected state corresponding to the expected result; the comparing module 240 may be configured to compare the remote device status with the device shadow to obtain a first comparison result, where the first comparison result is used to update the device status of the device to be controlled locally.
In some embodiments of the present application, the apparatus further includes a status determination module configured to: if the equipment updating state of the equipment to be controlled is obtained, determining whether the equipment updating state meets the expected result; and if the equipment updating state accords with the expected result, determining that the equipment to be controlled achieves the recorded expected state corresponding to the expected result.
In some embodiments of the present application, the apparatus further includes an update module configured to: comparing the equipment updating state with the equipment shadow to obtain a second comparison result; and updating the equipment state of the equipment to be controlled in the local area according to the second comparison result.
In some embodiments of the present application, the apparatus further includes a post-processing module configured to implement one of the following: removing the desired result from the storage location of the desired result; and adding a corresponding reached mark for the expected result, wherein the reached mark is used for indicating that the expected state corresponding to the expected result is reached.
In some embodiments of the present application, the apparatus further comprises a desire check module for: determining whether the remote device status meets the desired result; and if the remote equipment state accords with the expected result, determining that the equipment to be controlled achieves the recorded expected state corresponding to the expected result.
In some embodiments of the present application, the method post-processing module is further configured to one of: removing the desired result from the storage location of the desired result; and adding a corresponding reached mark for the expected result, wherein the reached mark is used for indicating that the expected state corresponding to the expected result is reached.
In some embodiments of the present application, the apparatus further comprises a creation module for: responding to the starting of a control application, and acquiring the shadow equipment state of the equipment to be controlled; creating a device shadow of the device to be controlled locally according to the shadow device state; and after the device shadow is created, displaying a controller of the device to be controlled in the control application, wherein the control instruction is triggered in the controller.
It should be noted that although in the above detailed description several modules or units of a device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functions of two or more modules or units described above may be embodied in one module or unit, in accordance with embodiments of the present application. Conversely, the features and functions of one module or unit described above may be further divided into a plurality of modules or units to be embodied.
In addition, the embodiment of the application further provides an electronic device, which may be a terminal or a server, as shown in fig. 4, which shows a schematic structural diagram of the electronic device according to the embodiment of the application, specifically:
the electronic device may include one or more processing cores 'processors 301, one or more computer-readable storage media's memory 302, power supply 303, and input unit 304, among other components. Those skilled in the art will appreciate that the electronic device structure shown in fig. 4 is not limiting of the electronic device and may include more or fewer components than shown, or may combine certain components, or may be arranged in different components.
Wherein:
the processor 301 is the control center of the electronic device, connects the various parts of the overall computer device using various interfaces and lines, and performs various functions of the computer device and processes data by running or executing software programs and/or modules stored in the memory 302, and invoking data stored in the memory 302, thereby performing overall monitoring of the electronic device. Optionally, processor 301 may include one or more processing cores; preferably, the processor 301 may integrate an application processor and a modem processor, wherein the application processor primarily handles operating systems, user pages, applications, etc., and the modem processor primarily handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 301.
The memory 302 may be used to store software programs and modules, and the processor 301 executes various functional applications and data processing by executing the software programs and modules stored in the memory 302. The memory 302 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program (such as a sound playing function, an image playing function, etc.) required for at least one function, and the like; the storage data area may store data created according to the use of the computer device, etc. In addition, memory 302 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 302 may also include a memory controller to provide the processor 301 with access to the memory 302.
The electronic device further comprises a power supply 303 for powering the various components, preferably the power supply 303 is logically connected to the processor 301 by a power management system, whereby the functions of managing charging, discharging, and power consumption are performed by the power management system. The power supply 303 may also include one or more of any components, such as a direct current or alternating current power supply, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, and the like.
The electronic device may further comprise an input unit 304, which input unit 304 may be used for receiving input digital or character information and for generating keyboard, mouse, joystick, optical or trackball signal inputs in connection with user settings and function control.
Although not shown, the electronic device may further include a display unit or the like, which is not described herein. In particular, in this embodiment, the processor 301 in the electronic device loads executable files corresponding to the processes of one or more computer programs into the memory 302 according to the following instructions, and the processor 301 executes the computer programs stored in the memory 302, so as to implement the functions in the foregoing embodiments of the present application, where the processor 301 may perform the following steps:
responding to a control instruction triggering the equipment to be controlled, recording an expected result corresponding to the control instruction, and returning the expected result in advance locally; setting a state update timing for the control instruction, and monitoring whether the state update timing is reached; if the state updating timing arrives and the equipment to be controlled does not reach the recorded expected state corresponding to the expected result, actively acquiring the remote equipment state of the equipment to be controlled; and comparing the remote equipment state with the equipment shadow to obtain a first comparison result, wherein the first comparison result is used for updating the equipment state of the equipment to be controlled in the local.
It will be appreciated by those of ordinary skill in the art that all or part of the steps of the various methods of the above embodiments may be performed by a computer program, or by computer program control related hardware, which may be stored in a computer readable storage medium and loaded and executed by a processor.
To this end, the present embodiments also provide a storage medium having stored therein a computer program that can be loaded by a processor to perform the steps of any of the methods provided by the embodiments of the present application.
Wherein the storage medium may include: read Only Memory (ROM), random access Memory (RAM, random Access Memory), magnetic or optical disk, and the like.
Since the computer program stored in the storage medium may perform any of the steps in the method provided in the embodiment of the present application, the beneficial effects that can be achieved by the method provided in the embodiment of the present application may be achieved, which are detailed in the previous embodiments and are not described herein.
Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the embodiments disclosed herein. This application is intended to cover any variations, uses, or adaptations of the application following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the application pertains.
It will be understood that the present application is not limited to the embodiments that have been described above and shown in the drawings, but that various modifications and changes can be made without departing from the scope thereof.

Claims (10)

1. The device control method is characterized by being applied to control devices, wherein device shadows corresponding to devices to be controlled are maintained in the control devices, and the method comprises the following steps:
responding to a control instruction triggering the equipment to be controlled, recording an expected result corresponding to the control instruction, and returning the expected result in advance locally;
setting a state update timing for the control instruction, and monitoring whether the state update timing is reached;
if the state updating timing arrives and the equipment to be controlled does not reach the recorded expected state corresponding to the expected result, actively acquiring the remote equipment state of the equipment to be controlled;
and comparing the remote equipment state with the equipment shadow to obtain a first comparison result, wherein the first comparison result is used for updating the equipment state of the equipment to be controlled in the local.
2. The method of claim 1, wherein after said recording the desired result for the control instruction, the method further comprises:
if the equipment updating state of the equipment to be controlled is obtained, determining whether the equipment updating state meets the expected result;
and if the equipment updating state accords with the expected result, determining that the equipment to be controlled achieves the recorded expected state corresponding to the expected result.
3. The method according to claim 2, wherein the method further comprises:
comparing the equipment updating state with the equipment shadow to obtain a second comparison result;
and updating the equipment state of the equipment to be controlled in the local area according to the second comparison result.
4. The method according to claim 2, wherein after said determining that said device update status meets said desired result if a device update status of said device to be controlled is obtained, said method further comprises one of:
removing the desired result from the storage location of the desired result;
and adding a corresponding reached mark for the expected result, wherein the reached mark is used for indicating that the expected state corresponding to the expected result is reached.
5. The method of claim 1, wherein after the actively acquiring the remote device state of the device to be controlled, the method further comprises:
determining whether the remote device status meets the desired result;
and if the remote equipment state accords with the expected result, determining that the equipment to be controlled achieves the recorded expected state corresponding to the expected result.
6. The method of claim 5, wherein after determining that the device to be controlled has reached the desired state corresponding to the recorded desired result if the remote device state meets the desired result, the method further comprises one of:
removing the desired result from the storage location of the desired result;
and adding a corresponding reached mark for the expected result, wherein the reached mark is used for indicating that the expected state corresponding to the expected result is reached.
7. The method according to any one of claims 1 to 6, wherein before said recording of a desired result corresponding to a control instruction for the device to be controlled in response to the control instruction, the method further comprises:
responding to the starting of a control application, and acquiring the shadow equipment state of the equipment to be controlled;
creating a device shadow of the device to be controlled locally according to the shadow device state;
and after the device shadow is created, displaying a controller of the device to be controlled in the control application, wherein the control instruction is triggered in the controller.
8. A device control apparatus, applied to a control device, where a device shadow corresponding to a device to be controlled is maintained in the control device, the apparatus comprising:
the result processing module is used for responding to a control instruction for the equipment to be controlled, recording an expected result corresponding to the control instruction and returning the expected result in advance locally;
a timing setting module, configured to set a state update timing for the control instruction, and monitor whether the state update timing arrives;
the state acquisition module is used for actively acquiring the remote equipment state of the equipment to be controlled if the state update timing arrives and the equipment to be controlled does not reach the recorded expected state corresponding to the expected result;
and the comparison module is used for comparing the remote equipment state with the equipment shadow to obtain a first comparison result, and the first comparison result is used for updating the equipment state of the equipment to be controlled in the local.
9. A storage medium having stored thereon a computer program which, when executed by a processor of a computer, causes the computer to perform the method of any of claims 1 to 7.
10. An electronic device, comprising: a memory storing a computer program; a processor reading a computer program stored in a memory to perform the method of any one of claims 1 to 7.
CN202310186456.0A 2023-02-22 2023-02-22 Equipment control method and device, storage medium and electronic equipment Pending CN117411914A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310186456.0A CN117411914A (en) 2023-02-22 2023-02-22 Equipment control method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310186456.0A CN117411914A (en) 2023-02-22 2023-02-22 Equipment control method and device, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN117411914A true CN117411914A (en) 2024-01-16

Family

ID=89485919

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310186456.0A Pending CN117411914A (en) 2023-02-22 2023-02-22 Equipment control method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN117411914A (en)

Similar Documents

Publication Publication Date Title
CN106209412B (en) Resource monitoring system and method thereof
US11662803B2 (en) Control method, apparatus, and electronic device
CN110618889A (en) Service availability detection method and device, computer equipment and storage medium
CN113746821A (en) Intelligent device control method and device, storage medium and electronic device
CN112044061B (en) Game picture processing method and device, electronic equipment and storage medium
US11388038B2 (en) Operation device and operation method
CN117411914A (en) Equipment control method and device, storage medium and electronic equipment
US20090083747A1 (en) Method for managing application programs by utilizing redundancy and load balance
CN113849356B (en) Equipment testing method and device, electronic equipment and storage medium
CN115437865A (en) Method, device, equipment and medium for testing abnormal power failure of hard disk
CN115421859A (en) Dynamic loading method and device of configuration file, computer equipment and storage medium
CN114647509A (en) Memory cleaning method and device, storage medium and electronic equipment
CN112303811B (en) Processing method, device and system for air conditioner operation data, air conditioner and storage medium
CN114490432A (en) Memory processing method and device, electronic equipment and computer readable storage medium
CN110990219B (en) Computer monitoring method based on prediction model
CN111858234A (en) Task execution method, device, equipment and medium
CN115242615B (en) Server operation management method and device, electronic equipment and storage medium
CN110572806A (en) Bluetooth-based time correction method and device for temperature control relay system
CN110019535B (en) Database management method, database management device, storage medium and computer equipment
CN117408656A (en) Node election method and device, storage medium and electronic equipment
CN117255332B (en) Bluetooth connection control method and device, storage medium and electronic equipment
CN114995972A (en) Application program management method and device, readable medium, electronic equipment and product
CN109189664B (en) Information acquisition method and terminal for application program
CN117407213A (en) System regulation and control method and device, storage medium and electronic equipment
CN114625543A (en) Memory management method and device, storage medium and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination