CN115134343A - Equipment control method, system, device, server and storage medium - Google Patents

Equipment control method, system, device, server and storage medium Download PDF

Info

Publication number
CN115134343A
CN115134343A CN202110334894.8A CN202110334894A CN115134343A CN 115134343 A CN115134343 A CN 115134343A CN 202110334894 A CN202110334894 A CN 202110334894A CN 115134343 A CN115134343 A CN 115134343A
Authority
CN
China
Prior art keywords
state
real
equipment
control instruction
shadow
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
CN202110334894.8A
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.)
Lumi United Technology Co Ltd
Original Assignee
Lumi United 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 Lumi United Technology Co Ltd filed Critical Lumi United Technology Co Ltd
Priority to CN202110334894.8A priority Critical patent/CN115134343A/en
Publication of CN115134343A publication Critical patent/CN115134343A/en
Pending legal-status Critical Current

Links

Images

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/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • H04L67/025Protocols based on web technology, e.g. hypertext transfer protocol [HTTP] for remote control or remote monitoring of applications
    • 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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/02Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]

Landscapes

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

Abstract

The embodiment of the application discloses a device control method, a system, a device, an electronic device and a storage medium, wherein the device control method is applied to a server. Firstly, under the condition that the expected state is different from the current state of the shadow device, generating a control instruction according to the expected state, wherein the control instruction is used for controlling the corresponding real device to be switched into the expected state; and if the real equipment corresponding to the shadow equipment is not in a communicable state, the control instruction is issued to the real equipment under the condition that the real equipment is recovered to the communicable state. Under the condition that the network is recovered to be normal, the real equipment is recovered to be in a communicable state, the control command is issued to the real equipment again, the real equipment executes the control command, switches to be in an expected state and informs a user, so that important command information is prevented from being omitted, and the user can timely obtain a response after the communication state is recovered.

Description

