CN109862111B - Time domain session aging control method and device, storage medium and electronic device - Google Patents

Time domain session aging control method and device, storage medium and electronic device Download PDF

Info

Publication number
CN109862111B
CN109862111B CN201910175591.9A CN201910175591A CN109862111B CN 109862111 B CN109862111 B CN 109862111B CN 201910175591 A CN201910175591 A CN 201910175591A CN 109862111 B CN109862111 B CN 109862111B
Authority
CN
China
Prior art keywords
time
session
aging
determining
length
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.)
Active
Application number
CN201910175591.9A
Other languages
Chinese (zh)
Other versions
CN109862111A (en
Inventor
刘京洋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN201910175591.9A priority Critical patent/CN109862111B/en
Publication of CN109862111A publication Critical patent/CN109862111A/en
Application granted granted Critical
Publication of CN109862111B publication Critical patent/CN109862111B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses a method and a device for controlling time domain session aging, a storage medium and an electronic device. Wherein, the method comprises the following steps: determining an initial aging time length of the session, wherein the initial aging time length is set by a time aggregator, and the time aggregator is a global variable taking time as a unit; when the remaining time length of the initial aging time length is within a first preset time range, determining the multiplexing condition of the session, wherein the remaining time length is a time period before the session is aged; and controlling the aging of the session according to the multiplexing condition of the session. The invention solves the technical problem that the setting of the session aging time influences the service experience in the related technology.

Description

Time domain session aging control method and device, storage medium and electronic device
Technical Field
The present invention relates to the field of computers, and in particular, to a method and an apparatus for controlling aging of a time domain session, a storage medium, and an electronic apparatus.
Background
The Security Transport Layer Protocol (TLS) handshake is a link with very high performance overhead, and generally, when a server switches from a hypertext Transfer Protocol (HTTP) to a network Protocol (HTTP), the performance may be reduced by more than ten times. In order to effectively reduce this performance overhead, the TLS protocol develops a Session multiplexing mechanism. That is, the Session context is cached at the server of the TLS for a period of time, and when the symmetric encryption channel can be multiplexed next time, the negotiated symmetric encryption channel can be directly searched and selected for communication without going through the most performance-consuming asymmetric handshake part.
Then the cached Session must have an aging algorithm to ensure that the internally stored Session does not grow all the time, thereby exploding the memory. The index used by the client query is called Session identification Session ID. However, in OpenSSL, an open condom level protocol, or in Nginx, the Session ages completely in time.
That is, the majority of TLS sessions are completely time-out of multiplex throughout the world. At time, the Session will expire regardless of its frequency of use, and a re-handshake is periodically triggered. Namely, the problem that the service experience is influenced by the centralized aging of the online TLS Session in the prior art exists.
In view of the above problems, no effective solution has been proposed.
Disclosure of Invention
The embodiment of the invention provides a method and a device for controlling time domain session aging, a storage medium and an electronic device, which are used for at least solving the technical problem that the setting of session aging time influences service experience in the related technology.
According to an aspect of the embodiments of the present invention, there is provided a method for controlling aging of a time domain session, including: determining an initial aging time length of the session, wherein the initial aging time length is set by a time aggregator, and the time aggregator is a global variable taking time as a unit; when the remaining time length of the initial aging time length is within a first preset time range, determining the multiplexing condition of the session, wherein the remaining time length is a time period before the session is aged; and controlling the aging of the session according to the multiplexing condition of the session.
According to another aspect of the embodiments of the present invention, there is also provided a control apparatus for time domain session aging, including: the device comprises a first determining module, a second determining module and a judging module, wherein the first determining module is used for determining an initial aging time length of a conversation, the initial aging time length is set by a time aggregator, and the time aggregator is a global variable taking time as a unit; the second determining module is used for determining the multiplexing condition of the session when the remaining time length of the initial aging time length is within a first preset time range, wherein the remaining time length is a time period before the session is aged; and the control module is used for controlling the aging of the conversation according to the multiplexing condition of the conversation.
In the embodiment of the invention, the time aggregator is adopted to determine the initial aging time length of the session, determine the multiplexing condition of the session when the remaining time length of the initial aging time length is within a first preset time range, and control the aging of the session based on the multiplexing condition of the session. The purpose of determining the aging time of the session according to the using frequency of the session is achieved, so that the effect of effectively setting the aging time of the session is achieved, and the technical problem that the setting of the aging time of the session influences service experience in the related technology is solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
fig. 1 is a block diagram of a hardware structure of a mobile terminal of a method for controlling aging of a time domain session according to an embodiment of the present invention;
fig. 2 is a flowchart illustrating a method for controlling aging of a time domain session according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a control apparatus for time-domain session aging according to an embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
In accordance with an embodiment of the present invention, there is provided a method embodiment of a method for controlling aging of a time-domain conversation, it is noted that the steps illustrated in the flowchart of the accompanying drawings may be performed in a computer system such as a set of computer-executable instructions, and that while a logical order is illustrated in the flowchart, in some cases the steps illustrated or described may be performed in an order different than here.
The method provided by the embodiment of the invention can be executed in a mobile terminal, a computer terminal or a similar arithmetic device. Taking the operation on the mobile terminal as an example, fig. 1 is a block diagram of a hardware structure of the mobile terminal of the method for controlling aging of a time domain session according to the embodiment of the present invention. As shown in fig. 1, the mobile terminal 10 may include one or more (only one shown in fig. 1) processors 102 (the processor 102 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, and optionally may also include a transmission device 106 for communication functions and an input-output device 108. It will be understood by those skilled in the art that the structure shown in fig. 1 is only an illustration, and does not limit the structure of the mobile terminal. For example, the mobile terminal 10 may also include more or fewer components than shown in FIG. 1, or have a different configuration than shown in FIG. 1.
The memory 104 may be used to store a computer program, for example, a software program of an application software and a module, such as a computer program corresponding to the control method of the aging of the time domain session in the embodiment of the present invention, and the processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, so as to implement the method described above. The memory 104 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory located remotely from the processor 102, which may be connected to the mobile terminal 10 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 106 is used for receiving or transmitting data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of the mobile terminal 10. In one example, the transmission device 106 includes a Network adapter (NIC), which can be connected to other Network devices through a base station so as to communicate with the internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module, which is used for communicating with the internet in a wireless manner.
Fig. 2 is a flowchart illustrating a method for controlling aging of a time domain session according to an embodiment of the present invention, as shown in fig. 2, the method includes the following steps:
step S202, determining the initial aging time length of the session, wherein the initial aging time length is set by a time aggregator, and the time aggregator is a global variable taking time as a unit;
step S204, when the residual time length of the initial aging time length is within a first preset time range, determining the multiplexing condition of the session, wherein the residual time length is a time period before the session is aged;
and step S206, controlling the aging of the session according to the multiplexing condition of the session.
Through the steps, the time concentrator is adopted to determine the initial aging time length of the session, when the remaining time length of the initial aging time length is within a first preset time range, the multiplexing situation of the session is determined, and the aging of the session is controlled based on the multiplexing situation of the session. The purpose of determining the aging time of the session according to the using frequency of the session is achieved, so that the effect of effectively setting the aging time of the session is achieved, and the technical problem that the setting of the aging time of the session influences service experience in the related technology is solved.
It should be noted that, in this embodiment, the aging time of the session is scattered in the time domain. The scattering mode is a global deviation representing the time speed, and a decision system for delaying aging close to the aging time.
First, when a large number of TLS requests arrive, it is the conventional practice to set an aging time point with the same expiration time for each newly generated Session, and then to age the Session at that time point. This causes a problem of concentrated aging. This example sets a global variable, called time aggregator, in seconds, to increment by 1 each time a Session is newly generated.
Optionally, the initial aging length of time for the session is determined by a time aggregator by:
1) and determining the time point when the session is generated and the value of the time encryptor, namely adding 1 to the value of the global variable when the session is generated and determining the value of the time encryptor when the session is generated.
2) Determining the aging time length configured for the Session, that is, when a TLS request arrives, the user may directly set an aging time point of an expiration time, which may be 10s, for the newly generated Session through the configuration file of Nginx;
3) the value of the time point, the time aggregator and the sum of the aging time lengths configured for the session are determined as the initial aging time length. The time point is the current time point, and the time stamp time point of the system can be directly obtained. And the time of Session aging is the current time point + the configured aging time length + the time aggregator. Such a setting may achieve that at most one Session will age in one second. Since Nginx is multiprocess, but multiple processes share a Session Cache, each process maintains a time cipher, so that the number of sessions equivalent to Worker, which has Nginx at most, per second is aged. The idea is that the larger the number of Worker number turns on at Nginx, the larger the expected on-line traffic, the faster the corresponding Session creation speed will be, so the larger the number of Session instances allowed to age per second will be.
Optionally, when the remaining time length of the initial aging time length is within the first preset time range, determining the reuse condition of the session by the following method:
1) setting a counter in a second preset time range, wherein the time length of the second preset time range is less than or equal to the initial aging time length, and the time length of the first preset time range is less than the initial aging time length; in this embodiment, when the aging time of a Session is about to arrive, it is used to decide whether to age according to the aging time set before. It is necessary to distinguish between different aging times for sessions with a high and low frequency of use. Specifically, if a Session is expected to continue to be used in the near future, the Session aging time is postponed. If a Session is expected not to continue to be used for a considerable period of time, the aging continues as intended by the intended aging time.
2) Calculating the number of times the session is multiplexed by using a counter; each time the Session is queried and reused, the counter is increased;
3) and judging whether the session is multiplexed within a first preset time range. It may be within the last 10s of Session-fast aging.
Optionally, the aging of the session is controlled by: postponing the aging time of the session under the condition that the session is multiplexed within a first preset time range; the deferred aging time may determine a product of the number of times the session is multiplexed and a time length of a second preset time range as the deferred aging time of the session. The method specifically comprises the following steps: if there is any multiplexing of the Session, the aging time deferral counter number for the Session is multiplied by a constant fixed unit of seconds (e.g., 10). That is, when a Session is in the last ten seconds, if multiplexing occurs, the number of multiplexing before 10s is postponed. After the aging is postponed, the counter of the number of multiplexing is cleared. And each Session has a maximum accumulated delay, which may be three times the configured aging time.
And in the case that the conversation is not multiplexed within a first preset time range, aging the conversation according to the initial aging time.
Optionally, after deferring the aging time of the session, the counter is cleared to facilitate the next count.
Optionally, the time to defer is limited, and beyond the maximum aging time, forced aging of the session will occur. The method specifically comprises the following steps:
1) determining a number of times a session is deferred for aging; the number of times is counted using a counter.
2) Calculating the time length of each time the session is delayed from aging;
3) calculating the accumulated delay time of the delayed aging of the conversation according to the times and the time length of each time of the delayed aging;
4) and when the accumulated deferral time is greater than a preset time length, forcing the aging session, wherein the preset time length is a multiple of the initial aging time length. The expiration may be marked directly rather than calculating an expiration time as in previous expiration calculations. Those marked expired are automatically aged by Nginx. Sessions of different importance can be distinguished significantly in their aging time, which is the result of a prediction of the frequency of use of future sessions.
As can be seen from the above, the multiplexing efficiency of TLS Session is significantly improved. Important sessions cannot be easily aged, and traffic congestion caused by intensive aging cannot be caused by traffic emergency.
The invention will now be described in detail with reference to a preferred embodiment:
in the related art, when TLS traffic is bursty, for example, a certain product organizes an activity, the traffic suddenly increases. At this time a large number of TLS sessions are created and these newly created TLS sessions are almost the same time that is aged. Traffic may be stuck at the beginning of the activity because the server is carrying a tremendous TLS handshake pressure, but after the early entry phase is spent, the traffic is smoother due to the reuse of TLS sessions. However, due to the existence of timing aging, the sessions will be aged at the same time point in a large amount, which means that the server of the service will enter the first stuck period. And at this time, the normal activities are still in progress, which greatly affects the quality of the business activities. The Session aging time on the line is in a knife-cut manner according to the practice of Nginx and OpenSSL. The same aging time is used for all sessions. But obviously the frequency of use of different sessions is completely different. The aging time for the on-line configuration is generally not too long because of security concerns, but not too short, otherwise it is not as different as without the TLS Session mechanism. It is very difficult to find an intermediate value of the aging time in all clients that use different frequencies of sessions. This value is usually not optimal.
The problem to be solved by this embodiment is the aging time of the above middle on-line TLS Session. The method has two main purposes, namely solving the problem that the service experience is influenced by centralized aging and solving the problem that different aging times of different sessions are determined according to the Session importance degree.
The core of this embodiment is that the aging time is broken up in the time domain by the Nginx program. This break-up is by a global time rate shift, and by a deferred aging decision-making system that approximates the aging time.
First, when a large number of TLS requests arrive, it is the conventional practice to set an aging time point with the same expiration time for each newly generated Session, and then to age at that time point. This causes a problem of concentrated aging. The device sets a global variable, and adds 1 every time a Session is newly generated, wherein the global variable is called a time aggregator and has the unit of second.
The setting of the aging time of the current Session is not set solely according to the expiration time but is set simultaneously according to the sum of the expiration time and this time aggregator. That is, the time for Session aging is current time + configured aging time length + time aggregator. This arrangement makes it possible to have at most one Session aged in one second. Since Nginx is multiprocess, but multiple processes share a Session Cache, each process maintains a time cipher, so that the number of sessions equivalent to Worker, which has Nginx at most, per second is aged. The idea is that the larger the number of Worker number turns on at Nginx, the larger the expected on-line traffic, the faster the corresponding Session creation speed will be, so the larger the number of Session instances allowed to age per second will be.
The contents of the second core are used to decide whether to age according to the previously set aging time when the aging time of a Session is about to arrive. The aim is to distinguish between different aging times for sessions with high and low frequency of use, and specifically to postpone the aging time for a Session if it is expected to continue to be used in the near future. If a Session is expected not to continue to be used for a considerable period of time, the aging continues as intended by the intended aging time.
The method for judging whether to postpone aging is to maintain a counter within the time range that the Session is not aged, and the counter is increased when the Session is repeatedly inquired each time. Within the last 10s of the Session's immediate aging, if there is any multiplexing of the Session, the Session's aging time delay counter number is multiplied by a constant fixed unit of seconds (this value is 10 in our use). That is, when a Session is in the last ten seconds, if multiplexing occurs, the number of multiplexing before 10s is postponed. After the aging is postponed, the counter of the number of multiplexing is cleared. And each Session has a maximum accumulated delay that exceeds three times the configured aging time, and if the Session has not been aged, aging is not postponed. Thus the Session is forced to age regardless of frequency.
The key point in this is two points, one is the last 10s decision and one is the cumulative number of multiplexes of preambles. The last 10s decision means that short term high frequency TLS connections can be circumvented. If a TLS connection is being reused for the next five minutes at the time of creation, the cumulative number of reuses will be large, and if the deferred aging is determined only according to the cumulative number of reuses, an incorrect aging decision will result, since the connection is no longer in use. The last 10s decisions can solve the TLS Session multiplexing situation with dense creation period, which is very high in practical applications.
The time for postponing aging is defined as the cumulative number of multiplexes multiplied by 10 seconds and cannot be larger than the maximum aging time, and the design can obviously distinguish the aging time of sessions with different degrees of importance, namely a result of prediction of the use frequency of the future sessions.
Through the preferred embodiment, the following technical effects can be obtained: the multiplexing efficiency of the TLS Session is obviously improved. Important sessions cannot be easily aged, and traffic congestion caused by intensive aging cannot be caused by traffic emergency.
It should be noted that the main body for executing the above steps may be the terminal shown in fig. 1, but is not limited thereto.
An embodiment of the present invention further provides a device for controlling aging of a time domain session, and fig. 3 is a schematic structural diagram of the device for controlling aging of a time domain session, provided in the embodiment of the present invention, as shown in fig. 3, the device includes:
a first determining module 32, configured to determine an initial aging time length of the session, where the initial aging time length is set by a time aggregator, and the time aggregator is a global variable in units of time;
a second determining module 34, configured to determine a multiplexing condition of the session when a remaining time length of the initial aging time length is within a first preset time range, where the remaining time length is a time period before the session is aged;
and the control module 36 is used for controlling the aging of the session according to the multiplexing condition of the session.
Through the steps, the time concentrator is adopted to determine the initial aging time length of the session, when the remaining time length of the initial aging time length is within a first preset time range, the multiplexing situation of the session is determined, and the aging of the session is controlled based on the multiplexing situation of the session. The purpose of determining the aging time of the session according to the using frequency of the session is achieved, so that the effect of effectively setting the aging time of the session is achieved, and the technical problem that the setting of the aging time of the session influences service experience in the related technology is solved.
It should be noted that, in this embodiment, the aging time of the session is scattered in the time domain. The scattering mode is a global deviation representing the time speed, and a decision system for delaying aging close to the aging time.
First, when a large number of TLS requests arrive, it is the conventional practice to set an aging time point with the same expiration time for each newly generated Session, and then to age the Session at that time point. This causes a problem of concentrated aging. This embodiment sets a global variable, which is called time aggregator and is given in seconds, to be added with 1 each time a Session is newly generated.
Optionally, the first determining module includes: a first determination unit for determining values of a time point and a time aggregator at a time when a session is generated; a second determining unit, configured to determine an aging time length configured for the session; and a third determining unit for determining the sum of the time point, the value of the time aggregator and the aging time length configured for the session as the initial aging time length.
Optionally, the initial aging length of time for the session is determined by a time aggregator by:
1) and determining the time point when the session is generated and the value of the time encryptor, namely adding 1 to the value of the global variable when the session is generated and determining the value of the time encryptor when the session is generated.
2) Determining the aging time length configured for the Session, that is, when a TLS request arrives, the user may directly set an aging time point of an expiration time, which may be 10s, for the newly generated Session through the configuration file of Nginx;
3) the value of the time point, the time aggregator and the sum of the aging time lengths configured for the session are determined as the initial aging time length. The time point is the current time point, and the time stamp time point of the system can be directly obtained. And the time of Session aging is the current time point + the configured aging time length + the time aggregator. Such a setting may achieve that at most one Session will age in one second. Since Nginx is multiprocess, but multiple processes share a Session Cache, each process maintains a time cipher, so that the number of sessions equivalent to Worker, which has Nginx at most, per second is aged. The idea is that the larger the number of Worker number turns on at Nginx, the larger the expected on-line traffic, the faster the corresponding Session creation speed will be, so the larger the number of Session instances allowed to age per second will be.
Optionally, when the remaining time length of the initial aging time length is within the first preset time range, determining the reuse condition of the session by the following method:
1) setting a counter in a second preset time range, wherein the time length of the second preset time range is less than or equal to the initial aging time length, and the time length of the first preset time range is less than the initial aging time length; in this embodiment, when the aging time of a Session is about to arrive, it is used to decide whether to age according to the aging time set before. It is necessary to distinguish between different aging times for sessions with a high and low frequency of use. Specifically, if a Session is expected to continue to be used in the near future, the Session aging time is postponed. If a Session is expected not to continue to be used for a considerable period of time, the aging continues as intended by the intended aging time.
2) Calculating the number of times the session is multiplexed by using a counter; each time the Session is queried and reused, the counter is increased;
3) and judging whether the session is multiplexed within a first preset time range. It may be within the last 10s of Session-fast aging.
Optionally, the aging of the session is controlled by: postponing the aging time of the session under the condition that the session is multiplexed within a first preset time range; the deferred aging time may determine a product of the number of times the session is multiplexed and a time length of a second preset time range as the deferred aging time of the session. The method specifically comprises the following steps: if there is any multiplexing of the Session, the aging time deferral counter number for the Session is multiplied by a constant fixed unit of seconds (e.g., 10). That is, when a Session is in the last ten seconds, if multiplexing occurs, the number of multiplexing before 10s is postponed. After the aging is postponed, the counter of the number of multiplexing is cleared. And each Session has a maximum accumulated delay, which may be three times the configured aging time.
And in the case that the conversation is not multiplexed within a first preset time range, aging the conversation according to the initial aging time.
Optionally, after deferring the aging time of the session, the counter is cleared to facilitate the next count.
Optionally, the time to defer is limited, and beyond the maximum aging time, forced aging of the session will occur. The method specifically comprises the following steps:
1) determining a number of times a session is deferred for aging; the number of times is counted using a counter.
2) Calculating the time length of each time the session is delayed from aging;
3) calculating the accumulated delay time of the delayed aging of the conversation according to the times and the time length of each time of the delayed aging;
4) and when the accumulated deferral time is greater than a preset time length, forcing the aging session, wherein the preset time length is a multiple of the initial aging time length. The expiration may be marked directly rather than calculating an expiration time as in previous expiration calculations. Those marked expired are automatically aged by Nginx. Sessions of different importance can be distinguished significantly in their aging time, which is the result of a prediction of the frequency of use of future sessions.
As can be seen from the above, the multiplexing efficiency of TLS Session is significantly improved. Important sessions cannot be easily aged, and traffic congestion caused by intensive aging cannot be caused by traffic emergency.
It should be noted that the above-mentioned device may be located in the terminal shown in fig. 1, but is not limited thereto.
Embodiments of the present invention also provide a storage medium having a computer program stored therein, wherein the computer program is arranged to perform the steps of any of the above method embodiments when executed.
Alternatively, in the present embodiment, the storage medium may be configured to store a computer program for executing the steps of:
s1, determining the initial aging time length of the conversation, wherein the initial aging time length is set by a time aggregator, and the time aggregator is a global variable taking time as a unit;
s2, when the remaining time length of the initial aging time length is within a first preset time range, determining the multiplexing condition of the session, wherein the remaining time length is the time period before the session is aged;
and S3, controlling the aging of the session according to the multiplexing condition of the session.
Optionally, in this embodiment, the storage medium may include, but is not limited to: various media capable of storing computer programs, such as a usb disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk.
Embodiments of the present invention also provide an electronic device comprising a memory having a computer program stored therein and a processor arranged to run the computer program to perform the steps of any of the above method embodiments.
Optionally, the electronic apparatus may further include a transmission device and an input/output device, wherein the transmission device is connected to the processor, and the input/output device is connected to the processor.
Optionally, in this embodiment, the processor may be configured to execute the following steps by a computer program:
s1, determining the initial aging time length of the conversation, wherein the initial aging time length is set by a time aggregator, and the time aggregator is a global variable taking time as a unit;
s2, when the remaining time length of the initial aging time length is within a first preset time range, determining the multiplexing condition of the session, wherein the remaining time length is the time period before the session is aged;
and S3, controlling the aging of the session according to the multiplexing condition of the session. Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation manners, and this embodiment is not described herein again.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
In the above embodiments of the present invention, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed technology can be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units may be a logical division, and in actual implementation, there may be another division, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.

