技术领域Technical Field
本发明涉及通信领域,具体而言,涉及一种信息同步方法及系统、存储介质、电子装置。The present invention relates to the field of communications, and in particular to an information synchronization method and system, a storage medium, and an electronic device.
背景技术Background technique
在智慧家庭中,智能家电设备通过WIFI接入到家庭网络中,通常是通过配网操作将家庭内路由器的SSID(Service set Identifier,服务集标识,简称SSID)名称和密码发送给智能家电设备。当用户更换路由器SSID名称或者更换路由器的密码时,就需要重新对每一台智能家电设备重新进行配网操作,这将是一个费时费力的工作,特别是家庭内的智能家电设备比较多时。In a smart home, smart home appliances are connected to the home network through WIFI. Usually, the SSID (Service Set Identifier) name and password of the home router are sent to the smart home appliances through network configuration. When the user changes the SSID name of the router or changes the password of the router, it is necessary to re-configure the network for each smart home appliance, which will be a time-consuming and laborious task, especially when there are many smart home appliances in the home.
相关技术中,提供了一种基于路由器的WIFI信息自同步方案:主要步骤是当路由器的SSID名称或者密码发生变化,路由器和设备之间建立同步机制,使设备无需重新配网就可以自动从路由器获得新的WIFI信息,但是由于上述同步机制中路由器的参与是不可或缺的,不同厂家之间的路由器根设备不能很好的兼容,因此,难以实现互联互通。In the related art, a router-based WIFI information self-synchronization solution is provided: the main step is to establish a synchronization mechanism between the router and the device when the SSID name or password of the router changes, so that the device can automatically obtain new WIFI information from the router without re-configuring the network. However, since the participation of the router in the above synchronization mechanism is indispensable, the router root devices of different manufacturers are not well compatible, and therefore, it is difficult to achieve interoperability.
针对相关技术中,WIFI信息的同步依赖于路由器,无法实现设备之间的WIFI信息自同步等问题,尚未提出有效的技术方案。In view of the problems in the related art that the synchronization of WIFI information depends on the router and the self-synchronization of WIFI information between devices cannot be achieved, no effective technical solution has been proposed.
发明内容Summary of the invention
本发明实施例提供了一种信息同步方法及系统、存储介质、电子装置,以至少解决相关技术中,WIFI信息的同步依赖于路由器,无法实现设备之间的WIFI信息自同步等问题。The embodiments of the present invention provide an information synchronization method and system, a storage medium, and an electronic device to at least solve the problem in the related art that the synchronization of WIFI information depends on a router and that self-synchronization of WIFI information between devices cannot be achieved.
根据本发明的一个实施例,提供了一种信息同步方法,包括:在目标区域存在已连网设备的情况下,向所述目标区域广播包含未连网设备中存储的网络标识的数据信息,其中,所述已连网设备用于指示目标对象更换连接信息后重新连网的设备;接收所述已连网设备根据所述数据信息反馈的用于单播交互的第一握手帧;在所述第一握手帧符合预设条件的情况下,向所述已连网设备发送包含预设网络密钥的第二握手帧,以获取所述已连网设备根据所述第二握手帧确定的目标连接信息,其中,所述目标连接信息用于指示已加密的所述已连网设备的当前连接信息。According to one embodiment of the present invention, there is provided an information synchronization method, comprising: in the case where there are connected devices in a target area, broadcasting data information containing a network identifier stored in an unconnected device to the target area, wherein the connected device is used to indicate a device that reconnects to the network after the target object changes its connection information; receiving a first handshake frame for unicast interaction fed back by the connected device based on the data information; and in the case where the first handshake frame meets a preset condition, sending a second handshake frame containing a preset network key to the connected device to obtain target connection information determined by the connected device based on the second handshake frame, wherein the target connection information is used to indicate the encrypted current connection information of the connected device.
在一个示例性实施例中,在所述第一握手帧符合预设条件的情况下,向所述已连网设备发送包含预设网络密钥的第二握手帧,包括:确定第一握手帧携带的认证信息,其中,所述认证信息中包括:表示握手帧次数的序列号、标识当前握手帧唯一性的第一随机数值、已连网设备与路由器连接的工作信道、已连网设备对应的网络标识;在所述认证信息中的所述已连网设备对应的网络标识与所述未连网设备中存储的网络标识一致的情况下,根据预设网络密钥结合所述第一随机数值确定用于加密待同步的连接信息的第一密钥,其中,所述连接信息包括以下至少之一:路由器服务集标识的信息,路由器密码的信息;将所述认证信息和所述第一密钥进行数据打包,并添加消息的完整性校验标识以及第二随机数值,以确定向所述已连网设备发送包含预设网络密钥的第二握手帧。In an exemplary embodiment, when the first handshake frame meets preset conditions, sending a second handshake frame containing a preset network key to the connected device includes: determining authentication information carried by the first handshake frame, wherein the authentication information includes: a serial number indicating the number of handshake frames, a first random value identifying the uniqueness of the current handshake frame, a working channel connecting the connected device and the router, and a network identifier corresponding to the connected device; when the network identifier corresponding to the connected device in the authentication information is consistent with the network identifier stored in the non-connected device, determining a first key for encrypting the connection information to be synchronized based on the preset network key combined with the first random value, wherein the connection information includes at least one of the following: information on the router service set identifier, information on the router password; packaging the authentication information and the first key, and adding a message integrity check identifier and a second random value to determine that a second handshake frame containing the preset network key is sent to the connected device.
在一个示例性实施例中,确定第一握手帧携带的认证信息之后,上述方法还包括:在所述认证信息中还包括有用于指示当前所述第一握手帧对应交互流程次数的序列号的情况下,确定已接收的多个第一握手帧对应的多个目标序列号与所述序列号是否存在匹配;在所述多个目标序列号与所述序列号不存在匹配的情况下,确定当前所述第一握手帧不为重复的第一握手帧;在所述多个目标序列号与所述序列号存在匹配的情况下,确定当前所述第一握手帧为重复的第一握手帧,所述第一握手帧对应的握手流程结束。In an exemplary embodiment, after determining the authentication information carried by the first handshake frame, the above method also includes: when the authentication information also includes a sequence number for indicating the number of interaction processes corresponding to the current first handshake frame, determining whether there is a match between multiple target sequence numbers corresponding to multiple received first handshake frames and the sequence number; when there is no match between the multiple target sequence numbers and the sequence number, determining that the current first handshake frame is not a repeated first handshake frame; when there is a match between the multiple target sequence numbers and the sequence number, determining that the current first handshake frame is a repeated first handshake frame, and the handshake process corresponding to the first handshake frame ends.
在一个示例性实施例中,在目标区域存在已连网设备的情况下,向所述目标区域广播包含未连网设备中存储的网络标识的数据信息,所述方法还包括:确定未连网设备待轮询的信道列表,其中,所述信道列表用于指示所述未连网设备通信的信道以及所述信道的数量;根据所述信道列表确定向所述目标区域进行广播的时间周期;在所述时间周期内获取到信道验证成功的指示信息的情况下,停止向所述目标区域进行广播,其中,所述信道验证成功用于指示信道接收到已联网设备发送的交互信息,所述交互信息包括第一握手帧。In an exemplary embodiment, when there are connected devices in a target area, data information containing network identifiers stored in non-connected devices is broadcast to the target area, and the method further includes: determining a channel list to be polled by non-connected devices, wherein the channel list is used to indicate the channels for communication of the non-connected devices and the number of channels; determining a time period for broadcasting to the target area based on the channel list; and stopping broadcasting to the target area when indication information of successful channel verification is obtained within the time period, wherein the successful channel verification is used to indicate that the channel has received interactive information sent by connected devices, and the interactive information includes a first handshake frame.
在一个示例性实施例中,在目标区域存在已连网设备的情况下,向所述目标区域广播包含未连网设备中存储的网络标识的数据信息之前,所述方法还包括:确定预设的过滤名单,其中,所述过滤名单用于指示已连网设备当前使用的连接信息无法被同步使用;在存在于所述过滤名单的已入网设备发送所述第一握手帧的情况下,禁止执行生成第二握手帧的操作。In an exemplary embodiment, when there are networked devices in the target area, before broadcasting data information containing network identifiers stored in non-networked devices to the target area, the method also includes: determining a preset filter list, wherein the filter list is used to indicate that connection information currently used by networked devices cannot be used synchronously; and prohibiting the operation of generating a second handshake frame when a networked device present in the filter list sends the first handshake frame.
在一个示例性实施例中,接收所述已连网设备根据所述数据信息反馈的用于单播交互的第一握手帧之后,所述方法还包括:在所述已连网设备存在多个且每一个所述已连网设备都反馈第一握手帧的情况下,根据每一个所述已连网设备反馈第一握手帧的时间点确定时序列表;根据所述时序列表的先后顺序进行所述第一握手帧是否符合预设条件的选择验证。In an exemplary embodiment, after receiving the first handshake frame for unicast interaction fed back by the connected device based on the data information, the method further includes: when there are multiple connected devices and each of the connected devices feeds back the first handshake frame, determining a timing sequence list based on the time point at which each of the connected devices feeds back the first handshake frame; and performing selection verification on whether the first handshake frame meets preset conditions based on the sequence of the timing sequence list.
根据本发明的一个实施例,提供了另一种信息同步方法,包括:获取未连网设备发送的包含未连网设备中存储的网络标识的数据信息,其中,所述未连网设备用于指示目标对象更换连接信息后中断连网的设备;在确定所述数据信息中包含的未连网设备中存储的网络标识与自身网络标识相同的情况下,向所述未连网设备发送用于单播交互的第一握手帧;接收所述未连网设备在确定所述第一握手帧符合预设条件之后发送的用于指示同步的第二握手帧;根据所述第二握手帧对当前连接信息进行加密,以得到用于同步的目标连接信息。According to one embodiment of the present invention, another information synchronization method is provided, comprising: obtaining data information sent by an unconnected device containing a network identifier stored in the unconnected device, wherein the unconnected device is used to indicate a device that is disconnected from the network after a target object changes connection information; when it is determined that the network identifier stored in the unconnected device contained in the data information is the same as its own network identifier, sending a first handshake frame for unicast interaction to the unconnected device; receiving a second handshake frame for indicating synchronization sent by the unconnected device after determining that the first handshake frame meets a preset condition; and encrypting the current connection information according to the second handshake frame to obtain the target connection information for synchronization.
在一个示例性实施例中,在确定所述数据信息中包含的未连网设备中存储的网络标识与自身网络标识相同的情况下,向所述未连网设备发送用于单播交互的第一握手帧,包括:在所述未连网设备中存储的网络标识与自身网络标识相同的情况下,确定所述未连网设备存在与目标区域,且所述未连网设备被允许执行单播交互;根据所述单播交互对应的预设条件确定待携带的认证信息,以确定对应的第一握手帧,其中,所述认证信息中包括:标识当前握手帧唯一性的第一随机数值、已连网设备对应的网络标识、当前所述第一握手帧对应交互流程次数的序列号。In an exemplary embodiment, when it is determined that the network identifier stored in the unconnected device contained in the data information is the same as its own network identifier, a first handshake frame for unicast interaction is sent to the unconnected device, including: when the network identifier stored in the unconnected device is the same as its own network identifier, determining that the unconnected device exists in the target area and that the unconnected device is allowed to perform unicast interaction; determining the authentication information to be carried according to the preset conditions corresponding to the unicast interaction to determine the corresponding first handshake frame, wherein the authentication information includes: a first random value identifying the uniqueness of the current handshake frame, the network identifier corresponding to the connected device, and a serial number of the number of interaction processes corresponding to the current first handshake frame.
根据本发明的另一个实施例,提供了一种信息同步系统,包括:已连网设备,用于获取未连网设备发送的包含未连网设备中存储的网络标识的数据信息,其中,所述未连网设备用于指示目标对象更换连接信息后中断连网的设备;在确定所述数据信息中包含的未连网设备中存储的网络标识与自身网络标识相同的情况下,向所述未连网设备发送用于单播交互的第一握手帧;接收所述未连网设备发送的用于指示同步的第二握手帧,根据所述第二握手帧对当前连接信息进行加密,以得到用于同步的目标连接信息;未连网设备,用于在目标区域存在已连网设备的情况下,向所述目标区域广播包含未连网设备中存储的网络标识的数据信息,其中,所述已连网设备用于指示目标对象更换连接信息后重新连网的设备;接收所述已连网设备发送的第一握手帧,在所述第一握手帧符合预设条件的情况下,向所述已连网设备发送包含预设网络密钥的第二握手帧。According to another embodiment of the present invention, an information synchronization system is provided, comprising: a connected device, for acquiring data information sent by an unconnected device containing a network identifier stored in the unconnected device, wherein the unconnected device is used to indicate a device that is disconnected from the network after a target object changes its connection information; in a case where it is determined that the network identifier stored in the unconnected device contained in the data information is the same as its own network identifier, sending a first handshake frame for unicast interaction to the unconnected device; receiving a second handshake frame sent by the unconnected device for indicating synchronization, encrypting current connection information according to the second handshake frame to obtain target connection information for synchronization; an unconnected device, for broadcasting data information containing a network identifier stored in the unconnected device to a target area when a connected device exists in the target area, wherein the connected device is used to indicate a device that is reconnected to the network after a target object changes its connection information; receiving the first handshake frame sent by the connected device, and in a case where the first handshake frame meets a preset condition, sending a second handshake frame containing a preset network key to the connected device.
在一个示例性实施例中,上述系统还包括:路由器,用于为已连网设备和未连网设备提供网络。In an exemplary embodiment, the system further includes: a router, configured to provide a network for networked devices and non-networked devices.
在一个示例性实施例中,上述未连网设备,还用于确定第一握手帧携带的认证信息,其中,所述认证信息中包括:标识当前握手帧唯一性的第一随机数值、已连网设备对应的网络标识;在所述认证信息中的所述已连网设备对应的网络标识与所述未连网设备中存储的网络标识一致的情况下,根据预设网络密钥结合所述第一随机数值确定用于加密待同步的连接信息的第一密钥,其中,所述连接信息包括以下至少之一:路由器服务集标识的信息,路由器密码的信息;将所述认证信息和所述第一密钥进行数据打包,并添加消息的完整性校验标识以及第二随机数值,以确定向所述已连网设备发送包含预设网络密钥的第二握手帧。In an exemplary embodiment, the above-mentioned non-networked device is also used to determine the authentication information carried by the first handshake frame, wherein the authentication information includes: a first random value identifying the uniqueness of the current handshake frame, and a network identifier corresponding to the networked device; when the network identifier corresponding to the networked device in the authentication information is consistent with the network identifier stored in the non-networked device, a first key for encrypting the connection information to be synchronized is determined according to a preset network key combined with the first random value, wherein the connection information includes at least one of the following: information on a router service set identifier, information on a router password; the authentication information and the first key are data packaged, and a message integrity check identifier and a second random value are added to determine that a second handshake frame containing a preset network key is sent to the networked device.
在一个示例性实施例中,上述未连网设备,还用于确定未连网设备待轮询的信道列表,其中,所述信道列表用于指示所述未连网设备通信的信道以及所述信道的数量;根据所述信道列表确定向所述目标区域进行广播的时间周期;在所述时间周期内获取到信道验证成功的指示信息的情况下,停止向所述目标区域进行广播,其中,所述信道验证成功用于指示信道接收到已联网设备发送的交互信息,所述交互信息包括第一握手帧。In an exemplary embodiment, the above-mentioned non-networked device is also used to determine a channel list to be polled by the non-networked device, wherein the channel list is used to indicate the channels for communication of the non-networked device and the number of channels; determine the time period for broadcasting to the target area according to the channel list; and stop broadcasting to the target area if indication information of successful channel verification is obtained within the time period, wherein the successful channel verification is used to indicate that the channel has received interaction information sent by a networked device, and the interaction information includes a first handshake frame.
在一个示例性实施例中,上述未连网设备,还用于确定预设的过滤名单,其中,所述过滤名单用于指示已连网设备当前使用的连接信息无法被同步使用;在存在于所述过滤名单的已入网设备发送所述第一握手帧的情况下,禁止执行生成第二握手帧的操作。In an exemplary embodiment, the above-mentioned non-networked device is also used to determine a preset filter list, wherein the filter list is used to indicate that the connection information currently used by the networked device cannot be used synchronously; when the networked device present in the filter list sends the first handshake frame, the operation of generating the second handshake frame is prohibited.
在一个示例性实施例中,上述未连网设备,还用于在所述已连网设备存在多个且每一个所述已连网设备都反馈第一握手帧的情况下,根据每一个所述已连网设备反馈第一握手帧的时间点确定时序列表;根据所述时序列表的先后顺序进行所述第一握手帧是否符合预设条件的选择验证。In an exemplary embodiment, the above-mentioned non-networked device is also used to determine a timing sequence list according to the time point when each of the networked devices feeds back the first handshake frame when there are multiple networked devices and each of the networked devices feeds back the first handshake frame; and select and verify whether the first handshake frame meets preset conditions according to the sequence of the timing sequence list.
在一个示例性实施例中,上述已连网设备,还用于在所述未连网设备中存储的网络标识与自身网络标识相同的情况下,确定所述未连网设备存在与目标区域,且所述未连网设备被允许执行单播交互;根据所述单播交互对应的预设条件确定待携带的认证信息,以确定对应的第一握手帧,其中,所述认证信息中包括:标识当前握手帧唯一性的第一随机数值、已连网设备与路由器连接的工作信道、当前所述第一握手帧对应交互流程次数的序列号。In an exemplary embodiment, the above-mentioned networked device is also used to determine that the non-networked device exists in the target area and that the non-networked device is allowed to perform unicast interaction when the network identifier stored in the non-networked device is the same as its own network identifier; determine the authentication information to be carried according to the preset conditions corresponding to the unicast interaction to determine the corresponding first handshake frame, wherein the authentication information includes: a first random value identifying the uniqueness of the current handshake frame, the working channel connecting the networked device to the router, and the serial number of the number of interaction processes corresponding to the current first handshake frame.
根据本发明的又一个实施例,还提供了一种存储介质,所述存储介质中存储有计算机程序,其中,所述计算机程序被设置为运行时执行上述任一项方法实施例中的步骤。According to yet another embodiment of the present invention, a storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of any one of the above method embodiments when running.
根据本发明的又一个实施例,还提供了一种电子装置,包括存储器和处理器,所述存储器中存储有计算机程序,所述处理器被设置为运行所述计算机程序以执行上述任一项方法实施例中的步骤。According to yet another embodiment of the present invention, there is provided an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
通过本发明,在目标区域存在已连网设备的情况下,向目标区域广播包含未连网设备中存储的网络标识的数据信息,其中,已连网设备用于指示目标对象更换连接信息后重新连网的设备;接收已连网设备根据数据信息反馈的用于单播交互的第一握手帧;在第一握手帧符合预设条件的情况下,向已连网设备发送包含预设网络密钥的第二握手帧,以获取已连网设备根据第二握手帧确定的目标连接信息,其中,目标连接信息用于指示已加密的已连网设备的当前连接信息,也就是说,通过已连网设备与未连网设备之间的握手帧交互,进行更换连接信息的自主同步,继而实现设备之间的连接信息的同步交互,因此,可以解决现有技术中WIFI信息的同步依赖于路由器,无法实现设备之间的WIFI信息自同步,确保了设备在路由器对应的连接信息变更后通过其他已连接设备的进行更换连接信息的同步,提升了设备在路由器连接的灵活性,并验证了未连接设备的合法性。According to the present invention, when there are connected devices in the target area, data information including network identifiers stored in unconnected devices is broadcast to the target area, wherein the connected devices are used to indicate devices that are reconnected to the network after the target object changes connection information; a first handshake frame for unicast interaction fed back by the connected device according to the data information is received; when the first handshake frame meets the preset conditions, a second handshake frame including a preset network key is sent to the connected device to obtain target connection information determined by the connected device according to the second handshake frame, wherein the target connection information is used to indicate the encrypted current connection information of the connected device, that is, through the handshake frame interaction between the connected device and the unconnected device, autonomous synchronization of changing the connection information is performed, and then synchronous interaction of the connection information between the devices is realized. Therefore, the problem that the synchronization of WIFI information in the prior art depends on the router and the self-synchronization of WIFI information between devices cannot be realized, and it is ensured that the device changes the synchronization of the connection information through other connected devices after the connection information corresponding to the router is changed, thereby improving the flexibility of the device in the router connection and verifying the legitimacy of the unconnected device.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
此处所说明的附图用来提供对本发明的进一步理解,构成本申请的一部分,本发明的示意性实施例及其说明用于解释本发明,并不构成对本发明的不当限定。在附图中:The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary 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 drawings:
图1是本发明实施例的一种信息同步方法的设备终端的硬件结构框图;1 is a hardware structure block diagram of a device terminal of an information synchronization method according to an embodiment of the present invention;
图2是根据本发明实施例的信息同步方法的流程图(一);FIG2 is a flow chart of an information synchronization method according to an embodiment of the present invention (I);
图3是根据本发明实施例的信息同步方法的流程图(二);FIG3 is a flow chart of an information synchronization method according to an embodiment of the present invention (II);
图4是根据本发明可选实施例的信息同步方法的交互示意图;FIG4 is an interactive schematic diagram of an information synchronization method according to an optional embodiment of the present invention;
图5是根据本发明实施例的信息同步系统的结构框图。FIG5 is a structural block diagram of an information synchronization system according to an embodiment of the present invention.
具体实施方式Detailed ways
下文中将参考附图并结合实施例来详细说明本发明。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。The present invention will be described in detail below with reference to the accompanying drawings and in combination with embodiments. It should be noted that the embodiments and features in the embodiments of the present application can be combined with each other without conflict.
需要说明的是,本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。It should be noted that the terms "first", "second", etc. in the specification 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.
本申请实施例所提供的方法实施例可以在计算机终端或者设备终端类似的运算装置中执行。以运行在设备终端上为例,图1是本发明实施例的一种信息同步方法的设备终端的硬件结构框图。如图1所示,设备终端可以包括一个或多个(图1中仅示出一个)处理器102(处理器102可以包括但不限于微处理器MCU或可编程逻辑器件FPGA等的处理装置)和用于存储数据的存储器104,在一个示例性实施例中,上述设备终端还可以包括用于通信功能的传输设备106以及输入输出设备108。本领域普通技术人员可以理解,图1所示的结构仅为示意,其并不对上述设备终端的结构造成限定。例如,设备终端还可包括比图1中所示更多或者更少的组件,或者具有与图1所示等同功能或比图1所示功能更多的不同的配置。The method embodiments provided in the embodiments of the present application can be executed in a computing device similar to a computer terminal or a device terminal. Taking running on a device terminal as an example, FIG1 is a hardware structure block diagram of a device terminal of an information synchronization method of an embodiment of the present invention. As shown in FIG1, the device terminal may include one or more (only one is shown in FIG1) 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 device terminal may also include a transmission device 106 and an input and output device 108 for communication functions. It can be understood by those of ordinary skill in the art that the structure shown in FIG1 is only for illustration and does not limit the structure of the above-mentioned device terminal. For example, the device terminal may also include more or fewer components than those shown in FIG1, or have different configurations with equivalent functions as shown in FIG1 or more functions than those shown in FIG1.
存储器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 the computer program corresponding to the information synchronization method in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a 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 a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the device terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
传输装置106用于经由一个网络接收或者发送数据。上述的网络具体实例可包括设备终端的通信供应商提供的无线网络。在一个实例中,传输装置106包括一个网络适配器(Network Interface Controller,简称为NIC),其可通过基站与其他网络设备相连从而可与互联网进行通讯。在一个实例中,传输装置106可以为射频(Radio Frequency,简称为RF)模块,其用于通过无线方式与互联网进行通讯。The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the device terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
在本实施例中提供了一种信息同步方法,图2是根据本发明实施例的信息同步方法的流程图(一),该流程包括如下步骤:In this embodiment, an information synchronization method is provided. FIG. 2 is a flow chart (I) of the information synchronization method according to an embodiment of the present invention. The flow chart includes the following steps:
步骤S202,在目标区域存在已连网设备的情况下,向所述目标区域广播包含未连网设备中存储的网络标识的数据信息,其中,所述已连网设备用于指示目标对象更换连接信息后重新连网的设备;Step S202, in the case where there are networked devices in the target area, broadcasting data information including network identifiers stored in the unconnected devices to the target area, wherein the networked devices are used to indicate the devices that the target object should reconnect to after changing the connection information;
需要说明的是,上述网络标识通常指示未连网设备在最近一次连接的网络所对应的网络标识,也以是未连网设备中存储的其他网络标识。It should be noted that the above network identifier generally indicates the network identifier corresponding to the network to which the non-networked device was most recently connected, and may also be other network identifiers stored in the non-networked device.
步骤S204,接收所述已连网设备根据所述数据信息反馈的用于单播交互的第一握手帧;Step S204, receiving a first handshake frame for unicast interaction fed back by the connected device according to the data information;
步骤S206,在所述第一握手帧符合预设条件的情况下,向所述已连网设备发送包含预设网络密钥的第二握手帧,以获取所述已连网设备根据所述第二握手帧确定的目标连接信息,其中,所述目标连接信息用于指示已加密的所述已连网设备的当前连接信息。Step S206, when the first handshake frame meets the preset conditions, sending a second handshake frame containing a preset network key to the connected device to obtain the target connection information determined by the connected device based on the second handshake frame, wherein the target connection information is used to indicate the encrypted current connection information of the connected device.
通过上述步骤,在目标区域存在已连网设备的情况下,向目标区域广播包含未连网设备中存储的网络标识的数据信息,其中,已连网设备用于指示目标对象更换连接信息后重新连网的设备;接收已连网设备根据数据信息反馈的用于单播交互的第一握手帧;在第一握手帧符合预设条件的情况下,向已连网设备发送包含预设网络密钥的第二握手帧,以获取已连网设备根据第二握手帧确定的目标连接信息,其中,目标连接信息用于指示已加密的已连网设备的当前连接信息,也就是说,通过已连网设备与未连网设备之间的握手帧交互,进行更换连接信息的自主同步,继而实现设备之间的连接信息的同步交互,因此,可以解决现有技术中WIFI信息的同步依赖于路由器,无法实现设备之间的WIFI信息自同步,确保了设备在路由器对应的连接信息变更后通过其他已连接设备的进行更换连接信息的同步,提升了设备在路由器连接的灵活性,并验证了未连接设备的合法性。Through the above steps, in the case that there are connected devices in the target area, data information containing the network identifier stored in the unconnected device is broadcast to the target area, wherein the connected device is used to indicate the device that reconnects to the network after the target object changes the connection information; a first handshake frame for unicast interaction fed back by the connected device according to the data information is received; when the first handshake frame meets the preset conditions, a second handshake frame containing a preset network key is sent to the connected device to obtain the target connection information determined by the connected device according to the second handshake frame, wherein the target connection information is used to indicate the encrypted current connection information of the connected device, that is, through the handshake frame interaction between the connected device and the unconnected device, autonomous synchronization of changing the connection information is performed, and then synchronous interaction of the connection information between the devices is realized. Therefore, the problem that the synchronization of WIFI information in the prior art depends on the router and the self-synchronization of WIFI information between devices cannot be realized, and it is ensured that the device changes the synchronization of the connection information through other connected devices after the connection information corresponding to the router is changed, thereby improving the flexibility of the device in the router connection and verifying the legitimacy of the unconnected device.
需要说明的是,上述握手帧是一种用于携带数据指示信息的数据帧,可以根据实际情况携带不同的数据信息。It should be noted that the above-mentioned handshake frame is a data frame used to carry data indication information, and can carry different data information according to actual conditions.
上述步骤S206的实现方式有多种,在一个可选实施例中,可以通过以下方案实现:确定第一握手帧携带的认证信息,其中,所述认证信息中包括:标识当前握手帧唯一性的第一随机数值、已连网设备对应的网络标识;在所述认证信息中的所述已连网设备对应的网络标识与所述未连网设备中存储的网络标识一致的情况下,根据预设网络密钥结合所述第一随机数值确定用于加密待同步的连接信息的第一密钥,其中,所述连接信息包括以下至少之一:路由器服务集标识的信息,路由器密码的信息;将所述认证信息和所述第一密钥进行数据打包,并添加消息的完整性校验标识以及第二随机数值,以确定向所述已连网设备发送包含预设网络密钥的第二握手帧。There are multiple ways to implement the above-mentioned step S206. In an optional embodiment, it can be implemented through the following scheme: determine the authentication information carried by the first handshake frame, wherein the authentication information includes: a first random value identifying the uniqueness of the current handshake frame, and a network identifier corresponding to the connected device; when the network identifier corresponding to the connected device in the authentication information is consistent with the network identifier stored in the non-connected device, determine the first key for encrypting the connection information to be synchronized according to the preset network key combined with the first random value, wherein the connection information includes at least one of the following: information on the router service set identifier, information on the router password; package the authentication information and the first key, and add a message integrity check identifier and a second random value to determine that a second handshake frame containing a preset network key is sent to the connected device.
也就是说,当未连接设备搜索到已连接设备后,已连接设备会在校验通过后,向未连接设备发送携带认证信息的用于指示后续连接认证同步的第一握手帧,进而通过第一握手帧对未连接设备的信道轮询操作进行停止,并固定信道,已确定后续的交互信道,进一步的,未连接设备基于接收到的第一握手帧,根据自身对应的预设网络密钥,以及确定出的用于指示待发送第二握手帧唯一性的第二随机数值,并增加用于验证数据包的发送者(即未连接设备)的消息的完整性校验标识,进而确定出用于握手交互的第二握手帧。That is to say, when an unconnected device searches for a connected device, the connected device will, after verification, send a first handshake frame carrying authentication information to the unconnected device to indicate subsequent connection authentication synchronization, and then stop the channel polling operation of the unconnected device through the first handshake frame, and fix the channel to determine the subsequent interaction channel. Furthermore, the unconnected device, based on the received first handshake frame, according to its own corresponding preset network key, and the second random value determined to indicate the uniqueness of the second handshake frame to be sent, adds a message integrity check identifier for verifying the sender of the data packet (i.e., the unconnected device), and then determines the second handshake frame used for handshake interaction.
在一个示例性实施例中,确定第一握手帧携带的认证信息之后,所述方法还包括:在所述认证信息中还包括有用于指示当前所述第一握手帧对应交互流程次数的序列号的情况下,确定已接收的多个第一握手帧对应的多个目标序列号与所述序列号是否存在匹配;在所述多个目标序列号与所述序列号不存在匹配的情况下,确定当前所述第一握手帧不为重复的第一握手帧;在所述多个目标序列号与所述序列号存在匹配的情况下,确定当前所述第一握手帧为重复的第一握手帧,所述第一握手帧对应的握手流程结束。In an exemplary embodiment, after determining the authentication information carried by the first handshake frame, the method also includes: when the authentication information also includes a sequence number indicating the number of interaction processes corresponding to the current first handshake frame, determining whether multiple target sequence numbers corresponding to multiple received first handshake frames match the sequence number; when there is no match between the multiple target sequence numbers and the sequence number, determining that the current first handshake frame is not a repeated first handshake frame; when there is a match between the multiple target sequence numbers and the sequence number, determining that the current first handshake frame is a repeated first handshake frame, and the handshake process corresponding to the first handshake frame ends.
简而言之,未连网设备与已连网设备的进行交互中的第一握手帧通过序列号进行本次交互流程的标识,当序列号相同证明对应的交互流程被重复执行,不相同则证明当前第一握手帧对应的交互流程未出现重复交互过程。In short, the first handshake frame in the interaction between an unconnected device and a connected device uses a serial number to identify the interaction process. If the serial numbers are the same, it proves that the corresponding interaction process is repeated. If they are different, it proves that there is no repeated interaction process in the interaction process corresponding to the current first handshake frame.
可选地,在目标区域存在已连网设备的情况下,向所述目标区域广播包含未连网设备中存储的网络标识的数据信息之后,所述方法还包括:确定未连网设备待轮询的信道列表,其中,所述信道列表用于指示所述未连网设备通信的信道以及所述信道的数量;根据所述信道列表确定向所述目标区域进行广播的时间周期;在所述时间周期内获取到信道验证成功的指示信息的情况下,停止向所述目标区域进行广播,其中,所述信道验证成功用于指示信道接收到已联网设备发送的交互信息,所述交互信息包括第一握手帧。Optionally, when there are connected devices in the target area, after broadcasting data information containing network identifiers stored in non-connected devices to the target area, the method further includes: determining a channel list to be polled by non-connected devices, wherein the channel list is used to indicate the channels for communication of the non-connected devices and the number of channels; determining a time period for broadcasting to the target area based on the channel list; and stopping broadcasting to the target area when indication information of successful channel verification is obtained within the time period, wherein the successful channel verification is used to indicate that the channel has received interactive information sent by connected devices, and the interactive information includes a first handshake frame.
例如,目标对象更改了SSID名称或者密码后,信道可能与原来的不同,并且由于路由器以及家电设备通常使用2.4G频段进行无线交互,因此未连网设备需要在13个信道上进行轮询,以发现已入网设备。初始从信道1开始,后续从轮询停止的下一个信道开始。每个信道上停留3秒钟,发送5帧,间隔512毫秒。当未连接设备第一次收到校验通过的握手帧,停止信道轮询,固定在握手step1帧中携带的信道,并对信道中传输过来的数据进行解析,进而确定出握手帧对应的内容。For example, after the target object changes the SSID name or password, the channel may be different from the original one, and because routers and home appliances usually use the 2.4G frequency band for wireless interaction, unconnected devices need to poll on 13 channels to discover connected devices. Initially start from channel 1, and then start from the next channel where polling stops. Stay on each channel for 3 seconds, send 5 frames, and the interval is 512 milliseconds. When the unconnected device receives the handshake frame that passes the verification for the first time, it stops channel polling, fixes the channel carried in the handshake step1 frame, and parses the data transmitted in the channel to determine the content corresponding to the handshake frame.
在一个示例性实施例中,在目标区域存在已连网设备的情况下,向所述目标区域广播包含未连网设备中存储的网络标识的数据信息之前,所述方法还包括:确定预设的过滤名单,其中,所述过滤名单用于指示已连网设备当前使用的连接信息无法被同步使用;在存在于所述过滤名单的已入网设备发送所述第一握手帧的情况下,禁止执行生成第二握手帧的操作。In an exemplary embodiment, when there are networked devices in the target area, before broadcasting data information containing network identifiers stored in non-networked devices to the target area, the method also includes: determining a preset filter list, wherein the filter list is used to indicate that connection information currently used by networked devices cannot be used synchronously; and prohibiting the operation of generating a second handshake frame when a networked device present in the filter list sends the first handshake frame.
例如,如果已入网设备在过滤名单,则忽略该已入网设备。与所有已入网设备的通信均失败后继续信道轮询。对于多个已入网设备,可以根据收到握手帧的先后顺序进行选择,并且已加入过滤名单的已入网设备的连接信息将无法同步到未连接设备上,在接收到已加入过滤名单的已入网设备发送的用于交互的第一握手帧之后,禁止未连接设备在验证成功的情况下生成对应的第二握手帧,并结束未连接设备与已加入过滤名单的已入网设备的交互流程。For example, if a connected device is in the filter list, the connected device is ignored. After all communications with all connected devices fail, channel polling continues. For multiple connected devices, selection can be made based on the order in which the handshake frames are received, and the connection information of the connected devices that have been added to the filter list will not be synchronized to the unconnected devices. After receiving the first handshake frame for interaction sent by the connected device that has been added to the filter list, the unconnected device is prohibited from generating the corresponding second handshake frame if the verification is successful, and the interaction process between the unconnected device and the connected device that has been added to the filter list is terminated.
在一个示例性实施例中,接收所述已连网设备根据所述数据信息反馈的用于单播交互的第一握手帧之后,所述方法还包括:在所述已连网设备存在多个且每一个所述已连网设备都反馈第一握手帧的情况下,根据每一个所述已连网设备反馈第一握手帧的时间点确定时序列表;根据所述时序列表的先后顺序进行所述第一握手帧是否符合预设条件的选择验证。In an exemplary embodiment, after receiving the first handshake frame for unicast interaction fed back by the connected device based on the data information, the method further includes: when there are multiple connected devices and each of the connected devices feeds back the first handshake frame, determining a timing sequence list based on the time point at which each of the connected devices feeds back the first handshake frame; and performing selection verification on whether the first handshake frame meets preset conditions based on the sequence of the timing sequence list.
例如,未连网设备可能会收到多个已入网设备的第一握手帧。根据系统资源的情况,可以维护一到多个已入网设备的通信,但与每个已入网设备通信最多尝试3次,因此,需要根据第一握手帧对应的反馈时间点,确定选择认证的次序。For example, a non-networked device may receive the first handshake frames of multiple networked devices. Depending on the system resources, communication with one or more networked devices can be maintained, but communication with each networked device can be attempted at most three times. Therefore, the order of selecting authentication needs to be determined based on the feedback time point corresponding to the first handshake frame.
在本实施例中提供了另一种信息同步方法,图3是根据本发明实施例的信息同步方法的流程图(二),该流程包括如下步骤:In this embodiment, another information synchronization method is provided. FIG. 3 is a flow chart (II) of the information synchronization method according to an embodiment of the present invention. The flow chart includes the following steps:
步骤S302,获取未连网设备发送的包含未连网设备中存储的网络标识的数据信息,其中,所述未连网设备用于指示目标对象更换连接信息后中断连网的设备;Step S302, obtaining data information sent by a non-networked device and including a network identifier stored in the non-networked device, wherein the non-networked device is used to indicate a device that is disconnected from the network after the target object changes its connection information;
步骤S304,在确定所述数据信息中包含的未连网设备中存储的网络标识与自身网络标识相同的情况下,向所述未连网设备发送用于单播交互的第一握手帧;Step S304: When it is determined that the network identifier stored in the non-networked device contained in the data information is the same as its own network identifier, a first handshake frame for unicast interaction is sent to the non-networked device;
步骤S306,接收所述未连网设备在确定所述第一握手帧符合预设条件之后发送的用于指示同步的第二握手帧;Step S306, receiving a second handshake frame for indicating synchronization, which is sent by the non-networked device after determining that the first handshake frame meets a preset condition;
步骤S308,根据所述第二握手帧对当前连接信息进行加密,以得到用于同步的目标连接信息。Step S308: encrypt the current connection information according to the second handshake frame to obtain target connection information for synchronization.
通过上述步骤,获取未连网设备发送的包含未连网设备中存储的网络标识的数据信息,其中,未连网设备用于指示目标对象更换连接信息后中断连网的设备;在确定数据信息中包含的未连网设备中存储的网络标识与自身网络标识相同的情况下,向未连网设备发送用于单播交互的第一握手帧;接收未连网设备在确定第一握手帧符合预设条件之后发送的用于指示同步的第二握手帧;根据第二握手帧对当前连接信息进行加密,以得到用于同步的目标连接信息,也就是说,通过已连网设备与未连网设备之间的握手帧交互,进行更换连接信息的自主同步,继而实现设备之间的连接信息的同步交互,因此,可以解决现有技术中WIFI信息的同步依赖于路由器,无法实现设备之间的WIFI信息自同步,确保了设备在路由器对应的连接信息变更后通过其他已连接设备的进行更换连接信息的同步,提升了设备在路由器连接的灵活性,并验证了未连接设备的合法性。Through the above steps, the data information sent by the unconnected device and containing the network identifier stored in the unconnected device is obtained, wherein the unconnected device is used to indicate the device that is disconnected from the network after the target object changes the connection information; when it is determined that the network identifier stored in the unconnected device contained in the data information is the same as its own network identifier, a first handshake frame for unicast interaction is sent to the unconnected device; a second handshake frame for indicating synchronization sent by the unconnected device after determining that the first handshake frame meets the preset conditions is received; the current connection information is encrypted according to the second handshake frame to obtain the target connection information for synchronization, that is, through the handshake frame interaction between the connected device and the unconnected device, the autonomous synchronization of the connection information is changed, and then the synchronous interaction of the connection information between the devices is realized. Therefore, the problem that the synchronization of WIFI information in the prior art depends on the router and the self-synchronization of WIFI information between devices cannot be realized, and it is ensured that the device changes the connection information through other connected devices after the connection information corresponding to the router is changed. The flexibility of the device in the router connection is improved, and the legitimacy of the unconnected device is verified.
在一个示例性实施例中,在确定所述数据信息中包含的未连网设备中存储的网络标识与自身网络标识相同的情况下,向所述未连网设备发送用于单播交互的第一握手帧,包括:在所述未连网设备中存储的网络标识与自身网络标识相同的情况下,确定所述未连网设备存在与目标区域,且所述未连网设备被允许执行单播交互;根据所述单播交互对应的预设条件确定待携带的认证信息,以确定对应的第一握手帧,其中,所述认证信息中包括:标识当前握手帧唯一性的第一随机数值、已连网设备与路由器连接的工作信道、已连网设备对应的网络标识、当前所述第一握手帧对应交互流程次数的序列号。In an exemplary embodiment, when it is determined that the network identifier stored in the unconnected device contained in the data information is the same as its own network identifier, a first handshake frame for unicast interaction is sent to the unconnected device, including: when the network identifier stored in the unconnected device is the same as its own network identifier, determining that the unconnected device exists in the target area and that the unconnected device is allowed to perform unicast interaction; determining the authentication information to be carried according to the preset conditions corresponding to the unicast interaction to determine the corresponding first handshake frame, wherein the authentication information includes: a first random value identifying the uniqueness of the current handshake frame, the working channel connecting the connected device to the router, the network identifier corresponding to the connected device, and the serial number of the number of interaction processes corresponding to the current first handshake frame.
为了更好的理解上述信息同步方法的过程,以下结合两个可选实施例对上述信息同步方法流程进行说明。In order to better understand the process of the above information synchronization method, the above information synchronization method process is described below in combination with two optional embodiments.
本发明可选实施例中,主要提供了一种WIFI信息自同步的方法,当用户更换路由器SSID名称或者更换路由器的密码时,只需要重新对一台智能家电设备进行配网操作,其他智能家电设备通过智能家电设备间的同步机制可以进行WIFI信息自同步。In an optional embodiment of the present invention, a method for self-synchronization of WIFI information is mainly provided. When a user changes the SSID name of a router or changes the password of a router, it is only necessary to re-configure the network for one smart home appliance. Other smart home appliances can self-synchronize WIFI information through the synchronization mechanism between smart home appliances.
为了更好的理解本发明实施例以及可选实施例的技术方案,以下对本发明实施例以及可选实施例中可能出现的名词术语进行说明,但不用于限定以下场景的应用。In order to better understand the technical solutions of the embodiments and optional embodiments of the present invention, the terms and concepts that may appear in the embodiments and optional embodiments of the present invention are explained below, but are not used to limit the application of the following scenarios.
已连网设备:用户更换路由器SSID名称或者更换路由器的密码后,重新连入家庭网络的智能家电设备。重新连网的方式包括但不限于设备配网、本发明可选实施例描述的方式等。Connected devices: smart home appliances that are reconnected to the home network after the user changes the router SSID name or the router password. The reconnection method includes but is not limited to device network configuration and the method described in the optional embodiment of the present invention.
未连网设备:用户更换路由器SSID名称或者更换路由器的密码后,原来可以接入家庭网络,现在不能正常连网的智能家电设备。Devices not connected to the network: After the user changes the router SSID name or the router password, the smart home appliances that were previously able to access the home network but now cannot connect to the network normally.
网络地址Network ID:家庭网络的标识。通常在设备配网绑定阶段设置到设备中,同一个家庭网络,Network ID相同。Network ID: The ID of the home network. Usually it is set in the device during the device configuration and binding phase. For the same home network, the Network ID is the same.
网络密钥Network Key:在一个家庭网络内,经过用户配网绑定的智能家电设备可以共享一个Network Key。Network Key: In a home network, smart home appliances that have been bound by user configuration can share a Network Key.
作为一种可选的实施方式,已连网设备与未连网设备的进行多次握手确定,继而实现WIFI信息自同步,如图4所示为本发明可选实施例的信息同步方法的交互示意图,包含以下步骤:As an optional implementation, the connected device and the unconnected device perform multiple handshakes to determine, and then implement WIFI information self-synchronization. FIG4 is an interactive schematic diagram of an information synchronization method of an optional embodiment of the present invention, which includes the following steps:
步骤1、搜索已连网设备帧。Step 1: Search for the connected device frame.
发送:未连网设备发送,广播形式。Send: sent by a device not connected to the Internet, in broadcast form.
内容:Network ID。Content: Network ID.
接收:已连网设备接收,如果Network ID与自身的相同,则发送握手step1帧(数据帧)。Receiving: The connected device receives. If the Network ID is the same as its own, it sends the handshake step 1 frame (data frame).
步骤2:握手step1帧;Step 2: handshake step1 frame;
发送:已连网设备,单播形式,直接发送未连网设备。Send: Connected devices, unicast mode, directly send to unconnected devices.
内容:Network ID、一个递增的序列号,每个握手step1帧均不同、一个随机数Nonce-A,每个握手step1帧均不同、工作信道,与路由器连接的工作信道。Contents: Network ID, an increasing sequence number, which is different for each handshake step1 frame, a random number Nonce-A, which is different for each handshake step1 frame, and the working channel connected to the router.
接收:未连网设备接收,如果Network ID与自身的相同,则发送握手step2帧。Receiving: The unconnected device receives. If the Network ID is the same as its own, it sends the handshake step 2 frame.
步骤3:3)握手step2帧;Step 3: 3) handshake step2 frame;
发送:未连网设备,单播形式,直接发送已连网设备。Send: For devices not connected to the network, use unicast mode to send directly to devices connected to the network.
内容:Network ID、序列号,握手step1帧中的序列号、一个随机数Nonce-B,每个握手step2帧均不同、MIC,SHA256(Network Key网络密钥,Nonce-A);Contents: Network ID, sequence number, the sequence number in the handshake step 1 frame, a random number Nonce-B, which is different for each handshake step 2 frame, MIC, SHA256 (Network Key, Nonce-A);
也就是说,未连接设备在向已连接设备发送握手step2帧时,为了保证消息的完整性通过接收的握手step1帧中的随机数A和自身存储的网络密钥通过预设的散列算法进行运算确定出对应的MIC对应的哈希值,进而已连接设备可以对收到的MIC进行解析,以确定握手step2帧是由接收到握手step1帧的未连接设备发送的,保证了流程的一致性和安全性。That is to say, when an unconnected device sends a handshake step2 frame to a connected device, in order to ensure the integrity of the message, the random number A in the received handshake step1 frame and the network key stored in itself are calculated through a preset hash algorithm to determine the hash value corresponding to the MIC. Then the connected device can parse the received MIC to determine that the handshake step2 frame is sent by the unconnected device that received the handshake step1 frame, ensuring the consistency and security of the process.
接收:已连网设备接收,如果Network ID与自身的相同,校验序列号和MIC,则发送握手step3帧。Receiving: The connected device receives. If the Network ID is the same as its own, the sequence number and MIC are verified, and then the handshake step 3 frame is sent.
步骤4:握手step3帧Step 4: Handshake step3 frame
发送:已连网设备,单播形式,直接发送未连网设备。Send: Connected devices, unicast mode, directly send to unconnected devices.
内容:Network ID;序列号,握手step1帧中的序列号;加密的SSID和密码,密钥使用SHA256(Network Key,Nonce-A,Nonce-B);MIC(Messages Integrity Check,消息完整性检查,简称MIC),SHA256(Network Key,Nonce-B);Contents: Network ID; Serial number, the serial number in the handshake step 1 frame; Encrypted SSID and password, the key uses SHA256 (Network Key, Nonce-A, Nonce-B); MIC (Messages Integrity Check, MIC for short), SHA256 (Network Key, Nonce-B);
简单来说,握手step3帧是在接收到握手step2帧的基础上发送的,并且为保证整个交互流程的一致性,根据握手step2帧中的随机数B和自身存储的网络密钥通过预设的散列算法进行运算确定出对应的MIC对应的哈希值(即SHA256(Network Key,Nonce-B)),进而未连接设备可以对收到的MIC进行解析,以确定握手step3帧是由接收到握手step2帧的已连接设备发送的,并且为了使得路由器的SSID和密码的安全性更高,通过握手step3帧之前所有交互的握手帧中携带的随机数值结合自身存储的网络密钥生成用于加密连接信息的下发密钥(即SHA256(Network Key,Nonce-A,Nonce-B))。Simply put, the handshake step3 frame is sent based on the received handshake step2 frame, and to ensure the consistency of the entire interaction process, the hash value corresponding to the corresponding MIC (i.e., SHA256 (Network Key, Nonce-B)) is determined by calculating the random number B in the handshake step2 frame and the network key stored in itself through a preset hash algorithm. Then, the unconnected device can parse the received MIC to determine that the handshake step3 frame is sent by the connected device that received the handshake step2 frame. In order to make the router's SSID and password more secure, the random value carried in all interactive handshake frames before the handshake step3 frame is combined with the network key stored in itself to generate a downlink key (i.e., SHA256 (Network Key, Nonce-A, Nonce-B)) for encrypting the connection information.
接收:未连网设备接收,如果Network ID与自身的相同,校验序列号和MIC,则解密SSID和密码,完成WIFI信息同步。Receiving: The device not connected to the network receives. If the Network ID is the same as its own, the serial number and MIC are verified, then the SSID and password are decrypted to complete the WIFI information synchronization.
本发明可选实施例中,还提供了一种未连网设备的操作方式,包含以下内容:In an optional embodiment of the present invention, an operation method of a non-networked device is also provided, including the following contents:
步骤S502:确定开始时机,当每次使用原有SSID和密码连接路由器失败后。未联网设备开启与已连网设备的自同步交互功能。Step S502: Determine the start time, when each attempt to connect to the router using the original SSID and password fails, the non-networked device starts the self-synchronization interaction function with the networked device.
步骤S504:当用户更改了SSID名称或者密码后,信道可能与原来的不同,因此未连网设备需要在13个信道上进行轮询,以发现已入网设备。初始从信道1开始,后续从轮询停止的下一个信道开始。每个信道上停留3秒钟,发送5帧,间隔512毫秒。Step S504: When the user changes the SSID name or password, the channel may be different from the original one, so the unconnected device needs to poll on 13 channels to find the connected devices. Initially start from channel 1, and then start from the next channel where the polling stops. Stay on each channel for 3 seconds, send 5 frames, and the interval is 512 milliseconds.
步骤S506:通过交互流程发现已连网设备并发出同步WIFI信息的操作信息。Step S506: discover the connected device through the interactive process and send out operation information for synchronizing WIFI information.
可选地,当未联网设备第一次收到校验通过的握手step1帧,停止信道轮询,固定在握手step1帧中携带的信道。并且需要说明的是每次通信时间最长5秒,从收到握手step1帧开始。未连网设备可能会收到多个已入网设备的握手step1帧。根据系统资源的情况,可以维护一到多个已入网设备的通信,但与每个已入网设备通信最多尝试3次。Optionally, when the non-networked device receives the handshake step1 frame that has passed the verification for the first time, it stops channel polling and fixes the channel carried in the handshake step1 frame. It should be noted that each communication time is up to 5 seconds, starting from the receipt of the handshake step1 frame. The non-networked device may receive handshake step1 frames from multiple networked devices. Depending on the system resources, the communication with one or more networked devices can be maintained, but the communication with each networked device is attempted at most 3 times.
可选地,如果已入网设备在过滤名单,则忽略该已入网设备。与所有已入网设备的通信均失败后继续信道轮询。对于多个已入网设备,可以根据收到握手step1帧的先后顺序进行选择。Optionally, if an already connected device is in the filter list, the already connected device is ignored. After all communication with all the already connected devices fails, channel polling continues. For multiple already connected devices, selection can be made based on the order in which the handshake step 1 frames are received.
步骤S508:获取到WIFI信息后,如果WIFI信息与保存的不一致,则记录发送WIFI信息的已入网设备的MAC(Media Access Control Address,媒体存取控制位址,简称MAC),关闭所有与已入网设备的通信,并退出WIFI信息同步操作,开始尝试连接路由器。Step S508: After obtaining the WIFI information, if the WIFI information is inconsistent with the saved one, the MAC (Media Access Control Address, MAC for short) of the connected device that sent the WIFI information is recorded, all communications with the connected device are closed, and the WIFI information synchronization operation is exited, and an attempt to connect to the router is started.
步骤S600:如果连接路由器成功,则保存WIFI信息;否则,丢弃WIFI信息,将对应的已入网设备置于过滤名单中(超时10分钟),使用原来的SSID和密码连接路由器,重新触发WIFI信息同步操作。Step S600: If the connection to the router is successful, the WIFI information is saved; otherwise, the WIFI information is discarded, the corresponding networked device is placed in the filter list (timeout 10 minutes), the original SSID and password are used to connect to the router, and the WIFI information synchronization operation is re-triggered.
作为一种可选的实施方式,已连网设备的操作方式包含以下内容:As an optional implementation, the operation mode of the connected device includes the following:
1)在与路由器连接的信道上监听搜索已连网设备帧,不影响与路由器的连接,不影响正常的通信。1) Listen and search for connected device frames on the channel connected to the router without affecting the connection with the router or normal communication.
2)通过交互流程完成WIFI信息同步。2) Complete WIFI information synchronization through interactive process.
3)可同时维护与一到多个未入网设备的通信。3) Can maintain communication with one or more non-networked devices at the same time.
4)每次通信时间最长5秒,从第一次发送握手step1帧开始。4) Each communication lasts up to 5 seconds, starting from the first sending of the handshake step 1 frame.
需要说明的是,本发明可选实施例描述的WIFI信息同步不依赖于路由器,只需要重新对一台智能家电设备进行配网操作,其他智能家电设备自动完成WIFI信息同步。WIFI信息同步机制通过Network Key机制实现已连网设备对未连网设备的验证,不需要云端的参与;同时通过Network Key实现了WIFI信息的加密传输。WIFI信息同步机制从未连网设备搜索已连网设备开始,经过两次交互实现了WIFI信息同步。交互流程中既没有影响已入网设备的正常通信,又实现了未入网设备的WIFI信息快速同步;同时未入网设备还设置了过滤机制,防止已入网设备传递了错误的WIFI信息。WIFI信息同步机制实现一对一、一对多、多对一和多对多的WIFI信息自同步。可以快速完成整个家庭网络内的WIFI信息同步。It should be noted that the WIFI information synchronization described in the optional embodiment of the present invention does not rely on the router. It only needs to re-configure the network for one smart home appliance, and other smart home appliances will automatically complete the WIFI information synchronization. The WIFI information synchronization mechanism uses the Network Key mechanism to realize the verification of the unconnected device by the connected device, without the participation of the cloud; at the same time, the encrypted transmission of WIFI information is realized through the Network Key. The WIFI information synchronization mechanism starts with the unconnected device searching for the connected device, and realizes the WIFI information synchronization after two interactions. The interaction process does not affect the normal communication of the connected device, and realizes the rapid synchronization of the WIFI information of the unconnected device; at the same time, the unconnected device is also equipped with a filtering mechanism to prevent the connected device from transmitting the wrong WIFI information. The WIFI information synchronization mechanism realizes one-to-one, one-to-many, many-to-one and many-to-many WIFI information self-synchronization. The WIFI information synchronization in the entire home network can be completed quickly.
进一步避免了,基于路由器的WIFI信息同步方案主要依赖于路由器与设备之间的同步机制的限制性,进而使得智能家电设备间可同时进行一对一、一对多、多对一和多对多的WIFI信息自同步。WIFI信息同步不依赖于路由器,也不依赖于云端,未连网设备可自动发现已连网设备,未连网设备可自动过滤已连网设备,已连网设备可自动验证未连网设备,WIFI信息同步不影响已连网设备的正常通信。This further avoids the limitation of the synchronization mechanism between routers and devices that is mainly relied on in the router-based WIFI information synchronization solution, thereby enabling one-to-one, one-to-many, many-to-one and many-to-many WIFI information self-synchronization between smart home appliances. WIFI information synchronization does not rely on routers or the cloud. Unconnected devices can automatically discover connected devices, unconnected devices can automatically filter connected devices, and connected devices can automatically verify unconnected devices. WIFI information synchronization does not affect the normal communication of connected devices.
综上,通过本发明可选实施例,利用已连网设备可自动发现未连网设备,已连网设备需要验证未连网设备,使得不能通过验证的未连网设备不能进行WIFI信息自同步,并且该WIFI信息自同步流程不需要云端参与,而且WIFI信息自同步不影响已连网设备的正常通信,在WIFI信息(SSID和密码)同步需要加密,可进行一对一、一对多、多对一和多对多的WIFI信息自同步,不产生过多的网络流量。In summary, through the optional embodiments of the present invention, the connected device can automatically discover the unconnected device, the connected device needs to verify the unconnected device, so that the unconnected device that cannot pass the verification cannot perform WIFI information self-synchronization, and the WIFI information self-synchronization process does not require cloud participation, and the WIFI information self-synchronization does not affect the normal communication of the connected device. When the WIFI information (SSID and password) synchronization needs to be encrypted, one-to-one, one-to-many, many-to-one and many-to-many WIFI information self-synchronization can be performed without generating excessive network traffic.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到根据上述实施例的方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本发明各个实施例所述的方法。Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present invention.
在本实施例中还提供了一种信息同步系统,该系统用于实现上述实施例及优选实施方式,已经进行过说明的不再赘述。图5是根据本发明实施例的信息同步系统的结构框图,如图5所示,该系统包括:In this embodiment, an information synchronization system is also provided, which is used to implement the above embodiments and preferred implementation modes, and the descriptions that have been made are omitted. FIG5 is a structural block diagram of an information synchronization system according to an embodiment of the present invention, as shown in FIG5 , the system includes:
已连接设备52、未连接设备54;Connected device 52, unconnected device 54;
其中,已连网设备52,用于获取未连网设备发送的包含未连网设备中存储的网络标识的数据信息,其中,所述未连网设备用于指示目标对象更换连接信息后中断连网的设备;在确定所述数据信息中包含的未连网设备中存储的网络标识与自身网络标识相同的情况下,向所述未连网设备发送用于单播交互的第一握手帧;接收所述未连网设备发送的用于指示同步的第二握手帧,根据所述第二握手帧对当前连接信息进行加密,以得到用于同步的目标连接信息;The networked device 52 is used to obtain data information sent by a non-networked device containing a network identifier stored in the non-networked device, wherein the non-networked device is used to indicate a device that is disconnected from the network after the target object changes the connection information; when it is determined that the network identifier stored in the non-networked device contained in the data information is the same as its own network identifier, send a first handshake frame for unicast interaction to the non-networked device; receive a second handshake frame sent by the non-networked device for indicating synchronization, and encrypt the current connection information according to the second handshake frame to obtain the target connection information for synchronization;
未连网设备54,用于在目标区域存在已连网设备的情况下,向所述目标区域广播包含未连网设备中存储的网络标识的数据信息,其中,所述已连网设备用于指示目标对象更换连接信息后重新连网的设备;接收所述已连网设备发送的第一握手帧,在所述第一握手帧符合预设条件的情况下,向所述已连网设备发送包含预设网络密钥的第二握手帧。The non-networked device 54 is used to broadcast data information containing a network identifier stored in the non-networked device to the target area when there is a networked device in the target area, wherein the networked device is used to indicate the device that reconnects to the network after the target object changes the connection information; receive a first handshake frame sent by the networked device, and send a second handshake frame containing a preset network key to the networked device when the first handshake frame meets a preset condition.
通过上述系统,在目标区域存在已连网设备的情况下,向目标区域广播包含未连网设备中存储的网络标识的数据信息,其中,已连网设备用于指示目标对象更换连接信息后重新连网的设备;接收已连网设备根据数据信息反馈的用于单播交互的第一握手帧;在第一握手帧符合预设条件的情况下,向已连网设备发送包含预设网络密钥的第二握手帧,以获取已连网设备根据第二握手帧确定的目标连接信息,其中,目标连接信息用于指示已加密的已连网设备的当前连接信息,也就是说,通过已连网设备与未连网设备之间的握手帧交互,进行更换连接信息的自主同步,继而实现设备之间的连接信息的同步交互,因此,可以解决现有技术中WIFI信息的同步依赖于路由器,无法实现设备之间的WIFI信息自同步,确保了设备在路由器对应的连接信息变更后通过其他已连接设备的进行更换连接信息的同步,提升了设备在路由器连接的灵活性,并验证了未连接设备的合法性。Through the above system, when there are connected devices in the target area, data information containing network identifiers stored in unconnected devices is broadcast to the target area, wherein the connected devices are used to indicate devices that reconnect to the network after the target object changes connection information; a first handshake frame for unicast interaction fed back by the connected device according to the data information is received; when the first handshake frame meets the preset conditions, a second handshake frame containing a preset network key is sent to the connected device to obtain the target connection information determined by the connected device according to the second handshake frame, wherein the target connection information is used to indicate the encrypted current connection information of the connected device, that is, through the handshake frame interaction between the connected device and the unconnected device, autonomous synchronization of changing the connection information is performed, and then synchronous interaction of the connection information between the devices is realized. Therefore, the problem that the synchronization of WIFI information in the prior art depends on the router and the self-synchronization of WIFI information between devices cannot be realized, and it is ensured that the device changes the synchronization of the connection information through other connected devices after the connection information corresponding to the router is changed, thereby improving the flexibility of the device in the router connection and verifying the legitimacy of the unconnected device.
需要说明的是,上述握手帧是一种用于携带数据指示信息的数据帧,可以根据实际情况携带不同的数据信息。在与路由器连接的信道上监听搜索已连网设备,不影响与路由器的连接,不影响正常的通信。It should be noted that the handshake frame is a data frame for carrying data indication information, and can carry different data information according to actual conditions. Listening and searching for connected devices on the channel connected to the router does not affect the connection with the router and does not affect normal communication.
在一个示例性实施例中,上述系统还包括:路由器,用于为已连网设备和未连网设备提供网络。In an exemplary embodiment, the system further includes: a router, configured to provide a network for networked devices and non-networked devices.
在一个示例性实施例中,上述未连网设备,还用于确定第一握手帧携带的认证信息,其中,所述认证信息中包括:表示握手帧次数的序列号、标识当前握手帧唯一性的第一随机数值、已连网设备与路由器连接的工作信道、已连网设备对应的网络标识;在所述认证信息中的所述已连网设备对应的网络标识与所述未连网设备中存储的网络标识一致的情况下,根据预设网络密钥结合所述第一随机数值确定用于加密待同步的连接信息的第一密钥,其中,所述连接信息包括以下至少之一:路由器服务集标识的信息,路由器密码的信息;将所述认证信息和所述第一密钥进行数据打包,并添加消息的完整性校验标识以及第二随机数值,以确定向所述已连网设备发送包含预设网络密钥的第二握手帧。In an exemplary embodiment, the above-mentioned non-networked device is also used to determine the authentication information carried by the first handshake frame, wherein the authentication information includes: a serial number indicating the number of handshake frames, a first random value identifying the uniqueness of the current handshake frame, a working channel connecting the networked device and the router, and a network identifier corresponding to the networked device; when the network identifier corresponding to the networked device in the authentication information is consistent with the network identifier stored in the non-networked device, a first key for encrypting the connection information to be synchronized is determined based on a preset network key combined with the first random value, wherein the connection information includes at least one of the following: information on the router service set identifier, information on the router password; the authentication information and the first key are data packaged, and a message integrity check identifier and a second random value are added to determine that a second handshake frame containing a preset network key is sent to the networked device.
也就是说,当未连接设备搜索到已连接设备后,已连接设备会在校验通过后,向未连接设备发送携带认证信息的用于指示后续连接认证同步的第一握手帧,进而通过第一握手帧对未连接设备的信道轮询操作进行停止,并固定信道,已确定后续的交互信道,进一步的,未连接设备基于接收到的第一握手帧,根据自身对应的预设网络密钥,以及确定出的用于指示待发送第二握手帧唯一性的第二随机数值,并增加用于验证数据包的发送者(即未连接设备)的消息的完整性校验标识,进而确定出用于握手交互的第二握手帧。That is to say, when an unconnected device searches for a connected device, the connected device will, after verification, send a first handshake frame carrying authentication information to the unconnected device to indicate subsequent connection authentication synchronization, and then stop the channel polling operation of the unconnected device through the first handshake frame, and fix the channel to determine the subsequent interaction channel. Furthermore, the unconnected device, based on the received first handshake frame, according to its own corresponding preset network key, and the second random value determined to indicate the uniqueness of the second handshake frame to be sent, adds a message integrity check identifier for verifying the sender of the data packet (i.e., the unconnected device), and then determines the second handshake frame used for handshake interaction.
在一个示例性实施例中,上述未连网设备,还用于在所述认证信息中还包括有用于指示当前所述第一握手帧对应交互流程次数的序列号的情况下,确定已接收的多个第一握手帧对应的多个目标序列号与所述序列号是否存在匹配;在所述多个目标序列号与所述序列号不存在匹配的情况下,确定当前所述第一握手帧不为重复的第一握手帧;在所述多个目标序列号与所述序列号存在匹配的情况下,确定当前所述第一握手帧为重复的第一握手帧,所述第一握手帧对应的握手流程结束。In an exemplary embodiment, the above-mentioned non-networked device is also used to determine whether there is a match between multiple target sequence numbers corresponding to multiple received first handshake frames and the sequence number when the authentication information also includes a sequence number indicating the number of interaction processes corresponding to the current first handshake frame; when there is no match between the multiple target sequence numbers and the sequence number, determine that the current first handshake frame is not a repeated first handshake frame; when there is a match between the multiple target sequence numbers and the sequence number, determine that the current first handshake frame is a repeated first handshake frame, and the handshake process corresponding to the first handshake frame ends.
简而言之,未连网设备与已连网设备的进行交互中的第一握手帧通过序列号进行本次交互流程的标识,当序列号相同证明对应的交互流程被重复执行,不相同则证明当前第一握手帧对应的交互流程未出现重复交互过程。In short, the first handshake frame in the interaction between an unconnected device and a connected device uses a serial number to identify the interaction process. If the serial numbers are the same, it proves that the corresponding interaction process is repeated. If they are different, it proves that there is no repeated interaction process in the interaction process corresponding to the current first handshake frame.
在一个示例性实施例中,上述未连网设备,还用于确定未连网设备待轮询的信道列表,其中,所述信道列表用于指示所述未连网设备通信的信道以及所述信道的数量;根据所述信道列表确定向所述目标区域进行广播的时间周期;在所述时间周期内获取到信道验证成功的指示信息的情况下,停止向所述目标区域进行广播,其中,所述信道验证成功用于指示信道接收到已联网设备发送的交互信息,所述交互信息包括第一握手帧。In an exemplary embodiment, the above-mentioned non-networked device is also used to determine a channel list to be polled by the non-networked device, wherein the channel list is used to indicate the channels for communication of the non-networked device and the number of channels; determine the time period for broadcasting to the target area according to the channel list; and stop broadcasting to the target area if indication information of successful channel verification is obtained within the time period, wherein the successful channel verification is used to indicate that the channel has received interaction information sent by a networked device, and the interaction information includes a first handshake frame.
例如,目标对象更改了SSID名称或者密码后,信道可能与原来的不同,并且由于路由器以及家电设备通常使用2.4G频段进行无线交互,因此未连网设备需要在13个信道上进行轮询,以发现已入网设备。初始从信道1开始,后续从轮询停止的下一个信道开始。每个信道上停留3秒钟,发送5帧,间隔512毫秒。当未连接设备第一次收到校验通过的握手帧,停止信道轮询,固定在握手step1帧中携带的信道,并对信道中传输过来的数据进行解析,进而确定出握手帧对应的内容。For example, after the target object changes the SSID name or password, the channel may be different from the original one, and because routers and home appliances usually use the 2.4G frequency band for wireless interaction, unconnected devices need to poll on 13 channels to discover connected devices. Initially start from channel 1, and then start from the next channel where polling stops. Stay on each channel for 3 seconds, send 5 frames, and the interval is 512 milliseconds. When the unconnected device receives the handshake frame that passes the verification for the first time, it stops channel polling, fixes the channel carried in the handshake step1 frame, and parses the data transmitted in the channel to determine the content corresponding to the handshake frame.
在一个示例性实施例中,上述未连网设备,还用于确定预设的过滤名单,其中,所述过滤名单用于指示已连网设备当前使用的连接信息无法被同步使用;在存在于所述过滤名单的已入网设备发送所述第一握手帧的情况下,禁止执行生成第二握手帧的操作。In an exemplary embodiment, the above-mentioned non-networked device is also used to determine a preset filter list, wherein the filter list is used to indicate that the connection information currently used by the networked device cannot be used synchronously; when the networked device present in the filter list sends the first handshake frame, the operation of generating the second handshake frame is prohibited.
例如,如果已入网设备在过滤名单,则忽略该已入网设备。与所有已入网设备的通信均失败后继续信道轮询。对于多个已入网设备,可以根据收到握手帧的先后顺序进行选择,并且已加入过滤名单的已入网设备的连接信息将无法同步到未连接设备上,在接收到已加入过滤名单的已入网设备发送的用于交互的第一握手帧之后,禁止未连接设备在验证成功的情况下生成对应的第二握手帧,并结束未连接设备与已加入过滤名单的已入网设备的交互流程。For example, if a connected device is in the filter list, the connected device is ignored. After all communications with all connected devices fail, channel polling continues. For multiple connected devices, selection can be made based on the order in which the handshake frames are received, and the connection information of the connected devices that have been added to the filter list will not be synchronized to the unconnected devices. After receiving the first handshake frame for interaction sent by the connected device that has been added to the filter list, the unconnected device is prohibited from generating the corresponding second handshake frame if the verification is successful, and the interaction process between the unconnected device and the connected device that has been added to the filter list is terminated.
在一个示例性实施例中,上述未连网设备,还用于在所述已连网设备存在多个且每一个所述已连网设备都反馈第一握手帧的情况下,根据每一个所述已连网设备反馈第一握手帧的时间点确定时序列表;根据所述时序列表的先后顺序进行所述第一握手帧是否符合预设条件的选择验证。In an exemplary embodiment, the above-mentioned non-networked device is also used to determine a timing sequence list according to the time point when each of the networked devices feeds back the first handshake frame when there are multiple networked devices and each of the networked devices feeds back the first handshake frame; and select and verify whether the first handshake frame meets preset conditions according to the sequence of the timing sequence list.
例如,未连网设备可能会收到多个已入网设备的第一握手帧。根据系统资源的情况,可以维护一到多个已入网设备的通信,但与每个已入网设备通信最多尝试3次,因此,需要根据第一握手帧对应的反馈时间点,确定选择认证的次序。For example, a non-networked device may receive the first handshake frames of multiple networked devices. Depending on the system resources, communication with one or more networked devices can be maintained, but communication with each networked device can be attempted at most three times. Therefore, the order of selecting authentication needs to be determined based on the feedback time point corresponding to the first handshake frame.
在一个示例性实施例中,上述已连网设备,还用于在所述未连网设备中存储的网络标识与自身网络标识相同的情况下,确定所述未连网设备存在与目标区域,且所述未连网设备被允许执行单播交互;根据所述单播交互对应的预设条件确定待携带的认证信息,以确定对应的第一握手帧,其中,所述认证信息中包括:标识当前握手帧唯一性的第一随机数值、已连网设备与路由器连接的工作信道、当前所述第一握手帧对应交互流程次数的序列号。In an exemplary embodiment, the above-mentioned networked device is also used to determine that the non-networked device exists in the target area and that the non-networked device is allowed to perform unicast interaction when the network identifier stored in the non-networked device is the same as its own network identifier; determine the authentication information to be carried according to the preset conditions corresponding to the unicast interaction to determine the corresponding first handshake frame, wherein the authentication information includes: a first random value identifying the uniqueness of the current handshake frame, the working channel connecting the networked device to the router, and the serial number of the number of interaction processes corresponding to the current first handshake frame.
在本发明的描述中,需要理解的是,术语中“中心”、“上”、“下”、“前”、“后”、“左”、“右”等指示的方位或位置关系为基于附图所示的方位或位置关系,仅是为了便于描述本发明和简化描述,而不是指示或暗示所指的装置或组件必须具有特定的方位、以特定的方位构造和操作,因此不能理解为对本发明的限制。此外,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性。In the description of the present invention, it should be understood that the orientations or positional relationships indicated by the terms "center", "upper", "lower", "front", "back", "left", "right", etc. are based on the orientations or positional relationships shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or component referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance.
在本发明的描述中,需要说明的是,除非另有明确的规定和限定,术语“安装”、“连接”、“相连”应做广义理解,例如,可以是固定连接,也可以是拆卸连接,或一体地连接;可以是机械连接,也可以是电连接;可以是直接相连,也可以是通过中间媒介间接相连,可以是两个组件内部的连通。当组件被称为“固定于”或“设置于”另一个元件,它可以直接在另一个组件上或者也可以存在居中的组件。当一个组件被认为是“连接”另一个元件,它可以是直接连接到另一个元件或者可能同时存在居中元件。对于本领域的普通技术人员而言,可以具体情况理解上述术语在本发明的具体含义。In the description of the present invention, it should be noted that, unless otherwise clearly specified and limited, the terms "installed", "connected" and "connected" should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be an indirect connection through an intermediate medium, or it can be a connection between the two components. When a component is referred to as being "fixed to" or "disposed on" another element, it can be directly on the other component or there can also be a central component. When a component is considered to be "connected" to another element, it can be directly connected to the other element or there can be a central element at the same time. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
需要说明的是,上述各个模块是可以通过软件或硬件来实现的,对于后者,可以通过以下方式实现,但不限于此:上述模块均位于同一处理器中;或者,上述各个模块以任意组合的形式分别位于不同的处理器中。It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.
本发明的实施例还提供了一种存储介质,该存储介质中存储有计算机程序,其中,该计算机程序被设置为运行时执行上述任一项方法实施例中的步骤。An embodiment of the present invention further provides a storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.
在一个示例性实施例中,在本实施例中,上述存储介质可以被设置为存储用于执行以下步骤的计算机程序:In an exemplary embodiment, in this embodiment, the above storage medium may be configured to store a computer program for performing the following steps:
S1,在目标区域存在已连网设备的情况下,向所述目标区域广播包含未连网设备中存储的网络标识的数据信息,其中,所述已连网设备用于指示目标对象更换连接信息后重新连网的设备;S1, in the case where there is a networked device in the target area, broadcasting data information including a network identifier stored in the unconnected device to the target area, wherein the networked device is used to indicate a device to reconnect to the network after the target object changes its connection information;
S2,接收所述已连网设备根据所述数据信息反馈的用于单播交互的第一握手帧;S2, receiving a first handshake frame for unicast interaction fed back by the connected device according to the data information;
S3,在所述第一握手帧符合预设条件的情况下,向所述已连网设备发送包含预设网络密钥的第二握手帧,以获取所述已连网设备根据所述第二握手帧确定的目标连接信息,其中,所述目标连接信息用于指示已加密的所述已连网设备的当前连接信息。S3. When the first handshake frame meets the preset conditions, a second handshake frame containing a preset network key is sent to the connected device to obtain target connection information determined by the connected device according to the second handshake frame, wherein the target connection information is used to indicate the encrypted current connection information of the connected device.
在一个示例性实施例中,在本实施例中,上述存储介质可以包括但不限于:U盘、只读存储器(Read-Only Memory,简称为ROM)、随机存取存储器(Random Access Memory,简称为RAM)、移动硬盘、磁碟或者光盘等各种可以存储计算机程序的介质。In an exemplary embodiment, in this embodiment, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store computer programs.
本发明的实施例还提供了一种电子装置,包括存储器和处理器,该存储器中存储有计算机程序,该处理器被设置为运行计算机程序以执行上述任一项方法实施例中的步骤。An embodiment of the present invention further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
在一个示例性实施例中,上述电子装置还可以包括传输设备以及输入输出设备,其中,该传输设备和上述处理器连接,该输入输出设备和上述处理器连接。In an exemplary embodiment, the electronic device may further include a transmission device and an input/output device, wherein the transmission device is connected to the processor, and the input/output device is connected to the processor.
在一个示例性实施例中,在本实施例中,上述处理器可以被设置为通过计算机程序执行以下步骤:In an exemplary embodiment, in this embodiment, the processor may be configured to perform the following steps through a computer program:
S1,在目标区域存在已连网设备的情况下,向所述目标区域广播包含未连网设备中存储的网络标识的数据信息,其中,所述已连网设备用于指示目标对象更换连接信息后重新连网的设备;S1, in the case where there is a networked device in the target area, broadcasting data information including a network identifier stored in the unconnected device to the target area, wherein the networked device is used to indicate a device to reconnect to the network after the target object changes its connection information;
S2,接收所述已连网设备根据所述数据信息反馈的用于单播交互的第一握手帧;S2, receiving a first handshake frame for unicast interaction fed back by the connected device according to the data information;
S3,在所述第一握手帧符合预设条件的情况下,向所述已连网设备发送包含预设网络密钥的第二握手帧,以获取所述已连网设备根据所述第二握手帧确定的目标连接信息,其中,所述目标连接信息用于指示已加密的所述已连网设备的当前连接信息。S3. When the first handshake frame meets the preset conditions, a second handshake frame containing a preset network key is sent to the connected device to obtain target connection information determined by the connected device according to the second handshake frame, wherein the target connection information is used to indicate the encrypted current connection information of the connected device.
在一个示例性实施例中,本实施例中的具体示例可以参考上述实施例及可选实施方式中所描述的示例,本实施例在此不再赘述。In an exemplary embodiment, the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.
显然,本领域的技术人员应该明白,上述的本发明的各模块或各步骤可以用通用的计算装置来实现,它们可以集中在单个的计算装置上,或者分布在多个计算装置所组成的网络上,在一个示例性实施例中,它们可以用计算装置可执行的程序代码来实现,从而,可以将它们存储在存储装置中由计算装置来执行,并且在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤,或者将它们分别制作成各个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。这样,本发明不限制于任何特定的硬件和软件结合。Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices. In an exemplary embodiment, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order than here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. In this way, the present invention is not limited to any specific combination of hardware and software.
以上所述仅为本发明的优选实施例而已,并不用于限制本发明,对于本领域的技术人员来说,本发明可以有各种更改和变化。凡在本发明的原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principle of the present invention shall be included in the protection scope of the present invention.
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202110867178.6ACN113613251B (en) | 2021-07-29 | 2021-07-29 | Information synchronization method and system, storage medium and electronic device |
| PCT/CN2022/096410WO2023005410A1 (en) | 2021-07-29 | 2022-05-31 | Information synchronization method and system, storage medium, and electronic device |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202110867178.6ACN113613251B (en) | 2021-07-29 | 2021-07-29 | Information synchronization method and system, storage medium and electronic device |
| Publication Number | Publication Date |
|---|---|
| CN113613251A CN113613251A (en) | 2021-11-05 |
| CN113613251Btrue CN113613251B (en) | 2024-05-24 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202110867178.6AActiveCN113613251B (en) | 2021-07-29 | 2021-07-29 | Information synchronization method and system, storage medium and electronic device |
| Country | Link |
|---|---|
| CN (1) | CN113613251B (en) |
| WO (1) | WO2023005410A1 (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN113613251B (en)* | 2021-07-29 | 2024-05-24 | 青岛海尔科技有限公司 | Information synchronization method and system, storage medium and electronic device |
| CN114339591B (en)* | 2021-12-09 | 2024-03-08 | 青岛海信移动通信技术有限公司 | Method and related device for positioning based on ultra-wideband chip |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109451502A (en)* | 2018-12-27 | 2019-03-08 | 广东美的厨房电器制造有限公司 | Household appliance matches network method, network distribution device and computer readable storage medium |
| CN110971495A (en)* | 2019-10-24 | 2020-04-07 | 青岛海尔科技有限公司 | Device binding method, device and storage medium for smart home system |
| CN111741509A (en)* | 2019-03-25 | 2020-10-02 | 珠海格力电器股份有限公司 | Network distribution method and device, storage medium and processor |
| CN111757356A (en)* | 2020-06-23 | 2020-10-09 | 四川虹美智能科技有限公司 | Equipment distribution network system and distribution network method thereof |
| CN112187831A (en)* | 2020-10-30 | 2021-01-05 | 腾讯科技(深圳)有限公司 | Equipment network access method and device, storage medium and electronic equipment |
| CN112202652A (en)* | 2020-09-17 | 2021-01-08 | 海尔优家智能科技(北京)有限公司 | Method and device for displaying information of equipment to be networked, storage medium and electronic device |
| CN112566220A (en)* | 2020-11-25 | 2021-03-26 | 中移(杭州)信息技术有限公司 | Distribution network information synchronization method and device and computer equipment |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US9843929B2 (en)* | 2015-08-21 | 2017-12-12 | Afero, Inc. | Apparatus and method for sharing WiFi security data in an internet of things (IoT) system |
| CN106211264B (en)* | 2016-07-11 | 2018-07-31 | 九阳股份有限公司 | A kind of household electrical appliances distribution method and device |
| CN112929908B (en)* | 2021-03-17 | 2023-03-24 | 北京小米移动软件有限公司 | Mesh networking method and device, gateway equipment and storage medium |
| CN113613251B (en)* | 2021-07-29 | 2024-05-24 | 青岛海尔科技有限公司 | Information synchronization method and system, storage medium and electronic device |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109451502A (en)* | 2018-12-27 | 2019-03-08 | 广东美的厨房电器制造有限公司 | Household appliance matches network method, network distribution device and computer readable storage medium |
| CN111741509A (en)* | 2019-03-25 | 2020-10-02 | 珠海格力电器股份有限公司 | Network distribution method and device, storage medium and processor |
| CN110971495A (en)* | 2019-10-24 | 2020-04-07 | 青岛海尔科技有限公司 | Device binding method, device and storage medium for smart home system |
| CN111757356A (en)* | 2020-06-23 | 2020-10-09 | 四川虹美智能科技有限公司 | Equipment distribution network system and distribution network method thereof |
| CN112202652A (en)* | 2020-09-17 | 2021-01-08 | 海尔优家智能科技(北京)有限公司 | Method and device for displaying information of equipment to be networked, storage medium and electronic device |
| CN112187831A (en)* | 2020-10-30 | 2021-01-05 | 腾讯科技(深圳)有限公司 | Equipment network access method and device, storage medium and electronic equipment |
| CN112566220A (en)* | 2020-11-25 | 2021-03-26 | 中移(杭州)信息技术有限公司 | Distribution network information synchronization method and device and computer equipment |
| Publication number | Publication date |
|---|---|
| WO2023005410A1 (en) | 2023-02-02 |
| CN113613251A (en) | 2021-11-05 |
| Publication | Publication Date | Title |
|---|---|---|
| CN113271579B (en) | Bluetooth device control method, client, computer device and readable storage medium | |
| US11563546B2 (en) | Method and apparatus for MoCA network with protected set-up | |
| CN113423105B (en) | Network connection method and device | |
| CN110708688A (en) | Intelligent equipment network distribution method and device, controller and medium | |
| CN110809308A (en) | A method and device for automatic connection between an IOT device and a WIFI router | |
| EP2834965B1 (en) | Push button configuration for hybrid network devices | |
| CN112997447B (en) | Timestamp-based access processing for wireless devices | |
| CN113965916A (en) | A device network distribution method, device, device, and computer-readable storage medium | |
| CN113613251B (en) | Information synchronization method and system, storage medium and electronic device | |
| CN105744596B (en) | A method and device for accessing a network by a WiFi device | |
| CN113595992B (en) | Secure binding method and system, storage medium and electronic device | |
| CN114143760A (en) | Data transmission method, system, chip, electronic device and storage medium | |
| US20160080889A1 (en) | Provisioning of multiple wireless devices by an access point | |
| CN112165713B (en) | Method, device, system and storage medium for smart device to access wireless network | |
| US20160330775A1 (en) | Methods and Devices for Sending or Receiving Wireless Parameter | |
| CN112040484A (en) | Password updating method and device, storage medium and electronic device | |
| CN113132983A (en) | Intelligent terminal network disconnection reconnection method | |
| CN112637931A (en) | Method and device for establishing network connection | |
| CN112738785A (en) | Device connection method and device, storage medium and electronic device | |
| CN112689316B (en) | Binding method and device of intelligent equipment, storage medium and electronic device | |
| CN108541077B (en) | WPS-based rapid network distribution method and system for intelligent hardware equipment | |
| US20160044009A1 (en) | Method and Apparatus for MoCA Network With Protected Set-Up | |
| EP3515121A1 (en) | Device networking method, apparatus and system | |
| CN112637221A (en) | Equipment control method and device | |
| CN112087745A (en) | Network distribution method and device of household appliance, electronic device and storage medium |
| 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 |