Equipment control method, system, device, server and storage medium
Technical Field
The application relates to the field of internet of things, in particular to a device control method, system, device, electronic device and storage medium.
Background
With the development of society and scientific progress, the internet of things is produced at the same time, and great progress is made. Today, people have higher and higher requirements on stability and expectation value of automatic control of the internet of things, and have more and more personalized requirements on the internet of things.
However, the production environment is complex, and it is difficult to implement a general automatic control strategy for the internet of things device, which not only meets the personalized requirements, but also meets the resource limitations on hardware. How to make human consciousness and will be implemented in the real controlled object, and the execution result will not be less than expected due to the unreasonable system design, which is the basis for the continuous optimization of the automation module.
The automatic control mode in the prior art is often designed based on the condition that the communication link of the automatic control mode is continuously kept normal. When the communication link is unstable or an offline condition occurs, the automation action occurring in the period of time is often directly treated as a failure result, and even if the communication link is restored to normal again, the automation action required to be executed when the communication link is unstable or the offline condition occurs is not treated any more. The consciousness and the will of people can not be implemented in the real controlled object.
Disclosure of Invention
An object of the present application is to provide a device control method, system, apparatus, electronic device, and storage medium, which at least partially improve the above-mentioned problems.
In order to achieve the above purpose, the embodiments of the present application employ the following technical solutions:
in a first aspect, an embodiment of the present application provides an apparatus control method, which is applied to a server, and the method includes:
under the condition that the expected state is different from the current state of the shadow device, generating a control instruction according to the expected state;
if the real device corresponding to the shadow device is not in a communicable state, the control instruction is issued to the real device under the condition that the real device is recovered to the communicable state.
Optionally, the control instruction carries a timestamp indicating a generation time, and if the real device corresponding to the shadow device is not in a communicable state, the control instruction is issued to the real device when the real device is restored to the communicable state, where the method further includes:
judging whether the type of the control instruction is a first type;
if so, judging whether the interval between the timestamp and the current time exceeds a preset time threshold, wherein the control instruction corresponding to the first type of shadow equipment has timeliness;
if the control command exceeds the preset control command, determining that the control command is invalid;
and if the actual equipment is not in the communicable state, the control instruction is issued to the actual equipment under the condition that the actual equipment is recovered to the communicable state.
Optionally, the control instruction carries a timestamp indicating a generation time, and if the real device corresponding to the shadow device is in a communicable state, the method further includes:
judging whether the type of the control instruction is a first type or not;
if so, judging whether the interval between the timestamp and the current time exceeds a preset time threshold, wherein the first type of control instruction has timeliness;
if the control command exceeds the preset control command, confirming that the control command is invalid;
and if not, issuing the control command to the real equipment.
Optionally, the method further comprises:
judging whether the type of the control instruction is a second type;
if yes, keeping the control instruction continuously effective.
Optionally, after generating a control instruction according to the desired state, the method further comprises:
judging whether the real equipment is in a communicable state;
and if the real equipment is in a communicable state, the control instruction is issued to the real equipment.
Optionally, before generating a control instruction in dependence on the desired state, the method comprises:
judging whether the expected state is the same as the current state of the shadow equipment or not;
and if not, generating a control instruction according to the expected state.
Optionally, before determining whether the desired state is the same as the current state of the shadow device, the method includes:
and generating an expected state according to state change information transmitted by associated equipment or a demand instruction transmitted by a client, wherein the associated equipment is equipment in linkage relation with the real equipment, and the client is a terminal for managing the real equipment.
Optionally, before determining whether the desired state is the same as the current state of the shadow device, the method includes:
and updating the current state of the shadow device according to the current state uploaded by the real device.
In a second aspect, an embodiment of the present application provides an apparatus control method, which is applied to a real apparatus, and the method includes:
after receiving a control instruction transmitted by a server, switching to an expected state corresponding to the control instruction;
and uploading the current state of the real equipment to the server after the state switching is finished, wherein the current state of the real equipment is used for updating the current state of the corresponding shadow equipment, and the shadow equipment runs on the server.
In a third aspect, an embodiment of the present application provides an apparatus control method, which is applied to an associated apparatus, and the method includes:
and transmitting state change information to a server, wherein the state change information is used for the server to generate an expected state of a shadow device, and the shadow device is the only virtual device of the real device having the linkage relation with the associated device.
In a fourth aspect, an embodiment of the present application provides an apparatus control system, where the apparatus control system includes a real apparatus, an associated apparatus, and a server, where the server is in communication connection with the real apparatus and the associated apparatus, respectively, and the associated apparatus has a linkage relationship with the real apparatus;
the associated equipment is used for transmitting state change information to the server;
the server is used for generating an expected state according to the state change information; the control device is also used for generating a control instruction according to the expected state under the condition that the expected state is different from the current state of the shadow device; the shadow device is further configured to issue the control instruction to the real device if the real device corresponding to the shadow device is not in a communicable state and the real device is recovered to the communicable state;
and the real equipment is used for switching to an expected state after receiving the control instruction.
In a sixth aspect, an embodiment of the present application provides an apparatus for controlling a device, where the apparatus is applied to a server, and the apparatus includes:
the shadow device comprises an instruction generating unit, a control unit and a control unit, wherein the instruction generating unit is used for generating a control instruction according to an expected state under the condition that the expected state is different from the current state of the shadow device;
and the issuing unit is used for issuing the control instruction to the real equipment under the condition that the real equipment is recovered to the communicable state if the real equipment corresponding to the shadow equipment is not in the communicable state.
In a seventh aspect, an embodiment of the present application provides an apparatus control device, which is applied to a real apparatus, where the apparatus includes:
the execution unit is used for switching to an expected state corresponding to the control instruction after receiving the control instruction transmitted by the server;
and the uploading unit is used for uploading the current state of the real equipment to the server every time the state switching is completed, wherein the current state of the real equipment is used for updating the current state of the corresponding shadow equipment, and the shadow equipment runs on the server.
In an eighth aspect, an embodiment of the present application provides an apparatus for controlling a device, which is applied to an associated device, where the apparatus includes:
and the transmission unit is used for transmitting state change information to the server, wherein the state change information is used for the server to generate an expected state of a shadow device, and the shadow device is the only virtual device of the real device in linkage relation with the associated device.
In a ninth aspect, an embodiment of the present application provides an electronic device, including: a processor and memory for storing one or more programs; the one or more programs, when executed by the processor, implement the methods described above.
In a tenth aspect, embodiments of the present application provide a computer-readable storage medium, on which a computer program is stored, and the computer program, when executed by a processor, implements the method described above.
Compared with the prior art, in the device control method, the system, the apparatus, the electronic device and the storage medium provided by the embodiments of the present application, the device control method is applied to a server. Firstly, under the condition that the expected state is different from the current state of the shadow device, generating a control instruction according to the expected state, wherein the control instruction is used for controlling the corresponding real device to be switched into the expected state; and if the real equipment corresponding to the shadow equipment is not in a communicable state, the control instruction is issued to the real equipment under the condition that the real equipment is recovered to the communicable state. Under the condition that the network is recovered to be normal, the real equipment is recovered to be in a communication state, the control command is issued to the real equipment again, the real equipment executes the control command, is switched to be in an expected state and informs a user, so that important command information is prevented from being omitted, and the user can timely obtain response after the communication state is recovered.
In order to make the aforementioned objects, features and advantages of the present application more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and those skilled in the art can also obtain other related drawings based on the drawings without inventive efforts.
FIG. 1 is a schematic illustration of a flooding event provided by an embodiment of the present application;
FIG. 2 is a schematic diagram of a door lock event provided by an embodiment of the present application;
fig. 3 is a schematic flowchart of an apparatus control method according to an embodiment of the present application;
fig. 4 is another schematic flow chart of an apparatus control method according to an embodiment of the present disclosure;
fig. 5 is another schematic flow chart of an apparatus control method according to an embodiment of the present application;
fig. 6 is another schematic flow chart of an apparatus control method according to an embodiment of the present application;
fig. 7 is another schematic flow chart of an apparatus control method according to an embodiment of the present application;
fig. 8 is another schematic flow chart of an apparatus control method according to an embodiment of the present application;
fig. 9 is another schematic flow chart of an apparatus control method according to an embodiment of the present application;
FIG. 10 is a schematic diagram of elements of a device control apparatus according to an embodiment of the present application;
fig. 11 is another schematic unit diagram of a device control apparatus provided in an embodiment of the present application;
FIG. 12 is a schematic diagram of another unit of a device control apparatus according to an embodiment of the present disclosure;
fig. 13 is a block diagram of a hardware structure of a server according to an embodiment of the present application.
In the figure: 1100-a server; 1110-a processor; 1120-storage medium; 1121 — operating system; 1122-data; 1123-applications; 1130-a memory; 1140-input output interface; 1150-wired or wireless network interface; 1160-power supply; 201-an instruction generation unit; 202-a sending unit; 301-an execution unit; 302-an upload unit; 401-transmission unit.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Most of the automatic control modes on the market at present are designed based on the condition that a communication link is normal. In the case of an unstable or offline communication link, such automation actions are often handled directly as failure results, and even if the communication link is restored to normal, the automation that the person wants to perform with consciousness or will not be handled immediately. The consciousness and the will of people can not be implemented in the real controlled object.
As shown in fig. 1, the water sensor detects a water immersion event and reports the water immersion event to the server, and the server notifies the alarm device to alarm through the stored automation rule (if the water immersion condition is met, the alarm device is notified to alarm), but once the network connection is abnormal, the action cannot be executed. Even if the network communication returns to normal after a period of time, an alarm will not be triggered because the flooding event occurred previously. Namely, after the network communication is recovered to be normal, the alarm device still cannot be used for giving an alarm when the water sensor detects a water immersion event.
In order to optimize the problem that the notification control cannot be performed due to network abnormality as shown in fig. 1, the inventor adds a retransmission mechanism for optimization, i.e. retransmission at regular intervals, and can issue a control command to the alarm device when the network returns to normal. However, under the condition of periodic retransmission, other requirements for automation control cannot be met. Referring to fig. 2, as shown in fig. 2, the door lock reports the door opening event at point 21, and the server turns on the light according to the automation rule (if the door opening event report is satisfied, the light is turned on). If the 21-point network connection is abnormal and the lamp cannot be turned on, the server periodically retransmits the lamp, and the network returns to the normal condition after people have a rest at 23 points, and the lamp is turned on because of the system retransmission mechanism, and the action of turning on the lamp is not expected by people.
In order to overcome the above problems, an apparatus control method is provided in an embodiment of the present application and applied to a server, please refer to fig. 3, where fig. 3 is a flowchart illustrating the apparatus control method provided in the embodiment of the present application. As shown in fig. 3, the device control method includes:
s103, judging whether the expected state is the same as the current state of the shadow device. If yes, go to S112; if not, S104 is executed.
Specifically, if the expected state is the same as the current state of the shadow device, the control instruction does not need to be issued to the real device, and then S112 is executed; otherwise, S104 is executed.
Wherein the shadow device is a copy created in the server (platform) corresponding to the real device. Each shadow device corresponds to a different real device. The shadow device is used for caching and displaying the current state of the corresponding real device. The real device is a controlled device which receives the server regulation instruction, such as an alarm and a lamp in the above example.
And S104, generating a control command according to the expected state.
Specifically, the control instruction is used for controlling the corresponding real device to switch to a desired state. For example, the real device corresponding to the shadow device is a lamp, the current state of the shadow device is an off state, and the desired state is an on state, and at this time, a control instruction needs to be generated according to the desired state. The method aims to enable the real device to be switched to the open state through the control instruction, so that the current state of the shadow device is switched to the open state and is consistent with the expected state.
S105, judging whether the real device corresponding to the shadow device is in a communicable state. If yes, executing S106; if not, S107 is executed.
Specifically, if the real device is in a communicable state, the control instruction is directly issued to the real device, so that the real device is switched to an expected state, and S106 is executed; on the contrary, if the corresponding real device is not in a communicable state, it is necessary to determine whether the type of the control command is the first type, and then S111 is executed.
And S106, sending the control command to the real equipment.
Specifically, the real device switches to the desired state after receiving the control instruction. For example, the real device is the lamp, and after the lamp receives the control instruction, the lamp quickly responds to the control instruction and is switched to the on state, so that the lighting requirement of the user is met.
And S111, sending the control command to the real equipment under the condition that the real equipment is recovered to a communicable state.
Please refer to the above example, the real device is an alarm device. When the water sensor detects a water immersion event, the real device is in a non-communicable state, and at this time, the user cannot be notified that the water immersion event occurs. Under the condition that the network is recovered to be normal, the real equipment is recovered to be in a communicable state, and the control command is issued to the alarm device again, so that the user is informed that the flooding event happens once when the real equipment is in a non-communicable state, and the situation that the flooding event is informed and potential safety hazards are generated is avoided.
And S112, ending.
In another optional implementation, the control instruction carries a timestamp indicating a generation time, and if a real device corresponding to the shadow device is in a communicable state, the method further includes:
judging whether the type of the control instruction is a first type;
if so, judging whether the interval between the timestamp and the current time exceeds a preset time threshold, wherein the first type of control instruction has timeliness;
if the control command exceeds the preset control command, confirming that the control command is invalid;
and if not, issuing the control command to the real equipment.
In the embodiment, the real device corresponding to the shadow device is confirmed to be in a communicable state, then the type of the control instruction is judged, when the control instruction is time-efficient, whether the interval between the timestamp when the control instruction is generated and the current time exceeds a preset time threshold value is judged, if so, the control instruction is considered to be invalid, and the control instruction is not issued to the real device. And if not, directly sending the control command to the real equipment.
On the basis of fig. 3, in order to avoid the problem that the real device executes an expired control instruction and generates interference to the user when the real device is the lamp in the above example, an embodiment of the present application further provides a possible implementation manner, please refer to fig. 4, where the device control method further includes:
s107, judging whether the type of the control command is a first type or a second type. If the type is the first type, executing S108; if the second type is determined, S110 is executed.
Specifically, if the type of the control instruction is not the first type, it indicates that the type of the control instruction is the second type, and S110 is executed.
Wherein the first type of control instruction is time-sensitive and the second type of control instruction is continuously valid.
Specifically, as shown in FIG. 2, the lamp is a real device (the type of the control command corresponding to the lamp is a first type; as shown in FIG. 1, the alarm device is a real device, and the type of the control command corresponding to the alarm device is a second type).
And S108, judging whether the interval between the timestamp and the current time exceeds a preset time threshold value. If yes, executing S109; if not, S111 is executed.
Wherein the control instruction carries a timestamp representing the time of generation. Under the condition that the expected state is different from the current state of the shadow device, the server needs to generate a control instruction, and the timestamp is the generation time of the control instruction. The timestamp is used for judging whether the control instruction of the shadow device is effective or not under the condition that the control instruction is of the first type.
Specifically, as shown in fig. 2, the real device (lamp) is a transient device, and the type of the control command corresponding to the lamp is a first type. When the door lock reports a door opening event at point 21, when the door lock is opened, a user can open the lamp conveniently, the generated expected state is an open state, and the current state of the shadow device corresponding to the lamp is a closed state, so that a control instruction for opening the lamp is generated, and a timestamp carried by the control instruction is, for example, 21: 00(21 point 0 point). However, at this time, the lamp is not in a communicable state, and the control command cannot be issued to the lamp.
In order to avoid that the user has a rest at the 23 th point and the communication network of the lamp recovers to the normal condition, the server issues a control instruction to the lamp at the 23 rd point, and the lamp is turned on due to the system retransmission mechanism, so that the rest of the user is influenced, and unnecessary waste is caused. And judging whether the interval between the timestamp and the current time exceeds a preset time threshold value. If yes, confirming that the control instruction is invalid, optionally deleting the control instruction, and executing S109; if not, the control instruction is still valid, and when the real device is restored to a communicable state, the control instruction is issued to the real device so that the real device is switched to an expected state, and S111 is executed.
Please continue to refer to the above example, suppose that a door opening event is reported when the door lock is in 21: 00/second, and under the condition that other conditions are not changed, if the lamp is restored to a communicable state in 21: 00/01/second, at this time, the interval between the timestamp and the current time is smaller than a preset time threshold, at this time, the lamp is turned on, which is helpful for the user to observe the environment, at this time, a control instruction is issued to the real device (lamp) so as to switch the real device to an expected state, that is, the lamp is switched to an open state.
And S109, confirming the control command failure.
Specifically, in the case where the control instruction fails, the control instruction is not issued to the real device any more even in the case where the real device is restored to the communicable state.
S110, keeping the control command continuously effective.
Specifically, the control instruction is kept valid all the time, and in the case where the real device is restored to a communicable state, S111 is executed to issue the control instruction to the real device, so that the real device is switched to a desired state. For example, the alarm device shown in fig. 1 is a real device, the type of the control instruction corresponding to the alarm device is a second type, and when the alarm device is restored to a communicable state, even if a water sensor which has occurred before detects a water immersion event, the server issues the control instruction to the alarm device, so that an alarm is triggered, and the alarm event is prevented from being missed.
On the basis of fig. 3, regarding how to determine the current state of the shadow device, a possible implementation manner is further provided in the embodiment of the present application, please refer to fig. 5, where the device control method further includes:
and S101, updating the current state of the shadow device according to the current state uploaded by the real device.
Specifically, the real device uploads the current state of the real device at a fixed frequency, and the server updates the current state uploaded by the real device to the current state of the shadow device after receiving the current state uploaded by the real device.
Alternatively, due to network instability, the communication state of real devices changes frequently, and the devices are frequently brought up and down. When a client sends a request for acquiring the current state of the real device, the real device is disconnected and is not in a communicable state, and the server cannot acquire the current state of the real device and cannot feed back the current state of the real device to the client in time. In the embodiment of the application, because the current state of the shadow device is updated according to the current state uploaded by the real device, the current state of the shadow device can be issued to the client when the client transmits the acquisition request, so as to meet the requirements of the client.
Optionally, in the prior art, when the server simultaneously obtains the obtaining requests of the current states of multiple same real devices, the server needs to obtain the current states of the real devices multiple times, and even if the response results are the same, the real devices need to respond multiple times according to the requests. However, the real device has limited processing capability, and cannot concurrently process multiple requests, thereby affecting the operation of the real device. In the scheme provided by the embodiment of the application, the current state of the shadow device is only required to be used as a result to feed back different demanders, and the operation of the real device cannot be influenced.
On the basis of fig. 3, regarding how to generate the desired state, the embodiment of the present application further provides a possible implementation manner, please refer to fig. 6, where the apparatus control method further includes:
and S102, generating an expected state according to the state change information transmitted by the associated equipment or the demand instruction transmitted by the client.
The associated equipment is equipment in linkage relation with the real equipment, and the client is a terminal for managing the real equipment.
Specifically, with continuing reference to fig. 1 and 2, in the case where the real device is an alarm device, the water sensor is associated with the alarm device, and in the case where the real device is a light, the door lock is associated with the light. The client is a terminal with real equipment management authority, and can be a mobile phone terminal, a computer terminal or other intelligent terminals.
Optionally, on the basis of fig. 3, regarding how to implement device control, a possible implementation manner is also provided in the embodiments of the present application, please refer to fig. 7, where the device control method includes S101 to S112.
Optionally, the current state of the shadow device in the embodiment of the present application is persistently stored in a database.
To sum up, the device control method provided by the embodiment of the present application is applied to a server. Firstly, under the condition that the expected state is different from the current state of the shadow device, generating a control instruction according to the expected state, wherein the control instruction is used for controlling the corresponding real device to be switched into the expected state; if the real device corresponding to the shadow device is not in a communicable state, the control instruction is issued to the real device under the condition that the real device is recovered to the communicable state. Under the condition that the network is recovered to be normal, the real equipment is recovered to be in a communicable state, the control command is issued to the real equipment again, the real equipment executes the control command, is switched to be in an expected state, informs a user that the real equipment needs to be switched to be in the expected state during the period that the real equipment is in the non-communicable state; therefore, important instruction information is prevented from being omitted, and the user can timely obtain response after the communication state is recovered. Secondly, the validity of the first type of control instruction is judged through the timestamp, the phenomenon that the real equipment corresponding to the shadow equipment executes the overdue control instruction, interference is caused to life of people, and unnecessary waste is avoided. Then, the current state of the shadow device is updated through the current state uploaded by the real device, so that the current state of the real device can be conveniently inquired by the client side, and the running load of the real device is reduced. And finally, generating an expected state through the state change information transmitted by the associated equipment or the demand instruction transmitted by the client, thereby quickly meeting the customer demand.
Optionally, an apparatus control method is provided in an embodiment of the present application, and please refer to fig. 8, where fig. 8 is a schematic flowchart of the apparatus control method provided in the embodiment of the present application. As shown in fig. 8, the device control method includes:
s201, after receiving the control command transmitted by the server, switching to an expected state corresponding to the control command.
Specifically, taking the real device as the above-mentioned alarm device as an example, after the alarm device receives the control instruction, the alarm device performs an alarm, that is, switches to an expected state corresponding to the control instruction.
And S202, uploading the current state of the real equipment to the server every time the state switching is finished. The current state of the real device is used for updating the current state of the corresponding shadow device, and the shadow device runs on the server.
Specifically, each shadow device corresponds to a different real device.
Optionally, the real device uploads the current state of the real device at a fixed frequency, and the server updates the current state uploaded by the real device to the current state of the shadow device after receiving the current state uploaded by the real device.
Alternatively, due to network instability, the communication state of real devices changes frequently, and the devices are frequently brought up and down. When a client sends a request for acquiring the current state of the real device, the real device is disconnected and is not in a communicable state, and the server cannot acquire the current state of the real device and cannot feed back the current state of the real device to the client in time. In the embodiment of the application, because the current state of the shadow device is updated according to the current state uploaded by the real device, the current state of the shadow device can be issued to the client when the client transmits the acquisition request, so as to meet the requirements of the client.
Optionally, an apparatus control method is provided in an embodiment of the present application, and is applied to associated apparatuses, please refer to fig. 9, where fig. 9 is a schematic flowchart of the apparatus control method provided in the embodiment of the present application. As shown in fig. 9, the device control method includes:
s301, transmitting the state change information to the server.
The state change information is used for the server to generate an expected state of the shadow device, and the shadow device is the only virtual device of the real device in linkage relation with the associated device.
Specifically, with continued reference to fig. 1 and 2, in the case where the real device is an alarm device, the associated device is a water sensor, and the state change information indicates that a water immersion event has occurred; in case the real device is a lamp, the associated device is a door and the state change information is indicative of the door being opened. The state change information is information characterizing a state change of the associated device. And by transmitting the state change information to the server, the server drives the real equipment to automatically perform state switching through the expected state of the shadow equipment.
Optionally, an apparatus control system is further provided in an embodiment of the present application, where the apparatus control system includes a real apparatus, an associated apparatus, and a server, the server is in communication connection with the real apparatus and the associated apparatus, respectively, and the associated apparatus and the real apparatus have a linkage relationship.
The associated device is used for transmitting the state change information to the server.
The server is used for generating an expected state according to the state change information; the control device is also used for generating a control instruction according to the expected state under the condition that the expected state is different from the current state of the shadow device; and the shadow device is also used for issuing a control instruction to the real device under the condition that the real device is recovered to a communicable state if the real device corresponding to the shadow device is not in the communicable state.
The real equipment is used for switching to an expected state after receiving the control instruction.
It should be noted that, the device control system provided in this embodiment may execute the method flows shown in the above method flow embodiments, so as to achieve corresponding technical effects. For the sake of brevity, the corresponding contents in the above embodiments may be referred to where not mentioned in this embodiment.
Referring to fig. 10, fig. 10 is a diagram of an apparatus control device according to an embodiment of the present application, where optionally, the apparatus control device is applied to a server according to an embodiment of the present application.
The device control apparatus includes: an instruction generation unit 201 and an issue unit 202.
An instruction generating unit 201, configured to generate a control instruction according to the desired state when the desired state is different from the current state of the shadow device. Alternatively, the instruction generating unit 201 may execute S104 described above.
The issuing unit 202 is configured to issue the control instruction to the real device if the real device corresponding to the shadow device is not in a communicable state, and optionally, the issuing unit 202 may execute the above S111 when the real device is recovered to the communicable state.
Optionally, the control instruction carries a timestamp indicating the generation time, and the issuing unit 202 is further configured to determine whether the type of the control instruction is the first type; if so, judging whether the interval between the timestamp and the current time exceeds a preset time threshold value, wherein the first type of control instruction has timeliness; if the control command exceeds the preset control command, determining that the control command is invalid; and if not, transmitting the control command to the real equipment under the condition that the real equipment is recovered to a communicable state.
The issuing unit 202 is further configured to determine whether the type of the control instruction is a second type; if yes, the control instruction is kept continuously effective.
Optionally, the issuing unit 202 is further configured to determine whether the real device is in a communicable state; and if the real equipment is in a communicable state, the control instruction is issued to the real equipment.
Optionally, the issuing unit 202 may also perform S105-S109.
Optionally, the instruction generating unit 201 is further configured to determine whether the expected state is the same as the current state of the shadow device; if not, generating a control command according to the expected state.
Optionally, the instruction generating unit 201 is further configured to generate the expected state according to state change information transmitted by associated devices or a demand instruction transmitted by a client, where the associated devices are devices having an interlocking relationship with the real devices, and the client is a terminal for managing the real devices.
Optionally, the instruction generating unit 201 is further configured to update the current state of the shadow device according to the current state uploaded by the real device.
Alternatively, the instruction generating unit 201 may execute S101 to S103 described above.
It should be noted that the device control apparatus provided in this embodiment may execute the method flows shown in the above method flow embodiments to achieve the corresponding technical effects. For the sake of brief description, the embodiment is not mentioned in part, and reference may be made to the corresponding contents in the above embodiments.
Referring to fig. 11, fig. 11 is a diagram of a device control apparatus according to an embodiment of the present application, where optionally, the device control apparatus is applied to an actual device in the embodiment of the present application.
The device control apparatus includes: an execution unit 301 and an upload unit 302.
The execution unit 301 is configured to switch to an expected state corresponding to the control instruction after receiving the control instruction transmitted by the server. Alternatively, the execution unit 301 may execute S201 described above.
An uploading unit 302, configured to upload the current state of the real device to the server every time the state switching is completed, where the current state of the real device is used to update the current state of the corresponding shadow device, and the shadow device runs on the server. Alternatively, the upload unit 302 may perform S202 described above.
It should be noted that the device control apparatus provided in this embodiment may execute the method flows shown in the above method flow embodiments to achieve the corresponding technical effects. For the sake of brevity, the corresponding contents in the above embodiments may be referred to where not mentioned in this embodiment.
Referring to fig. 12, fig. 12 is a diagram of a device control apparatus according to an embodiment of the present application, and optionally, the device control apparatus is applied to an associated device according to an embodiment of the present application.
The device control apparatus includes a transmission unit 401.
A transmitting unit 401, configured to transmit state change information to the server, where the state change information is used by the server to generate an expected state of a shadow device, and the shadow device is a unique virtual device of a real device having an interlocking relationship with an associated device.
It should be noted that, the device control apparatus provided in this embodiment may execute the method flows shown in the above method flow embodiments, so as to achieve corresponding technical effects. For the sake of brevity, the corresponding contents in the above embodiments may be referred to where not mentioned in this embodiment.
The embodiment of the application provides an electronic device which can be a server. The server comprises a processor and a memory, wherein at least one instruction, at least one program, a set of codes, or a set of instructions is stored in the memory, and the at least one instruction, the at least one program, the set of codes, or the set of instructions is loaded and executed by the processor to implement the device control method provided by the above method embodiment.
The memory may be used to store software programs and modules, and the processor may execute various functional applications and data processing by operating the software programs and modules stored in the memory. The memory can mainly comprise a program storage area and a data storage area, wherein the program storage area can store an operating system, application programs needed by functions and the like; the storage data area may store data created according to use of the apparatus, and the like. Further, the memory 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 may also include a memory controller to provide the processor access to the memory.
Fig. 13 is a block diagram of a hardware structure of a server in a device control method according to an embodiment of the present invention. As shown in fig. 13, the server 1100 may have a relatively large difference due to different configurations or performances, and may include one or more processors (CPUs) 1110 (the processors 1110 may include but are not limited to processing devices such as a microprocessor MCU or a programmable logic device FPGA), a memory 1130 for storing data, and one or more storage media 1120 (e.g., one or more mass storage devices) for storing applications 1123 or data 1122. The memory 1130 and the storage medium 1120 may be, among other things, transient storage or persistent storage. The program stored in the storage medium 1120 may include one or more modules, each of which may include a series of instruction operations in a server. Still further, the processor 1110 may be configured to communicate with the storage medium 1120, and execute a series of instruction operations in the storage medium 1120 on the server 1100. Server 1100 may also include one or more power supplies 1160, one or more wired or wireless network interfaces 1150, one or more input-output interfaces 1140, and/or one or more operating systems 1121, such as Windows Server, MacOSXTM, UnixTM, LinuxTM, FreeBSDTM, and so forth.
The input output interface 1140 may be used to receive or transmit data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of the server 1100. In one example, i/o interface 1140 includes a network adapter (NIC) that may be coupled to other network devices via a base station to communicate with the internet. In one example, the input/output interface 1140 can be a Radio Frequency (RF) module, which is used for communicating with the internet in a wireless manner.
It will be understood by those of ordinary skill in the art that the structure shown in fig. 13 is illustrative only and is not intended to limit the structure described above. For example, server 1100 may also include more or fewer components than shown in FIG. 13, or have a different configuration than shown in FIG. 13.
The embodiment of the present invention further provides a storage medium, which is a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements each process of the above device control method embodiment, and can achieve the same technical effect, and is not described herein again to avoid repetition. The computer-readable storage medium may be a Read-only memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention or portions thereof contributing to the prior art may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the methods according to the embodiments of the present invention.
While the present invention has been described with reference to the embodiments shown in the drawings, the present invention is not limited to the embodiments, which are illustrative and not restrictive, and it will be apparent to those skilled in the art that various changes and modifications can be made therein without departing from the spirit and scope of the invention as defined in the appended claims.