Claims (11)

1. A method for controlling aging of a time domain session is characterized by comprising the following steps:
determining an initial aging time length of a session, wherein the initial aging time length is set by a time concentrator, and the time concentrator is a global variable in time;
determining the reuse condition of the session when the remaining time length of the initial aging time length is within a first preset time range, wherein the remaining time length is a time period before the session is aged;
controlling the aging of the session according to the multiplexing condition of the session;
wherein controlling aging of the session according to the reuse condition of the session comprises one of: postponing an aging time of the session if the session is multiplexed within the first preset time range; and in the case that the session is not multiplexed within the first preset time range, aging the session according to the initial aging time.
2. The method of claim 1, wherein determining an initial aging length of the session comprises:
determining values of a point in time and a time aggregator at which the session was generated;
determining an aging time length configured for the session;
determining the initial aging time length as a sum of the time point, the value of the time aggregator, and the aging time length configured for the session.
3. The method of claim 2, wherein determining the value of the temporal secret comprises:
and when the session is generated, adding 1 to the value of the global variable to determine the value of the time aggregator when the session is generated.
4. The method of claim 1, wherein determining the reuse condition of the session when the remaining time length of the initial aging time length is within the first preset time range comprises:
setting a counter in a second preset time range, wherein the time length of the second preset time range is less than or equal to the initial aging time length, and the time length of the first preset time range is less than the initial aging time length;
calculating the number of times the session is multiplexed using the counter;
and judging whether the session is multiplexed or not within the first preset time range.
5. The method of claim 1, wherein if the session is multiplexed within the first preset time range, determining the deferred aging time of the session by:
and determining the product of the number of times the session is multiplexed and the time length of the second preset time range as the deferred aging time of the session.
6. The method of claim 1, wherein after deferring an aging time for the session, the method further comprises:
and clearing the counter.
7. The method of claim 5, wherein after determining the deferred aging time for the session, the method further comprises:
determining a number of times the session is deferred for aging;
calculating a time length of each time the session is deferred to age;
calculating the accumulated delay time of the delayed aging of the session according to the times and the time length of each time of delayed aging;
forcibly aging the session when the accumulated deferral time is greater than a predetermined length of time, wherein the predetermined length of time is a multiple of the initial aging length of time.
8. An apparatus for controlling aging of a time domain session, comprising:
the device comprises a first determining module, a second determining module and a judging module, wherein the first determining module is used for determining an initial aging time length of a conversation, the initial aging time length is set by a time concentrator, and the time concentrator is a global variable taking time as a unit;
a second determining module, configured to determine a reuse condition of the session when a remaining time length of the initial aging time length is within a first preset time range, where the remaining time length is a time period before the session is aged;
the control module is used for controlling the aging of the session according to the multiplexing condition of the session;
wherein the control means controls the aging of the session by: postponing the aging time of the session under the condition that the session is multiplexed within a first preset time range; the deferred aging time may determine a product of the number of times the session is multiplexed and a time length of a second preset time range as the deferred aging time of the session.
9. The apparatus of claim 8, wherein the first determining module comprises:
a first determination unit for determining values of a time point and a time aggregator at a time when the session is generated;
a second determining unit, configured to determine an aging time length configured for the session;
a third determining unit, configured to determine a sum of the time point, the value of the time aggregator, and an aging time length configured for the session as the initial aging time length.
10. A storage medium, in which a computer program is stored, wherein the computer program is arranged to perform the method of any of claims 1 to 7 when executed.
11. An electronic device comprising a memory and a processor, wherein the memory has stored therein a computer program, and wherein the processor is arranged to execute the computer program to perform the method of any of claims 1 to 7.
CN201910175591.9A 2019-03-08 2019-03-08 Time domain session aging control method and device, storage medium and electronic device Active CN109862111B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910175591.9A CN109862111B (en) 2019-03-08 2019-03-08 Time domain session aging control method and device, storage medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910175591.9A CN109862111B (en) 2019-03-08 2019-03-08 Time domain session aging control method and device, storage medium and electronic device

