Session aging method, apparatus, device, storage medium and program product
By detecting the response messages of the session and the current number of responses, the aging result is determined, which solves the resource waste and security problems caused by session connection timeout in the existing session aging methods and realizes efficient session aging and security management.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA TELECOM CLOUD TECH CO LTD
- Filing Date
- 2024-12-02
- Publication Date
- 2026-04-28
AI Technical Summary
Existing session aging methods only perform aging when a session connection times out, resulting in a large number of short-lived sessions having idle time, which reduces the effective utilization and security of sessions.
By detecting the response messages of the target session, the current number of times it can be responded to is determined, and the aging result is determined based on the current number of times it can be responded to. After the response messages are processed, corresponding processing is performed, including aging or maintaining the session connection.
This improves the effective utilization and security of sessions, avoiding resource waste and potential security risks caused by timeout judgments.
Smart Images

Figure CN119520579B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a session aging method, apparatus, device, storage medium, and program product. Background Technology
[0002] Session aging is a mechanism for automatically managing and maintaining the lifecycle of network sessions, ensuring that sessions without activity within a certain period are automatically identified and closed. Session aging offers several advantages: firstly, it optimizes resource allocation and improves system efficiency; secondly, it prevents unauthorized access and potential security threats. Existing session aging methods typically age sessions based on whether the connection has timed out.
[0003] However, existing session aging methods can only achieve session aging when the session connection times out. When there are a large number of short-connection sessions, the sessions will have a lot of idle time, which will reduce the effective utilization of the sessions. Summary of the Invention
[0004] Therefore, it is necessary to provide a session aging method, apparatus, device, storage medium, and program product that can improve the effective utilization rate of sessions, addressing the aforementioned technical problems.
[0005] Firstly, this application provides a session aging method, including:
[0006] If a response message is detected for the target session, determine the current number of times the target session can be responded to.
[0007] Determine the aging outcome of the target session based on the current number of responses available;
[0008] After processing the response message, the target session is processed based on the aging results.
[0009] In one embodiment, determining the current number of times a target session can be answered includes:
[0010] Based on the business scenario of the target session, determine the standard number of times the target session can be answered; based on the historical response records of the target session, determine the historical number of times the target session can be answered; the difference between the standard number of times the target session can be answered and the historical number of times the response records can be answered is taken as the current number of times the target session can be answered.
[0011] In one embodiment, the standard number of responses that a target session can have is determined based on the business scenario of the target session, including:
[0012] Based on the service settings, network protocol settings, and negotiation information in the messages between the two parties in each candidate service scenario, a correspondence between each candidate service scenario and the standard number of responses is constructed. The service scenario of the target session is used as an index to search in the correspondence to obtain the standard number of responses for the target session.
[0013] In one embodiment, upon detecting a response message for the target session, determining the current number of responses the target session can make includes:
[0014] If a response message for the target session is detected and the target session is identified as a session with an aging mechanism flag, determine the current number of responses that the target session can receive.
[0015] In one embodiment, the method further includes:
[0016] If the aging result of the target session is that the session has not been aged, obtain the current connection duration of the target session; if the current connection duration reaches the standard session duration of the target session, perform aging processing on the target session.
[0017] In one embodiment, the method further includes:
[0018] Display the session configuration interface corresponding to the target session to the user; determine the standard number of responses that the target session can receive based on the information entered by the user in the session configuration interface.
[0019] Secondly, this application also provides a session aging device, comprising:
[0020] The count determination module is used to determine the current number of times a response message for a target session can be received when a response message for the target session is detected.
[0021] The result determination module is used to determine the aging result of the target session based on the current number of responses available.
[0022] The session processing module is used to process the target session based on the aging results after the response message has been processed.
[0023] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:
[0024] If a response message is detected for the target session, determine the current number of times the target session can be responded to.
[0025] Determine the aging outcome of the target session based on the current number of responses available;
[0026] After processing the response message, the target session is processed based on the aging results.
[0027] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the following steps:
[0028] If a response message is detected for the target session, determine the current number of times the target session can be responded to.
[0029] Determine the aging outcome of the target session based on the current number of responses available;
[0030] After processing the response message, the target session is processed based on the aging results.
[0031] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, performs the following steps:
[0032] If a response message is detected for the target session, determine the current number of times the target session can be responded to.
[0033] Determine the aging outcome of the target session based on the current number of responses available;
[0034] After processing the response message, the target session is processed based on the aging results.
[0035] The aforementioned session aging method, apparatus, device, storage medium, and program product, upon detecting a response message for the target session, determine the current number of times the target session can be responded to, and then determine the aging result of the target session based on the current number of respondable messages. After processing the response messages, the target session is processed according to the aging result. Compared to related technologies that can only achieve session aging upon session connection timeout, the above method, by determining the aging result of the target session based on the current number of respondable messages, can ensure the reliability of session aging and improve the effective utilization rate of sessions. Attached Figure Description
[0036] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0037] Figure 1 This is a flowchart illustrating a session aging method in one embodiment;
[0038] Figure 2 This is a schematic diagram of aging time in related technologies;
[0039] Figure 3 This is a flowchart illustrating the process of determining the current number of responses in one embodiment;
[0040] Figure 4 This is a flowchart illustrating the session aging method in another embodiment;
[0041] Figure 5 This is a structural block diagram of a session aging device in one embodiment;
[0042] Figure 6 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0043] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0044] Session aging is a mechanism for automatically managing and maintaining the lifecycle of network sessions, ensuring that sessions without activity within a certain period are automatically identified and closed. Session aging offers several advantages: firstly, it optimizes resource allocation and improves system efficiency; secondly, it prevents unauthorized access and potential security threats. Existing session aging methods typically age sessions based on whether the connection has timed out.
[0045] However, existing session aging methods can only achieve session aging when the session connection times out. When there are a large number of short-connection sessions, the sessions will have a lot of idle time, which will reduce the effective utilization of the sessions.
[0046] Based on this, in an exemplary embodiment, such as Figure 1 As shown, a session aging method is provided. Taking the application of this method to a session device as an example, the method includes the following steps:
[0047] S101, if a response message for the target session is detected, determine the current number of responses that the target session can receive.
[0048] The session is used to record the connection status between the server and the client in the network; the current number of responses is the number of responses that the target session can accept if it has not yet accepted the response message at the current moment.
[0049] In this application, the session device initiates a request to generate a session based on the session sent by the requesting end, and sends a request message to the responding end; subsequently, the responding end can send a response message to the session device based on the request message, and the session device sends the response message back to the requesting end after receiving the response message.
[0050] In one possible implementation, upon detecting a response message for a target session, the current number of responses that the target session can currently receive can be queried based on the session identifier of the target session.
[0051] Understandably, some sessions within a session device may not have aging requirements. Therefore, to ensure the reliability of aging processing, it is necessary to determine the current number of responses a target session can receive when a response message for the target session is detected and the target session is identified as having an aging mechanism flag. The aging mechanism flag indicates that the session has an aging mechanism enabled.
[0052] In one possible implementation, when a response message for a target session is detected, the identification information of the target session at a preset location can be obtained. If the identification information includes an aging mechanism identifier, the current number of responses that the target session can receive is determined. If the identification information does not include an aging mechanism identifier, no further processing is performed.
[0053] S102, determine the aging result of the target session based on the current number of responses.
[0054] The aging results can include session aging and session non-aging.
[0055] Understandably, the number of session hits can be estimated in various business scenarios. For example, in the Domain Name System (DNS) scenario, DNS clients generate sessions by sending request messages to network element devices / firewall devices. Since a DNS request message can only correspond to one response message, it can be determined that in the DNS scenario, a session will age out after receiving a response message.
[0056] Therefore, after determining the current number of times the target session can be responded to, the aging result of the target session can be determined based on the current number of times the session can be responded to. For example, when there are multiple response messages for the target session at the same time, if the number of response messages is greater than or equal to the current number of times the session can be responded to, the aging result of the target session is determined to be session aging; if the number of response messages is less than the current number of times the session can be responded to, the aging result of the target session is determined to be session not aged.
[0057] S103 After processing the response message, the target session is processed according to the aging results.
[0058] In one possible implementation, if the aging result is that the session has aged out, the target session can be deleted after the response message has been processed; if the aging result is that the session has not aged out, the session connection can be maintained and the system can wait for the next response message for the target session until the target session ages out.
[0059] Understandably, reference Figure 2 The connection time diagram shown illustrates that in related technologies, a session aging time needs to be pre-set for the session (i.e., the session must maintain the connection for a fixed period of time). If the actual connection time required by the session is short, a large amount of invalid session time will be reserved. On the one hand, this will reduce the effective utilization rate of the session; on the other hand, since the session may be attacked during the invalid session time, it will also reduce the security of the session.
[0060] Based on this, in this application, session aging is performed based on the number of times the session can be responded to. On the one hand, this can shorten the session time; on the other hand, when there is attack traffic targeting the session, the aging result of the session can be determined based on the current number of times the session can be responded to, which can also effectively intercept the attack traffic.
[0061] For example, if 100 response messages are sent to session A at the same time, and session A currently has 2 response attempts, then session A will only send 2 of the 100 response messages back to the requesting end.
[0062] In the aforementioned session aging method, upon detecting a response message for the target session, the current number of times the target session can be responded to is determined. Then, based on the current number of respondable messages, the aging result of the target session is determined. After processing the response messages, the target session is processed according to the aging result. Compared to related technologies that can only achieve session aging upon session connection timeout, the above method, by determining the aging result of the target session based on the current number of respondable messages, ensures the reliability of session aging and improves the effective utilization rate of sessions.
[0063] To ensure the accuracy of the current number of responses, based on the above embodiments, this application provides an optional method for determining the current number of responses, such as... Figure 3 As shown, the specific steps include:
[0064] S301, Determine the standard number of responses that the target session can receive based on the business scenario of the target session.
[0065] The standard number of responses is the number of responses that can be provided during a session connection. For example, in a DNS scenario, the standard number of responses for a session is 1.
[0066] In one possible implementation, the standard number of times the previous session could be responded to in the business scenario of the target session can be used as the standard number of times the target session can be responded to.
[0067] In another possible implementation, a correspondence between each candidate service scenario and the standard number of responses is constructed based on the service setting information, network protocol setting information, and negotiation information in the messages between the two parties in each candidate service scenario; the service scenario of the target session is used as an index to search in the correspondence to obtain the standard number of responses for the target session.
[0068] Among them, candidate business scenarios are used to represent any possible business scenario.
[0069] Specifically, for any candidate service scenario, the standard number of responses for a session under that candidate service scenario can be determined based on the service settings, network protocol settings, and negotiation information in the messages between the two parties. This allows for the construction of a correspondence between each candidate service scenario and the standard number of responses.
[0070] Correspondingly, the scenario identifier of the business scenario of the target session can be used as an index to search in the pre-built correspondence to obtain the standard number of responses that the target session can receive.
[0071] In another possible implementation, a session configuration interface corresponding to the target session can be displayed to the user; based on the user's input information in the session configuration interface, the standard number of responses that the target session can accept is determined. The session configuration interface is used to configure the relevant parameters of the target session.
[0072] Specifically, a session configuration interface can be displayed on the user's terminal. The user can then directly enter session configuration information (including the standard number of responses for the target session) in the session configuration interface and click upload. Correspondingly, after obtaining the input information from the session configuration interface sent by the user's terminal, the standard number of responses for the target session can be extracted from the input information.
[0073] S302, determine the number of historical responses for the target session based on the historical response records of the target session.
[0074] Among them, historical response records are used to represent the response records of the target session within a historical period; the number of historical responses is the number of responses that the session has completed.
[0075] In one possible implementation, the historical response records of the target session can be obtained based on the session identifier information of the target session; subsequently, based on the historical response records, the number of historical responses that the target session has completed can be counted.
[0076] S303, the difference between the standard number of responsive responses and the historical number of responsive responses is taken as the current number of responsive responses for the target session.
[0077] In one possible implementation, the difference between the standard number of responsive responses and the historical number of responsive responses can be directly used as the current number of responsive responses for the target session.
[0078] In this embodiment of the application, by determining the standard number of responsive attempts and the historical number of responsive attempts, and using the difference between the standard number of responsive attempts and the historical number of responsive attempts as the current number of responsive attempts for the target session, the accuracy of the current number of responsive attempts can be guaranteed.
[0079] To avoid the problem of sessions failing to age out due to abnormal response or network packet loss, this application provides an optional method for aging out, based on the above embodiments. Specifically, if the aging result of the target session is that the session has not aged out, the current connection duration of the target session is obtained; if the current connection duration reaches the standard session duration of the target session, the target session is aged out.
[0080] The current connection duration is the duration that the target session has been connected at the current moment; the standard session duration is the pre-set duration that the session can be connected for, that is, when the session reaches the standard session duration, it needs to be aged out.
[0081] Understandably, in practical applications, there may be issues with lost response messages, which could prevent session messages from aging out. Therefore, if the aging result for the target session is that the session has not aged out, it is necessary to obtain the current connection duration of the target session. For example, this can be done by obtaining the current connection duration of the target session through a timing device in the session device.
[0082] Furthermore, it can be determined whether the current connection duration has reached the standard session duration. If so, the target session is aged out directly; otherwise, the connection of the target session is maintained.
[0083] In addition to the scenarios mentioned above, target sessions can also be aged out directly based on the standard session duration. Specifically, there is no need to calculate the current number of times the target session can be answered; the current connection duration of the target session can be obtained directly through the timing device in the session device. Then, when the current connection duration reaches the standard session duration, the target session is aged out.
[0084] In this embodiment of the application, when the target session has not aged out, the target session is aged out by determining whether the current connection duration has reached the standard session duration, which can ensure the reliability of session aging out.
[0085] Figure 4This is a flowchart illustrating the session aging method in another embodiment. Based on the above embodiments, this embodiment provides an optional example of the session aging method. (Combined with...) Figure 4 The specific implementation process is as follows:
[0086] S401, if a response message for the target session is detected and the target session is identified as a session with an aging mechanism identifier, the correspondence between each candidate service scenario and the standard number of responses is constructed based on the service settings information, network protocol settings information, and negotiation information in the messages between the two service parties under each candidate service scenario.
[0087] S402, using the business scenario of the target session as an index, search in the corresponding relationship to obtain the standard number of responses that the target session can receive.
[0088] In addition, the user can be shown the session configuration interface corresponding to the target session; based on the information entered by the user in the session configuration interface, the standard number of responses that the target session can receive can be determined.
[0089] S403, determine the number of historical responses for the target session based on the historical response records of the target session.
[0090] S404 uses the difference between the standard number of responsive responses and the historical number of responsive responses as the current number of responsive responses for the target session.
[0091] S405, based on the current number of responses, determine whether the target session is aging. If yes, proceed to S406; otherwise, proceed to S407.
[0092] S406, after processing the response message, performs aging processing on the target session.
[0093] S407, Get the current connection duration of the target session.
[0094] S408: If the current connection duration reaches the standard session duration of the target session, the target session will be aged out.
[0095] The specific processes of S401-S408 described above can be found in the description of the above method embodiments. Their implementation principles and technical effects are similar, and will not be repeated here.
[0096] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0097] Based on the same inventive concept, this application also provides a session aging apparatus for implementing the session aging method described above. The solution provided by this apparatus is similar to the implementation described in the above method; therefore, the specific limitations in one or more session aging apparatus embodiments provided below can be found in the limitations of the session aging method described above, and will not be repeated here.
[0098] In one exemplary embodiment, such as Figure 5 As shown, a session aging device 1 is provided, including: a session count determination module 10, a result determination module 20, and a session processing module 30, wherein:
[0099] The count determination module 10 is used to determine the current number of times the target session can be responded to when a response message for the target session is detected;
[0100] The result determination module 20 is used to determine the aging result of the target session based on the current number of responsive attempts.
[0101] The session processing module 30 is used to process the target session based on the aging results after the response message has been processed.
[0102] In one exemplary embodiment, the number determination module 10 includes:
[0103] The first determining unit is used to determine the standard number of responses that a target session can receive, based on the business scenario of the target session.
[0104] The second determining unit is used to determine the number of historical responses of the target session based on the historical response records of the target session;
[0105] The third determining unit is used to take the difference between the standard number of responsive responses and the historical number of responsive responses as the current number of responsive responses for the target session.
[0106] In an exemplary embodiment, the first determining unit is specifically used for:
[0107] Based on the service settings, network protocol settings, and negotiation information in the messages between the two parties in each candidate service scenario, a correspondence between each candidate service scenario and the standard number of responses is constructed. The service scenario of the target session is used as an index to search in the correspondence to obtain the standard number of responses for the target session.
[0108] In one exemplary embodiment, the number determination module 10 is further configured to:
[0109] If a response message for the target session is detected and the target session is identified as a session with an aging mechanism flag, determine the current number of responses that the target session can receive.
[0110] In an exemplary embodiment, the session aging device 1 further includes a duration detection module, wherein the duration detection module is specifically used for:
[0111] If the aging result of the target session is that the session has not been aged, obtain the current connection duration of the target session; if the current connection duration reaches the standard session duration of the target session, perform aging processing on the target session.
[0112] In an exemplary embodiment, the first determining unit is further configured to:
[0113] Display the session configuration interface corresponding to the target session to the user; determine the standard number of responses that the target session can receive based on the information entered by the user in the session configuration interface.
[0114] Each module in the aforementioned session aging device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can invoke and execute the operations corresponding to each module.
[0115] In one exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 6As shown, this computer device includes a processor, memory, input / output interfaces (I / O), and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores session data. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When the computer program is executed by the processor, it implements a session aging method.
[0116] Those skilled in the art will understand that Figure 6 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0117] In one exemplary embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:
[0118] If a response message is detected for the target session, determine the current number of times the target session can be responded to.
[0119] Determine the aging outcome of the target session based on the current number of responses available;
[0120] After processing the response message, the target session is processed based on the aging results.
[0121] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0122] Based on the business scenario of the target session, determine the standard number of times the target session can be answered; based on the historical response records of the target session, determine the historical number of times the target session can be answered; the difference between the standard number of times the target session can be answered and the historical number of times the response records can be answered is taken as the current number of times the target session can be answered.
[0123] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0124] Based on the service settings, network protocol settings, and negotiation information in the messages between the two parties in each candidate service scenario, a correspondence between each candidate service scenario and the standard number of responses is constructed. The service scenario of the target session is used as an index to search in the correspondence to obtain the standard number of responses for the target session.
[0125] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0126] If a response message for the target session is detected and the target session is identified as a session with an aging mechanism flag, determine the current number of responses that the target session can receive.
[0127] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0128] If the aging result of the target session is that the session has not been aged, obtain the current connection duration of the target session; if the current connection duration reaches the standard session duration of the target session, perform aging processing on the target session.
[0129] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0130] Display the session configuration interface corresponding to the target session to the user; determine the standard number of responses that the target session can receive based on the information entered by the user in the session configuration interface.
[0131] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:
[0132] If a response message is detected for the target session, determine the current number of times the target session can be responded to.
[0133] Determine the aging outcome of the target session based on the current number of responses available;
[0134] After processing the response message, the target session is processed based on the aging results.
[0135] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0136] Based on the business scenario of the target session, determine the standard number of times the target session can be answered; based on the historical response records of the target session, determine the historical number of times the target session can be answered; the difference between the standard number of times the target session can be answered and the historical number of times the response records can be answered is taken as the current number of times the target session can be answered.
[0137] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0138] Based on the service settings, network protocol settings, and negotiation information in the messages between the two parties in each candidate service scenario, a correspondence between each candidate service scenario and the standard number of responses is constructed. The service scenario of the target session is used as an index to search in the correspondence to obtain the standard number of responses for the target session.
[0139] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0140] If a response message for the target session is detected and the target session is identified as a session with an aging mechanism flag, determine the current number of responses that the target session can receive.
[0141] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0142] If the aging result of the target session is that the session has not been aged, obtain the current connection duration of the target session; if the current connection duration reaches the standard session duration of the target session, perform aging processing on the target session.
[0143] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0144] Display the session configuration interface corresponding to the target session to the user; determine the standard number of responses that the target session can receive based on the information entered by the user in the session configuration interface.
[0145] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, performs the following steps:
[0146] If a response message is detected for the target session, determine the current number of times the target session can be responded to.
[0147] Determine the aging outcome of the target session based on the current number of responses available;
[0148] After processing the response message, the target session is processed based on the aging results.
[0149] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0150] Based on the business scenario of the target session, determine the standard number of times the target session can be answered; based on the historical response records of the target session, determine the historical number of times the target session can be answered; the difference between the standard number of times the target session can be answered and the historical number of times the response records can be answered is taken as the current number of times the target session can be answered.
[0151] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0152] Based on the service settings, network protocol settings, and negotiation information in the messages between the two parties in each candidate service scenario, a correspondence between each candidate service scenario and the standard number of responses is constructed. The service scenario of the target session is used as an index to search in the correspondence to obtain the standard number of responses for the target session.
[0153] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0154] If a response message for the target session is detected and the target session is identified as a session with an aging mechanism flag, determine the current number of responses that the target session can receive.
[0155] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0156] If the aging result of the target session is that the session has not been aged, obtain the current connection duration of the target session; if the current connection duration reaches the standard session duration of the target session, perform aging processing on the target session.
[0157] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0158] Display the session configuration interface corresponding to the target session to the user; determine the standard number of responses that the target session can receive based on the information entered by the user in the session configuration interface.
[0159] It should be noted that the data involved in this application (including but not limited to session data) is all data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.
[0160] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0161] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0162] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A session aging method, characterized in that, The method includes: Upon detecting a response message for the target session, a correspondence between each candidate service scenario and the standard number of responses is constructed based on the service settings, network protocol settings, and negotiation information in the messages between the two parties in each candidate service scenario. Using the business scenario of the target session as an index, a search is performed in the corresponding relationship to obtain the standard number of times the target session can be responded to; Based on the historical response records of the target session, determine the number of historical responses for the target session; The difference between the standard number of responsive responses and the historical number of responsive responses is taken as the current number of responsive responses for the target session; Based on the current number of responsive attempts, determine the aging result of the target session; After the response message has been processed, the target session is processed according to the aging result; In the case where multiple response messages exist simultaneously for the target session, determining the aging result of the target session based on the current number of responses includes: If the number of response messages is greater than or equal to the current number of responses that can be made, then the aging result of the target session is determined to be session aging. If the number of response messages is less than the current number of responses that can be made, then the aging result is determined to be that the session has not aged.
2. The method according to claim 1, characterized in that, When a response message for the target session is detected, determining the current number of times the target session can be responded to includes: If a response message for a target session is detected, and the target session is identified as a session with an aging mechanism flag, the current number of responses that the target session can receive is determined.
3. The method according to claim 1, characterized in that, The method further includes: If the aging result of the target session is that the session has not aged, obtain the current connection duration of the target session; If the current connection duration reaches the standard session duration of the target session, the target session will be aged out.
4. The method according to claim 1, characterized in that, The method further includes: Display the session configuration interface corresponding to the target session to the user; Based on the user's input information in the session configuration interface, determine the standard number of responses that the target session can receive.
5. The method according to claim 1, characterized in that, When the target session's business scenario is a DNS scenario, the standard number of responses for the target session is 1.
6. A session aging device, characterized in that, The device includes: The count determination module is used to, upon detecting a response message for a target session, construct a correspondence between each candidate service scenario and a standard number of responses based on service setting information, network protocol setting information, and negotiation information in the messages between the two service parties; use the service scenario of the target session as an index to search within the correspondence to obtain the standard number of responses for the target session; determine the historical number of responses for the target session based on its historical response records; and use the difference between the standard number of responses and the historical number of responses as the current number of responses for the target session. The result determination module is used to determine the aging result of the target session based on the current number of responsive attempts. The session processing module is used to process the target session according to the aging result after the response message has been processed; In the case where multiple response messages for the target session exist simultaneously, the result determination module is further configured to: If the number of response messages is greater than or equal to the current number of responses that can be made, the aging result of the target session is determined to be session aging; if the number of response messages is less than the current number of responses that can be made, the aging result is determined to be session not aged.
7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 5.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 5.
9. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Method and apparatus for limiting session number
CN101083665A
Session data management method and device
CN112948313A