[go: up one dir, main page]

CN104796967B - Wireless network data restoring method and device - Google Patents

Wireless network data restoring method and device Download PDF

Info

Publication number
CN104796967B
CN104796967B CN201510224060.6A CN201510224060A CN104796967B CN 104796967 B CN104796967 B CN 104796967B CN 201510224060 A CN201510224060 A CN 201510224060A CN 104796967 B CN104796967 B CN 104796967B
Authority
CN
China
Prior art keywords
wireless network
network configuration
information
file
configuration file
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.)
Expired - Fee Related
Application number
CN201510224060.6A
Other languages
Chinese (zh)
Other versions
CN104796967A (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.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp 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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201510224060.6A priority Critical patent/CN104796967B/en
Publication of CN104796967A publication Critical patent/CN104796967A/en
Application granted granted Critical
Publication of CN104796967B publication Critical patent/CN104796967B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W48/00Access restriction; Network selection; Access point selection
    • H04W48/16Discovering, processing access restriction or access information
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W84/00Network topologies
    • H04W84/02Hierarchically pre-organised networks, e.g. paging networks, cellular networks, WLAN [Wireless Local Area Network] or WLL [Wireless Local Loop]
    • H04W84/10Small scale networks; Flat hierarchical networks
    • H04W84/12WLAN [Wireless Local Area Networks]

Landscapes

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

Abstract

The present invention is suitable for intelligent terminal technical field, there is provided a kind of wireless network data restoring method and device, the described method includes:When detecting wireless network data reduction instruction, the first wireless networks profiles are obtained;The radio network configuration information in backup file is read, the radio network configuration information in first wireless networks profiles is revised as read radio network configuration information;The port attribute information in second wireless network configuration file is read, the port attribute information in first wireless networks profiles is revised as read port attribute information;The authority information in backup file is read, the authority information in first wireless networks profiles is revised as read authority information;Finally restart intelligent terminal.The present invention realizes intelligent terminal after brush machine or factory reset, and pervious wireless network is can access without resetting radio network configuration information.

Description

无线网络数据还原方法及装置Wireless network data restoration method and device

技术领域technical field

本发明属于智能终端技术领域,尤其涉及一种无线网络数据还原方法及装置。The invention belongs to the technical field of intelligent terminals, and in particular relates to a wireless network data restoration method and device.

背景技术Background technique

现有的智能终端能够记录其曾经搜索到或连接过的无线网络。用户使用智能终端越久,智能终端上所保存的无线网络数据(例如Wi-Fi网络的名称和密码等)越多,每当智能终端检测到所述无线网络时,可根据保存的无线网络数据自动接入无线网络,极大地简化了智能终端的联网操作。Existing smart terminals can record the wireless networks they have searched or connected to. The longer the user uses the smart terminal, the more wireless network data (such as the name and password of the Wi-Fi network, etc.) stored on the smart terminal will be. Whenever the smart terminal detects the wireless network, it can automatically Access to the wireless network greatly simplifies the networking operation of smart terminals.

然而,当智能终端刷机或者恢复出厂设置后,智能终端上所记录的无线网络数据也被清除,需要重新设置智能终端上的无线网络数据才能接入无线网络,操作过程繁琐。However, when the smart terminal is flashed or reset to factory settings, the wireless network data recorded on the smart terminal is also cleared, and the wireless network data on the smart terminal needs to be reset to access the wireless network, and the operation process is cumbersome.

发明内容Contents of the invention

鉴于此,本发明实施例提供一种无线网络数据还原方法及装置,以使得智能终端在刷机或恢复出厂设置后,无需重新设置无线网络数据即可接入无线网络。In view of this, the embodiments of the present invention provide a method and device for restoring wireless network data, so that the smart terminal can access the wireless network without resetting the wireless network data after flashing or restoring factory settings.

第一方面,提供了一种无线网络数据还原方法,所述方法包括:In a first aspect, a method for restoring wireless network data is provided, the method comprising:

当检测到无线网络数据还原指令时,获取第一无线网络配置文件;When the wireless network data restoration instruction is detected, the first wireless network configuration file is obtained;

读取备份文件中的无线网络配置信息,将所述第一无线网络配置文件中的无线网络配置信息修改为所读取的无线网络配置信息;Read the wireless network configuration information in the backup file, and modify the wireless network configuration information in the first wireless network configuration file to the read wireless network configuration information;

读取第二无线网络配置文件中的端口属性信息,将所述第一无线网络配置文件中的端口属性信息修改为所读取的端口属性信息;Read the port attribute information in the second wireless network configuration file, and modify the port attribute information in the first wireless network configuration file to the read port attribute information;

读取备份文件中的权限信息,将所述第一无线网络配置文件中的权限信息修改为所读取的权限信息;Read the permission information in the backup file, and modify the permission information in the first wireless network configuration file to the read permission information;

在所述第一无线网络配置文件的无线网络配置信息、端口属性信息、权限信息修改完后,重新启动智能终端。After the wireless network configuration information, port attribute information, and authority information of the first wireless network configuration file are modified, restart the smart terminal.

进一步地,所述第一无线网络配置文件为data/misc/wifi/wpa_supplicant.conf文件;Further, the first wireless network configuration file is data/misc/wifi/wpa_supplicant.conf file;

所述第二无线网络配置文件为data/misc/wifi/p2p_supplicant.conf文件;The second wireless network configuration file is data/misc/wifi/p2p_supplicant.conf file;

所述端口属性信息为ctrl-interface属性信息。The port attribute information is ctrl-interface attribute information.

进一步地,在获取第一无线网络配置文件之前,所述方法还包括:Further, before obtaining the first wireless network configuration file, the method also includes:

在智能终端刷机或恢复出厂设置前,读取第一无线网络配置文件中的无线网络配置信息和权限信息;Before flashing the smart terminal or restoring factory settings, read the wireless network configuration information and permission information in the first wireless network configuration file;

将所述无线网络配置信息和权限信息存储至所述备份文件中。The wireless network configuration information and authority information are stored in the backup file.

进一步地,所述获取第一无线网络配置文件包括:Further, said obtaining the first wireless network configuration file includes:

判断智能终端中是否存在第一无线网络配置文件;Judging whether the first wireless network configuration file exists in the smart terminal;

若是,则获取所述第一无线网络配置文件;If yes, then obtain the first wireless network configuration file;

否则,触发无线网络连接功能以生成所述第一无线网络配置文件。Otherwise, trigger a wireless network connection function to generate the first wireless network configuration file.

进一步地,所述备份文件中包括其他智能终端的第一无线网络配置文件中的无线网络配置信息和权限信息。Further, the backup file includes wireless network configuration information and authority information in the first wireless network configuration file of other smart terminals.

第二发明,提供了一种无线网络数据还原装置,所述装置包括:The second invention provides a device for restoring wireless network data, the device comprising:

获取模块,用于当检测到无线网络数据还原指令时,获取第一无线网络配置文件;An acquisition module, configured to acquire the first wireless network configuration file when a wireless network data restoration instruction is detected;

第一读取模块,用于读取备份文件中的无线网络配置信息,将所述第一无线网络配置文件中的无线网络配置信息修改为所读取的无线网络配置信息;The first reading module is used to read the wireless network configuration information in the backup file, and modify the wireless network configuration information in the first wireless network configuration file to the read wireless network configuration information;

第二读取模块,用于读取第二无线网络配置文件中的端口属性信息,将所述第一无线网络配置文件中的端口属性信息修改为所读取的端口属性信息;The second reading module is used to read the port attribute information in the second wireless network configuration file, and modify the port attribute information in the first wireless network configuration file to the read port attribute information;

第三读取模块,用于读取备份文件中的权限信息,将所述第一无线网络配置文件中的权限信息修改为所读取的权限信息;A third reading module, configured to read the permission information in the backup file, and modify the permission information in the first wireless network configuration file to the read permission information;

重启模块,用于在所述第一无线网络配置文件的无线网络配置信息、端口属性信息、权限信息修改完后,重新启动智能终端。A restart module, configured to restart the smart terminal after the wireless network configuration information, port attribute information, and authority information of the first wireless network configuration file are modified.

进一步地,所述第一无线网络配置文件为data/misc/wifi/wpa_supplicant.conf文件;Further, the first wireless network configuration file is data/misc/wifi/wpa_supplicant.conf file;

所述第二无线网络配置文件为data/misc/wifi/p2p_supplicant.conf文件;The second wireless network configuration file is data/misc/wifi/p2p_supplicant.conf file;

所述端口属性信息为ctrl-interface属性信息。The port attribute information is ctrl-interface attribute information.

进一步地,所述装置还包括:Further, the device also includes:

备份模块,用于在智能终端刷机或恢复出厂设置前,读取第一无线网络配置文件中的无线网络配置信息和权限信息,将所述无线网络配置信息和权限信息存储至所述备份文件中。The backup module is used to read the wireless network configuration information and authority information in the first wireless network configuration file before the intelligent terminal is flashed or restored to factory settings, and stores the wireless network configuration information and authority information in the backup file .

进一步地,所述获取模块包括:Further, the acquisition module includes:

判断单元,用于判断智能终端中是否存在第一无线网络配置文件;A judging unit, configured to judge whether the first wireless network configuration file exists in the smart terminal;

获取单元,用于在判断单元的判断结果为是时,获取所述第一无线网络配置文件;an acquiring unit, configured to acquire the first wireless network configuration file when the judging result of the judging unit is yes;

生成单元,用于在判断单元的判断结果为否时,触发无线网络连接功能以生成所述第一无线网络配置文件。A generating unit, configured to trigger a wireless network connection function to generate the first wireless network configuration file when the judging result of the judging unit is negative.

进一步地,所述备份文件中包括其他智能终端的第一无线网络配置文件中的无线网络配置信息和权限信息。Further, the backup file includes wireless network configuration information and authority information in the first wireless network configuration file of other smart terminals.

与现有技术相比,本发明实施例在智能终端存储了与无线网络数据相关的备份文件;当检测到无线网络数据还原指令时,获取第一无线网络配置文件;读取备份文件中的无线网络配置信息,将所述第一无线网络配置文件中的无线网络配置信息修改为所读取的无线网络配置信息;读取第二无线网络配置文件中的端口属性信息,将所述第一无线网络配置文件中的端口属性信息更新为所读取的端口属性信息;读取备份文件中的权限信息,将所述第一无线网络配置文件中的权限信息修改为所读取的权限信息;重新启动所述智能终端;重启后的智能终端即可使用备份文件中所备份的无线网络数据连接网络,从而实现了在智能终端上还原所备份的无线网络数据,使得智能终端在刷机或者恢复出厂设置后仍能继续使用以前的Wi-Fi热点连接网络,避免了重新设置智能终端的网络连接,极大地提升了用户的体验感。Compared with the prior art, the embodiment of the present invention stores a backup file related to wireless network data in the smart terminal; when a wireless network data restore command is detected, the first wireless network configuration file is obtained; and the wireless network configuration file in the backup file is read. Network configuration information, modifying the wireless network configuration information in the first wireless network configuration file to the read wireless network configuration information; reading the port attribute information in the second wireless network configuration file, and modifying the first wireless network configuration information The port attribute information in the network configuration file is updated to the read port attribute information; the permission information in the backup file is read, and the permission information in the first wireless network configuration file is modified to the read permission information; Start the smart terminal; after restarting, the smart terminal can use the wireless network data backed up in the backup file to connect to the network, thereby realizing the restoration of the backed up wireless network data on the smart terminal, so that the smart terminal is flashing or restoring factory settings Afterwards, you can continue to use the previous Wi-Fi hotspot to connect to the network, avoiding the need to reset the network connection of the smart terminal, and greatly improving the user experience.

附图说明Description of drawings

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only These are some embodiments of the present invention. For those skilled in the art, other drawings can also be obtained according to these drawings without any creative effort.

图1是本发明实施例一提供的无线网络数据还原方法的第一实现流程图;FIG. 1 is a first implementation flowchart of the wireless network data restoration method provided by Embodiment 1 of the present invention;

图2是本发明实施例二提供的无线网络数据备份方法的第二实现流程图;FIG. 2 is a second implementation flow chart of the wireless network data backup method provided in Embodiment 2 of the present invention;

图3是本发明实施例三提供的无线网络数据还原装置的组成结构图。FIG. 3 is a structural diagram of a device for restoring wireless network data provided by Embodiment 3 of the present invention.

具体实施方式Detailed ways

为了使本发明的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。In order to make the object, technical solution and advantages of the present invention clearer, the present invention 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 the present invention, not to limit the present invention.

本发明实施例在智能终端存储了与无线网络数据相关的备份文件;当检测到无线网络数据还原指令时,获取第一无线网络配置文件;读取备份文件中的无线网络配置信息,将所述第一无线网络配置文件中的无线网络配置信息修改为所读取的无线网络配置信息;读取第二无线网络配置文件中的端口属性信息,将所述第一无线网络配置文件中的端口属性信息更新为所读取的端口属性信息;读取备份文件中的权限信息,将所述第一无线网络配置文件中的权限信息修改为所读取的权限信息;重新启动所述智能终端;重启后的智能终端即可使用备份文件中所备份的无线网络数据连接网络,从而实现了在智能终端上还原所备份的无线网络数据,使得智能终端在刷机或者恢复出厂设置后无需重新设置即可继续使用以前的Wi-Fi热点连接网络,避免了重新设置智能终端的网络连接,极大地提升了用户的体验感。本发明实施例还提供了相应的装置,以下分别进行详细的说明。In the embodiment of the present invention, a backup file related to wireless network data is stored in the smart terminal; when a wireless network data restore command is detected, the first wireless network configuration file is obtained; the wireless network configuration information in the backup file is read, and the The wireless network configuration information in the first wireless network configuration file is modified to the wireless network configuration information read; read the port attribute information in the second wireless network configuration file, and modify the port attribute information in the first wireless network configuration file The information is updated to the read port attribute information; read the permission information in the backup file, and modify the permission information in the first wireless network configuration file to the read permission information; restart the smart terminal; restart After that, the smart terminal can use the wireless network data backed up in the backup file to connect to the network, thereby realizing the restoration of the backed up wireless network data on the smart terminal, so that the smart terminal can continue without resetting after flashing or restoring factory settings. Using the previous Wi-Fi hotspot to connect to the network avoids resetting the network connection of the smart terminal, which greatly improves the user experience. Embodiments of the present invention also provide corresponding devices, which will be described in detail below.

实施例一Embodiment one

图1示出了本发明实施例一提供的无线网络数据还原方法的第一实现流程,为了便于说明,仅示出了与本发明实施例相关的部分。FIG. 1 shows a first implementation process of the wireless network data restoration method provided by Embodiment 1 of the present invention. For the convenience of description, only the parts related to the embodiment of the present invention are shown.

在本发明实施例中,所述方法应用于智能终端,所述智能终端具备连接无线局域网WLAN的功能。优选的,所述智能终端包括但不限于智能手机、平板电脑、学习机、音乐播放器(比如MP3、MP4等)、PDA智能终端、车载智能终端、可穿戴设备。在进行刷机或者恢复出厂设置前,所述智能终端将读取第一无线网络配置文件中的无线网络配置信息和权限信息,并将所述无线网络配置信息和权限信息一同存储至备份文件中。所述无线网络配置信息优选为Wi-Fi配置信息。In the embodiment of the present invention, the method is applied to a smart terminal, and the smart terminal has a function of connecting to a wireless local area network (WLAN). Preferably, the smart terminal includes, but not limited to, smart phones, tablet computers, learning machines, music players (such as MP3, MP4, etc.), PDA smart terminals, vehicle-mounted smart terminals, and wearable devices. Before flashing or restoring factory settings, the smart terminal will read the wireless network configuration information and permission information in the first wireless network configuration file, and store the wireless network configuration information and permission information together in the backup file. The wireless network configuration information is preferably Wi-Fi configuration information.

如图1所示,所述方法包括:As shown in Figure 1, the method includes:

在步骤S101中,当检测到无线网络数据还原指令时,获取第一无线网络配置文件。In step S101, when a wireless network data restoration instruction is detected, a first wireless network configuration file is obtained.

其中,所述第一无线网络配置文件为data/misc/wifi/wpa_supplicant.conf文件,用于存储Wi-Fi配置信息及权限信息。Wherein, the first wireless network configuration file is data/misc/wifi/wpa_supplicant.conf file, which is used to store Wi-Fi configuration information and permission information.

在本发明实施例中,由于刷机或者恢复出厂设置后的智能终端已将刷机或恢复出厂设置前的第一无线网络配置文件清除,若刷机或者恢复出厂设置后的智能终端未连接过Wi-Fi无线网络,其内部不存在第一无线网络配置文件,所述获取第一无线网络配置文件包括:In the embodiment of the present invention, since the smart terminal after flashing or restoring factory settings has cleared the first wireless network configuration file before flashing or restoring factory settings, if the smart terminal after flashing or restoring factory settings has not connected to Wi-Fi The wireless network does not have the first wireless network configuration file inside, and the obtaining the first wireless network configuration file includes:

判断智能终端中是否存在第一无线网络配置文件;Judging whether the first wireless network configuration file exists in the smart terminal;

若是,则获取所述第一无线网络配置文件;If yes, then obtain the first wireless network configuration file;

否则,触发无线网络连接功能以生成所述第一无线网络配置文件。Otherwise, trigger a wireless network connection function to generate the first wireless network configuration file.

在智能终端存在第一无线网络配置文件时,直接获取所述第一无线网络配置文件;否则,通过使能化一次Wi-Fi,即触发无线网络连接功能(比如开启智能终端上的无线网络连接功能,不一定连接上网络),通过此方式自动生成所述第一无线网络配置文件,即data/misc/wifi/wpa_supplicant.conf文件。When the smart terminal has the first wireless network configuration file, directly obtain the first wireless network configuration file; otherwise, by enabling Wi-Fi once, the wireless network connection function (such as enabling the wireless network connection on the smart terminal function, not necessarily connected to the network), and automatically generate the first wireless network configuration file in this way, that is, the data/misc/wifi/wpa_supplicant.conf file.

在步骤S102中,读取备份文件中的无线网络配置信息,将所述第一无线网络配置文件中的无线网络配置信息修改为所读取的无线网络配置信息。In step S102, the wireless network configuration information in the backup file is read, and the wireless network configuration information in the first wireless network configuration file is modified to the read wireless network configuration information.

在本发明实施例中,所述无线网络配置信息为Wi-Fi配置信息。智能终端连接过Wi-Fi后,其内部将生成第一无线网络配置文件,即data/misc/wifi/wpa_supplicant.conf文件,以保存该文件的权限信息(包括但不限于user、group属性和读写权限属性)和智能终端所有可搜索到或者连接过的Wi-Fi配置信息(包括但不限于ssid网络名称、psk密码、key_mgmt加密方式、priority优先权限)。所述智能终端在进行刷机或者恢复出厂设置前,预先读取第一无线网络配置文件(即恢复出厂设置或刷机前智能终端的data/misc/wifi/wpa_supplicant.conf文件)中的无线网络配置信息和权限信息,并将所述无线网络配置信息和权限信息一同存储至备份文件中。所述无线网络配置信息为Wi-Fi配置信息,所述备份文件优选为字符串数组conf[]。In the embodiment of the present invention, the wireless network configuration information is Wi-Fi configuration information. After the smart terminal is connected to Wi-Fi, it will generate the first wireless network configuration file, namely data/misc/wifi/wpa_supplicant.conf file, to save the permission information of the file (including but not limited to user, group attribute and read Write permission attribute) and all Wi-Fi configuration information that can be searched or connected to the smart terminal (including but not limited to ssid network name, psk password, key_mgmt encryption method, priority priority permission). The intelligent terminal reads in advance the wireless network configuration information in the first wireless network configuration file (i.e. the data/misc/wifi/wpa_supplicant.conf file of the intelligent terminal before restoring the factory settings or flashing) before flashing or restoring the factory settings and permission information, and store the wireless network configuration information and permission information together in a backup file. The wireless network configuration information is Wi-Fi configuration information, and the backup file is preferably a string array conf[].

在智能终端恢复出厂设备或刷机后,则从所述备份文件中获取Wi-Fi配置信息。针对第一无线网络配置文件中的每一项Wi-Fi配置属性,逐一查找所述备份文件中所述Wi-Fi配置属性对应的设置值,并将所述第一无线网络配置文件中的每一项Wi-Fi配置属性修改为所述设置值,即将备份文件中的每一项Wi-Fi配置属性的设置值赋值给所述第一无线网络配置文件中对应的Wi-Fi配置属性。After the smart terminal restores the factory equipment or flashes the machine, the Wi-Fi configuration information is obtained from the backup file. For each Wi-Fi configuration attribute in the first wireless network configuration file, look up the setting value corresponding to the Wi-Fi configuration attribute in the backup file one by one, and set each Wi-Fi configuration attribute in the first wireless network configuration file One Wi-Fi configuration attribute is modified to the set value, that is, the set value of each Wi-Fi configuration attribute in the backup file is assigned to the corresponding Wi-Fi configuration attribute in the first wireless network configuration file.

在步骤S103中,读取第二无线网络配置文件中的端口属性信息,将所述第一无线网络配置文件中的端口属性信息修改为所读取的端口属性信息。In step S103, read the port attribute information in the second wireless network configuration file, and modify the port attribute information in the first wireless network configuration file to the read port attribute information.

在本发明实施例中,所述第二无线网络配置文件为data/misc/wifi/p2p_supplicant.conf文件,其内部记录了ctrl_interface属性信息,即智能终端的端口属性信息。不同的Android设备所使用的网络端口不相同。因此,为了保证还原后的无线网络数据的可使用性,同时将data/misc/wifi/p2p_supplicant.conf文件中的ctrl_interface属性值赋值给data/misc/wifi/wpa_supplicant.conf文件中的ctrl_interface。In the embodiment of the present invention, the second wireless network configuration file is data/misc/wifi/p2p_supplicant.conf file, which records ctrl_interface attribute information, that is, port attribute information of the smart terminal. Different Android devices use different network ports. Therefore, in order to ensure the usability of the restored wireless network data, at the same time assign the ctrl_interface attribute value in the data/misc/wifi/p2p_supplicant.conf file to the ctrl_interface in the data/misc/wifi/wpa_supplicant.conf file.

在步骤S104中,读取备份文件中的权限信息,将所述第一无线网络配置文件中的权限信息修改为所读取的权限信息。In step S104, read the permission information in the backup file, and modify the permission information in the first wireless network configuration file to the read permission information.

在将data/misc/wifi/p2p_supplicant.conf文件中的ctrl_interface属性值赋值给data/misc/wifi/wpa_supplicant.conf文件中的ctrl_interface之后,根据备份文件conf[]中所记录的智能终端恢复出厂设置或刷机前的wpa_supplicant.conf文件的权限信息修改当前的data/misc/wifi/wpa_supplicant.conf文件的权限信息。After assigning the ctrl_interface attribute value in the data/misc/wifi/p2p_supplicant.conf file to the ctrl_interface in the data/misc/wifi/wpa_supplicant.conf file, restore the factory settings or Modify the permission information of the current data/misc/wifi/wpa_supplicant.conf file with the permission information of the wpa_supplicant.conf file before flashing.

在步骤S105中,在所述第一无线网络配置文件的无线网络配置信息、端口属性信息、权限信息修改完后,重新启动所述智能终端。In step S105, after the wireless network configuration information, port attribute information, and authority information of the first wireless network configuration file are modified, restart the smart terminal.

当恢复出厂设置或刷机后的智能终端的data/misc/wifi/wpa_supplicant.conf文件中的Wi-Fi配置信息、权限信息、ctrl_interface属性信息均修改完毕后,重新启动所述智能终端。重启后的智能终端将可继续使用刷机或恢复出厂设置之前所使用过的Wi-Fi热点接入无线网络。When the Wi-Fi configuration information, permission information, and ctrl_interface attribute information in the data/misc/wifi/wpa_supplicant.conf file of the intelligent terminal after restoring the factory settings or flashing the machine are all modified, restart the intelligent terminal. After restarting, the smart terminal can continue to use the Wi-Fi hotspot used before flashing or restoring factory settings to access the wireless network.

本发明实施例在智能终端刷机或恢复出厂设置前存储了与无线网络数据相关的备份文件;在智能终端刷机或恢复出厂设置后,根据存储的备份文件修改当前的第一无线网络配置文件中的无线网络配置信息和权限信息,以及根据第二无线网络配置文件中的端口属性信息修改当前的第一无线网络配置文件中的端口属性信息,最后重启所述智能终端;重启后的智能终端即可使用以前的Wi-Fi热点连接网络,从而实现了在智能终端上还原之前所保存的无线网络数据,使得智能终端在刷机或者恢复出厂设置后无需重新设置仍能继续使用以前的Wi-Fi热点连接网络,避免了重新设置智能终端的网络连接,极大地提升了用户的体验感。In the embodiment of the present invention, the backup file related to the wireless network data is stored before the smart terminal is reset or the factory settings are restored; after the smart terminal is reset or the factory settings are restored, the current first wireless network configuration file is modified according to the stored backup file. Wireless network configuration information and permission information, and modify the port attribute information in the current first wireless network configuration file according to the port attribute information in the second wireless network configuration file, and finally restart the smart terminal; the restarted smart terminal can be Use the previous Wi-Fi hotspot to connect to the network, so as to restore the previously saved wireless network data on the smart terminal, so that the smart terminal can continue to use the previous Wi-Fi hotspot connection without resetting after flashing or restoring factory settings The network avoids resetting the network connection of the smart terminal, which greatly improves the user experience.

实施例二Embodiment two

图2示出了本发明实施例二提供的无线网络数据备份方法的第二实现流程。在本发明实施例中,所述备份文件中还可包括其他智能终端的第一无线网络配置文件中的无线网络配置信息和权限信息。所述无线网络配置信息优选为所述其他智能终端Wi-Fi配置信息,包括但不限于所述其他智能终端可搜索到或者连接过的Wi-Fi网络的配置信息。FIG. 2 shows a second implementation process of the wireless network data backup method provided by Embodiment 2 of the present invention. In the embodiment of the present invention, the backup file may further include wireless network configuration information and authority information in the first wireless network configuration file of other smart terminals. The wireless network configuration information is preferably Wi-Fi configuration information of the other smart terminals, including but not limited to configuration information of Wi-Fi networks searchable or connected to by the other smart terminals.

如图2所示,所述方法包括:As shown in Figure 2, the method includes:

在步骤S201中,当检测到无线网络数据还原指令时,获取第一无线网络配置文件。In step S201, when a wireless network data restoration instruction is detected, a first wireless network configuration file is obtained.

在步骤S202中,读取备份文件中的无线网络配置信息,将所述第一无线网络配置文件中的无线网络配置信息修改为所读取的无线网络配置信息。In step S202, read the wireless network configuration information in the backup file, and modify the wireless network configuration information in the first wireless network configuration file to the read wireless network configuration information.

其中,所述备份文件可通过蓝牙、USB数据线传输等方式从其他智能终端获取。所述备份文件优选为字符串数组conf[],里面存储了所述其他智能终端的第一无线网络配置文件(即所述其他智能终端的data/misc/wifi/wpa_supplicant.conf文件)中的权限信息和Wi-Fi配置信息。Wherein, the backup file can be obtained from other smart terminals through bluetooth, USB data cable transmission and other means. The backup file is preferably a character string array conf[], which stores the permissions in the first wireless network configuration file of the other smart terminals (ie the data/misc/wifi/wpa_supplicant.conf file of the other smart terminals) information and Wi-Fi configuration information.

在步骤S203中,读取第二无线网络配置文件中的端口属性信息,将所述第一无线网络配置文件中的端口属性信息更新为所读取的端口属性信息。In step S203, read the port attribute information in the second wireless network configuration file, and update the port attribute information in the first wireless network configuration file with the read port attribute information.

在步骤S204中,读取备份文件中的权限信息,将所述第一无线网络配置文件中的权限信息修改为所读取的权限信息。In step S204, read the permission information in the backup file, and modify the permission information in the first wireless network configuration file to the read permission information.

其中,所述第一无线网络配置文件为data/misc/wifi/wpa_supplicant.conf文件;所述第二无线网络配置文件为data/misc/wifi/p2p_supplicant.conf文件;所述端口属性信息为ctrl-interface属性信息。Wherein, the first wireless network configuration file is data/misc/wifi/wpa_supplicant.conf file; the second wireless network configuration file is data/misc/wifi/p2p_supplicant.conf file; the port attribute information is ctrl- interface attribute information.

在步骤S205中,在所述第一无线网络配置文件的无线网络配置信息、端口属性信息、权限信息修改完后,重新所述启动智能终端。In step S205, after the wireless network configuration information, port attribute information, and authority information of the first wireless network configuration file are modified, restart the smart terminal.

在本发明实施例中,智能终端根据所述其他智能终端发送的备份文件修改本机的第一无线网络配置文件中的Wi-Fi配置信息和权限信息,以及根据第二无线网络配置文件中的端口属性信息修改本机的第一无线网络配置文件中的端口属性信息,并重新启动;重启后的智能终端即可获取所述其他智能终端曾经搜索到的Wi-Fi网络以及使用所述其他智能终端连接过的Wi-Fi热点连接无线网络。In the embodiment of the present invention, the smart terminal modifies the Wi-Fi configuration information and permission information in the first wireless network configuration file of the machine according to the backup files sent by the other smart terminals, and modifies the Wi-Fi configuration information and permission information in the second wireless network configuration file according to the backup files sent by the other smart terminals. The port attribute information modifies the port attribute information in the first wireless network configuration file of the machine, and restarts; the restarted smart terminal can obtain the Wi-Fi network once searched by the other smart terminals and use the other smart terminals. The Wi-Fi hotspot connected to the terminal is connected to the wireless network.

示例性地,假设有智能终端A和智能终端B,两者通过有线或者无线的方式连接计算机,并能够与计算机进行通讯。智能终端A将自身的data/misc/wifi/wpa_supplicant.conf文件中的Wi-Fi配置信息、权限信息生成备份文件conf[],通过计算机将所述备份文件conf[]发送给智能终端B,智能终端B使用所述备份conf[]还原本机的data/misc/wifi/wpa_supplicant.conf文件,重启后的智能终端B即可获取所述智能终端A曾经搜索到的Wi-Fi网络以及使用所述智能终端A连接过的Wi-Fi热点连接无线网络。Exemplarily, assume that there is an intelligent terminal A and an intelligent terminal B, both of which are connected to a computer in a wired or wireless manner, and can communicate with the computer. Smart terminal A generates a backup file conf[] from the Wi-Fi configuration information and authority information in its own data/misc/wifi/wpa_supplicant.conf file, and sends the backup file conf[] to smart terminal B through a computer. Terminal B uses the backup conf[] to restore the local data/misc/wifi/wpa_supplicant.conf file, and the restarted smart terminal B can obtain the Wi-Fi network that the smart terminal A once searched and use the described The Wi-Fi hotspot connected to smart terminal A connects to the wireless network.

需要说明的是,所述智能终端均为android设备。通过上述方法,实现了将一台android智能终端的无线网络数据备份还原到任意一台android智能终端上,避免了智能终端上联网设置的繁琐操作。It should be noted that the smart terminals are all android devices. Through the above method, it is realized to restore the wireless network data backup of one android smart terminal to any android smart terminal, avoiding the cumbersome operation of networking settings on the smart terminal.

实施例三Embodiment Three

图3示出了本发明实施例三提供的无线网络数据还原装置,为了便于说明,仅示出了与本发明实施例相关的部分。FIG. 3 shows a device for restoring wireless network data provided by Embodiment 3 of the present invention. For ease of description, only parts related to the embodiment of the present invention are shown.

在本发明实施例中,所述装置用于实现上述实施例一或实施例二所述的无线网络数据还原方法,可以是内置与智能终端的软件单元、硬件单元或者软硬件结合的单元。所述智能终端包括但不限于智能手机、平板电脑、学习机、音乐播放器(比如MP3、MP4等)、PDA智能终端、车载智能终端、可穿戴设备,所述智能终端均可以搜索并连接Wi-Fi热点。In the embodiment of the present invention, the device is used to implement the wireless network data restoration method described in the first or second embodiment above, and may be a built-in software unit, a hardware unit or a unit combined with software and hardware of the smart terminal. The intelligent terminal includes but not limited to smart phones, tablet computers, learning machines, music players (such as MP3, MP4, etc.), PDA intelligent terminals, vehicle-mounted intelligent terminals, wearable devices, and the intelligent terminals can search and connect to Wi-Fi -Fi hotspot.

如图3所示,所述装置包括:As shown in Figure 3, the device includes:

获取模块31,用于当检测到无线网络数据还原指令时,获取第一无线网络配置文件。The obtaining module 31 is configured to obtain the first wireless network configuration file when a wireless network data restoration instruction is detected.

第一读取模块32,用于读取备份文件中的无线网络配置信息,将所述第一无线网络配置文件中的无线网络配置信息修改为所读取的无线网络配置信息。The first reading module 32 is configured to read the wireless network configuration information in the backup file, and modify the wireless network configuration information in the first wireless network configuration file to the read wireless network configuration information.

第二读取模块33,用于读取第二无线网络配置文件中的端口属性信息,将所述第一无线网络配置文件中的端口属性信息修改为所读取的端口属性信息。The second reading module 33 is configured to read the port attribute information in the second wireless network configuration file, and modify the port attribute information in the first wireless network configuration file to the read port attribute information.

第三读取模块34,用于读取备份文件中的权限信息,将所述第一无线网络配置文件中的权限信息修改为所读取的权限信息。The third reading module 34 is configured to read the permission information in the backup file, and modify the permission information in the first wireless network configuration file to the read permission information.

重启模块35,用于在所述第一无线网络配置文件的无线网络配置信息、端口属性信息、权限信息修改完后,重新启动所述智能终端。The restart module 35 is configured to restart the smart terminal after the wireless network configuration information, port attribute information, and authority information of the first wireless network configuration file are modified.

其中,所述无线网络配置信息优选为Wi-Fi配置信息,所述第一无线网络配置文件为data/misc/wifi/wpa_supplicant.conf文件;所述第二无线网络配置文件为data/misc/wifi/p2p_supplicant.conf文件;所述端口属性信息为ctrl-interface属性信息。所述data/misc/wifi/p2p_supplicant.conf文件中包括ctrl-interface属性信息。Wherein, the wireless network configuration information is preferably Wi-Fi configuration information, the first wireless network configuration file is data/misc/wifi/wpa_supplicant.conf file; the second wireless network configuration file is data/misc/wifi /p2p_supplicant.conf file; the port attribute information is ctrl-interface attribute information. The data/misc/wifi/p2p_supplicant.conf file includes ctrl-interface attribute information.

在本发明实施例中,所述第一读取模块32针对第一无线网络配置文件中的每一项Wi-Fi配置属性,逐一查找所述备份文件中所述Wi-Fi配置属性对应的设置值,并将所述第一无线网络配置文件中的每一项Wi-Fi配置属性修改为所述设置值,即将备份文件中的每一项Wi-Fi配置属性的设置值赋值给所述第一无线网络配置文件中对应的Wi-Fi配置属性。In the embodiment of the present invention, the first reading module 32 searches for the settings corresponding to the Wi-Fi configuration attributes in the backup file one by one for each Wi-Fi configuration attribute in the first wireless network configuration file. value, and modify each Wi-Fi configuration attribute in the first wireless network configuration file to the set value, that is, assign the set value of each Wi-Fi configuration attribute in the backup file to the first A corresponding Wi-Fi configuration attribute in a wireless network configuration file.

进一步地,所述备份文件中包括智能终端刷机或恢复出厂设置前第一无线网络配置文件中的Wi-Fi配置信息和权限信息,所述装置还包括:Further, the backup file includes the Wi-Fi configuration information and permission information in the first wireless network configuration file before the smart terminal is flashed or restored to factory settings, and the device also includes:

备份模块36,用于在智能终端刷机或恢复出厂设置前,读取第一无线网络配置文件中的无线网络配置信息和权限信息;将所述无线网络配置信息和权限信息存储至备份文件中。The backup module 36 is used to read the wireless network configuration information and authority information in the first wireless network configuration file before the intelligent terminal is flashed or restored to factory settings; and the wireless network configuration information and authority information are stored in the backup file.

所述获取模块31包括:The acquisition module 31 includes:

判断单元,用于判断智能终端中是否存在第一无线网络配置文件;A judging unit, configured to judge whether the first wireless network configuration file exists in the smart terminal;

获取单元,用于在判断单元的判断结果为是时,获取所述第一无线网络配置文件;an acquiring unit, configured to acquire the first wireless network configuration file when the judging result of the judging unit is yes;

生成单元,用于在判断单元的判断结果为否时,触发无线网络连接功能以生成所述第一无线网络配置文件。A generating unit, configured to trigger a wireless network connection function to generate the first wireless network configuration file when the judging result of the judging unit is negative.

通过上述备份模块36,实现了智能终端在刷机或恢复出厂设置前备份本机可搜索到或者连接过的Wi-Fi网络的配置信息,以在智能终端刷机或恢复出厂设置后通过所述备份文件还原之前所保存的Wi-Fi网络的配置信息,使得智能终端在刷机或者恢复出厂设置后仍能继续使用以前的Wi-Fi热点连接网络,避免了重新设置智能终端的网络连接,极大地提升了用户的体验感。由于刷机或者恢复出厂设置后的智能终端已将刷机或恢复出厂设置前的第一无线网络配置文件清除,若刷机或者恢复出厂设置后的智能终端未连接过Wi-Fi无线网络,其内部可能不存在第一无线网络配置文件,此时,使能化一次Wi-Fi,即触发无线网络连接功能(比如开启智能终端上的无线网络连接功能,不一定连接上网络),通过此方式自动生成所述第一无线网络配置文件,即data/misc/wifi/wpa_supplicant.conf文件。Through the above-mentioned backup module 36, it is realized that the smart terminal backs up the configuration information of the Wi-Fi network that can be searched or connected to the machine before flashing or restoring the factory settings, so that the backup file can be passed after the smart terminal flashes or restores the factory settings. Restore the configuration information of the Wi-Fi network saved before, so that the smart terminal can continue to use the previous Wi-Fi hotspot to connect to the network after flashing or restoring the factory settings, avoiding the need to reset the network connection of the smart terminal, which greatly improves the User experience. Since the smart terminal after flashing or restoring factory settings has cleared the first wireless network configuration file before flashing or restoring factory settings, if the smart terminal after flashing or restoring factory settings has not connected to a Wi-Fi wireless network, its internal There is the first wireless network configuration file. At this time, enabling Wi-Fi once triggers the wireless network connection function (for example, turning on the wireless network connection function on the smart terminal does not necessarily connect to the network). Describe the first wireless network configuration file, that is, the data/misc/wifi/wpa_supplicant.conf file.

作为本发明的另一优选实施例,所述备份文件中包括其他智能终端的第一无线网络配置文件中的无线网络配置信息和权限信息。智能终端根据所述备份文件修改本机的第一无线网络配置文件中的无线网络配置信息和权限信息,以及根据第二无线网络配置文件中的端口属性信息修改本机的第一无线网络配置文件中的端口属性信息,并重新启动;重启后的智能终端即可获取所述其他智能终端曾经搜索到的Wi-Fi网络以及使用所述其他智能终端连接过的Wi-Fi热点连接无线网络。As another preferred embodiment of the present invention, the backup file includes wireless network configuration information and authority information in the first wireless network configuration file of other smart terminals. The smart terminal modifies the wireless network configuration information and authority information in the first wireless network configuration file of the machine according to the backup file, and modifies the first wireless network configuration file of the machine according to the port attribute information in the second wireless network configuration file The port attribute information in and restarted; the restarted smart terminal can obtain the Wi-Fi network that the other smart terminal has searched and use the Wi-Fi hotspot connected to the other smart terminal to connect to the wireless network.

需要说明的是,本发明实施例中的装置可以用于实现上述方法实施例中的全部技术方案,其各个功能模块的功能可以根据上述方法实施例中的方法具体实现,其具体实现过程可参照上述实施例中的相关描述,此处不再赘述。It should be noted that the device in the embodiment of the present invention can be used to realize all the technical solutions in the above method embodiment, and the functions of each functional module can be realized according to the method in the above method embodiment, and the specific implementation process can refer to Relevant descriptions in the foregoing embodiments will not be repeated here.

本发明实施例中,智能终端根据存储的备份文件修改本机的第一无线网络配置文件中的无线网络配置信息和权限信息,以及根据第二无线网络配置文件中的端口属性信息修改本机的第一无线网络配置文件中的端口属性信息,最后重启所述智能终端;在所述备份文件中包含智能终端刷机或者恢复出厂设置前的第一无线网络配置文件中的无线网络配置信息和权限信息时,重启后的智能终端即可使用刷机或恢复出厂设置前的Wi-Fi热点连接网络;所述备份文件中包含其他智能终端的第一无线网络配置文件中的无线网络配置信息和权限信息时,重启后的智能终端则可使用所述其他智能终端连接过的Wi-Fi热点,实现了将一台android智能终端的Wi-Fi配置信息备份还原到任意一台android智能终端上,避免了在智能终端上进行联网设置的繁琐操作,极大地提升了用户的体验感。In the embodiment of the present invention, the smart terminal modifies the wireless network configuration information and authority information in the first wireless network configuration file of the device according to the stored backup file, and modifies the configuration information and authority information of the device according to the port attribute information in the second wireless network configuration file. The port attribute information in the first wireless network configuration file, and finally restart the smart terminal; the backup file includes the wireless network configuration information and authority information in the first wireless network configuration file before the smart terminal is flashed or restored to factory settings , the smart terminal after restarting can use the Wi-Fi hotspot before flashing or restoring factory settings to connect to the network; when the backup file contains the wireless network configuration information and permission information in the first wireless network configuration file of other smart terminals , the smart terminal after restarting can use the Wi-Fi hotspot connected to the other smart terminals, realizing the backup and restoration of the Wi-Fi configuration information of one android smart terminal to any android smart terminal, avoiding The cumbersome operation of networking settings on the smart terminal greatly improves the user experience.

本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明的范围。Those skilled in the art can appreciate that the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed by hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions for each specific application, but such implementation should not be regarded as exceeding the scope of the present invention.

所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working process of the above-described devices and units can refer to the corresponding process in the foregoing method embodiments, and details are not repeated here.

在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed devices and methods may be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or May be integrated into another system, or some features may be ignored, or not implemented. In another point, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.

所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit.

所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。If the functions described above are realized in the form of software function units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the essence of the technical solution of the present invention or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including Several instructions are used to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk and other media that can store program codes. .

以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应所述以权利要求的保护范围为准。The above is only a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Anyone skilled in the art can easily think of changes or substitutions within the technical scope disclosed in the present invention. Should be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims (8)

1.一种无线网络数据还原方法,其特征在于,所述方法包括:1. A wireless network data restoration method, characterized in that the method comprises: 当检测到无线网络数据还原指令时,获取第一无线网络配置文件,所述第一无线网络配置文件包括智能终端所有可搜索到的Wi-Fi配置信息;When the wireless network data restoration instruction is detected, the first wireless network configuration file is obtained, and the first wireless network configuration file includes all searchable Wi-Fi configuration information of the smart terminal; 读取备份文件中的无线网络配置信息,将所述第一无线网络配置文件中的无线网络配置信息修改为所读取的无线网络配置信息;Read the wireless network configuration information in the backup file, and modify the wireless network configuration information in the first wireless network configuration file to the read wireless network configuration information; 读取第二无线网络配置文件中的端口属性信息,将所述第一无线网络配置文件中的端口属性信息修改为所读取的端口属性信息;Read the port attribute information in the second wireless network configuration file, and modify the port attribute information in the first wireless network configuration file to the read port attribute information; 读取备份文件中的权限信息,将所述第一无线网络配置文件中的权限信息修改为所读取的权限信息;Read the permission information in the backup file, and modify the permission information in the first wireless network configuration file to the read permission information; 在所述第一无线网络配置文件的无线网络配置信息、端口属性信息、权限信息修改完后,重新启动智能终端;After the wireless network configuration information, port attribute information, and authority information of the first wireless network configuration file are modified, restart the smart terminal; 在获取第一无线网络配置文件之前,所述方法还包括:Before obtaining the first wireless network configuration file, the method also includes: 在智能终端刷机或恢复出厂设置前,读取第一无线网络配置文件中的无线网络配置信息和权限信息;Before flashing the smart terminal or restoring factory settings, read the wireless network configuration information and permission information in the first wireless network configuration file; 将所述无线网络配置信息和权限信息存储至所述备份文件中,所述备份文件存储在所述智能终端。The wireless network configuration information and authority information are stored in the backup file, and the backup file is stored in the smart terminal. 2.如权利要求1所述的无线网络数据还原方法,其特征在于,所述第一无线网络配置文件为data/misc/wifi/wpa_supplicant.conf文件;2. The wireless network data restoration method according to claim 1, wherein the first wireless network configuration file is a data/misc/wifi/wpa_supplicant.conf file; 所述第二无线网络配置文件为data/misc/wifi/p2p_supplicant.conf文件;The second wireless network configuration file is data/misc/wifi/p2p_supplicant.conf file; 所述端口属性信息为ctrl-interface属性信息。The port attribute information is ctrl-interface attribute information. 3.如权利要求1至2任一项所述的无线网络数据还原方法,其特征在于,所述获取第一无线网络配置文件包括:3. The method for restoring wireless network data according to any one of claims 1 to 2, wherein said obtaining the first wireless network configuration file comprises: 判断智能终端中是否存在第一无线网络配置文件;Judging whether the first wireless network configuration file exists in the smart terminal; 若是,则获取所述第一无线网络配置文件;If yes, then obtain the first wireless network configuration file; 否则,触发无线网络连接功能以生成所述第一无线网络配置文件。Otherwise, trigger a wireless network connection function to generate the first wireless network configuration file. 4.如权利要求2所述的无线网络数据还原方法,其特征在于,所述备份文件中包括其他智能终端的第一无线网络配置文件中的无线网络配置信息和权限信息。4. The method for restoring wireless network data according to claim 2, wherein the backup file includes wireless network configuration information and authority information in the first wireless network configuration file of other smart terminals. 5.一种无线网络数据还原装置,其特征在于,所述装置包括:5. A wireless network data restoration device, characterized in that the device comprises: 获取模块,用于当检测到无线网络数据还原指令时,获取第一无线网络配置文件,所述第一无线网络配置文件包括智能终端所有可搜索到的Wi-Fi配置信息;An acquisition module, configured to acquire a first wireless network configuration file when a wireless network data restoration instruction is detected, the first wireless network configuration file including all searchable Wi-Fi configuration information of the smart terminal; 第一读取模块,用于读取备份文件中的无线网络配置信息,将所述第一无线网络配置文件中的无线网络配置信息修改为所读取的无线网络配置信息;The first reading module is used to read the wireless network configuration information in the backup file, and modify the wireless network configuration information in the first wireless network configuration file to the read wireless network configuration information; 第二读取模块,用于读取第二无线网络配置文件中的端口属性信息,将所述第一无线网络配置文件中的端口属性信息修改为所读取的端口属性信息;The second reading module is used to read the port attribute information in the second wireless network configuration file, and modify the port attribute information in the first wireless network configuration file to the read port attribute information; 第三读取模块,用于读取备份文件中的权限信息,将所述第一无线网络配置文件中的权限信息修改为所读取的权限信息;A third reading module, configured to read the permission information in the backup file, and modify the permission information in the first wireless network configuration file to the read permission information; 重启模块,用于在所述第一无线网络配置文件的无线网络配置信息、端口属性信息、权限信息修改完后,重新启动智能终端;A restart module, configured to restart the smart terminal after the wireless network configuration information, port attribute information, and authority information of the first wireless network configuration file are modified; 备份模块,用于在智能终端刷机或恢复出厂设置前,读取第一无线网络配置文件中的无线网络配置信息和权限信息,将所述无线网络配置信息和权限信息存储至所述备份文件中,所述备份文件存储在所述智能终端。The backup module is used to read the wireless network configuration information and authority information in the first wireless network configuration file before the intelligent terminal is flashed or restored to factory settings, and stores the wireless network configuration information and authority information in the backup file , the backup file is stored in the smart terminal. 6.如权利要求5所述的无线网络数据还原装置,其特征在于,所述第一无线网络配置文件为data/misc/wifi/wpa_supplicant.conf文件;6. The device for restoring wireless network data according to claim 5, wherein the first wireless network configuration file is a data/misc/wifi/wpa_supplicant.conf file; 所述第二无线网络配置文件为data/misc/wifi/p2p_supplicant.conf文件;The second wireless network configuration file is data/misc/wifi/p2p_supplicant.conf file; 所述端口属性信息为ctrl-interface属性信息。The port attribute information is ctrl-interface attribute information. 7.如权利要求5至6任一项所述的无线网络数据还原装置,其特征在于,所述获取模块包括:7. The device for restoring wireless network data according to any one of claims 5 to 6, wherein the acquisition module includes: 判断单元,用于判断智能终端中是否存在第一无线网络配置文件;A judging unit, configured to judge whether the first wireless network configuration file exists in the smart terminal; 获取单元,用于在判断单元的判断结果为是时,获取所述第一无线网络配置文件;an acquiring unit, configured to acquire the first wireless network configuration file when the judging result of the judging unit is yes; 生成单元,用于在判断单元的判断结果为否时,触发无线网络连接功能以生成所述第一无线网络配置文件。A generating unit, configured to trigger a wireless network connection function to generate the first wireless network configuration file when the judging result of the judging unit is negative. 8.如权利要求6所述的无线网络数据还原装置,其特征在于,所述备份文件中包括其他智能终端的第一无线网络配置文件中的无线网络配置信息和权限信息。8. The device for restoring wireless network data according to claim 6, wherein the backup file includes wireless network configuration information and authority information in the first wireless network configuration file of other smart terminals.
CN201510224060.6A 2015-05-05 2015-05-05 Wireless network data restoring method and device Expired - Fee Related CN104796967B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510224060.6A CN104796967B (en) 2015-05-05 2015-05-05 Wireless network data restoring method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510224060.6A CN104796967B (en) 2015-05-05 2015-05-05 Wireless network data restoring method and device

Publications (2)

Publication Number Publication Date
CN104796967A CN104796967A (en) 2015-07-22
CN104796967B true CN104796967B (en) 2018-05-04

Family

ID=53561376

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510224060.6A Expired - Fee Related CN104796967B (en) 2015-05-05 2015-05-05 Wireless network data restoring method and device

Country Status (1)

Country Link
CN (1) CN104796967B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107438186A (en) * 2016-05-25 2017-12-05 中兴通讯股份有限公司 A kind of network backup reconnection method, device and set top box
CN107529206A (en) * 2017-08-30 2017-12-29 四川长虹电器股份有限公司 The backup of Android device Wi Fi passwords and restoration methods
CN107743309A (en) * 2017-10-16 2018-02-27 深圳市汉普电子技术开发有限公司 Processing method, terminal device and the storage medium of wireless cipher data
CN109068342A (en) * 2018-08-20 2018-12-21 河南省通信建设监理有限公司 Automatic monitoring system of mobile wireless network, monitoring method, the information processing terminal

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103533563A (en) * 2013-10-21 2014-01-22 深圳市金立通信设备有限公司 Restoring method and terminal for wireless local area network account number
WO2014071841A1 (en) * 2012-11-09 2014-05-15 小米科技有限责任公司 Method, terminal, server, system, and device for synchronizing wireless network parameters
CN104539497A (en) * 2015-01-30 2015-04-22 小米科技有限责任公司 Network connecting method and device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2014071841A1 (en) * 2012-11-09 2014-05-15 小米科技有限责任公司 Method, terminal, server, system, and device for synchronizing wireless network parameters
CN103533563A (en) * 2013-10-21 2014-01-22 深圳市金立通信设备有限公司 Restoring method and terminal for wireless local area network account number
CN104539497A (en) * 2015-01-30 2015-04-22 小米科技有限责任公司 Network connecting method and device

Also Published As

Publication number Publication date
CN104796967A (en) 2015-07-22

Similar Documents

Publication Publication Date Title
TWI442238B (en) Method, system, and non-transitory machine-readable medium for communicating data between a host and a portable storage device
CN104796967B (en) Wireless network data restoring method and device
CN103488481A (en) Application program control method, terminal equipment and remote control system
WO2018149138A1 (en) Wireless fidelity (wi-fi) connection method and related product
CN104320161A (en) Method and system for rapid Bluetooth pairing
WO2013178048A1 (en) Method and device for generating firmware over-the-air upgrade package
CN106845267B (en) The processing method and mobile terminal of applicating history information
CN103617209B (en) File management method and device for a mobile terminal
CN102436383A (en) Firmware program processing method and equipment
US20160234340A1 (en) Systems and methods for adaptive cloning of mobile devices
CN104636165A (en) Mobile equipment starting method and device
CN111427860A (en) Distributed storage system and data processing method thereof
CN107632872B (en) Desktop layout processing method, user data processing method and device and computer storage medium
CN104573093A (en) A method and device for managing file directories
CN106507501A (en) A bluetooth connection method and device
CN106776908B (en) Data cleaning method and device and terminal
CN102572835B (en) A kind of automatic cut-in method of WLAN (wireless local area network) and device
CN103065096B (en) A kind of data guard method, Apparatus and system
CN104808953A (en) Device and method for controlling data storage and mobile terminal
CN104484211B (en) The method and device of shared image file
CN104063377A (en) Information processing method and electronic equipment using same
CN112948354A (en) Method and device for creating copy cluster, electronic device and storage medium
CN109471756B (en) Data recovery method, device and computer readable storage medium
CN106793015A (en) A wireless fidelity Wi-Fi connection method and mobile terminal
CN106778344A (en) A kind of data permission control method and terminal

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
EXSB Decision made by sipo to initiate substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP03 Change of name, title or address

Address after: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Patentee after: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd.

Address before: Changan town in Guangdong province Dongguan 523841 usha Beach Road No. 18

Patentee before: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd.

CP03 Change of name, title or address
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20180504

CF01 Termination of patent right due to non-payment of annual fee