Publications (2)

Publication Number Publication Date
CN109862111A CN109862111A (en) 2019-06-07
CN109862111B true CN109862111B (en) 2021-09-24

Family

ID=66900259

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910175591.9A Active CN109862111B (en) 2019-03-08 2019-03-08 Time domain session aging control method and device, storage medium and electronic device

Country Status (1)

Country Link
CN (1) CN109862111B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7346690B1 (en) * 2002-05-07 2008-03-18 Oracle International Corporation Deferred piggybacked messaging mechanism for session reuse
CN104320500A (en) * 2014-10-13 2015-01-28 中国联合网络通信集团有限公司 Keep-alive method and device of NAT (Network Address Translation) device
US9276957B2 (en) * 2009-06-22 2016-03-01 Citrix Systems, Inc. Systems and methods for handling SSL session not reusable across multiple cores
CN106131129A (en) * 2016-06-23 2016-11-16 杭州迪普科技有限公司 The method and apparatus of the data syn-chronization time management of GSLB
CN108206764A (en) * 2018-03-29 2018-06-26 新华三技术有限公司 Configuration method, server and the computer-readable medium of configuring information of network appliance

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7346690B1 (en) * 2002-05-07 2008-03-18 Oracle International Corporation Deferred piggybacked messaging mechanism for session reuse
US9276957B2 (en) * 2009-06-22 2016-03-01 Citrix Systems, Inc. Systems and methods for handling SSL session not reusable across multiple cores
CN104320500A (en) * 2014-10-13 2015-01-28 中国联合网络通信集团有限公司 Keep-alive method and device of NAT (Network Address Translation) device
CN106131129A (en) * 2016-06-23 2016-11-16 杭州迪普科技有限公司 The method and apparatus of the data syn-chronization time management of GSLB
CN108206764A (en) * 2018-03-29 2018-06-26 新华三技术有限公司 Configuration method, server and the computer-readable medium of configuring information of network appliance

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
TLS协议现状与研究综述;闫露等;《网络新媒体技术》;20190115;全文 *

