Disclosure of Invention
The invention provides a method and a system for realizing user data recovery in a wireless AP (access point), which solve the problem that when a user management process exits due to some reasons, how to ensure that the user management process can recover the information of all users after restarting again and the recorded state is accurate, and can also avoid the trouble that the user cannot access network resources for a long time due to system restart.
The invention provides a method for realizing user data recovery in a wireless AP, which comprises the following steps:
s100, monitoring a user management process, and restarting the user management process when the user management process is found to be abnormally quitted;
s200, acquiring and storing user information and data information thereof in a drive user management module, and kicking off the user according to the user information to enable the user management process and the drive user management module to be in a zero-user state;
s300, according to the processing condition of the user re-access process, saving and managing the user state in the user management process, completing the state switching of the user, and loading the saved data information of the user.
The scheme provides a mechanism for recovering the user information flow after the user management process in the wireless AP exits abnormally. In consideration of the characteristic that the information stored in the driver is still in place after the user management process exits, a processing flow is added to the initialization after the user management process is restarted. The user information stored in the drive is read from the drive, and then all users are kicked out, and the drive is also in a zero user information state. Therefore, the user can resend the access process, so that the user management process starts a new user access processing process, and after the user accesses, the original data information of the user obtained before is loaded, thereby ensuring that the user management process can recover the information of all users after being restarted again and the recording state is accurate.
Further, the method also comprises the following steps:
s400, the state and the data of the user are sent to the driving user management module to be stored and updated.
User management processes are typically used to save user state and data. From the time when the user connects the SSID to the time when the network resource can be normally accessed, the user management process updates the state machine of each accessed user and updates the user information driving the user management module, thereby ensuring that the user information can be correctly processed; correspondingly, the driving user management module receives the user management process configuration data of the user mode, saves the forwarding state of the user and the data related to the user, and ensures that the user can access network resources again in a short time.
Further, the step S200 includes the steps of:
s210, initializing the user management process;
s220, reading and storing the user information and the data information thereof stored in the drive user management module;
s230, calling a driving kicking-off command to kick off all users in the user information;
s240 notifies the driver user management module to delete the user entries of all users in the user information.
Further, after the step S230, the method further includes the steps of:
s235, judging whether the number of the read users is larger than a preset number, if so, entering the step S236; otherwise, go to step S240;
s236, all the users are grouped, the number of each group of users does not exceed the preset number, and the user management module is informed to delete the user list items of the users in a grouping mode according to the preset interval time period.
Further, the step S300 includes the steps of:
s310, when the user resends the access application but is not connected to the SSID, newly adding the user in the user management process, setting the user state as an unconnected initial state, and loading the stored data information of the user;
s320, when the user is successfully connected to the SSID which does not enable portal authentication, switching the unconnected initialization state of the user to a connected authenticated state in the user management process;
s330, when the user is successfully connected to the SSID which enables portal authentication, the unconnected uninitialized state of the user is switched to the connected unauthenticated state in the user management process, and when the user passes the portal authentication, the state of the user is updated to the connected authenticated state in the user management process.
The invention also provides a system for realizing user data recovery in the wireless AP, which comprises a user management process module, a driving user management module, a monitoring module, a starting module and an interface module; the user management process module is respectively connected with the monitoring module, the starting module and the interface module, the driving user management module is connected with the interface module, the monitoring module is connected with the starting module, and the monitoring module is connected with the starting module, wherein:
the monitoring module monitors the user management process module, and when the user management process module is found to be abnormally quit, the user management process module is restarted through the starting module;
the user management process module acquires and stores the user information and the data information thereof in the driving user management module through the interface module, and kicks off the user according to the user information so that the user management process module and the driving user management module are both in a zero-user state;
and the user management process module stores and manages the state and the data of the user according to the re-access flow processing condition of the user, completes the state switching of the user and loads the stored data information of the user.
Further, the method also comprises the following steps: the user management process module sends the state and data of the user to the driving user management module for storage and update through the interface module.
Further, the user management process module comprises an initialization unit, a control unit, a storage unit and a kicking unit, wherein the control unit is respectively connected with the initialization unit, the storage unit and the kicking unit, and the control unit is connected with the initialization unit, the storage unit and the kicking unit, wherein:
the initialization unit initializes the user management process module;
the control unit reads the user information and the data information thereof stored in the drive user management module through the interface module and stores the user information and the data information through the storage unit;
the control unit calls a driving kicking-off command, and all users in the user information are kicked off through the kicking-off unit;
and the control unit informs a driving user management module to delete the user table entries of all the users in the user information through the interface module.
Further, the user management process module further includes a judgment unit and a grouping unit respectively connected to the control unit, wherein:
when the control unit calls a driving kicking-off command, the kicking-off of all the users in the user information by the kicking-off unit further comprises:
the judging unit judges whether the number of the read users is larger than a preset number, if so, the grouping unit groups all the users, the number of each group of users does not exceed the preset number, and the control unit informs the driving user management module to delete the user table items of the users in a grouping mode through the interface module according to a preset interval time period; otherwise, the control unit informs a driving user management module to delete the user table entries of all the users in the user information through the interface module.
Furthermore, the user management process module also comprises a setting unit connected with the control unit; wherein:
the user management process module stores and manages the state and data of the user according to the access flow processing condition of the user, and the completion of the state switching of the user comprises the following steps:
when the user resends the access application but is not connected to the SSID, the control unit adds the user, sets the user state to be an unconnected initial state through the setting unit, and loads the data information of the user stored in the storage unit;
when the user is successfully connected to the SSID which does not enable portal authentication, the setting unit switches the unconnected initialization state of the user to the connected authenticated state;
when the user is successfully connected to the SSID enabling portal authentication, the setting unit switches the unconnected non-initialized state of the user to the connected non-authenticated state, and when the user passes portal authentication, the setting unit updates the state of the user to the connected authenticated state.
The scheme provides a mechanism for recovering the user information flow after the user management process in the wireless AP exits abnormally. In consideration of the characteristic that the information stored by the drive module is still in the user management process after the user management process exits, the scheme adds a processing flow in the initialization of the user management process. The user information stored in the drive is read from the drive, and then each user is circulated to kick out the user, so that the user information does not exist in the drive user management module. Therefore, the user can resend the access flow, so that the user management process starts a new user access processing flow, and the user can access the network resource again in a short time. The scheme not only avoids the trouble that the user can not access network resources for a long time due to the system restart, but also can ensure that the user management process can recover the information of all the users and the recording state is accurate after the system restart.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the present invention will be described in further detail with reference to the accompanying drawings, and it is apparent that the described embodiments are only a part of the embodiments of the present invention, not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The embodiment of a method for realizing user data recovery in a wireless AP is shown in FIG. 1, and comprises the following steps:
s100, monitoring a user management process, and restarting the user management process when the user management process is found to be abnormally quitted;
s200, acquiring and storing user information and data information thereof in a drive user management module, and kicking off the user according to the user information to enable the user management process and the drive user management module to be in a zero-user state;
s300, according to the processing condition of the user re-accessing process, saving and managing the user state in the user management process, completing the state switching of the user, and loading the acquired data information of the user.
In step S100 of this embodiment, a process monitoring mechanism is designed, and when it is detected that the user management process exits, the process is restarted immediately. The method can ensure that the network resource can be normally accessed when a new user accesses. And for the user existing in the user management process before the abnormal exit, the process is initialized after the restart, so that the user management process after the restart does not retain the original user information, but the information of the original user is still retained in the driving user management module, and therefore the user data can be recovered by utilizing the information of the original user retained by the driving user. Therefore, in step S200, after the user management process is restarted, a processing flow may be added in the process of the initialization session, that is, the original user information and the data information thereof are obtained from the driving user management module, where the data information includes the internet access time length, the internet access flow rate, and the like after the user authentication is passed. After the information is acquired, the users are kicked out from the user management process, and then the users are deleted by driving the user management module. Therefore, the user will resend the access flow, so that the user management process starts a new user access processing flow, the states of the users are saved and managed in the user management process, and the data information of the users acquired before is reloaded for recovery. And the user management process can recover all user information and record the state accurately after being restarted again.
Preferably, on the basis of the above embodiment, the method further includes the steps of:
s400, the state and the data of the user are sent to the driving user management module to be stored and updated.
The user management process can send the information to the driving user management module while preserving and managing the user state and data, and then the internet access service is completed. Generally, from the time when a user connects to an SSID to the time when the network resources can be normally ranged, a user management process updates a state machine of each accessed user, and updates user information for driving a user management module through a corresponding ioctl interface, so that the user information can be correctly processed. For example, if a user is connected and starts the SSID of the portal authentication function, the user state is switched to the connected authenticated state in the user management process, and then the user management process issues the connected authenticated state of the user to the driver, which drives the user management module to receive the data configured by the user management process, and stores the forwarding state of the user and the related data of the user, thereby ensuring that the user can access the network resources again in a short time. According to the scheme, on one hand, the user management process can be ensured to recover all user information and record the state accurately after being restarted again, and on the other hand, the trouble that the user cannot access network resources for a long time due to system restart is avoided.
Another embodiment of the method of the present invention, as shown in fig. 2, comprises the steps of:
s100, monitoring a user management process, and restarting the user management process when the user management process is found to be abnormally quitted;
s210, initializing the user management process;
s220, reading and storing the user information and the data information thereof stored in the drive user management module;
s230, calling a driving kicking-off command to kick off all users in the user information;
s240 notifies the driver user management module to delete the user entries of all users in the user information.
S300, according to the processing condition of the user re-access process, saving and managing the user state in the user management process, completing the state switching of the user, and loading the saved data information of the user.
In the embodiment, the characteristic that the user information stored in the user management module still exists after the user management process exits is considered, and a processing flow is added in the initialization process of the user management process. The user management process calls the IOCTL interface to read user information stored in the driver from the driver, then circulates each user information, calls a kick command in sequence to kick out the user, and calls the IOCTL interface to inform the driver to delete the user information. Then the user will send the normal access flow again, so as to start the processing of the normal user management process, because the data information of the users is saved before, when the user re-accesses, the data information of the user will be loaded in the user management process, the information of all users will be recovered, and the data is accurate.
Another embodiment of the method of the present invention, in the above embodiments, the step of determining the number of users is added, specifically as shown in fig. 3, including:
s100, monitoring a user management process, and restarting the user management process when the user management process is found to be abnormally quitted;
s210, initializing the user management process;
s220, reading and storing the user information and the data information thereof stored in the drive user management module;
s230, calling a driving kicking-off command to kick off all users in the user information;
s235, judging whether the number of the read users is larger than a preset number, if so, entering the step S236; otherwise, go to step S240;
s236, grouping all users, wherein the number of each group of users does not exceed the preset number, and informing the driving user management module to delete the user table entries of the users in a grouping manner according to the preset interval time period;
s300, according to the processing condition of the user re-accessing process, saving and managing the state of the user in the user management process, completing the state switching of the user, and loading the saved data information of the user;
s400, the state and the data of the user are sent to the driving user management module to be stored and updated.
Through experiments, by the method, after the user management process exits abnormally, after all more than 200 users are kicked away, and when the 200 users are networked almost simultaneously, the system is not blocked, the system runs smoothly, the user access time is very short, the network can be quickly accessed, and the user experience is high. However, in consideration of some extreme cases, if the number of users is very large, if such many users apply for access at the same time, a certain burden is still imposed on the system, and in the present embodiment, corresponding measures are taken for such cases. Specifically, after the user management process exits abnormally, the user management process is restarted and initialized, user information stored in the drive user management module is read through the interface, and after the users and data information thereof are backed up by one copy, a kicking command is called, and the read users are kicked completely in the user management process. After all users are kicked off in the user management process, the user management module is informed to delete the users, and considering that the number of the users is large, and if the users which are not deleted in the user management module can surf the internet, a grouping deletion method can be adopted, so that the burden of a server is reduced, and the internet surfing operation of old users and the internet accessing operation of new users are not influenced. Specifically, the number of users acquired from the driving user management module before is counted, whether the number exceeds a preset number is judged, if yes, the users are grouped, and then the driving user management module is notified according to preset interval time and group distribution to delete the users. For example, there are 575 statistical users, and if 200 users are in one group, the users can be divided into three groups, namely 200 users in group a; group B of 200 users; c group 75 users; if the predetermined interval is 1 minute; then the driving user management module can be informed to delete the group A users firstly, after 1 minute, the driving user management module is informed to delete the group B users, and after one minute, the driving user management module is informed to delete the group C users. Of course, the data can also be grouped and sent to the driving user management module once to inform users to be deleted according to the interval time grouping. The driving subscriber management module deletes a group of subscribers every minute.
In this embodiment, although the group deletion does not affect the internet access of the user, for example, after the group a user is deleted, when the group B and the group C users are not deleted yet, because the group B and the group C users still exist in the driving user management module, the group B and the group C users can continue to access the internet, but in the interval time that the group B and the group C users are not deleted, if the group B and the group C users perform association or logout authentication and other operations, a problem of a flow error may occur, in order to avoid such a situation, in the process of deleting the users in the group, that is, when the old user in the driving user management module is temporarily not deleted, when receiving the operation such as user association or logout authentication and the like, it is determined whether the operated user is the old user according to the backup old user information first, if the user is the old user, the user is immediately removed from the driving user management module, the user is allowed to resend the access flow, so that no flow error occurs. Here, the association operation, for example, the user originally surfs the internet in the 2.4GHz band, is now associated with surfing the internet in the 5GHz band, and such an operation is an association operation. Because the interval time of packet kicking-off is not very long, and the operation probability of associating or cancelling authentication by the old user in the period of time is low, the scheme can not influence the performance of the system, and the experience of the user can not be influenced because the time for re-accessing the user after kicking-off is short.
Preferably, on the basis of any of the above embodiments, the step S300 includes the steps of:
s310, when the user resends the access application but is not connected to the SSID, newly adding the user in the user management process, setting the user state as an unconnected initial state, and loading the stored data information of the user;
s320, when the user is successfully connected to the SSID which does not enable portal authentication, switching the unconnected initialization state of the user to a connected authenticated state in the user management process;
s330, when the user is successfully connected to the SSID which enables portal authentication, the unconnected uninitialized state of the user is switched to the connected unauthenticated state in the user management process, and when the user passes the portal authentication, the state of the user is updated to the connected authenticated state in the user management process.
From the time when the user connects the SSID to the time when the user can normally access the network resource, the user management process of the user mode can update the state machine of each accessed user, and meanwhile, the user information for driving the user management module is updated through a corresponding ioctl interface, so that the user information can be correctly processed. For the original old user, after the user is accessed again, the user is added again in the user management process, the state of the user is set, and then the previous data information is loaded after the old user is added according to the previously stored data information of the original old user, so that the recovery of the user data is completed. For example, the old user a has surfed the internet for 1 hour before the user management process exits abnormally, and the effective duration of the user surfing the internet is only 2 hours, then, after the user management process is restarted, data information such as the time length of the old user A and the time length of the internet access is read in the drive user management module and then is backed up and stored for one copy, then kicking the A and other old users out from the user management process and the drive user management module, then the old user A resends the access flow, the user management process starts a new user access processing flow, the user A is added in the user management process, and setting the state of the mobile terminal according to the access flow condition, and loading the data information of the old user A according to the previously stored data information of the old user, so that the data information of the old user is loaded when the mobile terminal is on the Internet for 1 hour and is updated into the driving user management module. Then the old user a has only 1 hour of internet time left. The data information also includes the internet traffic of the user, the network frequency band previously accessed by the user, and the like.
The user management process is used for managing user states and configurations, and the user management process sets various states in which the user is currently located. In the user management process, the user state mainly includes the following conditions:
if the SSID enables portal functionality, the state machine is set as follows:
when the user is not connected with the SSID, setting the state as an unconnected initial state;
when the user successfully connects the SSID to obtain the IP, setting the state as a connected waiting authentication state;
when the user passes the correct user name and password authentication, the cloud AC sends the corresponding duration to the wireless AP, the user management process sets the state of the user to be connected with the authenticated state, and the user can access network resources later.
If the SSID enables portal functionality, the state machine is set as follows:
when the user is not connected with the SSID, setting the state as an unconnected initial state;
when the user successfully connects the SSID to obtain the IP, the state is set to be the connected state, and meanwhile, the authority of accessing network resources can be obtained;
under normal conditions, from the successful connection of the SSID to the successful authentication of the user, the state machine and the corresponding drive forwarding state stored in the user management process change along with the successful connection, and the information of each user can be checked and seen in the log in the user management process.
A final embodiment of the method of the invention, shown in particular in fig. 4, comprises:
step S501, starting a process monitoring mechanism; step S502, when the abnormal exit of the user management process does not exist, restarting the process; then step S503 is entered, and the original message communication is initialized in the user management process; the processing flow added on the basis of user node information initialization and the like, namely, the step S504 is entered, and the saved user state information is read from the driving user management module; after reading the user information, if the number of the read users is 0, the processing flow directly returns without any processing; if the number of the read users is more than or equal to 1, the step S505 is carried out, the users are circulated in sequence, and a drive kick command is called to kick out all the users; the clientout operation is triggered in the driver kiskout operation, so step S506 is immediately entered to call the ioctl interface to notify the driver user management module to delete all user entries. At this time, the user management module and the driver user management module of the upper application do not store the user information and are in the zero-user state, so in step S507, the user triggers the clientin operation to restart the clientin operation, and finally in step S508, the user management process completes the switching of each user state machine and simultaneously issues the information to the driver to complete the internet service. If the user connects the SSID which does not enable portal, the user management process can directly switch the uninitialized state to the connected authenticated state, and the network resources can be normally accessed. If the user connects the SSID which enables the portal, the user management process can switch the uninitialized state to the connected unauthenticated state, and the purpose of accessing the network resources can be realized through re-authentication again.
The embodiment not only avoids the trouble that the user can not access the network resources for a long time due to the system restart, but also can ensure that the user management process can recover the information of all the users after restarting again and the recording state is accurate.
Based on the same technical concept, the embodiment of the invention also provides a system for realizing user data recovery in the wireless AP, and the system can execute the method embodiment. The system provided by the embodiment of the present invention is shown in fig. 5, and includes a user management process module 30, a driving user management module 50, a monitoring module 10, a starting module 20, and an interface module 40; the user management process module 30 is respectively connected to the monitoring module 10, the starting module 20 and the interface module 40, the driving user management module 50 is connected to the interface module 40, the monitoring module 10 is connected to the starting module 20, wherein:
the monitoring module 10 monitors the user management process module 30, and when the user management process module 30 is found to be abnormally exited, the user management process module 30 is restarted through the starting module 20;
the user management process module 30 obtains and stores the user information and the data information thereof in the driving user management module 50 through the interface module 40, and kicks off the user according to the user information, so that the user management process module 30 and the driving user management module 50 are both in a zero-user state;
the user management process module 30 stores and manages the state and data of the user according to the re-access process handling condition of the user, completes the state switching of the user, and loads the stored data information of the user.
The user management process module 30 stores the states and data of users, when the user management process module 30 exits abnormally, the start module 20 restarts the user management process module 30, and then the user management process module 30 acquires the user data information stored in the driving user management module 50 through the interface module 40, and kicks off the users, so that the user management process module 30 and the driving user management module 50 are both in a zero-user state.
After these users are kicked out, they will resend the access flow, so the user management process module 30 will start a new user access processing flow and load corresponding data information according to the backed-up user data information. In actual operation, if the users are not kicked off, the users are directly added into the user management process module 30 after the user management process module 30 is initialized, the operation is very complicated, the operation is troublesome and easy to make mistakes, the consumed time is long, all the users are kicked off, the access flow is sent again, the flow is simpler, quicker and more convenient, and the new and old users can access the network in a short time. If the data information of the old user is backed up before, the backup data is loaded only after the old user accesses the data information again.
Preferably, on the basis of the above embodiment, the method further includes:
the user management process module 30 sends the status and data of the user to the driving user management module 50 for storage and update through the interface module 40.
Preferably, on the basis of any of the above embodiments, the user management progress module 30 includes an initialization unit 31, a control unit 34, a storage unit 32, and a kicking unit 33, and the control unit 34 is respectively connected to the initialization unit 31, the storage unit 32, and the kicking unit 33, wherein:
the initialization unit 31 initializes the user management process module 30;
the control unit 34 reads the user information and data information thereof stored in the driving user management module 50 through the interface module 40, and stores the user information and data information thereof through the storage unit 32;
the control unit 34 calls a driving kicking-off command, and kicks off all users in the user information through the kicking-off unit 33;
the control unit 34 notifies the driving user management module 50 of deleting the user entries of all users in the user information through the interface module 40.
In the present embodiment, in consideration of the characteristic that the user information stored in the user management module 50 is still maintained after the user management process module 30 exits, a processing flow is added in the initialization of the user management process module 30. The user management process module 30 calls the interface module 40 to read the user information stored in the driver from the driver user management module 50, then cycles for each user, sequentially calls the driver kick-out command to kick out the user, and simultaneously calls the interface module 40 to notify the driver to delete the user information. Then the user will send the normal access flow again, so as to start the normal user management process, and ensure that the user can access the network resource again in a short time. The scheme not only avoids the trouble that the user can not access network resources for a long time due to the system restart, but also can ensure that the user management process can recover the information of all the users and the recording state is accurate after the system restart.
Preferably, on the basis of the above embodiment, the user management process module 30 further includes a judging unit 35 and a grouping unit 36 respectively connected to the control unit 34, wherein:
when the control unit 34 calls a drive kick command, kicking all users in the user information by the kick unit 33 further includes:
the judging unit 35 judges whether the number of the read users is greater than a preset number, if so, the grouping unit 36 groups all the users, the number of each group of users does not exceed the preset number, and according to a preset interval time period, the control unit 34 notifies the driving user management module 50 through the interface module 40 to delete the user table entries of the users in a grouping manner; otherwise, the control unit 34 notifies the driving user management module 50 to delete the user entries of all users in the user information through the interface module 40.
Under the condition that the number of the original users is huge, the method for packet kicking-off in the embodiment is adopted, so that the burden of the server is favorably reduced, and the phenomenon that the performance of the server is influenced by the simultaneous access of a large number of users is avoided. And the packet deletion does not affect the internet access of the new and old users, in addition, the interval time of the packet removal is generally set to be shorter, the probability of the association or cancellation of the authentication of the old user in the interval time is lower, and even if the old user takes the operation of the association or cancellation of the authentication in the interval time, after the user management process module 30 obtains the operation instruction of the user, the user management process module firstly compares the operation instruction with the backup old user information to see whether the operated user is the old user, and if the operation instruction is the old user, the user management process module 50 is immediately notified to delete the old user, so that the old user can resend the access flow without the flow error condition.
Preferably, on the basis of any of the above embodiments, the user management process module 30 further includes a setting unit 37 connected to the control unit 34; wherein:
the user management process module 30 stores and manages the state and data of the user according to the access process processing condition of the user, and completing the state switching of the user includes:
when the user resends the access application but is not yet connected to the SSID, the control unit 34 newly adds the user, sets the user state to be an unconnected initial state through the setting unit 37, and loads the data information of the user stored in the storage unit 32;
when the user is successfully connected to the SSID not enabling portal authentication, the setting unit 37 switches the user's unconnected uninitialized state to a connected authenticated state;
when the user is successfully connected to the SSID enabling portal authentication, the setting unit 37 switches the user's unconnected uninitialized state to a connected unauthenticated state, and when the user passes portal authentication, the setting unit 37 updates the user's state to a connected authenticated state.
Of course, the loaded data information can also be loaded when the old user state is switched to the connected authenticated state, and the operation of the normal flow is not affected.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.