CN114205178B - Equipment linkage method and device, storage medium and electronic equipment - Google Patents

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

Info

Publication number
CN114205178B
CN114205178B CN202111506142.1A CN202111506142A CN114205178B CN 114205178 B CN114205178 B CN 114205178B CN 202111506142 A CN202111506142 A CN 202111506142A CN 114205178 B CN114205178 B CN 114205178B
Authority
CN
China
Prior art keywords
equipment
state information
linkage
message
state
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111506142.1A
Other languages
Chinese (zh)
Other versions
CN114205178A (en
Inventor
李润林
甄志坚
郭平飞
宋德超
李绍斌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Gree Electric Appliances Inc of Zhuhai
Zhuhai Lianyun Technology Co Ltd
Original Assignee
Gree Electric Appliances Inc of Zhuhai
Zhuhai Lianyun Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Gree Electric Appliances Inc of Zhuhai, Zhuhai Lianyun Technology Co Ltd filed Critical Gree Electric Appliances Inc of Zhuhai
Priority to CN202111506142.1A priority Critical patent/CN114205178B/en
Publication of CN114205178A publication Critical patent/CN114205178A/en
Application granted granted Critical
Publication of CN114205178B publication Critical patent/CN114205178B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/2803Home automation networks
    • H04L12/2807Exchanging configuration information on appliance services in a home automation network
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/548Queue

Landscapes

  • Engineering & Computer Science (AREA)
  • Signal Processing (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Automation & Control Theory (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Telephonic Communication Services (AREA)

Abstract

The invention discloses a method and a device for equipment linkage, a storage medium and electronic equipment, and belongs to the technical field of intelligent home furnishing. Wherein, the method comprises the following steps: acquiring first state information of first equipment; judging whether the first state information of the first equipment meets a preset linkage condition or not; and if the preset linkage condition is met, controlling the equipment state of the second equipment. According to the invention, the state information of the first equipment is acquired through the second equipment, and whether the second equipment needs linkage control is judged, so that the technical problem that the equipment in the prior art consumes server resources in linkage is solved, mutual subscription and linkage control among the equipment are realized, when the equipment reaches the preset linkage condition, the equipment judges the preset linkage condition, executes the preset operation to realize linkage among the equipment, and the consumption of the server resources is reduced.

Description

Equipment linkage method and device, storage medium and electronic equipment
Technical Field
The invention relates to the technical field of smart home, in particular to a method and a device for equipment linkage, a storage medium and electronic equipment.
Background
In the prior art, along with the development of the internet of things, more and more users are interested in using intelligent household equipment. With the increase of the number of home intelligent devices, it is slightly troublesome to control a plurality of devices, so that linkage among the intelligent devices is generated at the same time.
In the prior art, equipment is triggered by a sensor to serve as a linkage condition or report to a server, and when the linkage preset condition is met, the server judges and sends an instruction to another equipment, so that the consumption of server resources is increased.
In view of the above problems in the related art, no effective solution has been found at present.
Disclosure of Invention
In order to overcome the defects of the prior art, the invention provides a device linkage method and device, a storage medium and electronic equipment.
According to an aspect of an embodiment of the present application, there is provided a method for linking devices, including: acquiring first state information of first equipment; judging whether the first state information of the first equipment meets a preset linkage condition or not; and if the preset linkage condition is met, controlling the equipment state of the second equipment.
Further, acquiring the first state information of the first device includes: receiving a first theme message sent by a Message Queue Telemetry Transmission (MQTT) server, wherein the MQTT server is connected with the first device and the second device through message middleware; extracting a device identification of the first device from the first subject message; judging whether the first device and the second device are in the same family group or not based on the device identification;
and if the first device and the second device are in the same family group, extracting the first state information from the first theme message.
Further, after controlling the device state of the second device, the method further comprises: generating second state information of the second device; searching a second subject matched with the second state information; and pushing the second state information serving as the load data of the second theme to an MQTT server.
Further, before determining whether the first state information of the first device satisfies a preset linkage condition, the method further includes: receiving a control instruction issued by an MQTT server, wherein the control instruction is used for indicating a linkage condition for linkage with the second equipment; storing the linkage condition to the second device.
According to an aspect of an embodiment of the present application, there is provided another method for linking devices, including: judging whether the equipment state of the first equipment is changed or not; if the equipment state of the first equipment is changed, acquiring latest first state information from the first equipment through Message Queue Telemetry Transmission (MQTT) and storing the latest first state information to a first theme; and pushing the first state information to second equipment so that the second equipment controls the equipment state of the second equipment through the first state information, wherein the first equipment and the second equipment are connected with an MQTT server through message middleware.
Further, before pushing the first state information to the second device, the method further comprises: receiving a control instruction submitted by a control terminal, wherein the control instruction is used for indicating the mutual linkage of the first equipment and the second equipment and linkage conditions; judging whether the first device and the second device are in the same family group; and if the first equipment and the second equipment are in the same family group, the control instruction is sent to the second equipment.
Further, determining whether the first device and the second device are in the same family group includes: acquiring a first MAC address of the first device and acquiring a second MAC address of the second device; searching a first family ID to which the first MAC address belongs and a second family ID to which the second MAC address belongs;
judging whether the first family ID is the same as the second family ID; and if the first family ID is the same as the second family ID, determining that the first equipment and the second equipment are in the same family group.
According to another aspect of the embodiments of the present application, there is also provided an apparatus for linking devices, including: the acquisition module is used for acquiring first state information of the first equipment; the judging module is used for judging whether the first state information of the first equipment meets a preset linkage condition or not; and the control module is used for controlling the equipment state of the second equipment if the preset linkage condition is met.
Further, the acquisition module comprises: the system comprises a first receiving unit, a second receiving unit and a third receiving unit, wherein the first receiving unit is used for receiving a first theme message sent by a message queue telemetry transmission MQTT server, and the MQTT server is connected with first equipment and second equipment through message middleware; a first extracting unit, configured to extract a device identifier of the first device from the first subject message; a first judging unit, configured to judge whether the first device and the second device are in a same family group based on the device identifier; a second extracting unit, configured to extract the first status information from the first topic message if the first device and the second device are in the same family group.
Further, the apparatus further comprises: the generating module is used for generating second state information of the second equipment after the control module controls the equipment state of the second equipment; the searching module is used for searching a second theme matched with the second state information; and the pushing module is used for pushing the second state information serving as the load data of the second theme to the MQTT server.
Further, the apparatus further comprises: the receiving module is used for receiving a control instruction sent by an MQTT server before the judging module judges whether the first state information of the first equipment meets the preset linkage condition, wherein the control instruction is used for indicating the linkage condition for linkage with the second equipment; and the storage module is used for storing the linkage condition to the second equipment.
According to another aspect of the embodiments of the present application, there is also provided an apparatus for linking devices, including: the judging module is used for judging whether the equipment state of the first equipment is changed or not; the acquisition module is used for acquiring latest first state information from the first equipment through Message Queue Telemetry Transmission (MQTT) and storing the latest first state information to a first theme if the equipment state of the first equipment is changed; and the pushing module is used for pushing the first state information to second equipment so that the second equipment controls the equipment state of the second equipment through the first state information, wherein the first equipment and the second equipment are connected with the MQTT server through message middleware.
Further, the apparatus further comprises: the receiving module is used for receiving a control instruction submitted by a control terminal, wherein the control instruction is used for indicating the mutual linkage of the first equipment and the second equipment and the linkage condition; the second judgment module is used for judging whether the first equipment and the second equipment are in the same family group; and the issuing module is used for issuing the control command to the second equipment if the first equipment and the second equipment are in the same family group.
Further, the second determination module includes: a first obtaining unit, configured to obtain a first MAC address of the first device, and obtain a second MAC address of the second device; a first searching unit, configured to search for a first home ID to which the first MAC address belongs and a second home ID to which the second MAC address belongs; a first judgment unit configured to judge whether the first home ID is the same as the second home ID; a first determining unit, configured to determine that the first device and the second device are in the same family group if the first family ID is the same as the second family ID.
According to another aspect of the embodiments of the present application, there is also provided an apparatus for linking devices, including: the first judgment module is used for judging whether the equipment state of the first equipment is changed or not; the acquisition module is used for acquiring latest first state information from the first equipment through Message Queue Telemetry Transmission (MQTT) and storing the latest first state information to a first theme if the equipment state of the first equipment is changed; and the pushing module is used for pushing the first state information to second equipment so that the second equipment controls the equipment state of the second equipment through the first state information, wherein the first equipment and the second equipment are connected with the MQTT server through message middleware.
Further, the apparatus further comprises: the receiving module is used for receiving a control instruction submitted by a control terminal before the pushing module pushes the first state information to the second equipment, wherein the control instruction is used for indicating the mutual linkage and linkage conditions of the first equipment and the second equipment; the second judgment module is used for judging whether the first equipment and the second equipment are in the same family group; and the issuing module is used for issuing the control command to the second equipment if the first equipment and the second equipment are in the same family group.
Further, the second determination module includes: an obtaining unit, configured to obtain a first MAC address of the first device and obtain a second MAC address of the second device; a searching unit, configured to search for a first home ID to which the first MAC address belongs and a second home ID to which the second MAC address belongs; a determination unit configured to determine whether the first home ID is the same as the second home ID; a determining unit, configured to determine that the first device and the second device are in the same family group if the first family ID is the same as the second family ID.
According to another aspect of the embodiments of the present application, there is also provided a storage medium including a stored program, wherein the program performs the above-mentioned method steps when executed.
According to another aspect of the embodiments of the present application, there is also provided an electronic device, including a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete communication with each other through the communication bus; wherein: a memory for storing a computer program; a processor for executing the above method steps by executing the program stored in the memory.
Embodiments of the present application also provide a computer program product containing instructions, which when run on a computer, cause the computer to perform the steps of the above method.
According to the invention, first state information of the first equipment is obtained; judging whether the first state information of the first equipment meets a preset linkage condition or not; if the preset linkage condition is met, the equipment state of the second equipment is controlled, the state information of the first equipment is obtained through the second equipment, whether the second equipment needs linkage control or not is judged, the technical problem that equipment linkage consumes server resources in the prior art is solved, mutual subscription and linkage control among the equipment are achieved, when the equipment reaches the preset linkage condition, the preset linkage condition is judged through the equipment, preset operation is executed to achieve linkage among the equipment, and consumption of the server resources is reduced.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
FIG. 1 is a block diagram of the hardware architecture of a device of an embodiment of the present invention;
FIG. 2 is a flow chart of a method of linking equipment according to an embodiment of the present invention;
FIG. 3 is a flow chart of another method of device linkage according to an embodiment of the present invention;
FIG. 4 is an overall flow chart of a method of device linkage according to an embodiment of the present invention;
FIG. 5 is a block diagram of an apparatus for linkage of equipment according to an embodiment of the present invention;
fig. 6 is a block diagram of another apparatus linkage according to an embodiment of the present invention.
Detailed Description
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only partial embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application. It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict.
It should be noted that the terms "first," "second," and the like in the description and claims of this application and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example 1
The method provided by the first embodiment of the application can be executed in smart home equipment, an MQTT server or similar operation devices. Taking the operation on the smart home device as an example, fig. 1 is a hardware structure block diagram of the smart home device according to the embodiment of the present invention. As shown in fig. 1, the smart home device may include one or more processors 102 (only one is shown in fig. 1) (the processor 102 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA), and a memory 104 for storing data, and optionally, the smart home device may further include a transmission device 106 for communication function and an input/output device 108. It can be understood by those skilled in the art that the structure shown in fig. 1 is only an illustration, and does not limit the structure of the smart home device. For example, smart home devices may also include more or fewer components than shown in FIG. 1, or have a different configuration than shown in FIG. 1.
The memory 104 may be used to store a smart home device program, for example, a software program and a module of application software, such as a device linkage program corresponding to a device linkage method in an embodiment of the present invention, and the processor 102 executes various functional applications and data processing by running the device linkage program stored in the memory 104, that is, implementing the method described above. The memory 104 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include memory located remotely from the processor 102, which may be connected to the smart home devices via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 106 is used to receive or transmit data via a network. The specific example of the network may include a wireless network provided by a communication provider of the smart home device. In one example, the transmission device 106 includes a Network adapter (NIC) that can be connected to other Network devices through a base station to communicate with the internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module, which is used to communicate with the internet in a wireless manner.
In the present embodiment, a method for linking devices is provided, and fig. 2 is a flowchart of a method for linking devices according to an embodiment of the present invention, applied to a second device, as shown in fig. 2, the flowchart includes the following steps:
step S202, acquiring first state information of first equipment;
in one implementation manner of this embodiment, the second device acquires the first state information of the first device, where the first state information represents the current state information of the first device, and the state information may be changed, and when the state information of the first device is changed, the first state information is changed into new first state information. Optionally, the number of the second devices is greater than or equal to one, and here, multiple devices may also obtain the first state information of the first device at the same time.
Step S204, judging whether the first state information of the first equipment meets a preset linkage condition;
in an implementation manner of this embodiment, after the second device receives the first state information of the first device, it is determined whether the first state information of the first device meets a preset linkage condition, where the preset linkage condition is stored in the second device, optionally, the number of the second devices is greater than or equal to one, where there may also be multiple devices that simultaneously determine whether the first state information of the first device meets the preset linkage condition, so as to implement a timely linkage operation of the multiple smart home devices.
And step S206, if the preset linkage condition is met, controlling the equipment state of the second equipment.
In an implementation manner of this embodiment, when the state of the first device meets the linkage condition preset in the second device before, the second device changes its state to complete the linkage between the devices, optionally, the number of the second devices is greater than or equal to one, and multiple devices can be linked at the same time, thereby avoiding the problem of complex operation caused by controlling multiple devices.
Through the steps, first state information of the first equipment is obtained; judging whether the first state information of the first equipment meets a preset linkage condition or not; if the preset linkage condition is met, the equipment state of the second equipment is controlled, the state information of the first equipment is obtained through the second equipment, whether the second equipment needs linkage control or not is judged, the technical problem that equipment linkage consumes server resources in the prior art is solved, mutual subscription and linkage control among the equipment are achieved, when the equipment reaches the preset linkage condition, the preset linkage condition is judged through the equipment, preset operation is executed to achieve linkage among the equipment, and consumption of server resources is reduced.
In this embodiment, acquiring the first state information of the first device includes:
s11, receiving a first theme Message sent by a Message Queue Telemetry Transport (MQTT) server, wherein the MQTT server is connected with the first device and the second device through a Message middleware;
the first subject message includes state information of the first device, identification information of the device, and the like, and the second device can analyze the ciphertext through the server public key and the device public key after receiving the data in the first subject message.
S12, extracting the equipment identification of the first equipment from the first theme message;
the subscribed first subject message contains device identification, such as MAC address information of the device, etc., because such identification information is unique, the device-related family dependency can be queried through such unique information.
S13, judging whether the first device and the second device are in the same family group or not based on the device identification;
and S14, if the first device and the second device are in the same family group, extracting the first state information from the first theme message.
In the above steps, whether the devices are in the same family group is queried through the device identifiers, and if yes, the first state information can be extracted from the first theme message. The definition of the family group is determined by the user through the actual situation, the number of the devices in the family group can be set, the family group can comprise more than two devices, the user can pull other users into the family group, and at the moment, the devices of the two parties are in the same family group.
The first state information can be extracted from the first theme message only after the equipment is identified and inquired in the same family group, optionally, the step of inquiring whether the equipment is in the same family group or not can be carried out before the equipment subscribes the theme, whether the equipment is in the same family group or not is firstly inquired and judged by the equipment identification, the corresponding themes can be mutually subscribed between the equipment when the equipment is in the same family group, so that the linkage safety of the equipment is ensured, and then the state information in the theme can be acquired without judging whether the equipment is in the same family group or not.
In this embodiment, after controlling the device state of the second device, the method further includes: generating second state information of the second device; searching a second subject matched with the second state information; and pushing the second state information serving as the load data of the second theme to an MQTT server.
After the device state of the second device is changed in the above steps, current second state information is generated and recorded, a second theme matched with the second state information is searched, and data is pushed to the MQTT server, where the current second state information is provided for subscribing other devices, and different devices correspond to corresponding themes.
Optionally, after the state information of the second device is changed, after the other devices acquire the second state information of the second device in the second theme, whether preset linkage conditions related to the second device, stored in the other devices, are met is continuously judged, and if the preset linkage conditions related to the second device are met, the linkage conditions of the devices can be set through linkage of the other devices, so that the devices are sequentially judged to be linked.
In this embodiment, before determining whether the first state information of the first device satisfies the preset linkage condition, the method further includes: receiving a control instruction issued by an MQTT server, wherein the control instruction is used for indicating a linkage condition for linkage with the second equipment; storing the linkage condition to the second device.
The steps store the preset linkage conditions to the equipment by receiving the control instruction issued by the MQTT server, and the issuing of the linkage conditions needs to be confirmed by the server, namely the equipment of the same family group can be linked, so that the linkage safety is ensured.
In this embodiment, a method for linking devices is further provided, and fig. 3 is a flowchart of another method for linking devices according to an embodiment of the present invention, which is applied to an MQTT server, as shown in fig. 3, the flowchart includes the following steps:
step S302, judging whether the equipment state of the first equipment is changed;
step S304, if the equipment state of the first equipment is changed, obtaining the latest first state information from the first equipment through message queue telemetry transmission MQTT, and storing the latest first state information to a first theme;
step S306, pushing the first state information to a second device, so that the second device controls a device state of the second device through the first state information, where the first device and the second device are connected to an MQTT server through a message middleware.
In an implementation manner of this embodiment, the MQTT server determines whether state information of the first device changes, and if the state information of the first device changes, acquires the latest first state information of the first device, stores the latest first state information to the first theme, and pushes the first state information to the second device through the message middleware. When the device state information changes, the data is sent to an IOT (Internet of Things) server through the MQTT, the data is encrypted through a device secret key when the device sends the data, and the IOT server decrypts through a server public key. After data are decrypted, encryption protection is carried out by using a secret key of the server and the data are forwarded to the MQTT server, the IOT server and the MQTT server are mutually independent and can interact through a network, the public key of the server is solidified into the server by both the IOT server and the MQTT server when the server is established, and the public key of equipment in the equipment is also solidified into the equipment. Since the server public key is not transmitted through the network but is solidified in the device, there is no possibility of leakage, i.e., security is guaranteed.
In the embodiment, the server does not need to issue the control command for linkage, so that the problems of linkage failure and the like caused by the loss of the issued command do not need to be worried about, and the usability of the linkage method is ensured.
In this embodiment, before pushing the first state information to the second device, the method further includes: receiving a control instruction submitted by a control terminal, wherein the control instruction is used for indicating the mutual linkage of the first equipment and the second equipment and linkage conditions; judging whether the first device and the second device are in the same family group; and if the first equipment and the second equipment are in the same family group, the control instruction is sent to the second equipment.
In the above steps, the user presets the linkage condition by submitting the control instruction to the control terminal, the server judges that the equipment sends the preset linkage condition to the equipment after judging the equipment in the same family group, the linkage safety is ensured, and the equipment can acquire the equipment state information in the theme after judging the equipment in the same family group or can subscribe the corresponding theme after judging the equipment in the same family group in the previous step, so that the double safety guarantee of equipment linkage is realized.
In this embodiment, determining whether the first device and the second device are in the same family group includes: acquiring a first MAC address of the first device and acquiring a second MAC address of the second device; searching a first family ID of the first MAC address and a second family ID of the second MAC address; judging whether the first family ID is the same as the second family ID; and if the first family ID is the same as the second family ID, determining that the first equipment and the second equipment are in the same family group.
Optionally, in the above step, the number of the obtained MAC addresses is greater than or equal to two, and the number of the searched home IDs is defined by the user according to the actual situation.
Fig. 4 is an overall flowchart of a method for linking devices according to an embodiment of the present invention, including: a device state change; encrypting by using the equipment key; the IOT server decrypts the data by using the server public key and encrypts and transmits the data to the MQTT server by using the server public key; devices of the same family group subscribe to each other; judging whether the equipment reaches a preset condition or not; if the preset condition is met, the devices are linked.
Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus necessary general mechanical equipment, and certainly can also be implemented by hardware, but the former is a better embodiment in many cases. Based on such understanding, the technical solution of the present invention or portions thereof contributing to the prior art may be embodied in the form of software controlled mechanical device, where the software is stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk), and includes several instructions for enabling a mechanical device (e.g. smart home device, etc.) to execute the method according to the embodiments of the present invention.
Example 2
In this embodiment, a device for linking equipment is further provided, which is used to implement the foregoing embodiments and preferred embodiments, and the description that has been given is omitted. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. Although the means described in the embodiments below are preferably implemented in software, an implementation in hardware, or a combination of software and hardware is also possible and contemplated.
Fig. 5 is a block diagram of an apparatus for linking devices according to an embodiment of the present invention, applied to a first device, as shown in fig. 5, the apparatus including: an acquisition module 50, a determination module 52, a control module 54, wherein,
an obtaining module 50, configured to obtain first state information of a first device;
the judging module 52 is configured to judge whether the first state information of the first device meets a preset linkage condition;
and the control module 54 is configured to control the device state of the second device if the preset linkage condition is met.
Optionally, the obtaining module includes: the system comprises a first receiving unit, a second receiving unit and a third receiving unit, wherein the first receiving unit is used for receiving a first theme message sent by a message queue telemetry transmission MQTT server, and the MQTT server is connected with the first equipment and the second equipment through message middleware; a first extracting unit, configured to extract a device identifier of the first device from the first subject message; a first judging unit, configured to judge whether the first device and the second device are in a same family group based on the device identifier; a second extracting unit, configured to extract the first status information from the first topic message if the first device and the second device are in the same family group.
Optionally, the apparatus further comprises: the generating module is used for generating second state information of the second equipment after the control module controls the equipment state of the second equipment; the searching module is used for searching a second theme matched with the second state information; and the pushing module is used for pushing the second state information serving as the load data of the second theme to an MQTT server.
Optionally, the apparatus further comprises: the receiving module is used for receiving a control instruction sent by an MQTT server before the judging module judges whether the first state information of the first equipment meets the preset linkage condition, wherein the control instruction is used for indicating the linkage condition for linkage with the second equipment; and the storage module is used for storing the linkage condition to the second equipment.
Fig. 6 is a block diagram of another device linkage apparatus according to an embodiment of the present invention, which is applied to an MQTT server, and as shown in fig. 6, the apparatus includes: a first determining module 60, an obtaining module 62, and a pushing module 64, wherein,
a first determining module 60, configured to determine whether a device state of the first device changes;
an obtaining module 62, configured to obtain latest first state information from the first device through message queue telemetry transmission MQTT if a device state of the first device changes, and store the latest first state information in a first theme;
and a pushing module 64, configured to push the first state information to a second device, so that the second device controls a device state of the second device through the first state information, where the first device and the second device are connected to an MQTT server through message middleware.
Optionally, the apparatus further comprises: the receiving module is used for receiving a control instruction submitted by a control terminal before the pushing module pushes the first state information to the second equipment, wherein the control instruction is used for indicating the mutual linkage and linkage condition of the first equipment and the second equipment; the second judgment module is used for judging whether the first equipment and the second equipment are in the same family group; and the issuing module is used for issuing the control command to the second equipment if the first equipment and the second equipment are in the same family group.
Optionally, the second determining module includes: an obtaining unit, configured to obtain a first MAC address of the first device, and obtain a second MAC address of the second device; a searching unit, configured to search for a first home ID to which the first MAC address belongs and a second home ID to which the second MAC address belongs; a determination unit configured to determine whether the first home ID is the same as the second home ID; a determining unit, configured to determine that the first device and the second device are in the same family group if the first family ID is the same as the second family ID.
The embodiment also provides a system, which comprises the first device and the second device in the above embodiments, and an MQTT server.
It should be noted that, the above modules may be implemented by software or hardware, and for the latter, the following may be implemented, but not limited to: the modules are all positioned in the same processor; alternatively, the modules are located in different processors in any combination.
Example 3
An embodiment of the present invention further provides a storage medium having a computer program stored therein, wherein the computer program is configured to perform the steps in any of the method embodiments described above when executed.
Alternatively, in the present embodiment, the storage medium may be configured to store a computer program for executing the steps of:
s1, acquiring first state information of first equipment;
s2, judging whether the first state information of the first equipment meets a preset linkage condition or not;
and S3, if the preset linkage condition is met, controlling the equipment state of the second equipment.
Optionally, in this embodiment, the storage medium may be further configured to store a computer program for executing the following steps:
s1, judging whether the equipment state of the first equipment is changed or not;
s2, if the equipment state of the first equipment is changed, obtaining the latest first state information from the first equipment through message queue telemetry transmission MQTT, and storing the latest first state information to a first theme;
and S3, pushing the first state information to second equipment so that the second equipment controls the equipment state of the second equipment through the first state information, wherein the first equipment and the second equipment are connected with an MQTT server through message middleware.
Optionally, in this embodiment, the storage medium may include, but is not limited to: various media capable of storing computer programs, such as a usb disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk.
Embodiments of the present invention also provide an electronic device comprising a memory having a computer program stored therein and a processor arranged to run the computer program to perform the steps of any of the above method embodiments.
Optionally, the electronic device may further include a transmission device and an input/output device, wherein the transmission device is connected to the processor, and the input/output device is connected to the processor.
Optionally, in this embodiment, the processor may be configured to execute the following steps by a computer program:
s1, acquiring first state information of first equipment;
s2, judging whether the first state information of the first equipment meets a preset linkage condition or not;
and S3, if the preset linkage condition is met, controlling the equipment state of the second equipment.
Optionally, in this embodiment, the processor may be further configured to execute, by the computer program, the following steps:
s1, judging whether the equipment state of the first equipment is changed or not;
s2, if the equipment state of the first equipment is changed, obtaining the latest first state information from the first equipment through message queue telemetry transmission MQTT, and storing the latest first state information to a first theme;
and S3, pushing the first state information to second equipment so that the second equipment controls the equipment state of the second equipment through the first state information, wherein the first equipment and the second equipment are connected with an MQTT server through message middleware.
Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation manners, and this embodiment is not described herein again.
The above-mentioned serial numbers of the embodiments of the present application are merely for description and do not represent the merits of the embodiments.
In the above embodiments of the present application, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed technical content can be implemented in other manners. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one type of division of logical functions, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one position, or may be distributed on multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit may be implemented in the form of hardware, or may also be implemented in the form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
The foregoing is only a preferred embodiment of the present application and it should be noted that, as will be apparent to those skilled in the art, numerous modifications and adaptations can be made without departing from the principles of the present application and such modifications and adaptations are intended to be considered within the scope of the present application.

Claims (9)

1. A method of linking devices, comprising:
acquiring first state information of first equipment;
judging whether the first state information of the first equipment meets a preset linkage condition or not;
if the preset linkage condition is met, controlling the equipment state of the second equipment;
wherein the acquiring of the first state information of the first device includes:
receiving a first theme message sent by a Message Queue Telemetry Transmission (MQTT) server, wherein the MQTT server is connected with the first device and the second device through message middleware;
extracting a device identification of the first device from the first subject message;
judging whether the first device and the second device are in the same family group or not based on the device identification;
and if the first device and the second device are in the same family group, extracting the first state information from the first theme message.
2. A method of linking devices according to claim 1, wherein after controlling the device state of the second device, the method further comprises:
generating second state information of the second device;
searching a second theme matched with the second state information;
and pushing the second state information serving as the load data of the second theme to an MQTT server.
3. The method for linking the devices according to claim 1, wherein before determining whether the first state information of the first device satisfies the preset linking condition, the method further comprises:
receiving a control instruction issued by an MQTT server, wherein the control instruction is used for indicating a linkage condition for linkage with the second equipment;
storing the linkage condition to the second device.
4. A method of linking devices, comprising:
judging whether the equipment state of the first equipment is changed or not;
if the equipment state of the first equipment is changed, acquiring the latest first state information from the first equipment through Message Queue Telemetry Transmission (MQTT) and storing the latest first state information to a first theme;
the first state information is pushed to second equipment, so that the second equipment controls the equipment state of the second equipment through the first state information, wherein the first equipment and the second equipment are connected with an MQTT server through message middleware;
wherein obtaining the latest first state information from the first device via message queue telemetry transport MQTT comprises:
receiving a first subject message sent by a message queue telemetry transmission MQTT server;
extracting a device identification of the first device from the first subject message;
judging whether the first device and the second device are in the same family group or not based on the device identification;
and if the first device and the second device are in the same family group, extracting the latest first state information from the first theme message.
5. The method of device linkage according to claim 4, wherein prior to pushing the first status information to the second device, the method further comprises:
receiving a control instruction submitted by a control terminal, wherein the control instruction is used for indicating the mutual linkage of the first equipment and the second equipment and linkage conditions;
judging whether the first device and the second device are in the same family group;
and if the first equipment and the second equipment are in the same family group, the control instruction is sent to the second equipment.
6. The method of claim 5, wherein determining whether the first device and the second device are in the same family group comprises:
acquiring a first MAC address of the first device and acquiring a second MAC address of the second device;
searching a first family ID to which the first MAC address belongs and a second family ID to which the second MAC address belongs;
judging whether the first family ID is the same as the second family ID;
and if the first family ID is the same as the second family ID, determining that the first equipment and the second equipment are in the same family group.
7. An apparatus for linking devices, comprising:
the acquisition module is used for acquiring first state information of the first equipment;
the judging module is used for judging whether the first state information of the first equipment meets a preset linkage condition;
the control module is used for controlling the equipment state of the second equipment if the preset linkage condition is met;
the acquisition module includes: the system comprises a first receiving unit, a second receiving unit and a third receiving unit, wherein the first receiving unit is used for receiving a first theme message sent by a message queue telemetry transmission MQTT server, and the MQTT server is connected with the first equipment and the second equipment through message middleware; a first extracting unit, configured to extract a device identifier of the first device from the first subject message;
a first judging unit, configured to judge whether the first device and the second device are in a same family group based on the device identifier; a second extracting unit, configured to extract the first status information from the first topic message if the first device and the second device are in the same family group.
8. A storage medium, characterized in that the storage medium comprises a stored program, wherein the program is operative to perform the method steps of any of the preceding claims 1 to 6.
9. An electronic device comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus; wherein:
a memory for storing a computer program;
a processor for performing the method steps of any of claims 1 to 6 by executing a program stored on a memory.
CN202111506142.1A 2021-12-10 2021-12-10 Equipment linkage method and device, storage medium and electronic equipment Active CN114205178B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111506142.1A CN114205178B (en) 2021-12-10 2021-12-10 Equipment linkage method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111506142.1A CN114205178B (en) 2021-12-10 2021-12-10 Equipment linkage method and device, storage medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN114205178A CN114205178A (en) 2022-03-18
CN114205178B true CN114205178B (en) 2022-10-11

Family

ID=80652408

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111506142.1A Active CN114205178B (en) 2021-12-10 2021-12-10 Equipment linkage method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN114205178B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114785850A (en) * 2022-05-07 2022-07-22 北京卡特加特智能科技有限公司 Scene linkage synchronization method and system

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111629259A (en) * 2020-05-22 2020-09-04 海信视像科技股份有限公司 Image quality adjusting method and display device
CN113141383A (en) * 2020-01-18 2021-07-20 佛山市云米电器科技有限公司 Device information subscription method, client, server, system and storage medium

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10057077B2 (en) * 2014-10-29 2018-08-21 Xiaomi Inc. Method and server for controlling smart devices based on predefined scenario mode
US10523537B2 (en) * 2015-06-30 2019-12-31 Amazon Technologies, Inc. Device state management
CN106357745A (en) * 2016-08-29 2017-01-25 北京小米移动软件有限公司 Linkage method and device for intelligent terminals
CN107179698A (en) * 2017-05-25 2017-09-19 青岛海信日立空调系统有限公司 The inter-linked controlling method and device of a kind of home appliance
CN113542078A (en) * 2020-04-14 2021-10-22 深圳爱根斯通科技有限公司 Equipment linkage method and device, electronic equipment and storage medium
CN112099968A (en) * 2020-08-26 2020-12-18 珠海格力电器股份有限公司 Equipment control method, device, system, storage medium and electronic device
CN112073273B (en) * 2020-08-26 2022-05-17 北京小米移动软件有限公司 Device state control method, device state control apparatus, and storage medium
CN112230616A (en) * 2020-10-28 2021-01-15 腾讯科技(深圳)有限公司 Linkage control method and device and linkage middleware
CN113516331A (en) * 2020-11-25 2021-10-19 腾讯科技(深圳)有限公司 Building data processing method and device
CN113741273A (en) * 2021-09-01 2021-12-03 珠海太川云社区技术股份有限公司 Multi-gateway scene linkage control method and system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113141383A (en) * 2020-01-18 2021-07-20 佛山市云米电器科技有限公司 Device information subscription method, client, server, system and storage medium
CN111629259A (en) * 2020-05-22 2020-09-04 海信视像科技股份有限公司 Image quality adjusting method and display device

Also Published As

Publication number Publication date
CN114205178A (en) 2022-03-18

Similar Documents

Publication Publication Date Title
CN112995348B (en) Control method, device and system of Internet of things equipment
CN102802059B (en) The method of configuration machine top box, Apparatus and system
US11449319B2 (en) Method and apparatus for downloading bundle to smart secure platform by using activation code
CN104137618A (en) Shared network access via a peer-to-peer link
CN106789378B (en) Information prevents leakage method and system in smart home
CN107041171B (en) Low-power-consumption Bluetooth BLE device, data updating system and method
CN106713004B (en) Router adaptation method and system
CN112130461A (en) Smart home control method and device, storage medium and electronic device
CN112689316B (en) Binding method and device of intelligent equipment, storage medium and electronic device
CN114205178B (en) Equipment linkage method and device, storage medium and electronic equipment
CN107995247A (en) A kind of document transmission method, server and system
CN113433831A (en) Control method and module of intelligent household equipment and storage medium
CN112637931A (en) Method and device for establishing network connection
CN111859127A (en) Subscription method and device of consumption data and storage medium
CN111541772A (en) Intelligent reminding method and system and cloud server
CN107872533B (en) Information-pushing method, device, server and storage medium
CN106452828A (en) Provision protocol transmission-based terminal configuration method and system
CN111787514A (en) Method and device for acquiring equipment control data, storage medium and electronic device
CN111141015A (en) Remote air conditioner control method
CN113076380B (en) Data synchronization method, device, system, equipment and storage medium
CN103763087A (en) Information processing method and electronic devices
CN114301989A (en) Information transmission method, device and system
CN114019821A (en) Smart home control method, device and system
CN109151014B (en) NAN-based intelligent management method and related product
CN111208743A (en) Intelligent household equipment, control method thereof and intelligent household system

Legal Events

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