Claims (16)

1. A device control method is applied to a server, and the method comprises the following steps:
under the condition that the expected state is different from the current state of the shadow device, generating a control instruction according to the expected state;
if the real device corresponding to the shadow device is not in a communicable state, the control instruction is issued to the real device under the condition that the real device is recovered to the communicable state.
2. The device control method according to claim 1, wherein the control instruction carries a timestamp indicating a generation time, and if a real device corresponding to the shadow device is not in a communicable state, the control instruction is issued to the real device when the real device is restored to the communicable state, the method further comprising:
judging whether the type of the control instruction is a first type or not;
if so, judging whether the interval between the timestamp and the current time exceeds a preset time threshold, wherein the first type of control instruction has timeliness;
if the control command exceeds the preset control command, determining that the control command is invalid;
and if the actual equipment is not in the communicable state, the control instruction is issued to the actual equipment under the condition that the actual equipment is recovered to the communicable state.
3. The apparatus control method according to claim 1, wherein the control instruction carries a timestamp indicating a generation time, and if the real apparatus corresponding to the shadow apparatus is in a communicable state, the method further comprises:
judging whether the type of the control instruction is a first type;
if so, judging whether the interval between the timestamp and the current time exceeds a preset time threshold, wherein the first type of control instruction has timeliness;
if the control command exceeds the preset control command, determining that the control command is invalid;
and if not, issuing the control command to the real equipment.
4. The device control method according to claim 1, characterized in that the method further comprises:
judging whether the type of the control instruction is a second type;
if yes, keeping the control instruction continuously effective.
5. The device control method according to claim 1, wherein after generating a control instruction in accordance with the desired state, the method further comprises:
judging whether the real equipment is in a communicable state;
and if the real equipment is in a communicable state, the control instruction is issued to the real equipment.
6. The device control method according to claim 1, wherein before generating a control instruction in accordance with the desired state, the method comprises:
judging whether the expected state is the same as the current state of the shadow device or not;
and if not, generating a control instruction according to the expected state.
7. The device control method of claim 6, prior to determining whether the desired state is the same as a current state of a shadow device, the method comprising:
and generating an expected state according to state change information transmitted by associated equipment or a demand instruction transmitted by a client, wherein the associated equipment is equipment in linkage relation with the real equipment, and the client is a terminal for managing the real equipment.
8. The device control method of claim 6, prior to determining whether the desired state is the same as a current state of a shadow device, the method comprising:
and updating the current state of the shadow device according to the current state uploaded by the real device.
9. A device control method, applied to a real device, the method comprising:
after receiving a control instruction transmitted by a server, switching to an expected state corresponding to the control instruction;
and uploading the current state of the real equipment to the server after the state switching is finished, wherein the current state of the real equipment is used for updating the current state of the corresponding shadow equipment, and the shadow equipment runs on the server.
10. A device control method is applied to an associated device, and comprises the following steps:
and transmitting state change information to a server, wherein the state change information is used for the server to generate an expected state of a shadow device, and the shadow device is the only virtual device of the real device having the linkage relation with the associated device.
11. The equipment control system is characterized by comprising real equipment, associated equipment and a server, wherein the server is in communication connection with the real equipment and the associated equipment respectively, and the associated equipment and the real equipment have a linkage relation;
the associated equipment is used for transmitting state change information to the server;
the server is used for generating an expected state according to the state change information; the control device is also used for generating a control instruction according to the expected state under the condition that the expected state is different from the current state of the shadow device; the shadow device is further configured to issue the control instruction to the real device if the real device corresponding to the shadow device is not in a communicable state and the real device is recovered to the communicable state;
and the real equipment is used for switching to an expected state after receiving the control instruction.
12. An apparatus for controlling a device, applied to a server, the apparatus comprising:
the command generation unit is used for generating a control command according to the expected state under the condition that the expected state is different from the current state of the shadow equipment;
and the issuing unit is used for issuing the control instruction to the real equipment under the condition that the real equipment is recovered to the communicable state if the real equipment corresponding to the shadow equipment is not in the communicable state.
13. An apparatus for controlling a device, applied to a real device, the apparatus comprising:
the execution unit is used for switching to an expected state corresponding to the control instruction after receiving the control instruction transmitted by the server;
and the uploading unit is used for uploading the current state of the real equipment to the server every time the state switching is completed, wherein the current state of the real equipment is used for updating the current state of the corresponding shadow equipment, and the shadow equipment runs on the server.
14. An apparatus for controlling a device, the apparatus being applied to an associated device, the apparatus comprising:
and the transmission unit is used for transmitting state change information to the server, wherein the state change information is used for the server to generate an expected state of a shadow device, and the shadow device is the only virtual device of the real device in linkage relation with the associated device.
15. A server, comprising: a processor and memory for storing one or more programs; the one or more programs, when executed by the processor, implement the method of any of claims 1-10.
16. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-10.
CN202110334894.8A 2021-03-29 2021-03-29 Equipment control method, system, device, server and storage medium Pending CN115134343A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110334894.8A CN115134343A (en) 2021-03-29 2021-03-29 Equipment control method, system, device, server and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110334894.8A CN115134343A (en) 2021-03-29 2021-03-29 Equipment control method, system, device, server and storage medium

