[go: up one dir, main page]

CN106385684A - Method and device for sharing wireless network and accessing wireless network - Google Patents

Method and device for sharing wireless network and accessing wireless network Download PDF

Info

Publication number
CN106385684A
CN106385684A CN201610812193.XA CN201610812193A CN106385684A CN 106385684 A CN106385684 A CN 106385684A CN 201610812193 A CN201610812193 A CN 201610812193A CN 106385684 A CN106385684 A CN 106385684A
Authority
CN
China
Prior art keywords
wireless network
access
name
access code
key
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.)
Granted
Application number
CN201610812193.XA
Other languages
Chinese (zh)
Other versions
CN106385684B (en
Inventor
王俊
刘春华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Samsung Electronics China R&D Center
Samsung Electronics Co Ltd
Original Assignee
Samsung Electronics China R&D Center
Samsung Electronics Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Samsung Electronics China R&D Center, Samsung Electronics Co Ltd filed Critical Samsung Electronics China R&D Center
Priority to CN201610812193.XA priority Critical patent/CN106385684B/en
Publication of CN106385684A publication Critical patent/CN106385684A/en
Application granted granted Critical
Publication of CN106385684B publication Critical patent/CN106385684B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/08Access security
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W48/00Access restriction; Network selection; Access point selection
    • H04W48/18Selecting a network or a communication service

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Small-Scale Networks (AREA)

Abstract

本申请公开了用于共享无线网络、接入无线网络的方法和装置。所述方法的一具体实施方式包括:获取待共享无线网络的名称及接入验证信息;对所述接入验证信息进行加密,得到密文字符串;基于所述名称、所述密文字符串,得到所述待共享无线网络的接入码;将所述接入码发送给待接入终端,以向所述待接入终端共享所述待共享无线网络。该实施方式避免了终端在接入无线网络时,需要用户输入验证信息的繁琐步骤,实现快速便捷的接入无线网络。

The application discloses a method and a device for sharing a wireless network and accessing a wireless network. A specific implementation of the method includes: obtaining the name and access verification information of the wireless network to be shared; encrypting the access verification information to obtain a ciphertext string; based on the name, the ciphertext string , obtaining an access code of the wireless network to be shared; sending the access code to a terminal to be accessed, so as to share the wireless network to be shared with the terminal to be accessed. This embodiment avoids the cumbersome steps of requiring the user to input verification information when the terminal accesses the wireless network, and realizes fast and convenient access to the wireless network.

Description

用于共享无线网络、接入无线网络的方法和装置Method and device for sharing wireless network and accessing wireless network

技术领域technical field

本申请涉及互联网技术领域,具体涉及无线网络技术领域,尤其涉及一种用于共享无线网络、接入无线网络的方法和装置。The present application relates to the field of Internet technology, specifically to the field of wireless network technology, and in particular to a method and device for sharing a wireless network and accessing a wireless network.

背景技术Background technique

无线网络能够覆盖有线网络难以涉及的范围,同时能够满足移动通信漫游访问的需求。目前很多行业都将无线网络作为首选的互联网连接方式,并且随着智能设备的不断普及,接入无线网络的智能设备也不断增多,如何使各种智能设备快速地接入无线网络成为当前面临的一项重要问题。The wireless network can cover areas that are difficult to be covered by the wired network, and at the same time, it can meet the requirements of mobile communication roaming access. At present, many industries use wireless networks as the preferred Internet connection method, and with the continuous popularization of smart devices, the number of smart devices connected to wireless networks is also increasing. How to quickly connect various smart devices to wireless networks has become the current challenge an important question.

目前,智能设备在接入无线网络时,通常情况下,首先需要查找无线网络信号,然后输入适配的密码,等待接入网络,耗费时间较长。At present, when a smart device accesses a wireless network, usually, it first needs to search for a wireless network signal, then enter an adapted password, and wait for access to the network, which takes a long time.

发明内容Contents of the invention

本申请的目的在于提出一种用于共享无线网络、接入无线网络的方法和装置,来解决以上背景技术部分提到的技术问题。The purpose of the present application is to propose a method and device for sharing a wireless network and accessing a wireless network, so as to solve the technical problems mentioned in the background technology section above.

第一方面,本申请提供了一种用于共享无线网络的方法,所述方法包括:获取待共享无线网络的名称及接入验证信息;对所述接入验证信息进行加密,得到密文字符串;基于所述名称、所述密文字符串,得到所述待共享无线网络的接入码;将所述接入码发送给待接入终端,以向所述待接入终端共享所述待共享无线网络。In a first aspect, the present application provides a method for sharing a wireless network, the method comprising: obtaining the name of the wireless network to be shared and access verification information; encrypting the access verification information to obtain ciphertext characters string; based on the name and the ciphertext string, obtain the access code of the wireless network to be shared; send the access code to the terminal to be accessed, so as to share the wireless network with the terminal to be accessed Wireless network to be shared.

在一些实施例中,所述对所述名称及所述接入验证信息进行加密,得到密文字符串,包括:采用预设的加密类型,调用密钥生成函数以生成密钥;调用加密函数以采用所述密钥对所述接入验证信息进行加密,得到密文字符串。In some embodiments, the encrypting the name and the access verification information to obtain a ciphertext string includes: using a preset encryption type, calling a key generation function to generate a key; calling an encryption function Encrypt the access verification information by using the key to obtain a ciphertext string.

在一些实施例中,所述基于所述名称、所述密文字符串,得到所述待共享无线网络的接入码,包括:将所述密钥、所述名称以及所述密文字符串以预设的排列顺序排列,得到所述接入码。In some embodiments, the obtaining the access code of the wireless network to be shared based on the name and the ciphertext string includes: combining the key, the name, and the ciphertext string Arrange in a preset order to obtain the access code.

在一些实施例中,所述基于所述名称、所述密文字符串,得到所述待共享无线网络的接入码,包括:在所述密钥前添加预设的密钥标识,得到添加标识的密钥;在所述密文字符串前添加预设的密文字符串标识,得到添加标识的密文字符串;在所述待共享无线网络的名称前添加预设的名称标识,得到添加标识的名称;组合所述添加标识的密钥、所述添加标识的密文字符串、所述添加标识的名称,得到接入码主体;在所述接入码主体前添加预设的校验标识,在所述接入码主体后添加预设的结束标识,得到所述接入码。In some embodiments, the obtaining the access code of the wireless network to be shared based on the name and the ciphertext string includes: adding a preset key identifier before the key to obtain the added An identified key; adding a preset ciphertext string identifier before the ciphertext string to obtain the ciphertext string with the identifier added; adding a preset name identifier before the name of the wireless network to be shared to obtain Add the name of the identification; combine the key of the added identification, the ciphertext string of the added identification, and the name of the added identification to obtain the main body of the access code; add a preset checksum before the main body of the access code The verification identifier is added, and a preset end identifier is added after the main body of the access code to obtain the access code.

在一些实施例中,所述将所述接入码发送给待接入终端,包括:通过以下至少一种数据传输方式将所述接入码发送给所述待接入终端:近场通信、红外、蓝牙。In some embodiments, the sending the access code to the terminal to be accessed includes: sending the access code to the terminal to be accessed by at least one of the following data transmission methods: near field communication, Infrared, Bluetooth.

在一些实施例中,所述方法还包括:显示发送所述接入码的发送状态,所述发送状态包括:发送成功、发送失败或发送中。In some embodiments, the method further includes: displaying a sending status of sending the access code, and the sending status includes: sending successfully, sending failed, or sending.

第二方面,本申请提供了一种用于接入无线网络的方法,所述方法包括:获取待接入无线网络的接入码,所述接入码是基于所述待接入无线网络的名称、加密所述待接入无线网络的接入验证信息后得到的密文字符串得到的;解析所述接入码,得到所述名称及所述密文字符串;解密所述密文字符串,得到所述接入验证信息;基于所述名称及所述接入验证信息,接入所述待接入无线网络。In a second aspect, the present application provides a method for accessing a wireless network, the method including: acquiring an access code of the wireless network to be accessed, the access code is based on the wireless network to be accessed Name, obtained by encrypting the ciphertext string obtained after encrypting the access verification information of the wireless network to be accessed; parsing the access code to obtain the name and the ciphertext string; decrypting the ciphertext character obtain the access verification information; based on the name and the access verification information, access the wireless network to be accessed.

在一些实施例中,所述接入码还包括加密所述接入验证信息所采用的密钥;以及所述解析所述接入码,得到所述名称及所述密文字符串,包括:依次读取所述接入码,基于预设的排列顺序,确定所述名称、所述密文字符串及所述密钥。In some embodiments, the access code further includes a key used to encrypt the access verification information; and the parsing the access code to obtain the name and the ciphertext string includes: The access codes are read sequentially, and the name, the ciphertext string and the key are determined based on a preset sequence.

在一些实施例中,所述解析所述接入码,得到所述名称及所述密文字符串,还包括:响应于所述接入码包括校验标识、结束标识,检测所述接入码是否包括密钥标识、密文字符串标识、名称标识;响应于所述接入码包括所述密钥标识、所述密文字符串标识、所述名称标识,提取所述密钥标识指示的字符串作为所述密钥,提取所述密文字符串标识指示的字符串作为所述密文字符串,提取所述名称标识指示的字符串作为所述待接入无线网络的名称。In some embodiments, the parsing the access code to obtain the name and the ciphertext string further includes: in response to the access code including a verification identifier and an end identifier, detecting the access Whether the code includes a key identifier, a ciphertext string identifier, and a name identifier; in response to the access code including the key identifier, the ciphertext string identifier, and the name identifier, extract the key identifier indication The character string indicated by the ciphertext string is used as the key, the character string indicated by the ciphertext string identifier is extracted as the ciphertext string, and the character string indicated by the name identifier is extracted as the name of the wireless network to be accessed.

在一些实施例中,所述解密所述密文字符串,得到所述接入验证信息,包括:采用预设的解密类型,调用解密函数以采用所述密钥对所述密文字符串进行解密,得到所述接入验证信息。In some embodiments, the decrypting the ciphertext string to obtain the access verification information includes: using a preset decryption type, calling a decryption function to use the key to process the ciphertext string Decrypt to obtain the access verification information.

在一些实施例中,在所述基于所述名称及所述验证信息,接入所述待接入无线网络之前,所述方法还包括:检测接入无线网络的开关的状态;响应于检测到所述接入无线网络的开关的状态为关闭,开启所述接入无线网络的开关;响应于检测到所述接入无线网络的开关的状态为开启,检测当前是否接入无线网络;响应于当前已接入无线网络,显示无线网络切换询问消息;响应于接收到用户发送的确认切换无线网络消息,断开对已接入的无线网络的连接。In some embodiments, before accessing the wireless network to be accessed based on the name and the verification information, the method further includes: detecting the status of a switch for accessing the wireless network; in response to detecting The state of the switch for accessing the wireless network is off, and the switch for accessing the wireless network is turned on; in response to detecting that the state of the switch for accessing the wireless network is on, detecting whether it is currently connected to the wireless network; in response to The wireless network is currently connected, and a wireless network switching query message is displayed; in response to receiving a confirmation message for switching the wireless network sent by the user, the connection to the connected wireless network is disconnected.

在一些实施例中,所述方法还包括:显示接入所述待接入无线网络的接入状态,所述接入状态包括:接入成功、接入失败或接入中。In some embodiments, the method further includes: displaying an access status of the wireless network to be accessed, where the access status includes: access successful, access failure, or access.

第三方面,本申请提供了一种用于共享无线网络的装置,所述装置包括:第一获取单元,用于获取待共享无线网络的名称及接入验证信息;加密单元,用于对所述接入验证信息进行加密,得到密文字符串;确定单元,用于基于所述名称、所述密文字符串,得到所述待共享无线网络的接入码;发送单元,用于将所述接入码发送给待接入终端,以向所述待接入终端共享所述待共享无线网络。In a third aspect, the present application provides a device for sharing a wireless network, the device comprising: a first acquiring unit, configured to acquire the name and access verification information of the wireless network to be shared; an encryption unit, configured to The access verification information is encrypted to obtain a ciphertext string; the determination unit is used to obtain the access code of the wireless network to be shared based on the name and the ciphertext string; the sending unit is used to transfer the ciphertext string The access code is sent to the terminal to be accessed, so as to share the wireless network to be shared with the terminal to be accessed.

在一些实施例中,所述加密单元包括:生成模块,用于采用预设的加密类型,调用密钥生成函数以生成密钥;加密模块,用于调用加密函数以采用所述密钥对所述接入验证信息进行加密,得到密文字符串。In some embodiments, the encryption unit includes: a generation module, configured to use a preset encryption type, and call a key generation function to generate a key; an encryption module, used to call an encryption function to use the key to pair the Encrypt the above access verification information to obtain a ciphertext string.

在一些实施例中,所述确定单元进一步用于:将所述密钥、所述名称以及所述密文字符串以预设的排列顺序排列,得到所述接入码。In some embodiments, the determining unit is further configured to: arrange the key, the name, and the ciphertext string in a preset sequence to obtain the access code.

在一些实施例中,所述确定单元进一步用于:在所述密钥前添加预设的密钥标识,得到添加标识的密钥;在所述密文字符串前添加预设的密文字符串标识,得到添加标识的密文字符串;在所述待共享无线网络的名称前添加预设的名称标识,得到添加标识的名称;组合所述添加标识的密钥、所述添加标识的密文字符串、所述添加标识的名称,得到接入码主体;在所述接入码主体前添加预设的校验标识,在所述接入码主体后添加预设的结束标识,得到所述接入码。In some embodiments, the determining unit is further configured to: add a preset key identifier before the key to obtain a key with the identifier; add preset ciphertext characters before the ciphertext string string identifier to obtain the ciphertext string of the added identifier; add a preset name identifier before the name of the wireless network to be shared to obtain the name of the added identifier; combine the key of the added identifier and the encryption key of the added identifier text string, the name of the added logo to obtain the main body of the access code; add a preset verification logo before the main body of the access code, and add a preset end logo after the main body of the access code to get the main body of the access code access code.

在一些实施例中,所述发送单元进一步用于:通过以下至少一种数据传输方式将所述接入码发送给所述待接入终端:近场通信、红外、蓝牙。In some embodiments, the sending unit is further configured to: send the access code to the terminal to be accessed through at least one of the following data transmission methods: near field communication, infrared, and Bluetooth.

在一些实施例中,所述装置还包括:第一显示单元,用于显示发送所述接入码的发送状态,所述发送状态包括:发送成功、发送失败或发送中。In some embodiments, the device further includes: a first display unit, configured to display a sending status of sending the access code, and the sending status includes: sending successfully, sending failed, or sending.

第四方面,本申请提供了一种用于接入无线网络的装置,所述装置包括:第二获取单元,用于获取待接入无线网络的接入码,所述接入码是基于所述待接入无线网络的名称、加密所述待接入无线网络的接入验证信息后得到的密文字符串得到的;解析单元,用于解析所述接入码,得到所述名称及所述密文字符串;解密单元,用于解密所述密文字符串,得到所述接入验证信息;接入单元,用于基于所述名称及所述接入验证信息,接入所述待接入无线网络。In a fourth aspect, the present application provides a device for accessing a wireless network, the device comprising: a second acquiring unit, configured to acquire an access code for accessing the wireless network, the access code is based on the The name of the wireless network to be accessed and the ciphertext string obtained after encrypting the access verification information of the wireless network to be accessed; the parsing unit is used to parse the access code to obtain the name and the The ciphertext string; the decryption unit is used to decrypt the ciphertext string to obtain the access verification information; the access unit is used to access the pending ciphertext based on the name and the access verification information. Connect to a wireless network.

在一些实施例中,所述接入码还包括加密所述接入验证信息所采用的密钥;以及所述解析单元进一步用于:依次读取所述接入码,基于预设的排列顺序,确定所述名称、所述密文字符串及所述密钥。In some embodiments, the access code further includes a key used to encrypt the access verification information; and the parsing unit is further configured to: sequentially read the access code, based on a preset sequence , determine the name, the ciphertext string, and the key.

在一些实施例中,所述解析单元进一步用于:响应于所述接入码包括校验标识、结束标识,检测所述接入码是否包括密钥标识、密文字符串标识、名称标识;响应于所述接入码包括所述密钥标识、所述密文字符串标识、所述名称标识,提取所述密钥标识指示的字符串作为所述密钥,提取所述密文字符串标识指示的字符串作为所述密文字符串,提取所述名称标识指示的字符串作为所述待接入无线网络的名称。In some embodiments, the parsing unit is further configured to: detect whether the access code includes a key identifier, a ciphertext string identifier, and a name identifier in response to the access code including a verification identifier and an end identifier; In response to the access code including the key identifier, the ciphertext string identifier, and the name identifier, extracting the character string indicated by the key identifier as the key, and extracting the ciphertext string The character string indicated by the identification is used as the ciphertext character string, and the character string indicated by the name identification is extracted as the name of the wireless network to be accessed.

在一些实施例中,所述解密单元进一步用于:采用预设的解密类型,调用解密函数以采用所述密钥对所述密文字符串进行解密,得到所述接入验证信息。In some embodiments, the decryption unit is further configured to: use a preset decryption type, call a decryption function to decrypt the ciphertext string with the key, and obtain the access verification information.

在一些实施例中,所述装置还包括:检测单元,用于在所述接入单元基于所述名称及所述验证信息,接入所述待接入无线网络之前,检测接入无线网络的开关的状态;响应于检测到所述接入无线网络的开关的状态为关闭,开启所述接入无线网络的开关;响应于检测到所述接入无线网络的开关的状态为开启,检测当前是否接入无线网络;响应于当前已接入无线网络,显示无线网络切换询问消息;响应于接收到用户发送的确认切换无线网络消息,断开对已接入的无线网络的连接。In some embodiments, the device further includes: a detecting unit, configured to detect the identity of the accessing wireless network before the accessing unit accesses the wireless network to be accessed based on the name and the verification information The state of the switch; in response to detecting that the state of the switch for accessing the wireless network is off, turn on the switch for accessing the wireless network; in response to detecting that the state of the switch for accessing the wireless network is on, detect the current Whether to access the wireless network; in response to the current access to the wireless network, displaying a wireless network switching inquiry message; in response to receiving a confirmation message for switching the wireless network sent by the user, disconnecting the connected wireless network.

在一些实施例中,所述装置还包括:第二显示单元,用于显示接入所述待接入无线网络的接入状态,所述接入状态包括:接入成功、接入失败或接入中。In some embodiments, the device further includes: a second display unit, configured to display the access status of the wireless network to be accessed, and the access status includes: access success, access failure, or access into the middle.

本申请提供的共享无线网络、接入无线网络的方法和装置,通过将待共享无线网络的接入验证信息进行加密,结合上述待共享无线网络的名称,生成待共享无线网络的接入码,然后将上述接入码共享给待接入终端。待接入终端在获取到待接入无线网络的接入码后,对上述接入码进行解析,得到加密后的接入验证信息和名称,解密得到接入验证信息,最后基于待接入无线网络的名称和接入验证信息,接入上述待接入无线网络,从而避免了终端在接入无线网络时,需要用户输入验证信息的繁琐步骤,实现快速便捷的接入无线网络。The method and device for sharing a wireless network and accessing a wireless network provided by the present application, by encrypting the access verification information of the wireless network to be shared, and combining the name of the wireless network to be shared, an access code of the wireless network to be shared is generated, Then share the access code with the terminal to be accessed. After obtaining the access code of the wireless network to be accessed, the terminal to be accessed parses the above access code to obtain the encrypted access verification information and name, decrypts the access verification information, and finally bases on the access code of the wireless network to be accessed. The name of the network and the access verification information are connected to the above-mentioned wireless network to be connected, thereby avoiding the cumbersome steps of requiring the user to input verification information when the terminal accesses the wireless network, and realizing fast and convenient access to the wireless network.

附图说明Description of drawings

通过阅读参照以下附图所作的对非限制性实施例所作的详细描述,本申请的其它特征、目的和优点将会变得更明显:Other characteristics, objects and advantages of the present application will become more apparent by reading the detailed description of non-limiting embodiments made with reference to the following drawings:

图1是本申请可以应用于其中的示例性系统架构图;FIG. 1 is an exemplary system architecture diagram to which the present application can be applied;

图2是根据本申请的用于共享无线网络的方法的一个实施例的流程图;FIG. 2 is a flowchart of an embodiment of a method for sharing a wireless network according to the present application;

图3是根据本申请的用于共享无线网络的方法的一个应用场景的示意图;FIG. 3 is a schematic diagram of an application scenario of a method for sharing a wireless network according to the present application;

图4是根据本申请的用于接入无线网络的方法的又一个实施例的流程图;FIG. 4 is a flowchart of another embodiment of a method for accessing a wireless network according to the present application;

图5是根据本申请的用于共享无线网络的装置的一个实施例的结构示意图;FIG. 5 is a schematic structural diagram of an embodiment of a device for sharing a wireless network according to the present application;

图6根据本申请的用于接入无线网络的装置的一个实施例的结构示意图;FIG. 6 is a schematic structural diagram of an embodiment of a device for accessing a wireless network according to the present application;

图7是适于用来实现本申请实施例的终端设备的计算机系统的结构示意图。Fig. 7 is a schematic structural diagram of a computer system suitable for implementing a terminal device according to an embodiment of the present application.

具体实施方式detailed description

下面结合附图和实施例对本申请作进一步的详细说明。可以理解的是,此处所描述的具体实施例仅仅用于解释相关发明,而非对该发明的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与有关发明相关的部分。The application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain related inventions, rather than to limit the invention. It should also be noted that, for the convenience of description, only the parts related to the related invention are shown in the drawings.

需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。下面将参考附图并结合实施例来详细说明本申请。It should be noted that, in the case of no conflict, the embodiments in the present application and the features in the embodiments can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and embodiments.

图1示出了可以应用本申请的用于共享无线网络的方法、用于共享无线网络的装置、用于接入无线网络的方法或用于接入无线网络的装置的实施例的示例性系统架构100。FIG. 1 shows an exemplary system to which embodiments of the method for sharing a wireless network, the device for sharing a wireless network, the method for accessing a wireless network, or the device for accessing a wireless network of the present application can be applied. Architecture100.

如图1所示,系统架构100可以包括终端设备101、102和待接入终端设备103、104,且终端设备101、102和待接入终端设备103、104之间通过无线通信方式进行交互,以接收或发送消息等。As shown in Figure 1, the system architecture 100 may include terminal devices 101, 102 and terminal devices 103, 104 to be accessed, and the terminal devices 101, 102 and the terminal devices 103, 104 to be accessed interact through wireless communication, to receive or send messages, etc.

终端设备101、102以及待接入终端设备103、104可以是具有显示屏并且支持接入无线网络的各种电子设备,包括但不限于智能手机、平板电脑、电子书阅读器、MP3播放器(Moving Picture Experts Group Audio Layer III,动态影像专家压缩标准音频层面3)、MP4(Moving Picture Experts Group Audio Layer IV,动态影像专家压缩标准音频层面4)播放器、膝上型便携计算机和台式计算机等等。The terminal devices 101, 102 and the terminal devices 103, 104 to be connected may be various electronic devices with display screens and supporting wireless network access, including but not limited to smart phones, tablet computers, e-book readers, MP3 players ( Moving Picture Experts Group Audio Layer III, moving picture experts compression standard audio layer 3), MP4 (Moving Picture Experts Group Audio Layer IV, moving picture experts compression standard audio layer 4) player, laptop portable computer and desktop computer, etc. .

需要说明的是,本申请实施例所提供的用于共享无线网络的方法一般由终端设备101、102执行,相应地,用于共享无线网络的装置一般设置于终端设备101、102中;本申请实施例所提供的用于接入无线网络的方法一般由待接入终端设备103、104执行,相应地,用于接入无线网络的装置一般设置于待接入终端设备103、104中。It should be noted that the method for sharing the wireless network provided by the embodiment of the present application is generally executed by the terminal equipment 101, 102, and correspondingly, the device for sharing the wireless network is generally set in the terminal equipment 101, 102; The method for accessing the wireless network provided by the embodiment is generally executed by the terminal devices 103 and 104 to be accessed, and correspondingly, the apparatus for accessing the wireless network is generally set in the terminal devices 103 and 104 to be accessed.

应该理解,图1中的终端设备和待接入终端设备的数目仅仅是示意性的。根据实现需要,可以具有任意数目的终端设备和待接入终端设备。It should be understood that the number of terminal devices and terminal devices to be accessed in FIG. 1 is only illustrative. According to implementation requirements, there may be any number of terminal devices and terminal devices to be accessed.

继续参考图2,示出了根据本申请的用于共享无线网络的方法的一个实施例的流程200。本实施例的用于共享无线网络的方法,包括以下步骤:Continuing to refer to FIG. 2 , a flow 200 of an embodiment of a method for sharing a wireless network according to the present application is shown. The method for sharing a wireless network in this embodiment includes the following steps:

步骤201,获取待共享无线网络的名称及接入验证信息。Step 201, acquire the name and access verification information of the wireless network to be shared.

在本实施例中,用于共享无线网络的方法运行于其上的电子设备(例如图1所示的终端设备)可以通过各种方式获取待共享无线网络的名称及接入验证信息,例如从上述终端设备中预先存储的文件中获取,或通过有线或无线连接方式从其它设备处获取等。上述待共享无线网络的名称即无线网络的SSID(Service Set Identifier,服务集标识),用于标识待共享无线网络,其可以是用户自定义的无线网络,也可以是在配置无线网络时自动生成的。上述接入验证信息用于在接入待共享无线网络时进行验证的信息,其可以是由数字或字母或符号组成的字符串或其它可实施的形式。In this embodiment, the electronic device on which the method for sharing a wireless network runs (such as the terminal device shown in FIG. 1 ) can obtain the name and access verification information of the wireless network to be shared in various ways, for example, from It can be obtained from the pre-stored files in the above-mentioned terminal device, or obtained from other devices through a wired or wireless connection. The name of the wireless network to be shared is the SSID (Service Set Identifier) of the wireless network, which is used to identify the wireless network to be shared. It can be a user-defined wireless network, or it can be automatically generated when configuring the wireless network of. The above access verification information is used for verification when accessing the wireless network to be shared, and it may be a string of numbers or letters or symbols or other practicable forms.

在本实施例的一些可选的实现方式中,终端设备在获取到上述待共享无线网络的名称和接入验证信息后,可以尝试接入上述待共享无线网络,以验证上述接入验证信息是否正确。In some optional implementations of this embodiment, after obtaining the name of the wireless network to be shared and the access verification information, the terminal device may try to access the wireless network to be shared to verify whether the access verification information is correct.

步骤202,对接入验证信息进行加密,得到密文字符串。Step 202, encrypting the access verification information to obtain a ciphertext string.

本实施例中,可以采用各种加密算法对上述接入验证信息进行加密,例如对称加密算法、非对称加密算法等。在对接入验证信息进行加密后,对应的,可得到密文字符串。In this embodiment, various encryption algorithms may be used to encrypt the above-mentioned access verification information, such as symmetric encryption algorithms, asymmetric encryption algorithms, and the like. After the access verification information is encrypted, correspondingly, a ciphertext string can be obtained.

在本实施例的一些可选的实现方式中,上述步骤202可以通过图2中未示出的以下子步骤来实现:采用预设的加密类型,调用密钥生成函数以生成密钥;调用加密函数以采用所生成的密钥对接入验证信息进行加密,得到密文字符串。In some optional implementations of this embodiment, the above step 202 can be implemented through the following sub-steps not shown in FIG. 2: using a preset encryption type, calling a key generation function to generate a key; calling an encryption The function uses the generated key to encrypt the access authentication information to obtain a ciphertext string.

本实现方式中,可以采用对称加密算法对接入验证信息进行加密,在加密过程中,首先调用密钥生成函数来生成密钥,再调用加密函数利用所生成的秘钥进行加密,得到密文字符串。In this implementation, a symmetric encryption algorithm can be used to encrypt the access verification information. During the encryption process, the key generation function is first called to generate a key, and then the encryption function is called to encrypt with the generated key to obtain the ciphertext string.

步骤203,基于上述名称、密文字符串,得到待共享无线网络的接入码。Step 203: Obtain an access code of the wireless network to be shared based on the above name and ciphertext string.

本实施例中,可以对待共享无线网络的名称和密文字符串进行组合或添加,得到待共享无线网络的接入码。上述接入码可以是由固定格式的数据帧,例如,上述接入码可以具有固定长度,组成接入码的各部分具有固定的排列顺序等。In this embodiment, the name of the wireless network to be shared and the ciphertext string may be combined or added to obtain the access code of the wireless network to be shared. The above-mentioned access code may be a data frame with a fixed format, for example, the above-mentioned access code may have a fixed length, and each part constituting the access code may have a fixed sequence, etc.

在本实施例的一些可选的实现方式中,上述步骤203可以通过图2中未示出的以下子步骤来实现:将密钥、名称以及密文字符串以预设的排列顺序排列,得到接入码。In some optional implementations of this embodiment, the above-mentioned step 203 can be realized by the following sub-steps not shown in FIG. access code.

本实现方式中,可以预先设定接入码中各部分的排列顺序,例如按照名称在前,密钥第二、密文字符串第三的方式来排列。这样,待接入终端在获取到上述接入码后,可以依次读取,从而确定接入码中的各部分。In this implementation, the arrangement order of each part in the access code can be preset, for example, the name is arranged first, the key is second, and the ciphertext string is arranged third. In this way, after acquiring the access code, the terminal to be accessed can read it in sequence, so as to determine each part of the access code.

在本实施例的一些可选的实现方式中,在确定接入码时,还可以在得到密钥、名称以及密文字符串后确定各部分的数据长度或预先设定各部分的数据组成长度。在确定各部分的数据长度后,可以将各长度值一起加入接入码中,从而使待接入终端设备在接收到接入码后可以迅速地确定密钥、名称及密文字符串的大小及位置。在预先设定各部分的数据组成长度时,待接入终端设备在接收到接入码后依次读取,结合预设的排列顺序,确定各部分的数据。In some optional implementations of this embodiment, when determining the access code, it is also possible to determine the data length of each part or preset the data composition length of each part after obtaining the key, name and ciphertext string . After determining the data length of each part, each length value can be added to the access code together, so that the terminal device to be accessed can quickly determine the size of the key, name and ciphertext string after receiving the access code and location. When the data composition length of each part is preset, the terminal device to be accessed reads in sequence after receiving the access code, and determines the data of each part in combination with the preset arrangement order.

在本实施例的一些可选的实现方式中,上述步骤203还可以通过图2中未示出的以下子步骤来实现:In some optional implementations of this embodiment, the above step 203 may also be implemented by the following sub-steps not shown in FIG. 2:

在密钥前添加预设的密钥标识,得到添加标识的密钥;在密文字符串前添加预设的密文字符串标识,得到添加标识的密文字符串;在待共享无线网络的名称前添加预设的名称标识,得到添加标识的名称;组合添加标识的密钥、添加标识的密文字符串、添加标识的名称,得到接入码主体;在接入码主体前添加预设的校验标识,在接入码主体后添加预设的结束标识,得到接入码。Add the preset key identifier before the key to obtain the key with the identifier; add the preset ciphertext string identifier before the ciphertext string to obtain the ciphertext string with the identifier; in the wireless network to be shared Add the preset name logo before the name to get the name of the logo; combine the key of the logo, the ciphertext string of the logo, and the name of the logo to get the main body of the access code; add the preset before the main body of the access code The verification identifier of the access code, add the preset end identifier after the main body of the access code to obtain the access code.

本实现方式中,还可以通过在密钥、密文字符串、待共享无线网络的名称前分别添加预设的密钥标识、预设的密文字符串标识以及预设的名称标识,然后将密钥与上述密钥标识进行绑定、将密文字符串与上述密文字符串标识进行绑定、将名称与名称标识进行绑定,将绑定后的三个部分进行组合,并将组合后的数据作为接入码主体;还可以在接入码主体前添加预设的校验标识,以使待接入终端在获取到接入码后,首先根据校验标识,确定接收到的数据为待共享无线网络的接入码;还可以在接入码主体后添加预设的结束标识,以使待接入终端在确定接收到的数据为接入码后,根据结束标识,确定接入码是否完整,避免因数据传输链路断开或其它原因造成的数据传输中断,从而接收到不完整的接入码,从而不能接入待共享无线网络。In this implementation, it is also possible to add a preset key identifier, a preset ciphertext string identifier, and a preset name identifier before the key, the ciphertext string, and the name of the wireless network to be shared, and then add Bind the key with the above key identifier, bind the ciphertext string with the above ciphertext string identifier, bind the name with the name identifier, combine the bound three parts, and combine The data after the access code is used as the main body of the access code; a preset check mark can also be added before the main body of the access code, so that after the terminal to be accessed obtains the access code, it first determines the received data according to the check mark It is the access code of the wireless network to be shared; a preset end identifier can also be added after the main body of the access code, so that the terminal to be accessed can determine the access code according to the end identifier after determining that the received data is the access code Whether the access code is complete, to avoid interruption of data transmission due to disconnection of the data transmission link or other reasons, so as to receive an incomplete access code and thus fail to access the wireless network to be shared.

示例性的,可设置加密类型为AES(Advanced Encryption Standard,高级加密标准),调用密钥生成函数,生成对称密钥K;采用硬编码将校验标识设定为M,将待共享无线网络的SSID约定为S,将结束标识设置为E;调用加密函数,使用密钥K对待共享无线网络的密码N进行加密,生成密文字符串N1;那么接入码的文件由M+K+S+N1+E组成。Exemplarily, the encryption type can be set to AES (Advanced Encryption Standard, Advanced Encryption Standard), and the key generation function can be called to generate a symmetric key K; the verification flag can be set to M by hard coding, and the wireless network to be shared The SSID is agreed to be S, and the end flag is set to E; call the encryption function, use the key K to encrypt the password N of the wireless network to be shared, and generate a ciphertext string N1; then the file of the access code is composed of M+K+S+ Composed of N1+E.

步骤204,将接入码发送给待接入终端,以向待接入终端共享待共享无线网络。Step 204, sending the access code to the terminal to be accessed, so as to share the wireless network to be shared with the terminal to be accessed.

本实施例中,执行用于共享无线网络的方法的终端设备可以通过各种通信方式将得到的接入码发送给待接入终端,实现向待接入终端共享无线网络。In this embodiment, the terminal device executing the method for sharing the wireless network may send the obtained access code to the terminal to be accessed through various communication methods, so as to share the wireless network with the terminal to be accessed.

在本实施例的一些可选的实现方式中,终端可以通过近场通信或红外或蓝牙的方式将上述接入码发送给待接入终端。In some optional implementation manners of this embodiment, the terminal may send the above access code to the terminal to be accessed through near field communication, infrared or bluetooth.

当终端设备与待接入终端设备都具有近场通信功能时,两者可通过近场通信来传输上述接入码。可以理解的是,还可以通过其它数据传输方式来传输上述接入码,如红外、蓝牙、射频识别技术或其它可实施的方式。When both the terminal device and the terminal device to be accessed have a near-field communication function, the two can transmit the access code through near-field communication. It can be understood that the above access code can also be transmitted through other data transmission methods, such as infrared, bluetooth, radio frequency identification technology or other practicable methods.

通过上述数据传输方式,能够有效保护无线网络登录信息在传输过程中的安全性和快速性,避免了在数据传输过程中被监听和篡改;并且由于不需要用户手动查找无线信号和输入密码,在缩短了接入无线网络的时间的同时,用户可将无线网络设置为隐藏,降低了无线网络被恶意攻击者查找的可能性。The above data transmission method can effectively protect the security and rapidity of wireless network login information during transmission, avoiding monitoring and tampering during data transmission; and since users do not need to manually search for wireless signals and enter passwords, While shortening the time to access the wireless network, users can set the wireless network to be hidden, reducing the possibility of the wireless network being found by malicious attackers.

在本实施例的一些可选的实现方式中,上述方法还包括图2中未示出的以下步骤:显示发送接入码的发送状态。In some optional implementations of this embodiment, the above method further includes the following step not shown in FIG. 2: displaying the sending status of the sending access code.

本实现方式中,上述发送状态包括:发送成功、发送失败或发送中。终端设备在向待接入终端设备发送接入码时,可以在接入码的发送过程中,在自身的显示屏上显示发送状态。In this implementation manner, the sending status includes: sending successfully, sending failed, or sending. When the terminal device sends the access code to the terminal device to be accessed, it can display the sending status on its own display screen during the sending process of the access code.

继续参见图3,图3是根据本实施例的用于共享无线网络的方法的应用场景的一个示意图。在图3的应用场景中,用户通过智能手机31选择打开NFC(near fieldcommunication,近场通信)功能,并选择一个无线网络作为待共享无线网络。其中,每个无线网络都包括名称及接入密码(在智能手机31的屏幕上只显示无线网络的名称)。在选择待分享的无线网络后,智能手机31自动生成选择的无线网络的接入码。然后将智能手机31与想要接入无线网络的智能手机32近场通信,其中,智能手机32也打开了NFC功能,将接入码发送给智能手机32。在发送完成后,智能手机31会显示发送成功界面。Continue to refer to FIG. 3 , which is a schematic diagram of an application scenario of the method for sharing a wireless network according to this embodiment. In the application scenario of FIG. 3 , the user chooses to enable the NFC (near field communication, near field communication) function through the smart phone 31, and selects a wireless network as the wireless network to be shared. Wherein, each wireless network includes a name and an access password (only the name of the wireless network is displayed on the screen of the smart phone 31). After selecting the wireless network to be shared, the smart phone 31 automatically generates an access code for the selected wireless network. Then the smart phone 31 communicates with the smart phone 32 that wants to access the wireless network in near field, wherein the smart phone 32 also turns on the NFC function, and sends the access code to the smart phone 32 . After the sending is completed, the smart phone 31 will display a sending success interface.

图3所示的应用场景可以应用于家庭无线网络的分享,在有访客到访时,访客可以利用智能手机或平板电脑或其它的电子设备与主人的电子设备间进行数据传输,就可以快速的接入家庭无线网络。The application scenario shown in Figure 3 can be applied to home wireless network sharing. When a visitor visits, the visitor can use a smartphone or tablet computer or other electronic device to transmit data with the owner's electronic device, and the user can quickly Connect to your home wireless network.

当然本实施例的用于共享无线网络的方法还可以应用于智能家居、家居医疗及公共场所。例如,用户可通过便携式终端设备与智能家居中的各个设备进行交互,以使各个设备快速接入家庭无线网络构成的小型物联网中;在公共场所(酒店、餐厅、大型会议中心),可以将无线网络的名称以及密码加密后设置成电子芯片、二维码或其它装置,用户通过利用智能设备扫描或接触就可以介入无线网络。Of course, the method for sharing a wireless network in this embodiment can also be applied to smart homes, home medical care, and public places. For example, users can interact with various devices in the smart home through portable terminal devices, so that each device can be quickly connected to the small Internet of Things formed by the home wireless network; in public places (hotels, restaurants, large conference centers), the The name and password of the wireless network are encrypted and set into electronic chips, two-dimensional codes or other devices, and users can access the wireless network by scanning or touching with smart devices.

本申请的上述实施例提供的用于共享无线网络的方法通过将待共享无线网络的接入验证信息进行加密,结合上述待共享无线网络的名称,生成待共享无线网络的接入码,然后将上述接入码共享给待接入终端。避免了终端在接入无线网络时,需要用户输入验证信息的繁琐步骤,实现快速便捷的接入无线网络。The method for sharing a wireless network provided by the above-mentioned embodiments of the present application encrypts the access verification information of the wireless network to be shared, combines the name of the wireless network to be shared, generates an access code of the wireless network to be shared, and then The above access code is shared with terminals to be accessed. When the terminal accesses the wireless network, the cumbersome steps of requiring the user to input verification information are avoided, and fast and convenient access to the wireless network is realized.

图4示出了根据本申请的用于接入无线网络的方法的又一个实施例的流程图400。本实施例的用于接入无线网络的方法包括以下步骤:Fig. 4 shows a flow chart 400 of still another embodiment of the method for accessing a wireless network according to the present application. The method for accessing a wireless network in this embodiment includes the following steps:

步骤401,获取待接入无线网络的接入码。Step 401, acquiring an access code of a wireless network to be accessed.

本实施例中,执行用于接入无线网络的方法的电子装置(如图1中的待接入终端设备),可以通过各种方式获取待接入无线网络的接入码,例如通过近场通信方式从分享上述待接入无线网络的终端处获取。上述接入码是基于待接入无线网络的名称及加密待接入无线网络的接入验证信息后得到的密文字符串得到的。In this embodiment, the electronic device executing the method for accessing the wireless network (such as the terminal device to be accessed in Figure 1) can obtain the access code of the wireless network to be accessed in various ways, for example, through the near field The communication method is obtained from the terminals that share the aforementioned wireless network to be accessed. The above access code is obtained based on the name of the wireless network to be accessed and the ciphertext string obtained after encrypting the access verification information of the wireless network to be accessed.

步骤402,解析接入码,得到所述名称及所述密文字符串。Step 402, analyze the access code to obtain the name and the ciphertext string.

待接入终端设备在获取到上述接入码后,首先对上述接入码进行解析,得到其名称及与接入验证信息对应的密文字符串。After obtaining the above-mentioned access code, the terminal device to be connected first parses the above-mentioned access code to obtain its name and the ciphertext string corresponding to the access verification information.

在本实施例的一些可选的实现方式中,上述接入码还包括加密上述接入验证信息所采用的密钥。上述步骤402具体可以通过图4中未示出的以下步骤实现对接入码的解析:依次读取接入码,基于预设的排列顺序,确定名称、密文字符串及密钥。In some optional implementation manners of this embodiment, the access code further includes a key used to encrypt the access verification information. The above step 402 can specifically implement the analysis of the access code through the following steps not shown in FIG. 4: read the access code in sequence, and determine the name, ciphertext string and key based on the preset arrangement order.

本实现方式中,接入码中的各部分可以是按照预设的排列顺序进行排列的,待接入终端在接收到上述接入码后,依次读取接入码中的数据,结合上述预设的排列顺序,可以确定待接入无线网络的名称、密文字符串及密钥。In this implementation, each part of the access code can be arranged according to a preset order, and the terminal to be accessed reads the data in the access code sequentially after receiving the above access code, and combines the above preset The arrangement order of the settings can determine the name, cipher text string and key of the wireless network to be accessed.

在本实施例的一些可选的实现方式中,上述步骤402中在对接入码的解析时,还可以首先检测上述接入码中是否包括校验标识和结束标识。其中,上述校验标识用于表示文件属性,待接入终端设备在接收到数据后,检测是否包括校验标识,当存在时,确定接收到的数据为待接入无线网络的接入码。上述结束标识用于表示接入码是否完整,当存在时,表示待接入终端接收到的接入码是完整的。In some optional implementation manners of this embodiment, when parsing the access code in the above step 402, it may first be detected whether the above access code includes a verification identifier and an end identifier. Wherein, the verification mark is used to represent the file attribute, and the terminal device to be accessed detects whether the verification mark is included after receiving the data, and if it exists, determines that the received data is an access code to be connected to the wireless network. The above end identifier is used to indicate whether the access code is complete, and if it exists, it indicates that the access code received by the terminal to be accessed is complete.

在确定接收到的接入码包括上述两个标识后,进一步检测上述接入码中是否包括密钥标识、密文字符串标识及名称标识。其中,密钥标识与密钥绑定,密文字符串标识与密文字符串绑定,名称标识与待接入无线网络的名称绑定。待接入终端设备在读取接入码时,通过读取密钥标识、密文字符串标识及名称标识可以快速的确定接入码中的哪一部分属于密钥、密文字符串及名称。After it is determined that the received access code includes the above two identifiers, it is further detected whether the above access code includes the key identifier, the ciphertext string identifier and the name identifier. Wherein, the key identifier is bound with the key, the ciphertext string identifier is bound with the ciphertext string, and the name identifier is bound with the name of the wireless network to be accessed. When the terminal device to be accessed reads the access code, it can quickly determine which part of the access code belongs to the key, the ciphertext string and the name by reading the key identifier, the ciphertext string identifier and the name identifier.

当上述三个标识都存在时,提取密钥标识指示的字符串作为密钥,提取密文字符串标识指示的字符串作为密文字符串,提取名称标识指示的字符串作为待接入无线网络的名称。When all the above three identifiers exist, extract the string indicated by the key identifier as the key, extract the string indicated by the ciphertext string identifier as the ciphertext string, and extract the character string indicated by the name identifier as the wireless network to be accessed The name.

步骤403,解密密文字符串,得到接入验证信息。Step 403, decrypt the ciphertext string to obtain access verification information.

待接入终端在解析得到待接入无线网络的名称、加密所采用的密钥及接入验证信息对应的密文字符串后,对上述密文字符串进行解密,即可得到明文的接入验证信息。After analyzing and obtaining the name of the wireless network to be accessed, the key used for encryption, and the ciphertext string corresponding to the access verification information, the terminal to be accessed decrypts the above ciphertext string to obtain the plaintext access verify message.

在本实施例的一些可选的实现方式中,在解密密文字符串时,采用预设的解密类型,调用解密函数以采用密钥对所述密文字符串进行解密,得到所述接入验证信息。In some optional implementations of this embodiment, when decrypting a ciphertext string, a preset decryption type is used, and a decryption function is called to decrypt the ciphertext string using a key to obtain the access verify message.

可以理解的是,上述解密类型应与加密时采用的加密类型相对应。例如加密时,采用AES加密类型,在解密时也应采用AES解密类型。It can be understood that the above decryption type should correspond to the encryption type used during encryption. For example, when encrypting, use the AES encryption type, and also use the AES decryption type when decrypting.

步骤404,基于名称及接入验证信息,接入待接入无线网络。Step 404, based on the name and access verification information, access the wireless network to be accessed.

根据得到的待接入无线网络的名称和接入验证信息,待接入终端可以快速的接入待接入无线网络。According to the obtained name and access verification information of the wireless network to be accessed, the terminal to be accessed can quickly access the wireless network to be accessed.

在本实施例的一些可选的实现方式中,待终端设备在接入无线网络之前,还可以首先检测接入无线网络的开关的状态,当检测到接入无线网络的开关的状态为关闭时,自动开启接入无线网络的开关。当检测到接入无线网络的开关的状态为开启时,则检测当前是否接入无线网络。当检测到当前已接入无线网络时,在待接入终端上显示无线网络切换询问消息。用户在对上述无线网络切换进行确认后,待接入终端断开对已接入的无线网络的连接,自动接入待接入无线网络。In some optional implementations of this embodiment, before the terminal device accesses the wireless network, it may first detect the status of the switch for accessing the wireless network, and when it is detected that the status of the switch for accessing the wireless network is off , to automatically turn on the switch to access the wireless network. When it is detected that the state of the switch for accessing the wireless network is turned on, it is detected whether the switch is currently connected to the wireless network. When it is detected that the wireless network is currently connected, a wireless network switching inquiry message is displayed on the terminal to be connected. After the user confirms the above wireless network switching, the terminal to be accessed disconnects the connected wireless network, and automatically accesses the wireless network to be accessed.

这种情况尤其适用于在当前已经接入无线网络且待接入终端正在进行网络数据交换时或接入的无线网络为付费网络或不安全网络时,实现接入的无线网络快速的切换。This situation is especially applicable to fast switching of the wireless network to be accessed when the wireless network is currently connected and the terminal to be connected is exchanging network data, or the wireless network to be connected is a paid network or an insecure network.

在本实施例的一些可选的实现方式中,待终端设备上还可以显示接入待接入无线网络的接入状态,如接入成功、接入失败或接入中。In some optional implementation manners of this embodiment, the access status of accessing the wireless network to be accessed may also be displayed on the waiting terminal device, such as accessing successfully, accessing failed, or accessing.

本申请的上述实施例提供的用于接入无线网络的方法,待接入终端在获取到待接入无线网络的接入码后,对上述接入码进行解析,得到加密后的接入验证信息和名称,解密得到接入验证信息,最后基于待接入无线网络的名称和接入验证信息,接入上述待接入无线网络,从而避免了终端在接入无线网络时,需要用户输入验证信息的繁琐步骤,实现快速便捷的接入无线网络。In the method for accessing the wireless network provided by the above-mentioned embodiments of the present application, after the terminal to be accessed obtains the access code of the wireless network to be accessed, it analyzes the above-mentioned access code to obtain the encrypted access verification information and name, decrypt the access verification information, and finally access the wireless network to be accessed based on the name and access verification information of the wireless network to be accessed, thereby avoiding the need for the user to input verification when the terminal accesses the wireless network The cumbersome steps of information, to achieve fast and convenient access to the wireless network.

进一步参考图5,作为对上述图2所示方法的实现,本申请提供了一种用于共享无线网络的装置的一个实施例,该装置实施例与图2所示的方法实施例相对应,该装置具体可以应用于各种电子设备中。Further referring to FIG. 5 , as an implementation of the method shown in FIG. 2 above, the present application provides an embodiment of a device for sharing a wireless network. The device embodiment corresponds to the method embodiment shown in FIG. 2 , The device can be specifically applied to various electronic devices.

如图5所示,本实施例所述的用于共享无线网络的装置500包括:第一获取单元501、加密单元502、确定单元503及发送单元504。As shown in FIG. 5 , the device 500 for sharing a wireless network described in this embodiment includes: a first acquiring unit 501 , an encrypting unit 502 , a determining unit 503 and a sending unit 504 .

其中,第一获取单元501,用于获取待共享无线网络的名称及接入验证信息。Wherein, the first obtaining unit 501 is configured to obtain the name and access verification information of the wireless network to be shared.

加密单元502,用于对第一获取单元501获取的接入验证信息进行加密,得到密文字符串。The encryption unit 502 is configured to encrypt the access verification information obtained by the first obtaining unit 501 to obtain a ciphertext string.

在本实施例的一些可选的实现方式中,加密单元502还可以进一步包括图5中未示出的生成模块和加密模块。In some optional implementation manners of this embodiment, the encryption unit 502 may further include a generation module and an encryption module not shown in FIG. 5 .

其中,生成模块,用于采用预设的加密类型,调用密钥生成函数以生成密钥。Wherein, the generation module is used to adopt a preset encryption type and call a key generation function to generate a key.

加密模块,用于调用加密函数以采用生成模块生成的密钥对接入验证信息进行加密,得到密文字符串。The encryption module is used to call the encryption function to encrypt the access verification information with the key generated by the generation module to obtain a ciphertext string.

确定单元503,用于基于第一获取单元501获取的名称、加密单元502得到的密文字符串,得到待共享无线网络的接入码。The determining unit 503 is configured to obtain an access code of the wireless network to be shared based on the name obtained by the first obtaining unit 501 and the ciphertext string obtained by the encrypting unit 502 .

在本实施例的一些可选的实现方式中,确定单元503可以进一步用于:将生成模块生成的密钥、第一获取单元501获取的名称以及加密模块得到的密文字符串以预设的排列顺序排列,得到接入码。In some optional implementations of this embodiment, the determining unit 503 may be further configured to: use the key generated by the generating module, the name obtained by the first obtaining unit 501, and the ciphertext string obtained by the encryption module in a preset Arrange them in order to get the access code.

在本实施例的一些可选的实现方式中,确定单元503可以进一步用于:In some optional implementation manners of this embodiment, the determining unit 503 may be further configured to:

在生成模块生成的密钥前添加预设的密钥标识,得到添加标识的密钥;在加密模块得到的密文字符串前添加预设的密文字符串标识,得到添加标识的密文字符串;在第一获取单元501获取的待共享无线网络的名称前添加预设的名称标识,得到添加标识的名称;组合添加标识的密钥、添加标识的密文字符串、添加标识的名称,得到接入码主体;在接入码主体前添加预设的校验标识,在接入码主体后添加预设的结束标识,得到接入码。Add the preset key identifier before the key generated by the generation module to obtain the key with the identifier; add the preset ciphertext string identifier before the ciphertext string obtained by the encryption module to obtain the ciphertext character with the identifier string; add a preset name identifier before the name of the wireless network to be shared obtained by the first obtaining unit 501, to obtain the name of the added identifier; combine the key of the added identifier, the ciphertext string of the added identifier, and the name of the added identifier, Obtain the main body of the access code; add a preset verification mark before the main body of the access code, add a preset end mark after the main body of the access code, and obtain the access code.

发送单元504,用于将确定单元503得到的接入码发送给待接入终端,以向待接入终端共享待共享无线网络。The sending unit 504 is configured to send the access code obtained by the determining unit 503 to the terminal to be accessed, so as to share the wireless network to be shared with the terminal to be accessed.

在本实施例的一些可选的实现方式中,发送单元504可以进一步用于:通过以下至少一种数据传输方式将接入码发送给待接入终端:近场通信、红外、蓝牙、射频识别以及其他数据传输方式。In some optional implementations of this embodiment, the sending unit 504 may be further configured to: send the access code to the terminal to be accessed through at least one of the following data transmission methods: near field communication, infrared, Bluetooth, radio frequency identification and other data transfer methods.

本申请的上述实施例提供的用于共享无线网络的装置,通过加密单元将待共享无线网络的接入验证信息进行加密,确定单元结合第一获取单元获取的待共享无线网络的名称,生成待共享无线网络的接入码,然后发送单元将上述接入码共享给待接入终端。避免了终端在接入无线网络时,需要用户输入验证信息的繁琐步骤,实现快速便捷的接入无线网络。In the device for sharing a wireless network provided by the above embodiments of the present application, the encryption unit encrypts the access verification information of the wireless network to be shared, and the determination unit combines the name of the wireless network to be shared acquired by the first acquisition unit to generate the wireless network to be shared. The access code of the wireless network is shared, and then the sending unit shares the access code with the terminal to be accessed. When the terminal accesses the wireless network, the cumbersome steps of requiring the user to input verification information are avoided, and fast and convenient access to the wireless network is realized.

进一步参考图6,作为对上述图4所示方法的实现,本申请提供了一种用于接入无线网络的装置的一个实施例,该装置实施例与图4所示的方法实施例相对应,该装置具体可以应用于各种电子设备中。Further referring to FIG. 6 , as an implementation of the method shown in FIG. 4 above, the present application provides an embodiment of a device for accessing a wireless network, which corresponds to the method embodiment shown in FIG. 4 , the device can be specifically applied to various electronic devices.

如图6所示,本实施例的用于接入无线网络的装置600包括:第二获取单元601、解析单元602、解密单元603及接入单元604。As shown in FIG. 6 , an apparatus 600 for accessing a wireless network in this embodiment includes: a second acquiring unit 601 , an analyzing unit 602 , a decrypting unit 603 and an accessing unit 604 .

第二获取单元601,用于获取待接入无线网络的接入码。The second acquiring unit 601 is configured to acquire an access code of a wireless network to be accessed.

其中,上述接入码是基于待接入无线网络的名称、加密待接入无线网络的接入验证信息后得到的密文字符串得到的。Wherein, the above-mentioned access code is obtained based on the name of the wireless network to be accessed and a ciphertext string obtained after encrypting the access verification information of the wireless network to be accessed.

解析单元602,用于解析第二获取单元601获取的接入码,得到待接入无线网络的名称及上述密文字符串。The parsing unit 602 is configured to parse the access code obtained by the second obtaining unit 601 to obtain the name of the wireless network to be accessed and the above-mentioned ciphertext string.

在本实施例的一些可选的实现方式中,上述接入码还可以包括加密接入验证信息所采用的密钥。In some optional implementation manners of this embodiment, the above access code may further include a key used to encrypt the access verification information.

上述解析单元602还可以进一步用于:依次读取接入码,基于预设的排列顺序,确定名称、密文字符串及密钥。The parsing unit 602 may be further configured to: read the access codes in sequence, and determine the name, ciphertext string and key based on the preset sequence.

在本实施例的一些可选的实现方式中,上述解析单元602还可以进一步用于:In some optional implementations of this embodiment, the parsing unit 602 may be further used to:

响应于接入码包括校验标识、结束标识,检测接入码是否包括密钥标识、密文字符串标识、名称标识;Responding to the fact that the access code includes a verification identifier and an end identifier, detect whether the access code includes a key identifier, a ciphertext string identifier, and a name identifier;

响应于接入码包括密钥标识、密文字符串标识、名称标识,提取密钥标识指示的字符串作为密钥,提取密文字符串标识指示的字符串作为密文字符串,提取名称标识指示的字符串作为待接入无线网络的名称。In response to the access code including the key identifier, the ciphertext string identifier, and the name identifier, extract the character string indicated by the key identifier as the key, extract the character string indicated by the ciphertext string identifier as the ciphertext string, and extract the name identifier The indicated character string is used as the name of the wireless network to be connected.

解密单元603,用于解密解析单元602得到的密文字符串,得到待接入无线网络的接入验证信息。The decryption unit 603 is configured to decrypt the ciphertext string obtained by the analysis unit 602 to obtain access verification information for accessing the wireless network.

在本实施例的一些可选的实现方式中,上述解密单元可以进一步用于:采用预设的解密类型,调用解密函数以采用密钥对密文字符串进行解密,得到接入验证信息。In some optional implementations of this embodiment, the decryption unit may be further configured to: use a preset decryption type, call a decryption function to decrypt the ciphertext string with a key, and obtain access verification information.

接入单元604,用于基于待接入无线网络的名称及接入验证信息,接入待接入无线网络。The access unit 604 is configured to access the wireless network to be accessed based on the name of the wireless network to be accessed and the access verification information.

在本实施例的一些可选的实现方式中,上述用于接入无线网络的装置600还可以包括图6中未示出的检测单元,上述检测单元用于在接入单元基于待接入无线网络的名称及验证信息,接入待接入无线网络之前,执行以下步骤:In some optional implementations of this embodiment, the above-mentioned apparatus 600 for accessing a wireless network may further include a detection unit not shown in FIG. The name and authentication information of the network, before connecting to the wireless network to be connected, perform the following steps:

检测接入无线网络的开关的状态;响应于检测到接入无线网络的开关的状态为关闭,开启接入无线网络的开关;响应于检测到接入无线网络的开关的状态为开启,检测当前是否接入无线网络;响应于当前已接入无线网络,显示无线网络切换询问消息;响应于接收到用户发送的确认切换无线网络消息,断开对已接入的无线网络的连接。Detect the state of the switch for accessing the wireless network; in response to detecting that the state of the switch for accessing the wireless network is off, turn on the switch for accessing the wireless network; in response to detecting that the state of the switch for accessing the wireless network is on, detect the current Whether to access the wireless network; in response to the current access to the wireless network, displaying a wireless network switching inquiry message; in response to receiving a confirmation message for switching the wireless network sent by the user, disconnecting the connected wireless network.

在本实施例的一些可选的实现方式中,上述用于接入无线网络的装置600还可以包括图6中未示出的第二显示单元,用于显示接入待接入无线网络的接入状态。上述接入状态包括:接入成功、接入失败或接入中。In some optional implementations of this embodiment, the above-mentioned apparatus 600 for accessing a wireless network may further include a second display unit not shown in FIG. into the state. The above-mentioned access status includes: access success, access failure, or access.

本申请的上述实施例提供的用于接入无线网络的装置,在第二获取单元获取到待接入无线网络的接入码后,解析单元对上述接入码进行解析,得到加密后的接入验证信息和名称,解密单元解密得到接入验证信息,最后接入单元基于待接入无线网络的名称和接入验证信息,接入上述待接入无线网络,从而避免了终端在接入无线网络时,需要用户输入验证信息的繁琐步骤,实现快速便捷的接入无线网络。In the device for accessing the wireless network provided by the above-mentioned embodiments of the present application, after the second obtaining unit obtains the access code of the wireless network to be accessed, the analysis unit analyzes the above-mentioned access code to obtain the encrypted access code. Enter the verification information and name, the decryption unit decrypts to obtain the access verification information, and finally the access unit accesses the wireless network to be accessed based on the name of the wireless network to be accessed and the access verification information, thereby preventing the terminal from accessing the wireless network. When connecting to the network, users need to enter the cumbersome steps of verification information to achieve fast and convenient access to the wireless network.

应当理解,用于共享无线网络的装置500中记载的单元501至单元504分别与参考图2中描述的方法中的各个步骤相对应;用于接入无线网络的装置600中记载的单元601至单元604分别与参考图4中描述的方法中的各个步骤相对应。由此,上文针对用于共享无线网络的方法描述的操作和特征同样适用于装置500及其中包含的单元;针对用于接入无线网络的方法描述的操作和特征同样适用于装置600及其中包含的单元,在此不再赘述。装置500或装置600的相应单元可以与终端设备中的单元相互配合以实现本申请实施例的方案。It should be understood that the units 501 to 504 described in the device 500 for sharing a wireless network correspond to the steps in the method described with reference to FIG. 2; the units 601 to 504 described in the device 600 for accessing a wireless network Unit 604 respectively corresponds to each step in the method described with reference to FIG. 4 . Therefore, the operations and features described above for the method for sharing a wireless network are also applicable to the device 500 and the units contained therein; the operations and features described for the method for accessing a wireless network are also applicable to the device 600 and therein The included units will not be repeated here. The corresponding units of the apparatus 500 or the apparatus 600 may cooperate with the units in the terminal device to implement the solution of the embodiment of the present application.

在本申请的上述实施例中,第一获取单元以及第二获取单元仅仅是用于区分两个不同的获取单元;第一显示单元以及第二显示单元仅仅是用于区分两个不同的显示单元。本领域技术人员应当理解,其中的第一或第二并不构成对获取单元、显示单元的特殊限定。In the above embodiments of the present application, the first acquisition unit and the second acquisition unit are only used to distinguish two different acquisition units; the first display unit and the second display unit are only used to distinguish two different display units . Those skilled in the art should understand that the first or second does not constitute a special limitation on the acquisition unit and the display unit.

下面参考图7,其示出了适于用来实现本申请实施例的终端设备的计算机系统700的结构示意图。Referring now to FIG. 7 , it shows a schematic structural diagram of a computer system 700 suitable for implementing a terminal device according to an embodiment of the present application.

如图7所示,计算机系统700包括中央处理单元(CPU)701,其可以根据存储在只读存储器(ROM)702中的程序或者从存储部分708加载到随机访问存储器(RAM)703中的程序而执行各种适当的动作和处理。在RAM 703中,还存储有系统700操作所需的各种程序和数据。CPU 701、ROM 702以及RAM 703通过总线704彼此相连。输入/输出(I/O)接口705也连接至总线704。As shown in FIG. 7 , a computer system 700 includes a central processing unit (CPU) 701 that can operate according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage section 708 into a random-access memory (RAM) 703 Instead, various appropriate actions and processes are performed. In the RAM 703, various programs and data necessary for the operation of the system 700 are also stored. The CPU 701 , ROM 702 , and RAM 703 are connected to each other via a bus 704 . An input/output (I/O) interface 705 is also connected to the bus 704 .

以下部件连接至I/O接口705:包括键盘、鼠标等的输入部分706;包括诸如阴极射线管(CRT)、液晶显示器(LCD)等以及扬声器等的输出部分707;包括硬盘等的存储部分708;以及包括诸如LAN卡、调制解调器等的网络接口卡的通信部分709。通信部分709经由诸如因特网的网络执行通信处理。驱动器710也根据需要连接至I/O接口705。可拆卸介质711,诸如磁盘、光盘、磁光盘、半导体存储器等等,根据需要安装在驱动器710上,以便于从其上读出的计算机程序根据需要被安装入存储部分708。The following components are connected to the I/O interface 705: an input section 706 including a keyboard, a mouse, etc.; an output section 707 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker; a storage section 708 including a hard disk, etc. and a communication section 709 including a network interface card such as a LAN card, a modem, or the like. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I/O interface 705 as needed. A removable medium 711 such as a magnetic disk, optical disk, magneto-optical disk, semiconductor memory, etc. is mounted on the drive 710 as necessary so that a computer program read therefrom is installed into the storage section 708 as necessary.

特别地,根据本公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包括有形地包含在机器可读介质上的计算机程序,所述计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信部分709从网络上被下载和安装,和/或从可拆卸介质711被安装。在该计算机程序被中央处理单元(CPU)701执行时,执行本申请的方法中限定的上述功能。In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product including a computer program tangibly embodied on a machine-readable medium, the computer program including program code for performing the methods shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from a network via communication portion 709 and/or installed from removable media 711 . When the computer program is executed by the central processing unit (CPU) 701, the above-mentioned functions defined in the method of the present application are performed.

附图中的流程图和框图,图示了按照本申请各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,所述模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。The flowchart and block diagrams in the Figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in a flowchart or block diagram may represent a module, program segment, or portion of code that contains one or more logic devices for implementing the specified Executable instructions for a function. It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or they may sometimes be executed in the reverse order, depending upon the functionality involved. It should also be noted that each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations, can be implemented by a dedicated hardware-based system that performs the specified functions or operations , or may be implemented by a combination of dedicated hardware and computer instructions.

描述于本申请实施例中所涉及到的单元可以通过软件的方式实现,也可以通过硬件的方式来实现。所描述的单元也可以设置在处理器中,例如,可以描述为:一种处理器包括第一获取单元、加密单元、确定单元和发送单元;或一种处理器包括第二获取单元、解析单元、解密单元和接入单元。其中,这些单元的名称在某种情况下并不构成对该单元本身的限定,例如,第一获取单元还可以被描述为“获取待共享无线网络的名称及接入验证信息的单元”。The units involved in the embodiments described in the present application may be implemented by means of software or by means of hardware. The described units can also be set in the processor, for example, can be described as: a processor includes a first acquisition unit, an encryption unit, a determination unit and a sending unit; or a processor includes a second acquisition unit, an analysis unit , a decryption unit and an access unit. Wherein, the names of these units do not constitute a limitation on the unit itself under certain circumstances, for example, the first acquiring unit may also be described as "a unit that acquires the name and access verification information of the wireless network to be shared".

作为另一方面,本申请还提供了一种非易失性计算机存储介质,该非易失性计算机存储介质可以是上述实施例中所述装置中所包含的非易失性计算机存储介质;也可以是单独存在,未装配入终端中的非易失性计算机存储介质。上述非易失性计算机存储介质存储有一个或者多个程序,当所述一个或者多个程序被一个设备执行时,使得所述设备:获取待共享无线网络的名称及接入验证信息;对所述接入验证信息进行加密,得到密文字符串;基于所述名称、所述密文字符串,得到所述待共享无线网络的接入码;将所述接入码发送给待接入终端,以向所述待接入终端共享所述待共享无线网络。或获取待接入无线网络的接入码,所述接入码是基于所述待接入无线网络的名称、加密所述待接入无线网络的接入验证信息后得到的密文字符串得到的;解析所述接入码,得到所述名称及所述密文字符串;解密所述密文字符串,得到所述接入验证信息;基于所述名称及所述接入验证信息,接入所述待接入无线网络。As another aspect, the present application also provides a non-volatile computer storage medium, which may be the non-volatile computer storage medium contained in the device described in the above embodiments; It may be a non-volatile computer storage medium that exists independently and is not assembled into the terminal. The above-mentioned non-volatile computer storage medium stores one or more programs, and when the one or more programs are executed by a device, the device: acquires the name and access verification information of the wireless network to be shared; Encrypt the access verification information to obtain a ciphertext string; obtain the access code of the wireless network to be shared based on the name and the ciphertext string; send the access code to the terminal to be accessed , so as to share the wireless network to be shared with the terminal to be accessed. Or acquire an access code of the wireless network to be accessed, where the access code is obtained based on the name of the wireless network to be accessed and a ciphertext string obtained after encrypting the access verification information of the wireless network to be accessed analyzing the access code to obtain the name and the ciphertext string; decrypting the ciphertext string to obtain the access verification information; based on the name and the access verification information, receiving Enter the wireless network to be accessed.

以上描述仅为本申请的较佳实施例以及对所运用技术原理的说明。本领域技术人员应当理解,本申请中所涉及的发明范围,并不限于上述技术特征的特定组合而成的技术方案,同时也应涵盖在不脱离所述发明构思的情况下,由上述技术特征或其等同特征进行任意组合而形成的其它技术方案。例如上述特征与本申请中公开的(但不限于)具有类似功能的技术特征进行互相替换而形成的技术方案。The above description is only a preferred embodiment of the present application and an illustration of the applied technical principle. Those skilled in the art should understand that the scope of the invention involved in this application is not limited to the technical solution formed by the specific combination of the above-mentioned technical features, but should also cover the technical solution formed by the above-mentioned technical features without departing from the inventive concept. Other technical solutions formed by any combination of or equivalent features thereof. For example, a technical solution formed by replacing the above-mentioned features with technical features with similar functions disclosed in this application (but not limited to).

Claims (24)

1.一种用于共享无线网络的方法,其特征在于,所述方法包括:1. A method for sharing a wireless network, characterized in that the method comprises: 获取待共享无线网络的名称及接入验证信息;Obtain the name and access verification information of the wireless network to be shared; 对所述接入验证信息进行加密,得到密文字符串;Encrypting the access verification information to obtain a ciphertext string; 基于所述名称、所述密文字符串,得到所述待共享无线网络的接入码;Obtain an access code of the wireless network to be shared based on the name and the ciphertext string; 将所述接入码发送给待接入终端,以向所述待接入终端共享所述待共享无线网络。Sending the access code to the terminal to be accessed, so as to share the wireless network to be shared with the terminal to be accessed. 2.根据权利要求1所述的方法,其特征在于,所述对所述名称及所述接入验证信息进行加密,得到密文字符串,包括:2. The method according to claim 1, wherein said encrypting said name and said access verification information to obtain a ciphertext string comprises: 采用预设的加密类型,调用密钥生成函数以生成密钥;Using the preset encryption type, call the key generation function to generate the key; 调用加密函数以采用所述密钥对所述接入验证信息进行加密,得到密文字符串。An encryption function is called to encrypt the access verification information with the key to obtain a ciphertext string. 3.根据权利要求2所述的方法,其特征在于,所述基于所述名称、所述密文字符串,得到所述待共享无线网络的接入码,包括:3. The method according to claim 2, wherein the obtaining the access code of the wireless network to be shared based on the name and the ciphertext string comprises: 将所述密钥、所述名称以及所述密文字符串以预设的排列顺序排列,得到所述接入码。Arranging the key, the name, and the ciphertext string in a preset sequence to obtain the access code. 4.根据权利要求2所述的方法,其特征在于,所述基于所述名称、所述密文字符串,得到所述待共享无线网络的接入码,包括:4. The method according to claim 2, wherein the obtaining the access code of the wireless network to be shared based on the name and the ciphertext string comprises: 在所述密钥前添加预设的密钥标识,得到添加标识的密钥;Adding a preset key identifier before the key to obtain a key with the identifier added; 在所述密文字符串前添加预设的密文字符串标识,得到添加标识的密文字符串;Adding a preset ciphertext string identifier before the ciphertext string to obtain a ciphertext string with the identifier added; 在所述待共享无线网络的名称前添加预设的名称标识,得到添加标识的名称;Adding a preset name logo before the name of the wireless network to be shared to obtain a name with the logo added; 组合所述添加标识的密钥、所述添加标识的密文字符串、所述添加标识的名称,得到接入码主体;Combining the key of the added identification, the ciphertext string of the added identification, and the name of the added identification to obtain the main body of the access code; 在所述接入码主体前添加预设的校验标识,在所述接入码主体后添加预设的结束标识,得到所述接入码。Adding a preset verification identifier before the main body of the access code, and adding a preset end identifier after the main body of the access code to obtain the access code. 5.根据权利要求1所述的方法,其特征在于,所述将所述接入码发送给待接入终端,包括:5. The method according to claim 1, wherein the sending the access code to the terminal to be accessed comprises: 通过以下至少一种数据传输方式将所述接入码发送给所述待接入终端:近场通信、红外、蓝牙。The access code is sent to the terminal to be accessed by at least one of the following data transmission methods: near field communication, infrared, and bluetooth. 6.根据权利要求1-5任一项所述的方法,其特征在于,所述方法还包括:6. The method according to any one of claims 1-5, wherein the method further comprises: 显示发送所述接入码的发送状态,所述发送状态包括:发送成功、发送失败或发送中。The sending status of sending the access code is displayed, and the sending status includes: sending successfully, sending failed or sending. 7.一种用于接入无线网络的方法,其特征在于,所述方法包括:7. A method for accessing a wireless network, characterized in that the method comprises: 获取待接入无线网络的接入码,所述接入码是基于所述待接入无线网络的名称、加密所述待接入无线网络的接入验证信息后得到的密文字符串得到的;Obtain an access code of the wireless network to be accessed, where the access code is obtained based on the name of the wireless network to be accessed and a ciphertext string obtained after encrypting the access verification information of the wireless network to be accessed ; 解析所述接入码,得到所述名称及所述密文字符串;Analyzing the access code to obtain the name and the ciphertext string; 解密所述密文字符串,得到所述接入验证信息;Decrypt the ciphertext string to obtain the access verification information; 基于所述名称及所述接入验证信息,接入所述待接入无线网络。Based on the name and the access verification information, access the wireless network to be accessed. 8.根据权利要求7所述的方法,其特征在于,所述接入码还包括加密所述接入验证信息所采用的密钥;以及8. The method according to claim 7, wherein the access code further includes a key used to encrypt the access verification information; and 所述解析所述接入码,得到所述名称及所述密文字符串,包括:The analyzing the access code to obtain the name and the ciphertext string includes: 依次读取所述接入码,基于预设的排列顺序,确定所述名称、所述密文字符串及所述密钥。The access codes are read sequentially, and the name, the ciphertext string and the key are determined based on a preset sequence. 9.根据权利要求8所述的方法,其特征在于,所述解析所述接入码,得到所述名称及所述密文字符串,还包括:9. The method according to claim 8, wherein said parsing said access code to obtain said name and said ciphertext string further comprises: 响应于所述接入码包括校验标识、结束标识,检测所述接入码是否包括密钥标识、密文字符串标识、名称标识;In response to the access code including a verification identifier and an end identifier, detecting whether the access code includes a key identifier, a ciphertext string identifier, and a name identifier; 响应于所述接入码包括所述密钥标识、所述密文字符串标识、所述名称标识,提取所述密钥标识指示的字符串作为所述密钥,提取所述密文字符串标识指示的字符串作为所述密文字符串,提取所述名称标识指示的字符串作为所述待接入无线网络的名称。In response to the access code including the key identifier, the ciphertext string identifier, and the name identifier, extracting the character string indicated by the key identifier as the key, and extracting the ciphertext string The character string indicated by the identification is used as the ciphertext character string, and the character string indicated by the name identification is extracted as the name of the wireless network to be accessed. 10.根据权利要求8或9所述的方法,其特征在于,所述解密所述密文字符串,得到所述接入验证信息,包括:10. The method according to claim 8 or 9, wherein the decrypting the ciphertext string to obtain the access verification information comprises: 采用预设的解密类型,调用解密函数以采用所述密钥对所述密文字符串进行解密,得到所述接入验证信息。Using a preset decryption type, calling a decryption function to use the key to decrypt the ciphertext string to obtain the access verification information. 11.根据权利要求7所述的方法,其特征在于,在所述基于所述名称及所述验证信息,接入所述待接入无线网络之前,所述方法还包括:11. The method according to claim 7, characterized in that, before accessing the wireless network to be accessed based on the name and the verification information, the method further comprises: 检测接入无线网络的开关的状态;Detect the state of the switch connected to the wireless network; 响应于检测到所述接入无线网络的开关的状态为关闭,开启所述接入无线网络的开关;In response to detecting that the switch for accessing the wireless network is off, turn on the switch for accessing the wireless network; 响应于检测到所述接入无线网络的开关的状态为开启,检测当前是否接入无线网络;In response to detecting that the state of the switch for accessing the wireless network is on, detecting whether to currently access the wireless network; 响应于当前已接入无线网络,显示无线网络切换询问消息;In response to the currently connected wireless network, displaying a wireless network switching inquiry message; 响应于接收到用户发送的确认切换无线网络消息,断开对已接入的无线网络的连接。In response to receiving a confirmation message for switching wireless networks sent by the user, the connection to the accessed wireless network is disconnected. 12.根据权利要求7所述的方法,其特征在于,所述方法还包括:12. The method according to claim 7, further comprising: 显示接入所述待接入无线网络的接入状态,所述接入状态包括:接入成功、接入失败或接入中。Displaying the access status of the wireless network to be accessed, where the access status includes: successful access, failed access, or in progress. 13.一种用于共享无线网络的装置,其特征在于,所述装置包括:13. A device for sharing a wireless network, characterized in that the device comprises: 第一获取单元,用于获取待共享无线网络的名称及接入验证信息;The first obtaining unit is used to obtain the name and access verification information of the wireless network to be shared; 加密单元,用于对所述接入验证信息进行加密,得到密文字符串;An encryption unit, configured to encrypt the access verification information to obtain a ciphertext string; 确定单元,用于基于所述名称、所述密文字符串,得到所述待共享无线网络的接入码;A determining unit, configured to obtain an access code of the wireless network to be shared based on the name and the ciphertext string; 发送单元,用于将所述接入码发送给待接入终端,以向所述待接入终端共享所述待共享无线网络。A sending unit, configured to send the access code to a terminal to be accessed, so as to share the wireless network to be shared with the terminal to be accessed. 14.根据权利要求13所述的装置,其特征在于,所述加密单元包括:14. The device according to claim 13, wherein the encryption unit comprises: 生成模块,用于采用预设的加密类型,调用密钥生成函数以生成密钥;A generation module, configured to use a preset encryption type, and call a key generation function to generate a key; 加密模块,用于调用加密函数以采用所述密钥对所述接入验证信息进行加密,得到密文字符串。An encryption module, configured to call an encryption function to encrypt the access verification information with the key to obtain a ciphertext string. 15.根据权利要求14所述的装置,其特征在于,所述确定单元进一步用于:15. The device according to claim 14, wherein the determining unit is further used for: 将所述密钥、所述名称以及所述密文字符串以预设的排列顺序排列,得到所述接入码。Arranging the key, the name, and the ciphertext string in a preset sequence to obtain the access code. 16.根据权利要求14所述的装置,其特征在于,所述确定单元进一步用于:16. The device according to claim 14, wherein the determining unit is further used for: 在所述密钥前添加预设的密钥标识,得到添加标识的密钥;Adding a preset key identifier before the key to obtain a key with the identifier added; 在所述密文字符串前添加预设的密文字符串标识,得到添加标识的密文字符串;Adding a preset ciphertext string identifier before the ciphertext string to obtain a ciphertext string with the identifier added; 在所述待共享无线网络的名称前添加预设的名称标识,得到添加标识的名称;Adding a preset name logo before the name of the wireless network to be shared to obtain a name with the logo added; 组合所述添加标识的密钥、所述添加标识的密文字符串、所述添加标识的名称,得到接入码主体;Combining the key of the added identification, the ciphertext string of the added identification, and the name of the added identification to obtain the main body of the access code; 在所述接入码主体前添加预设的校验标识,在所述接入码主体后添加预设的结束标识,得到所述接入码。Adding a preset verification identifier before the main body of the access code, and adding a preset end identifier after the main body of the access code to obtain the access code. 17.根据权利要求13所述的装置,其特征在于,所述发送单元进一步用于:17. The device according to claim 13, wherein the sending unit is further used for: 通过以下至少一种数据传输方式将所述接入码发送给所述待接入终端:近场通信、红外、蓝牙。The access code is sent to the terminal to be accessed by at least one of the following data transmission methods: near field communication, infrared, and bluetooth. 18.根据权利要求13-17任一项所述的装置,其特征在于,所述装置还包括:18. The device according to any one of claims 13-17, further comprising: 第一显示单元,用于显示发送所述接入码的发送状态,所述发送状态包括:发送成功、发送失败或发送中。The first display unit is configured to display the sending status of sending the access code, and the sending status includes: sending successfully, sending failed or sending. 19.一种用于接入无线网络的装置,其特征在于,所述装置包括:19. A device for accessing a wireless network, characterized in that the device comprises: 第二获取单元,用于获取待接入无线网络的接入码,所述接入码是基于所述待接入无线网络的名称、加密所述待接入无线网络的接入验证信息后得到的密文字符串得到的;The second acquiring unit is configured to acquire an access code of the wireless network to be accessed, the access code is obtained after encrypting the access verification information of the wireless network to be accessed based on the name of the wireless network to be accessed The ciphertext string is obtained; 解析单元,用于解析所述接入码,得到所述名称及所述密文字符串;A parsing unit, configured to parse the access code to obtain the name and the ciphertext string; 解密单元,用于解密所述密文字符串,得到所述接入验证信息;A decryption unit, configured to decrypt the ciphertext string to obtain the access verification information; 接入单元,用于基于所述名称及所述接入验证信息,接入所述待接入无线网络。An access unit, configured to access the wireless network to be accessed based on the name and the access verification information. 20.根据权利要求19所述的装置,其特征在于,所述接入码还包括加密所述接入验证信息所采用的密钥;以及20. The device according to claim 19, wherein the access code further includes a key used to encrypt the access verification information; and 所述解析单元进一步用于:The parsing unit is further used for: 依次读取所述接入码,基于预设的排列顺序,确定所述名称、所述密文字符串及所述密钥。The access codes are read sequentially, and the name, the ciphertext string and the key are determined based on a preset sequence. 21.根据权利要求20所述的装置,其特征在于,所述解析单元进一步用于:21. The device according to claim 20, wherein the parsing unit is further used for: 响应于所述接入码包括校验标识、结束标识,检测所述接入码是否包括密钥标识、密文字符串标识、名称标识;In response to the access code including a verification identifier and an end identifier, detecting whether the access code includes a key identifier, a ciphertext string identifier, and a name identifier; 响应于所述接入码包括所述密钥标识、所述密文字符串标识、所述名称标识,提取所述密钥标识指示的字符串作为所述密钥,提取所述密文字符串标识指示的字符串作为所述密文字符串,提取所述名称标识指示的字符串作为所述待接入无线网络的名称。In response to the access code including the key identifier, the ciphertext string identifier, and the name identifier, extracting the character string indicated by the key identifier as the key, and extracting the ciphertext string The character string indicated by the identification is used as the ciphertext character string, and the character string indicated by the name identification is extracted as the name of the wireless network to be accessed. 22.根据权利要求20或21所述的装置,其特征在于,所述解密单元进一步用于:22. The device according to claim 20 or 21, wherein the decryption unit is further used for: 采用预设的解密类型,调用解密函数以采用所述密钥对所述密文字符串进行解密,得到所述接入验证信息。Using a preset decryption type, calling a decryption function to use the key to decrypt the ciphertext string to obtain the access verification information. 23.根据权利要求19所述的装置,其特征在于,所述装置还包括:23. The device of claim 19, further comprising: 检测单元,用于在所述接入单元基于所述名称及所述验证信息,接入所述待接入无线网络之前,检测接入无线网络的开关的状态;A detecting unit, configured to detect the status of a switch for accessing a wireless network before the accessing unit accesses the wireless network to be accessed based on the name and the verification information; 响应于检测到所述接入无线网络的开关的状态为关闭,开启所述接入无线网络的开关;In response to detecting that the switch for accessing the wireless network is off, turn on the switch for accessing the wireless network; 响应于检测到所述接入无线网络的开关的状态为开启,检测当前是否接入无线网络;In response to detecting that the state of the switch for accessing the wireless network is on, detecting whether to currently access the wireless network; 响应于当前已接入无线网络,显示无线网络切换询问消息;In response to the currently connected wireless network, displaying a wireless network switching inquiry message; 响应于接收到用户发送的确认切换无线网络消息,断开对已接入的无线网络的连接。In response to receiving a confirmation message for switching wireless networks sent by the user, the connection to the accessed wireless network is disconnected. 24.根据权利要求19所述的装置,其特征在于,所述装置还包括:24. The device of claim 19, further comprising: 第二显示单元,用于显示接入所述待接入无线网络的接入状态,所述接入状态包括:接入成功、接入失败或接入中。The second display unit is configured to display an access status of the wireless network to be accessed, and the access status includes: access successful, access failure, or access.
CN201610812193.XA 2016-09-08 2016-09-08 Method and device for sharing wireless network and method and device for accessing wireless network Active CN106385684B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610812193.XA CN106385684B (en) 2016-09-08 2016-09-08 Method and device for sharing wireless network and method and device for accessing wireless network

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610812193.XA CN106385684B (en) 2016-09-08 2016-09-08 Method and device for sharing wireless network and method and device for accessing wireless network

Publications (2)

Publication Number Publication Date
CN106385684A true CN106385684A (en) 2017-02-08
CN106385684B CN106385684B (en) 2020-02-07

Family

ID=57935466

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610812193.XA Active CN106385684B (en) 2016-09-08 2016-09-08 Method and device for sharing wireless network and method and device for accessing wireless network

Country Status (1)

Country Link
CN (1) CN106385684B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110312253A (en) * 2018-03-20 2019-10-08 杭州海康威视数字技术股份有限公司 A kind of method for network access, apparatus and system
CN111148080A (en) * 2019-07-19 2020-05-12 广东小天才科技有限公司 Wireless network connection method and user equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1811719A1 (en) * 2006-01-24 2007-07-25 BRITISH TELECOMMUNICATIONS public limited company Internetwork key sharing
CN105451298A (en) * 2014-08-25 2016-03-30 深圳酷派技术有限公司 Network-sharing method and system, network access method and system, and electronic device
CN105704712A (en) * 2016-01-18 2016-06-22 华为技术有限公司 Network resource sharing method, mobile terminal, and server

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1811719A1 (en) * 2006-01-24 2007-07-25 BRITISH TELECOMMUNICATIONS public limited company Internetwork key sharing
CN105451298A (en) * 2014-08-25 2016-03-30 深圳酷派技术有限公司 Network-sharing method and system, network access method and system, and electronic device
CN105704712A (en) * 2016-01-18 2016-06-22 华为技术有限公司 Network resource sharing method, mobile terminal, and server

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110312253A (en) * 2018-03-20 2019-10-08 杭州海康威视数字技术股份有限公司 A kind of method for network access, apparatus and system
CN110312253B (en) * 2018-03-20 2022-08-09 杭州海康威视数字技术股份有限公司 Network access method, device and system
CN111148080A (en) * 2019-07-19 2020-05-12 广东小天才科技有限公司 Wireless network connection method and user equipment

Also Published As

Publication number Publication date
CN106385684B (en) 2020-02-07

Similar Documents

Publication Publication Date Title
US10182255B2 (en) Method, terminal, and system for communication pairing of a digital television terminal and a mobile terminal
US10972908B2 (en) Wireless network connection method, apparatus, and system
CN202738112U (en) Attachment, controller, and system for establishing wireless communication link therebetween
KR102137673B1 (en) Application connection method and system using same method
CN104144049B (en) A kind of encryption communication method, system and device
EP3255832A1 (en) Dynamic encryption method, terminal and server
KR20160078475A (en) Key configuration method, system and apparatus
CN104994098B (en) Document transmission method and relevant apparatus and Transmission system
CN106572427B (en) Method and device for establishing near field communication
CN106452999B (en) Intelligent household appliance and method and device for safely accessing intelligent household appliance
CN103701586A (en) Method and device for acquiring secret key
TW202123121A (en) Payment result acquisition method and apparatus, payment device, and cash register device
CN106658488B (en) Intelligent household appliance and method and device for safely accessing intelligent household appliance
KR102050823B1 (en) System, an apparatus and a method for transmitting and receiving information using quick response code
CN106385684B (en) Method and device for sharing wireless network and method and device for accessing wireless network
CN105763229A (en) Mobile terminal external equipment and file transmission method
CN111130805B (en) Secure transmission method, electronic device, and computer-readable storage medium
WO2015124798A2 (en) Method & system for enabling authenticated operation of a data processing device
EP3041185A1 (en) A method for authenticating a user equipment in order to established a secured communication session with a server
CN107172718B (en) Information processing method and electronic equipment
WO2014173215A1 (en) Conversion device and display system
TWI577145B (en) Method for encrypted data transmission of near field communication device and system thereof
WO2018023495A1 (en) Device pairing and data transmission method for handheld communication device
Ali et al. Data Hiding Technique Based on NFC-Enabled Smartphones
CN113193923B (en) Remote testing method, equipment and system

Legal Events

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