Session control method and device, electronic device, and storage medium
By obtaining and judging the target account information, the processing flow of session establishment request is controlled, ensuring that at most one session establishment request is processed for the same account at the same time, solving the problem of excessive response caused by inaccurate session control in the prior art, and improving the session The accuracy of quantity control and the efficiency of network resources utilization.
Patent Information
- Application Number
- CN202211256687.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-13
- Publication Date
- 2024-12-24
- Estimated Expiration
- 2042-10-13
AI Technical Summary
The prior art cannot effectively avoid the problem of excessive response when establishing a session between the control terminal device and the network access control network element, especially in the case of an account that supports multiple sessions, resulting in delay and accuracy of session establishment requests. Inadequate degree.
By obtaining the target account information in the target session establishment request, we can determine whether there is a session establishment request being processed. If otherwise, the session number threshold and the number of established sessions are obtained. If it is lower than the threshold, a new session is established to ensure that the same account has at most at the same time. A session establishment request is processed to avoid excessive responses caused by multiple requests being processed simultaneously.
Improve the accuracy of session number control, avoid excessive response, ensure that the number of established sessions corresponding to account information is within the supported scope, and improve the effective utilization of network resources.
Smart Images

Figure CN115604340B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a session control method and device, electronic equipment, storage medium, and program product. Background Art
[0002] In order to obtain more network resources, terminal devices usually request to establish multiple sessions with the network access control network element. For example, in order to obtain more broadband resources, broadband multi-dial is performed. However, different accounts support different numbers of sessions. For example, some accounts only support one session, while some accounts support multiple sessions.
[0003] In order to control the number of sessions, in the related art, whether to respond to the session establishment request is usually determined based on whether the time interval of the session establishment requests initiated by the same account is lower than a set value. However, this method is not suitable for accounts that support the establishment of multiple sessions. Alternatively, after receiving the session establishment request, the number of established sessions of the corresponding account can be queried from the association form, and whether to respond to the session establishment request can be determined based on whether the queried number of established sessions exceeds the number of sessions supported by the account. However, there will be a certain delay in the series of processes from determining to respond to the session establishment request to establishing a session based on the session establishment request and updating the relevant information of the established session to the association form. During this period, since the information in the association form has not been updated, all newly received session establishment requests will be responded to, and the time interval for initiating the session establishment request is short (for example, initiating a session establishment request at millisecond intervals within 1 second), resulting in excessive responses to session establishment requests. Summary of the invention
[0004] To solve the above technical problems, the embodiments of the present application provide a session control method and device, an electronic device, a storage medium, and a program product.
[0005] According to one aspect of an embodiment of the present application, a session control method is provided, the method comprising:
[0006] Obtain the target account information contained in the target session establishment request;
[0007] Determining whether the session establishment request being processed includes a session establishment request corresponding to the target account information;
[0008] If not, obtaining the session quantity threshold corresponding to the target account information and the number of established sessions;
[0009] If the number of established sessions corresponding to the target account information is lower than a threshold of the number of sessions corresponding to the target account information, a session corresponding to the target session establishment request is established according to the target account information.
[0010] According to one aspect of an embodiment of the present application, a session control device is provided, the device comprising:
[0011] An acquisition module configured to acquire target account information included in the target session establishment request;
[0012] A determination module configured to determine whether the session establishment request being processed includes a session establishment request corresponding to the target account information;
[0013] a determination module configured to, if no, obtain a session quantity threshold corresponding to the target account information and a quantity of established sessions;
[0014] The establishing module is configured to establish a session corresponding to the target session establishment request according to the target account information if the number of established sessions corresponding to the target account information is lower than a session number threshold corresponding to the target account information.
[0015] According to one aspect of an embodiment of the present application, there is provided an electronic device, including:
[0016] one or more processors;
[0017] A storage device is used to store one or more programs, and when the one or more programs are executed by the one or more processors, the electronic device implements the session control method as described above.
[0018] According to one aspect of an embodiment of the present application, a computer-readable storage medium is provided, on which computer-readable instructions are stored. When the computer-readable instructions are executed by a processor of an electronic device, the electronic device executes the session control method as described above.
[0019] According to one aspect of an embodiment of the present application, a computer program product is provided, including a computer program, wherein when the computer instructions are executed by a processor, the session control method as described above is implemented.
[0020] In the technical solution provided by the embodiment of the present application, the target account information included in the target session establishment request is first obtained; then, it is determined whether the session establishment request being processed includes the session establishment request corresponding to the target account information; if not, the session number threshold value and the number of established sessions corresponding to the target account information are obtained; if the number of established sessions corresponding to the target account information is lower than the session number threshold value corresponding to the target account information, the session corresponding to the target session establishment request is established according to the target account information, that is, only when there is no session establishment request being processed corresponding to the target account information, the subsequent processing is performed, so as to ensure that at most only one session establishment request for the same account is being processed at the same time, and avoid the problem of excessive response caused by simultaneous processing of multiple session establishment requests for the same account; then, under the condition that there is no session establishment request being processed corresponding to the target account information, the session number threshold value and the number of established sessions corresponding to the target account information are first obtained, and if the number of established sessions corresponding to the target account information is lower than the session number threshold value, the session corresponding to the target session establishment request is established according to the target account information, so as to ensure that the number of established sessions corresponding to the account information is within the range of the number of sessions supported by the account information, and improve the accuracy of session number control.
[0021] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present application, and together with the specification, are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work. In the drawings:
[0023] Figure 1 is a flow chart of a session control method shown in an exemplary embodiment of the present application;
[0024] Figure 2 yes Figure 1 Step S120 is shown in a flow chart of an exemplary embodiment;
[0025] Figure 3 yes Figure 1 Step S130 is shown in a flow chart of an exemplary embodiment;
[0026] Figure 4 is a flow chart of a session control method shown in another exemplary embodiment of the present application;
[0027] Figure 5is a flow chart of a session control method shown in another exemplary embodiment of the present application;
[0028] Figure 6 is a flow chart of a session control method shown in another exemplary embodiment of the present application;
[0029] Figure 7 is a processing flow chart of an AAA system shown in an exemplary embodiment of the present application;
[0030] Figure 8 is a timing diagram of a processing flow showing an exemplary embodiment of the present application;
[0031] Fig. 9 is a processing flow timing diagram showing another exemplary embodiment of the present application;
[0032] Fig.10 is a structural diagram of a session control device shown in an exemplary embodiment of the present application;
[0033] Fig.11 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown. DETAILED DESCRIPTION
[0034] Here, exemplary embodiments will be described in detail, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are only examples of devices and methods consistent with some aspects of the present application as detailed in the attached claims.
[0035] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0036] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.
[0037] It should also be noted that the "multiple" mentioned in this application refers to two or more than two. "And / or" describes the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship.
[0038] In order to obtain more network resources, terminal devices usually request to establish multiple sessions with the network access control network element. For example, in order to obtain more broadband resources, broadband multi-dial is performed. However, different accounts support different numbers of sessions. For example, some accounts only support one session, while some accounts support multiple sessions.
[0039] In order to control the number of sessions, in the related technology, it is usually determined whether to respond to the session establishment request based on whether the time interval of the session establishment request initiated by the same account is lower than the set value. However, this method is not suitable for accounts that support the establishment of multiple sessions; or, after receiving the session establishment request, the number of established sessions of the corresponding account can be queried from the association form, and whether to respond to the session establishment request can be determined based on whether the number of established sessions queried exceeds the number of sessions supported by the account. However, there is a certain delay in the series of processes from determining to respond to the session establishment request to establishing a session based on the session establishment request and updating the relevant information of the established session to the association form. During this period, since the information in the association form has not been updated, all newly received session establishment requests will be responded to, and the time interval for initiating the session establishment request is short, resulting in excessive response to the session establishment request. Based on this, the embodiments of the present application propose a session control method and device, electronic device, storage medium, and program product, so as to improve the accuracy of session quantity control.
[0040] See also Figure 1 , Figure 1 FIG. 1 is a flow chart of a session control method shown in an exemplary embodiment of the present application. Figure 1 As shown, in an exemplary embodiment, the session control method may include steps S110 to S140, which are described in detail as follows:
[0041] Step S110: obtaining target account information included in the target session establishment request.
[0042] It should be noted that the session establishment request is used to request the establishment of a session, so as to access the network and communicate through the established session. The session establishment request can be a request initiated by a terminal device to establish a session, or it can be a request for authentication, authorization, etc. generated based on a request initiated by a terminal device, so as to establish a session after the authentication, authorization, etc. are successful. Of course, it can also be other requests for requesting the establishment of a session. The session establishment request can include the account information of the corresponding terminal device for identity identification or identity authentication, wherein the account information includes but is not limited to the user name, user identification number, etc. The session establishment request can also include parameters such as the password corresponding to the account information and the identification information of the terminal device (for example, the physical address, IP address, etc.).
[0043] The target session establishment request refers to the received session establishment request to be processed, and the target account information refers to the account information included in the target session establishment request.
[0044] When a terminal device needs to access the network, it can initiate a request to establish a session, and the session control device obtains the target account information contained in the target session establishment request. The session control device is used to process the session establishment request, and the processing method includes but is not limited to authentication, authorization, etc. The session control device includes but is not limited to AAA (Authentication, Authorization, Accounting, authentication, authorization, billing system, that is, network security system) system, network access control network element, etc. The network access control network element is any network element that can control the network access of the terminal device so that the terminal device can access the network; the network access control network element includes but is not limited to NAS (Network Attached Server, network access server) equipment, etc. The terminal device is any device that can access the network, including but not limited to routers, switches, mobile phones, computers, vehicle-mounted terminals, etc.
[0045] Optionally, when the session control device is an AAA system, the session establishment request can be an authentication request to authenticate the account information contained therein, and after successful authentication, the session is established; the terminal device can initiate a request to establish a session to the network access control network element, and the network access control network element generates an authentication request based on the request and sends the authentication request to the session control device.
[0046] Step S120 , determining whether the session establishment request being processed includes a session establishment request corresponding to the target account information.
[0047] In order to ensure that only one session establishment request corresponding to the same account information is processed at the same time, that is, to ensure that the session establishment requests corresponding to the same account information are processed serially, and further to ensure that the number of established sessions corresponding to the account information is within a controllable range, in this embodiment, after receiving the target session establishment request, the session control device can parse the target session establishment request to obtain the target account information, and determine whether the session establishment request being processed contains the session establishment request corresponding to the target account information, that is, to determine whether there is a session establishment request corresponding to the target account information being processed.
[0048] The specific method of determining whether the session establishment request being processed includes a session establishment request corresponding to the target account information can be flexibly set according to actual needs.
[0049] Step S130: If not, obtain the session quantity threshold corresponding to the target account information and the number of established sessions.
[0050] The session number threshold refers to the maximum number of sessions that the account information supports at the same time, which can be determined based on the tariff package selected by the user.
[0051] If the session establishment request being processed does not include a session establishment request corresponding to the target account information, that is, there is no session establishment request being processed corresponding to the target account information, then the session quantity threshold corresponding to the target account information and the number of established sessions can be obtained.
[0052] Step S140: if the number of established sessions corresponding to the target account information is lower than the session number threshold corresponding to the target account information, a session corresponding to the target session establishment request is established according to the target account information.
[0053] If the number of established sessions corresponding to the target account information is lower than the session number threshold corresponding to the target account information, a session corresponding to the target session establishment request may be established according to the target account information.
[0054] Among them, the specific method of establishing a session corresponding to the target session establishment request according to the target account information can be flexibly set according to actual needs. Optionally, if the session control device is an AAA system, a session establishment response can be sent to the network access control network element to instruct the network access control network element to establish a session and allocate corresponding network resources.
[0055] Optionally, before establishing the session corresponding to the target session establishment request according to the target account information, the target session establishment request may be authenticated. If the authentication succeeds, the session corresponding to the target session establishment request is established according to the target account information; if the authentication fails, the target session establishment request is rejected. In order to save processing resources, the target session establishment request may be authenticated after determining that the session establishment request being processed does not contain the session establishment request corresponding to the target account information. If the authentication succeeds, the session number threshold corresponding to the target account information is obtained, and subsequent steps are performed; if the authentication fails, the target session establishment request is directly rejected; or, after determining that the number of established sessions corresponding to the target account information is lower than the session number threshold corresponding to the target account information, the target session establishment request may be authenticated. If the authentication succeeds, the session is established according to the target account information; if the authentication fails, the target session establishment request is rejected. The method of rejecting the session establishment request includes but is not limited to at least one of discarding the session establishment request and sending a rejection instruction for the session establishment request to the network access control network element.
[0056] In this embodiment, subsequent processing is performed only when there is no session establishment request being processed corresponding to the target account information, thereby ensuring that at most only one session establishment request for the same account is being processed at the same time, and avoiding the problem of excessive response caused by simultaneous processing of multiple session establishment requests for the same account; then, under the condition that there is no session establishment request being processed corresponding to the target account information, the session quantity threshold value and the number of established sessions corresponding to the target account information are first obtained. If the number of established sessions corresponding to the target account information is lower than the session quantity threshold value, a session corresponding to the target session establishment request is established according to the target account information, thereby ensuring that the number of established sessions corresponding to the account information is within the range of the number of sessions supported by the account information, and improving the accuracy of session quantity control.
[0057] In an exemplary embodiment, see Figure 2 As shown, Figure 2 for Figure 1 The flowchart of step S120 in an exemplary embodiment is shown in FIG. Figure 2 As shown, the process of determining whether the session establishment request being processed includes a session establishment request corresponding to the target account information may include steps S210 to S220, which are described in detail as follows:
[0058] Step S210, obtaining a first message set; wherein the first message set includes account information corresponding to the session establishment request being processed.
[0059] The first message set includes the account information corresponding to the session establishment request being processed, that is, includes the account information corresponding to the session establishment request in the processing state. The first message set can be stored in the form of a data table, etc. If the first message set is a data table, the account information can be stored in the data table as a primary key to avoid the situation where multiple table entries corresponding to the same account information exist at the same time.
[0060] Step S220: determine whether the first message set includes the target account information, so as to determine whether the session establishment request being processed includes the session establishment request corresponding to the target account information according to the determination result.
[0061] If the first message set includes the target account information, it indicates that the session establishment request being processed includes the session establishment request corresponding to the target account information, that is, there is a session establishment request being processed corresponding to the target account information; if the first message set does not include the target account information, it indicates that the session establishment request being processed does not include the session establishment request corresponding to the target account information, that is, there is no session establishment request being processed corresponding to the target account information.
[0062] In this embodiment, a first message set is first obtained, and the first message set includes account information corresponding to the session establishment request being processed; then, whether the session establishment request being processed includes a session establishment request corresponding to the target account information is determined by whether the first message set includes the target account information, thereby improving the efficiency and accuracy of the judgment.
[0063] In an exemplary embodiment, see Figure 3 As shown, Figure 3 Under the condition that the first message set is included, Figure 1 The flowchart of step S130 in an exemplary embodiment is shown in FIG. Figure 3 If not, the process of obtaining the session quantity threshold corresponding to the target account information and the number of established sessions may include steps S310 to S330, which are described in detail as follows:
[0064] Step S310: If the first message set does not include the target account information, the target session establishment request is authenticated.
[0065] If the first message set does not include the target account information, it indicates that there is no session establishment request being processed corresponding to the target account information, so the target session establishment request can be directly processed. In order to determine whether the identity of the target session establishment request is correct, the target session establishment request can be authenticated first.
[0066] Among them, the authentication method can be flexibly set according to actual needs. Optionally, the target session establishment request can include target account information and a password corresponding to the target account information. During the authentication process, it can be determined whether the password corresponding to the target account information included in the target session establishment request is consistent with the password corresponding to the pre-stored target account information. If so, the authentication is successful; if not, the authentication fails.
[0067] Step S320: After the authentication is successful, the target account information is written into the first message set.
[0068] After successful authentication, the target session establishment request can be processed. In order to indicate that the target session establishment request is being processed, the target account information can be written into the first message set so that the method for processing the session establishment request corresponding to the target account information received subsequently can be determined according to the first message set.
[0069] Step S330, searching for a session quantity threshold corresponding to the target account information, and obtaining the number of established sessions corresponding to the target account information according to the second message set; the second message set includes the number of established sessions corresponding to different account information.
[0070] The second message set includes the number of established sessions corresponding to different account information. Optionally, the second message set may include identification information of the established sessions and account information corresponding to the established sessions, so that the number of established sessions corresponding to different account information can be determined based on the second message set. The identification information of the established sessions includes but is not limited to the IP (Internet Protocol) address of the session, the ID (Identity document) of the session, etc. The second message set may be a data table. In order to increase the speed of obtaining the number of established sessions, the account information may be the primary key in the second message set, so that the relevant information of one or more sessions corresponding to the same account information is stored in the same table item.
[0071] It should be noted that the updating method of the second message set can be flexibly set according to actual needs. In one example, after the session corresponding to the session establishment request is established, the second message set can be updated according to the established session; after the established session is dismantled, the second message set can be updated according to the dismantled session; or, after the billing start message corresponding to the established session is received, the second message set can be updated according to the established session; after the established session is dismantled and the billing end message corresponding to the dismantled session is received, the second message set can be updated according to the dismantled session, wherein the billing start message is used to indicate the start of billing, and the billing end message is used to indicate the end of billing.
[0072] After the target account information is written into the first message set, the session quantity threshold corresponding to the target account information may be searched, and the number of established sessions corresponding to the target account information may be calculated according to the second message set.
[0073] In this embodiment, if the first message set does not include the target account information, the target session establishment request is authenticated, and after the authentication is successful, the target account information is first written into the first message set, and then the session quantity threshold corresponding to the target account information is found, and the number of established sessions corresponding to the target account information is calculated according to the second message set; that is, the authentication is performed first, and after the authentication is successful, it is determined whether the number of established sessions is lower than the session quantity threshold, thereby saving processing resources; and, the target account information is first written into the first message set, and then it is determined whether the number of established sessions is lower than the session quantity threshold, thereby improving the accuracy of session quantity control.
[0074] In an exemplary embodiment, see Figure 4 As shown, Figure 4 for Figure 1 Based on the embodiment shown, a flow chart of a session control method is proposed. Figure 4 As shown, the session control method may further include steps S410 to S430, which are described in detail as follows:
[0075] Step S410: If the session establishment request being processed includes a session establishment request corresponding to the target account information, then threshold attribute information corresponding to the target account information is obtained; the threshold attribute information is used to describe whether the session quantity threshold is greater than 1.
[0076] It should be noted that the threshold attribute information is used to describe whether the session quantity threshold corresponding to the account information is greater than 1. Optionally, the threshold attribute information can be represented by a specified identifier, for example, the character "0" can be used to represent that the session quantity threshold is 1, and the character "1" can be used to represent that the session quantity threshold is greater than 1; for another example, "no" can be used to represent that the session quantity threshold is 1, and "yes" can be used to represent that the session quantity threshold is greater than 1.
[0077] If the session establishment request being processed includes a session establishment request corresponding to the target account information, that is, there is a session establishment request being processed corresponding to the target account information, then the threshold attribute information corresponding to the target account information can be obtained.
[0078] The specific method of obtaining the threshold attribute information can be flexibly set according to actual needs. Optionally, in addition to the account information corresponding to the session establishment request being processed, the first message set can also include the threshold attribute information corresponding to the account information. After determining that the first message set includes the target account information, the threshold attribute information corresponding to the target account information can be further obtained from the first message set.
[0079] Step S420: determining whether the session quantity threshold corresponding to the target account information is greater than 1 based on the threshold attribute information corresponding to the target account information.
[0080] According to the threshold attribute information of the target account information, it can be determined whether the session quantity threshold corresponding to the target account is greater than 1.
[0081] Step S430: If the session quantity threshold corresponding to the target account information is greater than 1, the target session establishment request is cached in a designated queue.
[0082] The specified queue is used to cache session establishment requests waiting to be processed. It can be any type of message queue.
[0083] If the session establishment request being processed includes a session establishment request corresponding to the target account information, and the session quantity threshold corresponding to the target account information is greater than 1, it indicates that the number of sessions supported by the target account is greater than 1. Even if there is a session establishment request being processed corresponding to the target account, the target session establishment request can be cached in the designated queue and processed after the session establishment request being processed corresponding to the target account is completed.
[0084] Optionally, in other embodiments, if the session establishment request being processed includes a session establishment request corresponding to the target account information, and the session quantity threshold corresponding to the target account information is equal to 1, it indicates that there is a session establishment request corresponding to the target account being processed, and the number of sessions supported by the target account information is equal to 1. Therefore, it is very likely that a session will be established based on the session establishment request being processed, resulting in the number of established sessions corresponding to the target account reaching the session quantity threshold, and then making it impossible to establish a session based on the target session establishment request. Therefore, under this condition, the target session establishment request can be directly rejected to save processing resources.
[0085] Optionally, if the session establishment request being processed includes a session establishment request corresponding to the target account information, and the session quantity threshold corresponding to the target account information is equal to 1, it indicates that there is a session establishment request corresponding to the target account information being processed, and the number of sessions supported by the target account information is equal to 1. Therefore, it is very likely that a session will be established based on the session establishment request being processed, causing the number of established sessions corresponding to the target account to reach the session quantity threshold, and thus making it impossible to establish a session based on other session establishment requests. Therefore, under this condition, the session establishment request corresponding to the target account information contained in the specified queue can be deleted, thereby saving processing resources.
[0086] In this embodiment, if the session establishment request being processed includes a session establishment request corresponding to the target account information, threshold attribute information corresponding to the target account information is obtained, and the threshold attribute information is used to describe whether the session quantity threshold is greater than 1; according to the threshold attribute information corresponding to the target account information, it is determined whether the session quantity threshold corresponding to the target account information is greater than 1; if the session quantity threshold corresponding to the target account information is greater than 1, the target session establishment request is cached in a designated queue. That is to say, under the condition that the session establishment request being processed includes the session establishment request corresponding to the target account information, it is not directly determined whether the number of established sessions corresponding to the target account information is lower than the corresponding session quantity threshold, but when it is determined that the session quantity threshold corresponding to the target account information is greater than 1, the target session processing request is cached in the designated queue for processing, thereby not only ensuring that the session processing requests corresponding to the same account information are serially processed and improving the accuracy of the session quantity control, but also realizing the caching of the session establishment request and supporting the establishment of multiple sessions by the same account.
[0087] In an exemplary embodiment, see Figure 5 As shown, Figure 5 for Figure 4 Based on the embodiment shown, a flow chart of a session control method is proposed. Figure 5 As shown, in Figure 4 After step S430 shown (i.e., after caching the target session establishment request to the designated queue), the session control method may further include steps S510 to S530, which are described in detail as follows:
[0088] Step S510: detecting the processing status of the session establishment request being processed corresponding to the target account information.
[0089] After the target session establishment request is cached in the designated queue, the processing status of the session establishment request being processed corresponding to the target account information may be detected to determine whether the processing of the session establishment request being processed is complete.
[0090] The completion of the session establishment request processing includes but is not limited to two situations: one is to establish the session corresponding to the session establishment request and update the relevant information of the established session to the second message set; the other is to reject the session establishment request. The situations of rejecting the session establishment request include but are not limited to: 1. The authentication of the account information included in the session establishment request fails, for example, the account information included in the session establishment request or the corresponding password is incorrect; 2. The number of established sessions corresponding to the account information included in the session establishment request exceeds the session number threshold.
[0091] Step S520: If it is detected that the session establishment request corresponding to the target account information being processed is completed, it is determined whether the designated queue contains the session establishment request corresponding to the target account information.
[0092] If it is detected that the session establishment request corresponding to the target account information being processed is completed, the next session establishment request corresponding to the target account information can be processed. Therefore, it can be detected whether the designated queue contains the session establishment request corresponding to the target account information.
[0093] Step S530: If the designated queue contains a session establishment request corresponding to the target account information, the session establishment request corresponding to the target account information is obtained from the designated queue, and the obtained session establishment request is processed.
[0094] If the designated queue contains a session establishment request corresponding to the target account information, the session establishment request corresponding to the target account information may be obtained from the designated queue, and the obtained session establishment request may be processed.
[0095] Among them, processing the obtained session establishment request includes but is not limited to: searching the second message set for the number of established sessions corresponding to the account information of the session establishment request, and determining whether the found number of established sessions is lower than the corresponding session number threshold; if so, establishing the corresponding session based on the account information of the session establishment request; if not, rejecting the session establishment request.
[0096] Optionally, under the condition that the first message set is included, after step S520 (i.e., after determining whether the designated queue contains a session establishment request corresponding to the target account information), if the designated queue does not contain a session establishment request corresponding to the target account information, it indicates that there are no session establishment requests being processed and target session establishment requests corresponding to the target account information. Therefore, the target account information can be deleted from the first message set, that is, the target account information contained in the first message set is deleted.
[0097] In this embodiment, the processing status of the session establishment request being processed corresponding to the target account information is detected. If it is detected that the processing of the session establishment request being processed corresponding to the target account information is completed, it is determined whether the designated queue contains the session establishment request corresponding to the target account information; if the designated queue contains the session establishment request corresponding to the target account information, the session establishment request corresponding to the target account information is obtained from the designated queue, and the obtained session establishment request is processed, thereby improving the accuracy of session quantity control.
[0098] The following is a detailed description of a specific application scenario of the embodiment of the present application. In this embodiment, the session control method is applied to a scenario including a terminal device, a NAS device and an AAA system, and the session establishment request is an authentication request. Figure 6 As shown, the session control method includes steps S601 to S614, which are described in detail as follows:
[0099] Step S601: The terminal device initiates a request to establish a session to the NAS device.
[0100] When a terminal device needs to establish a session, it can initiate a request to the NAS device to establish a session.
[0101] Step S602: The NAS device sends a target authentication request to the AAA system.
[0102] After receiving the request for establishing a session initiated by the terminal device, the NAS device generates a target authentication request including the target user name and password, and sends the target authentication request to the AAA system for authentication.
[0103] Optionally, the target authentication request may be a request generated based on RADIUS (Remote Authentication Dial InUser Service).
[0104] Step S603: The AAA system processes the target authentication request and sends a target authentication response to the NAS device.
[0105] The target authentication response is used to indicate whether the authentication is successful.
[0106] Step S604: The NAS device sends an authentication result to the terminal device based on the target authentication response.
[0107] The NAS device can send the authentication result to the terminal device.
[0108] Optionally, the NAS device may not send the authentication result to the terminal device and directly proceed to S605.
[0109] Step S605: If the authentication result is successful, the terminal device and the NAS device establish a session corresponding to the target authentication request based on the target user name.
[0110] Optionally, the terminal device and the NAS device may establish a PPP (Point to Point Protocol) session based on the IPCP (Internet Protocol Control Protocol) protocol.
[0111] Step S606: The NAS device allocates an IP address to the session corresponding to the target authentication request.
[0112] After establishing a session corresponding to the target authentication request, the NAS device allocates an IP address for the established session.
[0113] Step S607: The NAS device sends an accounting start message to the AAA system.
[0114] After the session is established, the session can be charged, so the NAS device can send a charging start message corresponding to the session to the AAA system to instruct the AAA system to start charging. The charging start message can include at least one of the identification information of the session to start charging and the corresponding account information.
[0115] Step S608: The AAA system updates the online information table based on the session corresponding to the target authentication request.
[0116] The online information table includes identification information of established sessions, account information corresponding to established sessions, and the like.
[0117] After receiving the billing start message for the session corresponding to the target authentication request, the online information table can be updated based on the session corresponding to the target authentication request. For example, the identification information of the session, the target user name, etc. can be added to the online information table. Alternatively, if the online information table contains the number of established sessions corresponding to the target user name, the number of established sessions corresponding to the target user name can be updated.
[0118] Optionally, the AAA system may also perform accounting for the session corresponding to the target authentication request according to the accounting start message.
[0119] Step S609: The terminal device communicates based on the session corresponding to the target authentication request.
[0120] Step S610: The terminal device requests the NAS device to disconnect.
[0121] When the terminal device does not need to communicate, it can send a disconnection request for the session corresponding to the target authentication request to the NAS device to request to disconnect the session.
[0122] Step S611: The NAS device disconnects the session corresponding to the target authentication request and reclaims the IP address corresponding to the session.
[0123] After receiving the disconnection request for the session corresponding to the target authentication request, the NAS device removes the session corresponding to the target authentication request based on the disconnection request and reclaims the IP address corresponding to the session.
[0124] Step S612: The NAS device sends a disconnection success response to the terminal device.
[0125] After the NAS device dismantles the session corresponding to the target authentication request and reclaims the IP address of the session, it can send a successful disconnection response to the terminal device.
[0126] Optionally, the NAS device may not send a disconnection success response to the terminal device.
[0127] Step S613: The NAS device sends a charging end message to the AAA system.
[0128] Since the session has been torn down, an accounting end message may be sent to the AAA system to indicate the end of accounting.
[0129] The charging end message may include at least one of identification information of the session for which charging is ended and corresponding account information.
[0130] Step S614: The AAA system generates a billing record and updates the online information table.
[0131] The AAA system generates a billing call record based on the billing end message, and updates the online information table according to the identification information of the billing end session. For example, the relevant data of the billing end session can be deleted from the online information table.
[0132] It should be noted that see Figure 7 As shown, Figure 7 for Figure 6 In the session control method shown, the specific processing process of the AAA system includes steps S701 to S714, which are described in detail as follows:
[0133] Step S701: receiving a target authentication request, where the target authentication request includes a target user name and a corresponding password.
[0134] Step S702, determine whether the authentication process table contains the target user name, if so, go to step S703; if not, go to step S706.
[0135] The authentication process table (i.e., the first message set) includes the user name corresponding to the authentication request being processed, wherein the user name is the primary key, so that only one authentication request of the same user is processed at the same time (it should be noted that session establishment requests of multiple different users can be processed at the same time).
[0136] Step S703, determine whether the session quantity threshold corresponding to the target user name is greater than 1, if so, go to step S704; if not, go to step S705.
[0137] Step S704: Cache the target authentication request into a message queue.
[0138] Step S705: reject the target authentication request, and delete the authentication request corresponding to the target user name from the message queue.
[0139] Step S706, authenticating the target user name and password contained in the target authentication request; if the authentication succeeds, go to step S707; if the authentication fails, go to step S714.
[0140] Step S707, write the target user name and the corresponding threshold attribute information into the authentication process table. If the writing is successful, go to step S708; if the writing fails, go to step S704.
[0141] Step S708, query the online information table and determine whether the number of established sessions corresponding to the target user name reaches the corresponding session number threshold. If so, go to step S705; if not, go to step S709.
[0142] The online information table contains relevant information of the established session, such as identification information of the established session, corresponding account information, etc.
[0143] Step S709: Send a response indicating successful authentication to the NAS device, and wait for a billing start message.
[0144] An authentication response indicating successful authentication is sent to the NAS device, so that the NAS device and the terminal device establish a session corresponding to the authentication request based on the successful authentication response, and wait for the NAS device to send a billing start message corresponding to the session.
[0145] Step S710: receiving a charging start message and updating the online information table.
[0146] The online information table is updated according to the session corresponding to the accounting start message and the account information of the session.
[0147] Step S711, check whether the message queue contains an authentication request corresponding to the target user name, if so, go to step S713; if not, go to step S712.
[0148] Step S712: deleting the relevant data corresponding to the target user name contained in the authentication process table.
[0149] Step S713, obtaining the authentication request corresponding to the target user name from the message queue, and authenticating the user name and password contained in the authentication request. If the authentication succeeds, go to step S708; if the authentication fails, go to step S714.
[0150] Step S714: reject the authentication request.
[0151] Optionally, rejecting the authentication request includes sending an authentication failure response to the NAS device.
[0152] The following two examples are used to illustrate this.
[0153] Example 1:
[0154] See also Figure 8 As shown, assuming that the user's session quantity threshold is 1, for the first authentication request of the user, at time T0, the NAS device receives the first authentication request; at time T1, the AAA system authenticates the user name and password contained in the first authentication request, and writes the user name and the corresponding threshold attribute information into the authentication process table after the authentication is successful; at time T2, the AAA system replies with a response of successful authentication; at time T3, the NAS device sends a billing start message to the AAA system; at time T4, the AAA system updates the online information table and deletes the relevant data of the user contained in the authentication process table; at time T5, the NAS device sends a billing end message to the AAA system; at time T6, the AAA system deletes the relevant data of the session corresponding to the first authentication request contained in the online information table, and forms a call record. For the second authentication request of the user, if the second authentication request is received during T0-T1, the second authentication request is added to the message queue because the username is repeatedly written into the authentication process table and fails to be written. After being added to the message queue, the second authentication request is rejected because the number of established sessions reaches the session number threshold, and the subsequent authentication requests of the user in the message queue are deleted; if the second authentication request is received during T1-T4, since the username of the user is already included in the authentication process table, the second authentication request is directly rejected based on the threshold attribute information in the authentication process table being equal to 1, thereby reducing the steps of authenticating the username and password included in the second authentication request, avoiding unnecessary message caching, and saving processing resources; if the second authentication request is received after T4, it is determined whether to establish a session based on the second authentication request based on the number of established sessions of the user in the online information table; thereby ensuring that the number of established sessions does not exceed the session number threshold.
[0155] Example 2:
[0156] See also Fig. 9 As shown, assuming that the user's session number threshold is greater than 1, for the first authentication request of the user, at time T0, the NAS device receives the first authentication request; at time T1, the AAA system authenticates the user name and password contained in the first authentication request, and writes the user name and the corresponding threshold attribute information into the authentication process table after the authentication is successful; at time T2, the AAA system replies with a response of successful authentication; at time T3, the NAS device sends a billing start message to the AAA system; at time T4, after the AAA system updates the online information table, it obtains the subsequent authentication requests of the user from the message queue and processes them until there is no authentication request of the user in the message queue or the number of established sessions of the user reaches the session number threshold, clears the authentication request of the user contained in the message queue, and deletes the relevant data of the user contained in the authentication process table; at time T5, the NAS device sends a billing end message to the AAA system; at time T6, the AAA system deletes the relevant data of the first authentication request contained in the online information table to form a call record. For the second authentication request of the user, if the second authentication request is received during T0-T1, the second authentication request is added to the message queue and waits for subsequent processing because the user name is repeatedly written into the authentication process table and the writing fails; if the second authentication request is received during T1-T4, the second authentication request is added to the message queue, and when processing the second authentication request, it is determined whether to establish a session based on the second authentication request based on the number of established sessions of the user contained in the online information table and the corresponding session number threshold; if the second authentication request is received after T4, it is directly determined whether to establish a session based on the second authentication request based on the number of established sessions of the user in the online information table, thereby ensuring that the number of established sessions does not exceed the session number threshold.
[0157] In this embodiment, it can be ensured that only one authentication request is processed at the same time for the same user; at the same time, for users who are only allowed to establish one session, if the user is still in the authentication process table when a subsequent authentication request arrives, it will be directly rejected; for users who are allowed to establish multiple sessions, their subsequent requests are first cached, and after completing the processing of the previous request (that is, directly rejecting or updating the online information table), the requests in the message queue are extracted in turn for processing until the message queue is cleared or the number of established sessions reaches a threshold. After updating the online process table, the authentication process table is updated, thereby improving the accuracy of session quantity control.
[0158] See also Fig.10 , Fig.10 FIG. 1 is a block diagram of a session control device shown in an exemplary embodiment of the present application. Fig.10 As shown, the device comprises:
[0159] An acquisition module 1001 is configured to acquire target account information included in a target session establishment request;
[0160] A determination module 1002 is configured to determine whether the session establishment request being processed includes a session establishment request corresponding to the target account information;
[0161] Determining module 1003, configured to, if not, obtain a session quantity threshold corresponding to the target account information and the number of established sessions;
[0162] The establishing module 1004 is configured to establish a session corresponding to the target session establishment request according to the target account information if the number of established sessions corresponding to the target account information is lower than a threshold of the number of sessions corresponding to the target account information.
[0163] It should be noted that the session control device may also include corresponding modules to implement other steps in the session control method provided in the aforementioned embodiment. The session control device provided in the aforementioned embodiment and the session control method provided in the aforementioned embodiment belong to the same concept, and the specific manner in which each module and unit performs the operation has been described in detail in the method embodiment and will not be repeated here.
[0164] An embodiment of the present application also provides an electronic device, comprising: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by one or more processors, the electronic device implements the session control method provided in the above-mentioned embodiments.
[0165] Fig.11 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown.
[0166] It should be noted that Fig.11 The computer system 1100 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0167] like Fig.11As shown, the computer system 1100 includes a central processing unit (CPU) 1101, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 1102 or the program loaded from the storage part 1108 to the random access memory (RAM) 1103, such as executing the method in the above embodiment. In the RAM 1103, various programs and data required for system operation are also stored. The CPU 1101, the ROM 1102 and the RAM 1103 are connected to each other through the bus 1104. The input / output (I / O) interface 1105 is also connected to the bus 1104.
[0168] The following components are connected to the I / O interface 1105: an input section 1106 including a keyboard, a mouse, etc.; an output section 1107 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1108 including a hard disk, etc.; and a communication section 1109 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 1109 performs communication processing via a network such as the Internet. A drive 1110 is also connected to the I / O interface 1105 as needed. A removable medium 1111, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1110 as needed so that a computer program read therefrom is installed into the storage section 1108 as needed.
[0169] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 1109, and / or installed from a removable medium 1111. When the computer program is executed by a central processing unit (CPU) 1101, various functions defined in the system of the present application are executed.
[0170] It should be noted that the computer-readable medium shown in the embodiment of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it. In the present application, a computer-readable signal medium can include a data signal propagated in a baseband or as a part of a carrier wave, wherein a computer-readable computer program is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate, or transmit programs for use by or in conjunction with an instruction execution system, apparatus, or device. The computer program contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0171] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0172] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.
[0173] Another aspect of the present application further provides a computer-readable storage medium on which computer-readable instructions are stored. When the computer-readable instructions are executed by a processor of an electronic device, the electronic device implements the method described above. The computer-readable storage medium may be included in the electronic device described in the above embodiment, or may exist independently without being assembled into the electronic device.
[0174] Another aspect of the present application further provides a computer program product or a computer program, which includes a computer instruction, and when the computer instruction is executed by a processor, the method provided in each of the above embodiments is implemented. The computer instruction can be stored in a computer-readable storage medium; the processor of the electronic device can read the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the electronic device performs the method provided in each of the above embodiments.
[0175] The above content is only a preferred exemplary embodiment of the present application and is not intended to limit the implementation scheme of the present application. A person skilled in the art can easily make corresponding changes or modifications based on the main concept and spirit of the present application. Therefore, the scope of protection of the present application shall be based on the scope of protection required by the claims.
Claims
1. A session control method, characterized in that: The method comprises: Obtain the target account information contained in the target session establishment request; Determining whether the session establishment request being processed includes a session establishment request corresponding to the target account information; If not, obtaining the session quantity threshold corresponding to the target account information and the number of established sessions; If the number of established sessions corresponding to the target account information is lower than the session number threshold corresponding to the target account information, establishing a session corresponding to the target session establishment request according to the target account information; If the session establishment request being processed includes a session establishment request corresponding to the target account information, then obtaining threshold attribute information corresponding to the target account information; the threshold attribute information is used to describe whether the session quantity threshold is greater than 1; According to the threshold attribute information corresponding to the target account information, determining whether the session quantity threshold corresponding to the target account information is greater than 1; If the session quantity threshold corresponding to the target account information is greater than 1, the target session establishment request is cached in a designated queue; Detecting a processing status of a session establishment request being processed corresponding to the target account information; If it is detected that the session establishment request corresponding to the target account information being processed is completed, determining whether the designated queue contains the session establishment request corresponding to the target account information; If the designated queue contains a session establishment request corresponding to the target account information, the session establishment request corresponding to the target account information is obtained from the designated queue, and the obtained session establishment request is processed.
2. The method according to claim 1, characterized in that After determining whether the session quantity threshold corresponding to the target account information is greater than 1, the method further includes: If the session quantity threshold corresponding to the target account information is equal to 1, the target session establishment request is rejected.
3. The method according to claim 1, characterized in that After determining whether the session quantity threshold corresponding to the target account information is greater than 1, the method further includes: If the session quantity threshold corresponding to the target account information is equal to 1, the session establishment request corresponding to the target account information contained in the designated queue is deleted.
4. The method according to any one of claims 1 to 3, characterized in that The determining whether the session establishment request being processed includes a session establishment request corresponding to the target account information includes: Obtaining a first message set; wherein the first message set includes account information corresponding to the session establishment request being processed; It is determined whether the first message set includes the target account information, so as to determine whether the session establishment request being processed includes the session establishment request corresponding to the target account information according to the determination result.
5. The method according to claim 4, characterized in that If not, obtaining the session quantity threshold corresponding to the target account information and the number of established sessions includes: If the first message set does not include the target account information, authenticating the target session establishment request; After successful authentication, writing the target account information into the first message set; A session quantity threshold corresponding to the target account information is searched, and the number of established sessions corresponding to the target account information is obtained according to a second message set; the second message set includes the number of established sessions corresponding to different account information.
6. A conversation control device, characterized in that: The device comprises: An acquisition module configured to acquire target account information included in the target session establishment request; A determination module configured to determine whether the session establishment request being processed includes a session establishment request corresponding to the target account information; a determination module configured to, if no, obtain a session quantity threshold corresponding to the target account information and a quantity of established sessions; an establishing module configured to establish a session corresponding to the target session establishment request according to the target account information if the number of established sessions corresponding to the target account information is lower than a threshold number of sessions corresponding to the target account information; The device is also used for: If the session establishment request being processed includes a session establishment request corresponding to the target account information, then obtaining threshold attribute information corresponding to the target account information; the threshold attribute information is used to describe whether the session quantity threshold is greater than 1; According to the threshold attribute information corresponding to the target account information, determining whether the session quantity threshold corresponding to the target account information is greater than 1; If the session quantity threshold corresponding to the target account information is greater than 1, the target session establishment request is cached in a designated queue; Detecting a processing status of a session establishment request being processed corresponding to the target account information; If it is detected that the session establishment request corresponding to the target account information being processed is completed, determining whether the designated queue contains the session establishment request corresponding to the target account information; If the designated queue contains a session establishment request corresponding to the target account information, the session establishment request corresponding to the target account information is obtained from the designated queue, and the obtained session establishment request is processed.
7. An electronic device, characterized in that: include: one or more processors; A storage device for storing one or more computer programs, which, when executed by the one or more processors, enables the electronic device to implement the session control method described in any one of claims 1-5.
8. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a processor of an electronic device, the electronic device implements the session control method described in any one of claims 1-5.
