WO2023124136A1 - Device control method and apparatus, electronic device, and storage medium - Google Patents

Device control method and apparatus, electronic device, and storage medium Download PDF

Info

Publication number
WO2023124136A1
WO2023124136A1 PCT/CN2022/113942 CN2022113942W WO2023124136A1 WO 2023124136 A1 WO2023124136 A1 WO 2023124136A1 CN 2022113942 W CN2022113942 W CN 2022113942W WO 2023124136 A1 WO2023124136 A1 WO 2023124136A1
Authority
WO
WIPO (PCT)
Prior art keywords
target
control instruction
information
target device
control
Prior art date
Application number
PCT/CN2022/113942
Other languages
French (fr)
Chinese (zh)
Inventor
焦志民
Original Assignee
深圳海翼智新科技有限公司
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 深圳海翼智新科技有限公司 filed Critical 深圳海翼智新科技有限公司
Publication of WO2023124136A1 publication Critical patent/WO2023124136A1/en

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/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
    • H04L67/125Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks involving control of end-device applications over a network
    • GPHYSICS
    • G16INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR SPECIFIC APPLICATION FIELDS
    • G16YINFORMATION AND COMMUNICATION TECHNOLOGY SPECIALLY ADAPTED FOR THE INTERNET OF THINGS [IoT]
    • G16Y10/00Economic sectors
    • G16Y10/80Homes; Buildings
    • GPHYSICS
    • G16INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR SPECIFIC APPLICATION FIELDS
    • G16YINFORMATION AND COMMUNICATION TECHNOLOGY SPECIALLY ADAPTED FOR THE INTERNET OF THINGS [IoT]
    • G16Y40/00IoT characterised by the purpose of the information processing
    • G16Y40/30Control
    • G16Y40/35Management of things, i.e. controlling in accordance with a policy or in order to achieve specified objectives
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72403User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality
    • H04M1/72409User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality by interfacing with external accessories
    • H04M1/72415User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality by interfacing with external accessories for remote control of appliances

