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
- confirmed
- control
- verified
- distance
- signal strength
- 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 45
- 238000012790 confirmation Methods 0.000 claims description 19
- 230000015654 memory Effects 0.000 claims description 18
- 238000004590 computer program Methods 0.000 claims description 12
- 230000004044 response Effects 0.000 claims description 8
- 238000005516 engineering process Methods 0.000 abstract description 9
- 238000012795 verification Methods 0.000 abstract description 4
- 238000010586 diagram Methods 0.000 description 8
- 230000005540 biological transmission Effects 0.000 description 6
- 238000013475 authorization Methods 0.000 description 4
- 230000008569 process Effects 0.000 description 4
- 238000012360 testing method Methods 0.000 description 4
- 238000004891 communication Methods 0.000 description 3
- 230000006870 function Effects 0.000 description 3
- 238000006243 chemical reaction 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
- 238000012545 processing Methods 0.000 description 2
- 230000001360 synchronised effect Effects 0.000 description 2
- 238000011161 development Methods 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000006467 substitution reaction 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 device control method and device, a storage medium and an electronic device, wherein the above method includes: receiving the first broadcast data broadcast by the device to be confirmed, and determining the first signal strength of the first broadcast data ; Determine the first distance between the control device and the device to be confirmed based on the first signal strength, and when the first distance is less than a preset threshold, send heartbeat data to the device to be confirmed; When the verification device determines that the second distance between the device to be verified and the control device is less than a preset threshold based on the second signal strength of the heartbeat data, it obtains the key of the device to be verified and performs the verification according to the second signal strength of the heartbeat data. The key controls the device to be verified, and the above technical solution can be used to solve the problem in related technologies that requires manual physical operations to put the device in a state of pending verification, so that the control device can carry out ownership with the device to be verified. Relationship building and other issues.
Description
技术领域Technical field
本发明涉及通信领域,具体而言,涉及一种设备的控制方法和装置、存储介质及电子装置。The present invention relates to the field of communications, and specifically, to a device control method and device, a storage medium and an electronic device.
背景技术Background technique
随着科技的发展以及生活水平的提高,用户购买以及使用的智能家电的数量越来越多,目前市场上的控制设备在对待确权设备远程控制前,为了确保控制设备的用户具有对操作待确权设备的操作权限,必须先建立控制设备与待确权设备的所属关系,然后控制设备才能够对待确权设备进行控制。目前市场上能够见到的建立所属关系的方式是,先物理触发使待确权设备处于待建立所属关系的状态,如待确权设备上电或待确权设备触发某种特定的按键方式。这种方式对于用户操作门槛很高,用户很难在指定的时间内,完成特定的操作,使待确权设备处于待建立所属权的状态。With the development of science and technology and the improvement of living standards, the number of smart home appliances purchased and used by users is increasing. The control devices currently on the market must ensure that the user of the control device has the right to operate the device before remotely controlling it. To confirm the operating authority of the device, the ownership relationship between the control device and the device to be confirmed must be established first, and then the control device can control the device to be confirmed. The current method of establishing ownership that can be seen on the market is to first physically trigger the device to be verified to be in a state where the ownership relationship needs to be established, such as powering on the device to be verified or triggering a specific keystroke on the device to be verified. This method has a high threshold for user operations, and it is difficult for users to complete specific operations within a specified time, leaving the device to be confirmed in a state of pending ownership.
针对相关技术中,需要人为通过物理操作,使得设备处于待确权状态,进而控制设备才可以与待确权设备进行权属关系建立等问题,尚未提出有效的解决方案。In related technologies, no effective solution has been proposed for the problem that manual physical operations are required to put the device in a state of pending authorization, so that the control device can establish an ownership relationship with the device to be verified.
发明内容Contents of the invention
本发明实施例提供了一种设备的控制方法和装置、存储介质及电子装置,以至少解决相关技术中,需要人为通过物理操作,使得设备处于待确权状态,进而控制设备才可以与待确权设备进行权属关系建立等问题。Embodiments of the present invention provide an equipment control method and device, a storage medium and an electronic device, to at least solve the problem in related technologies that requires manual physical operations to put the equipment in a state of pending authorization, so that the control equipment can communicate with the pending authorization. Issues such as establishing ownership relationships for authorized equipment.
根据本发明实施例的一个实施例,提供了一种设备的控制方法,包括:接收待确权设备广播的第一广播数据,并确定所述第一广播数据的第一信号强度;根据所述第一信号强度确定控制设备与待确权设备的第一距离,在所述第一距离小于预设阈值的情况下,向所述待确权设备发送心跳数据;在所述待确权设备根据所述心跳数据的第二信号强度确定所述待确权设备和所述控制设备的第二距离小于预设阈值的情况下,获取所述待确权设备的密钥,并根据所述密钥控制所述待确权设备。According to an embodiment of the present invention, a method for controlling a device is provided, including: receiving first broadcast data broadcast by a device to be confirmed, and determining a first signal strength of the first broadcast data; according to the The first signal strength determines the first distance between the control device and the device to be confirmed. When the first distance is less than the preset threshold, heartbeat data is sent to the device to be confirmed; when the device to be confirmed is based on When the second signal strength of the heartbeat data determines that the second distance between the device to be verified and the control device is less than a preset threshold, obtain the key of the device to be verified, and use the key to Control the device to be authorized.
在一个示例性实施例中,根据所述第一信号强度确定控制设备与待确权设备的第一距离,包括:从所述第一广播数据中解析出所述待确权设备的设备状态;在所述待确权设备的设备状态为待确权状态的情况下,根据所述控制设备的型号信息确定第一衰减因子,其中,所述第一衰减因子用于指示所述控制设备收发信号的能力;根据所述第一信号强度和所述第一衰减因子确定控制设备与所述待确权设备的第一距离。In an exemplary embodiment, determining the first distance between the control device and the device to be confirmed based on the first signal strength includes: parsing the device status of the device to be confirmed from the first broadcast data; When the device status of the device to be verified is the device status to be verified, a first attenuation factor is determined according to the model information of the control device, wherein the first attenuation factor is used to instruct the control device to send and receive signals. The ability; determine the first distance between the control device and the device to be confirmed based on the first signal strength and the first attenuation factor.
在一个示例性实施例中,获取所述待确权设备的密钥,并根据所述密钥控制所述待确权设备之前,所述方法还包括:从所述第一广播数据中解析出所述待确权设备的设备型号,并根据所述待确权设备的设备型号获取所述待确权设备的第二衰减因子,其中,所述第二衰减因子用于指示所述待确权设备收发信号的能力;向所述待确权设备发送第二衰减因子,以指示所述待确权设备根据所述第二衰减因子和所述心跳数据的第二信号强度确定所述第二距离;在所述第二距离小于预设阈值的情况下,接收所述待确权设备发送的确权信息,其中,所述确权信息用于指示允许所述控制设备控制所述待确权设备。In an exemplary embodiment, before obtaining the key of the device to be verified and controlling the device to be verified according to the key, the method further includes: parsing the first broadcast data The device model of the device to be confirmed, and obtain the second attenuation factor of the device to be confirmed according to the device model of the device to be confirmed, wherein the second attenuation factor is used to indicate the right to be confirmed The ability of the device to send and receive signals; send a second attenuation factor to the device to be confirmed to instruct the device to be confirmed to determine the second distance based on the second attenuation factor and the second signal strength of the heartbeat data ; When the second distance is less than the preset threshold, receive confirmation information sent by the device to be confirmed, wherein the confirmation information is used to indicate that the control device is allowed to control the device to be confirmed. .
在一个示例性实施例中,获取所述待确权设备的密钥,包括:向云平台发送用于获取所述待确权设备的密钥的请求信息;接收所述云平台发送的响应信息,其中,所述响应信息包括:所述待确权设备的密钥。In an exemplary embodiment, obtaining the key of the device to be verified includes: sending request information to the cloud platform for obtaining the key of the device to be verified; and receiving response information sent by the cloud platform. , wherein the response information includes: the key of the device to be verified.
在一个示例性实施例中,获取所述待确权设备的密钥之后,所述方法还包括:将所述密钥发送至所述待确权设备,其中,在所述待确权设备成功接收到所述密钥的情况下,所述待确权设备将所述待确权设备的设备状态调整为控制状态;接收所述待确权设备发送的第二广播数据,其中,所述第二广播数据包括:所述待确权设备的设备状态;根据所述设备状态确定是否控制所述待确权设备。In an exemplary embodiment, after obtaining the key of the device to be verified, the method further includes: sending the key to the device to be verified, wherein the device to be verified successfully When receiving the key, the device to be verified adjusts the device status of the device to be verified to a control state; and receives the second broadcast data sent by the device to be verified, wherein the third The second broadcast data includes: the device status of the device to be confirmed; and determining whether to control the device to be confirmed based on the device status.
在一个示例性实施例中,根据所述设备状态确定是否控制所述待确权设备,包括:在确定所述待确权设备的设备状态为控制状态的情况下,允许根据所述密钥控制所述待确权设备;在确定所述待确权设备的设备状态为待确权状态的情况下,禁止根据所述密钥控制所述待确权设备。In an exemplary embodiment, determining whether to control the device to be verified according to the device status includes: when it is determined that the device status of the device to be verified is a control state, allowing control according to the key The device to be verified is prohibited from controlling the device to be verified based on the key when it is determined that the device status of the device to be verified is the state to be verified.
根据本发明实施例的另一个实施例,还提供了一种设备的控制装置,包括:接收模块,用于接收待确权设备广播的第一广播数据,并确定所述第一广播数据的第一信号强度;确定模块,用于根据所述第一信号强度确定控制设备与待确权设备的第一距离,在所述第一距离小于预设阈值的情况下,向所述待确权设备发送心跳数据;控制模块,用于在所述待确权设备根据所述心跳数据的第二信号强度确定所述待确权设备和所述控制设备的第二距离小于预设阈值的情况下,获取所述待确权设备的密钥,并根据所述密钥控制所述待确权设备。According to another embodiment of the present invention, a device control device is also provided, including: a receiving module, configured to receive the first broadcast data broadcast by the device to be confirmed, and determine the third broadcast data of the first broadcast data. A signal strength; determination module, configured to determine a first distance between the control device and the device to be confirmed according to the first signal strength, and when the first distance is less than a preset threshold, send a signal to the device to be confirmed. Send heartbeat data; a control module configured to determine, according to the second signal strength of the heartbeat data, that the second distance between the device to be confirmed and the control device is less than a preset threshold, Obtain the key of the device to be verified, and control the device to be verified based on the key.
在一个示例性实施例中,还包括:所述确定模块,还用于从所述第一广播数据中解析出所述待确权设备的设备状态;在所述待确权设备的设备状态为待确权状态的情况下,根据所述控制设备的型号信息确定第一衰减因子,其中,所述第一衰减因子用于指示所述控制设备收发信号的能力;根据所述第一信号强度和所述第一衰减因子确定控制设备与所述待确权设备的第一距离。In an exemplary embodiment, the method further includes: the determining module, further configured to parse the device status of the device to be confirmed from the first broadcast data; when the device status of the device to be confirmed is When the authorization status is to be confirmed, the first attenuation factor is determined according to the model information of the control device, wherein the first attenuation factor is used to indicate the ability of the control device to send and receive signals; according to the first signal strength and The first attenuation factor determines a first distance between the control device and the device to be confirmed.
根据本发明实施例的又一方面,还提供了一种计算机可读的存储介质,该计算机可读的存储介质中存储有计算机程序,其中,该计算机程序被设置为运行时执行上述设备的控制方法。According to another aspect of the embodiment of the present invention, a computer-readable storage medium is also provided. The computer-readable storage medium stores a computer program, wherein the computer program is configured to execute the control of the above device when running. method.
根据本发明实施例的又一方面,还提供了一种电子装置,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其中,上述处理器通过计算机程序执行上述的设备的控制方法。According to another aspect of the embodiment of the present invention, an electronic device is also provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the above-mentioned steps through the computer program. Device control methods.
在本发明实施例中,接收待确权设备广播的第一广播数据,并确定所述第一广播数据的第一信号强度;根据所述第一信号强度确定控制设备与待确权设备的第一距离,在所述第一距离小于预设阈值的情况下,向所述待确权设备发送心跳数据;在所述待确权设备根据所述心跳数据的第二信号强度确定所述待确权设备和所述控制设备的第二距离小于预设阈值的情况下,获取所述待确权设备的密钥,并根据所述密钥控制所述待确权设备,即控制设备通过第一广播数据的第一信号强度确定控制设备与待确权设备的第一距离,以及待确权设备第二广播数据的第二信号强度确定控制设备与待确权设备的第二距离,在第一距离和第一距离均小于预设阈值的情况下,控制设备可以控制待确权设备,采用上述技术方案,可以解决相关技术中,需要人为通过物理操作,使得设备处于待确权状态,进而控制设备才可以与待确权设备进行权属关系建立等问题。In the embodiment of the present invention, the first broadcast data broadcast by the device to be confirmed is received, and the first signal strength of the first broadcast data is determined; the first signal strength of the control device and the device to be confirmed is determined according to the first signal strength. A distance. When the first distance is less than a preset threshold, heartbeat data is sent to the device to be confirmed; when the device to be confirmed determines the device to be confirmed according to the second signal strength of the heartbeat data. When the second distance between the authorized device and the control device is less than the preset threshold, obtain the key of the device to be verified, and control the device to be verified according to the key, that is, the control device passes the first The first signal strength of the broadcast data determines the first distance between the control device and the device to be confirmed, and the second signal strength of the second broadcast data of the device to be confirmed determines the second distance between the control device and the device to be confirmed, in the first When the distance and the first distance are both less than the preset threshold, the control device can control the device to be confirmed. Using the above technical solution can solve the problem in related technologies that requires manual physical operation to put the device in the status of pending confirmation, and then control the device. Only then can the device establish ownership relationships with the device to be confirmed and other issues.
附图说明Description of drawings
此处所说明的附图用来提供对本发明的进一步理解,构成本申请的一部分,本发明的示意性实施例及其说明用于解释本发明,并不构成对本发明的不当限定。在附图中:The drawings described here are used to provide a further understanding of the present invention and constitute a part of this application. The illustrative embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the attached picture:
图1是本发明实施例的一种设备的控制方法的移动终端的硬件结构框图;Figure 1 is a hardware structure block diagram of a mobile terminal of a device control method according to an embodiment of the present invention;
图2是根据本发明实施例的设备的控制方法的流程图;Figure 2 is a flow chart of a control method of a device according to an embodiment of the present invention;
图3是根据本发明可选实施例的设备的控制方法的示意图;Figure 3 is a schematic diagram of a control method of a device according to an optional embodiment of the present invention;
图4是根据本发明实施例的一种设备的控制装置的结构框图(一);Figure 4 is a structural block diagram (1) of a control device for equipment according to an embodiment of the present invention;
图5是根据本发明实施例的一种设备的控制装置的结构框图(二)。Figure 5 is a structural block diagram (2) of a control device for equipment according to an embodiment of the present invention.
具体实施方式Detailed ways
为了使本技术领域的人员更好地理解本发明方案,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分的实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都应当属于本发明保护的范围。In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only These are some embodiments of the present invention, rather than all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts should fall within the scope of protection of the present invention.
需要说明的是,本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本发明的实施例能够以除了在这里图示或描述的那些以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。It should be noted that the terms "first", "second", etc. in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It is to be understood that the data so used are interchangeable under appropriate circumstances so that the embodiments of the invention described herein are capable of being practiced in sequences other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, e.g., a process, method, system, product, or apparatus that encompasses a series of steps or units and need not be limited to those explicitly listed. Those steps or elements may instead include other steps or elements not expressly listed or inherent to the process, method, product or apparatus.
本申请实施例所提供的方法实施例可以在移动终端、计算机终端或者类似的运算装置中执行。以运行在移动终端上为例,图1是本发明实施例的一种设备的控制方法的移动终端的硬件结构框图。如图1所示,移动终端可以包括一个或多个(图1中仅示出一个)处理器102(处理器102可以包括但不限于微处理器MCU或可编程逻辑器件FPGA等的处理装置)和用于存储数据的存储器104,在一个示例性实施例中,上述移动终端还可以包括用于通信功能的传输设备106以及输入输出设备108。本领域普通技术人员可以理解,图1所示的结构仅为示意,其并不对上述移动终端的结构造成限定。例如,移动终端还可包括比图1中所示更多或者更少的组件,或者具有与图1所示等同功能或比图1所示功能更多的不同的配置。The method embodiments provided by the embodiments of this application can be executed in a mobile terminal, a computer terminal, or a similar computing device. Taking running on a mobile terminal as an example, FIG. 1 is a hardware structure block diagram of a mobile terminal of a device control method according to an embodiment of the present invention. As shown in Figure 1, the mobile terminal may include one or more (only one is shown in Figure 1) processors 102 (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. In an exemplary embodiment, the above-mentioned mobile terminal may also include a transmission device 106 for communication functions and an input and output device 108. Persons of ordinary skill in the art can understand that the structure shown in Figure 1 is only illustrative, and it does not limit the structure of the above-mentioned mobile terminal. For example, the mobile terminal may also include more or fewer components than shown in FIG. 1 , or have a different configuration with equivalent functions or more functions than those shown in FIG. 1 .
存储器104可用于存储计算机程序,例如,应用软件的软件程序以及模块,如本发明实施例中的设备的控制方法对应的计算机程序,处理器102通过运行存储在存储器104内的计算机程序,从而执行各种功能应用以及数据处理,即实现上述的方法。存储器104可包括高速随机存储器,还可包括非易失性存储器,如一个或者多个磁性存储装置、闪存、或者其他非易失性固态存储器。在一些实例中,存储器104可进一步包括相对于处理器102远程设置的存储器,这些远程存储器可以通过网络连接至移动终端。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as computer programs corresponding to the device control methods in the embodiments of the present invention. The processor 102 executes the computer programs stored in the memory 104 by running them. Various functional applications and data processing implement the above methods. 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 relative to the processor 102, and these remote memories may be connected to the mobile terminal through a network. Examples of the above-mentioned networks include but are not limited to the Internet, intranets, local area networks, mobile communication networks and combinations thereof.
传输装置106用于经由一个网络接收或者发送数据。上述的网络具体实例可包括移动终端的通信供应商提供的无线网络。在一个实例中,传输装置106包括一个网络适配器(Network Interface Controller,简称为NIC),其可通过基站与其他网络设备相连从而可与互联网进行通讯。在一个实例中,传输装置106可以为射频(Radio Frequency,简称为RF)模块,其用于通过无线方式与互联网进行通讯。The transmission device 106 is used to receive or send data via a network. Specific examples of the above-mentioned network 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, NIC for short), which 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 (Radio Frequency, RF for short) module, which is used to communicate with the Internet wirelessly.
在本实施例中提供了一种设备的控制方法,应用于上述移动终端,具体的,应用于控制设备,图2是根据本发明实施例的设备的控制方法的流程图,该流程包括如下步骤:In this embodiment, a device control method is provided, which is applied to the above-mentioned mobile terminal. Specifically, it is applied to the control device. Figure 2 is a flow chart of a device control method according to an embodiment of the present invention. The process includes the following steps: :
步骤S202,接收待确权设备广播的第一广播数据,并确定所述第一广播数据的第一信号强度;Step S202: Receive the first broadcast data broadcast by the device to be verified, and determine the first signal strength of the first broadcast data;
步骤S204,根据所述第一信号强度确定控制设备与待确权设备的第一距离,在所述第一距离小于预设阈值的情况下,向所述待确权设备发送心跳数据;Step S204: Determine a first distance between the control device and the device to be confirmed based on the first signal strength, and when the first distance is less than a preset threshold, send heartbeat data to the device to be confirmed;
步骤S206,在所述待确权设备根据所述心跳数据的第二信号强度确定所述待确权设备和所述控制设备的第二距离小于预设阈值的情况下,获取所述待确权设备的密钥,并根据所述密钥控制所述待确权设备。Step S206: Obtain the right to be confirmed when the device to be confirmed determines that the second distance between the device to be confirmed and the control device is less than a preset threshold based on the second signal strength of the heartbeat data. The key of the device, and control the device to be authenticated based on the key.
通过上述步骤,接收待确权设备广播的第一广播数据,并确定所述第一广播数据的第一信号强度;根据所述第一信号强度确定控制设备与待确权设备的第一距离,在所述第一距离小于预设阈值的情况下,向所述待确权设备发送心跳数据;在所述待确权设备根据所述心跳数据的第二信号强度确定所述待确权设备和所述控制设备的第二距离小于预设阈值的情况下,获取所述待确权设备的密钥,并根据所述密钥控制所述待确权设备,即控制设备通过第一广播数据的第一信号强度确定控制设备与待确权设备的第一距离,以及待确权设备第二广播数据的第二信号强度确定控制设备与待确权设备的第二距离,在第一距离和第一距离均小于预设阈值的情况下,控制设备可以控制待确权设备,采用上述技术方案,可以解决相关技术中,需要人为通过物理操作,使得设备处于待确权状态,进而控制设备才可以与待确权设备进行权属关系建立等问题。Through the above steps, receive the first broadcast data broadcast by the device to be confirmed, and determine the first signal strength of the first broadcast data; determine the first distance between the control device and the device to be confirmed according to the first signal strength, When the first distance is less than a preset threshold, heartbeat data is sent to the device to be confirmed; and the device to be confirmed determines the device and the device to be confirmed according to the second signal strength of the heartbeat data. When the second distance of the control device is less than the preset threshold, the key of the device to be verified is obtained, and the device to be verified is controlled according to the key, that is, the control device passes the first broadcast data The first signal strength determines the first distance between the control device and the device to be confirmed, and the second signal strength of the second broadcast data of the device to be confirmed determines the second distance between the control device and the device to be confirmed. Between the first distance and the second When both distances are less than the preset threshold, the control device can control the device to be confirmed. Using the above technical solution can solve the problem in related technologies that requires manual physical operation to put the device in a state of pending confirmation and then control the device. Issues such as establishing ownership relationships with equipment to be confirmed.
在一个示例性实施例中,根据所述第一信号强度确定控制设备与待确权设备的第一距离,包括:从所述第一广播数据中解析出所述待确权设备的设备状态;在所述待确权设备的设备状态为待确权状态的情况下,根据所述控制设备的型号信息确定第一衰减因子,其中,所述第一衰减因子用于指示所述控制设备收发信号的能力;根据所述第一信号强度和所述第一衰减因子确定控制设备与所述待确权设备的第一距离。In an exemplary embodiment, determining the first distance between the control device and the device to be confirmed based on the first signal strength includes: parsing the device status of the device to be confirmed from the first broadcast data; When the device status of the device to be verified is the device status to be verified, a first attenuation factor is determined according to the model information of the control device, wherein the first attenuation factor is used to instruct the control device to send and receive signals. The ability; determine the first distance between the control device and the device to be confirmed according to the first signal strength and the first attenuation factor.
也就是说,接收待确权设备发送的第一广播数据并确定所述第一广播数据对应的第一信号强度,其中,所述第一广播数据包括:所述待确权设备的设备状态和待确权设备的设备型号;根据待确权设备的设备状态判断是否可以控制所述待确权设备,在所述待确权设备的设备状态为待确权状态的情况下,待确权设备未与其他控制设备建立连接,因此,在所述待确权设备的设备状态为待确权状态的情况下,根据所述控制设备的型号信息获取第一衰减因子;根据所述第一信号强度和所述第一衰减因子计算控制设备与所述待确权设备的第一距离,在第一距离小于预设阈值的情况下,与所述待确权设备建立连接。That is to say, receive the first broadcast data sent by the device to be confirmed and determine the first signal strength corresponding to the first broadcast data, where the first broadcast data includes: the device status of the device to be confirmed and The device model of the device to be confirmed; determine whether the device to be confirmed can be controlled based on the device status of the device to be confirmed. When the device status of the device to be confirmed is the status to be confirmed, the device to be confirmed No connection has been established with other control devices. Therefore, when the device status of the device to be verified is the device status to be verified, the first attenuation factor is obtained according to the model information of the control device; according to the first signal strength and the first attenuation factor to calculate a first distance between the control device and the device to be confirmed, and when the first distance is less than a preset threshold, a connection is established with the device to be confirmed.
具体地,根据所述第一信号强度和所述第一衰减因子计算控制设备与所述待确权设备的第一距离,包括:获取所述第一信号强度、所述第一衰减因子和单位第一信号强度;根据所述第一信号强度、所述第一衰减因子和所述单位第一信号强度计算所述控制设备与所述待确权设备的距离。Specifically, calculating the first distance between the control device and the device to be confirmed according to the first signal strength and the first attenuation factor includes: obtaining the first signal strength, the first attenuation factor and the unit First signal strength; calculate the distance between the control device and the device to be confirmed according to the first signal strength, the first attenuation factor and the unit first signal strength.
进一步地,信号强度与距离转换的公式为:d1=10^((abs(rssi1)-A1)/(10*n1)),其中:d1为第一距离,rssi1为第一信号强度,A1为待确权设备和控制设备相隔单位距离的信号强度,n1为第一衰减因子。Further, the formula for converting signal strength and distance is: d1=10^((abs(rssi1)-A1)/(10*n1)), where: d1 is the first distance, rssi1 is the first signal strength, and A1 is The signal strength of the device to be confirmed and the control device separated by unit distance, n1 is the first attenuation factor.
在一个示例性实施例中,获取所述待确权设备的密钥,并根据所述密钥控制所述待确权设备之前,从所述第一广播数据中解析出所述待确权设备的设备型号,并根据所述待确权设备的设备型号获取所述待确权设备的第二衰减因子,其中,所述第二衰减因子用于指示所述待确权设备收发信号的能力;向所述待确权设备发送第二衰减因子,以指示所述待确权设备根据所述第二衰减因子和所述心跳数据的第二信号强度确定所述第二距离;在所述第二距离小于预设阈值的情况下,接收所述待确权设备发送的确权信息,其中,所述确权信息用于指示允许所述控制设备控制所述待确权设备。In an exemplary embodiment, before obtaining the key of the device to be verified and controlling the device to be verified according to the key, the device to be verified is parsed from the first broadcast data. The device model of the device, and obtain the second attenuation factor of the device to be confirmed according to the device model of the device to be confirmed, wherein the second attenuation factor is used to indicate the ability of the device to be confirmed to send and receive signals; Send a second attenuation factor to the device to be confirmed to instruct the device to be confirmed to determine the second distance based on the second attenuation factor and the second signal strength of the heartbeat data; in the second When the distance is less than a preset threshold, confirmation information sent by the device to be confirmed is received, where the confirmation information is used to indicate that the control device is allowed to control the device to be confirmed.
换言之,接收待确权设备发送的第一广播数据并确定所述第一广播数据对应的第一信号强度,其中,所述第一广播数据包括:所述待确权设备的设备状态和待确权设备的设备型号;根据第一广播数据获取待确权设备的设备型号,控制设备根据待确权设备的设备型号向云平台获取待确权设备的第二衰减因子,控制设备通过待确权设备与控制设备之间的连接向所述发送第二衰减因子以及心跳数据,待确权设备在获取到第二衰减因子的情况下,根据第二衰减因子和第二信号强度确定第二距离,在所述第二距离小于预设阈值的情况下,接收所述待确权设备发送的确权信息。需要说明的是,在云平台将第二衰减因子发送给控制设备时,云平台需要对第二衰减因子进行加密,加密后的数据控制终端无法解密,只有待确权设备根据密钥能够解密,进而确保了待确权设备对控制设备鉴权的可靠性。In other words, receive the first broadcast data sent by the device to be confirmed and determine the first signal strength corresponding to the first broadcast data, where the first broadcast data includes: the device status of the device to be confirmed and the device status to be confirmed. The device model of the device to be confirmed; the device model of the device to be confirmed is obtained according to the first broadcast data, the control device obtains the second attenuation factor of the device to be confirmed from the cloud platform based on the device model of the device to be confirmed, and the control device passes the right to be confirmed The connection between the device and the control device sends the second attenuation factor and heartbeat data to the device. When the device to be confirmed obtains the second attenuation factor, it determines the second distance according to the second attenuation factor and the second signal strength, When the second distance is less than the preset threshold, the confirmation information sent by the device to be confirmed is received. It should be noted that 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 it. Only the device to be confirmed can decrypt it according to the key. This ensures the reliability of the authentication of the control device by the device to be authenticated.
进一步地,信号强度与距离转换的公式为:d2=10^((abs(rssi2)-A2)/(10*n2)),其中:d2为第一距离,rssi2为第一信号强度,A2为待确权设备和控制设备相隔单位距离的信号强度,n2为第一衰减因子。Further, the formula for converting signal strength and distance is: d2=10^((abs(rssi2)-A2)/(10*n2)), where: d2 is the first distance, rssi2 is the first signal strength, and A2 is The signal strength of the device to be confirmed and the control device separated by unit distance, n2 is the first attenuation factor.
在一个示例性实施例中,获取所述待确权设备的密钥,包括:向云平台发送用于获取所述待确权设备的密钥的请求信息;接收所述云平台发送的响应信息,其中,所述响应信息包括:所述待确权设备的密钥。In an exemplary embodiment, obtaining the key of the device to be verified includes: sending request information to the cloud platform for obtaining the key of the device to be verified; and receiving response information sent by the cloud platform. , wherein the response information includes: the key of the device to be verified.
也就是说,在接收到所述待确权设备发送的确权信息后,向云平台申请待确权设备的密钥,控制设备接收到待确权设备的密钥之后,将待确权设备的密钥存储在本地,同时同步给待确权设备。That is to say, after receiving the confirmation information sent by the device to be confirmed, it applies to the cloud platform for the key of the device to be confirmed. After the control device receives the key of the device to be confirmed, it sends the device to be confirmed. The key is stored locally and synchronized to the device to be verified.
在一个示例性实施例中,获取所述待确权设备的密钥之后,将所述密钥发送至所述待确权设备,其中,在所述待确权设备成功接收到所述密钥的情况下,所述待确权设备将所述待确权设备的设备状态调整为控制状态;接收所述待确权设备发送的第二广播数据,其中,所述第二广播数据包括:所述待确权设备的设备状态;根据所述设备状态确定是否控制所述待确权设备。In an exemplary embodiment, after obtaining the key of the device to be verified, the key is sent to the device to be verified, wherein after the device to be verified successfully receives the key In the case of , the device to be verified adjusts the device status of the device to be verified to a control state; and receives the second broadcast data sent by the device to be verified, wherein the second broadcast data includes: Describe the device status of the device to be confirmed; determine whether to control the device to be confirmed according to the device status.
需要说明的是,在待确权设备接收到密钥信息的情况下,所述待确权设备将设备状态从待确权状态调整为控制状态,待确权设备发送第二广播数据,其中,第二广播数据中携带的待确权设备的设备状态为控制状态,在控制设备接收到第二广播数据的情况下,根据第二广播数据中携带的设备状态确定是否控制所述待确权设备。It should be noted that when the device to be verified receives the key information, the device to be verified adjusts the device state from the state to be verified to the control state, and the device to be verified sends the second broadcast data, where, The device status of the device to be confirmed carried in the second broadcast data is the control state. When the control device receives the second broadcast data, it determines whether to control the device to be confirmed based on the device status carried in the second broadcast data. .
在一个示例性实施例中,根据所述设备状态确定是否控制所述待确权设备,包括:在确定所述待确权设备的设备状态为控制状态的情况下,允许根据所述密钥控制所述待确权设备;在确定所述待确权设备的设备状态为待确权状态的情况下,禁止根据所述密钥控制所述待确权设备。In an exemplary embodiment, determining whether to control the device to be verified according to the device status includes: when it is determined that the device status of the device to be verified is a control state, allowing control according to the key The device to be verified is prohibited from controlling the device to be verified based on the key when it is determined that the device status of the device to be verified is the state to be verified.
为了更好的理解上述设备的控制方法的过程,以下再结合可选实施例对上述设备的控制的实现方法流程进行说明,但不用于限定本发明实施例的技术方案。In order to better understand the process of the control method of the above-mentioned equipment, the flow of the implementation method of controlling the above-mentioned equipment will be described below in combination with optional embodiments, but this is not intended to limit the technical solutions of the embodiments of the present invention.
如图3所示,图3是根据本发明可选实施例的设备的控制方法的示意图,具体如下:As shown in Figure 3, Figure 3 is a schematic diagram of a control method of a device according to an optional embodiment of the present invention. The details are as follows:
步骤S301:待确权设备上电,需要说明的是当前待确权设备与控制设备为建立权属关系;Step S301: Power on the device to be confirmed. It should be noted that the current ownership relationship between the device to be confirmed and the control device is established;
步骤S302:待确权设备以30ms一次的频率发送第一广播数据,并在第一广播数据中携带待确权状态及设备型号;Step S302: The device to be verified sends the first broadcast data at a frequency of 30 ms, and carries the status of the rights to be verified and the device model in the first broadcast data;
步骤S303:控制设备根据待确权设备的设备型号和控制设备的设备型号从云平台手机测试设备的第一衰减因子及设备测试手机的第二衰减因子;Step S303: The control device tests the first attenuation factor of the device from the cloud platform mobile phone and the second attenuation factor of the device test mobile phone based on the device model of the device to be confirmed and the device model of the control device;
需要说明的是,在云平台给控制设备下发第二衰减因子时,需要对数据进行加密,加密后的数据控制设备无法解密,只有待确权设备能够解密,确保待确权设备对控制设备鉴权的可靠性。It should be noted that 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 confirmed can decrypt, ensuring that the device to be confirmed has no influence on the control device. Reliability of authentication.
步骤S304:控制设备以500ms为一组采集第一广播数据的信号强度,并对多组信号强度求均值;Step S304: The control device collects the signal strength of the first broadcast data in groups of 500ms, and averages the signal strengths of the multiple groups;
步骤S305:使用信号强度与距离转换公式,结合手机测试设备的第一衰减因子计算第一距离,并确定第一距离是否小于预设距离;Step S305: Calculate the first distance using the signal strength and distance conversion formula combined with the first attenuation factor of the mobile phone test equipment, and determine whether the first distance is less than the preset distance;
需要说明的是,信号强度与距离转换的公式为:d=10^((abs(rssi)-A)/(10*n)),其中:d为第一距离,rssi为信号强度,A为控制设备和待确权设备单位信号强度,n为第一衰减因子。It should be noted that the formula for converting signal strength and distance is: d=10^((abs(rssi)-A)/(10*n)), where: d is the first distance, rssi is the signal strength, and A is The unit signal strength of the control equipment and the equipment to be confirmed, n is the first attenuation factor.
步骤S306:控制设备无线连接待确权设备,并下发设备测试手机的第二衰减因子,并以30ms为间隔下发连接心跳;Step S306: The control device wirelessly connects to the device to be confirmed, and delivers the second attenuation factor of the device to test the mobile phone, and delivers the connection heartbeat at 30ms intervals;
步骤S307:待确权设备以500ms为一组采集心跳数据的信号强度,并对多组信号强度求均值;Step S307: The device to be confirmed collects the signal strength of the heartbeat data in groups of 500ms, and averages the signal strengths of the multiple groups;
步骤S308:使用信号强度与距离转换公式,结合第二衰减因子计算第二距离,并确定第二距离是否小于预设距离;Step S308: Calculate the second distance using the signal strength and distance conversion formula combined with the second attenuation factor, and determine whether the second distance is less than the preset distance;
步骤S309:在第二距离小于预设距离的情况下,向控制设备发送确权信息;Step S309: When the second distance is less than the preset distance, send confirmation information to the control device;
步骤S310:控制设备接收到确权信息后,向云平台申请权属密钥;Step S310: After receiving the rights confirmation information, the control device applies for the ownership key from the cloud platform;
步骤S311:控制设备将权属密钥存储在本地,并发送给待确权设备;Step S311: The control device stores the ownership key locally and sends it to the device to be confirmed;
步骤S312:待确权设备确定第二距离小于预设距离,并接收到权属密钥,在将权属密钥存储在本地,将设备状态调整为可控制状态;Step S312: The device to be authenticated determines that the second distance is less than the preset distance, receives the ownership key, stores the ownership key locally, and adjusts the device status to a controllable state;
步骤S313:控制设备使用权属密钥对待确权设备进行控制。Step S313: The control device uses the ownership key to control the device to be authenticated.
通过上述实施例,接收待确权设备广播的第一广播数据,并确定所述第一广播数据的第一信号强度;根据所述第一信号强度确定控制设备与待确权设备的第一距离,在所述第一距离小于预设阈值的情况下,向所述待确权设备发送心跳数据;在所述待确权设备根据所述心跳数据的第二信号强度确定所述待确权设备和所述控制设备的第二距离小于预设阈值的情况下,获取所述待确权设备的密钥,并根据所述密钥控制所述待确权设备,即控制设备通过第一广播数据的第一信号强度确定控制设备与待确权设备的第一距离,以及待确权设备第二广播数据的第二信号强度确定控制设备与待确权设备的第二距离,在第一距离和第一距离均小于预设阈值的情况下,控制设备可以控制待确权设备,采用上述技术方案,可以解决相关技术中,需要人为通过物理操作,使得设备处于待确权状态,进而控制设备才可以与待确权设备进行权属关系建立等问题。Through the above embodiment, the first broadcast data broadcast by the device to be confirmed is received, and the first signal strength of the first broadcast data is determined; the first distance between the control device and the device to be confirmed is determined according to the first signal strength. , when the first distance is less than the preset threshold, send heartbeat data to the device to be confirmed; when the device to be confirmed determines the device to be confirmed according to the second signal strength of the heartbeat data When the second distance to the control device is less than a preset threshold, obtain the key of the device to be verified, and control the device to be verified according to the key, that is, the control device passes the first broadcast data The first signal strength determines the first distance between the control device and the device to be confirmed, and the second signal strength of the second broadcast data of the device to be confirmed determines the second distance between the control device and the device to be confirmed. When the first distance and When the first distance is less than the preset threshold, the control device can control the device to be verified. Using the above technical solution can solve the problem in related technologies that requires manual physical operation to put the device in the state of pending verification, and then control the device. Issues such as establishing ownership relationships with the equipment to be confirmed can be established.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到根据上述实施例的方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本发明各个实施例的方法。Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by means of software plus the necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is Better implementation. Based on this understanding, the technical solution of the present invention can be embodied in the form of a software product in essence or the part that contributes to the existing technology. The computer software product is stored in a storage medium (such as ROM/RAM, disk, CD), including several instructions to cause a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of various embodiments of the present invention.
图4是根据本发明实施例的一种设备的控制装置的结构框图(一);如图4所示,包括:Figure 4 is a structural block diagram (1) of a control device for equipment according to an embodiment of the present invention; as shown in Figure 4, it includes:
接收模块42,用于接收待确权设备广播的第一广播数据,并确定所述第一广播数据的第一信号强度;The receiving module 42 is configured to receive the first broadcast data broadcast by the device to be confirmed, and determine the first signal strength of the first broadcast data;
确定模块44,用于根据所述第一信号强度确定控制设备与待确权设备的第一距离,在所述第一距离小于预设阈值的情况下,向所述待确权设备发送心跳数据;Determining module 44, configured to determine a first distance between the control device and the device to be confirmed based on the first signal strength, and when the first distance is less than a preset threshold, send heartbeat data to the device to be confirmed. ;
控制模块46,用于在所述待确权设备根据所述心跳数据的第二信号强度确定所述待确权设备和所述控制设备的第二距离小于预设阈值的情况下,获取所述待确权设备的密钥,并根据所述密钥控制所述待确权设备。The control module 46 is configured to obtain the device when the device to be confirmed determines that the second distance between the device to be confirmed and the control device is less than a preset threshold based on the second signal strength of the heartbeat data. The key of the device to be verified, and the device to be verified is controlled according to the key.
通过上述装置,接收待确权设备广播的第一广播数据,并确定所述第一广播数据的第一信号强度;根据所述第一信号强度确定控制设备与待确权设备的第一距离,在所述第一距离小于预设阈值的情况下,向所述待确权设备发送心跳数据;在所述待确权设备根据所述心跳数据的第二信号强度确定所述待确权设备和所述控制设备的第二距离小于预设阈值的情况下,获取所述待确权设备的密钥,并根据所述密钥控制所述待确权设备,即控制设备通过第一广播数据的第一信号强度确定控制设备与待确权设备的第一距离,以及待确权设备第二广播数据的第二信号强度确定控制设备与待确权设备的第二距离,在第一距离和第一距离均小于预设阈值的情况下,控制设备可以控制待确权设备,采用上述技术方案,可以解决相关技术中,需要人为通过物理操作,使得设备处于待确权状态,进而控制设备才可以与待确权设备进行权属关系建立等问题。Through the above device, the first broadcast data broadcast by the device to be confirmed is received, and the first signal strength of the first broadcast data is determined; the first distance between the control device and the device to be confirmed is determined according to the first signal strength, When the first distance is less than a preset threshold, heartbeat data is sent to the device to be confirmed; and the device to be confirmed determines the device and the device to be confirmed according to the second signal strength of the heartbeat data. When the second distance of the control device is less than the preset threshold, the key of the device to be verified is obtained, and the device to be verified is controlled according to the key, that is, the control device passes the first broadcast data The first signal strength determines the first distance between the control device and the device to be confirmed, and the second signal strength of the second broadcast data of the device to be confirmed determines the second distance between the control device and the device to be confirmed. Between the first distance and the second When both distances are less than the preset threshold, the control device can control the device to be confirmed. Using the above technical solution can solve the problem in related technologies that requires manual physical operation to put the device in a state of pending confirmation and then control the device. Issues such as establishing ownership relationships with equipment to be confirmed.
在一个示例性实施例中,确定模块,还用于从所述第一广播数据中解析出所述待确权设备的设备状态;在所述待确权设备的设备状态为待确权状态的情况下,根据所述控制设备的型号信息确定第一衰减因子,其中,所述第一衰减因子用于指示所述控制设备收发信号的能力;根据所述第一信号强度和所述第一衰减因子确定控制设备与所述待确权设备的第一距离。In an exemplary embodiment, the determining module is further configured to parse the device status of the device to be confirmed from the first broadcast data; when the device status of the device to be confirmed is the status of the device to be confirmed, In this case, the first attenuation factor is determined according to the model information of the control device, wherein the first attenuation factor is used to indicate the ability of the control device to send and receive signals; according to the first signal strength and the first attenuation The factor determines the first distance between the control device and the device to be confirmed.
也就是说,接收待确权设备发送的第一广播数据并确定所述第一广播数据对应的第一信号强度,其中,所述第一广播数据包括:所述待确权设备的设备状态和待确权设备的设备型号;根据待确权设备的设备状态判断是否可以控制所述待确权设备,在所述待确权设备的设备状态为待确权状态的情况下,待确权设备未与其他控制设备建立连接,因此,在所述待确权设备的设备状态为待确权状态的情况下,根据所述控制设备的型号信息获取第一衰减因子;根据所述第一信号强度和所述第一衰减因子计算控制设备与所述待确权设备的第一距离,在第一距离小于预设阈值的情况下,与所述待确权设备建立连接。That is to say, receive the first broadcast data sent by the device to be confirmed and determine the first signal strength corresponding to the first broadcast data, where the first broadcast data includes: the device status of the device to be confirmed and The device model of the device to be confirmed; determine whether the device to be confirmed can be controlled based on the device status of the device to be confirmed. When the device status of the device to be confirmed is the status to be confirmed, the device to be confirmed No connection has been established with other control devices. Therefore, when the device status of the device to be verified is the device status to be verified, the first attenuation factor is obtained according to the model information of the control device; according to the first signal strength and the first attenuation factor to calculate a first distance between the control device and the device to be confirmed, and when the first distance is less than a preset threshold, a connection is established with the device to be confirmed.
具体地,根据所述第一信号强度和所述第一衰减因子计算控制设备与所述待确权设备的第一距离,包括:获取所述第一信号强度、所述第一衰减因子和单位第一信号强度;根据所述第一信号强度、所述第一衰减因子和所述单位第一信号强度计算所述控制设备与所述待确权设备的距离。Specifically, calculating the first distance between the control device and the device to be confirmed according to the first signal strength and the first attenuation factor includes: obtaining the first signal strength, the first attenuation factor and the unit First signal strength; calculate the distance between the control device and the device to be confirmed according to the first signal strength, the first attenuation factor and the unit first signal strength.
进一步地,信号强度与距离转换的公式为:d1=10^((abs(rssi1)-A1)/(10*n1)),其中:d1为第一距离,rssi1为第一信号强度,A1为待确权设备和控制设备相隔单位距离的信号强度,n1为第一衰减因子。Further, the formula for converting signal strength and distance is: d1=10^((abs(rssi1)-A1)/(10*n1)), where: d1 is the first distance, rssi1 is the first signal strength, and A1 is The signal strength of the device to be confirmed and the control device separated by unit distance, n1 is the first attenuation factor.
在一个示例性实施例中,图5是根据本发明实施例的一种设备的控制装置的结构框图(二);如图5所示,上述装置还包括,解析模块52,用于从所述第一广播数据中解析出所述待确权设备的设备型号,并根据所述待确权设备的设备型号获取所述待确权设备的第二衰减因子,其中,所述第二衰减因子用于指示所述待确权设备收发信号的能力;向所述待确权设备发送第二衰减因子,以指示所述待确权设备根据所述第二衰减因子和所述心跳数据的第二信号强度确定所述第二距离;在所述第二距离小于预设阈值的情况下,接收所述待确权设备发送的确权信息,其中,所述确权信息用于指示允许所述控制设备控制所述待确权设备。In an exemplary embodiment, Figure 5 is a structural block diagram (2) of a device control device according to an embodiment of the present invention; as shown in Figure 5, the above device also includes a parsing module 52 for extracting from the The device model of the device to be verified is parsed from the first broadcast data, and the second attenuation factor of the device to be verified is obtained according to the device model of the device to be verified, wherein the second attenuation factor is In order to indicate the ability of the device to be confirmed to send and receive signals; sending a second attenuation factor to the device to be confirmed to indicate that the device to be confirmed is based on the second attenuation factor and the second signal of the heartbeat data Strength determines the second distance; when the second distance is less than a preset threshold, receive confirmation information sent by the device to be confirmed, wherein the confirmation information is used to indicate that the control device is allowed to Control the device to be authorized.
换言之,接收待确权设备发送的第一广播数据并确定所述第一广播数据对应的第一信号强度,其中,所述第一广播数据包括:所述待确权设备的设备状态和待确权设备的设备型号;根据第一广播数据获取待确权设备的设备型号,控制设备根据待确权设备的设备型号向云平台获取待确权设备的第二衰减因子,控制设备通过待确权设备与控制设备之间的连接向所述发送第二衰减因子以及心跳数据,待确权设备在获取到第二衰减因子的情况下,根据第二衰减因子和第二信号强度确定第二距离,在所述第二距离小于预设阈值的情况下,接收所述待确权设备发送的确权信息。需要说明的是,在云平台将第二衰减因子发送给控制设备时,云平台需要对第二衰减因子进行加密,加密后的数据控制终端无法解密,只有待确权设备根据密钥能够解密,进而确保了待确权设备对控制设备鉴权的可靠性。In other words, receive the first broadcast data sent by the device to be confirmed and determine the first signal strength corresponding to the first broadcast data, where the first broadcast data includes: the device status of the device to be confirmed and the device status to be confirmed. The device model of the device to be confirmed; the device model of the device to be confirmed is obtained according to the first broadcast data, the control device obtains the second attenuation factor of the device to be confirmed from the cloud platform based on the device model of the device to be confirmed, and the control device passes the right to be confirmed The connection between the device and the control device sends the second attenuation factor and heartbeat data to the device. When the device to be confirmed obtains the second attenuation factor, it determines the second distance according to the second attenuation factor and the second signal strength, When the second distance is less than the preset threshold, the confirmation information sent by the device to be confirmed is received. It should be noted that 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 it. Only the device to be confirmed can decrypt it according to the key. This ensures the reliability of the authentication of the control device by the device to be authenticated.
进一步地,信号强度与距离转换的公式为:d2=10^((abs(rssi2)-A2)/(10*n2)),其中:d2为第一距离,rssi2为第一信号强度,A2为待确权设备和控制设备相隔单位距离的信号强度,n2为第一衰减因子。Further, the formula for converting signal strength and distance is: d2=10^((abs(rssi2)-A2)/(10*n2)), where: d2 is the first distance, rssi2 is the first signal strength, and A2 is The signal strength of the device to be confirmed and the control device separated by unit distance, n2 is the first attenuation factor.
在一个示例性实施例中,接收模块,还用于向云平台发送用于获取所述待确权设备的密钥的请求信息;接收所述云平台发送的响应信息,其中,所述响应信息包括:所述待确权设备的密钥。In an exemplary embodiment, the receiving module is further configured to send request information for obtaining the key of the device to be verified to the cloud platform; and receive response information sent by the cloud platform, wherein the response information Including: the key of the device to be verified.
也就是说,在接收到所述待确权设备发送的确权信息后,向云平台申请待确权设备的密钥,控制设备接收到待确权设备的密钥之后,将待确权设备的密钥存储在本地,同时同步给待确权设备。That is to say, after receiving the confirmation information sent by the device to be confirmed, it applies to the cloud platform for the key of the device to be confirmed. After the control device receives the key of the device to be confirmed, it sends the device to be confirmed. The key is stored locally and synchronized to the device to be verified.
在一个示例性实施例中,接收模块,还用于将所述密钥发送至所述待确权设备,其中,在所述待确权设备成功接收到所述密钥的情况下,所述待确权设备将所述待确权设备的设备状态调整为控制状态;接收所述待确权设备发送的第二广播数据,其中,所述第二广播数据包括:所述待确权设备的设备状态;根据所述设备状态确定是否控制所述待确权设备。In an exemplary embodiment, the receiving module is further configured to send the key to the device to be verified, wherein if the device to be verified successfully receives the key, the The device to be confirmed adjusts the device status of the device to be confirmed to a control state; and receives the second broadcast data sent by the device to be confirmed, wherein the second broadcast data includes: the device status of the device to be confirmed. Device status; determine whether to control the device to be confirmed based on the device status.
需要说明的是,在待确权设备接收到密钥信息的情况下,所述待确权设备将设备状态从待确权状态调整为控制状态,待确权设备发送第二广播数据,其中,第二广播数据中携带的待确权设备的设备状态为控制状态,在控制设备接收到第二广播数据的情况下,根据第二广播数据中携带的设备状态确定是否控制所述待确权设备。It should be noted that when the device to be verified receives the key information, the device to be verified adjusts the device state from the state to be verified to the control state, and the device to be verified sends the second broadcast data, where, The device status of the device to be confirmed carried in the second broadcast data is the control state. When the control device receives the second broadcast data, it determines whether to control the device to be confirmed based on the device status carried in the second broadcast data. .
在一个示例性实施例中,根据所述设备状态确定是否控制所述待确权设备,包括:在确定所述待确权设备的设备状态为控制状态的情况下,允许根据所述密钥控制所述待确权设备;在确定所述待确权设备的设备状态为待确权状态的情况下,禁止根据所述密钥控制所述待确权设备。In an exemplary embodiment, determining whether to control the device to be verified according to the device status includes: when it is determined that the device status of the device to be verified is a control state, allowing control according to the key The device to be verified is prohibited from controlling the device to be verified based on the key when it is determined that the device status of the device to be verified is the state to be verified.
本发明的实施例还提供了一种存储介质,该存储介质包括存储的程序,其中,上述程序运行时执行上述任一项的方法。Embodiments of the present invention also provide a storage medium that includes a stored program, wherein the method of any of the above items is executed when the program is run.
可选地,在本实施例中,上述存储介质可以被设置为存储用于执行以下步骤的程序代码:Optionally, in this embodiment, the above-mentioned storage medium may be configured to store program codes for performing the following steps:
S1,接收待确权设备广播的第一广播数据,并确定所述第一广播数据的第一信号强度;S1, receive the first broadcast data broadcast by the device to be confirmed, and determine the first signal strength of the first broadcast data;
S2,根据所述第一信号强度确定控制设备与待确权设备的第一距离,在所述第一距离小于预设阈值的情况下,向所述待确权设备发送心跳数据;S2, determine the first distance between the control device and the device to be confirmed based on the first signal strength, and when the first distance is less than a preset threshold, send heartbeat data to the device to be confirmed;
S3,在所述待确权设备根据所述心跳数据的第二信号强度确定所述待确权设备和所述控制设备的第二距离小于预设阈值的情况下,获取所述待确权设备的密钥,并根据所述密钥控制所述待确权设备。S3: When the device to be confirmed determines that the second distance between the device to be confirmed and the control device is less than a preset threshold based on the second signal strength of the heartbeat data, obtain the device to be confirmed. key, and control the device to be authenticated based on the key.
本发明的实施例还提供了一种电子装置,包括存储器和处理器,该存储器中存储有计算机程序,该处理器被设置为运行计算机程序以执行上述任一项方法实施例中的步骤。An embodiment of the present invention also provides an electronic device, including a memory and a processor. A computer program is stored in the memory, and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.
可选地,上述电子装置还可以包括传输设备以及输入输出设备,其中,该传输设备和上述处理器连接,该输入输出设备和上述处理器连接。Optionally, the above-mentioned electronic device may further include a transmission device and an input-output device, wherein the transmission device is connected to the above-mentioned processor, and the input-output device is connected to the above-mentioned processor.
可选地,在本实施例中,上述处理器可以被设置为通过计算机程序执行以下步骤:Optionally, in this embodiment, the above-mentioned processor may be configured to perform the following steps through a computer program:
S1,接收待确权设备广播的第一广播数据,并确定所述第一广播数据的第一信号强度;S1, receive the first broadcast data broadcast by the device to be confirmed, and determine the first signal strength of the first broadcast data;
S2,根据所述第一信号强度确定控制设备与待确权设备的第一距离,在所述第一距离小于预设阈值的情况下,向所述待确权设备发送心跳数据;S2, determine the first distance between the control device and the device to be confirmed based on the first signal strength, and when the first distance is less than a preset threshold, send heartbeat data to the device to be confirmed;
S3,在所述待确权设备根据所述心跳数据的第二信号强度确定所述待确权设备和所述控制设备的第二距离小于预设阈值的情况下,获取所述待确权设备的密钥,并根据所述密钥控制所述待确权设备。S3: When the device to be confirmed determines that the second distance between the device to be confirmed and the control device is less than a preset threshold based on the second signal strength of the heartbeat data, obtain the device to be confirmed. key, and control the device to be authenticated based on the key.
可选地,在本实施例中,上述存储介质可以包括但不限于:U盘、只读存储器(Read-Only Memory,简称为ROM)、随机存取存储器(Random Access Memory,简称为RAM)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。Optionally, in this embodiment, the above storage medium may include but is not limited to: U disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), Various media that can store program code, such as mobile hard drives, magnetic disks, or optical disks.
可选地,本实施例中的具体示例可以参考上述实施例及可选实施方式中所描述的示例,本实施例在此不再赘述。Optionally, for specific examples in this embodiment, reference can be made to the examples described in the above-mentioned embodiments and optional implementations, and details will not be described again in this embodiment.
显然,本领域的技术人员应该明白,上述的本发明的各模块或各步骤可以用通用的计算装置来实现,它们可以集中在单个的计算装置上,或者分布在多个计算装置所组成的网络上,可选地,它们可以用计算装置可执行的程序代码来实现,从而,可以将它们存储在存储装置中由计算装置来执行,并且在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤,或者将它们分别制作成各个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。这样,本发明不限制于任何特定的硬件和软件结合。Obviously, those skilled in the art should understand that the above-mentioned modules or steps of the present invention can be implemented using general-purpose computing devices. They can be concentrated on a single computing device, or distributed across a network composed of multiple computing devices. , optionally, they may be implemented in program code executable by a computing device, such that they may be stored in a storage device for execution by the computing device, and in some cases, may be in a sequence different from that herein. The steps shown or described are performed either individually as individual integrated circuit modules, or as multiple modules or steps among them as a single integrated circuit module. As such, the invention is not limited to any specific combination of hardware and software.
以上所述仅为本发明的优选实施例而已,并不用于限制本发明,对于本领域的技术人员来说,本发明可以有各种更改和变化。凡在本发明的原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。The above descriptions are only preferred embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and changes. Any modifications, equivalent substitutions, improvements, etc. made within the principles of the present invention shall be included in the protection scope of the present invention.
Claims (9)
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 |
---|---|---|
US9769732B2 (en) | Wireless network connection establishment method and terminal device | |
EP2405622B1 (en) | Device communication | |
KR101644090B1 (en) | Method for connecting wireless communications, wireless communications station and wireless communications system | |
CN113423105B (en) | Network connection method and device | |
CN105323824B (en) | Electronic equipment assisting WIFI equipment in networking, WIFI equipment and method | |
WO2018049892A1 (en) | Data transmission method and apparatus, and terminal | |
CN111490916A (en) | Method, system, device and medium for binding ZigBee sub-devices of ZigBee | |
CN102308562A (en) | Mobile terminal and method, device, system for controlling mobile terminal | |
CN108702603A (en) | A kind of method and apparatus communicated by virtual client identification module | |
CN109660988B (en) | Communication authentication processing method and device and electronic equipment | |
CN102739864A (en) | Method for realizing wireless earphone function of television set and wireless communication equipment | |
CN104219734A (en) | Internet access method and device for internet device | |
CN113286294B (en) | Equipment wireless network information configuration method and device | |
KR20140060793A (en) | Method for providing kids care function using smart-phone, and smart-phone with kids care function | |
CN114760112A (en) | Wireless local area network-oriented intelligent household equipment network access method, system, equipment and storage medium | |
CN108541077B (en) | WPS-based rapid network distribution method and system for intelligent hardware equipment | |
CN105873047A (en) | Wireless local area network user authentication method and system, and terminal device | |
CN107087293B (en) | Access method, terminal and server | |
CN104468825A (en) | Remote authorization method and system | |
KR20190088820A (en) | Method and electronic device for controlling data communication | |
CN112040484A (en) | Password updating method and device, storage medium and electronic device | |
CN114040323B (en) | Control method and device of equipment, storage medium and electronic device | |
CN106131771B (en) | Bluetooth pairing method and device for mobile phone and payment terminal | |
CN110087281A (en) | The method, apparatus and system of network insertion | |
CN106792687B (en) | Connection method and system of WIFI network of mobile terminal |
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 |