Publications (1)

Publication Number Publication Date
CN115134343A true CN115134343A (en) 2022-09-30

Family

ID=83375347

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110334894.8A Pending CN115134343A (en) 2021-03-29 2021-03-29 Equipment control method, system, device, server and storage medium

Country Status (1)

Country Link
CN (1) CN115134343A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116056123A (en) * 2023-03-24 2023-05-02 新华三技术有限公司 Equipment detection method and device, electronic equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104079542A (en) * 2013-03-29 2014-10-01 联想(北京)有限公司 Information processing method and device management server
CN109618202A (en) * 2018-12-24 2019-04-12 深圳创维-Rgb电子有限公司 Control method, TV and the readable storage medium storing program for executing of peripheral hardware
CN110427220A (en) * 2019-06-17 2019-11-08 深圳绿米联创科技有限公司 Configuration method, device, electronic equipment and the storage medium of device command
CN110493270A (en) * 2019-09-25 2019-11-22 北京金茂绿建科技有限公司 Internet of things equipment accesses fused controlling method and device thereof
CN111478965A (en) * 2020-04-07 2020-07-31 四川虹美智能科技有限公司 Method, device and system for processing device shadow

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104079542A (en) * 2013-03-29 2014-10-01 联想(北京)有限公司 Information processing method and device management server
CN109618202A (en) * 2018-12-24 2019-04-12 深圳创维-Rgb电子有限公司 Control method, TV and the readable storage medium storing program for executing of peripheral hardware
CN110427220A (en) * 2019-06-17 2019-11-08 深圳绿米联创科技有限公司 Configuration method, device, electronic equipment and the storage medium of device command
CN110493270A (en) * 2019-09-25 2019-11-22 北京金茂绿建科技有限公司 Internet of things equipment accesses fused controlling method and device thereof
CN111478965A (en) * 2020-04-07 2020-07-31 四川虹美智能科技有限公司 Method, device and system for processing device shadow

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116056123A (en) * 2023-03-24 2023-05-02 新华三技术有限公司 Equipment detection method and device, electronic equipment and storage medium
CN116056123B (en) * 2023-03-24 2023-06-20 新华三技术有限公司 Equipment detection method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN110058889B (en) Application awakening method and device
US7151966B1 (en) System and methodology providing open interface and distributed processing in an industrial controller environment
EP2294487B1 (en) Actuator for hvac systems and method for operating the actuator
US9285800B2 (en) Systems and methods for asynchronous searching and filtering of data
WO2015154495A1 (en) Traffic control method and device
CN109140706B (en) Intelligent control method for air conditioner
WO2016021208A1 (en) Management device, control method for management device, and control method for management system
CN115134343A (en) Equipment control method, system, device, server and storage medium
CN111669304B (en) Intelligent household scene control method and equipment based on edge gateway and storage medium
US9547297B2 (en) Field device and field device software update system therewith
CN112350840A (en) Fault monitoring and repairing method and related equipment
CN111313546A (en) Monitoring operation and maintenance system and method for distribution transformer monitoring terminal and storage medium
CN115406063A (en) Method, device, terminal and storage medium for automatically controlling terminal equipment
CN111813430A (en) Robot cluster intelligent updating and deploying method and system
CN110324217B (en) Equipment triggering control method and device, electronic equipment and storage medium
CN116166306A (en) Dynamic online maintenance method and system for data acquisition platform based on Kafka and Canal
JP2005020989A (en) Power control system for electrical apparatus
CN111610774B (en) Method and system for calculating effective throw ratio, electronic equipment and storage medium
CN114553958A (en) Data migration processing method and device, electronic equipment and storage medium
CN112068451A (en) Household electrical appliance intelligent control system based on Aliyun Internet of things
Maracic et al. Context-aware multi-agent system in machine-to-machine communication
JP2017167845A (en) Communication device, communication system, communication method and program
EP4354240A1 (en) Configuration sourced direct from ethernet advanced physical layer field device
JP2003198590A (en) Multi-protocol gateway and multi-protocol controller
CN113780755B (en) Measuring point scheduling method, device and power management system

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