Definitions

  • the present disclosure generally relates to the communication field, and more specifically relates to a device control method, device, electronic device, and storage medium.
  • the Internet of Things cloud platform can realize the access, control and management of devices.
  • the device By connecting the device to the IoT cloud platform, remote control and data collection of the device can be realized.
  • the present disclosure provides a device control method, which includes:
  • For a target device set in the device cluster generate a control instruction for the target device set, where the target device set includes a first device and a second device;
  • control device for equipment which includes:
  • a generating module configured to generate a control instruction of the target device set for the target device set in the device cluster, the target device set including the first device and the second device;
  • a sending module configured to send the control instruction to the first device in the target device set, so that the first device, when receiving the control instruction, uses unicast and The method is sent to the second device in the set of target devices at the same time in a multicast manner.
  • the present disclosure provides an electronic device, which includes: a processor and a memory, the processor is configured to execute a device control program stored in the memory, so as to implement the device control method described in the present disclosure.
  • the present disclosure provides a storage medium, the storage medium stores one or more programs, and the one or more programs can be executed by one or more processors, so as to implement the device control method described in the present disclosure .
  • FIG. 1 is an application scenario diagram of a device control method provided by an embodiment of the present disclosure
  • FIG. 2 is a schematic flowchart of a device control method provided by an embodiment of the present disclosure
  • FIG. 3 is a schematic flowchart of another device control method provided by an embodiment of the present disclosure.
  • FIG. 4 is a schematic flowchart of another device control method provided by an embodiment of the present disclosure.
  • FIG. 5 is a schematic structural diagram of a control device of a device provided by an embodiment of the present disclosure.
  • Fig. 6 is a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure.
  • FIG. 1 is an application scenario diagram of a device control method provided by the present disclosure, as shown in FIG. 1 , which includes:
  • a device cluster includes multiple device sets, and each device set includes multiple devices, and each device set includes a first device and a second device.
  • the first device can be understood as the master device in the device set, and the second device A device can be understood as a slave device in the device set; the number of master devices in each device set is one, and the number of slave devices can include one or more.
  • the method also includes:
  • the method also includes:
  • the method also includes:
  • the method also includes:
  • For any of the device sets in the device cluster send target device information to the first device and the second device in the device set, so that the first device and the second The device stores the target device information, where the target device information includes information of all devices in the device set.
  • the step of simultaneously sending the control instruction to the second device in the target device set by unicast and multicast includes:
  • the first device queries the target device information
  • the method also includes:
  • the current state information of the target device set is updated.
  • the device cluster is controlled by an external electronic device, and the electronic device controls one or more device sets in the device cluster at the same time.
  • the first device in the set sends a control command, and when the first device in the target device set receives the control command, it sends the control command to the second device in the same device set in the form of unicast or multicast, using Sending the control command in unicast mode can make the second device quickly receive the control command, and adopting the multicast mode can make all the second devices in the same device set receive the control command, that is, the control commands all cover the second device , using the two methods to send simultaneously can ensure that the second device in the device set can quickly receive the control command and avoid the omission of the control command.
  • the control command when the second device receives the control command for the first time (the control command may be sent by the first device in unicast), the control command is executed; When a control command is received (sent by the first device in the form of multicast), it is judged whether the control command that has been executed or is being executed contains the control command received for the second time, if it is included, then ignore the control command; if it does not include , execute the control instruction.
  • the division may be performed by an external device, or the division may be performed when the devices in the device cluster are deployed, and the division of the device sets may be completed at the same time when the device deployment is completed.
  • an application program is installed on an external device, and deployed devices are added to the application program, and the devices are grouped.
  • the devices in each group are collectively referred to as a device set, and multiple device sets
  • a device cluster is formed, and a master device (first device) and a slave device (second device) are determined in each device set.
  • the devices in the device cluster are grouped according to a preset rule to obtain multiple device sets.
  • the preset rule can be: grouping according to the deployment location of the device, or according to the identification of the device (device ID , device type) to group and so on.
  • the construction of the device set is completed, and the first device and the second device in each set are determined, and the first device in the device set sends the device information in the device set To the electronic device, the information of the device cluster is stored by the electronic device, so as to facilitate subsequent control of the device cluster through the electronic device.
  • each device (first device or second device) in the device set stores information about other devices in the device set except itself, and the device The information may include: IP address, MAC address, device ID, serial number, and response action rules.
  • device set A includes: device 1 (first device), device 2 (second device), device 3 (second device), and device 4 (second device); device 1 locally stores device The device information of 2-4, the device 2 locally stores the device information of devices 1 and 3-4, the device 3 locally stores the device information of devices 1-2, 4, and the device 4 locally stores the device information of devices 1-3.
  • the device when a certain device (first device or second device) in the device set obtains device information that changes (the IP address changes), the device uses unicast and group broadcast to other devices in the device set, so that other devices update the locally stored device information after receiving the changed device information.
  • the electronic device also stores the device information corresponding to each device set in the device cluster, so that when the device set is controlled by the electronic device, the device information can be queried to accurately find the target device cluster to be controlled .
  • the electronic devices involved may be devices such as smart remote controllers, smart phones, and smart bracelets, and the devices in the device cluster may be lamps, cameras, etc., and the devices in the device cluster may include one or Various.
  • all lamps installed in a certain building area can be used as a device cluster, and all lamps and all cameras installed in a certain building area can also be used as a device cluster.
  • FIG. 2 is a schematic flowchart of a method for controlling equipment provided by an embodiment of the present disclosure. As shown in FIG. 2 , the method includes:
  • the corresponding target device set is queried through the device information locally stored in the electronic device, and corresponding control instructions are generated for the target device set.
  • the target device set includes a first device and a second device.
  • the first device can be understood as a master device in the target device set for data interaction with electronic devices, and the second device can be understood as a slave device, that is, A control instruction forwarded by the first device is received.
  • the electronic device sends the control instruction to the first device in the target device set, and the first device adopts the unicast and multicast methods to simultaneously unicast and multicast the control instruction according to the device information corresponding to the target device set stored locally. Sent to the second device in the set of target devices.
  • the first device after the first device finishes sending the control command, the first device executes the control command, and when the second device receives the second control command, the second device executes the control command, so as to realize electronic The linkage control of the device to the first device and the second device in the target device set.
  • Using unicast to send the control command can make the second device quickly receive the control command, and using multicast can make all the second devices in the same device set receive the control command, that is, the control command covers all the second devices. equipment.
  • the device control method provided by the embodiments of the present disclosure generates a control instruction of the target device set for the target device set in the device cluster, and the target device set includes the first device and the second device; sending an instruction to the first device in the set of target devices, so that the first device, when receiving the control instruction, simultaneously sends the control instruction to the
  • the second device in the target device set adopting two methods of simultaneous sending can ensure that the second device in the device set can receive the control command quickly, and avoid the omission of the control command, thereby realizing rapid response among multiple devices.
  • the method for controlling the device in this embodiment will be introduced below by taking the electronic device as an example of a smart phone and the device as an example of a smart lamp.
  • the smart lamp is deployed in the building area, and the deployment location can be the front door position, the garage position, the fence position, the back door position, etc. of the building area.
  • the smart lamp is equipped with a WI-FI module, through which the smart The lights are connected to a wireless access point (AP).
  • AP wireless access point
  • the above-mentioned intelligent lamps are grouped, and the preset rule of grouping can be grouped according to the deployment position of the intelligent lamps (for example, the intelligent lamps in the area in front of the door are divided into equipment set 1, and the intelligent lamps in the garage area are divided into equipment set 2 etc.), after the grouping is completed, select a device from each group as the master device (the first device), and the rest of the devices in the group are slave devices (the second device); the preset rule of the grouping can also be based on The device types of smart lamps are grouped (for example, multiple smart lamps of 20W installed in a certain location are divided into device set 1, and multiple smart lamps of 10W installed in another location are divided into device set 2, etc.).
  • the target device information is sent to the first device and the second device in the device set, so that the first device The first device and the second device store the target device information, where the target device information includes information of all devices in the device set.
  • the target device information in the same group is synchronized to each smart lamp through the APP, so that each smart lamp stores the device information of other smart lamps in the group.
  • the target device information can be: device IP address, MAC address, device ID, serial number, and response action rules.
  • the response action rules can be the rules when the device executes the control command.
  • the response action rule can be that the smart lamps in the group are turned on sequentially in the order of 1-N.
  • FIG. 3 is a schematic flowchart of another device control method provided by an embodiment of the present disclosure. As shown in FIG. 3 , the method includes:
  • the first device in the device set sends a network detection message to the second device in the device set, so as to perform the communication between the first device and the network status detection between the second devices;
  • the second device When it is determined that the second device has received the network detection message, the second device returns a response message of the network detection message to the first device, and then determine the relationship between the first device and the second device The network status between is normal;
  • the first device in each device set executes the step of network state detection, predetermines a time threshold (for example, 2min), and every interval of the time threshold , the first device performs a network status detection, and the specific process of detection may be: the first device periodically sends a network detection message to the second device in the device set, so that the second device returns a response message in response to the network detection message, In this way, the network reachability between the first device and the second device is judged.
  • a time threshold for example, 2min
  • the first device performs a network status detection
  • the specific process of detection may be: the first device periodically sends a network detection message to the second device in the device set, so that the second device returns a response message in response to the network detection message, In this way, the network reachability between the first device and the second device is judged.
  • the second device when it is determined that the second device has received the network detection message, the second device returns a response message of the network detection message to the first device, and then it is determined that the first device and the second device The state of the network between them is normal, that is, the network between the first device and the second device is normal.
  • the first device When it is determined that the first device has not received the response message of the network detection message returned by the second device, that is, the network between the first device and the second device is unreachable (the first device and the second device network abnormality between), update the device state of the second device that does not return the response message (update the device state table locally stored by the first device for representing the second device), and update the second device
  • the device status of the second device is changed from online to offline.
  • the second device when the network between the first device and the second device is unreachable, it can be understood that the second device is in an offline state at this time, and when the second device is online again (that is, in the next network state detection period, it will report to the first device).
  • the device returns a response message), updates the device status of the second device again, and changes the device status of the second device from offline to online.
  • the second device When it is determined that the second device has not received the network detection message within a preset time (the preset time may be greater than or equal to a time threshold), it is determined that the first device is offline, and the first device is re-determined from the second device , to update the first device in the target device set.
  • the preset time may be greater than or equal to a time threshold
  • the detection of the second device can be improved. 1. Accuracy of equipment network status judgment to avoid misjudgment.
  • the re-determined first device updates the locally stored device information and synchronizes the updated device information to the devices in the same device set. Secondary equipment, and electronic equipment.
  • the first device that goes back online when the first device that is offline comes back online, the first device that goes back online can be re-determined as the first device in the device set, or the first device that goes back online can also be set to For the second device, after performing the above operations, update the device information synchronously.
  • the first device or the second device whose device information has changed will synchronize the latest device information to the device information in the device collection. Other devices, so that other devices update the locally stored device information.
  • FIG. 4 is a schematic flowchart of another device control method provided by an embodiment of the present disclosure. As shown in FIG. 4 , the method includes:
  • the first device queries the target device information
  • the target device information is the device information of all devices (the first device and the second device) in the target device set, and S41-S43 are similar to S21-S22 in FIG. 2 , and are not described here for brevity. repeat.
  • control instruction may be a control instruction for controlling all devices in the target device set, or a control instruction for controlling some devices in the target device set.
  • the control instruction When the control instruction is a part of the control target device set, the control instruction carries the device identifier (for example, device ID) that executes the control instruction, and when the first device receives the first control instruction, it starts from the first control instruction.
  • the device identifier is obtained by parsing the instruction, and the second device corresponding to the device identifier is selected from the target device information, and sent to the second device corresponding to the device identifier in a unicast or multicast manner.
  • the first device and the second device when the first device and the second device receive the control instruction, execute the control instruction, and send a corresponding execution result to the electronic device, so that the electronic device updates the state information corresponding to the target device set.
  • an opening command for controlling the garage-smart lamps is generated on the APP of the smart phone (this operation can be voice input or manually triggered), and the smart phone sends the control command to the master device in the garage-smart lamps collection , the master device will use the form of unicast and multicast to send the control command to the slave devices in the garage-smart lamp collection.
  • the master device and the slave device finish executing the control command, they will send an enabled execution result message to the smart phone. After receiving the execution result message, the smart phone will update the status information corresponding to the garage-smart lighting set from off to on. .
  • the device control method provided by the embodiments of the present disclosure generates a control instruction of the target device set for the target device set in the device cluster, and the target device set includes the first device and the second device; sending an instruction to the first device in the set of target devices, so that the first device, when receiving the control instruction, simultaneously sends the control instruction to the
  • the second device in the target device set adopting two methods of simultaneous sending can ensure that the second device in the device set can receive the control command quickly, and avoid the omission of the control command, thereby realizing rapid response among multiple devices.
  • the device control method provided by the embodiments of the present disclosure generates a control instruction of the target device set for the target device set in the device cluster, and the target device set includes the first device and the second device; sending an instruction to the first device in the set of target devices, so that the first device, when receiving the control instruction, simultaneously sends the control instruction to the
  • the second device in the target device set adopting two methods of simultaneous sending can ensure that the second device in the device set can receive the control command quickly, and avoid the omission of the control command, thereby realizing rapid response among multiple devices.
  • Fig. 5 is a schematic structural diagram of the control device 50 of the equipment provided by the embodiment of the present disclosure. As shown in Fig. 5, it includes:
  • the generation module 51 is configured to generate a control instruction of the target device set for the target device set in the device cluster, the target device set includes the first device and the second device;
  • the sending module 52 is configured to send the control instruction to the first device in the target device set, so that when the first device receives the control instruction, it uses unicast and simultaneously send to the second device in the target device set in a multicast manner.
  • the device control device 50 provided in this embodiment may be the device control device as shown in FIG. 5 , which can execute all the steps of the device control method in the present disclosure, and then realize the control method of the device shown in the present disclosure.
  • FIGS. 2-4 please refer to the relevant descriptions in FIGS. 2-4 , which are not described here for brevity.
  • FIG. 6 is a schematic structural diagram of an electronic device 600 provided by an embodiment of the present disclosure.
  • the electronic device 600 shown in FIG. 6 includes: at least one processor 601 , memory 602 , at least one network interface 604 and other user interfaces 603 .
  • Various components in the electronic device 600 are coupled together through a bus system 605 .
  • the bus system 605 is used to realize connection and communication between these components.
  • the bus system 605 also includes a power bus, a control bus and a status signal bus.
  • the various buses are labeled as bus system 605 in FIG. 6 for clarity of illustration.
  • the user interface 603 may include a display, a keyboard or a pointing device (for example, a mouse, a trackball (trackball), a touch panel or a touch screen, and the like.
  • a keyboard or a pointing device for example, a mouse, a trackball (trackball), a touch panel or a touch screen, and the like.
  • the memory 602 in the embodiment of the present disclosure may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories.
  • the non-volatile memory can be read-only memory (Read-Only Memory, ROM), programmable read-only memory (Programmable ROM, PROM), erasable programmable read-only memory (Erasable PROM, EPROM), electronically programmable Erase Programmable Read-Only Memory (Electrically EPROM, EEPROM) or Flash.
  • the volatile memory can be Random Access Memory (RAM), which acts as external cache memory.
  • RAM Static Random Access Memory
  • SRAM Static Random Access Memory
  • DRAM Dynamic Random Access Memory
  • Synchronous Dynamic Random Access Memory Synchronous Dynamic Random Access Memory
  • SDRAM double data rate synchronous dynamic random access memory
  • Double Data Rate SDRAM DDRSDRAM
  • enhanced SDRAM ESDRAM
  • Synch link DRAM SLDRAM
  • Direct Memory Bus Random Access Memory Direct Rambus RAM, DRRAM
  • the memory 602 described herein is intended to include, but is not limited to, these and any other suitable types of memory.
  • the memory 602 stores the following elements, executable units or data structures, or a subset thereof, or an extension thereof: an operating system 6021 and an application program 6022 .
  • the operating system 6021 includes various system programs, such as framework layer, core library layer, driver layer, etc., for realizing various basic services and processing hardware-based tasks.
  • the application program 6022 includes various application programs, such as a media player (Media Player), a browser (Browser), etc., and is used to realize various application services. Programs for realizing the methods of the embodiments of the present disclosure may be included in the application program 6022 .
  • the processor 601 by calling the program or instruction stored in the memory 602, which may be the program or instruction stored in the application program 6022, the processor 601 is used to execute the method steps provided by the embodiments of the present disclosure, which includes:
  • a target device set in a device cluster For a target device set in a device cluster, generate a control instruction of the target device set, where the target device set includes a first device and a second device; and send the control instruction to the target device set in the target device set.
  • the first device so that when the first device receives the control instruction, it simultaneously sends the control instruction to the second device in the target device set in a unicast and multicast manner.
  • the second device during the network status detection process between the first device and the second device, it is judged whether the second device has received the network detection message sent by the first device; When the second device does not receive the network detection message, re-determine the first device from the second device, so as to update the first device in the target device set.
  • the device status of the second device that has not returned the response message is updated .
  • the devices in the device cluster are grouped according to preset rules to obtain multiple device sets; and the corresponding first device and second device in each of the device sets are determined.
  • the target device information is sent to the first device and the second device in the device set, so that the first device The first device and the second device store the target device information, where the target device information includes information of all devices in the device set.
  • the first device queries the target device information; based on the target device information, the control instruction is sent to the second device in the target device set in a unicast or multicast manner .
  • the first execution result returned by the first device for indicating execution of the control instruction is received; after the second device executes the After the control instruction, receive the second execution result returned by the second device for instructing to execute the control instruction; based on the first execution result and the second execution result, the current set of target devices Status information is updated.
  • the methods provided by the foregoing embodiments of the present disclosure may be applied to the processor 601 or implemented by the processor 601 .
  • the processor 601 may be an integrated circuit chip and has signal processing capability. In the implementation process, each step of the above method may be completed by an integrated logic circuit of hardware in the processor 601 or instructions in the form of software.
  • the above-mentioned processor 601 may be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a ready-made programmable gate array (Field Programmable Gate Array, FPGA) or other Programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
  • a general-purpose processor may be a microprocessor, or the processor may be any conventional processor, or the like.
  • the steps of the methods disclosed in the embodiments of the present disclosure may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software units in the decoding processor.
  • the software unit may be located in a mature storage medium in the field such as random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, register.
  • the storage medium is located in the memory 602, and the processor 601 reads the information in the memory 602, and completes the steps of the above method in combination with its hardware.
  • the processing unit can be implemented in one or more application specific integrated circuits (Application Specific Integrated Circuits, ASIC), digital signal processor (Digital Signal Processing, DSP), digital signal processing device (DSP Device, DSPD), programmable Logic device (Programmable Logic Device, PLD), Field-Programmable Gate Array (Field-Programmable Gate Array, FPGA), general-purpose processor, controller, microcontroller, microprocessor, other devices used to perform the functions described in this application electronic unit or its combination.
  • ASIC Application Specific Integrated Circuits
  • DSP Digital Signal Processing
  • DSP Device digital signal processing device
  • DSPD digital signal processing device
  • PLD programmable Logic Device
  • Field-Programmable Gate Array Field-Programmable Gate Array
  • FPGA Field-Programmable Gate Array
  • the electronic device provided in this embodiment may be the electronic device shown in Figure 6, which can execute all the steps of the device control method in the present disclosure, and then realize the technical effect of the device control method shown in the present disclosure, please refer to Figure 2 -4 Relevant descriptions are for brevity and will not be repeated here.
  • the embodiment of the present disclosure also provides a storage medium (computer-readable storage medium).
  • the storage medium here stores one or more programs.
  • the storage medium may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a read-only memory, a flash memory, a hard disk or a solid-state disk; the memory may also include the above-mentioned types of memory combination.
  • One or more programs in the storage medium can be executed by one or more processors, so as to implement the above-mentioned device control method executed on the control device side of the device.
  • the processor is used to execute the control program of the device stored in the memory, so as to realize the following steps of the device control method executed on the control device side of the device:
  • a target device set in a device cluster For a target device set in a device cluster, generate a control instruction of the target device set, where the target device set includes a first device and a second device; and send the control instruction to the target device set in the target device set.
  • the first device so that when the first device receives the control instruction, it simultaneously sends the control instruction to the second device in the target device set in a unicast and multicast manner.
  • the second device during the network status detection process between the first device and the second device, it is judged whether the second device has received the network detection message sent by the first device; When the second device does not receive the network detection message, re-determine the first device from the second device, so as to update the first device in the target device set.
  • the device status of the second device that has not returned the response message is updated .
  • the devices in the device cluster are grouped according to preset rules to obtain multiple device sets; and the corresponding first device and second device in each of the device sets are determined.
  • the target device information is sent to the first device and the second device in the device set, so that the first device The first device and the second device store the target device information, where the target device information includes information of all devices in the device set.
  • the first device queries the target device information; based on the target device information, the control instruction is sent to the second device in the target device set in a unicast or multicast manner .
  • the first device executes the control instruction, receiving a first execution result returned by the first device for indicating execution of the control instruction; after the second device executes the After the control instruction, receive the second execution result returned by the second device for instructing to execute the control instruction; based on the first execution result and the second execution result, the current set of target devices Status information is updated.
  • RAM random access memory
  • ROM read-only memory
  • EEPROM electrically programmable ROM
  • EEPROM electrically erasable programmable ROM
  • registers hard disk, removable disk, CD-ROM, or any other Any other known storage medium.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computing Systems (AREA)
  • Signal Processing (AREA)
  • General Business, Economics & Management (AREA)
  • Business, Economics & Management (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Architecture (AREA)
  • Human Computer Interaction (AREA)
  • Health & Medical Sciences (AREA)
  • Civil Engineering (AREA)
  • Structural Engineering (AREA)
  • Medical Informatics (AREA)
  • Accounting & Taxation (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • General Health & Medical Sciences (AREA)
  • Automatic Disk Changers (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The present application provides a device control method and apparatus, an electronic device, and a storage medium. The control method comprises: for a target device set in a device cluster, generating a control instruction of the target device set, wherein the target device set comprises a first device and a second device; and sending the control instruction to the first device in the target device set, so that upon receipt of the control instruction, the first device sends the control instruction to the second device in the target device set in a unicast manner and in a multicast manner at the same time.

Description

设备的控制方法、装置、电子设备及存储介质Device control method, device, electronic device, and storage medium
相关申请的引用References to related applications
本公开要求于2021年12月31日向中国人民共和国国家知识产权局提交的申请号为202111682832.2、发明名称为“设备的控制方法、装置、电子设备及存储介质”的发明专利的优先权,并通过引用的方式将其全部内容并入本公开。This disclosure claims the priority of the invention patent with the application number 202111682832.2 and the invention name "equipment control method, device, electronic equipment and storage medium" submitted to the State Intellectual Property Office of the People's Republic of China on December 31, 2021, and passed The entire content thereof is incorporated into this disclosure by reference.
领域field
本公开大体上涉及通信领域,更具体地涉及设备的控制方法、装置、电子设备及存储介质。The present disclosure generally relates to the communication field, and more specifically relates to a device control method, device, electronic device, and storage medium.
背景background
随着物联网技术的应用日益广泛,物联网云平台可以实现设备的接入、控制和管理。通过将设备接入物联网云平台,实现对设备的远程控制和数据采集。With the increasingly widespread application of Internet of Things technology, the Internet of Things cloud platform can realize the access, control and management of devices. By connecting the device to the IoT cloud platform, remote control and data collection of the device can be realized.
概述overview
第一方面,本公开提供设备的控制方法,其包括:In a first aspect, the present disclosure provides a device control method, which includes:
针对设备集群中的目标设备集合,生成所述目标设备集合的控制指令,所述目标设备集合中包括第一设备和第二设备;以及For a target device set in the device cluster, generate a control instruction for the target device set, where the target device set includes a first device and a second device; and
将所述控制指令发送给所述目标设备集合中的所述第一设备,以使所述第一设备在接收到所述控制指令时,将所述控制指令采用单播和组播的方式同时发送给所述目标设备集合中的所述第二设备。sending the control instruction to the first device in the set of target devices, so that the first device, when receiving the control instruction, simultaneously broadcasts the control instruction in a unicast and multicast manner sent to the second device in the target device set.
第二方面,本公开提供设备的控制装置,其包括:In a second aspect, the present disclosure provides a control device for equipment, which includes:
生成模块,配置为针对设备集群中的目标设备集合,生成所述目标设备集合的控制指令,所述目标设备集合中包括第一设备和第二设 备;A generating module configured to generate a control instruction of the target device set for the target device set in the device cluster, the target device set including the first device and the second device;
发送模块,配置为将所述控制指令发送给所述目标设备集合中的所述第一设备,以使所述第一设备在接收到所述控制指令时,将所述控制指令采用单播和组播的方式同时发送给所述目标设备集合中的所述第二设备。A sending module, configured to send the control instruction to the first device in the target device set, so that the first device, when receiving the control instruction, uses unicast and The method is sent to the second device in the set of target devices at the same time in a multicast manner.
第三方面,本公开提供电子设备,其包括:处理器和存储器,所述处理器用于执行所述存储器中存储的设备的控制程序,以实现本公开所述的设备的控制方法。In a third aspect, the present disclosure provides an electronic device, which includes: a processor and a memory, the processor is configured to execute a device control program stored in the memory, so as to implement the device control method described in the present disclosure.
第四方面,本公开提供存储介质,所述存储介质存储有一个或者多个程序,所述一个或者多个程序可被一个或者多个处理器执行,以实本公开所述的设备的控制方法。In a fourth aspect, the present disclosure provides a storage medium, the storage medium stores one or more programs, and the one or more programs can be executed by one or more processors, so as to implement the device control method described in the present disclosure .
附图简要说明Brief description of the drawings
图1为本公开一实施例提供的设备的控制方法的应用场景图;FIG. 1 is an application scenario diagram of a device control method provided by an embodiment of the present disclosure;
图2为本公开一实施例提供的设备的控制方法的流程示意图;FIG. 2 is a schematic flowchart of a device control method provided by an embodiment of the present disclosure;
图3为本公开一实施例提供的另一设备的控制方法的流程示意图;FIG. 3 is a schematic flowchart of another device control method provided by an embodiment of the present disclosure;
图4为本公开一实施例提供的又一设备的控制方法的流程示意图;FIG. 4 is a schematic flowchart of another device control method provided by an embodiment of the present disclosure;
图5为本公开实施例提供的设备的控制装置的结构示意图;以及FIG. 5 is a schematic structural diagram of a control device of a device provided by an embodiment of the present disclosure; and
图6为本公开一实施例提供的电子设备的结构示意图。Fig. 6 is a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure.
详述detail
为使本公开实施例的目的、技术方案和优点更加清楚,下面将结合本公开实施例中的附图,对本公开实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本公开一部分实施例,而不是全部的实施例。基于本公开中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本公开保护 的范围。In order to make the purpose, technical solutions and advantages of the embodiments of the present disclosure clearer, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments It is a part of the embodiments of the present disclosure, but not all of them. Based on the embodiments in the present disclosure, all other embodiments obtained by persons of ordinary skill in the art without creative efforts fall within the protection scope of the present disclosure.
为便于对本公开实施例的理解,下面将结合附图以实施例做进一步的解释说明,实施例并不构成对本公开实施例的限定。In order to facilitate the understanding of the embodiments of the present disclosure, further explanations will be made below with reference to the accompanying drawings, and the embodiments are not intended to limit the embodiments of the present disclosure.
图1为本公开提供的设备的控制方法的应用场景图,如图1所示,其包括:FIG. 1 is an application scenario diagram of a device control method provided by the present disclosure, as shown in FIG. 1 , which includes:
设备集群中包括多个设备集合,每个设备集合中包括多个设备,且每个设备集合中包括第一设备和第二设备,第一设备可以理解为该设备集合中的主设备,第二设备可以理解为该设备集合中的从设备;对于每个设备集合中的主设备的数量为一个,从设备的数量可以包括一个或多个。A device cluster includes multiple device sets, and each device set includes multiple devices, and each device set includes a first device and a second device. The first device can be understood as the master device in the device set, and the second device A device can be understood as a slave device in the device set; the number of master devices in each device set is one, and the number of slave devices can include one or more.
在某些实施方案中,所述方法还包括:In some embodiments, the method also includes:
在所述第一设备与所述第二设备之间的网络状态检测过程中,判断所述第二设备是否接收到所述第一设备发送的网络检测消息;以及During the network status detection process between the first device and the second device, judging whether the second device has received a network detection message sent by the first device; and
在确定所述第二设备未接收到所述网络检测消息时,从所述第二设备中重新确定第一设备,以对所述目标设备集合中的第一设备进行更新。When it is determined that the second device has not received the network detection message, re-determining the first device from the second device, so as to update the first device in the target device set.
在某些实施方案中,所述方法还包括:In some embodiments, the method also includes:
在确定所述第一设备未接收到第二设备返回的所述网络检测消息的响应消息时,对未返回所述响应消息的所述第二设备的设备状态进行更新。When determining that the first device has not received the response message of the network detection message returned by the second device, update the device status of the second device that has not returned the response message.
在某些实施方案中,所述方法还包括:In some embodiments, the method also includes:
按照预设规则对所述设备集群中的设备进行分组,得到多个设备集合;以及grouping devices in the device cluster according to preset rules to obtain multiple device sets; and
确定每个所述设备集合中对应的第一设备和第二设备。Determine the corresponding first device and second device in each of the device sets.
在某些实施方案中,所述方法还包括:In some embodiments, the method also includes:
针对所述设备集群中的任一所述设备集合,将目标设备信息发送 至所述设备集合中的所述第一设备和所述第二设备,以使所述第一设备和所述第二设备对所述目标设备信息进行存储,所述目标设备信息包括所述设备集合中全部设备的信息。For any of the device sets in the device cluster, send target device information to the first device and the second device in the device set, so that the first device and the second The device stores the target device information, where the target device information includes information of all devices in the device set.
在某些实施方案中,所述将所述控制指令采用单播和组播的方式同时发送给所述目标设备集合中的所述第二设备的步骤包括:In some embodiments, the step of simultaneously sending the control instruction to the second device in the target device set by unicast and multicast includes:
所述第一设备查询所述目标设备信息;以及the first device queries the target device information; and
基于所述目标设备信息将所述控制指令采用单播和组播的方式发送给所述目标设备集合中的第二设备。Sending the control instruction to the second device in the target device set in a unicast or multicast manner based on the target device information.
在某些实施方案中,所述方法还包括:In some embodiments, the method also includes:
在所述第一设备执行所述控制指令后,接收所述第一设备返回的用于指示执行所述控制指令的第一执行结果;After the first device executes the control instruction, receiving a first execution result returned by the first device for indicating execution of the control instruction;
在所述第二设备执行所述控制指令后,接收所述第二设备返回的用于指示执行所述控制指令的第二执行结果;以及After the second device executes the control instruction, receiving a second execution result returned by the second device for indicating execution of the control instruction; and
基于所述第一执行结果和所述第二执行结果,对所述目标设备集合的当前状态信息进行更新。Based on the first execution result and the second execution result, the current state information of the target device set is updated.
在某些实施方案中,该设备集群通过外部的电子设备进行控制,该电子设备对设备集群中的一个或多个设备集合同时进行控制,在需要对某个目标设备集合时,向该目标设备集合中的第一设备发送控制指令,该目标设备集合中的第一设备在接收到控制指令时,采用单播和组播的形式将该控制指令发送给同一设备集合中的第二设备,采用单播的方式发送控制指令可以使第二设备快速收到该控制指令,采用组播的方式可使同一设备集合中的第二设备全部收到该控制指令,也即控制指令全部覆盖第二设备,采用两种方式同发可保证设备集合内的第二设备既快速收到控制指令,又避免控制指令的遗漏。In some embodiments, the device cluster is controlled by an external electronic device, and the electronic device controls one or more device sets in the device cluster at the same time. The first device in the set sends a control command, and when the first device in the target device set receives the control command, it sends the control command to the second device in the same device set in the form of unicast or multicast, using Sending the control command in unicast mode can make the second device quickly receive the control command, and adopting the multicast mode can make all the second devices in the same device set receive the control command, that is, the control commands all cover the second device , using the two methods to send simultaneously can ensure that the second device in the device set can quickly receive the control command and avoid the omission of the control command.
在某些实施方案中,在第二设备第一次收到控制指令时(该控制指令可以是第一设备采用单播的形式发送的),执行该控制指令;在第二设备第二次收到控制指令时(第一设备采用组播的形式发送的),判断已 执行或正执行的控制指令是否包含该第二次收到的控制指令,若包括,则忽略该控制指令;若不包括,则执行该控制指令。In some embodiments, when the second device receives the control command for the first time (the control command may be sent by the first device in unicast), the control command is executed; When a control command is received (sent by the first device in the form of multicast), it is judged whether the control command that has been executed or is being executed contains the control command received for the second time, if it is included, then ignore the control command; if it does not include , execute the control instruction.
在某些实施方案中,针对设备集群中设备集合的划分,可以由外部设备执行划分,或在部署设备集群中的设备时执行划分,在设备部署完成时同时完成设备集合的划分。In some embodiments, for the division of the device sets in the device cluster, the division may be performed by an external device, or the division may be performed when the devices in the device cluster are deployed, and the division of the device sets may be completed at the same time when the device deployment is completed.
在某些实施方案中,在外部设备上安装应用程序(APP),并在该应用程序中添加已部署的设备,对设备完成分组,每个小组的设备统称为设备集合,多个设备集合中构成设备集群,并在每个设备集合中确定主设备(第一设备)和从设备(第二设备)。In some embodiments, an application program (APP) is installed on an external device, and deployed devices are added to the application program, and the devices are grouped. The devices in each group are collectively referred to as a device set, and multiple device sets A device cluster is formed, and a master device (first device) and a slave device (second device) are determined in each device set.
在某些实施方案中,按照预设规则对设备集群中的设备进行分组,得到多个设备集合,该预设规则可以是:根据设备的部署位置进行分组,还可以根据设备的标识(设备ID、设备类型)进行分组等等。In some implementations, the devices in the device cluster are grouped according to a preset rule to obtain multiple device sets. The preset rule can be: grouping according to the deployment location of the device, or according to the identification of the device (device ID , device type) to group and so on.
在某些实施方案中,在设备部署过程中,完成设备集合的构建,以及确定每个集合中的第一设备和第二设备,设备集合中的第一设备将该设备集合中的设备信息发送至电子设备,由电子设备对设备集群的信息进行存储,便于后续通过电子设备对设备集群进行控制。In some embodiments, during the device deployment process, the construction of the device set is completed, and the first device and the second device in each set are determined, and the first device in the device set sends the device information in the device set To the electronic device, the information of the device cluster is stored by the electronic device, so as to facilitate subsequent control of the device cluster through the electronic device.
在某些实施方案中,在每个设备集合确定后,该设备集合中的每个设备(第一设备或第二设备)均存储由该设备集合中除本身之外的其它设备信息,该设备信息可以包括:IP地址、MAC地址、设备ID、序列号和响应动作规则等信息。In some embodiments, after each device set is determined, each device (first device or second device) in the device set stores information about other devices in the device set except itself, and the device The information may include: IP address, MAC address, device ID, serial number, and response action rules.
在某些实施方案中,设备集合A包括:设备1(第一设备)、设备2(第二设备)、设备3(第二设备)和设备4(第二设备);设备1本地存储有设备2-4的设备信息、设备2本地存储有设备1、3-4的设备信息、设备3本地存储有设备1-2、4的设备信息、设备4本地存储有设备1-3的设备信息。In some embodiments, device set A includes: device 1 (first device), device 2 (second device), device 3 (second device), and device 4 (second device); device 1 locally stores device The device information of 2-4, the device 2 locally stores the device information of devices 1 and 3-4, the device 3 locally stores the device information of devices 1-2, 4, and the device 4 locally stores the device information of devices 1-3.
在某些实施方案中,在设备集合中的某一设备(第一设备或第二设备)得到设备信息发生变化时(IP地址发生变化),该设备将变化后的设备信息采用单播和组播的方式发送给该设备集合内的其它设备,以使 其它设备在接收到变化后的设备信息对本地存储的设备信息进行更新。In some implementations, when a certain device (first device or second device) in the device set obtains device information that changes (the IP address changes), the device uses unicast and group broadcast to other devices in the device set, so that other devices update the locally stored device information after receiving the changed device information.
在某些实施方案中,电子设备中还存储有设备集群中每个设备集合对应的设备信息,便于在通过电子设备对设备集合进行控制时,查询该设备信息准确的找到待控制的目标设备集群。In some embodiments, the electronic device also stores the device information corresponding to each device set in the device cluster, so that when the device set is controlled by the electronic device, the device information can be queried to accurately find the target device cluster to be controlled .
在某些实施方案中,涉及的电子设备可以是智能遥控器、智能手机、智能手环等设备,设备集群中的设备可以是灯具、摄像头等设备,该设备集群中的设备可以包括一种或多种。In some embodiments, the electronic devices involved may be devices such as smart remote controllers, smart phones, and smart bracelets, and the devices in the device cluster may be lamps, cameras, etc., and the devices in the device cluster may include one or Various.
在某些实施方案中,可将某一建筑区域内安装的全部灯具作为设备集群,还可以将某一建筑区域内安装的全部灯具+全部摄像头作为设备集群。In some embodiments, all lamps installed in a certain building area can be used as a device cluster, and all lamps and all cameras installed in a certain building area can also be used as a device cluster.
图2为本公开实施例提供的设备的控制方法的流程示意图,如图2所示,该方法包括:FIG. 2 is a schematic flowchart of a method for controlling equipment provided by an embodiment of the present disclosure. As shown in FIG. 2 , the method includes:
S21,针对设备集群中的目标设备集合,生成所述目标设备集合的控制指令,所述目标设备集合中包括第一设备和第二设备;以及S21. For a target device set in the device cluster, generate a control instruction for the target device set, where the target device set includes a first device and a second device; and
S22,将所述控制指令发送给所述目标设备集合中的所述第一设备,以使所述第一设备在接收到所述控制指令时,将所述控制指令采用单播和组播的方式同时发送给所述目标设备集合中的所述第二设备。S22. Send the control instruction to the first device in the target device set, so that when the first device receives the control instruction, it uses unicast and multicast methods for the control instruction. The method is sent to the second device in the target device set at the same time.
在某些实施方案中,当需要对设备集群中的目标设备集合进行控制时,通过电子设备本地存储的设备信息查询对应的目标设备集合,针对该目标设备集合生成对应的控制指令。In some embodiments, when the target device set in the device cluster needs to be controlled, the corresponding target device set is queried through the device information locally stored in the electronic device, and corresponding control instructions are generated for the target device set.
在该目标设备集合中包括第一设备和第二设备,第一设备可以理解为目标设备集合中的主设备,用于与电子设备进行数据交互,第二设备可以理解为从设备,也即可接收由第一设备转发的控制指令。The target device set includes a first device and a second device. The first device can be understood as a master device in the target device set for data interaction with electronic devices, and the second device can be understood as a slave device, that is, A control instruction forwarded by the first device is received.
在某些实施方案中,电子设备将控制指令发送给目标设备集合中 的第一设备,第一设备根据本地存储的目标设备集合对应的设备信息将该控制指令采用单播和组播的方式同时发送给目标设备集合中的第二设备。In some embodiments, the electronic device sends the control instruction to the first device in the target device set, and the first device adopts the unicast and multicast methods to simultaneously unicast and multicast the control instruction according to the device information corresponding to the target device set stored locally. Sent to the second device in the set of target devices.
在某些实施方案中,在第一设备完成控制指令的发送后,第一设备执行该控制指令,以及第二设备在接收到第二控制指令时,第二设备执行该控制指令,以实现电子设备对目标设备集合中的第一设备和第二设备的联动控制。In some embodiments, after the first device finishes sending the control command, the first device executes the control command, and when the second device receives the second control command, the second device executes the control command, so as to realize electronic The linkage control of the device to the first device and the second device in the target device set.
采用单播的方式发送控制指令可以使第二设备快速收到该控制指令,采用组播的方式可使同一设备集合中的第二设备全部收到该控制指令,也即控制指令全部覆盖第二设备。Using unicast to send the control command can make the second device quickly receive the control command, and using multicast can make all the second devices in the same device set receive the control command, that is, the control command covers all the second devices. equipment.
本公开实施例提供的设备的控制方法,通过针对设备集群中的目标设备集合,生成所述目标设备集合的控制指令,所述目标设备集合中包括第一设备和第二设备;将所述控制指令发送给所述目标设备集合中的所述第一设备,以使所述第一设备在接收到所述控制指令时,将所述控制指令采用单播和组播的方式同时发送给所述目标设备集合中的所述第二设备;采用两种方式同发可保证设备集合内的第二设备既快速收到控制指令,又避免控制指令的遗漏,进而实现多设备之间的快速响应。The device control method provided by the embodiments of the present disclosure generates a control instruction of the target device set for the target device set in the device cluster, and the target device set includes the first device and the second device; sending an instruction to the first device in the set of target devices, so that the first device, when receiving the control instruction, simultaneously sends the control instruction to the The second device in the target device set: adopting two methods of simultaneous sending can ensure that the second device in the device set can receive the control command quickly, and avoid the omission of the control command, thereby realizing rapid response among multiple devices.
以下以电子设备为智能手机为例,设备为智能灯具为例对本实施例的设备的控制方法进行介绍。The method for controlling the device in this embodiment will be introduced below by taking the electronic device as an example of a smart phone and the device as an example of a smart lamp.
该智能灯具被部署于建筑区域,部署位置可以是建筑区域的门前位置、车库位置、围墙位置、后门位置等,该智能灯具上设置有WI-FI模块,通过该WI-FI模块可以使智能灯具连接于无线访问接入点(AP)。The smart lamp is deployed in the building area, and the deployment location can be the front door position, the garage position, the fence position, the back door position, etc. of the building area. The smart lamp is equipped with a WI-FI module, through which the smart The lights are connected to a wireless access point (AP).
在智能灯具连接无线访问接入点后,通过智能手机上安装的APP添加上述智能灯具,并在该APP中绑定上述智能灯具,在该APP的展示界面展示已绑定的全部智能灯具,对上述智能灯具进行分组,分组的预设规则可以是根据智能灯具的部署位置进行分组(例如,门前位置区域内的智能灯具划分为设备集合1、车库位置区域内的智能灯具划分 为设备集合2等等),在分组完成后,从每个分组内选一设备作为主设备(第一设备),该组内的其余设备为从设备(第二设备);分组的预设规则还可以是根据智能灯具的设备类型进行分组(例如,将某一位置安装的20W的多个智能灯具划分为设备集合1、另一位置安装的10W的多个智能灯具划分为设备集合2等等)。After the smart lamps are connected to the wireless access point, add the above-mentioned smart lamps through the APP installed on the smartphone, bind the above-mentioned smart lamps in the APP, and display all the bound smart lamps on the display interface of the APP. The above-mentioned intelligent lamps are grouped, and the preset rule of grouping can be grouped according to the deployment position of the intelligent lamps (for example, the intelligent lamps in the area in front of the door are divided into equipment set 1, and the intelligent lamps in the garage area are divided into equipment set 2 etc.), after the grouping is completed, select a device from each group as the master device (the first device), and the rest of the devices in the group are slave devices (the second device); the preset rule of the grouping can also be based on The device types of smart lamps are grouped (for example, multiple smart lamps of 20W installed in a certain location are divided into device set 1, and multiple smart lamps of 10W installed in another location are divided into device set 2, etc.).
在某些实施方案中,针对所述设备集群中的任一所述设备集合,将目标设备信息发送至所述设备集合中的所述第一设备和所述第二设备,以使所述第一设备和所述第二设备对所述目标设备信息进行存储,所述目标设备信息包括所述设备集合中全部设备的信息。In some embodiments, for any of the device sets in the device cluster, the target device information is sent to the first device and the second device in the device set, so that the first device The first device and the second device store the target device information, where the target device information includes information of all devices in the device set.
在某些实施方案中,通过APP将同一分组内的目标设备信息同步至每台智能灯具,以使每台智能灯具存储该分内其它智能灯具的设备信息。In some implementations, the target device information in the same group is synchronized to each smart lamp through the APP, so that each smart lamp stores the device information of other smart lamps in the group.
相应地,目标设备信息可以是:设备IP地址、MAC地址、设备ID、序列号和响应动作规则等信息,响应动作规则可以是设备在执行控制指令时的规则,例如,在智能灯具接收到开启指令时,响应动作规则可以是该组内的智能灯具按照1-N的顺序依次执行开启。Correspondingly, the target device information can be: device IP address, MAC address, device ID, serial number, and response action rules. The response action rules can be the rules when the device executes the control command. When ordering, the response action rule can be that the smart lamps in the group are turned on sequentially in the order of 1-N.
图3为本公开实施例提供的另一设备的控制方法的流程示意图,如图3所示,该方法包括:FIG. 3 is a schematic flowchart of another device control method provided by an embodiment of the present disclosure. As shown in FIG. 3 , the method includes:
S31,针对所述设备集群中的任一所述设备集合,所述设备集合内的第一设备向所述设备集合内的第二设备发送网络检测消息,以执行所述第一设备与所述第二设备之间的网络状态检测;S31. For any of the device sets in the device cluster, the first device in the device set sends a network detection message to the second device in the device set, so as to perform the communication between the first device and the network status detection between the second devices;
S32,在确定所述第二设备接收到所述网络检测消息时,第二设备向第一设备返回的所述网络检测消息的响应消息,则确定所述第一设备与所述第二设备之间的网络状态正常;S32. When it is determined that the second device has received the network detection message, the second device returns a response message of the network detection message to the first device, and then determine the relationship between the first device and the second device The network status between is normal;
S33,在确定所述第一设备未接收到第二设备返回的所述网络检测消息的响应消息时,对未返回所述响应消息的所述第二设备的设备状 态进行更新;以及S33. When determining that the first device has not received a response message of the network detection message returned by the second device, update the device status of the second device that has not returned the response message; and
S34;在确定所述第二设备未接收到所述网络检测消息时,从所述第二设备中重新确定第一设备,以对所述目标设备集合中的第一设备进行更新。S34: When it is determined that the second device has not received the network detection message, re-determine the first device from the second device, so as to update the first device in the target device set.
在某些实施方案中,为保证设备响应的准确性和及时性,每个设备集合中的第一设备执行网络状态检测的步骤,预先确定一时间阈值(例如,2min),每间隔该时间阈值,第一设备执行一次网络状态检测,检测的具体过程可以是:第一设备周期性的向设备集合内的第二设备发送网络检测消息,以使第二设备响应于网络检测消息返回响应消息,以此来判断第一设备与第二设备之间的网络可达性。In some embodiments, in order to ensure the accuracy and timeliness of device response, the first device in each device set executes the step of network state detection, predetermines a time threshold (for example, 2min), and every interval of the time threshold , the first device performs a network status detection, and the specific process of detection may be: the first device periodically sends a network detection message to the second device in the device set, so that the second device returns a response message in response to the network detection message, In this way, the network reachability between the first device and the second device is judged.
在某些实施方案中,在确定第二设备接收到网络检测消息时,第二设备向第一设备返回的所述网络检测消息的响应消息,则确定所述第一设备与所述第二设备之间的网络状态正常,也即,第一设备与该第二设备之间的网络正常。In some embodiments, when it is determined that the second device has received the network detection message, the second device returns a response message of the network detection message to the first device, and then it is determined that the first device and the second device The state of the network between them is normal, that is, the network between the first device and the second device is normal.
在确定所述第一设备未接收到第二设备返回的所述网络检测消息的响应消息时,也即,第一设备与第二设备之间的网络不可达(第一设备与该第二设备之间的网络异常),对未返回所述响应消息的所述第二设备的设备状态进行更新(对第一设备本地存储的用于表征第二设备的设备状态表进行更新),将该第二设备的设备状态由在线变更为离线。When it is determined that the first device has not received the response message of the network detection message returned by the second device, that is, the network between the first device and the second device is unreachable (the first device and the second device network abnormality between), update the device state of the second device that does not return the response message (update the device state table locally stored by the first device for representing the second device), and update the second device The device status of the second device is changed from online to offline.
相应地,在第一设备与第二设备之间的网络不可达时,可理解为第二设备此时处于离线状态,在第二设备重新在线时(也即在下一网络状态检测周期内向第一设备返回响应消息),再次对所述第二设备的设备状态进行更新,将该第二设备的设备状态由在离变更为在线。Correspondingly, when the network between the first device and the second device is unreachable, it can be understood that the second device is in an offline state at this time, and when the second device is online again (that is, in the next network state detection period, it will report to the first device). The device returns a response message), updates the device status of the second device again, and changes the device status of the second device from offline to online.
在确定第二设备在预设时间内(该预设时间可以大于等于时间阈值)未接收到所述网络检测消息时,则确定第一设备离线,从所述第二设备中重新确定第一设备,以对所述目标设备集合中的第一设备进行更新。When it is determined that the second device has not received the network detection message within a preset time (the preset time may be greater than or equal to a time threshold), it is determined that the first device is offline, and the first device is re-determined from the second device , to update the first device in the target device set.
在某些实施方案中,在多个第二设备在预设时间内均未接收到所 述网络检测消息时,则确定第一设备离线,通过多对个第二设备进行判断,可提高对第一设备网络状态判断的准确性,避免出现误判。In some implementations, when multiple second devices do not receive the network detection message within a preset time, it is determined that the first device is offline, and by judging multiple pairs of second devices, the detection of the second device can be improved. 1. Accuracy of equipment network status judgment to avoid misjudgment.
在某些实施方案中,在从第二设备中重新确定第一设备后,被重新确定的第一设备对本地存储的设备信息进行更新,并将更新后的设备信息同步至同一设备集合中的第二设备,以及电子设备。In some embodiments, after the first device is re-determined from the second device, the re-determined first device updates the locally stored device information and synchronizes the updated device information to the devices in the same device set. Secondary equipment, and electronic equipment.
在某些实施方案中,在处于离线的第一设备重新在线时,可将重新在线的第一设备重新确定为该设备集合中的第一设备,或者,还可以将重新在线的第一设备设置为第二设备,在执行完上述操作后,同步更新设备信息。In some embodiments, when the first device that is offline comes back online, the first device that goes back online can be re-determined as the first device in the device set, or the first device that goes back online can also be set to For the second device, after performing the above operations, update the device information synchronously.
在某些实施方案中,在设备集合中的第一设备或第二设备的设备信息发生变化时,设备信息发生变化的第一设备或第二设备将最新的设备信息同步至该设备集合内的其它设备,以使其它设备对本地存储的设备信息进行更新。In some embodiments, when the device information of the first device or the second device in the device collection changes, the first device or the second device whose device information has changed will synchronize the latest device information to the device information in the device collection. Other devices, so that other devices update the locally stored device information.
图4为本公开实施例提供的又一设备的控制方法的流程示意图,如图4所示,该方法包括:FIG. 4 is a schematic flowchart of another device control method provided by an embodiment of the present disclosure. As shown in FIG. 4 , the method includes:
S41,针对设备集群中的目标设备集合,生成所述目标设备集合的控制指令;S41. For the target device set in the device cluster, generate a control instruction for the target device set;
S42,所述第一设备查询所述目标设备信息;S42. The first device queries the target device information;
S43,基于所述目标设备信息将所述控制指令采用单播和组播的方式发送给所述目标设备集合中的第二设备;S43. Send the control instruction to a second device in the target device set in a unicast or multicast manner based on the target device information;
S44,在所述第一设备执行所述控制指令后,接收所述第一设备返回的用于指示执行所述控制指令的第一执行结果;S44. After the first device executes the control instruction, receive a first execution result returned by the first device for instructing execution of the control instruction;
S45,在所述第二设备执行所述控制指令后,接收所述第二设备返回的用于指示执行所述控制指令的第二执行结果;以及S45. After the second device executes the control instruction, receive a second execution result returned by the second device for indicating execution of the control instruction; and
S46,基于所述第一执行结果和所述第二执行结果,对所述目标设 备集合的当前状态信息进行更新。S46. Based on the first execution result and the second execution result, update the current state information of the target device set.
在某些实施方案中,目标设备信息为目标设备集合中全部设备(第一设备和第二设备)的设备信息,S41-S43与图2中的S21-S22类似,为简洁描述,在此不作赘述。In some embodiments, the target device information is the device information of all devices (the first device and the second device) in the target device set, and S41-S43 are similar to S21-S22 in FIG. 2 , and are not described here for brevity. repeat.
在某些实施方案中,控制指令可以是用于控制目标设备集合内全部设备的控制指令,还可以是用于控制目标设备集合内部分设备的控制指令。In some embodiments, the control instruction may be a control instruction for controlling all devices in the target device set, or a control instruction for controlling some devices in the target device set.
在控制指令为控制目标设备集合内部分设备时,在该控制指令中携带有执行该控制指令的设备标识(例如,设备ID),第一设备在接收到第一控制指令时,从第一控制指令中解析得到设备标识,从目标设备信息中挑选与该设备标识对应的第二设备,并采用单播和组播的方式发送给该设备标识对应的第二设备。When the control instruction is a part of the control target device set, the control instruction carries the device identifier (for example, device ID) that executes the control instruction, and when the first device receives the first control instruction, it starts from the first control instruction. The device identifier is obtained by parsing the instruction, and the second device corresponding to the device identifier is selected from the target device information, and sent to the second device corresponding to the device identifier in a unicast or multicast manner.
在某些实施方案中,在第一设备和第二设备接收到控制指令时,执行该控制指令,并向电子设备发送对应的执行结果,以使电子设备更新目标设备集合对应的状态信息。In some embodiments, when the first device and the second device receive the control instruction, execute the control instruction, and send a corresponding execution result to the electronic device, so that the electronic device updates the state information corresponding to the target device set.
在某些实施方案中,在智能手机的APP上生成控制车库-智能灯具的开启指令(该操作可以语音输入或手动触发),智能手机将该控制指令发送给车库-智能灯具集合中的主设备,主设备将利用单播和组播的形式将该控制指令发送至车库-智能灯具集合中的从设备。主设备和从设备执行完该控制指令时,向智能手机发送已开启的执行结果消息,智能手机在收到执行结果消息后,将车库-智能灯具集合对应的状态信息由已关闭更新为已开启。In some embodiments, an opening command for controlling the garage-smart lamps is generated on the APP of the smart phone (this operation can be voice input or manually triggered), and the smart phone sends the control command to the master device in the garage-smart lamps collection , the master device will use the form of unicast and multicast to send the control command to the slave devices in the garage-smart lamp collection. When the master device and the slave device finish executing the control command, they will send an enabled execution result message to the smart phone. After receiving the execution result message, the smart phone will update the status information corresponding to the garage-smart lighting set from off to on. .
本公开实施例提供的设备的控制方法,通过针对设备集群中的目标设备集合,生成所述目标设备集合的控制指令,所述目标设备集合中包括第一设备和第二设备;将所述控制指令发送给所述目标设备集合中的所述第一设备,以使所述第一设备在接收到所述控制指令时,将所述控制指令采用单播和组播的方式同时发送给所述目标设备集合中的所述第二设备;采用两种方式同发可保证设备集合内的第二设备 既快速收到控制指令,又避免控制指令的遗漏,进而实现多设备之间的快速响应。The device control method provided by the embodiments of the present disclosure generates a control instruction of the target device set for the target device set in the device cluster, and the target device set includes the first device and the second device; sending an instruction to the first device in the set of target devices, so that the first device, when receiving the control instruction, simultaneously sends the control instruction to the The second device in the target device set: adopting two methods of simultaneous sending can ensure that the second device in the device set can receive the control command quickly, and avoid the omission of the control command, thereby realizing rapid response among multiple devices.
本公开实施例提供的设备的控制方法,通过针对设备集群中的目标设备集合,生成所述目标设备集合的控制指令,所述目标设备集合中包括第一设备和第二设备;将所述控制指令发送给所述目标设备集合中的所述第一设备,以使所述第一设备在接收到所述控制指令时,将所述控制指令采用单播和组播的方式同时发送给所述目标设备集合中的所述第二设备;采用两种方式同发可保证设备集合内的第二设备既快速收到控制指令,又避免控制指令的遗漏,进而实现多设备之间的快速响应。The device control method provided by the embodiments of the present disclosure generates a control instruction of the target device set for the target device set in the device cluster, and the target device set includes the first device and the second device; sending an instruction to the first device in the set of target devices, so that the first device, when receiving the control instruction, simultaneously sends the control instruction to the The second device in the target device set: adopting two methods of simultaneous sending can ensure that the second device in the device set can receive the control command quickly, and avoid the omission of the control command, thereby realizing rapid response among multiple devices.
图5为本公开实施例提供的设备的控制装置50的结构示意图,如图5所示,其包括:Fig. 5 is a schematic structural diagram of the control device 50 of the equipment provided by the embodiment of the present disclosure. As shown in Fig. 5, it includes:
生成模块51,配置为针对设备集群中的目标设备集合,生成所述目标设备集合的控制指令,所述目标设备集合中包括第一设备和第二设备;以及The generation module 51 is configured to generate a control instruction of the target device set for the target device set in the device cluster, the target device set includes the first device and the second device; and
发送模块52,配置为将所述控制指令发送给所述目标设备集合中的所述第一设备,以使所述第一设备在接收到所述控制指令时,将所述控制指令采用单播和组播的方式同时发送给所述目标设备集合中的所述第二设备。The sending module 52 is configured to send the control instruction to the first device in the target device set, so that when the first device receives the control instruction, it uses unicast and simultaneously send to the second device in the target device set in a multicast manner.
本实施例提供的设备的控制装置50可以是如图5中所示的设备的控制装置,可执行本公开中的设备的控制方法的所有步骤,进而实现图本公开所示设备的控制方法的技术效果,请参照图2-4相关描述,为简洁描述,在此不作赘述。The device control device 50 provided in this embodiment may be the device control device as shown in FIG. 5 , which can execute all the steps of the device control method in the present disclosure, and then realize the control method of the device shown in the present disclosure. For the technical effects, please refer to the relevant descriptions in FIGS. 2-4 , which are not described here for brevity.
图6为本公开实施例提供的电子设备600的结构示意图,图6所示的电子设备600包括:至少一个处理器601、存储器602、至少一个网络接口604和其他用户接口603。电子设备600中的各个组件通过总线系统605耦合在一起。可理解,总线系统605用于实现这些组件之 间的连接通信。总线系统605除包括数据总线之外,还包括电源总线、控制总线和状态信号总线。但是为了清楚说明起见,在图6中将各种总线都标为总线系统605。FIG. 6 is a schematic structural diagram of an electronic device 600 provided by an embodiment of the present disclosure. The electronic device 600 shown in FIG. 6 includes: at least one processor 601 , memory 602 , at least one network interface 604 and other user interfaces 603 . Various components in the electronic device 600 are coupled together through a bus system 605 . It can be understood that the bus system 605 is used to realize connection and communication between these components. In addition to the data bus, the bus system 605 also includes a power bus, a control bus and a status signal bus. However, the various buses are labeled as bus system 605 in FIG. 6 for clarity of illustration.
其中,用户接口603可以包括显示器、键盘或者点击设备(例如,鼠标,轨迹球(trackball)、触感板或者触摸屏等。Wherein, the user interface 603 may include a display, a keyboard or a pointing device (for example, a mouse, a trackball (trackball), a touch panel or a touch screen, and the like.
可以理解,本公开实施例中的存储器602可以是易失性存储器或非易失性存储器,或可包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(Read-Only Memory,ROM)、可编程只读存储器(Programmable ROM,PROM)、可擦除可编程只读存储器(Erasable PROM,EPROM)、电可擦除可编程只读存储器(Electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(Random Access Memory,RAM),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态随机存取存储器(Static RAM,SRAM)、动态随机存取存储器(Dynamic RAM,DRAM)、同步动态随机存取存储器(Synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(Double Data Rate SDRAM,DDRSDRAM)、增强型同步动态随机存取存储器(Enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(Synch link DRAM,SLDRAM)和直接内存总线随机存取存储器(Direct Rambus RAM,DRRAM)。本文描述的存储器602旨在包括但不限于这些和任意其它适合类型的存储器。It can be understood that the memory 602 in the embodiment of the present disclosure may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory can be read-only memory (Read-Only Memory, ROM), programmable read-only memory (Programmable ROM, PROM), erasable programmable read-only memory (Erasable PROM, EPROM), electronically programmable Erase Programmable Read-Only Memory (Electrically EPROM, EEPROM) or Flash. The volatile memory can be Random Access Memory (RAM), which acts as external cache memory. By way of illustration and not limitation, many forms of RAM are available, such as Static Random Access Memory (Static RAM, SRAM), Dynamic Random Access Memory (Dynamic RAM, DRAM), Synchronous Dynamic Random Access Memory (Synchronous DRAM, SDRAM), double data rate synchronous dynamic random access memory (Double Data Rate SDRAM, DDRSDRAM), enhanced synchronous dynamic random access memory (Enhanced SDRAM, ESDRAM), synchronous connection dynamic random access memory (Synch link DRAM, SLDRAM ) and Direct Memory Bus Random Access Memory (Direct Rambus RAM, DRRAM). The memory 602 described herein is intended to include, but is not limited to, these and any other suitable types of memory.
在某些实施方案中,存储器602存储了如下的元素,可执行单元或者数据结构,或者他们的子集,或者他们的扩展集:操作系统6021和应用程序6022。In some embodiments, the memory 602 stores the following elements, executable units or data structures, or a subset thereof, or an extension thereof: an operating system 6021 and an application program 6022 .
其中,操作系统6021,包含各种系统程序,例如框架层、核心库层、驱动层等,用于实现各种基础业务以及处理基于硬件的任务。应用程序6022,包含各种应用程序,例如媒体播放器(Media Player)、浏览器(Browser)等,用于实现各种应用业务。实现本公开实施例方法的程序可以包含在应用程序6022中。Among them, the operating system 6021 includes various system programs, such as framework layer, core library layer, driver layer, etc., for realizing various basic services and processing hardware-based tasks. The application program 6022 includes various application programs, such as a media player (Media Player), a browser (Browser), etc., and is used to realize various application services. Programs for realizing the methods of the embodiments of the present disclosure may be included in the application program 6022 .
在某些实施方案中,通过调用存储器602存储的程序或指令,可以是应用程序6022中存储的程序或指令,处理器601用于执行本公开实施例所提供的方法步骤,其包括:In some embodiments, by calling the program or instruction stored in the memory 602, which may be the program or instruction stored in the application program 6022, the processor 601 is used to execute the method steps provided by the embodiments of the present disclosure, which includes:
针对设备集群中的目标设备集合,生成所述目标设备集合的控制指令,所述目标设备集合中包括第一设备和第二设备;将所述控制指令发送给所述目标设备集合中的所述第一设备,以使所述第一设备在接收到所述控制指令时,将所述控制指令采用单播和组播的方式同时发送给所述目标设备集合中的所述第二设备。For a target device set in a device cluster, generate a control instruction of the target device set, where the target device set includes a first device and a second device; and send the control instruction to the target device set in the target device set. The first device, so that when the first device receives the control instruction, it simultaneously sends the control instruction to the second device in the target device set in a unicast and multicast manner.
在某些实施方案中,在所述第一设备与所述第二设备之间的网络状态检测过程中,判断所述第二设备是否接收到所述第一设备发送的网络检测消息;在确定所述第二设备未接收到所述网络检测消息时,从所述第二设备中重新确定第一设备,以对所述目标设备集合中的第一设备进行更新。In some implementations, during the network status detection process between the first device and the second device, it is judged whether the second device has received the network detection message sent by the first device; When the second device does not receive the network detection message, re-determine the first device from the second device, so as to update the first device in the target device set.
在某些实施方案中,在确定所述第一设备未接收到第二设备返回的所述网络检测消息的响应消息时,对未返回所述响应消息的所述第二设备的设备状态进行更新。In some embodiments, when it is determined that the first device has not received the response message of the network detection message returned by the second device, the device status of the second device that has not returned the response message is updated .
在某些实施方案中,按照预设规则对所述设备集群中的设备进行分组,得到多个设备集合;确定每个所述设备集合中对应的第一设备和第二设备。In some embodiments, the devices in the device cluster are grouped according to preset rules to obtain multiple device sets; and the corresponding first device and second device in each of the device sets are determined.
在某些实施方案中,针对所述设备集群中的任一所述设备集合,将目标设备信息发送至所述设备集合中的所述第一设备和所述第二设备,以使所述第一设备和所述第二设备对所述目标设备信息进行存储,所述目标设备信息包括所述设备集合中全部设备的信息。In some embodiments, for any of the device sets in the device cluster, the target device information is sent to the first device and the second device in the device set, so that the first device The first device and the second device store the target device information, where the target device information includes information of all devices in the device set.
在某些实施方案中,所述第一设备查询所述目标设备信息;基于所述目标设备信息将所述控制指令采用单播和组播的方式发送给所述目标设备集合中的第二设备。In some embodiments, the first device queries the target device information; based on the target device information, the control instruction is sent to the second device in the target device set in a unicast or multicast manner .
在某些实施方案中,在所述第一设备执行所述控制指令后,接收所述第一设备返回的用于指示执行所述控制指令的第一执行结果;在 所述第二设备执行所述控制指令后,接收所述第二设备返回的用于指示执行所述控制指令的第二执行结果;基于所述第一执行结果和所述第二执行结果,对所述目标设备集合的当前状态信息进行更新。In some implementations, after the first device executes the control instruction, the first execution result returned by the first device for indicating execution of the control instruction is received; after the second device executes the After the control instruction, receive the second execution result returned by the second device for instructing to execute the control instruction; based on the first execution result and the second execution result, the current set of target devices Status information is updated.
上述本公开实施例提供的方法可以应用于处理器601中,或者由处理器601实现。处理器601可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过处理器601中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器601可以是通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本公开实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本公开实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件单元组合执行完成。软件单元可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器602,处理器601读取存储器602中的信息,结合其硬件完成上述方法的步骤。The methods provided by the foregoing embodiments of the present disclosure may be applied to the processor 601 or implemented by the processor 601 . The processor 601 may be an integrated circuit chip and has signal processing capability. In the implementation process, each step of the above method may be completed by an integrated logic circuit of hardware in the processor 601 or instructions in the form of software. The above-mentioned processor 601 may be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a ready-made programmable gate array (Field Programmable Gate Array, FPGA) or other Programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. Various methods, steps and logic block diagrams disclosed in the embodiments of the present disclosure may be implemented or executed. A general-purpose processor may be a microprocessor, or the processor may be any conventional processor, or the like. The steps of the methods disclosed in the embodiments of the present disclosure may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software units in the decoding processor. The software unit may be located in a mature storage medium in the field such as random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, register. The storage medium is located in the memory 602, and the processor 601 reads the information in the memory 602, and completes the steps of the above method in combination with its hardware.
可以理解的是,本文描述的这些实施例可以用硬件、软件、固件、中间件、微码或其组合来实现。对于硬件实现,处理单元可以实现在一个或多个专用集成电路(Application Specific Integrated Circuits,ASIC)、数字信号处理器(Digital Signal Processing,DSP)、数字信号处理设备(DSP Device,DSPD)、可编程逻辑设备(Programmable Logic Device,PLD)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)、通用处理器、控制器、微控制器、微处理器、用于执行本申请所述功能的其它电子单元或其组合中。It should be understood that the embodiments described herein may be implemented by hardware, software, firmware, middleware, microcode or a combination thereof. For hardware implementation, the processing unit can be implemented in one or more application specific integrated circuits (Application Specific Integrated Circuits, ASIC), digital signal processor (Digital Signal Processing, DSP), digital signal processing device (DSP Device, DSPD), programmable Logic device (Programmable Logic Device, PLD), Field-Programmable Gate Array (Field-Programmable Gate Array, FPGA), general-purpose processor, controller, microcontroller, microprocessor, other devices used to perform the functions described in this application electronic unit or its combination.
对于软件实现,可通过执行本文所述功能的单元来实现本文所述的技术。软件代码可存储在存储器中并通过处理器执行。存储器可以 在处理器中或在处理器外部实现。For a software implementation, the techniques described herein are implemented by means of units that perform the functions described herein. Software codes can be stored in memory and executed by a processor. Memory can be implemented within the processor or external to the processor.
本实施例提供的电子设备可以是如图6中所示的电子设备,可执行本公开中设备的控制方法的所有步骤,进而实现本公开所示设备的控制方法的技术效果,请参照图2-4相关描述,为简洁描述,在此不作赘述。The electronic device provided in this embodiment may be the electronic device shown in Figure 6, which can execute all the steps of the device control method in the present disclosure, and then realize the technical effect of the device control method shown in the present disclosure, please refer to Figure 2 -4 Relevant descriptions are for brevity and will not be repeated here.
本公开实施例还提供了存储介质(计算机可读存储介质)。这里的存储介质存储有一个或者多个程序。其中,存储介质可以包括易失性存储器,例如随机存取存储器;存储器也可以包括非易失性存储器,例如只读存储器、快闪存储器、硬盘或固态硬盘;存储器还可以包括上述种类的存储器的组合。The embodiment of the present disclosure also provides a storage medium (computer-readable storage medium). The storage medium here stores one or more programs. Wherein, the storage medium may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a read-only memory, a flash memory, a hard disk or a solid-state disk; the memory may also include the above-mentioned types of memory combination.
当存储介质中一个或者多个程序可被一个或者多个处理器执行,以实现上述在设备的控制设备侧执行的设备的控制方法。One or more programs in the storage medium can be executed by one or more processors, so as to implement the above-mentioned device control method executed on the control device side of the device.
所述处理器用于执行存储器中存储的设备的控制程序,以实现以下在设备的控制设备侧执行的设备的控制方法的步骤:The processor is used to execute the control program of the device stored in the memory, so as to realize the following steps of the device control method executed on the control device side of the device:
针对设备集群中的目标设备集合,生成所述目标设备集合的控制指令,所述目标设备集合中包括第一设备和第二设备;将所述控制指令发送给所述目标设备集合中的所述第一设备,以使所述第一设备在接收到所述控制指令时,将所述控制指令采用单播和组播的方式同时发送给所述目标设备集合中的所述第二设备。For a target device set in a device cluster, generate a control instruction of the target device set, where the target device set includes a first device and a second device; and send the control instruction to the target device set in the target device set. The first device, so that when the first device receives the control instruction, it simultaneously sends the control instruction to the second device in the target device set in a unicast and multicast manner.
在某些实施方案中,在所述第一设备与所述第二设备之间的网络状态检测过程中,判断所述第二设备是否接收到所述第一设备发送的网络检测消息;在确定所述第二设备未接收到所述网络检测消息时,从所述第二设备中重新确定第一设备,以对所述目标设备集合中的第一设备进行更新。In some implementations, during the network status detection process between the first device and the second device, it is judged whether the second device has received the network detection message sent by the first device; When the second device does not receive the network detection message, re-determine the first device from the second device, so as to update the first device in the target device set.
在某些实施方案中,在确定所述第一设备未接收到第二设备返回的所述网络检测消息的响应消息时,对未返回所述响应消息的所述第二设备的设备状态进行更新。In some embodiments, when it is determined that the first device has not received the response message of the network detection message returned by the second device, the device status of the second device that has not returned the response message is updated .
在某些实施方案中,按照预设规则对所述设备集群中的设备进行分组,得到多个设备集合;确定每个所述设备集合中对应的第一设备和第二设备。In some embodiments, the devices in the device cluster are grouped according to preset rules to obtain multiple device sets; and the corresponding first device and second device in each of the device sets are determined.
在某些实施方案中,针对所述设备集群中的任一所述设备集合,将目标设备信息发送至所述设备集合中的所述第一设备和所述第二设备,以使所述第一设备和所述第二设备对所述目标设备信息进行存储,所述目标设备信息包括所述设备集合中全部设备的信息。In some embodiments, for any of the device sets in the device cluster, the target device information is sent to the first device and the second device in the device set, so that the first device The first device and the second device store the target device information, where the target device information includes information of all devices in the device set.
在某些实施方案中,所述第一设备查询所述目标设备信息;基于所述目标设备信息将所述控制指令采用单播和组播的方式发送给所述目标设备集合中的第二设备。In some embodiments, the first device queries the target device information; based on the target device information, the control instruction is sent to the second device in the target device set in a unicast or multicast manner .
在某些实施方案中,在所述第一设备执行所述控制指令后,接收所述第一设备返回的用于指示执行所述控制指令的第一执行结果;在所述第二设备执行所述控制指令后,接收所述第二设备返回的用于指示执行所述控制指令的第二执行结果;基于所述第一执行结果和所述第二执行结果,对所述目标设备集合的当前状态信息进行更新。In some implementations, after the first device executes the control instruction, receiving a first execution result returned by the first device for indicating execution of the control instruction; after the second device executes the After the control instruction, receive the second execution result returned by the second device for instructing to execute the control instruction; based on the first execution result and the second execution result, the current set of target devices Status information is updated.
专业人员应该还可以进一步意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、计算机软件或者二者的结合来实现,为了清楚地说明硬件和软件的可互换性,在上述说明中已经按照功能一般性地描述了各示例的组成及步骤。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本公开的范围。Professionals should further realize that the units and algorithm steps described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the relationship between hardware and software Interchangeability. In the above description, the composition and steps of each example have been generally described according to their functions. Whether these functions are executed by hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each particular application, but such implementation should not be considered beyond the scope of the present disclosure.
结合本文中所公开的实施例描述的方法或算法的步骤可以用硬件、处理器执行的软件模块,或者二者的结合来实施。软件模块可以置于随机存储器(RAM)、内存、只读存储器(ROM)、电可编程ROM、电可擦除可编程ROM、寄存器、硬盘、可移动磁盘、CD-ROM、或技术领域内所公知的任意其它形式的存储介质中。The steps of the methods or algorithms described in connection with the embodiments disclosed herein may be implemented by hardware, software modules executed by a processor, or a combination of both. Software modules can be placed in random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other Any other known storage medium.
以上所述的具体实施方式,对本公开的目的、技术方案和有益效 果进行了进一步详细说明,所应理解的是,以上所述仅为本公开的具体实施方式而已,并不用于限定本公开的保护范围,凡在本公开的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本公开的保护范围之内。The specific implementations described above further describe the purpose, technical solutions and beneficial effects of the present disclosure in detail. It should be understood that the above descriptions are only specific implementations of the present disclosure and are not intended to limit the scope of the present disclosure Protection scope, within the spirit and principles of the present disclosure, any modification, equivalent replacement, improvement, etc., shall be included in the protection scope of the present disclosure.

Claims (10)

  1. 设备的控制方法,其包括:A control method for a device, comprising:
    针对设备集群中的目标设备集合,生成所述目标设备集合的控制指令,所述目标设备集合中包括第一设备和第二设备;以及For a target device set in the device cluster, generate a control instruction for the target device set, where the target device set includes a first device and a second device; and
    将所述控制指令发送给所述目标设备集合中的所述第一设备,以使所述第一设备在接收到所述控制指令时,将所述控制指令采用单播和组播的方式同时发送给所述目标设备集合中的所述第二设备。sending the control instruction to the first device in the set of target devices, so that the first device, when receiving the control instruction, simultaneously broadcasts the control instruction in a unicast and multicast manner sent to the second device in the target device set.
  2. 如权利要求1所述的方法,其中,所述方法还包括:The method of claim 1, wherein the method further comprises:
    在所述第一设备与所述第二设备之间的网络状态检测过程中,判断所述第二设备是否接收到所述第一设备发送的网络检测消息;以及During the network status detection process between the first device and the second device, judging whether the second device has received a network detection message sent by the first device; and
    在确定所述第二设备未接收到所述网络检测消息时,从所述第二设备中重新确定第一设备,以对所述目标设备集合中的第一设备进行更新。When it is determined that the second device has not received the network detection message, re-determining the first device from the second device, so as to update the first device in the target device set.
  3. 如权利要求1或2所述的方法,其中,所述方法还包括:The method according to claim 1 or 2, wherein said method further comprises:
    在确定所述第一设备未接收到所述第二设备返回的所述网络检测消息的响应消息时,对未返回所述响应消息的所述第二设备的设备状态进行更新。When it is determined that the first device has not received the response message of the network detection message returned by the second device, updating the device status of the second device that has not returned the response message.
  4. 如权利要求1至3中任一权利要求所述的方法,其中,所述方法还包括:The method according to any one of claims 1 to 3, wherein the method further comprises:
    按照预设规则对所述设备集群中的设备进行分组,得到多个设备集合;以及grouping devices in the device cluster according to preset rules to obtain multiple device sets; and
    确定每个所述设备集合中对应的第一设备和第二设备。Determine the corresponding first device and second device in each of the device sets.
  5. 如权利要求4所述的方法,其中,所述方法还包括:The method of claim 4, wherein the method further comprises:
    针对所述设备集群中的任一所述设备集合,将目标设备信息发送至所述设备集合中的所述第一设备和所述第二设备,以使所述第一设备和所述第二设备对所述目标设备信息进行存储,所述目标设备信息包括所述设备集合中全部设备的信息。For any of the device sets in the device cluster, send target device information to the first device and the second device in the device set, so that the first device and the second The device stores the target device information, where the target device information includes information of all devices in the device set.
  6. 根据权利要求5所述的方法,其中,所述将所述控制指令采用单播和组播的方式同时发送给所述目标设备集合中的所述第二设备的步骤包括:The method according to claim 5, wherein the step of simultaneously sending the control instruction to the second device in the target device set in a unicast and multicast manner comprises:
    所述第一设备查询所述目标设备信息;以及the first device queries the target device information; and
    基于所述目标设备信息将所述控制指令采用单播和组播的方式发送给所述目标设备集合中的第二设备。Sending the control instruction to the second device in the target device set in a unicast or multicast manner based on the target device information.
  7. 根据权利要求1至6中任一权利要求所述的方法,其中,所述方法还包括:The method according to any one of claims 1 to 6, wherein the method further comprises:
    在所述第一设备执行所述控制指令后,接收所述第一设备返回的用于指示执行所述控制指令的第一执行结果;After the first device executes the control instruction, receiving a first execution result returned by the first device for indicating execution of the control instruction;
    在所述第二设备执行所述控制指令后,接收所述第二设备返回的用于指示执行所述控制指令的第二执行结果;以及After the second device executes the control instruction, receiving a second execution result returned by the second device for indicating execution of the control instruction; and
    基于所述第一执行结果和所述第二执行结果,对所述目标设备集合的当前状态信息进行更新。Based on the first execution result and the second execution result, the current state information of the target device set is updated.
  8. 设备的控制装置,其包括:The control device of the equipment, which includes:
    生成模块,配置为针对设备集群中的目标设备集合,生成所述目标设备集合的控制指令,所述目标设备集合中包括第一设备和第二设备;A generating module, configured to generate a control instruction for a target device set in a device cluster, where the target device set includes a first device and a second device;
    发送模块,配置为将所述控制指令发送给所述目标设备集合中的所述第一设备,以使所述第一设备在接收到所述控制指令时,将所述控制指令采用单播和组播的方式同时发送给所述目标设备集合中的所述第二设备。A sending module, configured to send the control instruction to the first device in the target device set, so that the first device, when receiving the control instruction, uses unicast and The method is sent to the second device in the set of target devices at the same time in a multicast manner.
  9. 电子设备,其包括:处理器和存储器,所述处理器用于执行所述存储器中存储的设备的控制程序,以实现权利要求1至7中任一权利要求所述的设备的控制方法。An electronic device, comprising: a processor and a memory, the processor is configured to execute a control program of the device stored in the memory, so as to implement the device control method according to any one of claims 1 to 7.
  10. 存储介质,其中,所述存储介质存储有一个或者多个程序,所述一个或者多个程序可被一个或者多个处理器执行,以实现权利要求1至7中任一权利要求所述的设备的控制方法。A storage medium, wherein the storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the device according to any one of claims 1 to 7 control method.
PCT/CN2022/113942 2021-12-31 2022-08-22 Device control method and apparatus, electronic device, and storage medium WO2023124136A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111682832.2A CN114422559A (en) 2021-12-31 2021-12-31 Device control method and device, electronic device and storage medium
CN202111682832.2 2021-12-31

Publications (1)

Publication Number Publication Date
WO2023124136A1 true WO2023124136A1 (en) 2023-07-06

Family

ID=81271536

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/113942 WO2023124136A1 (en) 2021-12-31 2022-08-22 Device control method and apparatus, electronic device, and storage medium

Country Status (2)

Country Link
CN (1) CN114422559A (en)
WO (1) WO2023124136A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114422559A (en) * 2021-12-31 2022-04-29 深圳海翼智新科技有限公司 Device control method and device, electronic device and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110687809A (en) * 2019-10-17 2020-01-14 珠海格力电器股份有限公司 Method and device for selecting master control equipment and equipment linkage system
CN110769033A (en) * 2019-09-18 2020-02-07 珠海格力电器股份有限公司 Intelligent networking method and system
CN111930020A (en) * 2020-08-10 2020-11-13 公牛集团股份有限公司 Equipment control system, method, device, terminal and readable storage medium
US20210219105A1 (en) * 2018-09-28 2021-07-15 Huawei Technologies Co., Ltd. Communications method and apparatus
CN113810860A (en) * 2021-09-24 2021-12-17 生迪智慧科技有限公司 Wireless control method and equipment for intelligent lighting system
CN114422559A (en) * 2021-12-31 2022-04-29 深圳海翼智新科技有限公司 Device control method and device, electronic device and storage medium

Family Cites Families (25)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9207905B2 (en) * 2003-07-28 2015-12-08 Sonos, Inc. Method and apparatus for providing synchrony group status information
AU2007312945A1 (en) * 2006-10-17 2008-04-24 Altec Lansing Australia Pty Ltd Media distribution in a wireless network
CN101426286A (en) * 2007-11-02 2009-05-06 瑞乐普(北京)科技有限公司 Method and device for supporting user's multimedia information browse in wireless network
WO2013134847A1 (en) * 2012-03-16 2013-09-19 Research In Motion Limited System and method for managing data using tree structures
KR20150009698A (en) * 2013-07-17 2015-01-27 삼성전자주식회사 Method for processing received data and an electronic device thereof
CN103595768B (en) * 2013-10-28 2016-05-25 国家电网公司 A kind of method that realizes configuration synchronization between virtual equipment
CN103955195B (en) * 2014-05-05 2016-09-14 中国安全生产科学研究院 The transmission of a kind of control instruction, response method and device
US9693127B2 (en) * 2014-05-14 2017-06-27 Samsung Electronics Co., Ltd Method and apparatus for communicating audio data
CN104267811A (en) * 2014-09-22 2015-01-07 联想(北京)有限公司 Terminal device and method for controlling terminal device
US9998544B2 (en) * 2014-08-11 2018-06-12 Sas Institute Inc. Synchronization testing of active clustered servers
CN105429883B (en) * 2015-10-22 2018-05-18 上海斐讯数据通信技术有限公司 The long connection method of multiple smart machines and server apparatus and smart machine
JP2017208673A (en) * 2016-05-17 2017-11-24 株式会社リコー Electrical apparatus, electrical apparatus control system, electrical apparatus control method, and program
US10341792B1 (en) * 2016-11-21 2019-07-02 Amazon Technologies, Inc. System for distributing audio output using multiple devices
CN107071189B (en) * 2016-11-28 2021-11-09 深圳市潮流网络技术有限公司 Connection method of communication equipment physical interface
CN108037675A (en) * 2018-02-01 2018-05-15 苏州创爵智能科技有限公司 A kind of Intelligent household scene control method based on ZigBee Group
AU2018411768B2 (en) * 2018-03-06 2021-06-24 Guangdong Oppo Mobile Telecommunications Corp., Ltd. Response message processing method, apparatus, and storage medium
CN109462794B (en) * 2018-12-11 2021-02-12 Oppo广东移动通信有限公司 Intelligent sound box and voice interaction method for intelligent sound box
CN112185394A (en) * 2019-07-02 2021-01-05 北京小鸟听听科技有限公司 Playing method, device and playing system of equipment group
CN110708222B (en) * 2019-10-14 2021-08-17 珠海格力电器股份有限公司 Control method, control device, gateway and storage medium
CN110831246B (en) * 2019-11-11 2023-04-18 展讯通信(上海)有限公司 Data transmission method and device
CN114868425A (en) * 2020-03-10 2022-08-05 Oppo广东移动通信有限公司 Data transmission method and device, network equipment and terminal equipment
CN111913397B (en) * 2020-07-10 2022-08-26 青岛易来智能科技股份有限公司 Device control method, device, storage medium, and electronic apparatus
CN111885151B (en) * 2020-07-21 2023-04-18 深圳市讯方技术股份有限公司 Intelligent equipment communication method based on zigbee protocol and main intelligent equipment
CN112235370B (en) * 2020-09-29 2023-04-28 卧安科技(深圳)有限公司 Equipment information synchronization method, synchronization device, main equipment and storage medium
CN113241068A (en) * 2021-03-26 2021-08-10 青岛海尔科技有限公司 Voice signal response method and device, storage medium and electronic device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20210219105A1 (en) * 2018-09-28 2021-07-15 Huawei Technologies Co., Ltd. Communications method and apparatus
CN110769033A (en) * 2019-09-18 2020-02-07 珠海格力电器股份有限公司 Intelligent networking method and system
CN110687809A (en) * 2019-10-17 2020-01-14 珠海格力电器股份有限公司 Method and device for selecting master control equipment and equipment linkage system
CN111930020A (en) * 2020-08-10 2020-11-13 公牛集团股份有限公司 Equipment control system, method, device, terminal and readable storage medium
CN113810860A (en) * 2021-09-24 2021-12-17 生迪智慧科技有限公司 Wireless control method and equipment for intelligent lighting system
CN114422559A (en) * 2021-12-31 2022-04-29 深圳海翼智新科技有限公司 Device control method and device, electronic device and storage medium

Also Published As

Publication number Publication date
CN114422559A (en) 2022-04-29

Similar Documents

Publication Publication Date Title
US20200195511A1 (en) Network management method and related device
US9906935B2 (en) Bluetooth low energy beacon device and advertising method
WO2023124136A1 (en) Device control method and apparatus, electronic device, and storage medium
US11782590B2 (en) Scene-operation method, electronic device, and non-transitory computer readable medium
WO2021135299A1 (en) Binding method and system for device network configuration, and mobile terminal and storage medium
WO2022174752A1 (en) Distributed scenario cluster interconnection central control system and control method
CN110996405A (en) Earphone connection method, terminal, earphone box and computer readable storage medium
US20220070016A1 (en) Method and apparatus for dynamically building conflict check rule table in smart home
CN111770035B (en) MAC address table updating method and device, message sending method and electronic equipment
CN111147943B (en) Multimedia light linkage playing method and device, computer equipment and storage medium
CN113625589B (en) Equipment control method and device, electronic equipment and storage medium
CN109618315A (en) A kind of control method of lighting apparatus, device, storage medium and intelligent terminal
EP3260987B1 (en) Data reading method, equipment and system
WO2018040106A1 (en) Method and apparatus for outputting search result, and electronic device
CN113612814A (en) Method, device, terminal and storage medium for screening session information
CN115150801B (en) Inter-node communication method and system based on Bluetooth Mesh network
CN112333295A (en) Multipath connection method and device, electronic equipment and storage medium
CN114980433B (en) Ethernet light control method, system, equipment and medium for stage lamp
CN114967485A (en) Device control method, device, electronic device and storage medium
CN105760204A (en) Method and equipment for installing application program
WO2022143201A1 (en) Lamp strip configuration method and device, storage medium and electronic device
CN112988132B (en) Automatic generation method and device of data interface, computer equipment and storage medium
CN105187387A (en) Service discovery method and terminal
CN114884975A (en) Service message processing method and device, storage medium and electronic device
JP2016174207A (en) Device management apparatus, wireless communications system, device management method and program

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22913420

Country of ref document: EP

Kind code of ref document: A1