Also Published As

Publication number Publication date
CN109862111A (en) 2019-06-07

Similar Documents

Publication Publication Date Title
CN109120679B (en) Task allocation method and device
CN109379380A (en) Data transmission method, data receiver method and remote printing system, mobile terminal
US9781474B2 (en) Content playback information estimation apparatus and method and program
US9210064B2 (en) Measuring latency over a network
WO2006074064A3 (en) Method and apparatus for managing data object size in a multi-user environment
CN108390860B (en) Data packet encryption and decryption method and device
WO2006091269A3 (en) Tool for optimizing system performance and methods relating to same
WO2021244489A1 (en) Method and apparatus for transmitting encryption control overhead in optical transport network
CN107454276A (en) A kind of subscriber terminal equipment and its data forwarding method and communication system
CN110099013B (en) Message sending control method and device
CN105120530A (en) Method and device for acquiring data and data acquisition system
EP3038321B1 (en) Anti-replay method and apparatus
CN110690988A (en) Bandwidth control method, bandwidth control platform, server and storage medium
CN107251529B (en) Method and apparatus for transmitting and receiving information between servers in content transmission network system
CN109862111B (en) Time domain session aging control method and device, storage medium and electronic device
CN107528837B (en) Encrypted video identification method and device, computer device and readable storage medium
CN103107950A (en) Internet protocol security security association deleting method and equipment
EP1628457A2 (en) Method, server and computer readable medium, wherein an application server, part of a real time data provider, produces transactional messages and streamed messages
US7443811B2 (en) Transmitting data
CN113381905A (en) Data information synchronization method and device and storage medium
CN107566335B (en) The treating method and apparatus of message
CN113783822A (en) Service timeout management method and device
CN110290552B (en) Method and device for measuring cache depth, storage medium and electronic device
CN114124891B (en) Processing method and device of network request, storage medium and electronic device
EP1631040A1 (en) Data retransmission after inactive communication session

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
GR01 Patent grant
GR01 Patent grant