CN114040323B - Control method and device of equipment, storage medium and electronic device - Google Patents
Control method and device of equipment, storage medium and electronic device Download PDFInfo
- Publication number
- CN114040323B CN114040323B CN202111276217.1A CN202111276217A CN114040323B CN 114040323 B CN114040323 B CN 114040323B CN 202111276217 A CN202111276217 A CN 202111276217A CN 114040323 B CN114040323 B CN 114040323B
- Authority
- CN
- China
- Prior art keywords
- equipment
- authenticated
- control
- determined
- distance
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 43
- 238000004590 computer program Methods 0.000 claims description 12
- 230000004044 response Effects 0.000 claims description 8
- 238000010586 diagram Methods 0.000 description 8
- 238000006243 chemical reaction Methods 0.000 description 7
- 230000005540 biological transmission Effects 0.000 description 6
- 238000012360 testing method Methods 0.000 description 4
- 238000004891 communication Methods 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 3
- 230000006870 function Effects 0.000 description 3
- 230000008569 process Effects 0.000 description 3
- 238000012790 confirmation Methods 0.000 description 2
- 230000006872 improvement Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 238000011161 development Methods 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W4/00—Services specially adapted for wireless communication networks; Facilities therefor
- H04W4/06—Selective distribution of broadcast services, e.g. multimedia broadcast multicast service [MBMS]; Services to user groups; One-way selective calling services
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/10—Active monitoring, e.g. heartbeat, ping or trace-route
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W12/00—Security arrangements; Authentication; Protecting privacy or anonymity
- H04W12/04—Key management, e.g. using generic bootstrapping architecture [GBA]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W4/00—Services specially adapted for wireless communication networks; Facilities therefor
- H04W4/02—Services making use of location information
- H04W4/023—Services making use of location information using mutual or relative location information between multiple location based services [LBS] targets or of distance thresholds
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W48/00—Access restriction; Network selection; Access point selection
- H04W48/08—Access restriction or access information delivery, e.g. discovery data delivery
- H04W48/10—Access restriction or access information delivery, e.g. discovery data delivery using broadcasted information
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer Security & Cryptography (AREA)
- Multimedia (AREA)
- Health & Medical Sciences (AREA)
- Cardiology (AREA)
- General Health & Medical Sciences (AREA)
- Selective Calling Equipment (AREA)
Abstract
The invention discloses a control method and device of equipment, a storage medium and an electronic device, wherein the method comprises the following steps: receiving first broadcast data broadcast by to-be-determined equipment, and determining first signal strength of the first broadcast data; determining a first distance between a control device and to-be-determined equipment according to the first signal strength, and sending heartbeat data to the to-be-determined equipment under the condition that the first distance is smaller than a preset threshold value; under the condition that the to-be-determined equipment determines that the second distance between the to-be-determined equipment and the control equipment is smaller than a preset threshold according to the second signal intensity of the heartbeat data, the key of the to-be-determined equipment is obtained, and the to-be-determined equipment is controlled according to the key.
Description
Technical Field
The present invention relates to the field of communications, and in particular, to a method and apparatus for controlling a device, a storage medium, and an electronic apparatus.
Background
Along with development of science and technology and improvement of living standard, the number of intelligent home appliances purchased and used by users is increasing, and before the control device on the market is controlled remotely by the device to be authenticated, in order to ensure that the user of the control device has an operation right to operate the device to be authenticated, the relationship between the control device and the device to be authenticated must be established first, and then the control device can control the device to be authenticated. The prior art of establishing the relationship is that the device to be authenticated is in the state of establishing the relationship by physical triggering, such as powering up the device to be authenticated or triggering a specific key-press mode by the device to be authenticated. The method has high operation threshold for the user, and the user can hardly complete specific operation in the appointed time, so that the equipment to be determined is in the state of the right to be established.
Aiming at the problems that in the related technology, the equipment is in a right waiting state by manual physical operation, and then the control equipment can establish a right relation with the right waiting equipment, and the like, no effective solution is proposed yet.
Disclosure of Invention
The embodiment of the invention provides a control method and a device of equipment, a storage medium and an electronic device, which at least solve the problems that in the related technology, the equipment is in a to-be-authorized state through physical operation by people, and then the control equipment can establish a rights relation with the to-be-authorized equipment.
According to an embodiment of the present invention, there is provided a control method of an apparatus, including: receiving first broadcast data broadcast by to-be-determined equipment, and determining first signal strength of the first broadcast data; determining a first distance between a control device and to-be-determined equipment according to the first signal strength, and sending heartbeat data to the to-be-determined equipment under the condition that the first distance is smaller than a preset threshold value; and under the condition that the to-be-determined equipment determines that the second distance between the to-be-determined equipment and the control equipment is smaller than a preset threshold value according to the second signal intensity of the heartbeat data, acquiring a key of the to-be-determined equipment, and controlling the to-be-determined equipment according to the key.
In an exemplary embodiment, determining a first distance between the control device and the to-be-determined device according to the first signal strength includes: analyzing the equipment state of the equipment to be authorized from the first broadcast data; determining a first attenuation factor according to model information of the control equipment under the condition that the equipment state of the equipment to be determined is the equipment state to be determined, wherein the first attenuation factor is used for indicating the capability of the control equipment for receiving and transmitting signals; and determining a first distance between the control equipment and the right waiting equipment according to the first signal intensity and the first attenuation factor.
In an exemplary embodiment, before obtaining the key of the to-be-authenticated device and controlling the to-be-authenticated device according to the key, the method further includes: analyzing the equipment model of the equipment to be authenticated from the first broadcast data, and acquiring a second attenuation factor of the equipment to be authenticated according to the equipment model of the equipment to be authenticated, wherein the second attenuation factor is used for indicating the capability of the equipment to be authenticated to send and receive signals; transmitting a second attenuation factor to the to-be-determined device to instruct the to-be-determined device to determine the second distance according to the second attenuation factor and a second signal strength of the heartbeat data; and receiving the right confirming information sent by the right waiting device under the condition that the second distance is smaller than a preset threshold, wherein the right confirming information is used for indicating that the control device is allowed to control the right waiting device.
In an exemplary embodiment, obtaining the key of the to-be-authenticated device includes: transmitting request information for acquiring the key of the device to be authenticated to a cloud platform; receiving response information sent by the cloud platform, wherein the response information comprises: and the key of the to-be-authenticated device.
In an exemplary embodiment, after obtaining the key of the to-be-authenticated device, the method further includes: the secret key is sent to the to-be-authenticated device, wherein the to-be-authenticated device adjusts the device state of the to-be-authenticated device into a control state under the condition that the to-be-authenticated device successfully receives the secret key; receiving second broadcast data sent by the right waiting device, wherein the second broadcast data comprises: the device state of the device to be authorized; and determining whether to control the right waiting device according to the device state.
In an exemplary embodiment, determining whether to control the right to wait device according to the device state includes: allowing the right waiting device to be controlled according to the secret key under the condition that the device state of the right waiting device is determined to be a control state; and under the condition that the equipment state of the equipment to be authenticated is determined to be the authentication to be in state, the equipment to be authenticated is forbidden to be controlled according to the secret key.
According to another embodiment of the present invention, there is also provided a control apparatus of a device, including: the receiving module is used for receiving first broadcast data broadcast by the to-be-authorized equipment and determining first signal strength of the first broadcast data; the determining module is used for determining a first distance between the control equipment and the equipment to be authenticated according to the first signal intensity, and sending heartbeat data to the equipment to be authenticated under the condition that the first distance is smaller than a preset threshold value; the control module is used for acquiring a key of the to-be-authenticated device and controlling the to-be-authenticated device according to the key when the to-be-authenticated device determines that the second distance between the to-be-authenticated device and the control device is smaller than a preset threshold according to the second signal intensity of the heartbeat data.
In one exemplary embodiment, further comprising: the determining module is further configured to analyze a device state of the device to be determined from the first broadcast data; determining a first attenuation factor according to model information of the control equipment under the condition that the equipment state of the equipment to be determined is the equipment state to be determined, wherein the first attenuation factor is used for indicating the capability of the control equipment for receiving and transmitting signals; and determining a first distance between the control equipment and the right waiting equipment according to the first signal intensity and the first attenuation factor.
According to still another aspect of the embodiments of the present invention, there is also provided a computer-readable storage medium having a computer program stored therein, wherein the computer program is configured to execute the control method of the above-described apparatus when running.
According to still another aspect of the embodiments of the present invention, there is also provided an electronic apparatus including a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor executes the control method of the device described above through the computer program.
In the embodiment of the invention, first broadcast data broadcast by to-be-authorized equipment is received, and the first signal strength of the first broadcast data is determined; determining a first distance between a control device and to-be-determined equipment according to the first signal strength, and sending heartbeat data to the to-be-determined equipment under the condition that the first distance is smaller than a preset threshold value; under the condition that the second distance between the to-be-determined equipment and the control equipment is smaller than a preset threshold value according to the second signal intensity of the heartbeat data, acquiring a key of the to-be-determined equipment, and controlling the to-be-determined equipment according to the key, namely, determining a first distance between the control equipment and the to-be-determined equipment through the first signal intensity of first broadcast data and determining a second distance between the control equipment and the to-be-determined equipment through the second signal intensity of second broadcast data of the to-be-determined equipment, wherein the control equipment can control the to-be-determined equipment under the condition that the first distance and the first distance are smaller than the preset threshold value.
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 embodiments of the invention and together with the description serve to explain the invention and do not constitute a limitation on the invention. In the drawings:
fig. 1 is a block diagram of a hardware configuration of a mobile terminal of a control method of a device according to an embodiment of the present invention;
fig. 2 is a flowchart of a control method of an apparatus according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a method of controlling an apparatus according to an alternative embodiment of the invention;
fig. 4 is a block diagram (a) of a control device of an apparatus according to an embodiment of the present invention;
fig. 5 is a block diagram (two) of a control device of an apparatus according to an embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present invention and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise 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, system, 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.
The method embodiments provided by the embodiments of the present application may be performed in a mobile terminal, a computer terminal, or similar computing device. Taking the mobile terminal as an example, fig. 1 is a block diagram of a hardware structure of the mobile terminal according to a control method of a device according to an embodiment of the present invention. As shown in fig. 1, a mobile terminal 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 microprocessor MCU or a processing device such as a programmable logic device FPGA) and a memory 104 for storing data, and in one exemplary embodiment, a transmission device 106 for communication functions and an input-output device 108. It will be appreciated by those skilled in the art that the structure shown in fig. 1 is merely illustrative and not limiting of the structure of the mobile terminal described above. For example, a mobile terminal may also include more or fewer components than shown in FIG. 1, or have a different configuration than the equivalent functions shown in FIG. 1 or more than the functions shown in FIG. 1.
The memory 104 may be used to store a computer program, for example, a software program of application software and a module, such as a computer program corresponding to a control method of an apparatus in an embodiment of the present invention, and the processor 102 executes the computer program stored in the memory 104 to perform various functional applications and data processing, that is, to implement the above-mentioned method. 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 remotely located relative to the processor 102, which may be connected to the mobile terminal 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 means 106 is arranged to receive or transmit data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, simply referred to as NIC) that can connect 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 wirelessly.
In this embodiment, a control method of a device is provided, which is applied to the mobile terminal, specifically, to a control device, and fig. 2 is a flowchart of a control method of a device according to an embodiment of the present invention, where the flowchart includes the following steps:
step S202, receiving first broadcast data broadcast by a device to be authorized, and determining first signal strength of the first broadcast data;
step S204, determining a first distance between the control device and the equipment to be authenticated according to the first signal intensity, and sending heartbeat data to the equipment to be authenticated under the condition that the first distance is smaller than a preset threshold value;
step S206, when the to-be-authenticated device determines that the second distance between the to-be-authenticated device and the control device is smaller than the preset threshold according to the second signal strength of the heartbeat data, acquiring a key of the to-be-authenticated device, and controlling the to-be-authenticated device according to the key.
Through the steps, first broadcast data broadcast by the to-be-authorized equipment is received, and first signal strength of the first broadcast data is determined; determining a first distance between a control device and to-be-determined equipment according to the first signal strength, and sending heartbeat data to the to-be-determined equipment under the condition that the first distance is smaller than a preset threshold value; under the condition that the second distance between the to-be-determined equipment and the control equipment is smaller than a preset threshold value according to the second signal intensity of the heartbeat data, acquiring a key of the to-be-determined equipment, and controlling the to-be-determined equipment according to the key, namely, determining a first distance between the control equipment and the to-be-determined equipment through the first signal intensity of first broadcast data and determining a second distance between the control equipment and the to-be-determined equipment through the second signal intensity of second broadcast data of the to-be-determined equipment, wherein the control equipment can control the to-be-determined equipment under the condition that the first distance and the first distance are smaller than the preset threshold value.
In an exemplary embodiment, determining a first distance between the control device and the to-be-determined device according to the first signal strength includes: analyzing the equipment state of the equipment to be authorized from the first broadcast data; determining a first attenuation factor according to model information of the control equipment under the condition that the equipment state of the equipment to be determined is the equipment state to be determined, wherein the first attenuation factor is used for indicating the capability of the control equipment for receiving and transmitting signals; and determining a first distance between the control equipment and the right waiting equipment according to the first signal intensity and the first attenuation factor.
That is, receiving first broadcast data sent by a device to be authenticated and determining a first signal strength corresponding to the first broadcast data, wherein the first broadcast data includes: the equipment state of the equipment to be authorized and the equipment model of the equipment to be authorized; judging whether the equipment to be authenticated can be controlled according to the equipment state of the equipment to be authenticated, wherein the equipment to be authenticated is not connected with other control equipment under the condition that the equipment state of the equipment to be authenticated is the equipment state to be authenticated, so that a first attenuation factor is acquired according to the model information of the control equipment under the condition that the equipment state of the equipment to be authenticated is the equipment state to be authenticated; and calculating a first distance between the control equipment and the to-be-determined equipment according to the first signal intensity and the first attenuation factor, and establishing connection with the to-be-determined equipment under the condition that the first distance is smaller than a preset threshold value.
Specifically, calculating a first distance between the control device and the right waiting device according to the first signal intensity and the first attenuation factor includes: acquiring the first signal intensity, the first attenuation factor and unit first signal intensity; and calculating the distance between the control equipment and the right waiting equipment according to the first signal intensity, the first attenuation factor and the unit first signal intensity.
Further, the formula of the signal strength and distance conversion is: d1 =10 ((abs (rssi 1) -A1)/(10×n1)), wherein: d1 is a first distance, rsti 1 is a first signal intensity, A1 is a signal intensity of a unit distance between the right waiting device and the control device, and n1 is a first attenuation factor.
In an exemplary embodiment, acquiring a key of the to-be-determined device, and analyzing a device model of the to-be-determined device from the first broadcast data before controlling the to-be-determined device according to the key, and acquiring a second attenuation factor of the to-be-determined device according to the device model of the to-be-determined device, wherein the second attenuation factor is used for indicating the capability of the to-be-determined device to send and receive signals; transmitting a second attenuation factor to the to-be-determined device to instruct the to-be-determined device to determine the second distance according to the second attenuation factor and a second signal strength of the heartbeat data; and receiving the right confirming information sent by the right waiting device under the condition that the second distance is smaller than a preset threshold, wherein the right confirming information is used for indicating that the control device is allowed to control the right waiting device.
In other words, receiving first broadcast data sent by a right waiting device and determining first signal strength corresponding to the first broadcast data, wherein the first broadcast data includes: the equipment state of the equipment to be authorized and the equipment model of the equipment to be authorized; according to the equipment model of the equipment to be authenticated, the control equipment acquires a second attenuation factor of the equipment to be authenticated from the cloud platform according to the equipment model of the equipment to be authenticated, the control equipment sends the second attenuation factor and heartbeat data to the equipment to be authenticated through connection between the equipment to be authenticated and the control equipment, the equipment to be authenticated determines a second distance according to the second attenuation factor and second signal intensity under the condition that the second attenuation factor is acquired, and receives the authentication information sent by the equipment to be authenticated under the condition that the second distance is smaller than a preset threshold value. When the cloud platform sends the second attenuation factor to the control device, the cloud platform needs to encrypt the second attenuation factor, the encrypted data control terminal cannot decrypt, only the device to be authenticated can decrypt according to the secret key, and therefore reliability of authentication of the device to be authenticated to the control device is guaranteed.
Further, the formula of the signal strength and distance conversion is: d2 =10 ((abs (rssi 2) -A2)/(10×n2)), wherein: d2 is the first distance, rsti 2 is the first signal strength, A2 is the signal strength of the unit distance between the right waiting device and the control device, and n2 is the first attenuation factor.
In an exemplary embodiment, obtaining the key of the to-be-authenticated device includes: transmitting request information for acquiring the key of the device to be authenticated to a cloud platform; receiving response information sent by the cloud platform, wherein the response information comprises: and the key of the to-be-authenticated device.
That is, after receiving the right confirming information sent by the right waiting device, applying for the key of the right waiting device to the cloud platform, after receiving the key of the right waiting device, the control device stores the key of the right waiting device locally and synchronously sends the key to the right waiting device.
In an exemplary embodiment, after obtaining the key of the right waiting device, sending the key to the right waiting device, where the right waiting device adjusts the device state of the right waiting device to a control state if the right waiting device successfully receives the key; receiving second broadcast data sent by the right waiting device, wherein the second broadcast data comprises: the device state of the device to be authorized; and determining whether to control the right waiting device according to the device state.
It should be noted that, when the to-be-authenticated device receives the key information, the to-be-authenticated device adjusts the device state from the to-be-authenticated state to a control state, and the to-be-authenticated device sends second broadcast data, where the device state of the to-be-authenticated device carried in the second broadcast data is the control state, and when the control device receives the second broadcast data, it determines whether to control the to-be-authenticated device according to the device state carried in the second broadcast data.
In an exemplary embodiment, determining whether to control the right to wait device according to the device state includes: allowing the right waiting device to be controlled according to the secret key under the condition that the device state of the right waiting device is determined to be a control state; and under the condition that the equipment state of the equipment to be authenticated is determined to be the authentication to be in state, the equipment to be authenticated is forbidden to be controlled according to the secret key.
In order to better understand the process of the control method of the above-mentioned device, the following describes the implementation method flow of the control of the above-mentioned device with reference to the alternative embodiment, but is not used to limit the technical solution of the embodiment of the present invention.
As shown in fig. 3, fig. 3 is a schematic diagram of a control method of an apparatus according to an alternative embodiment of the present invention, specifically as follows:
Step S301: the right waiting equipment is powered on, and the fact that the right waiting equipment and the control equipment are in right relation is established at present needs to be explained;
step S302: the method comprises the steps that to-be-authenticated equipment sends first broadcast data at a frequency of 30ms once, and the to-be-authenticated state and the equipment model are carried in the first broadcast data;
step S303: the control equipment tests a first attenuation factor of equipment and a second attenuation factor of the equipment testing mobile phone from the cloud platform mobile phone according to the equipment model of the equipment to be authorized and the equipment model of the control equipment;
when the cloud platform issues the second attenuation factor to the control device, the data needs to be encrypted, the encrypted data cannot be decrypted by the control device, only the device to be authenticated can be decrypted, and the reliability of the authentication of the device to be authenticated to the control device is ensured.
Step S304: the control equipment takes 500ms as a group to collect the signal intensity of the first broadcast data, and averages the signal intensities of a plurality of groups;
step S305: calculating a first distance by using a signal intensity and distance conversion formula and combining a first attenuation factor of mobile phone test equipment, and determining whether the first distance is smaller than a preset distance;
it should be noted that the formula of the signal strength and distance conversion is d=10++abs (rsti) -a)/(10×n), where: d is the first distance, rsti is the signal strength, A is the unit signal strength of the control device and the device to be determined, and n is the first attenuation factor.
Step S306: the control device is wirelessly connected with the right waiting device, and the issuing device tests a second attenuation factor of the mobile phone and issues and connects heartbeat at intervals of 30 ms;
step S307: the equipment to be determined takes 500ms as a group to collect the signal intensity of the heartbeat data, and averages the signal intensities of a plurality of groups;
step S308: calculating a second distance by using a signal intensity and distance conversion formula and combining a second attenuation factor, and determining whether the second distance is smaller than a preset distance;
step S309: transmitting the right confirmation information to the control equipment under the condition that the second distance is smaller than the preset distance;
step S310: after receiving the right confirmation information, the control equipment applies for a right secret key to the cloud platform;
step S311: the control device stores the right secret key locally and sends the right secret key to the device to be confirmed;
step S312: the equipment to be determined determines that the second distance is smaller than the preset distance, receives the rights key, and locally stores the rights key to adjust the equipment state to be a controllable state;
step S313: the control device controls the device to be authenticated using the rights key.
Through the above embodiment, first broadcast data broadcast by the to-be-authenticated device is received, and a first signal strength of the first broadcast data is determined; determining a first distance between a control device and to-be-determined equipment according to the first signal strength, and sending heartbeat data to the to-be-determined equipment under the condition that the first distance is smaller than a preset threshold value; under the condition that the second distance between the to-be-determined equipment and the control equipment is smaller than a preset threshold value according to the second signal intensity of the heartbeat data, acquiring a key of the to-be-determined equipment, and controlling the to-be-determined equipment according to the key, namely, determining a first distance between the control equipment and the to-be-determined equipment through the first signal intensity of first broadcast data and determining a second distance between the control equipment and the to-be-determined equipment through the second signal intensity of second broadcast data of the to-be-determined equipment, wherein the control equipment can control the to-be-determined equipment under the condition that the first distance and the first distance are smaller than the preset threshold value.
From the description of the above embodiments, it will be clear to a person skilled in the art that the method according to the above embodiments may be implemented by means of software plus the necessary general hardware platform, but of course also by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising several instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method of the various embodiments of the present invention.
Fig. 4 is a block diagram (a) of a control device of an apparatus according to an embodiment of the present invention; as shown in fig. 4, includes:
a receiving module 42, configured to receive first broadcast data broadcast by a to-be-authenticated device, and determine a first signal strength of the first broadcast data;
a determining module 44, configured to determine a first distance between the control device and the device to be authorized according to the first signal strength, and send heartbeat data to the device to be authorized if the first distance is less than a preset threshold;
The control module 46 is configured to obtain a key of the to-be-authenticated device when the to-be-authenticated device determines that the second distance between the to-be-authenticated device and the control device is less than a preset threshold according to the second signal strength of the heartbeat data, and control the to-be-authenticated device according to the key.
Receiving first broadcast data broadcast by to-be-authorized equipment through the device, and determining first signal strength of the first broadcast data; determining a first distance between a control device and to-be-determined equipment according to the first signal strength, and sending heartbeat data to the to-be-determined equipment under the condition that the first distance is smaller than a preset threshold value; under the condition that the second distance between the to-be-determined equipment and the control equipment is smaller than a preset threshold value according to the second signal intensity of the heartbeat data, acquiring a key of the to-be-determined equipment, and controlling the to-be-determined equipment according to the key, namely, determining a first distance between the control equipment and the to-be-determined equipment through the first signal intensity of first broadcast data and determining a second distance between the control equipment and the to-be-determined equipment through the second signal intensity of second broadcast data of the to-be-determined equipment, wherein the control equipment can control the to-be-determined equipment under the condition that the first distance and the first distance are smaller than the preset threshold value.
In an exemplary embodiment, the determining module is further configured to parse a device state of the to-be-authenticated device from the first broadcast data; determining a first attenuation factor according to model information of the control equipment under the condition that the equipment state of the equipment to be determined is the equipment state to be determined, wherein the first attenuation factor is used for indicating the capability of the control equipment for receiving and transmitting signals; and determining a first distance between the control equipment and the right waiting equipment according to the first signal intensity and the first attenuation factor.
That is, receiving first broadcast data sent by a device to be authenticated and determining a first signal strength corresponding to the first broadcast data, wherein the first broadcast data includes: the equipment state of the equipment to be authorized and the equipment model of the equipment to be authorized; judging whether the equipment to be authenticated can be controlled according to the equipment state of the equipment to be authenticated, wherein the equipment to be authenticated is not connected with other control equipment under the condition that the equipment state of the equipment to be authenticated is the equipment state to be authenticated, so that a first attenuation factor is acquired according to the model information of the control equipment under the condition that the equipment state of the equipment to be authenticated is the equipment state to be authenticated; and calculating a first distance between the control equipment and the to-be-determined equipment according to the first signal intensity and the first attenuation factor, and establishing connection with the to-be-determined equipment under the condition that the first distance is smaller than a preset threshold value.
Specifically, calculating a first distance between the control device and the right waiting device according to the first signal intensity and the first attenuation factor includes: acquiring the first signal intensity, the first attenuation factor and unit first signal intensity; and calculating the distance between the control equipment and the right waiting equipment according to the first signal intensity, the first attenuation factor and the unit first signal intensity.
Further, the formula of the signal strength and distance conversion is: d1 =10 ((abs (rssi 1) -A1)/(10×n1)), wherein: d1 is a first distance, rsti 1 is a first signal intensity, A1 is a signal intensity of a unit distance between the right waiting device and the control device, and n1 is a first attenuation factor.
In an exemplary embodiment, fig. 5 is a block diagram (ii) of a control apparatus of an apparatus according to an embodiment of the present invention; as shown in fig. 5, the above apparatus further includes an parsing module 52, configured to parse a device model of the to-be-authenticated device from the first broadcast data, and obtain a second attenuation factor of the to-be-authenticated device according to the device model of the to-be-authenticated device, where the second attenuation factor is used to indicate a capability of the to-be-authenticated device to send and receive signals; transmitting a second attenuation factor to the to-be-determined device to instruct the to-be-determined device to determine the second distance according to the second attenuation factor and a second signal strength of the heartbeat data; and receiving the right confirming information sent by the right waiting device under the condition that the second distance is smaller than a preset threshold, wherein the right confirming information is used for indicating that the control device is allowed to control the right waiting device.
In other words, receiving first broadcast data sent by a right waiting device and determining first signal strength corresponding to the first broadcast data, wherein the first broadcast data includes: the equipment state of the equipment to be authorized and the equipment model of the equipment to be authorized; according to the equipment model of the equipment to be authenticated, the control equipment acquires a second attenuation factor of the equipment to be authenticated from the cloud platform according to the equipment model of the equipment to be authenticated, the control equipment sends the second attenuation factor and heartbeat data to the equipment to be authenticated through connection between the equipment to be authenticated and the control equipment, the equipment to be authenticated determines a second distance according to the second attenuation factor and second signal intensity under the condition that the second attenuation factor is acquired, and receives the authentication information sent by the equipment to be authenticated under the condition that the second distance is smaller than a preset threshold value. When the cloud platform sends the second attenuation factor to the control device, the cloud platform needs to encrypt the second attenuation factor, the encrypted data control terminal cannot decrypt, only the device to be authenticated can decrypt according to the secret key, and therefore reliability of authentication of the device to be authenticated to the control device is guaranteed.
Further, the formula of the signal strength and distance conversion is: d2 =10 ((abs (rssi 2) -A2)/(10×n2)), wherein: d2 is the first distance, rsti 2 is the first signal strength, A2 is the signal strength of the unit distance between the right waiting device and the control device, and n2 is the first attenuation factor.
In an exemplary embodiment, the receiving module is further configured to send request information for obtaining a key of the to-be-authenticated device to a cloud platform; receiving response information sent by the cloud platform, wherein the response information comprises: and the key of the to-be-authenticated device.
That is, after receiving the right confirming information sent by the right waiting device, applying for the key of the right waiting device to the cloud platform, after receiving the key of the right waiting device, the control device stores the key of the right waiting device locally and synchronously sends the key to the right waiting device.
In an exemplary embodiment, the receiving module is further configured to send the key to the to-be-authenticated device, where, in a case where the to-be-authenticated device successfully receives the key, the to-be-authenticated device adjusts a device state of the to-be-authenticated device to a control state; receiving second broadcast data sent by the right waiting device, wherein the second broadcast data comprises: the device state of the device to be authorized; and determining whether to control the right waiting device according to the device state.
It should be noted that, when the to-be-authenticated device receives the key information, the to-be-authenticated device adjusts the device state from the to-be-authenticated state to a control state, and the to-be-authenticated device sends second broadcast data, where the device state of the to-be-authenticated device carried in the second broadcast data is the control state, and when the control device receives the second broadcast data, it determines whether to control the to-be-authenticated device according to the device state carried in the second broadcast data.
In an exemplary embodiment, determining whether to control the right to wait device according to the device state includes: allowing the right waiting device to be controlled according to the secret key under the condition that the device state of the right waiting device is determined to be a control state; and under the condition that the equipment state of the equipment to be authenticated is determined to be the authentication to be in state, the equipment to be authenticated is forbidden to be controlled according to the secret key.
An embodiment of the present invention also provides a storage medium including a stored program, wherein the program executes the method of any one of the above.
Alternatively, in the present embodiment, the above-described storage medium may be configured to store program code for performing the steps of:
S1, receiving first broadcast data broadcast by equipment to be authorized, and determining first signal strength of the first broadcast data;
s2, determining a first distance between the control equipment and the equipment to be authenticated according to the first signal intensity, and sending heartbeat data to the equipment to be authenticated under the condition that the first distance is smaller than a preset threshold value;
s3, under the condition that the to-be-determined right equipment determines that the second distance between the to-be-determined right equipment and the control equipment is smaller than a preset threshold value according to the second signal intensity of the heartbeat data, acquiring a key of the to-be-determined right equipment, and controlling the to-be-determined right equipment according to the key.
An embodiment of the invention also provides an electronic device comprising a memory having stored therein a computer program and a processor arranged to run the computer program to perform the steps of any of the method embodiments described above.
Optionally, the electronic apparatus may further include a transmission device and an input/output device, where the transmission device is connected to the processor, and the input/output device is connected to the processor.
Alternatively, in the present embodiment, the above-described processor may be configured to execute the following steps by a computer program:
S1, receiving first broadcast data broadcast by equipment to be authorized, and determining first signal strength of the first broadcast data;
s2, determining a first distance between the control equipment and the equipment to be authenticated according to the first signal intensity, and sending heartbeat data to the equipment to be authenticated under the condition that the first distance is smaller than a preset threshold value;
s3, under the condition that the to-be-determined right equipment determines that the second distance between the to-be-determined right equipment and the control equipment is smaller than a preset threshold value according to the second signal intensity of the heartbeat data, acquiring a key of the to-be-determined right equipment, and controlling the to-be-determined right equipment according to the key.
Alternatively, in the present embodiment, the storage medium may include, but is not limited to: a U-disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a removable hard disk, a magnetic disk, or an optical disk, or other various media capable of storing program codes.
Alternatively, specific examples in this embodiment may refer to examples described in the foregoing embodiments and optional implementations, and this embodiment is not described herein.
It will be appreciated by those skilled in the art that the modules or steps of the invention described above may be implemented in a general purpose computing device, they may be concentrated on a single computing device, or distributed across a network of computing devices, they may alternatively be implemented in program code executable by computing devices, so that they may be stored in a memory device for execution by computing devices, and in some cases, the steps shown or described may be performed in a different order than that shown or described, or they may be separately fabricated into individual integrated circuit modules, or multiple modules or steps within them may be fabricated into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.
The above description is only of the preferred embodiments of the present invention and is not intended to limit the present invention, but various modifications and variations can be made to the present invention by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the principle of the present invention should be included in the protection scope of the present invention.
Claims (9)
1. A control method of an apparatus, applied to a control apparatus, characterized by comprising:
receiving first broadcast data broadcast by to-be-determined equipment, and determining first signal strength of the first broadcast data;
determining a first distance between a control device and to-be-determined equipment according to the first signal strength, and sending heartbeat data to the to-be-determined equipment under the condition that the first distance is smaller than a preset threshold value; acquiring a key of the to-be-determined equipment and controlling the to-be-determined equipment according to the key under the condition that the to-be-determined equipment determines that the second distance between the to-be-determined equipment and the control equipment is smaller than a preset threshold according to the second signal intensity of the heartbeat data;
the method comprises the steps of obtaining a key of the to-be-authenticated device, and before controlling the to-be-authenticated device according to the key, further comprises the steps of:
Analyzing the equipment model of the equipment to be authenticated from the first broadcast data, and acquiring a second attenuation factor of the equipment to be authenticated according to the equipment model of the equipment to be authenticated, wherein the second attenuation factor is used for indicating the capability of the equipment to be authenticated to send and receive signals;
transmitting a second attenuation factor to the to-be-determined device to instruct the to-be-determined device to determine the second distance according to the second attenuation factor and a second signal strength of the heartbeat data; and receiving the right confirming information sent by the right waiting device under the condition that the second distance is smaller than a preset threshold, wherein the right confirming information is used for indicating that the control device is allowed to control the right waiting device.
2. The method for controlling a device according to claim 1, wherein determining a first distance between the control device and the device to be authenticated based on the first signal strength comprises:
analyzing the equipment state of the equipment to be authorized from the first broadcast data;
determining a first attenuation factor according to model information of the control equipment under the condition that the equipment state of the equipment to be determined is the equipment state to be determined, wherein the first attenuation factor is used for indicating the capability of the control equipment for receiving and transmitting signals;
And determining a first distance between the control equipment and the right waiting equipment according to the first signal intensity and the first attenuation factor.
3. The method for controlling the device according to claim 1, wherein obtaining the key of the device to be authenticated comprises:
transmitting request information for acquiring the key of the device to be authenticated to a cloud platform;
receiving response information sent by the cloud platform, wherein the response information comprises: and the key of the to-be-authenticated device.
4. The method of controlling a device according to claim 1, wherein after acquiring the key of the device to be authenticated, the method further comprises:
the secret key is sent to the to-be-authenticated device, wherein the to-be-authenticated device adjusts the device state of the to-be-authenticated device into a control state under the condition that the to-be-authenticated device successfully receives the secret key;
receiving second broadcast data sent by the right waiting device, wherein the second broadcast data comprises: the device state of the device to be authorized;
and determining whether to control the right waiting device according to the device state.
5. The method of controlling a device according to claim 4, wherein determining whether to control the right-to-wait device according to the device state includes:
Allowing the right waiting device to be controlled according to the secret key under the condition that the device state of the right waiting device is determined to be a control state;
and under the condition that the equipment state of the equipment to be authenticated is determined to be the authentication to be in state, the equipment to be authenticated is forbidden to be controlled according to the secret key.
6. A control device of an apparatus, characterized by comprising:
the receiving module is used for receiving first broadcast data broadcast by the to-be-authorized equipment and determining first signal strength of the first broadcast data;
the determining module is used for determining a first distance between the control equipment and the equipment to be authenticated according to the first signal intensity, and sending heartbeat data to the equipment to be authenticated under the condition that the first distance is smaller than a preset threshold value;
the control module is used for acquiring a key of the to-be-authenticated device and controlling the to-be-authenticated device according to the key when the to-be-authenticated device determines that the second distance between the to-be-authenticated device and the control device is smaller than a preset threshold according to the second signal intensity of the heartbeat data;
wherein the apparatus further comprises: the analysis module is used for analyzing the equipment model of the equipment to be authenticated from the first broadcast data and acquiring a second attenuation factor of the equipment to be authenticated according to the equipment model of the equipment to be authenticated, wherein the second attenuation factor is used for indicating the capacity of the equipment to be authenticated to send and receive signals;
Transmitting a second attenuation factor to the to-be-determined device to instruct the to-be-determined device to determine the second distance according to the second attenuation factor and a second signal strength of the heartbeat data; and receiving the right confirming information sent by the right waiting device under the condition that the second distance is smaller than a preset threshold, wherein the right confirming information is used for indicating that the control device is allowed to control the right waiting device.
7. The control device of the apparatus according to claim 6, comprising:
the determining module is further configured to analyze a device state of the device to be determined from the first broadcast data; determining a first attenuation factor according to model information of the control equipment under the condition that the equipment state of the equipment to be determined is the equipment state to be determined, wherein the first attenuation factor is used for indicating the capability of the control equipment for receiving and transmitting signals; and determining a first distance between the control equipment and the right waiting equipment according to the first signal intensity and the first attenuation factor.
8. A computer readable storage medium, characterized in that the computer readable storage medium comprises a stored program, wherein the program when run performs the method of any of the preceding claims 1 to 5.
9. An electronic device comprising a memory and a processor, characterized in that the memory has stored therein a computer program, the processor being arranged to execute the method according to any of the claims 1 to 5 by means of the computer program.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111276217.1A CN114040323B (en) | 2021-10-29 | 2021-10-29 | Control method and device of equipment, storage medium and electronic device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111276217.1A CN114040323B (en) | 2021-10-29 | 2021-10-29 | Control method and device of equipment, storage medium and electronic device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114040323A CN114040323A (en) | 2022-02-11 |
CN114040323B true CN114040323B (en) | 2023-12-19 |
Family
ID=80136074
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111276217.1A Active CN114040323B (en) | 2021-10-29 | 2021-10-29 | Control method and device of equipment, storage medium and electronic device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114040323B (en) |
Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104993981A (en) * | 2015-05-14 | 2015-10-21 | 小米科技有限责任公司 | Method and apparatus for controlling access of device |
CN108632056A (en) * | 2017-03-17 | 2018-10-09 | 阿里云计算有限公司 | A kind of smart machine network collocating method and system |
CN108632814A (en) * | 2017-03-17 | 2018-10-09 | 上海庆科信息技术有限公司 | A kind of terminal device network collocating method and system |
CN111787514A (en) * | 2020-06-28 | 2020-10-16 | 海尔优家智能科技(北京)有限公司 | Method and device for acquiring equipment control data, storage medium and electronic device |
CN112214779A (en) * | 2020-10-28 | 2021-01-12 | 纳恩博(北京)科技有限公司 | Control method and device, electronic equipment and storage medium |
CN112637208A (en) * | 2020-12-23 | 2021-04-09 | 美的集团股份有限公司 | Method for determining authority of target device, electronic device and computer readable storage medium |
CN112804697A (en) * | 2021-01-04 | 2021-05-14 | 珠海格力电器股份有限公司 | Network distribution method and device for equipment to be networked, electronic equipment and computer readable medium |
CN112822630A (en) * | 2021-01-12 | 2021-05-18 | 上海钧正网络科技有限公司 | Data processing method of device and computer-readable storage medium |
CN112866909A (en) * | 2020-12-31 | 2021-05-28 | 广州极飞科技股份有限公司 | Device interaction method, system, electronic device and storage medium |
CN113316222A (en) * | 2021-05-26 | 2021-08-27 | Oppo广东移动通信有限公司 | Data processing method and device, electronic equipment and storage medium |
-
2021
- 2021-10-29 CN CN202111276217.1A patent/CN114040323B/en active Active
Patent Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104993981A (en) * | 2015-05-14 | 2015-10-21 | 小米科技有限责任公司 | Method and apparatus for controlling access of device |
CN108632056A (en) * | 2017-03-17 | 2018-10-09 | 阿里云计算有限公司 | A kind of smart machine network collocating method and system |
CN108632814A (en) * | 2017-03-17 | 2018-10-09 | 上海庆科信息技术有限公司 | A kind of terminal device network collocating method and system |
CN111787514A (en) * | 2020-06-28 | 2020-10-16 | 海尔优家智能科技(北京)有限公司 | Method and device for acquiring equipment control data, storage medium and electronic device |
CN112214779A (en) * | 2020-10-28 | 2021-01-12 | 纳恩博(北京)科技有限公司 | Control method and device, electronic equipment and storage medium |
CN112637208A (en) * | 2020-12-23 | 2021-04-09 | 美的集团股份有限公司 | Method for determining authority of target device, electronic device and computer readable storage medium |
CN112866909A (en) * | 2020-12-31 | 2021-05-28 | 广州极飞科技股份有限公司 | Device interaction method, system, electronic device and storage medium |
CN112804697A (en) * | 2021-01-04 | 2021-05-14 | 珠海格力电器股份有限公司 | Network distribution method and device for equipment to be networked, electronic equipment and computer readable medium |
CN112822630A (en) * | 2021-01-12 | 2021-05-18 | 上海钧正网络科技有限公司 | Data processing method of device and computer-readable storage medium |
CN113316222A (en) * | 2021-05-26 | 2021-08-27 | Oppo广东移动通信有限公司 | Data processing method and device, electronic equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN114040323A (en) | 2022-02-11 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109474977A (en) | A kind of monitoring method of equipment, apparatus and system | |
CN111885115B (en) | Device binding changing method and device | |
CN110461025B (en) | Network distribution method, network distribution device, mobile terminal and intelligent equipment | |
CN109905312B (en) | Message pushing method, device and system | |
CN101432749A (en) | Communications device monitoring | |
EP3099106B1 (en) | Activating a mobile hotspot operation | |
TW201330566A (en) | System and method for facilitating wireless communication | |
CN105103618A (en) | Systems and methods for wirelessly modifying detection characteristics of portable devices | |
CN112822756B (en) | Communication method, system, base station and terminal | |
CN109257793B (en) | Network connection method, device, equipment and storage medium | |
CN104219734A (en) | Internet access method and device for internet device | |
CN105282868A (en) | System and Method for Temporarily Joining a WiFi Network | |
CN110831245B (en) | Network connection method, device and router | |
CN105636161A (en) | Wireless network access method and device, communication terminal and wireless network access point | |
KR20140060793A (en) | Method for providing kids care function using smart-phone, and smart-phone with kids care function | |
US10382961B2 (en) | System and method of preventing unauthorized SIM card usage | |
CN112566078A (en) | Device connection method and apparatus, storage medium, and electronic apparatus | |
CN103974216A (en) | Information processing method and electronic equipment | |
CN105430646B (en) | ZigBee device networking realization method and device and ZigBee device networking system | |
CN114125052A (en) | Target operation execution method and device, storage medium and electronic device | |
CN113965904A (en) | Device registration method, device and storage medium | |
CN114040323B (en) | Control method and device of equipment, storage medium and electronic device | |
CN116347656A (en) | Bluetooth encryption connection method and device and electronic equipment | |
CN110769397A (en) | Method and device for connecting robot with network and terminal equipment | |
CN109379354A (en) | A kind of methods, devices and systems for binding smart machine |
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 |