CN116248341A - RADIUS server authorization method, device and medium - Google Patents
RADIUS server authorization method, device and medium Download PDFInfo
- Publication number
- CN116248341A CN116248341A CN202211685594.5A CN202211685594A CN116248341A CN 116248341 A CN116248341 A CN 116248341A CN 202211685594 A CN202211685594 A CN 202211685594A CN 116248341 A CN116248341 A CN 116248341A
- Authority
- CN
- China
- Prior art keywords
- period
- duration
- time
- preset
- user
- 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.)
- Pending
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/10—Network architectures or network communication protocols for network security for controlling access to devices or network resources
- H04L63/108—Network architectures or network communication protocols for network security for controlling access to devices or network resources when the policy decisions are valid for a limited amount of time
Landscapes
- Engineering & Computer Science (AREA)
- Computer Hardware Design (AREA)
- Computer Security & Cryptography (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
本申请涉及通信领域,尤其涉及一种RADIUS服务器授权方法、装置及介质。该方法包括:基于用户的认证时间与第一授权时长计算用户的预下线时间;判断预下线时间是否处于至少一个预设时段中的忙时段;第一授权时长为系统预配置给用户的授权时长,预设时段包括忙时段和闲时段;若预下线时间没有处于任何预设时段中的忙时段,则将第一授权时长授权给用户;若预下线时间处于第一预设时段中的忙时段,则基于第一预设时段包括的闲时段计算第二授权时长,将第二授权时长与第一授权时长合并后授权给用户;第一预设时段包括在至少一个预设时段中。该方法可以均衡RADIUS服务器负荷。
The present application relates to the communication field, in particular to a RADIUS server authorization method, device and medium. The method includes: calculating the user's pre-offline time based on the user's authentication time and the first authorization period; judging whether the pre-offline time is in a busy period in at least one preset period; the first authorization period is the system pre-configured to the user. Authorization duration, the preset time period includes busy time period and idle time period; if the pre-offline time is not in the busy time period in any preset time period, the first authorization time length is authorized to the user; if the pre-offline time is in the first preset time period In the busy period, the second authorized duration is calculated based on the idle period included in the first preset period, and the second authorized duration is combined with the first authorized duration to be authorized to the user; the first preset period is included in at least one preset period middle. This method can balance the load of RADIUS servers.
Description
技术领域technical field
本申请涉及通信领域,尤其涉及一种RADIUS服务器授权方法、装置及介质。The present application relates to the communication field, and in particular to a RADIUS server authorization method, device and medium.
背景技术Background technique
目前,电信运营商和网络服务提供商所对用户采用的认证方式主要有本地认证、RADIUS认证和不认证;在实际应用中,RADIUS认证的方式应用最为广泛;这种认证方式通过网络附属存储(Network Attached Storage,NAS)获取用户的信息,RASIUS服务器对用户进行认证,并对认证成功的用户发放授权时长。现有技术中RADIUS服务器发放给用户的授权时长,大多为固定值;用户在授权时长消耗完毕后需要重新通过RADIUS服务器进行认证、授权。然而随着用户数量的增加,现有技术中的这种授权方式会导致RADIUS服务器的工作压力不均衡。At present, the authentication methods used by telecom operators and network service providers for users mainly include local authentication, RADIUS authentication and non-authentication; in practical applications, RADIUS authentication is the most widely used; Network Attached Storage (NAS) to obtain user information, the RASIUS server authenticates the user, and issues authorization time to the successfully authenticated user. In the prior art, the authorization period issued by the RADIUS server to the user is mostly a fixed value; the user needs to re-authenticate and authorize through the RADIUS server after the authorization period is exhausted. However, as the number of users increases, this authorization method in the prior art will lead to uneven work pressure on the RADIUS server.
发明内容Contents of the invention
本申请提供一种RADIUS服务器授权方法、装置及介质,用于解决现有技术中RADIUS服务器的工作压力不均衡的问题,能够均衡RADIUS服务器的工作压力。The present application provides a RADIUS server authorization method, device and medium, which are used to solve the problem of unbalanced working pressure of RADIUS servers in the prior art, and can balance the working pressure of RADIUS servers.
为达到上述目的,本申请采用如下技术方案:In order to achieve the above object, the application adopts the following technical solutions:
第一方面,本申请提供一种RADIUS服务器授权方法,该方法包括:基于用户的认证时间与第一授权时长计算用户的预下线时间;In a first aspect, the present application provides a RADIUS server authorization method, the method comprising: calculating the user's pre-logout time based on the user's authentication time and the first authorization duration;
判断预下线时间是否处于至少一个预设时段中的忙时段;第一授权时长为系统预配置给用户的授权时长,预设时段包括忙时段和闲时段;Judging whether the pre-offline time is in a busy period in at least one preset period; the first authorized period is the authorized period preconfigured to the user by the system, and the preset period includes a busy period and an idle period;
若预下线时间没有处于任何预设时段中的忙时段,则将第一授权时长授权给用户;If the pre-offline time is not in the busy period of any preset period, the first authorized duration is authorized to the user;
若预下线时间处于第一预设时段中的忙时段,则基于第一预设时段包括的闲时段计算第二授权时长,将第二授权时长与第一授权时长合并后授权给用户;第一预设时段包括在至少一个预设时段中。If the pre-offline time is in the busy period in the first preset period, then calculate the second authorized duration based on the idle period included in the first preset period, and authorize the user after combining the second authorized duration with the first authorized duration; the second A preset period is included in at least one preset period.
作为本申请第一方面的一种可能的实施方式,基于第一预设时段包括的闲时段计算第二授权时长,包括:As a possible implementation manner of the first aspect of the present application, calculating the second authorized duration based on the idle period included in the first preset period includes:
从闲时段中随机选择时间点,并基于时间点与预下线时间确定第二授权时长。A time point is randomly selected from the idle time period, and the second authorized duration is determined based on the time point and the pre-offline time.
作为本申请第一方面的一种可能的实施方式,基于时间点与预下线时间确定第二授权时长,包括:As a possible implementation of the first aspect of the present application, the second authorization period is determined based on the time point and the pre-offline time, including:
计算时间点到第一预设时间点的时长,得到第一计算时长;Calculate the duration from the time point to the first preset time point to obtain the first calculation duration;
计算预下线时间到第一预设时间点的时长,得到第二计算时长;Calculate the duration from the pre-offline time to the first preset time point to obtain the second calculation duration;
计算预下线时间到第二预设时间点的时长作为第三计算时长;并判断时间点,是否晚于预下线时间处于忙时段的结束时间;Calculate the duration from the pre-offline time to the second preset time point as the third calculation duration; and judge whether the time point is later than the end time of the busy period after the pre-offline time;
若晚于预下线时间处于忙时段的结束时间,则第二授权时长等于第一计算时长减第二计算时长;If it is the end of the busy period later than the pre-offline time, the second authorized duration is equal to the first calculation duration minus the second calculation duration;
若不晚于预下线时间处于忙时段的结束时间,则第二授权时长等于第三计算时长加第一计算时长。If the end time of the busy period is not later than the pre-offline time, the second authorization duration is equal to the third calculation duration plus the first calculation duration.
作为本申请第一方面的一种可能的实施方式,方法还包括:As a possible implementation manner of the first aspect of the present application, the method further includes:
根据RADIUS服务器的历史业务情况以及历史负荷情况中至少一项,得到至少一个预设时段;预设时段中的忙时段的时长小于预设时段中的闲时段的时长。At least one preset time period is obtained according to at least one of historical service conditions and historical load conditions of the RADIUS server; the duration of the busy period in the preset period is shorter than the duration of the idle period in the preset period.
第二方面,本申请提供一种RADIUS服务器授权装置,该装置包括:In a second aspect, the present application provides a RADIUS server authorization device, which includes:
处理单元,用于基于用户的认证时间与第一授权时长计算用户的预下线时间;A processing unit, configured to calculate the user's pre-logout time based on the user's authentication time and the first authorization duration;
处理单元,还用于判断预下线时间是否处于至少一个预设时段中的忙时段;第一授权时长为系统预配置给用户的授权时长,预设时段包括忙时段和闲时段;The processing unit is also used to judge whether the pre-offline time is in a busy period in at least one preset period; the first authorized period is the authorized period preconfigured by the system to the user, and the preset period includes a busy period and an idle period;
通信单元,用于若预下线时间没有处于任何预设时段中的忙时段,则将第一授权时长授权给用户;The communication unit is used to authorize the first authorization duration to the user if the pre-offline time is not in any preset time period during the busy period;
通信单元,还用于若预下线时间处于第一预设时段中的忙时段,则基于第一预设时段包括的闲时段计算第二授权时长,将第二授权时长与第一授权时长合并后授权给用户;第一预设时段包括在至少一个预设时段中。The communication unit is also used to calculate the second authorized time length based on the idle time period included in the first preset time period if the pre-offline time is in the busy time period of the first preset time period, and combine the second authorized time length with the first authorized time length and then authorized to the user; the first preset time period is included in at least one preset time period.
作为本申请第二方面的一种可能的实施方式,基于第一预设时段包括的闲时段计算第二授权时长,包括:As a possible implementation of the second aspect of the present application, calculating the second authorized duration based on the idle period included in the first preset period includes:
从闲时段中随机选择时间点,并基于时间点与预下线时间确定第二授权时长。A time point is randomly selected from the idle time period, and the second authorized duration is determined based on the time point and the pre-offline time.
作为本申请第二方面的一种可能的实施方式,基于时间点与预下线时间确定第二授权时长,包括:As a possible implementation of the second aspect of the present application, the second authorization period is determined based on the time point and the pre-offline time, including:
计算时间点到第一预设时间点的时长,得到第一计算时长;Calculate the duration from the time point to the first preset time point to obtain the first calculation duration;
计算预下线时间到第一预设时间点的时长,得到第二计算时长;Calculate the duration from the pre-offline time to the first preset time point to obtain the second calculation duration;
计算预下线时间到第二预设时间点的时长作为第三计算时长;并判断时间点,是否晚于预下线时间处于忙时段的结束时间;Calculate the duration from the pre-offline time to the second preset time point as the third calculation duration; and judge whether the time point is later than the end time of the busy period after the pre-offline time;
若晚于预下线时间处于忙时段的结束时间,则第二授权时长等于第一计算时长减第二计算时长;If it is the end of the busy period later than the pre-offline time, the second authorized duration is equal to the first calculation duration minus the second calculation duration;
若不晚于预下线时间处于忙时段的结束时间,则第二授权时长等于第三计算时长加第一计算时长。If the end time of the busy period is not later than the pre-offline time, the second authorization duration is equal to the third calculation duration plus the first calculation duration.
作为本申请第二方面的一种可能的实施方式,处理单元,还用于根据RADIUS服务器的历史业务情况以及历史负荷情况中至少一项,得到至少一个预设时段;预设时段中的忙时段的时长小于预设时段中的闲时段的时长。As a possible implementation of the second aspect of the present application, the processing unit is further configured to obtain at least one preset period according to at least one of the historical business conditions and historical load conditions of the RADIUS server; the busy period in the preset period The duration of is less than the duration of the idle time period in the preset time period.
第三方面,本申请提供了一种RADIUS服务器授权装置,该装置包括:处理器和通信接口;通信接口和处理器耦合,处理器用于运行计算机程序或指令,以实现如第一方面和第一方面的任一种可能的实现方式中所描述的RADIUS服务器授权方法。In a third aspect, the present application provides a RADIUS server authorization device, which includes: a processor and a communication interface; the communication interface is coupled to the processor, and the processor is used to run computer programs or instructions to implement the first aspect and the first The RADIUS server authorization method described in any possible implementation manner of the aspect.
第四方面,本申请提供了一种计算机可读存储介质,计算机可读存储介质中存储有指令,当指令在终端上运行时,使得终端执行如第一方面和第一方面的任一种可能的实现方式中描述的RADIUS服务器授权方法。In a fourth aspect, the present application provides a computer-readable storage medium, where instructions are stored in the computer-readable storage medium, and when the instructions are run on the terminal, the terminal is made to execute any one of the possibilities in the first aspect and the first aspect. The RADIUS server authorization method described in Implementation Methods.
第五方面,本申请实施例提供一种包含指令的计算机程序产品,当计算机程序产品在RADIUS服务器授权装置上运行时,使得RADIUS服务器授权装置执行如第一方面和第一方面的任一种可能的实现方式中所描述的RADIUS服务器授权方法。In the fifth aspect, the embodiment of the present application provides a computer program product containing instructions. When the computer program product is run on the RADIUS server authorization device, the RADIUS server authorization device is executed as in any one of the first aspect and the first aspect. Implementation of the RADIUS server authorization method described in .
第六方面,本申请实施例提供一种芯片,芯片包括处理器和通信接口,通信接口和处理器耦合,处理器用于运行计算机程序或指令,以实现如第一方面和第一方面的任一种可能的实现方式中所描述的RADIUS服务器授权方法。In a sixth aspect, an embodiment of the present application provides a chip, the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is used to run computer programs or instructions to implement any one of the first aspect and the first aspect. The RADIUS server authorization method described in a possible implementation.
具体的,本申请实施例中提供的芯片还包括存储器,用于存储计算机程序或指令。Specifically, the chip provided in the embodiment of the present application further includes a memory for storing computer programs or instructions.
本申请所提供的技术方案至少带来以下有益效果:本申请基于预设时段对RADIUS服务器的授权时长进行调整,可以将一部分用户的下线时间调整至RADIUS服务器处理压力比较小的闲时段,可以均衡RADIUS服务器工作压力,合理分配RADIUS服务器的负荷。The technical solution provided by this application brings at least the following beneficial effects: this application adjusts the authorization duration of the RADIUS server based on the preset time period, and can adjust the offline time of some users to the idle time period when the processing pressure of the RADIUS server is relatively small. Balance the working pressure of RADIUS servers and distribute the load of RADIUS servers reasonably.
附图说明Description of drawings
图1为本申请实施例提供的一种AAA系统架构示意图;FIG. 1 is a schematic diagram of an AAA system architecture provided by an embodiment of the present application;
图2为本申请实施例提供的一种RADIUS服务器授权方法的流程示意图;Fig. 2 is a schematic flow chart of a RADIUS server authorization method provided by the embodiment of the present application;
图3为本申请实施例提供的RADIUS服务器历史业务分布图;Fig. 3 is the RADIUS server historical service distribution diagram that the embodiment of the present application provides;
图4位本申请实施例提供的一种RADIUS服务器授权方法示意图;Fig. 4 is a schematic diagram of a RADIUS server authorization method provided by the embodiment of the present application;
图5为本申请实施例提供的一种RADIUS服务器授权装置的结构示意图;FIG. 5 is a schematic structural diagram of a RADIUS server authorization device provided in an embodiment of the present application;
图6为本申请实施例提供的另一种RADIUS服务器授权装置的结构示意图;FIG. 6 is a schematic structural diagram of another RADIUS server authorization device provided in the embodiment of the present application;
图7为本申请实施例提供的一种芯片结构示意图。FIG. 7 is a schematic structural diagram of a chip provided by an embodiment of the present application.
具体实施方式Detailed ways
下面结合附图对本申请实施例提供的RADIUS服务器授权方法及装置进行详细地描述。The RADIUS server authorization method and device provided in the embodiments of the present application will be described in detail below with reference to the accompanying drawings.
本文中术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。The term "and/or" in this article is just an association relationship describing associated objects, which means that there can be three relationships, for example, A and/or B can mean: A exists alone, A and B exist simultaneously, and there exists alone B these three situations.
本申请的说明书以及附图中的术语“第一”和“第二”等是用于区别不同的对象,或者用于区别对同一对象的不同处理,而不是用于描述对象的特定顺序。The terms "first" and "second" in the specification and drawings of the present application are used to distinguish different objects, or to distinguish different processes for the same object, rather than to describe a specific sequence of objects.
此外,本申请的描述中所提到的术语“包括”和“具有”以及它们的任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或单元的过程、方法、系统、产品或设备没有限定于已列出的步骤或单元,而是可选地还包括其他没有列出的步骤或单元,或可选地还包括对于这些过程、方法、产品或设备固有的其它步骤或单元。In addition, the terms "including" and "having" mentioned in the description of the present application and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device comprising a series of steps or units is not limited to the listed steps or units, but optionally also includes other unlisted steps or units, or optionally also includes Other steps or elements inherent to the process, method, product or apparatus are included.
需要说明的是,本申请实施例中,“示例性的”或者“例如”等词用于表示作例子、例证或说明。本申请实施例中被描述为“示例性的”或者“例如”的任何实施例或设计方案不应被解释为比其它实施例或设计方案更优选或更具优势。确切而言,使用“示例性的”或者“例如”等词旨在以具体方式呈现相关概念。It should be noted that, in the embodiments of the present application, words such as "exemplary" or "for example" are used as examples, illustrations or descriptions. Any embodiment or design scheme described as "exemplary" or "for example" in the embodiments of the present application shall not be interpreted as being more preferred or more advantageous than other embodiments or design schemes. Rather, the use of words such as "exemplary" or "such as" is intended to present related concepts in a concrete manner.
以下,对本申请实施例中所涉及的一些相关术语和技术进行解释说明。In the following, some related terms and technologies involved in the embodiments of the present application are explained.
1)、AAA与AAA系统1), AAA and AAA system
AAA是认证(Authentication,A)、授权(Authorization,A)和计费(Accounting,A)的简称,是网络安全中进行访问控制的一种安全管理机制,提供认证、授权和计费三种安全服务。AAA is the abbreviation of authentication (Authentication, A), authorization (Authorization, A) and accounting (Accounting, A). Serve.
具体的,AAA提供的三种安全服务是指:Specifically, the three security services provided by AAA refer to:
认证:是对用户的身份进行验证,判断其是否为合法用户。Authentication: It is to verify the identity of the user to determine whether it is a legitimate user.
授权:是对通过认证的用户,授权其可以使用哪些服务。Authorization: Authorize the authenticated users to use which services.
计费:是记录用户使用网络服务的资源情况,这些信息将作为计费的依据。Billing: It is to record the resources of users using network services, and this information will be used as the basis for billing.
首先,认证部分提供了对用户的认证。整个认证通常是采用用户输入用户名与密码来进行权限审核。认证的原理是每个用户都有一个唯一的权限获得标准。由AAA服务器将用户的标准同数据库中每个用户的标准一一核对。如果符合,那么对用户认证通过。如果不符合,则拒绝提供网络连接。First, the authentication part provides authentication of the user. The entire authentication usually uses the user to enter the user name and password for authority review. The principle of authentication is that each user has a unique permission access standard. The AAA server checks the user's criteria with the criteria of each user in the database one by one. If so, the user authentication is passed. If not, deny the network connection.
其次,用户要通过授权来获得操作相应任务的权限。比如,登录系统后,用户可能会执行一些命令来进行操作。这时,授权过程会检测用户是否拥有执行这些命令的权限。简单而言,授权过程是一系列强迫策略的组合,包括:确定活动的种类或质量、资源或者用户被允许的服务有哪些。授权过程发生在认证上下文中,一旦用户通过了认证,他们也就被授予了相应的权限。Secondly, the user needs to obtain the authority to operate the corresponding task through authorization. For example, after logging in to the system, the user may execute some commands to perform operations. At this point, the authorization process checks whether the user has permission to execute these commands. Simply put, the authorization process is a combination of a series of coercive strategies, including: determining the type or quality of activities, resources, or services that users are allowed to have. The authorization process takes place in an authentication context, and once a user is authenticated, they are granted the appropriate permissions.
最后,计费这一过程将会计算用户在连接过程中消耗的资源数目。这些资源包括连接时间或者用户在连接过程中的收发流量等等。可以根据连接过程的统计日志、用户信息、授权控制、账单、趋势分析、资源利用以及容量计划活动来执行计费过程。Finally, the billing process will count the number of resources consumed by the user during the connection process. These resources include the connection time or the user's sending and receiving traffic during the connection process, and so on. The billing process can be performed based on statistical logs of the connection process, user information, authorization control, billing, trend analysis, resource utilization, and capacity planning activities.
AAA系统即实现AAA功能的系统,具体的在AAA系统上实现认证、授权、计费应用的协议主要包括RADIUS和TACACS+协议,Diameter协议作为新的标准也在逐步推广使用。其中,RADIUS协议内容详见标准RFC2865,RFC 2866。TACACS+在TACACS协议(RFC 1492)基础上进行了功能增强。Diameter协议内容参见RFC 3588,RFC4006。The AAA system is the system that implements the AAA function. The specific protocols for implementing authentication, authorization, and accounting applications on the AAA system mainly include RADIUS and TACACS+ protocols. The Diameter protocol is also being gradually promoted as a new standard. Among them, see the standard RFC2865 and RFC 2866 for the details of the RADIUS protocol. TACACS+ has enhanced functions based on the TACACS protocol (RFC 1492). Refer to RFC 3588 and RFC4006 for the content of the Diameter protocol.
2)、RADIUS与RADIUS服务器2), RADIUS and RADIUS server
RADIUS(Remote Authentication Dial-In User Server,远程认证拨号用户服务)是一种分布式的、C/S架构的信息交互协议,由标准RFC2865,RFC2866定义,能包含网络不受未授权访问的干扰,常应用在既要求较高安全性、又允许远程用户访问的各种网络环境中。RADIUS (Remote Authentication Dial-In User Server, Remote Authentication Dial-In User Server) is a distributed, C/S-structured information exchange protocol, defined by the standards RFC2865 and RFC2866, which can contain the interference of the network from unauthorized access, It is often used in various network environments that require high security and allow remote user access.
RADIUS服务器是一种在网络附属存储(Network Attached Storage,NAS)和共享认证服务器间传输认证、授权和配置信息的协议服务器。RADIUS使用UDP作为其传输协议。此外RADIUS也负责传送网络接入服务器和共享计费服务器间的计费信息。RADIUS的服务器上存放着大量的信息,NAS上无须保存这些信息,而是通过RADUIS协议对这些信息进行访问。这些信息的集中统一的保存,使得管理更加方便,而且更加安全。RADIUS服务器可以作为一个代理,以客户的身份同其他的RADIUS服务器或者其他类型的验证服务器进行通信。用户的漫游通常就是通过RADIUS代理实现的。A RADIUS server is a protocol server that transmits authentication, authorization, and configuration information between Network Attached Storage (NAS) and a shared authentication server. RADIUS uses UDP as its transport protocol. In addition, RADIUS is also responsible for transmitting the accounting information between the network access server and the shared accounting server. A large amount of information is stored on the RADIUS server, and there is no need to save this information on the NAS, but to access the information through the RADUIS protocol. The centralized and unified storage of these information makes management more convenient and safer. A RADIUS server can act as a proxy, communicating with other RADIUS servers or other types of authentication servers in the identity of a client. User roaming is usually realized through RADIUS proxy.
图1公开了一种示例性的AAA系统架构示意图,该系统采用典型的客户端/服务器(Client/Server)结构;包括:多个用户100(图中仅示出了一个)、多个NAS101(图中仅示出了一个)和多个RADIUS服务器102(图中仅示出了一个)。NAS101上运行的AAA程序对用户来讲是服务器端,对RADIUS服务器102而言就是客户端。NAS101负责传输用户信息到指定的RADIUS服务器102,然后根据RADIUS服务器102返回的信息进行相应处理。RADIUS服务器102上存放着大量的信息,包括用户信息、NAS信息、授权属性信息等。需要说明的是,图1仅为本申请可以使用的场景的一种示意图,并不构成对本申请提供的技术方案的适用场景的限定。FIG. 1 discloses a schematic diagram of an exemplary AAA system architecture. The system adopts a typical client/server (Client/Server) structure; including: multiple users 100 (only one is shown in the figure), multiple NAS 101 ( Only one is shown in the figure) and multiple RADIUS servers 102 (only one is shown in the figure). The AAA program running on the
一种示例性的AAA系统的工作模式如下:当用户100想要登陆网络的时候,NAS101会提供一个用户登录的界面要求用户100提供用户信息(用户名和口令),用户100等待认证结果。An exemplary working mode of the AAA system is as follows: when the
NAS101在接收到用户信息之后,向RADIUS服务器102发送一个接入请求包(access-request),包中包含了RADIUS一些相关属性:用户名,用户口令,访问服务器的ID以及访问端口的ID。After receiving user information,
RADIUS服务器102接收到来自NAS的接入请求包(access-request)之后,先验证NAS101的共享密钥与RADIUS服务器所设置的是否一致,用来确定这个NAS101是所属的RADIUS客户端。RADIUS服务器102在检查了NAS101发出的接入请求包正确之后,在用户数据库查询是否有此用户。如果查询用户信息不正确,RADIUS服务器102则会发送一个接入拒绝包(access-reject)给NAS101,NAS101在收到包后,会与拒绝并停止用户100的服务请求,并将用户100给强制退出。After receiving the access-request packet (access-request) from the NAS, the
如果查询用户信息正确,RADIUS服务器102会向NAS101发送一个接入质询包(access-challenge),对用户100的登录请求做进一步的验证,这个验证包括:用户名,用户口令,用户100登录所访问的服务器的IP,用户100登录的物理端口号等。NAS101收到接入质询包(access-request)之后,NAS101会通知用户100要求用户100提供更多的用户信息,并且要求用户100进一步确认登录请求,用户100确认之后,RADIUS服务器102会将两次的请求信息进行对比,然后决定怎么去响应用的请求(发送access-accept,access-reject或者再一次发送access-challenge);当所有的验证条件以及握手都通过时,RADIUS服务器102会将数据库中的用户的配置信息都放在接入接受包(access-accept)中返回给NAS101,NAS101会根据包中的配置信息来对用户100访问网络的能力进行限定。If the query user information is correct, the
当验证与授权完成之后,用户100就可以通过交换机进入网络了,在用户100进入网络的时候,NAS101会向RADIUS服务器102发送一个计费开始请求包(accounting-requeststart),通知RADIUS服务器102开始计费,当用户下网的时候,NAS101会向RADIUS服务器102发送一个计费结束包(accounting-request stop),RADIUS服务器102会根据计费包的信息计算用户100使用网络的相关费用。After the verification and authorization are completed, the
RADIUS服务器102将NAS101上报的用户的身份验证凭据与存储在数据库中的用户凭据进行比较。如果凭据匹配,则用户身份认证成功,并且授予用户访问网络的权限。如果凭据不匹配,则身份认证失败,并且网络访问将被拒绝。如果认证成功,则RADIUS服务器102将通过RADIUS协议对用户下发相应授权,如域名、带宽速率、时长。由NAS执行相应授权属性。其中,RADIUS服务器下发的授权时长是在对用户进行授权时的重要参数,涉及用户上网感知、NAS资源调配、RADIUS服务器处理压力等。用书在授权时长结束后需要重新进行认证、授权、上线。The
目前,现有技术中RADIUS服务器授权时长通常为固定值或者指定范围两种。固定值是RADIUS服务器根据预先配置为用户分配固定时长;指定范围是RADIUS服务器根据用户信息从用户规定最大最小上网时长中随机生成一个时长授权给用户。目前基于固定值的授权时长,在RADIUS服务器中被广泛使用。At present, in the prior art, the authorization duration of the RADIUS server is usually a fixed value or a specified range. The fixed value means that the RADIUS server assigns a fixed duration to the user according to the pre-configuration; the specified range means that the RADIUS server randomly generates a duration from the maximum and minimum Internet duration specified by the user according to the user information and authorizes it to the user. Currently, the authorization duration based on a fixed value is widely used in RADIUS servers.
可见,无论是基于固定值的授权时长还是指定范围的授权时长对于RADIUS服务器来说,都是不可调控的;即RADIUS服务器均无法决定用户何时进行下线业务。随着网络业务的高速发展,上述两种授时方式均存在以下缺点:It can be seen that no matter the authorization duration based on a fixed value or the authorization duration of a specified range is uncontrollable for the RADIUS server; that is, the RADIUS server cannot determine when the user goes offline. With the rapid development of network services, the above two timing methods have the following disadvantages:
1、用户感知较差,对于用户来讲,上述两种方式对用户进行授权,用户均会在业务繁忙的时段因为授权时长到期而超时下线,从而需要重新认证、授权、上线。对于一些对实时性需求比较高的用户来说(如从事直播的用户,从事在线教育的用户),重新认证、授权、上线会严重影响用户的使用体验和使用感受。1. User perception is poor. For users, the above two methods authorize users, and users will go offline when the authorization period expires during busy business hours, so they need to re-authenticate, authorize, and go online. For some users who have high real-time requirements (such as users engaged in live broadcasting, users engaged in online education), re-authentication, authorization, and online will seriously affect the user experience and experience.
2、RADIUS服务器负荷不均衡,对于RADIUS服务器来说,RADIUS服务器的压力主要取决于用户的上网习惯;据统计RADIUS服务器在高峰时段的处理压力高于低谷时段的处理压力40%左右;在高峰时段过高的处理压力会导致RADIUS服务器的效率、性能、寿命均会收到影响。2. The load of the RADIUS server is unbalanced. For the RADIUS server, the pressure on the RADIUS server mainly depends on the user's online habits; according to statistics, the processing pressure of the RADIUS server in peak hours is about 40% higher than that in low hours; Excessive processing pressure will affect the efficiency, performance, and lifespan of the RADIUS server.
为解决上述问题,本申请的首先提供一种RADIUS服务器授权方法,可以提高用户感知,均衡RADIUS服务器负荷。In order to solve the above problems, the present application firstly provides a RADIUS server authorization method, which can improve user perception and balance the load of the RADIUS server.
参考图2,本申请提供一种RADIUS服务器授权方法,该方法包括:With reference to Fig. 2, the application provides a kind of RADIUS server authorizing method, and this method comprises:
S100.基于用户的认证时间与第一授权时长计算用户的预下线时间;S100. Calculate the user's pre-logout time based on the user's authentication time and the first authorization duration;
可以理解的是,在上述认证时间可以为认证开始的时间也可以为认证结束(成功)的时间。例如,在图1所述的AAA架构中,上述认证时间可以为:认证开始的时间,即用户100向NAS101发送用户信息的时间点;也可以为认证结束的时间,即RADIUS服务器102将接入接收包返还给NAS101的时间点。It can be understood that the above authentication time may be the time when the authentication starts or the time when the authentication ends (successfully). For example, in the AAA architecture described in FIG. 1, the above-mentioned authentication time can be: the time when the authentication starts, that is, the time point when the
其中,第一授权时长为系统预配置给用户的授权时长,第一授权时长可以由电信运营商和网络服务提供商根据实际的需要自由设定;可以为固定值的授权时长也可以为指定范围的授权时长。示例性的,作为一种指定范围的授权时长,上述第一授权时长可以为:40-60小时之间的随机数;作为一种固定值的授权时长,上述第一授权时长可以为40小时、50小时或60小时等等,可以由电信运营商和网络服务提供商根据实际的使用需求进行调整。Among them, the first authorization duration is the authorization duration pre-configured by the system to users, and the first authorization duration can be freely set by telecom operators and network service providers according to actual needs; the authorization duration can be a fixed value or a specified range authorization period. Exemplarily, as an authorized duration of a specified range, the above-mentioned first authorized duration may be: a random number between 40-60 hours; as a fixed-value authorized duration, the above-mentioned first authorized duration may be 40 hours, 50 hours or 60 hours, etc., can be adjusted by telecom operators and network service providers according to actual usage needs.
S200.判断预下线时间是否处于至少一个预设时段中的忙时段;S200. Determine whether the pre-offline time is in a busy period in at least one preset period;
上述预设时段中包括:忙时段和闲时段,预设时段可以具有多个也可以具有一个;The above-mentioned preset time period includes: a busy time period and an idle time period, and the preset time period can have multiple or one;
在一种可能的实施方式中,本申请可以根据RADIUS服务器的历史业务情况以及历史负荷情况中至少一项,得到所述至少一个预设时段;其中,所述预设时段中的忙时段的时长小于所述预设时段中的闲时段的时长。具体的参见图3,图3为本申请提供的一个示例性的RADIUS服务器历史业务分布图,图中的横坐标为时段,共24个时段,覆盖了0时0分0秒至23时59分59秒,可以理解的是,图中的00时段即为0时0分0秒至0时59分59秒,图中纵坐标即为业务量。图中可见,图中的历史业务情况可以包括:用户请求下线业务、超时下线业务以及其他业务,其中其他业务包括:Lost-Carrier(线路突发异常,产生下线)、Idle-Timeout(部分设备可能对用户有空闲阈值,超过多长时间的空闲会下线)等。其中用户请求下线业务为用户主动进行下线请求,主动进行下线;超时下线业务为RADIUS服务器将授权时间消耗完毕的用户下线,用户需要重新进行认证、授权、上线的流程。In a possible implementation manner, the present application can obtain the at least one preset time period according to at least one of the historical business conditions and historical load conditions of the RADIUS server; wherein, the duration of the busy period in the preset time period less than the duration of the idle time period in the preset time period. Specifically refer to Fig. 3, Fig. 3 is an exemplary RADIUS server historical service distribution map provided by the present application, the abscissa in the figure is a time period, a total of 24 time periods, covering 0:00:00:00 to 23:59 59 seconds. It can be understood that the 00 time period in the figure is from 0:00:00 to 0:59:59, and the vertical axis in the figure is the business volume. As can be seen in the figure, the historical service conditions in the figure can include: user request offline service, timeout offline service and other services, wherein other services include: Lost-Carrier (the line is suddenly abnormal, resulting in offline), Idle-Timeout ( Some devices may have an idle threshold for the user, and the idle time will go offline after a long time), etc. Among them, the user request offline service refers to the user's initiative to request offline, and the user actively goes offline; the timeout offline service refers to the RADIUS server logging off the user whose authorization time has expired, and the user needs to re-authenticate, authorize, and go online.
可以理解的是,RADIUS服务器的业务情况在实际的应用中是由用户对网络的使用习惯决定的,由于RADIUS服务器的用户量比较大,并且用户相对固定;从宏观上讲,RADIUS服务器用户的习惯也会比较固定,少量用户的更替变换并不会从宏观层面改变该RADIUS服务器的用户习惯。It can be understood that the business situation of the RADIUS server is determined by the user's habit of using the network in actual applications. Since the number of users of the RADIUS server is relatively large and the users are relatively fixed; from a macro perspective, the habits of RADIUS server users It will also be relatively fixed, and the replacement of a small number of users will not change the user habits of the RADIUS server from a macro level.
从图3中可见,业务的峰值集中在08时段和09时段,而01时段、02时段的历史业务比较低。从图3中可知,在上述业务峰值集中的时段,用户请求下线业务均比较繁重。因此本申请可以根据图3示出的历史业务情况得到,第一预设时段;其中。第一预设时段包括,08时段和01时段;其中,第一预设时段中的忙时段包括:08时段;闲时段包括:01时段。It can be seen from Figure 3 that the business peaks are concentrated in the 08 and 09 periods, while the historical business in the 01 and 02 periods is relatively low. It can be seen from FIG. 3 that during the period when the above-mentioned business peaks are concentrated, the user requests to go offline are relatively heavy. Therefore, this application can be obtained according to the historical service situation shown in FIG. 3 , the first preset time period; wherein. The first preset time period includes 08 time period and 01 time period; wherein, the busy time period in the first preset time period includes: 08 time period; the idle time period includes: 01 time period.
同时,从图中可见,在RADIUS服务器的历史业务中,超时下线的业务分布得比较平均,几乎一致;可见,RADIUS服务器所管理的用户中会存在一定数量的用户,这些用户的使用习惯为:在消耗完RADIUS服务器提供的授权时长后,由RADIUS服务器令其下线,并不会主动的进行请求下线的业务。At the same time, it can be seen from the figure that in the historical services of the RADIUS server, the services that log out after timeout are evenly distributed and almost the same; it can be seen that there will be a certain number of users in the users managed by the RADIUS server, and the usage habits of these users are as follows: : After the authorization period provided by the RADIUS server is exhausted, the RADIUS server will make it offline, and will not actively request the offline service.
S300.若预下线时间没有处于任何预设时段中的忙时段,则将第一授权时长授权给用户;S300. If the pre-offline time is not in a busy period in any preset period, authorize the first authorized duration to the user;
S400.若预下线时间处于第一预设时段中的忙时段,则基于第一预设时段包括的闲时段计算第二授权时长,将第二授权时长与第一授权时长合并后授权给用户;第一预设时段包括在至少一个预设时段中。S400. If the pre-offline time is in the busy period of the first preset time period, calculate the second authorized duration based on the idle period included in the first preset period, and authorize the user after combining the second authorized duration with the first authorized duration ; The first preset time period is included in at least one preset time period.
本申请基于预设时段对RADIUS服务器的授权时长进行调整,可以将超时下线业务用户的下线时间调整至RADIUS服务器处理压力比较小的闲时段,可以均衡RADIUS服务器负荷。对于那些实时性需求比较高的用户,使用本申请提供的技术方案可以减少这些用户在忙时段因为授权时长消耗完毕而导致的超时下线,因此可以提高用户的使用体验和使用感受,可以提高用户感知。This application adjusts the authorization time of the RADIUS server based on the preset time period, which can adjust the time of the overtime logout service user to the idle time period when the processing pressure of the RADIUS server is relatively small, and can balance the load of the RADIUS server. For those users with high real-time requirements, using the technical solution provided by this application can reduce the overtime logout of these users due to the exhaustion of authorization time during busy hours, so it can improve the user experience and experience, and improve the user experience. perception.
在一种可能的实施方式中,上述基于第一预设时段包括的闲时段计算第二授权时长,包括:In a possible implementation manner, the calculation of the second authorized duration based on the idle period included in the first preset period includes:
从闲时段中随机选择时间点,并基于时间点与预下线时间确定第二授权时长。A time point is randomly selected from the idle time period, and the second authorized duration is determined based on the time point and the pre-offline time.
在一种可能的实施方式中,上述基于时间点与预下线时间确定第二授权时长,包括:In a possible implementation manner, the above-mentioned determination of the second authorization period based on the time point and the pre-offline time includes:
计算时间点到第一预设时间点的时长,得到第一计算时长;Calculate the duration from the time point to the first preset time point to obtain the first calculation duration;
计算预下线时间到第一预设时间点的时长,得到第二计算时长;Calculate the duration from the pre-offline time to the first preset time point to obtain the second calculation duration;
计算预下线时间到第二预设时间点的时长作为第三计算时长;并判断时间点,是否晚于预下线时间处于忙时段的结束时间;Calculate the duration from the pre-offline time to the second preset time point as the third calculation duration; and judge whether the time point is later than the end time of the busy period after the pre-offline time;
其中,第一预设时间点可以为0时0分0秒,第二预设时间点可以为23时59分59秒。Wherein, the first preset time point may be 0:00:00 seconds, and the second preset time point may be 23:59:59 seconds.
若晚于预下线时间处于忙时段的结束时间,则第二授权时长等于第一计算时长减第二计算时长;If it is the end of the busy period later than the pre-offline time, the second authorized duration is equal to the first calculation duration minus the second calculation duration;
若不晚于预下线时间处于忙时段的结束时间,则第二授权时长等于第三计算时长加第一计算时长。If the end time of the busy period is not later than the pre-offline time, the second authorization duration is equal to the third calculation duration plus the first calculation duration.
在一种可能的实施方式中,方法还包括:In a possible implementation manner, the method also includes:
根据RADIUS服务器的历史业务情况以及历史负荷情况中至少一项,得到至少一个预设时段;预设时段中的忙时段的时长小于预设时段中的闲时段的时长。At least one preset time period is obtained according to at least one of historical service conditions and historical load conditions of the RADIUS server; the duration of the busy period in the preset period is shorter than the duration of the idle period in the preset period.
根据某地区的RADIUS服务器的历史负荷情况得到的预设时段如表1所示:The preset time period obtained according to the historical load of the RADIUS server in a certain area is shown in Table 1:
表1预设时段表Table 1 Preset timetable
参见图4,图4为本申请提供的RADIUS服务器授权方法示意图;从图中可见,若用户A认证成功,得到认证时间;RADIUS服务器根据配置得到用户A的第一授权时长,如认证时间加第一授权时长为08:05:00,判定该时间落入表中的预设时段1中的忙时段,图中为忙时段1;忙时段1所对应的闲时段为闲时段1,如10:00:00~12:00:00。则需要通过闲时段1对应计算第二授权时长。Referring to Fig. 4, Fig. 4 is the schematic diagram of the RADIUS server authorization method provided by the present application; As can be seen from the figure, if user A is successfully authenticated, the authentication time is obtained; the RADIUS server obtains the first authorization duration of user A according to configuration, such as authentication time plus the first An authorized duration is 08:05:00, and it is determined that this time falls into the busy period in the preset period 1 in the table, which is busy period 1 in the figure; the idle period corresponding to busy period 1 is idle period 1, such as 10: 00:00~12:00:00. Then, it is necessary to calculate the second authorized duration corresponding to the idle period 1.
在一种可能的实施方式中,本申请获取闲时段1的闲时开始时间,为10:00:00;并判断闲时开始的时间大于忙时结束时间09:00:00。从闲时段10:00:00~12:00:00中随机抽取一个时间点,如为11:30:00,然后将该时间转为时长(单位秒),即11*3600+30*60+0=41400秒。用户预下线时间为08:05:00,到0点时长(单位秒)为8*3600+5*60+0=29100秒。第二授权时长为41400-29100=12300秒。In a possible implementation manner, the application obtains the start time of idle time of idle period 1, which is 10:00:00; and judges that the start time of idle time is greater than the end time of busy time 09:00:00. Randomly select a time point from the idle time period 10:00:00~12:00:00, such as 11:30:00, and then convert the time into a duration (in seconds), that is, 11*3600+30*60+ 0 = 41400 seconds. The user's pre-logout time is 08:05:00, and the time to 0 o'clock (in seconds) is 8*3600+5*60+0=29100 seconds. The second authorization duration is 41400-29100=12300 seconds.
在另一种可能的实施方式中,本申请在闲时段1中随机选取一个时间点,如为11:30:00,计算该时间点到00:00:00的时长为11*60*60+30*60=41400秒,得到第一计算时长;In another possible implementation, the application randomly selects a time point in idle period 1, such as 11:30:00, and calculates the duration from this time point to 00:00:00 as 11*60*60+ 30*60=41400 seconds, get the first calculation duration;
计算08:05:00到00:00:00的时长为8*3600+5*60+0=29100秒,得到第二计算时长;计算08:05:00到23:59:59的时长为15*60*60+55*60=57300秒,得到第三计算时长;在不考虑日期的24小时制的时间上,随机时间点早于忙时段2的结束时间,因此第二授权时长等于41400-29100=12300秒。Calculate the duration from 08:05:00 to 00:00:00 as 8*3600+5*60+0=29100 seconds to get the second calculation duration; calculate the duration from 08:05:00 to 23:59:59 as 15 *60*60+55*60=57300 seconds, the third calculation duration is obtained; in the 24-hour format regardless of the date, the random time point is earlier than the end time of the busy period 2, so the second authorization duration is equal to 41400- 29100 = 12300 seconds.
如用户B认证成功,获取认证时间,RADIUS服务器根据配置得到用户B的第一授权时长,如认证时间加第一授权时长为21:00:00,判定预下线时间落入表1中的预设时段2中的忙时段,图中以忙时段2示出,在预设时段2中忙时段2对应的闲时段为闲时段2,则本申请可以根据闲时段2计算第二授权时长。If user B is successfully authenticated, the authentication time is obtained. The RADIUS server obtains the first authorization duration of user B according to the configuration. Suppose the busy period in period 2 is shown as busy period 2 in the figure, and the idle period corresponding to busy period 2 in preset period 2 is idle period 2, then the application can calculate the second authorized duration according to idle period 2.
在一种可能的实施方式中,本申请获取闲时段2的开始时间为00:30:00,在不考虑日期时,早于忙时结束时间20:00:00。计算预下线时间21:00:00到当时23:59:59的时长,为23:59:59减21:00:00,即为3*3600=10800秒。从00:30:00~04:30:00中随机抽取一个时间点,例如00:41:55,将该时间转为时长(单位秒),即41*60+55=2515秒。则第二授权时长为:10800+2515=13315秒。In a possible implementation manner, the application acquires that the start time of the idle period 2 is 00:30:00, which is earlier than the end time of the busy hour at 20:00:00 when the date is not considered. Calculate the time from the pre-offline time 21:00:00 to the current 23:59:59, which is 23:59:59 minus 21:00:00, which is 3*3600=10800 seconds. Randomly select a time point from 00:30:00 to 04:30:00, such as 00:41:55, and convert this time into a duration (in seconds), that is, 41*60+55=2515 seconds. Then the second authorization duration is: 10800+2515=13315 seconds.
在另一种可能的实施方式中,本申请在闲时段2中随机选取一个时间点,如为00:41:55,计算该时间点到00:00:00的时长为41*60+55=2515秒,得到第一计算时长;计算21:00:00到00:00:00的时长为21*60*60=75600秒,得到第二计算时长;计算21:00:00到23:59:59的时长为3*3600=10800秒,得到第三计算时长;在不考虑日期的24小时制的时间上,上述随机时间点早于忙时段2的结束时间,因此第二授权时长等于10800+2515=13315秒。In another possible implementation, the application randomly selects a time point in the idle period 2, such as 00:41:55, and calculates the duration from this time point to 00:00:00 as 41*60+55= 2515 seconds to get the first calculation duration; calculate the duration from 21:00:00 to 00:00:00 as 21*60*60=75600 seconds to get the second calculation duration; calculate 21:00:00 to 23:59: The duration of 59 is 3*3600=10800 seconds, and the third calculation duration is obtained; in the 24-hour format regardless of the date, the above random time point is earlier than the end time of busy period 2, so the second authorization duration is equal to 10800+ 2515 = 13315 seconds.
本申请通过分析用户的预下线时间,并基于预下线时间对用户的授权时长进行修改;可以将原本本在忙时段进行超时下线业务的用户,调整至在闲时段进行超时下线业务。根据上述的分析可知,RADIUS服务器处理超时下线的业务分布比较平均,在忙时段与闲时段处理超时下线业务的业务量分布比较均匀;而RADIUS服务器在忙时处理的用户主动下线与其他业务比较繁重,因此本申请通过对RADIUS服务器的授权时间进行调整,让原本在忙时段进行超时下线业务的用户,调整至在闲时段进行超时下线业务,从而将RADIUS服务器在忙时段处理超时下线业务的处理能力,转移给处理主动下线业务和其他业务;基于此,本申请可以减少RADIUS服务器在忙时段处理超时下线业务的业务量,并将这一部分业务量转移至RADIUS服务器压力比较小的闲时,让RADIUS服务器在忙时段主要处理用户从主动下线业务,从而可以均衡RADIUS服务器的压力,可以均衡RADIUS服务器的负荷。This application analyzes the user's pre-offline time and modifies the user's authorization time based on the pre-offline time; users who originally performed overtime offline business during busy periods can be adjusted to overtime offline business during idle periods . According to the above analysis, it can be known that the RADIUS server handles the overtime offline business distribution evenly, and the business volume distribution of the overtime offline business during the busy period and idle time is relatively even; while the RADIUS server handles the user's active offline during busy time and other The business is relatively heavy, so this application adjusts the authorization time of the RADIUS server so that the users who originally performed time-out offline business during the busy period can be adjusted to perform the time-out offline business during the idle time, so that the RADIUS server can process time-out during the busy period. The processing capacity of the offline business is transferred to the active offline business and other businesses; based on this, this application can reduce the business volume of the RADIUS server handling overtime offline business during busy hours, and transfer this part of the business volume to the RADIUS server. During the relatively small idle time, let the RADIUS server mainly handle the user's active offline business during the busy period, so that the pressure on the RADIUS server can be balanced, and the load on the RADIUS server can be balanced.
同时,本申请通过对授权时间的调整,可以减少实时性需求较强的用户在忙时因为授权时间消耗完毕,被RADIUS服务器超时下线,导致用户掉线;同时在忙时,这些实时性需求较强的用户大多在使用网络,掉线会影响用户的使用体验和使用感受,影响这部分用户的用户感知。基于此,本申请可以将这部分实时性较强的用户的超时下线时间调整至闲时段,可以提高用户的使用体验和使用感受,可以提高用户感知。At the same time, through the adjustment of the authorization time, this application can reduce the users with strong real-time requirements when they are busy, because the authorization time is exhausted, and the RADIUS server overtimes the offline, causing the user to go offline; at the same time, these real-time requirements Strong users are mostly using the network, and disconnection will affect the user experience and feeling, and affect the user perception of these users. Based on this, the application can adjust the overtime logout time of these users with strong real-time characteristics to the idle period, which can improve the user's use experience and experience, and can improve user perception.
本申请实施例可以根据上述方法示例对RADIUS服务器授权装置进行功能模块或者功能单元的划分,例如,可以对应各个功能划分各个功能模块或者功能单元,也可以将两个或两个以上的功能集成在一个处理单元中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块或者功能单元的形式实现。其中,本申请实施例中对模块或者单元的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。In the embodiment of the present application, the RADIUS server authorization device can be divided into functional modules or functional units according to the above-mentioned method examples. For example, each functional module or functional unit can be divided corresponding to each function, or two or more than two functions can be integrated. in a processing unit. The above-mentioned integrated modules can be implemented not only in the form of hardware, but also in the form of software function modules or functional units. Wherein, the division of modules or units in the embodiment of the present application is schematic, and is only a logical function division, and there may be another division manner in actual implementation.
如图5所示,为本申请提供一种RADIUS服务器授权装置,该装置包括:As shown in Figure 5, a RADIUS server authorization device is provided for the present application, and the device includes:
处理单元201,用于基于用户的认证时间与第一授权时长计算用户的预下线时间;A processing unit 201, configured to calculate the user's pre-logout time based on the user's authentication time and the first authorization duration;
处理单元201,还用于判断预下线时间是否处于至少一个预设时段中的忙时段;第一授权时长为系统预配置给用户的授权时长,预设时段包括忙时段和闲时段;The processing unit 201 is also used to determine whether the pre-offline time is in a busy period in at least one preset period; the first authorized duration is the authorized duration preconfigured by the system to the user, and the preset period includes a busy period and an idle period;
通信单元202,用于若预下线时间没有处于任何预设时段中的忙时段,则将第一授权时长授权给用户;The communication unit 202 is configured to authorize the first authorized duration to the user if the pre-offline time is not in any preset time period during the busy period;
通信单元202,还用于若预下线时间处于第一预设时段中的忙时段,则基于第一预设时段包括的闲时段计算第二授权时长,将第二授权时长与第一授权时长合并后授权给用户;第一预设时段包括在至少一个预设时段中。The communication unit 202 is also used to calculate the second authorized time length based on the idle time period included in the first preset time period if the pre-offline time is in the busy time period of the first preset time period, and combine the second authorized time length with the first authorized time length Authorized to the user after combination; the first preset time period is included in at least one preset time period.
作为一种可能的实施方式,基于第一预设时段包括的闲时段计算第二授权时长,包括:As a possible implementation manner, calculating the second authorized duration based on the idle period included in the first preset period includes:
从闲时段中随机选择时间点,并基于时间点与预下线时间确定第二授权时长。A time point is randomly selected from the idle time period, and the second authorized duration is determined based on the time point and the pre-offline time.
作为一种可能的实施方式,基于时间点与预下线时间确定第二授权时长,包括:As a possible implementation, the second authorization period is determined based on the time point and the pre-offline time, including:
计算时间点到第一预设时间点的时长,得到第一计算时长;Calculate the duration from the time point to the first preset time point to obtain the first calculation duration;
计算预下线时间到第一预设时间点的时长,得到第二计算时长;Calculate the duration from the pre-offline time to the first preset time point to obtain the second calculation duration;
计算预下线时间到第二预设时间点的时长作为第三计算时长;并判断时间点,是否晚于预下线时间处于忙时段的结束时间;Calculate the duration from the pre-offline time to the second preset time point as the third calculation duration; and judge whether the time point is later than the end time of the busy period after the pre-offline time;
若晚于预下线时间处于忙时段的结束时间,则第二授权时长等于第一计算时长减第二计算时长;If it is the end of the busy period later than the pre-offline time, the second authorized duration is equal to the first calculation duration minus the second calculation duration;
若不晚于预下线时间处于忙时段的结束时间,则第二授权时长等于第三计算时长加第一计算时长。If the end time of the busy period is not later than the pre-offline time, the second authorization duration is equal to the third calculation duration plus the first calculation duration.
作为一种可能的实施方式,处理单元201,还用于根据RADIUS服务器的历史业务情况以及历史负荷情况中至少一项,得到至少一个预设时段;预设时段中的忙时段的时长小于预设时段中的闲时段的时长。As a possible implementation, the processing unit 201 is further configured to obtain at least one preset period according to at least one of the historical business conditions and historical load conditions of the RADIUS server; the duration of the busy period in the preset period is less than the preset The length of the idle slot in the bucket.
在通过硬件实现时,本申请实施例中的通信单元202可以集成在通信接口上,处理单元201可以集成在处理器上。具体实现方式如图6所示。When implemented by hardware, the communication unit 202 in the embodiment of the present application may be integrated on a communication interface, and the processing unit 201 may be integrated on a processor. The specific implementation is shown in Figure 6.
图6示出了上述实施例中所涉及的RADIUS服务器授权装置的又一种可能的结构示意图。该RADIUS服务器授权装置包括:处理器302和通信接口303。处理器302用于对RADIUS服务器授权装置的动作进行控制管理,例如,执行上述处理单元201执行的步骤,和/或用于执行本文所描述的技术的其它过程。通信接口303用于支持RADIUS服务器授权装置与其他网络实体的通信,例如,执行上述通信单元202执行的步骤。RADIUS服务器授权装置还可以包括存储器301和总线304,存储器301用于存储RADIUS服务器授权装置的程序代码和数据。Fig. 6 shows another possible structural diagram of the RADIUS server authorization apparatus involved in the above embodiment. The RADIUS server authorization device includes: a
其中,存储器301可以是RADIUS服务器授权装置中的存储器等,该存储器可以包括易失性存储器,例如随机存取存储器;该存储器也可以包括非易失性存储器,例如只读存储器,快闪存储器,硬盘或固态硬盘;该存储器还可以包括上述种类的存储器的组合。Wherein, the
上述处理器302可以是实现或执行结合本申请公开内容所描述的各种示例性的逻辑方框,模块和电路。该处理器可以是中央处理器,通用处理器,数字信号处理器,专用集成电路,现场可编程门阵列或者其他可编程逻辑器件、晶体管逻辑器件、硬件部件或者其任意组合。其可以实现或执行结合本申请公开内容所描述的各种示例性的逻辑方框,模块和电路。该处理器也可以是实现计算功能的组合,例如包含一个或多个微处理器组合,DSP和微处理器的组合等。The above-mentioned
总线304可以是扩展工业标准结构(Extended Industry StandardArchitecture,EISA)总线等。总线304可以分为地址总线、数据总线、控制总线等。为便于表示,图6中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。The
图7是本申请实施例提供的芯片170的结构示意图。芯片170包括一个或两个以上(包括两个)处理器1710和通信接口1730。FIG. 7 is a schematic structural diagram of a
可选的,该芯片170还包括存储器1740,存储器1740可以包括只读存储器和随机存取存储器,并向处理器1710提供操作指令和数据。存储器1740的一部分还可以包括非易失性随机存取存储器(non-volatile random access memory,NVRAM)。Optionally, the
在一些实施方式中,存储器1740存储了如下的元素,执行模块或者数据结构,或者他们的子集,或者他们的扩展集。In some implementations, the
在本申请实施例中,通过调用存储器1740存储的操作指令(该操作指令可存储在操作系统中),执行相应的操作。In the embodiment of the present application, the corresponding operation is executed by calling the operation instruction stored in the memory 1740 (the operation instruction may be stored in the operating system).
其中,上述处理器1710可以实现或执行结合本申请公开内容所描述的各种示例性的逻辑方框,单元和电路。该处理器可以是中央处理器,通用处理器,数字信号处理器,专用集成电路,现场可编程门阵列或者其他可编程逻辑器件、晶体管逻辑器件、硬件部件或者其任意组合。其可以实现或执行结合本申请公开内容所描述的各种示例性的逻辑方框,单元和电路。所述处理器也可以是实现计算功能的组合,例如包含一个或多个微处理器组合,DSP和微处理器的组合等。Wherein, the above-mentioned
存储器1740可以包括易失性存储器,例如随机存取存储器;该存储器也可以包括非易失性存储器,例如只读存储器,快闪存储器,硬盘或固态硬盘;该存储器还可以包括上述种类的存储器的组合。
总线1720可以是扩展工业标准结构(Extended Industry StandardArchitecture,EISA)总线等。总线1720可以分为地址总线、数据总线、控制总线等。为便于表示,图7中仅用一条线表示,但并不表示仅有一根总线或一种类型的总线。The
通过以上的实施方式的描述,所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Through the description of the above embodiments, those skilled in the art can clearly understand that for the convenience and brevity of the description, only the division of the above-mentioned functional modules is used as an example for illustration. In practical applications, the above-mentioned functions can be allocated according to needs It is completed by different functional modules, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. For the specific working process of the above-described system, device, and unit, reference may be made to the corresponding process in the foregoing method embodiments, and details are not repeated here.
本申请实施例提供一种包含指令的计算机程序产品,当该计算机程序产品在计算机上运行时,使得该计算机执行上述方法实施例中的RADIUS服务器授权方法。An embodiment of the present application provides a computer program product containing instructions, and when the computer program product is run on a computer, the computer is made to execute the RADIUS server authorization method in the above method embodiment.
本申请实施例还提供一种计算机可读存储介质,计算机可读存储介质中存储有指令,当该指令在计算机上运行时,使得该计算机执行上述方法实施例所示的方法流程中的RADIUS服务器授权方法。The embodiment of the present application also provides a computer-readable storage medium, and instructions are stored in the computer-readable storage medium, and when the instructions are run on the computer, the computer is made to execute the RADIUS server in the method flow shown in the above method embodiment authorization method.
其中,计算机可读存储介质,例如可以是但不限于电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子(非穷举的列表)包括:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机存取存储器(Random Access Memory,RAM)、只读存储器(Read-Only Memory,ROM)、可擦式可编程只读存储器(Erasable Programmable Read Only Memory,EPROM)、寄存器、硬盘、光纤、便携式紧凑磁盘只读存储器(Compact Disc Read-Only Memory,CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合、或者本领域熟知的任何其它形式的计算机可读存储介质。一种示例性的存储介质耦合至处理器,从而使处理器能够从该存储介质读取信息,且可向该存储介质写入信息。当然,存储介质也可以是处理器的组成部分。处理器和存储介质可以位于特定用途集成电路(Application Specific Integrated Circuit,ASIC)中。在本申请实施例中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。Wherein, the computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any combination thereof. More specific examples (non-exhaustive list) of computer-readable storage media include: electrical connections with one or more wires, portable computer disks, hard disks, Random Access Memory (RAM), read-only memory (Read-Only Memory, ROM), Erasable Programmable Read-Only Memory (Erasable Programmable Read Only Memory, EPROM), Registers, Hard Disk, Optical Fiber, Portable Compact Disk Read-Only Memory (Compact Disc Read-Only Memory, CD-ROM ), an optical storage device, a magnetic storage device, or any suitable combination of the above, or any other form of computer-readable storage medium known in the art. An exemplary storage medium is coupled to the processor such the processor can read information from, and write information to, the storage medium. Of course, the storage medium may also be a component of the processor. The processor and the storage medium may be located in an application specific integrated circuit (Application Specific Integrated Circuit, ASIC). In the embodiments of the present application, a computer-readable storage medium may be any tangible medium containing or storing a program, and the program may be used by or in combination with an instruction execution system, device or device.
本发明的实施例提供一种包含指令的计算机程序产品,当指令在计算机上运行时,使得计算机执行如图2、图4中所述的RADIUS服务器授权方法。An embodiment of the present invention provides a computer program product containing instructions. When the instructions are run on a computer, the computer is made to execute the RADIUS server authorization method as described in FIG. 2 and FIG. 4 .
由于本发明的实施例中的RADIUS服务器授权装置、计算机可读存储介质、计算机程序产品可以应用于上述方法,因此,其所能获得的技术效果也可参考上述方法实施例,本发明实施例在此不再赘述。Since the RADIUS server authorization device, computer-readable storage medium, and computer program product in the embodiment of the present invention can be applied to the above-mentioned method, therefore, the technical effect that it can obtain can also refer to the above-mentioned method embodiment, the embodiment of the present invention is in This will not be repeated here.
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、设备和方法,可以通过其它的方式实现。例如,以上所描述的设备实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,设备或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed systems, 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 shown 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 application may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit.
以上,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何在本申请揭露的技术范围内的变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应该以权利要求的保护范围为准。The above are only specific implementation methods of this application, but the protection scope of this application is not limited thereto. Any changes or replacements within the technical scope disclosed in this application shall be covered within the protection scope of this application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211685594.5A CN116248341A (en) | 2022-12-27 | 2022-12-27 | RADIUS server authorization method, device and medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211685594.5A CN116248341A (en) | 2022-12-27 | 2022-12-27 | RADIUS server authorization method, device and medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116248341A true CN116248341A (en) | 2023-06-09 |
Family
ID=86625164
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211685594.5A Pending CN116248341A (en) | 2022-12-27 | 2022-12-27 | RADIUS server authorization method, device and medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116248341A (en) |
Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6070243A (en) * | 1997-06-13 | 2000-05-30 | Xylan Corporation | Deterministic user authentication service for communication network |
CN101432717A (en) * | 2006-04-26 | 2009-05-13 | 思科技术公司 | System and method for implementing fast reauthentication |
CN101902721A (en) * | 2010-07-30 | 2010-12-01 | 中国联合网络通信集团有限公司 | A method and device for implementing time-based policy control |
CN105592037A (en) * | 2015-07-10 | 2016-05-18 | 杭州华三通信技术有限公司 | MAC address authentication method and device |
US20160366587A1 (en) * | 2015-06-12 | 2016-12-15 | At&T Intellectual Property I, Lp | Method and apparatus for authentication and identity management of communicating devices |
CN108200039A (en) * | 2017-12-28 | 2018-06-22 | 北京网瑞达科技有限公司 | Unaware authentication and authorization system and method based on dynamic creation temporary account password |
KR20180102983A (en) * | 2017-03-08 | 2018-09-18 | 삼성전자주식회사 | Electronic device and method for controlling a connection of wireless communication thereof |
CN111310130A (en) * | 2020-02-21 | 2020-06-19 | 浙江大华技术股份有限公司 | Authorization authentication processing method, device, storage medium and electronic device |
US20210090080A1 (en) * | 2017-03-08 | 2021-03-25 | Samsung Electronics Co., Ltd. | Electronic device and method for controlling wireless communication connection thereof |
CN114756361A (en) * | 2020-11-23 | 2022-07-15 | 台湾中华电信股份有限公司 | Internet of things device authentication system and method based on edge computing and server thereof |
-
2022
- 2022-12-27 CN CN202211685594.5A patent/CN116248341A/en active Pending
Patent Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6070243A (en) * | 1997-06-13 | 2000-05-30 | Xylan Corporation | Deterministic user authentication service for communication network |
CN101432717A (en) * | 2006-04-26 | 2009-05-13 | 思科技术公司 | System and method for implementing fast reauthentication |
CN101902721A (en) * | 2010-07-30 | 2010-12-01 | 中国联合网络通信集团有限公司 | A method and device for implementing time-based policy control |
US20160366587A1 (en) * | 2015-06-12 | 2016-12-15 | At&T Intellectual Property I, Lp | Method and apparatus for authentication and identity management of communicating devices |
CN105592037A (en) * | 2015-07-10 | 2016-05-18 | 杭州华三通信技术有限公司 | MAC address authentication method and device |
KR20180102983A (en) * | 2017-03-08 | 2018-09-18 | 삼성전자주식회사 | Electronic device and method for controlling a connection of wireless communication thereof |
US20210090080A1 (en) * | 2017-03-08 | 2021-03-25 | Samsung Electronics Co., Ltd. | Electronic device and method for controlling wireless communication connection thereof |
CN108200039A (en) * | 2017-12-28 | 2018-06-22 | 北京网瑞达科技有限公司 | Unaware authentication and authorization system and method based on dynamic creation temporary account password |
CN111310130A (en) * | 2020-02-21 | 2020-06-19 | 浙江大华技术股份有限公司 | Authorization authentication processing method, device, storage medium and electronic device |
CN114756361A (en) * | 2020-11-23 | 2022-07-15 | 台湾中华电信股份有限公司 | Internet of things device authentication system and method based on edge computing and server thereof |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109587187B (en) | Method, device and system for calling network function service | |
CN104580496B (en) | A kind of virtual machine based on locum accesses system and server | |
US6275859B1 (en) | Tree-based reliable multicast system where sessions are established by repair nodes that authenticate receiver nodes presenting participation certificates granted by a central authority | |
US6947725B2 (en) | Mobile authentication system with reduced authentication delay | |
US7653933B2 (en) | System and method of network authentication, authorization and accounting | |
CN1826766B (en) | Method and apparatus for controlling credit-based (prepaid) access to a wireless network | |
US7320032B2 (en) | Methods and structure for reducing resource hogging | |
WO2013002886A1 (en) | Network identity for software-as-a-service authentication | |
CN105518689B (en) | Method and system relating to user authentication for accessing a data network | |
CN110730174A (en) | Network access control method, device, equipment and medium | |
WO2011023050A1 (en) | User online bandwidth adjustment method and remote authentication dial in user service server | |
CN1464682A (en) | Method for implementing broad band pre-payment based on authentication, authorization and charging protocol | |
WO2016188325A1 (en) | Data charging method and apparatus | |
US8326996B2 (en) | Method and apparatus for establishing multiple sessions between a database and a middle-tier client | |
US7558845B2 (en) | Modifying a DHCP configuration for one system according to a request from another system | |
JP6067005B2 (en) | System and method for integrating OpenID into a telecommunications network | |
WO2006058493A1 (en) | A method and system for realizing the domain authentication and network authority authentication | |
CN116248341A (en) | RADIUS server authorization method, device and medium | |
US9232078B1 (en) | Method and system for data usage accounting across multiple communication networks | |
CN106878099B (en) | A traffic management method, terminal device, server and system | |
US7480371B2 (en) | Method and system for billing network access capacities shared between internet service providers | |
JP2003303174A (en) | Terminal authentication method and device | |
WO2009006770A1 (en) | Method of p2p node management | |
CN112600813B (en) | UKEY-based multi-application unified authentication method | |
WO2011127771A1 (en) | Method and system for managing services in broadband network |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |