A method, device and electronic device for dynamically adjusting online authentication users
By calculating the activity weight of the authenticated user and dynamically adjusting its status, the problem of the inability to adjust the authenticated user according to the activity level in the prior art is solved, and effective utilization of equipment bandwidth and cost savings are achieved.
Patent Information
- Application Number
- CN202110875416.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-30
- Publication Date
- 2024-11-29
- Estimated Expiration
- 2041-07-30
AI Technical Summary
The existing technology cannot dynamically adjust authenticated users based on activity, resulting in new users being unable to go online when the specification limit is reached, and the quota of users with low activity cannot be dynamically adjusted, wasting equipment bandwidth and resources.
By obtaining the total traffic size and online duration of the authenticated user, calculate the activity weight, and when the maximum online user specification is reached, the user with the lowest activeness will be placed in the cache area, and the new user will be online normally; determine whether to use the change in the activity weight. Force down the cache area user.
It realizes dynamic adjustment of authenticated users based on activity, avoids the situation where new users cannot go online, makes full use of equipment bandwidth, saves costs, and is suitable for situations where the number of user access exceeds the specifications in a small range.
Smart Images

Figure CN113641898B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of online authentication, and in particular to a method, device, electronic device and computer-readable storage medium for dynamically adjusting online authentication users. Background Art
[0002] At present, there are two ways for online users to go online on firewall devices: anonymous identification and authenticated access. Regardless of the access method, the device has specification restrictions. When an authenticated user goes online, if the quota is insufficient, the anonymous user will be deregistered to fill the current specification so that the number of authenticated users on the device reaches the final specification limit. The above technology has the following defects: when a large number of authenticated users go online and the specification is reached, new users will not be able to authenticate and go online. New users can only be authenticated and go online after the timeout. After the authenticated user goes online, the users with low activity and occupying quotas cannot be dynamically adjusted, which wastes the original bandwidth of the device and the resources for monitoring user services. Summary of the invention
[0003] In view of this, it is necessary to provide a method, device, electronic device and computer-readable storage medium for dynamically adjusting the online authentication users, so as to solve the problem in the prior art that the authentication users cannot be dynamically adjusted according to the activity.
[0004] In order to solve the above problem, the present invention provides a method for dynamically adjusting the online authentication of users, comprising:
[0005] Obtain the total traffic volume and online time used by authenticated users;
[0006] Obtaining the activity weight of the authenticated user according to the total traffic size and online time used by the authenticated user;
[0007] Get the maximum online user specification of the firewall device. When a new user applies to go online, if the number of authenticated users is equal to the maximum online user specification, put the corresponding authenticated users into the cache area according to the activity weights of all authenticated users, and allow the new user to go online normally.
[0008] Furthermore, the method for dynamically adjusting the online status of authenticated users also includes determining whether to forcibly log off the authenticated users in the cache area according to changes in activity weights of the authenticated users in the cache area.
[0009] Further, determining whether to forcibly log off the authenticated user in the cache area according to the change in the activity weight of the authenticated user in the cache area specifically includes:
[0010] If the activity weight of the authenticated user in the cache area changes to the minimum activity weight, the authenticated user in the cache area will be forced to log off.
[0011] Furthermore, the total traffic size used by the authenticated user is obtained, including:
[0012] The session generated by the traffic passing through the device is detected. When an authenticated user is detected, the bandwidth statistics of the upstream and downstream traffic of the authenticated user are collected to obtain the total traffic size used by the authenticated user.
[0013] Furthermore, the online time of the authenticated user is obtained, including:
[0014] The session generated by the traffic passing through the device is detected. When an authenticated user is detected, the initial time is obtained, and the difference between the current time and the initial time is used as the online time of the authenticated user.
[0015] Furthermore, according to the total traffic volume and online time used by the authenticated user, the activity weight of the authenticated user is obtained, which specifically includes:
[0016] According to the total traffic size and online time used by the authenticated user, the traffic size level and online time level of the authenticated user are determined respectively, and the traffic size level and online time level are weighted averaged to obtain the activity weight of the authenticated user.
[0017] Furthermore, according to the activity weights of all authenticated users, the corresponding authenticated users are placed in the cache area, specifically including:
[0018] Compare the activity weights of all authenticated users, obtain the authenticated user with the smallest activity weight, and put the authenticated user into the cache.
[0019] The present invention also provides a device for dynamically adjusting the online access of authenticated users, comprising a user data acquisition module, a weight level acquisition module and an online access module;
[0020] The user data acquisition module is used to obtain the total traffic size and online time used by the authenticated user;
[0021] The weight level acquisition module is used to obtain the activity weight of the authenticated user according to the total traffic size and online time used by the authenticated user;
[0022] The online module is used to obtain the maximum online user specification of the firewall device. When a new user applies to go online, if the number of authenticated users is equal to the maximum online user specification, the corresponding authenticated users are placed in the cache area according to the activity weights of all authenticated users, and the new user is brought online normally.
[0023] The present invention also provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the method for dynamically adjusting the online authentication user as described in any of the above technical solutions is implemented.
[0024] The present invention also provides a computer-readable storage medium having a computer program stored thereon, characterized in that when the computer program is executed by a processor, the method for dynamically adjusting the online authentication of users as described in any of the above technical solutions is implemented.
[0025] The beneficial effects of adopting the above embodiment are: by obtaining the total traffic size and online time used by authenticated users; obtaining the activity weight of the authenticated users according to the total traffic size and online time used by the authenticated users; obtaining the maximum online user specification of the firewall device, when a new user applies to go online, if the number of authenticated users is equal to the maximum online user specification, the corresponding authenticated users are placed in the cache area according to the activity weights of all authenticated users, and the new users are allowed to go online normally; the authenticated users can be dynamically adjusted according to the activity. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1 A flow chart of an embodiment of a method for dynamically adjusting online authentication users provided by the present invention;
[0027] Figure 2 A structural block diagram of a device for dynamically adjusting online authentication users provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0028] The preferred embodiments of the present invention are described in detail below in conjunction with the accompanying drawings, wherein the accompanying drawings constitute a part of this application and are used together with the embodiments of the present invention to illustrate the principles of the present invention, but are not used to limit the scope of the present invention.
[0029] A specific embodiment of the present invention discloses a method for dynamically adjusting the online authentication of users, and its flow chart is as follows: Figure 1 Said method comprises:
[0030] Step S1, obtaining the total traffic size and online time used by the authenticated user;
[0031] Step S2: Obtain the activity weight of the authenticated user according to the total traffic size and online time used by the authenticated user;
[0032] Step S3, obtaining the maximum online user specification of the firewall device. When a new user applies to go online, if the number of authenticated users is equal to the maximum online user specification, the corresponding authenticated users are placed in the cache area according to the activity weights of all authenticated users, and the new user is allowed to go online normally.
[0033] As a preferred embodiment, the method for dynamically adjusting the online status of authenticated users further includes determining whether to forcibly log off the authenticated users in the cache area according to changes in activity weights of the authenticated users in the cache area.
[0034] In a specific embodiment, a cache area is set on the firewall device to store authenticated users. The size of the cache area can be allocated according to the current hardware memory ratio, such as 5%. At the same time, a cache specification is set. The cache specification can be allocated according to the hardware model, CPU memory, etc. of the current device to ensure that after the cache is stored, there is still available space in the cache area. By setting the cache area, the authenticated user specification can be expanded.
[0035] As a preferred embodiment, determining whether to forcibly log off the authenticated user in the cache area according to the change in the activity weight of the authenticated user in the cache area specifically includes:
[0036] If the activity weight of the authenticated user in the cache area changes to the minimum activity weight, the authenticated user in the cache area will be forced to log off.
[0037] As a preferred embodiment, obtaining the total traffic size used by the authenticated user specifically includes:
[0038] The session generated by the traffic passing through the device is detected. When an authenticated user is detected, the bandwidth statistics of the upstream and downstream traffic of the authenticated user are collected to obtain the total traffic size used by the authenticated user.
[0039] In a specific embodiment, the session generated by the traffic passing through the device is detected, and the user is detected by the user IP. When an authenticated user is detected, the bandwidth statistics of the upstream and downstream traffic of the authenticated user are performed, and the traffic used by the user during the online period is accumulated to obtain the total traffic size used by the authenticated user.
[0040] As a preferred embodiment, obtaining the online time of the authenticated user specifically includes:
[0041] Detect the sessions generated by traffic passing through the device. When an authenticated user is detected, obtain the initial time and use the difference between the current time and the initial time as the online time of the authenticated user.
[0042] In a specific embodiment, when an authenticated user is detected, the initial time is recorded. If the user stops streaming midway or the session ages, the user is determined to be offline and the user's time is no longer recorded. The user is deleted from the record. After the user comes back online and has traffic, the time is recorded again. The time difference between the current time and the first recorded time after the user comes online is the total online time.
[0043] As a preferred embodiment, obtaining the activity weight of the authenticated user according to the total traffic size and online time used by the authenticated user specifically includes:
[0044] According to the total traffic size and online time used by the authenticated user, the traffic size level and online time level of the authenticated user are determined respectively, and the traffic size level and online time level are weighted averaged to obtain the activity weight of the authenticated user.
[0045] In a specific embodiment, the traffic size level of the authenticated user includes N levels, the traffic size corresponding to the first level is less than or equal to X, the traffic size of the Nth level is greater than Y, and the size of the interval corresponding to the second to N-1 levels is equal; for example, N is 5, X is 0M, and Y is 20M. The size ranges corresponding to the 2nd to 4th levels are (0,5], (5,10], (10,15], (15,20], respectively, where the unit is M.
[0046] The online duration level of authenticated users also includes N levels. The online duration corresponding to the Nth level is less than or equal to t. The first level is the traffic size greater than T. From the second to the N-1 levels, the size of the interval corresponding to each level is equal; for example, N is 5, t is 5s, and T is 45s. The size ranges corresponding to levels 2-4 are (35, 45], (25, 35], (15, 25], and (5, 15], respectively, where the unit is s.
[0047] In another specific embodiment, the traffic size level and online time level of the authenticated user are determined to be divided into the n1th level and the n2th level, then the activity weight W of the authenticated user = q×n1+p×n2, wherein q and p are weight coefficients, the sum of the two is 1, q is greater than 0.5, and p is less than 0.5.
[0048] In specific implementation, the user with the longest online time and a traffic size of 0M is the least active user, and the user with the highest total traffic size is the most active user. Therefore, the minimum traffic size is 0M, and other values can be divided proportionally according to the physical bandwidth of the device or the current total traffic of the device; all time size values are divided proportionally according to the actual situation of the user.
[0049] As a preferred embodiment, according to the activity weights of all authenticated users, corresponding authenticated users are placed in a cache area, specifically including:
[0050] Compare the activity weights of all authenticated users, obtain the authenticated user with the smallest activity weight, and put the authenticated user into the cache.
[0051] In a specific embodiment, the cache specification can be allocated according to the hardware model, CPU memory, etc. of the current device. For example, the allocated online user specification is capcity A, and the actual total number of online users is capcity B. The initial value of capcity B is 0. When a new user comes online, it is compared whether capcity B is less than capcity A. If it is less, the user continues to go online. At this time, the number of capicty B is accumulated and added by 1. When the value of capcity B is equal to capcity A, it is considered that the maximum online user specification of the device is reached. When the specification is reached, the authenticated users are placed in the cache area in order from low to high according to the activity level (it can be one or more users).
[0052] Every time a user is added to the cache area, the level of the user with the highest activity among the original authenticated users will be reduced by 1. This can ensure to a certain extent that the pressure on the device will not be very high after the new user is online. After the cache area reaches the specification, the user with 0 activity will be forced offline. The forced offline will pass the session detection and the session will be aged and deleted according to the IP address corresponding to the user. If there are no users with 0 activity, no more users will be added. When the number of authenticated users in the non-cache area is less than the original authentication specification, the users in the existing cache area will be released in order from high to low activity, and users in the buffer zone can be set to time out and go offline.
[0053] The embodiment of the present invention provides a device for dynamically adjusting the online authentication of users, and its structural block diagram is as follows: Figure 2 As shown, the device for dynamically adjusting the online authentication of users includes a user data acquisition module 1, a weight level acquisition module 2 and an online module 3;
[0054] The user data acquisition module 1 is used to obtain the total traffic size and online time used by the authenticated user;
[0055] The weight level acquisition module 2 is used to obtain the activity weight of the authenticated user according to the total traffic size and online time used by the authenticated user;
[0056] The online module 3 is used to obtain the maximum online user specification of the firewall device. When a new user applies to go online, if the number of authenticated users is equal to the maximum online user specification, the corresponding authenticated users are placed in the cache area according to the activity weights of all authenticated users, and the new user is allowed to go online normally.
[0057] An embodiment of the present invention provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the method for dynamically adjusting the online authentication of users as described in any of the above embodiments is implemented.
[0058] An embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the method for dynamically adjusting the online status of authenticated users as described in any of the above embodiments is implemented.
[0059] A method, device, electronic device and computer-readable storage medium for dynamically adjusting the online access of authenticated users, comprising: obtaining the total traffic size and online duration used by authenticated users; obtaining the activity weight of authenticated users according to the total traffic size and online duration used by the authenticated users; obtaining the maximum online user specification of a firewall device, and when a new user applies to go online, if the number of authenticated users is equal to the maximum online user specification, according to the activity weights of all authenticated users, the corresponding authenticated users are placed in a cache area, and the new users are brought online normally; and authenticated users can be dynamically adjusted according to activity.
[0060] The technical solution of the present invention can expand the specification of authentication users by setting a cache area; by monitoring the authentication users according to the user's activity level, it can avoid a large number of authentication users without traffic going online in a short period of time to occupy quotas and new users being unable to go online, thereby allowing more users to authenticate and access the Internet and fully utilize the bandwidth of the device. The technical solution of the present invention provides a new solution for certain customer scenarios where the number of user accesses exceeds the specification in a small range. When the user does not want to purchase higher-end equipment, the authentication user specifications can be flexibly expanded to meet the usage requirements, which saves costs well.
[0061] Those skilled in the art will appreciate that all or part of the processes of the above-mentioned embodiments can be implemented by instructing related hardware through a computer program, and the program can be stored in a computer-readable storage medium, wherein the computer-readable storage medium is a disk, an optical disk, a read-only storage memory, or a random access memory, etc.
[0062] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by any technician familiar with the technical field within the technical scope disclosed by the present invention should be covered within the protection scope of the present invention.
Claims
1. A method for dynamically adjusting the online access of authenticated users, characterized in that: include: Obtain the total traffic volume and online time used by authenticated users; Obtaining the activity weight of the authenticated user according to the total traffic size and online time used by the authenticated user; Obtain the maximum online user specification of the firewall device. When a new user applies to go online, if the number of authenticated users is equal to the maximum online user specification, put the corresponding authenticated users into the cache area according to the activity weights of all authenticated users, and allow the new user to go online normally. According to the total traffic volume and online time used by the authenticated user, the activity weight of the authenticated user is obtained, which specifically includes: According to the total traffic size and online time used by the authenticated user, determine the traffic size level and online time level of the authenticated user respectively, and perform weighted average of the traffic size level and online time level to obtain the activity weight of the authenticated user; According to the activity weights of all authenticated users, the corresponding authenticated users are placed in the cache area, including: Compare the activity weights of all authenticated users, obtain the authenticated user with the smallest activity weight, and put the authenticated user into the cache.
2. The method for dynamically adjusting the number of authenticated users online according to claim 1, characterized in that: The method also includes determining whether to forcibly log off the authenticated users in the cache area according to changes in activity weights of the authenticated users in the cache area.
3. The method for dynamically adjusting the number of authenticated users online according to claim 2, characterized in that: The step of determining whether to forcibly log off the authenticated user in the cache area according to the change in the activity weight of the authenticated user in the cache area specifically includes: If the activity weight of the authenticated user in the cache area changes to the minimum activity weight, the authenticated user in the cache area will be forced to log off.
4. The method for dynamically adjusting the number of authenticated users online according to claim 1, characterized in that: Get the total traffic used by authenticated users, including: The session generated by the traffic passing through the device is detected. When an authenticated user is detected, the bandwidth statistics of the upstream and downstream traffic of the authenticated user are collected to obtain the total traffic size used by the authenticated user.
5. The method for dynamically adjusting the number of authenticated users online according to claim 1, characterized in that: Get the online time of the authenticated user, including: The session generated by the traffic passing through the device is detected. When an authenticated user is detected, the initial time is obtained, and the difference between the current time and the initial time is used as the online time of the authenticated user.
6. A device for dynamically adjusting the number of authenticated users online, characterized in that: It includes user data acquisition module, weight level acquisition module and online module; The user data acquisition module is used to obtain the total traffic size and online time used by the authenticated user; The weight level acquisition module is used to obtain the activity weight of the authenticated user according to the total traffic size and online time used by the authenticated user; The online module is used to obtain the maximum online user specification of the firewall device. When a new user applies to go online, if the number of authenticated users is equal to the maximum online user specification, the corresponding authenticated users are placed in the cache area according to the activity weights of all authenticated users, and the new user is normally online; According to the total traffic volume and online time used by the authenticated user, the activity weight of the authenticated user is obtained, which specifically includes: According to the total traffic size and online time used by the authenticated user, determine the traffic size level and online time level of the authenticated user respectively, and perform weighted average of the traffic size level and online time level to obtain the activity weight of the authenticated user; According to the activity weights of all authenticated users, the corresponding authenticated users are placed in the cache area, including: Compare the activity weights of all authenticated users, obtain the authenticated user with the smallest activity weight, and put the authenticated user into the cache.
7. An electronic device, characterized in that: It comprises a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the method for dynamically adjusting the online authentication user as described in any one of claims 1-5 is implemented.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by the processor, the method for dynamically adjusting the online authentication user as described in any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Method and device for optimizing network resources
CN103428734A
Access method and device for wireless node STAs (special temporary authority) in wireless local area network (WLAN)
CN106358262A
