CN117972674A - Method, device, computer equipment and storage medium for determining session expiration duration - Google Patents
Method, device, computer equipment and storage medium for determining session expiration duration Download PDFInfo
- Publication number
- CN117972674A CN117972674A CN202311404679.6A CN202311404679A CN117972674A CN 117972674 A CN117972674 A CN 117972674A CN 202311404679 A CN202311404679 A CN 202311404679A CN 117972674 A CN117972674 A CN 117972674A
- Authority
- CN
- China
- Prior art keywords
- access
- time
- determining
- aggregation
- target 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
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/30—Authentication, i.e. establishing the identity or authorisation of security principals
- G06F21/31—User authentication
- G06F21/41—User authentication where a single sign-on provides access to a plurality of computers
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/604—Tools and structures for managing or administering access control systems
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2221/00—Indexing scheme relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F2221/21—Indexing scheme relating to G06F21/00 and subgroups addressing additional information or applications relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F2221/2141—Access rights, e.g. capability lists, access control lists, access tables, access matrices
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Computer Security & Cryptography (AREA)
- General Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- General Health & Medical Sciences (AREA)
- Bioethics (AREA)
- Health & Medical Sciences (AREA)
- Automation & Control Theory (AREA)
- Computer And Data Communications (AREA)
Abstract
The application relates to a method, a device, computer equipment and a storage medium for determining a session expiration duration. The method comprises the following steps: acquiring access record information of a target user, wherein the access record information comprises access behavior information and corresponding access time; based on the access time and the access behavior information, obtaining an access data sequence; determining access interval time of the target user based on the access data sequence; and determining the expiration time of the access session of the target user according to the access interval time. By adopting the method, the expiration time of the session can be accurately determined.
Description
Technical Field
The present application relates to the field of distributed technology, and in particular, to a method, an apparatus, a computer device, a storage medium, and a computer program product for determining a session expiration duration.
Background
In the distributed system, SSO (SINGLE SIGN On ) technology exists, which means that in a plurality of application systems, a user can access all application systems which are trusted by each other only by logging in once, and after logging in successfully, session information is cached in the distributed cache.
In the related art, the SSO technology is generally implemented by adopting an SSO system, that is, in a distributed system architecture, the SSO system is independent into a micro service, all subsystems do not independently manage session sessions, and session sessions are uniformly managed by the SSO system. When a user wants to access the subsystem, the user can call a login verification service of the SSO system, so that the user jumps to a login page of the SSO, and after successful login, session information is written into the distributed cache, wherein the expiration time of the session in the distributed cache is defined by the user. However, this method cannot accurately determine the session expiration duration.
Disclosure of Invention
In view of the foregoing, it is desirable to provide an accurate session expiration duration determination method, apparatus, computer device, computer readable storage medium, and computer program product.
In a first aspect, the present application provides a method for determining a session expiration duration, including:
obtaining access record information of a target user, wherein the access record information comprises access behavior information and corresponding access time;
based on the access time and the access behavior information, obtaining an access data sequence;
determining access interval time of the target user based on the access data sequence;
and determining the expiration time of the access session of the target user according to the access interval time.
In a second aspect, the present application further provides a session expiration duration determining apparatus, including:
The access information acquisition module is used for acquiring access record information of the target user, wherein the access record information comprises access behavior information and corresponding access time;
the access information analysis module is used for obtaining an access data sequence based on the access time and the access behavior information;
the interval time determining module is used for determining the access interval time of the target user based on the access data sequence;
and the expiration time determining module is used for determining the expiration time of the access session of the target user according to the access interval time.
In a third aspect, the present application also provides a computer device comprising a memory and a processor, the memory storing a computer program, the processor implementing the following steps when executing the computer program:
obtaining access record information of a target user, wherein the access record information comprises access behavior information and corresponding access time;
based on the access time and the access behavior information, obtaining an access data sequence;
determining access interval time of the target user based on the access data sequence;
and determining the expiration time of the access session of the target user according to the access interval time.
In a fourth aspect, the present application also provides a computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of:
obtaining access record information of a target user, wherein the access record information comprises access behavior information and corresponding access time;
based on the access time and the access behavior information, obtaining an access data sequence;
determining access interval time of the target user based on the access data sequence;
and determining the expiration time of the access session of the target user according to the access interval time.
In a fifth aspect, the application also provides a computer program product comprising a computer program which, when executed by a processor, performs the steps of:
obtaining access record information of a target user, wherein the access record information comprises access behavior information and corresponding access time;
based on the access time and the access behavior information, obtaining an access data sequence;
determining access interval time of the target user based on the access data sequence;
and determining the expiration time of the access session of the target user according to the access interval time.
The method, the device, the computer equipment, the storage medium and the computer program product for determining the session expiration time adopt the access record information of the target user to obtain the access data sequence, obtain the access interval time of the target user after analyzing the access data sequence, and accurately determine the access session expiration time of the target user based on the access interval time. Different access session expiration durations can be set for users with different access record information, so that the access session expiration durations are fixed for all users in the traditional technology, and the access record information can be accurately analyzed to accurately determine the session expiration durations.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the related art, the drawings that are required to be used in the embodiments or the related technical descriptions will be briefly described, and it is apparent that the drawings in the following description are only some embodiments of the present application, and other drawings may be obtained according to the drawings without inventive effort for those skilled in the art.
FIG. 1 is an application environment diagram of a method for determining session expiration duration in one embodiment;
FIG. 2 is a flow diagram of a method for determining a session expiration duration in one embodiment;
FIG. 3 is a flow chart of a method for determining a session expiration duration in another embodiment;
FIG. 4 is a flow chart of a method for determining session expiration duration by an SSO system in yet another embodiment;
FIG. 5 is a flow chart of a method for determining a session expiration duration in a specific application example;
FIG. 6 is a block diagram of a session expiration duration determining apparatus in one embodiment;
fig. 7 is an internal structural diagram of a computer device in one embodiment.
Detailed Description
The present application will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present application more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application.
The distributed system architecture includes an SSO system and subsystems. In the distributed system architecture, each subsystem does not manage sessions independently, but is managed uniformly by the SSO system. For example, when a user accesses subsystem a, the domain name of subsystem a is: domain.com; the subsystem A calls login service in the SSO system, after the user is successfully logged in, the SSO system stores logged-in session information in the distributed cache, generates a token, and returns the token to the subsystem A. The subsystem A writes the token into a front-end cookie, wherein the cookie domain is a common top-level domain name (domain. Com) of all subsystems; when a user accesses the subsystem B (domain name is b.domain.com), the subsystem B acquires a public token from a public cookie domain (domain.com), invokes an SSO system to verify whether logging in or not, returns to a page of the subsystem B after verification is passed, and the user does not need to log in again to realize the sharing of logging in information of a plurality of subsystems.
At this time, no matter which subsystem the user accesses, the user can call the login verification service of the SSO system; if the user does not log in, the user jumps to a login page of the SSO, and after the user successfully logs in, session information is written into the distributed cache, and in general, the expiration time of the session is defined by the user. Where the session is in a network web application, it is called "session control". The session object stores attributes and configuration information required for a particular user session. Thus, when a user jumps between Web pages of an application, the variables stored in the session object will not be lost, but will remain throughout the user session. When a user requests a Web page from an application, the Web server will automatically create a session object if the user has not yet been conversationed. When the session expires or is abandoned, the server will terminate the session. One of the most common uses of session objects is to store user preferences.
If the user needs to ensure that the user does not need to log in repeatedly within 24 hours, the session expiration time is set to 24 hours, or the session expiration time which ensures that the user does not need to log in repeatedly within half a day is set to 12 hours. The user does not have to log in repeatedly to access different subsystems as long as the session is valid. And each time the user accesses the subsystem, the subsystem calls the SSO system to acquire the session information, the session validity period is reset, and the user does not need to log in repeatedly as long as the user is in the session validity period from the last operation.
However, assuming that the expiration time of the session is 24 hours, in many cases, the user completes the task through a plurality of operations, and does not need to enter the system again on the same day. According to the prior art, the expiration time of the session after the last operation is 24 hours, and the session information of the user is always in the cache for 24 hours, so that the cache is occupied for a long time, and the storage is wasted.
If the expiration time of the session is set to be short, such as 30 minutes, then if the user does not enter the system page within 30 minutes and does not complete the task, the user will enter the system again after 30 minutes, and the user experience is poor.
Therefore, the current method for determining the expiration time of the session is not accurate enough, and based on the problem, the application provides the method for determining the expiration time of the session, which can accurately determine the expiration time of the session. The method can set reasonable session expiration time aiming at different access behaviors of different users in different subsystems, does not influence user experience, and does not occupy session cache for a long time.
The method for determining the session expiration time provided by the embodiment of the application can be applied to an application environment shown in fig. 1. The client of each subsystem and the SSO system exists on the terminal 102, and the client of each subsystem on the terminal 102 communicates with the server 106 corresponding to each subsystem through the network. The subsystems A, B, C, …, and N in fig. 1 include servers respectively corresponding to each other. When the clients of the subsystems communicate with the servers 106 corresponding to the subsystems respectively through the network, the server 108 of the SSO system is called to perform login verification, and if the login is unsuccessful, the client jumps to the client interface of the SSO system; when the login is successful, the SSO system will write session information into the distributed cache.
When the target user interacts with the client of a subsystem on the terminal 102 of the target user, the client of the subsystem sends an access request to the server 106 of the corresponding subsystem, the access request carries the target user identifier, and the subsystem invokes the login verification service of the SSO system, that is, the server 106 of the subsystem sends the login request to the server 108 of the SSO system based on the target user identifier. After successful login, the server 108 of the SSO system will write the session to the distributed cache. At this time, the server 108 of the SSO system needs to set a session expiration time for the session; the server 108 of the SSO system may obtain the target user identifier corresponding to the terminal 102 from the database, and obtain, from the database, access record information of the target user through the target user identifier, where the access record information includes access behavior information and a corresponding access time. The server 108 of the SSO system obtains an access data sequence based on the access time and the access behavior information; determining access interval time of the target user based on the access data sequence; and determining the expiration time of the access session of the target user according to the access interval time. Further, server 108 of the SSO system performs expiration processing for the session in the distributed cache based on the determined access session expiration duration.
The terminal 102 may be, but not limited to, various personal computers, notebook computers, smart phones, tablet computers, internet of things devices, and portable wearable devices, where the internet of things devices may be smart speakers, smart televisions, smart air conditioners, smart vehicle devices, and the like. The portable wearable device may be a smart watch, smart bracelet, headset, or the like. The subsystem's server 106 and SSO's server 108 can be implemented as separate servers or as a cluster of servers.
In an exemplary embodiment, as shown in fig. 2, a method for determining a session expiration duration is provided, and the method is applied to the server 108 of the SSO system in fig. 1, for example, and includes the following steps 200 to 800. Wherein:
S200, access record information of the target user is obtained.
The access record information comprises access behavior information and corresponding access time. The access record information refers to historical access record information. The access behavior information includes access events and access objects. Access events include, but are not limited to, browse, order, click, etc. events; access objects include, but are not limited to, news pages, big-disc ticker pages, merchandise pages, and the like.
Specifically, when the target user interacts with a client of a subsystem on a terminal of the target user, the client of the subsystem sends an access request to a server of a corresponding subsystem, the access request carries a target user identifier, and the subsystem invokes a login verification service of the SSO system, that is, the server of the subsystem sends a login request to the server of the SSO system based on the target user identifier. After successful login, the server of the SSO system will write the session into the distributed cache. At this time, the server of the SSO system needs to set a session expiration time for the session; the server 108 of the SSO system may obtain the target user identifier corresponding to the terminal 102 from the database, and obtain, from the database, access record information of the target user through the target user identifier, where the access record information includes access behavior information and a corresponding access time. Wherein the access behavior information includes access events and access objects. Taking the access record information of the user A as an example for browsing a news page, the access event at the moment is browsing, and the access object is the news page. The access time is characterized in terms of year, month, day and hour, and minute seconds, so that the access time can be recorded more accurately. Further, the time threshold of the access record information of the target user may be defined by the target user, for example, the access record information in the past month may be obtained.
In practical application, the server side of the SSO system may obtain access record information of different users, where the access record information of different users is stored in the database and represented in a form of a table or a single piece of data, and if the access record information of different users in the table is represented in a form of a table, the access record information of different users in the table may be distinguished by different user identifiers, that is, the access record information of different users may be divided by using the users as dimensions. The access record information table of different users is shown in table 1, the first column of the table is different user identifications, and the second column, the third column and the fourth column of the table are access objects, access events and access time in the access record information respectively, wherein the access objects are access subsystems.
Table 1 access record information table for different users
S400, obtaining an access data sequence based on the access time and the access behavior information.
Specifically, different users have respective access data sequences. And generating an access data sequence of the target user based on the access time and the access behavior information in the access record information of the target user. The access data sequence of the target user may be used to describe what access behavior the target user takes place at what time. Further, the access data sequence is not simply ordered based on the access time and the access behavior information, but the access time and the access behavior information are further processed to obtain a more accurate access data sequence.
S600, determining the access interval time of the target user based on the access data sequence.
Specifically, the intervals of two accesses before and after the target user in the access data sequence may be consistent or inconsistent, and may be shorter access intervals, longer access intervals, or both shorter access intervals and longer access intervals. The access data sequence of the target user is analyzed, and each access interval time of the target user can be determined from the access data sequence.
S800, determining the expiration time of the access session of the target user according to the access interval time.
Specifically, determining the access frequency of the target user according to the access interval time of the target user; the frequency access types of the target users may be divided based on the access frequencies of the target users. The frequency access types of the target user comprise: high frequency access type, low frequency access type, frequency-dependent access type, etc. Different access session expiration durations are set for different frequency access types of the target users. When the subsequent target user accesses each subsystem, the generated session is expired after the set session expiration time is ended.
In the method for determining the expiration time of the session, the access record information of the target user is adopted to obtain the access data sequence, the access interval time of the target user is obtained after the access data sequence is analyzed, and the expiration time of the access session of the target user is accurately determined based on the access interval time. Different access session expiration durations can be set for users with different access record information, so that the access session expiration durations are fixed for all users in the traditional technology, and the access record information can be accurately analyzed to accurately determine the session expiration durations.
In one exemplary embodiment, based on the access time and the access behavior information, deriving the access data sequence includes:
Based on the access time, ordering the access record information to obtain an access time sequence; and according to the time difference of adjacent access time in the access time sequence, carrying out aggregation operation on each piece of access behavior information to obtain an access data sequence.
Specifically, the access record information is sorted based on the access time, that is, the access record information is sorted in time order. In general, sorting in time series means sorting access record information from early to late according to time series to obtain an access time series. In addition, the access record information may be sorted from late to early according to the time sequence. As shown in table 1, there are three pieces of access record information of the target user a, and the corresponding access times are respectively: 09:00: 00. 09:10: 00. 09:35:00, the three pieces of access record information in fig. 1 may be ordered from early to late according to access time. The resulting access data sequence may also be characterized in tabular form.
The access time sequence at this time is a sequence in which access record information is time-ordered. Determining the time difference of adjacent access time in the access time sequence, analyzing the time difference of the adjacent access time, judging whether the access behavior information corresponding to each adjacent access time can be subjected to aggregation operation according to the analysis result, and acquiring a first access data sequence based on the aggregated access behavior information if the access behavior information corresponding to each adjacent access time can be aggregated. And taking the access behavior information which cannot be subjected to aggregation operation as a second access data sequence. And obtaining the access data sequence based on the first access data sequence and the second access data sequence.
In this embodiment, by sorting the access record information according to the access time, and determining whether the access behavior information corresponding to each adjacent access time can be aggregated according to the time difference between the adjacent access times in the access time sequence, the access record information can be aggregated more accurately, so as to obtain a more accurate access data sequence.
In an exemplary embodiment, the aggregating operation is performed on each access behavior information according to the time difference between adjacent access times to obtain an access data sequence, including:
under the condition that the time difference of the adjacent access time is not larger than a preset aggregation time threshold value, the access behavior information corresponding to the adjacent access time is aggregated to the same data to obtain aggregated data; based on each aggregate data, an access data sequence is obtained.
Specifically, when judging whether the access behavior information corresponding to each adjacent access time can be aggregated according to the time difference of the adjacent access time in the access time sequence, judging whether the time difference of the adjacent access time is larger than a preset aggregation time threshold, if the obtained judgment result represents that the time difference of the adjacent access time is larger than the preset aggregation time threshold, the access behavior information corresponding to each adjacent access time cannot be aggregated; if the obtained judging result indicates that the time difference of the adjacent access time is smaller than or equal to a preset aggregation time threshold, aggregating the access behavior information corresponding to each adjacent access time. The preset aggregation time threshold is configured by service personnel according to self service conditions of an enterprise, and the preset aggregation time threshold comprises, but is not limited to, one hour, two hours, three hours and the like. Taking setting the preset aggregation time threshold as an example of one hour, the setting basis is mainly that the task to be completed after the user logs in the system can be completed normally within one hour.
And under the condition that the time difference of the adjacent access times is smaller than or equal to a preset aggregation time threshold value, performing aggregation operation on the access behavior information corresponding to each adjacent access time, namely aggregating the access behavior information corresponding to each adjacent access time into the same number to obtain aggregated data. In the process of aggregating the same data to obtain aggregated data, if the access behavior information corresponding to each adjacent access time is the same, the number of times of the access behavior information needs to be increased in the aggregated data, for example, the access time is 09:00:00 and 09:10:00 is taken as an example, when 09:00: the access behavior information of 00 is browsing news page, 09:10: when the access behavior information of 00 is browsing news pages, 09:00:00 and 09:10:00 are respectively corresponding to the access behavior information and are aggregated into the same data to obtain aggregated data, and the aggregated access behavior information in the aggregated data is: the news page is browsed 2 times. It can be seen that the aggregate data includes aggregate access behavior information, where the aggregate access behavior information includes access objects and event times, and the aggregate access behavior information is stored in a map data structure. In addition, the aggregated data not only includes the aggregated access behavior information, but also includes an aggregation start time and an aggregation end time, wherein the aggregation start time is an earlier access time in the adjacent access times, and the aggregation end time is a later access time in the adjacent access times.
Further, the aggregated data corresponding to the aggregation start time and the aggregation end time may be regarded as access behavior information corresponding to the access time, and the aggregated data may be aggregated with other adjacent access behavior information not yet aggregated or adjacent aggregated data again to determine whether the same data can be aggregated. And taking the interval time between the aggregation end time of the aggregation data and the access time corresponding to the adjacent access behavior information which is not aggregated, or the interval time between the aggregation start time of the aggregation data and the aggregation end time of other adjacent aggregation data which is earlier or the interval time between the aggregation end time of the aggregation data and the aggregation start time of other adjacent aggregation data which is later as the time difference of the adjacent access time, and aggregating the access behavior information or the aggregation data corresponding to the adjacent access time to the same data when the time difference of the adjacent access time is smaller than or equal to a preset aggregation time threshold value to obtain the aggregation data.
And finally, sequencing the aggregate data according to time to obtain an access data sequence.
In practical application, taking table 1 as an example, let the preset aggregation time threshold be 1h, 09 in fig. 1: 00:00 and 09:10:00 is the adjacent access time, the time difference of the adjacent access time is 10min, that is, the time difference of the adjacent access time is smaller than the preset aggregation time threshold, and the method comprises the following steps: 00: access behavior information corresponding to 00 and 09:10: and the access behavior information corresponding to 00 is aggregated to the same aggregated data.
And 09 in table 1: 35:00 and adjacent access time 09:10:00 is 25min, 09 can also be: 35: access behavior information corresponding to 00 and 09:10: and (3) aggregating the access behavior information corresponding to 00 into the same aggregate data to obtain a final access data sequence shown as data corresponding to the target user A in the table 2.
If the target user is B or the target user is C, the access record information corresponding to B, C in table 1 is aggregated, and the obtained access data sequence is also shown in table 2.
TABLE 2 partial Access data sequences for different users
In this embodiment, when the time difference between the adjacent access times is less than or equal to the preset aggregation time threshold, the access behavior information corresponding to the adjacent access times is aggregated to the same data to obtain the aggregated data, so that a more accurate access data sequence can be obtained efficiently.
In one exemplary embodiment, determining the access interval time of the target user based on the access data sequence includes:
and determining the access interval time of the target user based on the interval time of the time adjacent aggregated data in the access data sequence.
Specifically, the aggregate data in the access data sequence is aggregate data in which different access behavior information is aggregated together based on access time, and the access interval time of the target user can be determined by regarding the aggregate data as access record information. And the method for determining the access interval time of the target user is as follows: the method comprises the steps of determining interval time of time adjacent aggregated data in an access data sequence to determine access interval time of a target user, wherein the access interval time of the target user is more than one. And the interval time of the time adjacent aggregation data in the access data sequence is obtained by the aggregation ending time of the earlier aggregation data and the aggregation starting time of the later aggregation data.
For example, in table 3, the first aggregate data and the second aggregate data adjacent to the first aggregate data are taken as an access data sequence of the target user a, the interval time of the aggregate data is 25h25min, and the interval time between the adjacent aggregate data in each other time in table 3 is 25h25min and 24h25min. Thus, the access intervals of the target user are also 25h25min, 25h25min and 24h25min.
TABLE 3 Access data sequence for target user A
In this embodiment, the access interval time of the target user can be accurately determined based on the interval time of adjacent aggregate data in the access data sequence, so that interference caused by the excessively short access interval time to determining the frequency access type of the target user is avoided.
In one exemplary embodiment, as shown in fig. 3, S800 includes:
S820, determining the access frequency type of the target user based on the access interval time.
S840, determining the expiration time of the access session of the target user based on the access frequency type.
Specifically, the interval time of the aggregation data adjacent to the time is analyzed, the interval time of the aggregation data adjacent to the time is compared with a preset interval time threshold value, and the access frequency type of the target user is determined. The preset interval time threshold is interval time customized by service personnel, and the access frequency type of the target user comprises a high-frequency access type, a low-frequency access type frequency and an indefinite access type. When each access interval time is smaller than a preset high-frequency interval time threshold value, the frequency of the user access subsystem is high, the access frequency type of the target user is determined to be a high-frequency access type, and the user frequently accesses the subsystem. When each access interval time is larger than a preset low-frequency interval time threshold value, the frequency of the user access subsystem is low, and the access frequency type of the target user is a low-frequency access type. When the access interval time is not fixed, that is, the access interval time is smaller than the preset high-frequency interval time threshold value and larger than the preset low-frequency interval time threshold value, the frequency of the user access subsystem is not fixed, and the access frequency type of the target user is a frequency-uncertain access type.
Still taking table 3 as an example, the access interval time of each piece of aggregate data of the target user a is about 24 hours or more, and the access frequency type of the target user a at this time is a low-frequency access type; as shown in table 4, the target user a is basically accessing during the working time, and the access interval time of the working time is considered to be 0, and the access frequency type of the target user a at this time is a high-frequency access type; as shown in table 5, the frequency of access to the subsystem by the target user a is not fixed, and the access interval time of the working time is 0, and the access interval time is several days, and thus the access frequency type of the target user a at this time is a frequency-variable access type.
Table 4 Access data sequence corresponding to the case where user A is of the high frequency Access type in actual application
Table 5 Access data sequence corresponding to the case where user A is of the type of access with indefinite frequency in actual application
And determining the access session expiration time of the target user by determining the access frequency type of the target user, namely setting different access session expiration time for users corresponding to different access frequency types.
In this embodiment, by determining the access frequency type of the target user based on the access interval time as a division basis, different access session expiration durations are set for the target user when the target user belongs to different access frequency types. The method can replace the access session expiration time fixed by different users in the traditional technology, and avoid the cache waste caused by longer access session expiration time or the need of logging in again due to the expiration of the access session in use caused by shorter access session expiration time.
In one exemplary embodiment, determining the access session expiration duration of the target user based on the access frequency type includes:
Acquiring the aggregation time length of each aggregation data in the access data sequence under the condition that the access frequency type is a low-frequency access type; and determining the access session expiration time of the target user based on the maximum aggregation time of the aggregation time and the preset first longest expiration time and the preset first shortest expiration time of the low-frequency access type.
The first longest expiration time and the preset first shortest expiration time are defined by a user, the preset first longest expiration time in practical application is generally determined by the time of a user working in one day, and the preset first shortest expiration time is the shortest expiration time which ensures that repeated login is not needed.
In particular, when the access frequency type is a low frequency access type, the frequency characterizing the target user's access subsystem is low. At this time, the aggregation time length of each aggregation data in the access data sequence can be acquired, and the access data sequence is obtained based on the historical access record information. And determining the maximum aggregation time length from the aggregation time lengths, wherein the maximum aggregation time length can be regarded as the maximum time length of continuous access of the user in a period of time, and the continuous access means that the interval time of the user access in the maximum aggregation time length is smaller than or equal to a preset aggregation time threshold value. And determining the access session expiration time of the target user based on the maximum aggregation time of the aggregation time, the preset first longest expiration time of the low-frequency access type and the preset first shortest expiration time.
In this embodiment, by acquiring the aggregation duration of each aggregation data in the access data sequence of the low-frequency access type and acquiring the preset first longest expiration duration and the preset first shortest expiration duration of the low-frequency access type, the expiration duration of the access session of the target user can be accurately determined based on the preset first longest expiration duration and the preset first shortest expiration duration of the aggregation duration.
In an exemplary embodiment, determining the access session expiration duration of the target user based on the preset first longest expiration duration and the preset first shortest expiration duration of the aggregation duration, including:
Determining a smaller value of the maximum aggregation duration and a preset first longest expiration duration; and determining the smaller value and the larger value in the preset first shortest expiration time as the expiration time of the access session of the target user.
Specifically, the session expiration duration of the low frequency access type is: session expiration time=max (min (maximum aggregate duration, preset first longest expiration duration), preset first shortest expiration duration). And determining a smaller value of the maximum aggregation time length and the preset first longest expiration time length, and when the maximum aggregation time length is smaller than the first longest expiration time length, taking the maximum aggregation time length as the smaller value, and selecting the session expiration time length at the moment from the maximum aggregation time length and the preset first shortest expiration time length, so that the waste of the cache caused by selecting the first longest expiration time length as the access session expiration time length is avoided. When the maximum aggregation time length is longer than the first longest expiration time length, the preset first longest expiration time length is taken as a smaller value, and the session expiration time length at the moment is selected from the preset first longest expiration time length and the preset first shortest expiration time length, so that excessive occupation of the session on a cache when the maximum aggregation time length is too long as the access session expiration time length is avoided.
Further, taking the smaller value as the maximum aggregation time length as an example, when the maximum aggregation time length is smaller than the preset first shortest expiration time length, the access session expiration time length is the preset first shortest expiration time length, that is, the user can be in a login state when accessing each time, and the login is not required to be repeated, and even if the preset first shortest expiration time length is smaller than the preset first shortest expiration time length, the session expiration time length is not required to be set as the maximum aggregation time length. When the maximum aggregation time length is longer than the preset first shortest expiration time length, the session expiration time length can be determined to be the maximum aggregation time length, and the problem that the session data cannot be cleaned in time due to the fact that the session expiration time length is too long is avoided.
In addition, there are cases where the maximum aggregation duration is equal to the preset first longest expiration duration, or the smaller value is equal to the preset first shortest expiration duration, and when the maximum aggregation duration is equal to the preset first longest expiration duration, one of the two equal data may be arbitrarily selected as the smaller value or the larger value.
For example, the aggregation time periods of the target user a are shown in table 6, and the maximum aggregation time period of the target user a is 40min, so that the preset first longest expiration time period is 12h, and the preset first shortest expiration time period is 1h.
TABLE 6 aggregation time periods for target user A
| User' s | Polymerization start time | Polymerization end time | Duration of polymerization | Interval time of |
| A | 2023-07-10 09:00:00 | 2023-07-10 09:35:00 | 35 Minutes | |
| A | 2023-07-11 11:00:00 | 2023-07-11 12:30:00 | 25 Minutes | 25 Hours 25 minutes |
| A | 2023-07-12 10:00:00 | 2023-07-12 10:40:00 | 40 Minutes | 21 Hours 30 minutes |
| A | 2023-07-13 15:00:00 | 2023-07-10 15:10:00 | For 10 minutes | 28 Hours 20 minutes |
| A | 2023-07-18 15:00:00 | 2023-07-18 15:10:00 | For 10 minutes | 119 Hours 50 minutes |
The expression of the session expiration time at this time is: session expiration time=max (min (40 min,12 h), 1 h), resulting in a final access session expiration duration of 1h.
In this embodiment, by determining a smaller value of the maximum aggregation duration and the preset first longest expiration duration when the frequency access type is the low frequency access type; and determining the smaller value and the larger value in the preset first shortest expiration time as the expiration time of the access session of the target user, so that the target user can be ensured to log in only once in the work task of the same day without repeatedly logging in.
In one exemplary embodiment, determining the access session expiration duration of the target user based on the access frequency type includes:
and taking the preset high-frequency session expiration time as the access session expiration time of the target user under the condition that the access frequency type is the high-frequency access type.
Specifically, when the access frequency type is a high-frequency access type, the frequency of representing that the target user accesses the subsystem is high, and the user is considered to access the subsystem within the preset high-frequency session expiration time. Therefore, the preset high-frequency session expiration time period can be used as the access session expiration time period of the target user. The user only needs to log in for the first time when working tasks on the same day, and no log in is needed in the follow-up. And after the last login, the session is expired after the time corresponding to the preset high-frequency session expiration time. The login is performed again the next day. If the preset high-frequency session expiration time is set to be 1h, when the frequency access type is the high-frequency access type, the user accesses the subsystem in each hour, so that when the user accesses the subsystem for the first time, the session expiration time is 1h, when the user accesses the subsystem for the second time, the session is not expired yet, the user does not need to log in repeatedly, and because the user performs new access behaviors, the session expiration time is updated to be 1h until the subsystem is accessed for the last time, and the session expiration time is updated to be 1h again.
In this embodiment, by taking the preset high-frequency session expiration duration as the access session expiration duration of the target user in the case that the access frequency type is the high-frequency access type, the user can log in the subsystem once in a day, and then does not need to log in repeatedly.
In one exemplary embodiment, determining the access session expiration duration of the target user based on the access frequency type includes:
Under the condition that the access frequency type is a frequency-variable access type, acquiring the aggregation duration and the aggregation access behavior information of each aggregation data in the access data sequence; determining a regression coefficient of a preset regression model based on each aggregation time length and the aggregation access behavior information; based on the regression coefficients, an access session expiration duration is determined.
In particular, when the access frequency type is a frequency-independent access type, the frequency characterizing the target user's access subsystem is not fixed. Such as sometimes all day access is required, sometimes at intervals of a few days. Because the access data sequence is obtained according to the access record information in the past time period, the session expiration time of the newly added access record information can be judged according to some rules in the historical access data sequence. More specifically, the aggregate duration and aggregate access behavior information for each aggregate data may be obtained from the access data sequence. And the aggregate access behavior information comprises access times and the like corresponding to each access behavior type. And each access behavior type in the access behavior information is aggregated to distinguish the access object from the access event, and when the access object and the access event are different, the access type of each access behavior information is also different.
And acquiring a preset regression model, and calculating a regression coefficient corresponding to the preset regression model based on each aggregation time length and the aggregation access behavior information. And determining the session expiration time corresponding to the subsequent newly-added access record information based on the regression coefficient. The regression coefficient is determined based on the aggregation time length and the aggregation access behavior information, so that the aggregation time length after the access record information is added can be determined based on the regression coefficient and the aggregation access behavior information containing the newly added access behavior information, and the access session expiration time length corresponding to the newly added access record information can be determined through the aggregation time length. Wherein the preset regression model includes, but is not limited to, y=f (x) =Σb ixi+b0, where i=1, 2,3, ….
In this embodiment, since the access session expiration time is difficult to be determined by the frequency-variable access type in a mode of maximum value and minimum value, the application analyzes each piece of aggregated data in the historical access data sequence to obtain the aggregation time of each piece of aggregated data and the aggregated access behavior information, and determines the regression coefficient corresponding to the preset regression model related to the aggregation time of each piece of aggregated data and the aggregated access behavior information based on the aggregation time of each piece of aggregated data and the aggregated access behavior information, thereby determining the aggregation time for the newly added access behavior information more accurately through the regression coefficient, and further determining the access session expiration time corresponding to the newly added access record information accurately through the aggregation time.
In an exemplary embodiment, the regression coefficient is calculated based on each aggregation duration and the aggregate access behavior information, including:
acquiring access times corresponding to different aggregation access behaviors from the aggregation access behavior information; and determining regression coefficients of the preset regression model based on the access times respectively corresponding to the aggregation duration and the different aggregation access behaviors.
Specifically, the aggregate access behavior information includes access times corresponding to each access behavior type, and access times corresponding to each access behavior type are obtained from the aggregate access behavior information, that is, access times corresponding to different aggregate access behaviors are obtained. And establishing an original table or updating the original table based on the access times respectively corresponding to the access behavior types and the aggregation duration of different aggregation access behavior information. The table comprises the times and the aggregation time length corresponding to each access behavior type in the aggregation access behaviors. Analyzing the table, taking the aggregation time length as a dependent variable, taking the access times corresponding to each access behavior type as independent variables, respectively substituting the aggregation time length and the access times corresponding to each access behavior information type into a preset regression model, and calculating to obtain a regression coefficient.
As shown in table 7, based on the table, the number of accesses corresponding to each access behavior type in the aggregated access behavior information may be used as the argument x, and the number of accesses corresponding to each access behavior type may include: the number of times x 1 of browsing the large-disc quotation pages, the number of times x 2 of ordering stock trading pages, the number of times x 3 of browsing news pages, the number of times x 4 of browsing commodity pages, the number of times x 5 of ordering commodity pages, the number of times x 6 of browsing video pages and the like, and different access record information has different access behavior types, the number of the access behavior types is not fixed, namely the types of independent variables in a preset regression model are uncertain. The polymerization time period was used as an argument y, and a table was obtained as shown in table 8.
Table 7 aggregate duration table when target user is frequency-independent access type
Table 8 table with the access times and aggregation time length corresponding to each access behavior type in the aggregated access behavior as variables
For the first piece of aggregate data in table 8, the number of accesses corresponding to each access type in the aggregate access behavior information includes: the number of browsing the large-disc quotation pages is x 1, the number of ordering the stock trading pages is x 2, the number of accesses corresponding to x 1 is 150, the number of accesses corresponding to x 2 is 3, the aggregation time length is 8h as y 1, the regression coefficient corresponding to x 1 is b 1,x2, the regression coefficient corresponding to b 2, and b 1、x1、b2、x2 is substituted into a preset regression model. The preset regression model may be y= Σb ixi +b0, where i=1, 2,3, …; the aggregation duration y 1=b1x1+b2x2+b0 of the first piece of aggregated data results in 8h=150b 1+3b2+b0. For the third piece of aggregation data in the table, the access times corresponding to each access behavior type in the aggregation access behavior information comprise: the number of browsing the large-disc quotation pages is x 1, the number of ordering the stock trading pages is x 2, the aggregation duration is 7h and 35min is taken as y 1, the regression coefficient corresponding to x 1 is b 2 and the regression coefficient corresponding to b 1,x2 is substituted into a preset regression model, and the sum of y 2=b1x1+b2x2 and b0 is 7h and 35 min=230b 1+4b2+b0. From this, the system of linear equations corresponding to table 8 is:
8h=150b1+3b2+b0;
7h35min=230b1+4b2+b0;
1h35min=10b3+b0;
10min=10b4+2b5+b0;
10min=2b4+b5+b0;
2h10min=10b3+2b4+b5+b0。
Based on the above-described linear equation set, a regression coefficient Σb i or the like is calculated.
In this embodiment, the regression coefficient corresponding to each access behavior type is obtained by analyzing the historical access record information, so that the session expiration time length corresponding to the newly added access record information can be determined based on the historical access record information under the condition that the frequency access type is the frequency-uncertain access type.
In one exemplary embodiment, determining the access session expiration time based on the regression coefficients includes:
Under the condition that the latest access record information of the target user is received, acquiring the latest access behavior information and the corresponding latest access time in the latest access record information, and updating the access data sequence based on the latest access time and the latest access behavior information; determining an aggregation prediction time length according to the access behavior information and the regression coefficient in the updated access data sequence; and determining the access session expiration time of the target user based on the aggregation prediction time, the preset second longest expiration time and the preset second shortest expiration time of the frequency-variable access type.
Specifically, the SSO system establishes for each user an access data sequence comprising: the system comprises a user identifier and access record information, wherein the access record information comprises access behavior information and access time, and the access behavior information comprises an access object and an access event. When the target user is of a frequency-variable access type, and when the SSO system acquires the latest access record information of the target user and the latest access time corresponding to the latest access record information, the access data sequence can be updated based on the latest access time and the latest access behavior information, and the latest access record information of the acquired target user is essentially the access record information generated when the target user initially transmits an access request at the terminal.
When updating the access data sequence, firstly, judging how long the latest access time of the target user is from the interval time of the last access time, if the latest access time is longer than the preset access interval time, clearing the existing access data sequence, taking the latest access record information as a new access data sequence, and calculating the aggregation prediction time length based on the access behavior information and the regression coefficient in the updated access data sequence; if the access interval time is smaller than the preset access interval time, the latest access record information is added to the latest piece of aggregation data in the existing access data sequence, and the latest piece of aggregation data in the access data sequence is updated. Taking the example that the number of times of browsing the large-disc quotation page x 1, the number of times of browsing the news page x 3, the number of times of browsing the commodity page x 4 and the number of times of placing the commodity page x 5 in the updated access data sequence is 8, x 1、x3、x4、x5 is substituted into a preset regression model to obtain y=b 0+8b1+5b3+3b4+b5. Since the regression coefficient Σb i is known, the aggregation predicted time length y can be obtained. And finally, determining the expiration time of the access session of the target user based on the aggregation prediction time, the preset second longest expiration time and the preset second shortest expiration time of the access type with variable frequency.
In this embodiment, since the regression coefficient is determined based on the number of times that the aggregation duration in the historical access data sequence corresponds to each access behavior type, when there is the latest access record information, the aggregation prediction duration can also be accurately calculated by presetting the regression coefficient in the regression model. And determining the access session expiration time of the target user based on the aggregation prediction time, the preset second longest expiration time and the preset second shortest expiration time of the frequency-variable access type.
In an exemplary embodiment, determining the access session expiration duration of the target user based on the aggregate predicted duration, the preset second longest expiration duration and the preset second shortest expiration duration of the frequency-variable access type, includes:
Determining a larger value of the aggregation predicted time length and a preset second shortest expiration time length; and determining the smaller value of the larger value and the preset second longest expiration time as the expiration time of the access session of the target user.
Specifically, the session expiration duration of the frequency-dependent access type is: session expiration time=min (max (predicted aggregate time, preset second shortest expiration time), preset second longest expiration time). Determining a larger value of the predicted aggregation time length and the preset second shortest expiration time length, taking the predicted aggregation time length as the larger value when the predicted aggregation time length is larger than the preset second shortest expiration time length, and selecting the session expiration time length at the moment from the predicted aggregation time length and the preset second longest expiration time length, so that the inefficiency caused by repeated login when the preset second shortest expiration time length is selected as the access session expiration time length is avoided. When the preset second shortest expiration time is longer than the predicted aggregation time, the preset second shortest expiration time is taken as a larger value, and the session expiration time at the moment is selected from the preset second shortest expiration time and the preset second longest expiration time, so that the waste of the session to the cache when the predicted aggregation time is taken as the access session expiration time is avoided.
Further, taking a larger value as the predicted aggregation time length as an example, when the predicted aggregation time length is smaller than the preset second longest expiration time length, the access session expiration time length is the predicted aggregation time length, that is, the user can be in a login state when accessing each time, and the login is not required to be repeated. When the preset second longest expiration time is smaller than the predicted aggregation time, the session expiration time can be determined to be the preset second longest expiration time, and excessive occupation of the cache when the predicted aggregation time is used as the session expiration time is avoided.
In addition, there are cases where the aggregation predicted time length is equal to the preset second shortest expiration time length or a larger value is equal to the preset second longest expiration time length, and when the aggregation predicted time length is equal to the preset second shortest expiration time length, one of the two equal data may be arbitrarily selected as the smaller value or the larger value.
In this embodiment, a larger value of the aggregate predicted duration and the preset second shortest expiration duration is determined; and determining the smaller value of the larger value and the preset second longest expiration time as the expiration time of the access session of the target user, so that the expiration time of the access session of the target user with the variable access frequency can be accurately determined, and the cache is not wasted and is not excessively occupied.
In one embodiment, the user may directly initiate a session expiration duration determination request to the SSO system through the terminal, or when accessing the subsystem, the subsystem invokes the SSO system, so that the SSO system determines a session expiration duration of the newly added session. As shown in fig. 4, when the SSO system determines the session expiration time, the following method is generally adopted:
S1, starting.
S2, acquiring historical detail data of the user, namely historical access record information.
And S3, aggregating the history detail data to obtain an access data sequence.
S4, analyzing the access data sequence, determining the access frequency type of the user, and setting different expiration time of the access session when the access frequency types of the user are different. And the access frequency type of the user includes a low frequency access type, a high frequency access type, and a frequency-indefinite access type.
S5, ending.
In practical application, as shown in fig. 5, the method for determining the expiration duration of the access session of the target user C includes:
s11, the target user C interacts with the terminal of the target user C, so that the terminal sends an access request to the subsystem a, and the access request carries the target user identification.
S12, because the subsystem can call the login verification service of the SSO system, a server of the SSO system can acquire the target user identification and acquire the history access record information of the target user C from the database through the target user identification, wherein the history access record information is selected by the user, for example, the access record information of the past month can be selected. In the application example, in order to better explain how to determine the expiration time of the access session, therefore, the selected access record information is less, and in the application, more access record information is generally needed, so that the regression coefficient obtained by calculation is accurate.
The historical access record information is ordered based on the access events in the historical access record information, and an access time sequence is obtained as shown in table 9:
TABLE 9 Access event sequence for target user C
| User' s | Subsystem | Event(s) | Access time |
| C | News | Browsing | 2023-07-20 09:00:00 |
| C | News | Browsing | 2023-07-20 09:10:00 |
| C | News | Browsing | 2023-07-20 09:35:00 |
| C | Goods commodity | Browsing | 2023-07-20 12:00:00 |
| C | News | Browsing | 2023-07-20 12:30:00 |
| C | News | Browsing | 2023-07-20 13:20:00 |
| C | Goods commodity | Browsing | 2023-07-21 14:25:00 |
| C | News | Browsing | 2023-07-21 14:30:00 |
Analyzing the table 9, judging whether the time difference of the adjacent access time in the table 9 is larger than a preset aggregation time threshold, and aggregating the access behavior information corresponding to the adjacent access time to the same data when the time difference of the adjacent access time is smaller than or equal to the preset aggregation time threshold. Let the preset aggregation time threshold be 1h, it can be considered that the 1 st, 2 nd and 3 rd access record information in table 9 can be aggregated to the same data to obtain aggregated data, the 4 th and 5th access record information in table 9 can be aggregated to the same data to obtain aggregated data, but the 3 rd and 4 th access record information in table 9 cannot be aggregated to the same data. Thus, the resulting access data sequence is shown in Table 10:
table 10 access data sequence for target user C
As can be obtained from table 10, the aggregation duration of each aggregation data of the target user C is 35min, 1h20min and 5min, and the interval time of accessing the aggregation data adjacent in time in the data sequence is 2h25min and 25h5min; thus, the frequency access type of the target user C can be regarded as a frequency-indefinite access type. Analyzing table 9, substituting the news-browsing times as x 1, the commodity-browsing times as x 2, the aggregation duration of each aggregation data as y into a preset regression model y=Σb ixi+b0, and the final regression model is as follows:
y1=3b1+b0;
y2=2b1+b2+b0;
y3=b1+b2+b0;
the regression coefficients b 1、b2 and b 0 are obtained by analysis.
S13, acquiring current access record information currently accessed by the target user C, and judging whether the time interval between the access time of the current access record information and the last access time is larger than a preset aggregation time threshold. If yes, go to S14, if no, go to S15.
S14, if the current access record information is 2023-07-22: 30:00 accesses the commodity browsing page, and the original access data sequence is emptied and the current access record information is used as a new access data sequence because the time interval of the current access time corresponding to the current access record information from the last access time is greater than a preset aggregation time threshold value for 1 h.
S15, if the current access record information is that the commodity browsing page is accessed in 2023-07-21:00:00, as the time interval of the current access time corresponding to the current access record information from the last access time is smaller than a preset aggregation time threshold value for 1h, adding the current access record information to the last aggregation data to obtain:
table 11 updated aggregate data
At this time, since the regression coefficients b1, b2, and b0 are known, the aggregation time length corresponding to the aggregated data including the current access record information, that is, the predicted aggregation time length y c=b0+b1+2b2, can be predicted based on the regression coefficients and the number of times corresponding to each access behavior type.
S17, based on the predicted aggregation time length, according to the expression: session expiration time=min (max (predicting aggregation time, presetting a second shortest expiration time, presetting a second longest expiration time), determining a final session expiration time.
S18, ending.
It should be understood that, although the steps in the flowcharts related to the embodiments described above are sequentially shown as indicated by arrows, these steps are not necessarily sequentially performed in the order indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in the flowcharts described in the above embodiments may include a plurality of steps or a plurality of stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of the steps or stages is not necessarily performed sequentially, but may be performed alternately or alternately with at least some of the other steps or stages.
Based on the same inventive concept, the embodiment of the application also provides a session expiration time determining device for implementing the session expiration time determining method. The implementation of the solution provided by the device is similar to the implementation described in the above method, so the specific limitation in the embodiments of the session expiration duration determining device provided below may refer to the limitation of the session expiration duration determining method described above, and will not be repeated herein.
In an exemplary embodiment, as shown in fig. 6, there is provided a session expiration duration determining apparatus, including: an access information acquisition module 200, an access information analysis module 400, an interval time determination module 600, and an expiration time determination module 800, wherein:
The access information acquisition module 200 is configured to acquire access record information of a target user, where the access record information includes access behavior information and a corresponding access time;
the access information analysis module 400 is configured to obtain an access data sequence based on the access time and the access behavior information;
an interval time determining module 600, configured to determine an access interval time of the target user based on the access data sequence;
the expiration duration determining module 800 is configured to determine an expiration duration of the access session of the target user according to the access interval time.
In one embodiment, the access information analysis module 400 is further configured to sort the access record information based on the access time, to obtain an access time sequence; and according to the time difference of adjacent access time in the access time sequence, carrying out aggregation operation on each piece of access behavior information to obtain an access data sequence.
In one embodiment, the access information analysis module 400 is further configured to aggregate the access behavior information corresponding to the adjacent access time to the same data to obtain aggregated data when the time difference between the adjacent access times is not greater than a preset aggregation time threshold; based on each aggregate data, an access data sequence is obtained.
In one embodiment, the interval determination module 600 is further configured to determine the access interval of the target user based on the intervals of the aggregated data that are adjacent in time in the access data sequence.
In one embodiment, the expiration duration determining module 800 is further configured to determine an access frequency type of the target user based on the access interval time; based on the access frequency type, an access session expiration duration of the target user is determined.
In one embodiment, the expiration duration determining module 800 is further configured to obtain an aggregation duration of each aggregation data in the access data sequence when the access frequency type is a low frequency access type; and determining the access session expiration time of the target user based on the maximum aggregation time of the aggregation time and the preset first longest expiration time and the preset first shortest expiration time of the low-frequency access type.
In one embodiment, the expiration period determining module 800 is further configured to determine a smaller value of the maximum aggregate period and the preset first longest expiration period; and determining the smaller value and the larger value in the preset first shortest expiration time as the expiration time of the access session of the target user.
In one embodiment, the expiration duration determining module 800 is further configured to, in a case where the access frequency type is a high frequency access type, set a preset high frequency session expiration duration as the access session expiration duration of the target user.
In one embodiment, the expiration duration determining module 800 is further configured to obtain an aggregation duration of each aggregated data in the access data sequence and aggregated access behavior information when the access frequency type is a frequency-variable access type; determining a regression coefficient of a preset regression model based on each aggregation time length and the aggregation access behavior information; based on the regression coefficients, an access session expiration duration is determined.
In one embodiment, the expiration duration determining module 800 is further configured to obtain access times corresponding to different aggregate access behaviors from the aggregate access behavior information; and determining regression coefficients of the preset regression model based on the access times respectively corresponding to the aggregation duration and the different aggregation access behaviors.
In one embodiment, the expiration time determining module 800 is further configured to, when receiving the latest access record information of the target user, obtain the latest access behavior information and the corresponding latest access time in the latest access record information, and update the access data sequence based on the latest access time and the latest access behavior information; determining an aggregation prediction time length according to the access behavior information and the regression coefficient in the updated access data sequence; and determining the access session expiration time of the target user based on the aggregation prediction time, the preset second longest expiration time and the preset second shortest expiration time of the frequency-variable access type.
In one embodiment, the expiration period determining module 800 is further configured to determine a larger value of the aggregate predicted period and the preset second shortest expiration period; and determining the smaller value of the larger value and the preset second longest expiration time as the expiration time of the access session of the target user.
The above-mentioned modules in the session expiration time determining apparatus may be implemented in whole or in part by software, hardware, and a combination thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In one exemplary embodiment, a computer device is provided, which may be a server, the internal structure of which may be as shown in fig. 7. The computer device includes a processor, a memory, an Input/Output interface (I/O) and a communication interface. The processor, the memory and the input/output interface are connected through a system bus, and the communication interface is connected to the system bus through the input/output interface. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database of the computer device is used for storing data such as access record information. The input/output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used for communicating with an external terminal through a network connection. The computer program when executed by a processor implements a session expiration duration determination method.
It will be appreciated by those skilled in the art that the structure shown in FIG. 7 is merely a block diagram of some of the structures associated with the present inventive arrangements and is not limiting of the computer device to which the present inventive arrangements may be applied, and that a particular computer device may include more or fewer components than shown, or may combine some of the components, or have a different arrangement of components.
In an exemplary embodiment, a computer device is provided, comprising a memory and a processor, the memory having stored therein a computer program, the processor performing the steps of the method embodiments described above when the computer program is executed.
In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored which, when executed by a processor, carries out the steps of the method embodiments described above.
In an embodiment, a computer program product is provided, comprising a computer program which, when executed by a processor, implements the steps of the method embodiments described above.
It should be noted that, the user information (including but not limited to user equipment information, user personal information, etc.) and the data (including but not limited to data for analysis, stored data, presented data, etc.) related to the present application are both information and data authorized by the user or sufficiently authorized by each party, and the collection, use and processing of the related data are required to meet the related regulations.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, database, or other medium used in embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, high density embedded nonvolatile Memory, resistive random access Memory (ReRAM), magneto-resistive random access Memory (Magnetoresistive Random Access Memory, MRAM), ferroelectric Memory (Ferroelectric Random Access Memory, FRAM), phase change Memory (PHASE CHANGE Memory, PCM), graphene Memory, and the like. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory, and the like. By way of illustration, and not limitation, RAM can be in various forms such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), etc. The databases referred to in the embodiments provided herein may include at least one of a relational database and a non-relational database. The non-relational database may include, but is not limited to, a blockchain-based distributed database, and the like. The processor referred to in the embodiments provided in the present application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, or the like, but is not limited thereto.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The foregoing examples illustrate only a few embodiments of the application and are described in detail herein without thereby limiting the scope of the application. It should be noted that it will be apparent to those skilled in the art that several variations and modifications can be made without departing from the spirit of the application, which are all within the scope of the application. Accordingly, the scope of the application should be assessed as that of the appended claims.
Claims (15)
1. A method for determining a session expiration period, the method comprising:
obtaining access record information of a target user, wherein the access record information comprises access behavior information and corresponding access time;
based on the access time and the access behavior information, obtaining an access data sequence;
determining access interval time of the target user based on the access data sequence;
and determining the expiration time of the access session of the target user according to the access interval time.
2. The method of claim 1, wherein the obtaining an access data sequence based on the access time and the access behavior information comprises:
based on the access time, ordering the access record information to obtain an access time sequence;
And according to the time difference of adjacent access time in the access time sequence, carrying out aggregation operation on each piece of access behavior information to obtain an access data sequence.
3. The method according to claim 2, wherein the aggregating each access behavior information according to the time difference between adjacent access times to obtain an access data sequence includes:
Under the condition that the time difference of adjacent access time is not larger than a preset aggregation time threshold, aggregating the access behavior information corresponding to the adjacent access time to the same data to obtain aggregated data;
based on each of the aggregated data, an access data sequence is obtained.
4. A method according to claim 2 or 3, wherein said determining the access interval time of the target user based on the access data sequence comprises:
And determining the access interval time of the target user based on the interval time of the time adjacent aggregated data in the access data sequence.
5. The method of claim 1, wherein said determining an access session expiration duration of the target user based on the access interval time comprises:
Determining an access frequency type of the target user based on the access interval time;
and determining the expiration time of the access session of the target user based on the access frequency type.
6. The method of claim 5, wherein the determining the access session expiration duration of the target user based on the access frequency type comprises:
Acquiring the aggregation time length of each aggregation data in the access data sequence under the condition that the access frequency type is a low-frequency access type;
And determining the access session expiration time of the target user based on the maximum aggregation time of the aggregation time and the preset first longest expiration time and the preset first shortest expiration time of the low-frequency access type.
7. The method of claim 6, wherein the determining the access session expiration duration of the target user based on the preset first longest expiration duration and the preset first shortest expiration duration of the low frequency access type for the maximum aggregation duration of the aggregation duration comprises:
determining a smaller value of the maximum aggregation duration and the preset first longest expiration duration;
And determining the smaller value and the larger value in the preset first shortest expiration time as the access session expiration time of the target user.
8. The method of claim 5, wherein the determining the access session expiration duration of the target user based on the access frequency type comprises:
And under the condition that the access frequency type is a high-frequency access type, taking the preset high-frequency session expiration time as the access session expiration time of the target user.
9. The method of claim 5, wherein the determining the access session expiration duration of the target user based on the access frequency type comprises:
acquiring the aggregation duration and the aggregation access behavior information of each aggregation data in the access data sequence under the condition that the access frequency type is a frequency-variable access type;
Determining a regression coefficient of a preset regression model based on each aggregation duration and the aggregation access behavior information;
and determining the expiration time of the access session based on the regression coefficient.
10. The method of claim 9, wherein calculating regression coefficients based on each of the aggregate duration and the aggregate access behavior information comprises:
Acquiring access times corresponding to different aggregation access behaviors from the aggregation access behavior information;
And determining regression coefficients of the preset regression model based on the access times respectively corresponding to the aggregation duration and the different aggregation access behaviors.
11. The method of claim 9, wherein the determining the access session expiration time based on the regression coefficients comprises:
Under the condition that the latest access record information of the target user is received, acquiring the latest access behavior information and the corresponding latest access time in the latest access record information, and updating the access data sequence based on the latest access time and the latest access behavior information;
determining an aggregation prediction time length according to the access behavior information in the updated access data sequence and the regression coefficient;
and determining the access session expiration time of the target user based on the aggregation prediction time, the preset second longest expiration time and the preset second shortest expiration time of the frequency-variable access type.
12. The method of claim 11, wherein the determining the access session expiration duration for the target user based on the aggregate predicted duration, the preset second longest expiration duration and the preset second shortest expiration duration for the frequency-dependent access type comprises:
determining a larger value of the aggregation predicted time length and the preset second shortest expiration time length;
And determining the smaller value of the larger value and the preset second longest expiration time as the expiration time of the access session of the target user.
13. A session expiration duration determining apparatus, the apparatus comprising:
The access information acquisition module is used for acquiring access record information of the target user, wherein the access record information comprises access behavior information and corresponding access time;
the access information analysis module is used for obtaining an access data sequence based on the access time and the access behavior information;
the interval time determining module is used for determining the access interval time of the target user based on the access data sequence;
and the expiration time determining module is used for determining the expiration time of the access session of the target user according to the access interval time.
14. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any one of claims 1 to 12 when the computer program is executed.
15. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 12.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202311404679.6A CN117972674A (en) | 2023-10-26 | 2023-10-26 | Method, device, computer equipment and storage medium for determining session expiration duration |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202311404679.6A CN117972674A (en) | 2023-10-26 | 2023-10-26 | Method, device, computer equipment and storage medium for determining session expiration duration |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN117972674A true CN117972674A (en) | 2024-05-03 |
Family
ID=90852036
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202311404679.6A Pending CN117972674A (en) | 2023-10-26 | 2023-10-26 | Method, device, computer equipment and storage medium for determining session expiration duration |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN117972674A (en) |
-
2023
- 2023-10-26 CN CN202311404679.6A patent/CN117972674A/en active Pending
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US12298878B2 (en) | Methods and systems for determining system capacity | |
| US9691035B1 (en) | Real-time updates to item recommendation models based on matrix factorization | |
| CN111580874B (en) | System safety control method and system for data application and computer equipment | |
| CN109885786B (en) | Data caching processing method and device, electronic equipment and readable storage medium | |
| WO2022100382A1 (en) | Blockchain-based credit loan recommendation method, and devices and storage medium | |
| JP2014063495A (en) | System and method for data privacy and destruction in multi-system landscape | |
| WO2021012877A1 (en) | Blockchain-based alliance member management method and apparatus, and computer device | |
| US10733244B2 (en) | Data retrieval system | |
| CN111241381A (en) | Information recommendation method, apparatus, electronic device, and computer-readable storage medium | |
| CN116561074A (en) | Method, device, computer equipment and storage medium for grouping resource data | |
| CN120104325A (en) | Resource processing method, device and computer equipment for cloud service platform | |
| CN114461895A (en) | Medical information pushing method and device, computer equipment and storage medium | |
| CN118761831A (en) | Business license data processing method, device, equipment and storage medium | |
| CN117972674A (en) | Method, device, computer equipment and storage medium for determining session expiration duration | |
| CN116938681A (en) | Twin data auditing method and device of network element equipment and computer equipment | |
| CN116155597A (en) | Access request processing method and device and computer equipment | |
| CN114490720A (en) | Searching and killing method and device, computer equipment and storage medium | |
| CN114185949A (en) | Information registration method, information registration apparatus, computer device, storage medium, and program product | |
| CN115203486A (en) | Deduction scheme generation method and device and computer equipment | |
| CN114880315A (en) | Business information cleaning method, device, computer equipment and storage medium | |
| CN114372865B (en) | Internet-based loan business processing method, device, and computer equipment | |
| CN115865857B (en) | Method, device, computer equipment and storage medium for pushing response data | |
| CN114239502B (en) | Method, device, computer equipment and storage medium for online editing file | |
| CN119383104B (en) | Task inspection method, device, equipment and medium | |
| CN114119170B (en) | Interactive product recommendation method, device, computer equipment, and storage medium |
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 |