Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this application and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It is to be understood that although the terms first, second, third, etc. may be used herein to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present application. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
Next, examples of the present application will be described in detail.
An embodiment of the present application provides a method for restoring a configuration file, where the method is applied to an AC, and as shown in fig. 1, the method may include the following steps:
And S11, when the configuration file of the AC is lost, acquiring the file description information stored by a plurality of designated APs in the APs managed by the AC.
Each piece of file description information is file description information of a current configuration file aiming at the AC, which is received and stored by the corresponding AP, and the file description information stored by each appointed AP at least comprises the file description information which is received by the appointed AP most recently.
And S12, selecting file description information meeting preset conditions from the acquired file description information.
S13, acquiring corresponding configuration files from a plurality of APs in the source APs of the selected file description information;
and S14, determining a configuration file from the acquired configuration files according to the selected file description information, and performing configuration recovery according to the determined configuration file.
It should be noted that, in this embodiment of the present application, the AC may select all APs or a part of APs from the APs managed by the AC as the designated APs, send the initial configuration file and the file description information for the initial configuration file to the designated APs for saving, and subsequently, once the configuration file is changed, the AC further sends the changed configuration file and the file description information for the changed configuration file to the designated APs for saving, so as to be used when configuration needs to be restored later.
Here, each piece of file description information may include time, file size, check value, profile file name, and the like. If the configuration file corresponding to the piece of file description information is the initial configuration file, the time included in the piece of file description information may be the configuration time of the initial configuration file, and the like; if the configuration file corresponding to the piece of file description information is the changed configuration file, the time included in the piece of file description information may be the time when the configuration file before being changed is changed. The check value included in the piece of document description information is obtained by calculating, by the AC, the configuration file corresponding to the piece of document description information according to a preset algorithm, for example, the preset algorithm may be an MD5 information digest algorithm or the like.
For each designated AP, once the configuration file and the corresponding file description information sent by the AC are received, the configuration file and the corresponding file description information received this time are stored, and for the configuration file and the corresponding file description information received before, the configuration file and the corresponding file description information may be selectively discarded according to the storage space condition of the AP, for example, discarded in the order of morning and evening of the receiving time.
That is, the configuration file and the corresponding file description information stored in each designated AP may be the same or different.
Specifically, in step S11, when the configuration file of the AC is lost, the AC may actively send an acquisition request to the multiple designated APs to acquire the file description information saved by the multiple designated APs.
When the configuration file of the AC is lost, if the AC is just re-associated with the AP managed by the AC itself, the AC may not actively send the related acquisition request, and wait to receive the file description information saved by the AC, which is actively sent by a plurality of designated APs. These file description information are sent together when each designated AP reassociates with the AC and actively sends its own configuration file to the AC.
In an embodiment of the present application, each piece of file description information acquired by the AC may be file description information of a corresponding configuration file (i.e., a complete configuration file).
In this case, in the above step S12, the AC may select the file description information satisfying the preset condition by:
and selecting file description information which has the same content and the time closest to the current time from the acquired file description information.
In step S14, the AC may determine a profile by:
And selecting a configuration file from the acquired configuration files, wherein the file size and the check value of the configuration file are the same as those of the selected file description information.
And the check value of each configuration file is obtained by calculating the configuration file by the AC through a preset algorithm.
In addition, in this case, to ensure that the complete profile is saved on the designated AP, the AC also performs the following operational flow:
for each acquired configuration file, if the file size and the check value of the configuration file are not identical to the file size and the check value included in the selected file description information, after the configuration is restored, the determined configuration file is sent to the source AP of the configuration file, so that the source AP of the configuration file replaces the configuration file with the determined configuration file.
In another embodiment of the present application, each piece of file description information acquired by the AC is file description information of a sub-configuration file in a corresponding configuration file.
That is, the AC may divide the complete profile into multiple sub-profiles, with each sub-profile assigned to multiple APs to relieve storage pressure on those APs.
In this case, in the above step S12, the AC may select the file description information satisfying the preset condition by:
grouping the acquired file description information according to the names of the sub-configuration files included in the file description information;
and for each group of file description information, selecting file description information which has the same content and the time closest to the current time from the group of file description information.
In step S13, when the AC acquires the corresponding configuration files from the multiple APs in the source AP of the selected file description information, the specific implementation process is as follows:
and aiming at each selected group of file description information, acquiring corresponding sub-configuration files from a plurality of APs in the source APs of the group of file description information.
In step S14, the AC may determine a profile by:
and aiming at each group of acquired sub-configuration files, selecting a sub-configuration file from the group of sub-configuration files, wherein the file size and the check value of the sub-configuration file are the same as the file size and the check value included in the file description information of the selected group of sub-configuration files. And calculating the check value of each sub-configuration file in the group of sub-configuration files by using a preset algorithm for the AC.
And combining all the selected sub-configuration files to obtain a determined configuration file.
In this case, to ensure that the complete sub-profile is maintained on the designated AP, the AC also performs the following operational flow:
for each acquired sub configuration file in each group of sub configuration files, if the file size and the check value of the sub configuration file are not identical to the file size and the check value included in the file description information of the selected group of sub configuration files, after configuration is restored, the sub configuration file selected from the group of sub configuration files is sent to the source AP of the sub configuration file, so that the source AP of the sub configuration file replaces the sub configuration file.
Further, in the embodiment of the present application, the AC may further perform the following operation flow:
when the configuration file of the AC is not lost, acquiring file description information stored by a designated AP according to an acquisition instruction input by an administrator;
sequencing the acquired file description information stored in the appointed AP according to the sequence of time included in the file description information;
displaying the sequenced file description information to an administrator for selection;
and according to the file description information selected by the administrator, acquiring a corresponding configuration file from the source AP of the selected file description information, and restoring the current configuration file into the acquired configuration file.
That is, the AC may automatically implement a rollback of the configuration file according to the administrator's relevant instructions.
In addition, in the embodiment of the application, in order to ensure that the AC can be timely recovered when the configuration file is lost, the AC may periodically and actively acquire the file description information saved by a specified AP in the managed APs during the normal association process with the managed AP, so as to compare the file description information with the file description information of the current configuration file in time, and send the latest configuration file to the specified AP in time when the comparison is inconsistent.
The above configuration file recovery method is described in detail with reference to specific embodiments.
In wireless networking, assuming that the AC manages the APs 1 to APn, the AC sends the complete configuration file and its corresponding file description information to the APs 1 to APn several times.
When the configuration file of the AC is lost, the AC transmits an acquisition request for acquiring file description information to the APs 1 to APn, respectively.
And the AC receives the acquisition response which is sent by the APs 1 to APn and carries the description information of the respective saved files.
The AC selects file description information which has the same content and comprises the time closest to the current time from the received file description information.
Suppose 95% of the AP sent the file description information closest to the current time, as shown in table one below.
Table one assumes that 5% of the APs send the file description information closest to the current time, as shown in table two below.
Watch two
The AC will use the file description information sent by 95% of the APs as the selected file description information.
Then, the AC randomly selects several APs from 95% of the APs, and acquires configuration files corresponding to config-20200303120000 from the several APs.
And the AC selects a configuration file from the acquired configuration files, wherein the file size and the check value of the configuration file are the same as those of the selected file description information.
Assuming that the size of the acquired configuration file and the check value of the configuration file are both the same as the file size and the check value included in the selected file description information, the AC may randomly select one configuration file.
And finally, carrying out configuration recovery according to the selected configuration file.
According to the technical scheme, in the embodiment of the application, when the configuration file of the AC is lost, the corresponding configuration file can be acquired according to the file description information for the AC stored by the designated AP in each AP, and the configuration recovery is performed according to the acquired configuration file. The whole recovery process does not need manual participation, and the labor cost is saved.
Based on the same inventive concept, the present application further provides a configuration file recovery apparatus, which is applied to an AC, and a schematic structural diagram of the apparatus is shown in fig. 2, and specifically includes:
a first obtainingmodule 21, configured to obtain, when a configuration file of the AC is lost, file description information stored by a plurality of designated APs in each AP managed by the AC, where each piece of file description information is file description information of a current configuration file of the AC, which is received and stored by a corresponding AP and is issued by the AC, and the file description information stored by each designated AP at least includes file description information that is received by the designated AP most recently;
a selecting module 22, configured to select file description information that meets a preset condition from the acquired file description information;
a second obtaining module 23, configured to obtain corresponding configuration files from a plurality of APs in the source AP of the selected file description information;
the first restoringmodule 24 is configured to determine a configuration file from the acquired configuration files according to the selected file description information, and perform configuration restoration according to the determined configuration file.
Preferably, each piece of file description information is file description information of a corresponding configuration file;
The selecting module 22 is specifically configured to:
selecting file description information which has the same content and the time which is closest to the current time from the acquired file description information;
thefirst recovery module 24 is specifically configured to:
and selecting a configuration file from the acquired configuration files, wherein the file size and the check value of the configuration file are the same as those of the selected file description information, and the check value of each configuration file is obtained by calculating the configuration file by the AC through a preset algorithm.
Preferably, the apparatus further comprises:
a first sending module (not shown in fig. 2), configured to, for each obtained configuration file, if the file size and the check value of the configuration file are not identical to the file size and the check value included in the selected file description information, send the determined configuration file to the source AP of the configuration file after configuration is restored, so that the source AP of the configuration file replaces the configuration file with the determined configuration file.
Preferably, each piece of file description information is file description information of a sub-configuration file in a corresponding configuration file;
The selecting module 22 is specifically configured to:
grouping the acquired file description information according to the names of the sub-configuration files included in the file description information;
for each group of file description information, selecting file description information which has the same content and the time which is closest to the current time from the group of file description information;
the second obtaining module 23 is specifically configured to:
aiming at each selected group of file description information, acquiring corresponding sub-configuration files from a plurality of APs in source APs of the group of file description information;
thefirst recovery module 24 is specifically configured to:
for each group of acquired sub-configuration files, selecting a sub-configuration file from the group of sub-configuration files, wherein the file size and the check value of the sub-configuration file are the same as those included in the file description information of the selected group of sub-configuration files, and the check value of each sub-configuration file in the group of sub-configuration files is obtained by calculating the sub-configuration file by the AC through a preset algorithm;
and combining all the selected sub-configuration files to obtain a determined configuration file.
Preferably, the apparatus further comprises:
A second sending module (not shown in fig. 2), configured to, for each acquired sub-configuration file in each set of sub-configuration files, if the file size and the check value of the sub-configuration file are not identical to the file size and the check value included in the file description information of the selected set of sub-configuration files, send the sub-configuration file selected from the set of sub-configuration files to the source AP of the set of sub-configuration files after configuration is restored, so that the source AP of the set of sub-configuration files replaces the set of sub-configuration files.
Preferably, the apparatus further comprises:
a third obtaining module (not shown in fig. 2) configured to, when the configuration file of the AC is not lost, obtain, according to an obtaining instruction input by an administrator, file description information stored by the specified AP;
a sorting module (not shown in fig. 2) configured to sort the acquired file description information according to a sequence of time included in the file description information;
a display module (not shown in fig. 2) for displaying the sorted file description information to the administrator for selection;
a second restoring module (not shown in fig. 2) configured to, according to the file description information selected by the administrator, obtain a corresponding configuration file from the source AP of the selected file description information, and restore the current configuration file to the obtained configuration file.
According to the technical scheme, in the embodiment of the application, when the configuration file of the AC is lost, the corresponding configuration file can be acquired according to the file description information for the AC stored by the designated AP in each AP, and the configuration recovery is performed according to the acquired configuration file. The whole recovery process does not need manual participation, and the labor cost is saved.
An electronic device is further provided in the embodiments of the present application, as shown in fig. 3, including aprocessor 31 and a machine-readable storage medium 32, where the machine-readable storage medium 32 stores machine-executable instructions that can be executed by theprocessor 31, and theprocessor 31 is caused by the machine-executable instructions to: and implementing the steps of the configuration file recovery method.
The machine-readable storage medium may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Alternatively, the machine-readable storage medium may be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.
In yet another embodiment provided by the present application, a computer-readable storage medium is further provided, in which a computer program is stored, and the computer program, when executed by a processor, implements the steps of the above-mentioned profile recovery method.
The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the scope of protection of the present application.