CN118295310A - Equipment control method, device, equipment and storage medium - Google Patents
Equipment control method, device, equipment and storage medium Download PDFInfo
- Publication number
- CN118295310A CN118295310A CN202410727711.2A CN202410727711A CN118295310A CN 118295310 A CN118295310 A CN 118295310A CN 202410727711 A CN202410727711 A CN 202410727711A CN 118295310 A CN118295310 A CN 118295310A
- Authority
- CN
- China
- Prior art keywords
- controlled
- control command
- state
- control
- attribute
- 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
Links
Classifications
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B19/00—Programme-control systems
- G05B19/02—Programme-control systems electric
- G05B19/04—Programme control other than numerical control, i.e. in sequence controllers or logic controllers
- G05B19/042—Programme control other than numerical control, i.e. in sequence controllers or logic controllers using digital processors
- G05B19/0423—Input/output
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B2219/00—Program-control systems
- G05B2219/20—Pc systems
- G05B2219/25—Pc structure of the system
- G05B2219/25257—Microcontroller
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Automation & Control Theory (AREA)
- Selective Calling Equipment (AREA)
Abstract
本发明涉及物联网技术领域,公开了设备控制方法、装置、设备及存储介质,包括:对设备控制命令中各设备的属性状态与存储的各设备的当前属性状态进行比较,确定第一待控制设备以及第一控制命令;将第一控制命令下发至第一待控制设备,获取第一待控制设备响应于第一控制命令后的第一状态,并比较第一待控制设备的属性状态与第一状态,当设备控制命令中的第一待控制设备的属性状态与第一待控制设备的第一状态一致时,确定对设备控制命令中的所有设备的控制。该方法通过对第一状态和设备控制命令中的属性状态的比较,确定是否完成对设备的控制,减少了响应时间,提升速度,并保证命令响应的准确性,具备灵活性和多样性。
The present invention relates to the technical field of Internet of Things, and discloses a device control method, apparatus, device and storage medium, including: comparing the attribute state of each device in the device control command with the current attribute state of each device stored, determining the first device to be controlled and the first control command; sending the first control command to the first device to be controlled, obtaining the first state of the first device to be controlled after responding to the first control command, and comparing the attribute state of the first device to be controlled with the first state, and when the attribute state of the first device to be controlled in the device control command is consistent with the first state of the first device to be controlled, determining the control of all devices in the device control command. The method determines whether the control of the device is completed by comparing the first state with the attribute state in the device control command, thereby reducing the response time, improving the speed, and ensuring the accuracy of the command response, and has flexibility and diversity.
Description
技术领域Technical Field
本发明涉及物联网技术领域,具体涉及设备控制方法、装置、设备及存储介质。The present invention relates to the technical field of Internet of Things, and in particular to a device control method, apparatus, device and storage medium.
背景技术Background technique
随着智能物联网行业的发展,用户对设备的无线化无感化要求日益增加,智能网关下要挂载的无线射频设备数量和种类都越来越多,不再仅仅是开关、插座等,还有各种可调光调色的灯具、各种窗帘电机、各种暖通控制设备等。由此用户在实际使用中自然而然会产生对多个功能相同或者不同的无线设备一起进行准确控制的需求,并且期望各设备的执行间隔时间能够尽可能地短。With the development of the smart Internet of Things industry, users have an increasing demand for wireless and non-sensitive devices. The number and types of wireless radio frequency devices to be mounted on smart gateways are increasing, no longer just switches and sockets, but also various dimming and color-adjusting lamps, various curtain motors, various HVAC control devices, etc. As a result, users will naturally have the need to accurately control multiple wireless devices with the same or different functions together in actual use, and expect the execution interval of each device to be as short as possible.
智能网关是通过无线射频协议连接的设备,在进行控制命令操作时,就会出现数据丢包的情况从而导致命令无法到达无线射频设备。在控制多个无线设备时,就会要求准确性。通过命令重发机制确保真实可达的无线设备都能执行命令。同样的由于是无线设备,受限于无线射频协议的频段和传输速度,每次对无线设备进行控制时会有一定的通讯时延。相关技术中,对多个设备进行控制时需要依次对设备进行控制且需要等待是否成功响应,或者建立设备群组,之后对群组进行控制,导致控制总时间较长,或限制了多设备控制的多样性,灵活性不够高。The intelligent gateway is a device connected through a wireless radio frequency protocol. When performing control command operations, data packet loss will occur, resulting in the command failing to reach the wireless radio frequency device. When controlling multiple wireless devices, accuracy is required. The command retransmission mechanism ensures that all truly reachable wireless devices can execute commands. Similarly, since it is a wireless device, it is limited by the frequency band and transmission speed of the wireless radio frequency protocol, and there will be a certain communication delay each time the wireless device is controlled. In the related art, when controlling multiple devices, it is necessary to control the devices one by one and wait for a successful response, or to establish a device group and then control the group, resulting in a longer total control time, or limiting the diversity of multi-device control, and the flexibility is not high enough.
发明内容Summary of the invention
有鉴于此,本发明提供了一种设备控制方法、装置、设备及存储介质,以提高多设备控制时的速度以及灵活性。In view of this, the present invention provides a device control method, apparatus, device and storage medium to improve the speed and flexibility of controlling multiple devices.
第一方面,本发明提供了一种设备控制方法,所述方法包括:In a first aspect, the present invention provides a device control method, the method comprising:
获取设备控制命令,并对所述设备控制命令中各设备的属性状态与存储的各设备的当前属性状态进行比较,确定第一待控制设备以及第一控制命令;Acquire a device control command, and compare the attribute state of each device in the device control command with the stored current attribute state of each device to determine a first device to be controlled and a first control command;
基于预设时间间隔将所述第一控制命令下发至所述第一待控制设备,所述第一控制命令用于对所述第一待控制设备进行控制;Sending the first control command to the first device to be controlled based on a preset time interval, where the first control command is used to control the first device to be controlled;
获取所述第一待控制设备响应于所述第一控制命令后的第一状态,并对所述设备控制命令中的第一待控制设备的属性状态与所述第一待控制设备的第一状态进行比较;Acquire a first state of the first device to be controlled after responding to the first control command, and compare the attribute state of the first device to be controlled in the device control command with the first state of the first device to be controlled;
当所述设备控制命令中的第一待控制设备的属性状态与所述第一待控制设备的第一状态一致,确定对所述设备控制命令中的所有设备的控制。When the attribute state of the first device to be controlled in the device control command is consistent with the first state of the first device to be controlled, control of all devices in the device control command is determined.
在一种可选的实施方式中,所述对所述设备控制命令中各设备的属性状态与存储的各设备的当前属性状态进行比较,确定第一待控制设备以及第一控制命令,包括:In an optional implementation, comparing the attribute state of each device in the device control command with the stored current attribute state of each device to determine the first device to be controlled and the first control command includes:
对所述设备控制命令中各设备的各属性对应的状态与存储的各设备的各属性对应的当前状态进行一一对比;Comparing the state corresponding to each attribute of each device in the device control command with the current state corresponding to each attribute of each device stored one by one;
去除所述设备控制命令中无需控制设备所对应的命令,确定第一控制命令以及与所述第一控制命令对应的第一待控制设备,所述无需控制设备的各属性状态与所述设备控制命令中的各属性状态一致。The commands corresponding to the unnecessary controlled devices in the device control commands are removed, a first control command and a first to-be-controlled device corresponding to the first control command are determined, and each attribute state of the unnecessary controlled devices is consistent with each attribute state in the device control commands.
在一种可选的实施方式中,所述确定第一控制命令以及与所述第一控制命令对应的第一待控制设备,包括:In an optional implementation, the determining a first control command and a first to-be-controlled device corresponding to the first control command includes:
对所述设备控制命令中同一设备的不同属性对应的控制命令进行合并,确定第一控制命令以及与所述第一控制命令对应的第一待控制设备。The control commands corresponding to different attributes of the same device in the device control commands are merged to determine a first control command and a first to-be-controlled device corresponding to the first control command.
在一种可选的实施方式中,所述获取所述第一待控制设备响应于所述第一控制命令后的第一状态之后,所述方法还包括:In an optional implementation, after acquiring the first state of the first to-be-controlled device in response to the first control command, the method further includes:
基于接收到的所述第一待控制设备的第一状态,对存储的所述第一待控制设备的当前属性状态进行更新,以存储所述第一待控制设备的第一状态。Based on the received first state of the first device to be controlled, the stored current attribute state of the first device to be controlled is updated to store the first state of the first device to be controlled.
在一种可选的实施方式中,所述方法还包括:In an optional embodiment, the method further includes:
当所述设备控制命令中的第一待控制设备的属性状态与所述第一待控制设备的第一状态不一致,对所述第一待控制设备进行筛选,确定第二待控制设备和第二控制命令;When the attribute state of the first device to be controlled in the device control command is inconsistent with the first state of the first device to be controlled, screening the first device to be controlled to determine a second device to be controlled and a second control command;
将所述第二控制命令发送给所述第二待控制设备,以对所述第二待控制设备进行控制。The second control command is sent to the second device to be controlled to control the second device to be controlled.
在一种可选的实施方式中,所述对所述第一待控制设备进行筛选,确定第二待控制设备和第二控制命令,包括:In an optional implementation manner, screening the first device to be controlled to determine the second device to be controlled and the second control command includes:
去除设备控制命令中属性状态与所述第一状态一致的设备,确定第二待控制设备;Remove the device whose attribute status in the device control command is consistent with the first status, and determine the second device to be controlled;
从所述设备控制命令中提取所述第二待控制设备对应的第二控制命令。A second control command corresponding to the second to-be-controlled device is extracted from the device control command.
在一种可选的实施方式中,所述方法还包括:In an optional embodiment, the method further includes:
当设备的当前属性状态发生变化,基于预设协议接收所述设备的当前属性状态;When the current attribute state of the device changes, receiving the current attribute state of the device based on a preset protocol;
基于所述设备的当前属性状态对存储的所述设备的属性状态进行更新,以存储所述设备的当前属性状态。The stored attribute state of the device is updated based on the current attribute state of the device to store the current attribute state of the device.
第二方面,本发明提供了一种设备控制装置,所述装置包括:In a second aspect, the present invention provides a device control apparatus, the device comprising:
第一命令确定模块,用于获取设备控制命令,并对所述设备控制命令中各设备的属性状态与存储的各设备的当前属性状态进行比较,确定第一待控制设备以及第一控制命令;A first command determination module, used to obtain a device control command, and compare the attribute state of each device in the device control command with the stored current attribute state of each device, to determine a first device to be controlled and a first control command;
第一命令下发模块,用于基于预设时间间隔将所述第一控制命令下发至所述第一待控制设备,所述第一控制命令用于对所述第一待控制设备进行控制;A first command issuing module, configured to issue the first control command to the first device to be controlled based on a preset time interval, wherein the first control command is used to control the first device to be controlled;
命令比较模块,用于获取所述第一待控制设备响应于所述第一控制命令后的第一状态,并对所述设备控制命令中的第一待控制设备的属性状态与所述第一待控制设备的第一状态进行比较;a command comparison module, configured to obtain a first state of the first device to be controlled after responding to the first control command, and compare the attribute state of the first device to be controlled in the device control command with the first state of the first device to be controlled;
控制完成模块,用于当所述设备控制命令中的第一待控制设备的属性状态与所述第一待控制设备的第一状态一致,确定对所述设备控制命令中的所有设备的控制。The control completion module is used to determine the control of all devices in the device control command when the attribute state of the first device to be controlled in the device control command is consistent with the first state of the first device to be controlled.
第三方面,本发明提供了一种计算机设备,包括:存储器和处理器,存储器和处理器之间互相通信连接,存储器中存储有计算机指令,处理器通过执行计算机指令,从而执行上述第一方面或其对应的任一实施方式的设备控制方法。In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the device control method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.
第四方面,本发明提供了一种计算机可读存储介质,该计算机可读存储介质上存储有计算机指令,计算机指令用于使计算机执行上述第一方面或其对应的任一实施方式的设备控制方法。In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the device control method of the first aspect or any corresponding embodiment thereof.
本实施例提供的设备控制方法,获取设备控制命令,对设备控制命令中各设备的属性状态与存储的各设备的当前属性状态进行比较,确定第一待控制设备以及第一控制命令;将第一控制命令下发至第一待控制设备,获取第一待控制设备响应于第一控制命令后的第一状态,并比较设备控制命令中的第一待控制设备的属性状态与第一待控制设备的第一状态,当设备控制命令中的第一待控制设备的属性状态与第一待控制设备的第一状态一致时,确定对设备控制命令中的所有设备的控制。该方法在第一轮发送设备控制命令之后无需等待响应,通过对第一状态和设备控制命令中的属性状态的比较,确定是否完成对设备的控制,在多设备控制时减少了响应时间,提升速度,后续也可以通过比较进行确认,以保证命令响应的准确性,适用于多种设备,具备灵活性和多样性。The device control method provided in this embodiment obtains a device control command, compares the attribute state of each device in the device control command with the current attribute state of each device stored, determines the first device to be controlled and the first control command; sends the first control command to the first device to be controlled, obtains the first state of the first device to be controlled after responding to the first control command, and compares the attribute state of the first device to be controlled in the device control command with the first state of the first device to be controlled. When the attribute state of the first device to be controlled in the device control command is consistent with the first state of the first device to be controlled, determines the control of all devices in the device control command. This method does not need to wait for a response after sending the device control command in the first round. By comparing the first state with the attribute state in the device control command, it determines whether the control of the device is completed. When controlling multiple devices, the response time is reduced and the speed is improved. It can also be confirmed by comparison later to ensure the accuracy of the command response. It is applicable to a variety of devices and has flexibility and diversity.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
为了更清楚地说明本发明具体实施方式或现有技术中的技术方案,下面将对具体实施方式或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施方式,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
图1是根据本发明实施例的设备控制方法的流程示意图;FIG1 is a schematic flow chart of a device control method according to an embodiment of the present invention;
图2是根据本发明实施例的设备控制方法的流程示意图;FIG2 is a schematic flow chart of a device control method according to an embodiment of the present invention;
图3是根据本发明实施例的设备控制装置的结构框图;3 is a structural block diagram of a device control apparatus according to an embodiment of the present invention;
图4是本发明实施例的计算机设备的硬件结构示意图。FIG. 4 is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention.
具体实施方式Detailed ways
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
智能网关是一种联网设备,主要用于连接和控制各种智能终端设备,通过特定的硬件和软件将设备连接到云端、本地服务器和其他设备,实现广域互联和局域互联。可以通过智能网关对所有连接的智能设备进行集中控制,例如,可以通过应用程序远程开关家中的灯光、调节温度等。A smart gateway is a networking device that is mainly used to connect and control various smart terminal devices. It connects devices to the cloud, local servers and other devices through specific hardware and software to achieve wide-area and local-area interconnection. All connected smart devices can be centrally controlled through a smart gateway. For example, you can remotely turn on and off lights and adjust the temperature in your home through an application.
相关技术中,对多个设备控制通常采用如下方式:In the related art, the following methods are usually used to control multiple devices:
(1)按次序对设备单独进行控制,每次控制后需要等待设备是否成功响应,若未响应则需要重发,例如,打开10个开关和打开5个灯光,就需要按照顺序依次发送指定开关和灯光的开关控制命令,并且等待执行成功。这种方法每条控制指令都是指定设备进行控制的,只有当前控制命令指定的设备才会去执行控制,所有设备的控制命令的发送和等待响应加起来的通讯时延累积起来会导致多个设备控制总时间较长,无法保证用户对速度的需求。(1) Control the devices individually in sequence. After each control, you need to wait for the device to respond successfully. If there is no response, you need to resend it. For example, to turn on 10 switches and 5 lights, you need to send the switch control commands of the specified switches and lights in sequence and wait for successful execution. In this method, each control instruction is controlled by a specified device, and only the device specified by the current control command will execute the control. The communication delay of sending control commands for all devices and waiting for responses will accumulate, resulting in a long total control time for multiple devices, which cannot meet the user's demand for speed.
(2)对需要控制的设备建立群组,群组建立完成后,后续操作使用只要对群组进行一次控制命令的单条组播通知,群组内的无线设备可以在收到这条组播通知时执行控制。如果出现设备未成功执行控制命令,组播命令会重新发送。该方法通过组播方式进行群控,只能多设备进行相同的操作,当群组内存在不同类型的设备(例如,灯光和窗帘),组播命令只能设定为对不同种类设备的相同属性进行控制的命令。该方法限制了多设备控制的多样性且灵活性较差。(2) Create a group for the devices that need to be controlled. After the group is established, subsequent operations use a single multicast notification that only sends a control command to the group once. The wireless devices in the group can execute control when they receive this multicast notification. If a device fails to execute the control command successfully, the multicast command will be resent. This method uses multicast to control the group, and can only perform the same operation on multiple devices. When there are different types of devices in the group (for example, lights and curtains), the multicast command can only be set as a command to control the same attributes of different types of devices. This method limits the diversity of multi-device control and has poor flexibility.
基于此,本公开提供了一种设备控制方法,用于解决上述问题。该方法可应用于一种智能网关,智能网关可接收终端的设备控制命令,终端可以为手机、电脑、平板电脑等,用户也可以直接在智能网关上发出设备控制命令。智能网关与其下属的一个或多个无线射频设备之间设定有特定的通讯协议,用于规定通讯机制和状态变化上报机制,无线射频设备可以包括灯具、窗帘等多种家居设备。Based on this, the present disclosure provides a device control method for solving the above problems. The method can be applied to an intelligent gateway, which can receive device control commands from a terminal. The terminal can be a mobile phone, a computer, a tablet computer, etc. The user can also issue device control commands directly on the intelligent gateway. A specific communication protocol is set between the intelligent gateway and one or more wireless radio frequency devices under it, which is used to specify the communication mechanism and the status change reporting mechanism. The wireless radio frequency devices can include a variety of home appliances such as lamps and curtains.
根据本发明实施例,提供了一种设备控制方法实施例,需要说明的是,在附图的流程图示出的步骤可以在诸如一组计算机可执行指令的计算机系统中执行,并且,虽然在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤。According to an embodiment of the present invention, an embodiment of a device control method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
在本实施例中提供了一种设备控制方法,可用于智能网关,图1是根据本发明实施例的设备控制方法的流程图,请参阅图1,该流程包括如下步骤:In this embodiment, a device control method is provided, which can be used for an intelligent gateway. FIG. 1 is a flow chart of a device control method according to an embodiment of the present invention. Please refer to FIG. 1 . The flow chart includes the following steps:
步骤S101,获取设备控制命令,并对设备控制命令中各设备的属性状态与存储的各设备的当前属性状态进行比较,确定第一待控制设备以及第一控制命令。Step S101: Acquire a device control command, and compare the attribute state of each device in the device control command with the stored current attribute state of each device to determine a first device to be controlled and a first control command.
设备控制命令中可以包含一条或多条对各家居设备的控制命令,对同一家居设备可以有多条控制命令,例如:打开灯A并调节灯A的颜色。用户可以直接通过智能网关发出设备控制命令,也可以通过与智能网关进行无线连接的终端发出设备控制命令,终端可以包括电脑、手机、平板电脑等。The device control command may include one or more control commands for each home device. There may be multiple control commands for the same home device, for example, turning on light A and adjusting the color of light A. Users can issue device control commands directly through the smart gateway or through a terminal wirelessly connected to the smart gateway, such as a computer, mobile phone, tablet computer, etc.
智能网关中存储各设备当前最新的属性状态,同一设备可能存在多种属性,每个属性有其对应的状态,所存储的数据形式可以为:A属性-值1,具体例如:灯1 开关(属性1)-开(值1)。The smart gateway stores the latest attribute status of each device. The same device may have multiple attributes, each with its corresponding status. The stored data may be in the form of: A attribute-value 1, for example: Light 1 switch (attribute 1)-on (value 1).
在接收到设备控制命令后,对设备控制命令进行分析,将设备控制命令中每个设备的每个属性以及对应的状态与所存储的当前各属性状态进行一一对比。在设备控制命令中可能存在与当前属性状态一样的命令,相同的命令则无需再下发,不相同的则需要下发,其中不相同的命令为第一控制命令,第一控制命令需要控制的设备为第一待控制设备。可以认为,只要一台设备的任一属性在设备控制命令中与存储的当前属性状态不同,则需要对该属性进行控制,从设备控制命令中提取对该属性控制的命令。After receiving the device control command, the device control command is analyzed, and each attribute and corresponding state of each device in the device control command is compared with the stored current attribute states one by one. There may be commands in the device control command that are the same as the current attribute state. The same commands do not need to be issued again, but different commands need to be issued. The different commands are the first control commands, and the device to be controlled by the first control command is the first device to be controlled. It can be considered that as long as any attribute of a device is different from the stored current attribute state in the device control command, the attribute needs to be controlled, and the command to control the attribute is extracted from the device control command.
步骤S102,基于预设时间间隔将第一控制命令下发至第一待控制设备。Step S102: Sending a first control command to a first device to be controlled based on a preset time interval.
所述第一控制命令用于对所述第一待控制设备进行控制。The first control command is used to control the first device to be controlled.
第一待控制设备可以是一个或多个,当第一待控制设备有多个,在下发第一控制命令时,无需等待某一设备的响应,将第一控制命令全部下发。具体在下发时,可以按照设备顺序依次下发,每个发送给设备的控制命令之间没有间隔,即预设时间间隔为零。进行连续发送,直到全部控制命令发送完成。由于不等待第一待控制设备的响应,因此下发第一控制命令的过程是快速且连续的。The first device to be controlled may be one or more. When there are multiple first devices to be controlled, when issuing the first control command, there is no need to wait for a response from a certain device, and all the first control commands are issued. Specifically, when issuing, the commands can be issued in sequence according to the order of the devices, and there is no interval between each control command sent to the device, that is, the preset time interval is zero. The commands are sent continuously until all the control commands are sent. Since there is no need to wait for the response of the first device to be controlled, the process of issuing the first control command is fast and continuous.
步骤S103,获取第一待控制设备响应于第一控制命令后的第一状态,并对设备控制命令中的第一待控制设备的属性状态与第一待控制设备的第一状态进行比较。Step S103: acquiring a first state of the first device to be controlled after responding to the first control command, and comparing the attribute state of the first device to be controlled in the device control command with the first state of the first device to be controlled.
第一待控制设备接收到第一控制命令后对其进行响应,响应于第一控制命令后属性状态为第一状态,基于设备与智能网关之间的状态上报机制,各设备的第一状态会自动上报给智能网关。第一状态即设备当前最新的属性状态,由于在步骤S102中可能存在未能成功响应第一控制命令的设备,因此智能网关将各设备的第一状态与设备控制命令中各设备的属性状态进行比较。After receiving the first control command, the first device to be controlled responds to it. After responding to the first control command, the attribute state is the first state. Based on the status reporting mechanism between the device and the intelligent gateway, the first state of each device is automatically reported to the intelligent gateway. The first state is the latest attribute state of the device. Since there may be a device that fails to successfully respond to the first control command in step S102, the intelligent gateway compares the first state of each device with the attribute state of each device in the device control command.
步骤S104,当设备控制命令中的第一待控制设备的属性状态与第一待控制设备的第一状态一致,确定对设备控制命令中的所有设备的控制。Step S104: when the attribute state of the first device to be controlled in the device control command is consistent with the first state of the first device to be controlled, determining to control all devices in the device control command.
若所有第一待控制设备的第一状态与设备控制命令中第一待控制设备的属性状态一致,表明第一待控制设备均已按设备控制命令完成响应,确定完成对设备控制命令中所有设备的控制。If the first states of all first devices to be controlled are consistent with the attribute states of the first devices to be controlled in the device control command, it indicates that the first devices to be controlled have completed responding according to the device control command, and it is determined that the control of all devices in the device control command is completed.
本实施例提供的设备控制方法,获取设备控制命令,对设备控制命令中各设备的属性状态与存储的各设备的当前属性状态进行比较,确定第一待控制设备以及第一控制命令;将第一控制命令下发至第一待控制设备,获取第一待控制设备响应于第一控制命令后的第一状态,并比较设备控制命令中的第一待控制设备的属性状态与第一待控制设备的第一状态,当设备控制命令中的第一待控制设备的属性状态与第一待控制设备的第一状态一致时,确定对设备控制命令中的所有设备的控制。该方法在第一轮发送设备控制命令之后无需等待响应,通过对第一状态和设备控制命令中的属性状态的比较,确定是否完成对设备的控制,在多设备控制时减少了响应时间,提升速度,后续也可以通过比较进行确认,以保证命令响应的准确性,适用于多种设备,具备灵活性和多样性。The device control method provided in this embodiment obtains a device control command, compares the attribute state of each device in the device control command with the current attribute state of each device stored, determines the first device to be controlled and the first control command; sends the first control command to the first device to be controlled, obtains the first state of the first device to be controlled after responding to the first control command, and compares the attribute state of the first device to be controlled in the device control command with the first state of the first device to be controlled. When the attribute state of the first device to be controlled in the device control command is consistent with the first state of the first device to be controlled, determines the control of all devices in the device control command. This method does not need to wait for a response after sending the device control command in the first round. By comparing the first state with the attribute state in the device control command, it determines whether the control of the device is completed. When controlling multiple devices, the response time is reduced and the speed is improved. It can also be confirmed by comparison later to ensure the accuracy of the command response. It is applicable to a variety of devices and has flexibility and diversity.
在一些可选的实施方式中,上述步骤S101中对所述设备控制命令中各设备的属性状态与存储的各设备的当前属性状态进行比较,确定第一待控制设备以及第一控制命令,包括如下步骤:In some optional implementations, the step S101 compares the attribute state of each device in the device control command with the stored current attribute state of each device to determine the first device to be controlled and the first control command, including the following steps:
步骤S201,对设备控制命令中各设备的各属性对应的状态与存储的各设备的各属性对应的当前状态进行一一对比;Step S201, comparing the state corresponding to each attribute of each device in the device control command with the current state corresponding to each attribute of each device stored one by one;
智能网关存储有各设备的每个属性对应的当前状态,设备控制命令中可能涉及一个或多个设备,当需要对多个设备进行控制,对设备控制命令中所涉及的设备的各属性状态与存储的各属性的状态进行一一比对。The intelligent gateway stores the current status of each attribute of each device. The device control command may involve one or more devices. When multiple devices need to be controlled, the status of each attribute of the device involved in the device control command is compared one by one with the status of each stored attribute.
步骤S202,去除设备控制命令中无需控制设备所对应的命令,确定第一控制命令以及与所述第一控制命令对应的第一待控制设备。Step S202: remove commands corresponding to unnecessary controlled devices from the device control commands, and determine a first control command and a first to-be-controlled device corresponding to the first control command.
所述无需控制设备的各属性状态与所述设备控制命令中的各属性状态一致。The attribute states of the device that does not need to be controlled are consistent with the attribute states in the device control command.
可能存在设备的当前状态与设备控制命令中的属性状态一致,将这种设备定义为无需控制设备,去除设备控制命令中无需控制设备对应的命令,得到设备控制命令中其他命令为第一控制命令,与第一控制命令对应的为第一待控制设备。There may be a device whose current state is consistent with the attribute state in the device control command. This device is defined as a device that does not need to be controlled. The commands corresponding to the device that does not need to be controlled in the device control command are removed, and the other commands in the device control command are obtained as the first control command, and the device corresponding to the first control command is the first device to be controlled.
本实施例提供的方法通过去除设备控制命令中无需控制设备对应的命令,减少后续进行设备控制时的命令数量,降低发送命令花费的时间,进而提升控制效率。The method provided in this embodiment reduces the number of commands for subsequent device control and the time spent on sending commands by removing commands that are not required to control the device from the device control commands, thereby improving control efficiency.
进一步地,在一些可选的实施方式中,步骤S202包括:对设备控制命令中同一设备的不同属性对应的控制命令进行合并,确定第一控制命令以及与所述第一控制命令对应的第一待控制设备。Further, in some optional implementations, step S202 includes: merging control commands corresponding to different attributes of the same device in the device control command, and determining a first control command and a first to-be-controlled device corresponding to the first control command.
智能网关可以通过一条控制命令对同一无线射频设备的多个属性状态进行控制,在设备控制命令中可能存在多条对同一设备的不同属性的控制命令,在确定第一控制命令之前,可先对同一设备的多条命令进行合并,确保同一设备只对应一条控制命令,经过合并,得到第一控制命令。可避免对同一设备发送多条控制命令,减少了对设备进行控制时所发送的命令数量,提升控制效率。The intelligent gateway can control multiple attribute states of the same wireless radio frequency device through one control command. There may be multiple control commands for different attributes of the same device in the device control command. Before determining the first control command, multiple commands for the same device can be merged to ensure that the same device corresponds to only one control command. After merging, the first control command is obtained. This can avoid sending multiple control commands to the same device, reduce the number of commands sent when controlling the device, and improve control efficiency.
在一些可选的实施方式中,上述步骤S103中获取所述第一待控制设备响应于所述第一控制命令后的第一状态之后,方法还包括:基于接收到的第一待控制设备的第一状态,对存储的第一待控制设备的当前属性状态进行更新,以存储第一待控制设备的第一状态。In some optional embodiments, after obtaining the first state of the first device to be controlled in response to the first control command in the above step S103, the method further includes: updating the stored current attribute state of the first device to be controlled based on the received first state of the first device to be controlled to store the first state of the first device to be controlled.
智能网关与无线射频设备之间有协议规定的设备属性状态变化的上报机制,当设备的属性状态发生变化,会将变化后的状态发送给智能网关,智能网关接收到上报数据后对存储的属性状态进行更新,保证智能网关存储的设备的属性状态与设备当前的属性状态一致。There is a reporting mechanism for device attribute status changes specified by the protocol between the smart gateway and the wireless RF device. When the attribute status of the device changes, the changed status will be sent to the smart gateway. After receiving the reported data, the smart gateway updates the stored attribute status to ensure that the attribute status of the device stored in the smart gateway is consistent with the current attribute status of the device.
在本实施例中,第一待控制设备在接收到第一控制命令并执行完第一控制命令后,其属性状态变为第一状态,由于状态发生变化,会自动触发上报机制,将第一状态发送给智能网关,智能网关对存储的属性状态进行更新。In this embodiment, after the first device to be controlled receives the first control command and executes the first control command, its attribute state changes to the first state. Due to the change in state, the reporting mechanism is automatically triggered to send the first state to the intelligent gateway, and the intelligent gateway updates the stored attribute state.
第一待控制设备可以是一个或多个,当第一待控制设备有多个,多个设备的第一状态都需要上报至智能网关,因此智能网关需要等待一定时间,等待各设备的第一状态都上报完成。具体等待时间可以根据实际应用场景中设备的数量以及无线射频协议的通讯速率进行设定。通常在20个设备以内的控制可以设定等待时间为1秒。The first device to be controlled may be one or more. When there are multiple first devices to be controlled, the first status of multiple devices need to be reported to the intelligent gateway. Therefore, the intelligent gateway needs to wait for a certain period of time until the first status of each device is reported. The specific waiting time can be set according to the number of devices in the actual application scenario and the communication rate of the wireless radio frequency protocol. Usually, the waiting time can be set to 1 second for the control of less than 20 devices.
在一些可选的实施方式中,方法还包括:In some optional embodiments, the method further comprises:
步骤S301,当设备控制命令中的第一待控制设备的属性状态与第一待控制设备的第一状态不一致,对第一待控制设备进行筛选,确定第二待控制设备和第二控制命令。Step S301: When the attribute state of the first device to be controlled in the device control command is inconsistent with the first state of the first device to be controlled, the first device to be controlled is screened to determine a second device to be controlled and a second control command.
由于无线通信过程中会出现信号波动,导致数据丢包,因此可能会存在第一控制命令无法到达第一待控制设备或者第一待控制设备上报的第一状态无法到达智能网关的情况,进而通过对比会出现设备控制命令中的第一待控制设备的属性状态与第一待控制设备的第一状态不一致的情况,则根据此情况对第一待控制设备进行筛选,将第一状态与设备控制命令中属性状态不一致的设备确定为第二待控制设备,以及用于控制第二待控制设备的第二控制命令。Since signal fluctuations may occur during wireless communication, resulting in data packet loss, there may be a situation where the first control command cannot reach the first device to be controlled or the first state reported by the first device to be controlled cannot reach the intelligent gateway. Furthermore, by comparison, it is found that the attribute state of the first device to be controlled in the device control command is inconsistent with the first state of the first device to be controlled. According to this situation, the first device to be controlled is screened, and the device whose first state is inconsistent with the attribute state in the device control command is determined as the second device to be controlled, and the second control command for controlling the second device to be controlled is used.
具体地,上述步骤S301包括:Specifically, the above step S301 includes:
步骤S3011,去除设备控制命令中属性状态与第一状态一致的设备,确定第二待控制设备;Step S3011, removing the device whose attribute state in the device control command is consistent with the first state, and determining the second device to be controlled;
步骤S3012,从设备控制命令中提取第二待控制设备对应的第二控制命令。Step S3012: extracting a second control command corresponding to a second device to be controlled from the device control command.
设备控制命令中属性状态与第一状态一致的设备表示该设备已响应第一待控制命令,去除这些设备,从而可以确定第二待控制设备,从设备控制命令中提取用于控制第二待控制设备的命令,即为第二控制命令。Devices whose attribute states in the device control command are consistent with the first state indicate that the device has responded to the first command to be controlled. By removing these devices, the second device to be controlled can be determined, and the command for controlling the second device to be controlled is extracted from the device control command, which is the second control command.
步骤S302,将第二控制命令发送给第二待控制设备,以对第二待控制设备进行控制。Step S302: Send a second control command to a second device to be controlled to control the second device to be controlled.
通过筛选确定第二控制命令后,将第二控制命令发送给第二待控制设备从而控制第二待控制设备,以确保设备控制命令中的设备均已控制完成。After the second control command is determined by screening, the second control command is sent to the second device to be controlled so as to control the second device to be controlled, thereby ensuring that all devices in the device control command have been controlled.
本实施例提供的方法,筛选出漏控的设备,提取出对应的第二控制命令,进而对第二待控制设备再次进行控制,确保没有遗漏,提升设备控制的准确性。The method provided in this embodiment screens out the missed devices, extracts the corresponding second control commands, and then controls the second device to be controlled again to ensure that there are no omissions and improve the accuracy of device control.
在一些可选的实施方式中,方法还包括:In some optional embodiments, the method further comprises:
步骤S401,当设备的当前属性状态发生变化,基于预设协议接收设备的当前属性状态;Step S401, when the current attribute state of the device changes, the current attribute state of the device is received based on a preset protocol;
步骤S402,基于设备的当前属性状态对存储的设备的属性状态进行更新,以存储设备的当前属性状态。Step S402: updating the stored attribute state of the device based on the current attribute state of the device to store the current attribute state of the device.
智能网关与无线射频设备之间有协议规定的设备属性状态变化的上报机制,当设备的属性状态发生变化,会将变化后的状态发送给智能网关,智能网关接收到上报数据后对存储的属性状态进行更新,保证智能网关存储的设备的属性状态与设备当前的属性状态一致。There is a reporting mechanism for device attribute status changes specified by the protocol between the smart gateway and the wireless RF device. When the attribute status of the device changes, the changed status will be sent to the smart gateway. After receiving the reported data, the smart gateway updates the stored attribute status to ensure that the attribute status of the device stored in the smart gateway is consistent with the current attribute status of the device.
当设备的当前属性状态发生变化,会自动将其当前属性状态发送给智能网关,智能网关接收设备的当前属性状态后,对其存储的设备的属性状态进行更新。When the current property state of the device changes, it will automatically send its current property state to the smart gateway. After the smart gateway receives the current property state of the device, it updates the property state of the device stored in it.
在本实施例中提供了一种设备控制方法的具体实施例,可用于智能网关,该方法流程请参阅图2,具体流程如下:In this embodiment, a specific embodiment of a device control method is provided, which can be used for an intelligent gateway. Please refer to FIG. 2 for the method flow, and the specific flow is as follows:
(1)状态对比(1) Status comparison
智能网关上会保存着所有在线子设备的当前最新的属性状态,那么将控制命令中所要控制各个设备的属性,依次与智能网关上的保存的相应设备的当前属性状态进行对比检查,如果控制执行结果与设备当前状态相同,则去除控制命令中的该属性控制操作,这样就可以一定程度减少后续控制设备命令的发送条数,从而减少发送时间。The smart gateway will save the latest property status of all online sub-devices. The properties of each device to be controlled in the control command will be compared with the current property status of the corresponding device saved on the smart gateway. If the control execution result is the same as the current status of the device, the property control operation in the control command will be removed. This can reduce the number of subsequent control device commands sent to a certain extent, thereby reducing the sending time.
(2)合并命令(2) Merge command
智能网关对同一无线射频子设备的多个属性状态的控制可以使用一条控制命令进行控制,所以可以将多设备控制命令中的重复设备的所有属性进行合并,确保同一设备的控制只有一条控制命令,这样就避免了同一设备发送多条控制命令,同样减少了后续控制设备命令的发送条数,从而减少发送时间。The intelligent gateway can use one control command to control multiple attribute states of the same wireless RF sub-device, so all attributes of repeated devices in the multi-device control command can be merged to ensure that there is only one control command for the control of the same device. This avoids sending multiple control commands for the same device and also reduces the number of subsequent control device commands sent, thereby reducing the sending time.
(3)快速发送(3) Fast delivery
智能网关将经过第一步和第二步处理后剩余的需要控制的设备及其相应所要控制的属性,按照设备依次下发,并且每个发送给设备的控制命令中间间隔不等待,进行连续发送直到全部设备指令发送结束。该步骤由于无需等待设备返回控制结果,所以一轮多个设备控制命令发送完成是快速结束的,从而减少多设备的控制时间。The intelligent gateway will send the remaining devices and their corresponding properties to be controlled after the first and second steps, and send them one by one according to the devices. There is no waiting interval between each control command sent to the device, and it will be sent continuously until all device commands are sent. Since this step does not need to wait for the device to return the control result, a round of multiple device control commands is sent quickly, thereby reducing the control time of multiple devices.
(4)等待状态上报(4) Waiting for status reporting
智能网关与无线射频设备直接有协议规定的设备属性状态变化的上报机制,当设备自身属性出现变化时,就会将变化后的状态上报给智能网关,智能网关接收到上报数据后更新相应上报设备的属性状态信息,由此保证智能网关和无线设备的状态数据是一致的。The smart gateway and the wireless RF device have a direct reporting mechanism for device attribute status changes as specified in the protocol. When the device's own attributes change, the changed status will be reported to the smart gateway. After receiving the reported data, the smart gateway updates the attribute status information of the corresponding reporting device, thereby ensuring that the status data of the smart gateway and the wireless device are consistent.
无线设备在接收并执行完控制命令后,自身的被控制的属性状态会发生改变,然后就会触发上报机制。由于是多个设备在被控制后,各个状态变化都要进行上报,所以智能网关端需要等待一定时间,去等待大部分设备状态的变化上报完成。这个时间可以根据设备数量和无线射频协议的通讯速率自行设定等待时间,基础的20个设备内的控制,可以设定在1秒。After receiving and executing the control command, the wireless device's controlled attribute status will change, and then the reporting mechanism will be triggered. Since multiple devices need to report each status change after being controlled, the smart gateway needs to wait for a certain period of time to wait for most of the device status changes to be reported. This time can be set according to the number of devices and the communication rate of the wireless radio frequency protocol. The basic control of 20 devices can be set to 1 second.
(5)二次对比校验(5) Secondary comparison and verification
由于无线通信过程中会出现信号波动,导致数据丢包的情况,会出现控制命令无法到达设备或者设备上报无法到达智能网关等情况,所以在智能网关等待接收和更新设备状态完成后,需要再进行一次第一步的状态对比操作。Due to signal fluctuations during wireless communication, data packets may be lost, and control commands may not reach the device or device reports may not reach the smart gateway. Therefore, after the smart gateway waits for the device status to be received and updated, the first step of status comparison needs to be performed again.
进行控制命令中的设备属性状态与智能网关更新后的设备属性状态进行对比检查,就可以排查出是否有设备在控制后的状态和控制命令中的目标状态不一致,不一致则为漏控或者数据不同步。By comparing the device attribute status in the control command with the device attribute status after the smart gateway is updated, it is possible to find out whether the status of any device after control is inconsistent with the target status in the control command. Inconsistency means missed control or data is out of sync.
(6)重发确认(6) Resend confirmation
第一步到第四步大部分的设备都基本已经控制完成,第五步中提取的漏控设备数量很少或者是没有,在智能网关和无线射频设备之间信号强度良好的情况下,就会出现没有漏控设备的情况。所以若第五步提取的漏控设备列表为空那么就表示全部设备控制都完成且成功,则不需要再重发确认。若第五步提取的漏控设备列表中存在设备,那么需要将漏控设备的控制命令依次按照基础的应答控制搭配失败重发方式进行发送控制命令,确保漏控设备控制完成。Most of the devices from the first to the fourth step have been basically controlled. The number of missed devices extracted in the fifth step is small or no. When the signal strength between the smart gateway and the wireless RF device is good, there will be no missed devices. Therefore, if the list of missed devices extracted in the fifth step is empty, it means that all device controls have been completed and successful, and no resend confirmation is required. If there are devices in the list of missed devices extracted in the fifth step, the control commands of the missed devices need to be sent in sequence according to the basic response control with failure resend method to ensure that the missed devices are controlled.
上述步骤(1)至(4)用来保证控制的速度,步骤(5)至(6)用来保证准确性。本方法进行设备控制的整体时间对于用户感知是快速并准确的,虽然设备之间控制响应存在先后,但是间隔时间短,给用户的感知差别不大。同时因为控制命令是每个设备单独发送的,所以设备与设备之间并没有关联性,所以多设备控制时可以一个设备开,一个关,一个灯光设备调色彩,一个窗帘设备打开百分之五十等等不一样的操作,保证了多设备控制时的多样性和灵活性。The above steps (1) to (4) are used to ensure the speed of control, and steps (5) to (6) are used to ensure accuracy. The overall time of device control by this method is fast and accurate for the user's perception. Although there is a sequence of control responses between devices, the interval is short and the difference in user perception is not significant. At the same time, because the control command is sent by each device separately, there is no correlation between devices. Therefore, when controlling multiple devices, one device can be turned on and another off, a lighting device can adjust the color, a curtain device can be opened by 50%, and so on. This ensures the diversity and flexibility of multi-device control.
在本实施例中还提供了一种设备控制装置,该装置用于实现上述实施例及实施方式,已经进行过说明的不再赘述。如以下所使用的,术语“模块”可以实现预定功能的软件和/或硬件的组合。尽管以下实施例所描述的装置较佳地以软件来实现,但是硬件,或者软件和硬件的组合的实现也是可能并被构想的。In this embodiment, a device control device is also provided, which is used to implement the above-mentioned embodiments and implementation methods, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and/or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
本实施例提供一种设备控制装置,请参阅图3,包括:This embodiment provides a device control device, see FIG3 , including:
第一命令确定模块501,用于获取设备控制命令,并对所述设备控制命令中各设备的属性状态与存储的各设备的当前属性状态进行比较,确定第一待控制设备以及第一控制命令;A first command determination module 501 is used to obtain a device control command, and compare the attribute state of each device in the device control command with the stored current attribute state of each device to determine a first device to be controlled and a first control command;
第一命令下发模块502,用于基于预设时间间隔将所述第一控制命令下发至所述第一待控制设备,所述第一控制命令用于对所述第一待控制设备进行控制;A first command issuing module 502, configured to issue the first control command to the first device to be controlled based on a preset time interval, wherein the first control command is used to control the first device to be controlled;
命令比较模块503,用于获取所述第一待控制设备响应于所述第一控制命令后的第一状态,并对所述设备控制命令中的第一待控制设备的属性状态与所述第一待控制设备的第一状态进行比较;A command comparison module 503, configured to obtain a first state of the first device to be controlled after responding to the first control command, and compare the attribute state of the first device to be controlled in the device control command with the first state of the first device to be controlled;
控制完成模块504,用于当所述设备控制命令中的第一待控制设备的属性状态与所述第一待控制设备的第一状态一致,确定对所述设备控制命令中的所有设备的控制。The control completion module 504 is configured to determine control of all devices in the device control command when the attribute state of the first device to be controlled in the device control command is consistent with the first state of the first device to be controlled.
在一些可选的实施方式中,第一命令确定模块501包括:In some optional implementations, the first command determination module 501 includes:
第一对比单元,用于对所述设备控制命令中各设备的各属性对应的状态与存储的各设备的各属性对应的当前状态进行一一对比;A first comparison unit, configured to compare the state corresponding to each attribute of each device in the device control command with the current state corresponding to each attribute of each device stored one by one;
第一命令确定单元,用于去除所述设备控制命令中无需控制设备所对应的命令,确定第一控制命令以及与所述第一控制命令对应的第一待控制设备,所述无需控制设备的各属性状态与所述设备控制命令中的各属性状态一致。The first command determination unit is used to remove the commands corresponding to the unnecessary controlled devices in the device control command, determine the first control command and the first to-be-controlled device corresponding to the first control command, and the attribute states of the unnecessary controlled devices are consistent with the attribute states in the device control command.
在一些可选的实施方式中,第一命令确定单元包括:In some optional implementations, the first command determining unit includes:
命令合并子单元,用于对所述设备控制命令中同一设备的不同属性对应的控制命令进行合并,确定第一控制命令以及与所述第一控制命令对应的第一待控制设备。The command merging subunit is used to merge the control commands corresponding to different attributes of the same device in the device control command to determine a first control command and a first to-be-controlled device corresponding to the first control command.
在一些可选的实施方式中,装置还包括:In some optional embodiments, the device further comprises:
状态更新单元,用于基于接收到的所述第一待控制设备的第一状态,对存储的所述第一待控制设备的当前属性状态进行更新,以存储所述第一待控制设备的第一状态。A state updating unit is configured to update the stored current attribute state of the first device to be controlled based on the received first state of the first device to be controlled, so as to store the first state of the first device to be controlled.
在一些可选的实施方式中,装置还包括:In some optional embodiments, the device further comprises:
第二控制命令确定模块,用于当所述设备控制命令中的第一待控制设备的属性状态与所述第一待控制设备的第一状态不一致,对所述第一待控制设备进行筛选,确定第二待控制设备和第二控制命令;a second control command determining module, configured to screen the first device to be controlled and determine a second device to be controlled and a second control command when the attribute state of the first device to be controlled in the device control command is inconsistent with the first state of the first device to be controlled;
第二命令发送模块,用于将所述第二控制命令发送给所述第二待控制设备,以对所述第二待控制设备进行控制。The second command sending module is used to send the second control command to the second device to be controlled, so as to control the second device to be controlled.
在一些可选的实施方式中,第二控制命令确定模块包括:In some optional implementations, the second control command determination module includes:
设备去除单元,用于去除设备控制命令中属性状态与所述第一状态一致的设备,确定第二待控制设备;A device removing unit, configured to remove a device in a device control command whose attribute state is consistent with the first state, and determine a second device to be controlled;
命令提取单元,用于从所述设备控制命令中提取所述第二待控制设备对应的第二控制命令。A command extraction unit is used to extract a second control command corresponding to the second to-be-controlled device from the device control command.
在一些可选的实施方式中,装置还包括:In some optional embodiments, the device further comprises:
属性状态确定模块,用于当设备的当前属性状态发生变化,基于预设协议接收所述设备的当前属性状态;An attribute state determination module, configured to receive the current attribute state of the device based on a preset protocol when the current attribute state of the device changes;
状态存储模块,用于基于所述设备的当前属性状态对存储的所述设备的属性状态进行更新,以存储所述设备的当前属性状态。The state storage module is used to update the stored attribute state of the device based on the current attribute state of the device to store the current attribute state of the device.
上述各个模块和单元的更进一步的功能描述与上述对应实施例相同,在此不再赘述。The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
本实施例中的设备控制装置是以功能单元的形式来呈现,这里的单元是指ASIC(Application Specific Integrated Circuit,专用集成电路)电路,执行一个或多个软件或固定程序的处理器和存储器,和/或其他可以提供上述功能的器件。The device control device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and/or other devices that can provide the above functions.
本发明实施例还提供一种计算机设备,具有上述图3所示的设备控制装置。An embodiment of the present invention further provides a computer device having the device control apparatus shown in FIG. 3 above.
请参阅图4,图4是本发明可选实施例提供的一种计算机设备的结构示意图,该计算机设备包括:一个或多个处理器10、存储器20,以及用于连接各部件的接口,包括高速接口和低速接口。各个部件利用不同的总线互相通信连接,并且可以被安装在公共主板上或者根据需要以其它方式安装。处理器可以对在计算机设备内执行的指令进行处理,包括存储在存储器中或者存储器上以在外部输入/输出装置(诸如,耦合至接口的显示设备)上显示GUI的图形信息的指令。在一些可选的实施方式中,若需要,可以将多个处理器和/或多条总线与多个存储器和多个存储器一起使用。同样,可以连接多个计算机设备,各个设备提供部分必要的操作(例如,作为服务器阵列、一组刀片式服务器、或者多处理器系统)。图4中以一个处理器10为例。Please refer to Figure 4, which is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, and the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components are connected to each other using different buses for communication, and can be installed on a common motherboard or installed in other ways as needed. The processor can process instructions executed in the computer device, including instructions stored in or on the memory to display graphical information of the GUI on an external input/output device (such as a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and/or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). In Figure 4, a processor 10 is taken as an example.
处理器10可以是中央处理器,网络处理器或其组合。其中,处理器10还可以进一步包括硬件芯片。上述硬件芯片可以是专用集成电路,可编程逻辑器件或其组合。上述可编程逻辑器件可以是复杂可编程逻辑器件,现场可编程逻辑门阵列,通用阵列逻辑或其任意组合。The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
其中,所述存储器20存储有可由至少一个处理器10执行的指令,以使所述至少一个处理器10执行实现上述实施例示出的方法。The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.
存储器20可以包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需要的应用程序;存储数据区可存储根据计算机设备的使用所创建的数据等。此外,存储器20可以包括高速随机存取存储器,还可以包括非瞬时存储器,例如至少一个磁盘存储器件、闪存器件、或其他非瞬时固态存储器件。在一些可选的实施方式中,存储器20可选包括相对于处理器10远程设置的存储器,这些远程存储器可以通过网络连接至该计算机设备。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
存储器20可以包括易失性存储器,例如,随机存取存储器;存储器也可以包括非易失性存储器,例如,快闪存储器,硬盘或固态硬盘;存储器20还可以包括上述种类的存储器的组合。The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
该计算机设备还包括通信接口30,用于该计算机设备与其他设备或通信网络通信。The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.
本发明实施例还提供了一种计算机可读存储介质,上述根据本发明实施例的方法可在硬件、固件中实现,或者被实现为可记录在存储介质,或者被实现通过网络下载的原始存储在远程存储介质或非暂时机器可读存储介质中并将被存储在本地存储介质中的计算机代码,从而在此描述的方法可被存储在使用通用计算机、专用处理器或者可编程或专用硬件的存储介质上的这样的软件处理。其中,存储介质可为磁碟、光盘、只读存储记忆体、随机存储记忆体、快闪存储器、硬盘或固态硬盘等;进一步地,存储介质还可以包括上述种类的存储器的组合。可以理解,计算机、处理器、微处理器控制器或可编程硬件包括可存储或接收软件或计算机代码的存储组件,当软件或计算机代码被计算机、处理器或硬件访问且执行时,实现上述实施例示出的方法。The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
虽然结合附图描述了本发明的实施例,但是本领域技术人员可以在不脱离本发明的精神和范围的情况下做出各种修改和变型,这样的修改和变型均落入由所附权利要求所限定的范围之内。Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410727711.2A CN118295310A (en) | 2024-06-06 | 2024-06-06 | Equipment control method, device, equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410727711.2A CN118295310A (en) | 2024-06-06 | 2024-06-06 | Equipment control method, device, equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN118295310A true CN118295310A (en) | 2024-07-05 |
Family
ID=91682602
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202410727711.2A Pending CN118295310A (en) | 2024-06-06 | 2024-06-06 | Equipment control method, device, equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN118295310A (en) |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113254077A (en) * | 2021-06-18 | 2021-08-13 | 深圳市欧瑞博科技股份有限公司 | State control method and device of intelligent equipment, electronic equipment and storage medium |
US20220163932A1 (en) * | 2019-03-28 | 2022-05-26 | Huawei Technologies Co., Ltd. | Device control page display method, related apparatus, and system |
CN114911171A (en) * | 2022-05-25 | 2022-08-16 | 京东科技信息技术有限公司 | A device control method and device |
CN114995183A (en) * | 2022-07-05 | 2022-09-02 | 珠海格力电器股份有限公司 | Instruction processing method, terminal equipment and control system for smart home equipment |
CN116136775A (en) * | 2021-11-16 | 2023-05-19 | 青岛海尔科技有限公司 | Method, device, storage medium and electronic equipment for issuing control commands |
WO2023146826A1 (en) * | 2022-01-25 | 2023-08-03 | Apple Inc. | Message redundancy between user devices |
-
2024
- 2024-06-06 CN CN202410727711.2A patent/CN118295310A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20220163932A1 (en) * | 2019-03-28 | 2022-05-26 | Huawei Technologies Co., Ltd. | Device control page display method, related apparatus, and system |
CN113254077A (en) * | 2021-06-18 | 2021-08-13 | 深圳市欧瑞博科技股份有限公司 | State control method and device of intelligent equipment, electronic equipment and storage medium |
CN116136775A (en) * | 2021-11-16 | 2023-05-19 | 青岛海尔科技有限公司 | Method, device, storage medium and electronic equipment for issuing control commands |
WO2023146826A1 (en) * | 2022-01-25 | 2023-08-03 | Apple Inc. | Message redundancy between user devices |
CN114911171A (en) * | 2022-05-25 | 2022-08-16 | 京东科技信息技术有限公司 | A device control method and device |
CN114995183A (en) * | 2022-07-05 | 2022-09-02 | 珠海格力电器股份有限公司 | Instruction processing method, terminal equipment and control system for smart home equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20220052866A1 (en) | Smart home system control method and apparatus, electronic device | |
CN109547306B (en) | Intelligent household equipment management method and system, intelligent gateway and server | |
CN111522264B (en) | Control method and device of equipment, storage medium and electronic device | |
CN101241364B (en) | Local controller, remote management controller and method for automatically updating the local controller of an air conditioner system | |
CN112291079B (en) | Network service configuration method and network management equipment | |
CN112187531B (en) | Module upgrading method and system, storage medium and electronic device | |
CN114172756A (en) | Version upgrading method and system for intelligent equipment electronic control firmware | |
CN102638590B (en) | Collocation method, air-conditioning system and the indoor apparatus of air conditioner of indoor set address | |
CN112020050A (en) | Networking method of wireless device, gateway device and storage medium | |
WO2023045611A1 (en) | Device control method, apparatus and system, storage medium, and electronic apparatus | |
CN109451354B (en) | Terminal and method for awakening same | |
CN115514667A (en) | Access service processing method, system, device, electronic equipment and storage medium | |
CN118295310A (en) | Equipment control method, device, equipment and storage medium | |
US20160085539A1 (en) | Updating Method and Electronic System thereof | |
CN118921397A (en) | Communication connection method, device, storage device and program product | |
CN114629657B (en) | Cloud billing machine, invoice checking method and storage medium | |
JP2005202518A (en) | adapter | |
CN115268951A (en) | Installation method, device, equipment and storage medium of operating system | |
CN114867041B (en) | A Wi-Fi Portal-based OTA upgrade method, storage medium and air conditioner | |
CN115883287B (en) | Determination method and device of scene operation gateway, storage medium and electronic device | |
CN113453376A (en) | Network configuration method, related device, equipment and storage medium | |
CN115529236B (en) | Lossless network configuration method and device and computer equipment | |
CN115373927B (en) | Product testing method, device, electronic equipment and computer readable medium | |
CN118118286A (en) | Method, device, system, equipment and storage medium for gateway equipment replacement | |
CN112147910A (en) | Method and device for determining execution capacity, storage medium and electronic device |
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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20240705 |
|
RJ01 | Rejection of invention patent application after publication |