Session data processing method and device, computer equipment, computer readable storage medium and computer program product

By listening to client non-server response operation events to calculate user activity and generating session maintenance requests, it solves the problem of inaccurate judgment of server activity and improves resource utilization and client function stability.

CN120583142APending Publication Date: 2025-09-02KINGDEE SOFTWARE(CHINA) CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510864613.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-25
Publication Date
2025-09-02

AI Technical Summary

Technical Problem

In the prior art, the server determines that the client's activity is inaccurate, resulting in waste of resources or the client's functions being affected, and the client sends sessions regularly to keep the request efficient.

Method used

By listening to non-server-responsive operation events on the client, calculating user activity, and generating session hold requests based on activity, overwriting operation scenarios in the traditional session hold mechanism without server response, avoiding resource waste.

Benefits of technology

It realizes more accurate client activity detection, improves server resource utilization, and avoids session interruption affecting client functions and resource waste.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120583142A_ABST
    Figure CN120583142A_ABST
Patent Text Reader

Abstract

The invention relates to a session data processing method and device, computer equipment, a computer readable storage medium and a computer program product. The method comprises the following steps: monitoring an operation event of a non-server response operation on a client in a current monitoring period to obtain a monitoring result; determining the user activeness corresponding to the client according to the monitoring result; generating a session holding request based on the user activeness; the session keeping request is used for requesting a server to keep a session with the client. By adopting the method, the session can be kept more accurately, so that the resource utilization rate of the server is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of computer data processing, and in particular to a session data processing method, apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Art

[0002] Clients and servers can exchange data by establishing sessions. Maintaining sessions with clients consumes server processing resources. In related art, servers kick out clients that have been inactive for a period of time to free up resources. Clients can periodically send session persistence requests to avoid being kicked out. However, this approach presents problems: the server's accuracy in determining client activity is low, potentially impacting the client's normal functionality; and the client's mechanism for periodically sending heartbeat refresh requests is not intelligent enough, potentially wasting server resources.

[0003] Therefore, a more accurate and resource-efficient session data processing solution is needed. Summary of the Invention

[0004] Based on this, it is necessary to provide a session data processing method, apparatus, computer equipment, computer-readable storage medium and computer program product that can improve the efficiency of server resource utilization in order to address the above technical problems.

[0005] In a first aspect, the present application provides a session data processing method, comprising:

[0006] During the current monitoring cycle, monitor the operation events on the client that are not server response operations and obtain the monitoring results;

[0007] Determine the user activity corresponding to the client according to the monitoring result;

[0008] A session maintenance request is generated based on the user activity; the session maintenance request is used to request the server to maintain the session with the client.

[0009] In one embodiment, the monitoring result includes the event type of each operation event; and determining the user activity corresponding to the client according to the monitoring result includes:

[0010] Determining, according to the event type, a user activity representation weight corresponding to each operation event;

[0011] According to the user activity representation weight corresponding to the operation event, weighted statistics are performed on the operation events to obtain the user activity.

[0012] In one embodiment, the monitoring result further includes the event attributes and triggering frequency of the operation event; and the process of determining the user activity further includes:

[0013] Calculating, according to the event attributes of the operation events, the correlation between the first operation events whose triggering frequencies are greater than a preset frequency threshold;

[0014] Merge the first operation events whose correlations meet the preset conditions to obtain merged events;

[0015] The user activity is obtained by performing weighted statistics on the merged event and the second operation event whose trigger frequency is less than or equal to the preset frequency threshold.

[0016] In one embodiment, the monitoring result further includes the event attributes and triggering frequency of the operation event; and the process of determining the user activity further includes:

[0017] Calculating, according to the event attributes of the operation events, the correlation between the first operation events whose triggering frequencies are greater than a preset frequency threshold;

[0018] Merge the first operation events whose correlations meet the preset conditions to obtain merged events;

[0019] The user activity is obtained by performing weighted statistics on the merged event and the second operation event whose trigger frequency is less than or equal to the preset frequency threshold.

[0020] In one embodiment, the process of generating the session persistence request further includes:

[0021] Obtaining the load status of the server;

[0022] determining, based on a comparison result of the load condition and a preset load threshold, a discard ratio for a third operation event whose triggering frequency is greater than a preset frequency threshold;

[0023] discarding the third operation event according to the discard ratio to obtain a processed operation event;

[0024] The user activity is calculated according to the processed operation events and a fourth operation event whose triggering frequency is less than or equal to a preset frequency threshold.

[0025] In one embodiment, generating a session maintenance request based on the user activity includes:

[0026] Comparing the user activity with an activity threshold;

[0027] If the user activity is greater than or equal to the activity threshold, generating the session maintenance request and entering the next monitoring cycle;

[0028] If the user activity is less than the activity threshold, directly enter the next monitoring cycle.

[0029] In one embodiment, the method further comprises:

[0030] Based on the user activity in the current listening period, the length of the next listening period is adjusted; wherein the length of the next listening period is positively correlated with the user activity in the current listening period.

[0031] In one embodiment, the process of adjusting the length of the next listening period includes:

[0032] Determining a monitoring duration attenuation coefficient based on a maximum session duration set by the server for the client; wherein, when the server does not receive the session hold request, it counts down the maximum session duration to obtain a remaining session duration corresponding to the client; when the remaining session duration reaches zero, the server terminates the session with the client;

[0033] Non-linearly decay the remaining session duration corresponding to the client according to the monitoring duration decay coefficient to obtain the length of the next monitoring period.

[0034] In one embodiment, the operation event is input through a target page in the client; and the process of generating the session persistence request further includes:

[0035] Determining a time difference between the client and the server and page visibility of the target page;

[0036] When the time difference is less than a preset deviation value threshold and the page visibility representation is visible, the session maintenance request is generated.

[0037] In a second aspect, the present application further provides a session data processing device, comprising:

[0038] The monitoring module is used to monitor the operation events on the client that are not server response operations during the current monitoring cycle and obtain the monitoring results;

[0039] A determination module, configured to determine the user activity corresponding to the client according to the monitoring result;

[0040] A generating module is used to generate a session maintaining request based on the user activity; the session maintaining request is used to request the server to maintain the session between the server and the client.

[0041] In a third aspect, the present application further provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of any embodiment of the first aspect when executing the computer program.

[0042] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the steps of any embodiment of the first aspect are implemented:

[0043] In a fifth aspect, the present application also provides a computer program product, comprising a computer program, which, when executed by a processor, implements the steps of any one of the following embodiments of the first aspect.

[0044] The above-mentioned session data processing method, apparatus, computer device, computer-readable storage medium and computer program product monitor the operation events of non-server response operations on the client during the current monitoring cycle to obtain the monitoring results; determine the user activity corresponding to the client according to the monitoring results, and finally generate a session maintenance request based on the user activity to request the server to maintain the session between the client and the client. In the embodiment of the present invention, the user activity of the client is determined by the monitoring results of the operation events of non-server response operations on the client, and the session maintenance request is sent to the server based on the user activity. On the basis of the traditional session maintenance mechanism, it can cover such scenarios as there are operations on the client but the operation does not require a server response. It can avoid the problem that the server judges that the client is inactive due to not receiving an operation from the client, thereby interrupting the session with the client, affecting the normal function of the client, and avoid the problem of low utilization efficiency of server resources due to the client sending session maintenance requests periodically, thereby achieving more accurate detection of client activity without wasting server resources and achieving session data processing with higher resource utilization. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following briefly introduces the drawings required for use in the embodiments of the present application or related technical descriptions. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying any creative work.

[0046] Figure 1 This is a diagram of an application environment of a method for processing session data in one embodiment;

[0047] Figure 2 1 is a flow chart of a method for processing session data in one embodiment;

[0048] Figure 3 Schematic diagram of a flow chart of user activity calculation steps in one embodiment;

[0049] Figure 4 Schematic diagram of a flow chart of a user activity calculation step in another embodiment;

[0050] Figure 5 Schematic diagram of a flow chart of a user activity calculation step in another embodiment;

[0051] Figure 6 Schematic diagram of a flow chart of a user activity calculation step in another embodiment;

[0052] Figure 7 A flowchart of the steps of generating a session persistence request in one embodiment;

[0053] Figure 8 A flowchart of a session persistence request generation step in another embodiment;

[0054] Figure 9 is a flowchart of a method for processing session data in another embodiment;

[0055] Figure 10 is a flowchart of a method for processing session data in another embodiment;

[0056] Figure 11 is a flowchart of a method for processing session data in another embodiment;

[0057] Figure 12 is a structural diagram of a session data processing device in one embodiment;

[0058] Figure 13 FIG. 1 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0059] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.

[0060] A session is a mechanism used in internet technology to maintain user state between a client (such as a browser) and a server. It addresses the statelessness of the HTTP protocol (which cannot automatically record the relationship between consecutive user requests) by allowing servers to identify multiple requests from the same user, enabling interactive features such as login status and shopping carts. How a session works: Upon a user's first visit, the server creates a unique session ID. Subsequent requests carry this ID, allowing the server to associate user data (such as login information) with it. Unlike cookies, which are stored on the client, session data is stored on the server (only the ID is passed via cookies). This means that a session can be considered a way for the server to "remember" the user, temporarily storing user data to ensure a consistent interactive experience. Session persistence is a technology that ensures that a user remains connected to the same server or service instance across multiple requests. It is commonly used in load-balancing or multi-server environments. Its core purpose is to maintain user session continuity and avoid session interruptions caused by requests being distributed to different servers (such as loss of login status or emptying of shopping carts).

[0061] Traditionally, servers automatically terminate client sessions when they detect inactivity, a mechanism known as session timeout. Session timeout triggers are typically as follows: 1. Request-free interval: The server records the timestamp of the client's last interactive request. If no new requests exceed a preset threshold (e.g., 30 minutes), the session is considered inactive. 2. Heartbeat failure: Some persistent connections (such as WebSocket) rely on periodic heartbeat packets sent by the client. If these packets are not received on time, the session is considered disconnected.

[0062] Issues with the aforementioned triggering conditions include: Regarding trigger condition 1, whether the user is active on the client isn't strongly coupled to whether the client sends an interaction request to the server. For example, user operations on the client may require no server interaction, such as pure front-end operations like form validation, dynamic changes to page elements, and real-time graphics rendering. Consider that all operations and logic for pure front-end operations are processed on the user's browser (i.e., the client) without server interaction. For example, in a web application, when a user clicks a button to trigger an animation or an option to change the displayed content, no back-end database operations, data storage, or complex calculations are involved (in contrast to user login, shopping cart checkout, etc.). Therefore, pure front-end operations don't require the client to request data from the server, meaning no server response is required. Consequently, the server doesn't receive client interaction requests during the user's operation. Consequently, the server's record of the client's last request isn't updated, potentially causing the client-server session to time out, impacting normal client operations.

[0063] Regarding trigger condition 2, the mechanism by which the client periodically sends session maintenance requests is relatively mechanical. It is possible that the user makes an erroneous operation on the client but the client still requests the server to maintain the session, thereby wasting server resources and reducing the utilization efficiency of server resources.

[0064] In response to the technical problems in the above-mentioned session processing field, such as low utilization efficiency of server resources or impact on normal client operation, an embodiment of the present application provides a session data processing method, which determines the user activity of the client by monitoring the results of operation events of non-server response operations on the client, and then sends a session persistence request to the server based on the user activity. On the basis of the traditional session persistence mechanism, it can cover scenarios such as operations on the client but the operations do not require a server response. It can avoid the problem that the server judges that the client is inactive due to not receiving operations from the client, thereby interrupting the session with the client, affecting the normal function of the client, and avoids the problem of low utilization efficiency of server resources due to the client periodically sending session persistence requests, thereby achieving session data processing with higher resource utilization.

[0065] The session data processing method provided in the embodiment of the present application can be applied to Figure 1In the application environment shown, terminal 102 communicates with middleware 104 via a network. Middleware 104 communicates with server 106. A data storage system can store data that middleware 104 needs to process. The data storage system can be integrated with middleware 104 or placed on a cloud or other network server. During a current monitoring cycle, middleware 104 monitors non-server response operation events on terminal 102 and obtains monitoring results, where non-server response operations are operations that do not require a response from server 106. Based on the monitoring results, middleware 104 determines the user activity corresponding to terminal 102. Based on the user activity, it generates a session maintenance request. The session maintenance request is used to request server 106 to maintain the session with terminal 102. Terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, smart car devices, projectors, etc. Portable wearable devices can include smart watches, smart bracelets, head-mounted devices, etc. The head-mounted device can be a virtual reality (VR) device, an augmented reality (AR) device, smart glasses, etc. Middleware 104 is a device with certain data processing and communication capabilities, such as various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices, although this invention does not limit these. Server 106 can be a standalone physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server providing cloud computing services.

[0066] In an exemplary embodiment, Figure 2 As shown, a session data processing method is provided, which is applied to Figure 1 The middleware 104 in FIG. 1 is taken as an example to illustrate the process, which includes the following steps 202 to 206. Among them:

[0067] Step 202: During the current monitoring period, monitor the operation events on the client that are not server response operations and obtain monitoring results.

[0068] Non-server-responsive operations refer to operations that do not require a server response; that is, the processing of the operation events is entirely completed on the client. For example, operations such as keyboard input, page scrolling, mouse movement, and mouse clicks can be processed solely by the client, without requiring a server response. A target page is displayed on the client. When the target page is created, a session corresponding to the target page is established between the client and the server. In an embodiment of the present invention, operation events input on the target page are monitored, and operation events corresponding to non-server-responsive operations are screened to obtain monitoring results. Multiple candidate operation events can be pre-screened based on the corresponding processing methods of the operation events to obtain operation events corresponding to the non-server-responsive operations. The processing method includes whether the processing of such operation events involves the client sending an interactive request to the server. For example, server-responsive operations may include data requests, file uploads, and user authentication, while non-server-responsive operations may include long text entry, multi-entry entry, dynamic effects, form validation, and showing and hiding page elements.

[0069] Specifically, monitoring results may include the event type, trigger time, and event attributes of non-server response operations. The event type characterizes the triggering conditions and handling methods for events triggered by certain user or browser actions on a webpage. It can be a DOM (Document Object Model) event type. For example, event types can be categorized as mouse events, keyboard events, input events, form events, and window events. Mouse events include mouse double-clicks, mouse single-clicks, and mouse releases. Event attributes refer to the properties and methods of the event object corresponding to the operation event, providing detailed information about the event. For example, when a page is displayed in a browser on a client, each time an event is triggered, the browser automatically generates an event object and passes it to the event handler. This event object allows you to obtain more event details, such as the event source, mouse position, and key status. For example, if the operation event is a mouse single-click, the corresponding event attributes may include the click location and click duration. The trigger time is the moment when the operation event is triggered on the client.

[0070] It should be noted that, in order to improve the accuracy and reliability of the monitoring results, non-server response operations are monitored periodically, and the duration of the next monitoring period can be a preset fixed length, such as the same as the duration of the current monitoring period. Preferably, the duration can also be dynamically adjusted based on the monitoring results of the previous monitoring period. Among them, the adjustment mechanism can include shortening the duration of the next monitoring period if the monitoring results of the previous monitoring result indicate that the user on the client is not active. This is based on the principle that the less active the user is during the historical monitoring time, the lower the probability of the user being active during the future monitoring time. This can save monitoring resources and improve the efficiency of session processing.

[0071] Step 204: Determine the user activity corresponding to the client according to the monitoring result.

[0072] The user activity is used to represent the enthusiasm of the interaction between the user and the client. It is understandable that the more times and / or the higher the frequency of the interaction, the more active the user on the client.

[0073] In an embodiment of the present invention, the monitoring results can be counted to obtain the total number or frequency of user behaviors on the client. For example, if the user inputs the keyboard 100 times, the number or frequency of behaviors can be standardized according to preset statistical rules as user activity. For example, if the user inputs the keyboard 1 time, it will be counted as user activity plus 0.1, etc.

[0074] Preferably, it is considered that the operation events on the client may not be triggered by the user's interaction needs, but are mistakenly triggered by factors such as environmental noise and operational errors. For example, when there are inanimate objects such as stationery and mobile phones pressing on the keyboard keys or pressing on the mouse keys, mouse input or keyboard input operation events may be triggered, and these operation events cannot reflect the user's true interaction intentions, and thus should not be included in the calculation of user activity, otherwise it will lead to falsely high user activity. Therefore, the operation events can be weighted and counted according to the event type of the operation event to obtain user activity, thereby improving the accuracy of user activity. Among them, the weight of the type of operation event is determined according to the probability that the event type reflects the user's true interaction intention, that is, the probability that the event of this type is a false trigger, and the operation events are weighted and counted according to the weight. For example, for the two types of events, mouse click and keyboard input, considering that the probability of false touch of mouse click is greater, the weight corresponding to keyboard input can be set to be greater than the weight corresponding to the type of operation event such as mouse click. Furthermore, for the two types of events, single input and continuous input, considering that general false triggers are sporadic and difficult to be continuous in time and space, continuous input events are more likely to reflect the user's true interaction intention. Therefore, the weight corresponding to continuous input can be set to be greater than the weight corresponding to single input operation events.

[0075] Step 206: Generate a session maintenance request based on the user activity; the session maintenance request is used to request the server to maintain the session with the client.

[0076] The user activity level can be compared with a preset activity threshold. If the user activity level exceeds the activity threshold, a session hold request is generated and the next listening cycle is entered. It is understood that upon receiving the session hold request, the server refreshes the maximum session hold duration corresponding to the client. If the server does not receive the session hold request, it counts down the maximum session hold duration. When the maximum hold duration countdown reaches zero, the server terminates the session with the client.

[0077] Optionally, if the user activity is greater than the activity threshold, a session maintenance request is generated and the next monitoring cycle is entered.

[0078] In the above embodiment, the user activity of the client is determined by monitoring the results of operation events of non-server response operations on the client, and a session maintenance request is sent to the server based on the user activity. On the basis of the traditional session maintenance mechanism, it can cover scenarios such as operations that exist on the client but do not require a server response, thereby achieving more accurate client activity detection without wasting server resources and achieving session data processing with higher resource utilization.

[0079] In an exemplary embodiment, the monitoring result includes the event type of each operation event; Figure 3 As shown, step 204 includes steps 302 to 304. Among them:

[0080] Step 302: Determine the user activity representation weight corresponding to each operation event according to the event type.

[0081] Among them, the user activity representation weight is used to represent the probability that the operation event is triggered by a real user operation. For example, when a certain area on the keyboard is accidentally touched by an object other than the user, such as when the object is pressed on an area of ​​the keyboard, an operation event such as keyboard input will be triggered. However, this event obviously does not represent that the user is currently actively interacting with the client. Therefore, the degree to which each operation event is considered in calculating user activity is adjusted according to the event type to improve the authenticity of user activity.

[0082] For example, for event types such as movement, continuous movement, scrolling, continuous scrolling, click, continuous click, input, and continuous input, considering the probability of accidental touches, the corresponding user activity representation weights can be set to 0.2, 1, 0.2, 1, 0.3, 1, 0.5, and 1 respectively.

[0083] Step 304: performing weighted statistics on the operation events according to the user activity representation weights corresponding to the operation events to obtain the user activity.

[0084] Among them, for operation events of each event type, the product of the number of occurrences of operation events of this event type and the user activity representation weight corresponding to this event type is used as the user activity corresponding to this type of operation event, and the sum of the user activity corresponding to operation events of each event type is determined as the user activity of the client.

[0085] For example, if two mouse movements, one keyboard input, and one mouse click are detected during the current monitoring period, referring to the example of the user activity representation weight in step 304, the user activity of the client during the current monitoring period is calculated as follows: 2x0.2+1x0.5+1x0.3=1.

[0086] In the above embodiment, different user activity representation weights are assigned to different types of operation events by calculating the probability that the operation event reflects the user's true interaction intention, thereby improving the accuracy of user activity.

[0087] In an exemplary embodiment, the monitoring result also includes the event attributes and trigger frequency of the operation event; wherein the event attributes are used to characterize the detailed features of the operation event, such as the occurrence event, occurrence location, action trajectory, action object, etc. Figure 4 As shown, step 302 includes steps 402 to 406. Among them:

[0088] Step 402: Calculate, based on the event attributes of the operation events, the correlation between the first operation events whose triggering frequencies are greater than a preset frequency threshold.

[0089] Among them, considering that some operation events may be triggered more frequently, such as high-frequency continuous clicks of the mouse, continuous input of a certain key on the keyboard, etc., if user activity is counted and accumulated for each triggering of such frequently triggered operation events, it may lead to inflated user activity, thereby causing the erroneous generation of session persistence requests, thereby wasting server resources. Therefore, in order to reduce the first operation events that need to be responded to, the first operation events are analyzed. Among them, considering that in high-frequency operation scenarios, some first operation events are essentially triggered by the same interaction intention of the user, such as when the user is inputting long text, he continuously presses and releases one or more keys on the keyboard, and the event characteristics of these operation events are related, such as when the occurrence time is relatively close. For example, when the user is browsing a page or playing a single-player game, he may click the mouse continuously, and these click events can be regarded as components of a user interaction operation.

[0090] Therefore, in an embodiment of the present invention, all first operation events are clustered based on the similarity of their event attributes to obtain the correlation between each first operation event. This correlation represents the probability that two operation events are triggered by the same user interaction intent. Based on the patterns of user interaction with a client (e.g., a web page displayed on a browser), for example, when filling out a form, a user may sequentially perform keyboard input, mouse clicks, and mouse scrolling. Operation events with relatively close triggering times and locations can be considered highly correlated.

[0091] Preferably, in order to improve the accuracy of the correlation degree, a higher correlation degree may be set for the first operation event of the same event type.

[0092] Step 404: Merge the first operation events whose correlations meet the preset conditions to obtain merged events.

[0093] Among them, the first operation event whose correlation meets the preset conditions has a large correlation and can be regarded as an event triggered by the same operation intention of the user. Merging processing refers to aggregating the first operation events whose correlation meets the preset conditions at a certain frequency, and the number of the aggregated first operation events is a specific value, such as 50 mouse clicks whose correlation meets the preset conditions within 100ms can be aggregated into 1 mouse click. Correspondingly, when the merging frequency increases, 50 mouse clicks whose correlation meets the preset conditions within 50ms can be aggregated into 1 mouse click. Correspondingly, when the number after aggregation increases, 50 mouse clicks whose correlation meets the preset conditions within 50ms can be aggregated into 10 mouse clicks.

[0094] It should be noted that the aggregation ratio can be adaptively determined based on the event type of the first operation event. For events with a high operation frequency under normal circumstances, such as keyboard / mouse input, the merging frequency can be set higher, that is, events over a longer period of time are merged to avoid a large workload of merging processing.

[0095] For operations with relatively low frequencies in general, the merging frequency can be set higher accordingly, so as to avoid excessive merging, which results in too low a number of events after merging. For example, for mouse movement events, the merging frequency can be 100ms / time, for page scrolling events, the merging frequency can be 300ms / time, and for keyboard input or mouse input events, the merging frequency can be 500ms / time. That is, for high-frequency mouse movement events within every 100ms in the current monitoring cycle whose correlation meets the preset conditions, they can be merged into one mouse movement operation event, thereby achieving the extraction of the direction of mouse movement during the mouse movement process to replace the various coordinate points during the mouse movement process. Correspondingly, for mouse or keyboard input, the user's input events within 500ms are merged into one input event. For example, if the user enters a long text within 500ms, the input of the long text is regarded as one input event. Correspondingly, for page scrolling events, considering that the number of scrolling events sent within 300ms may be large, the scrolling end point can be predicted based on the scrolling speed of each scrolling event, and the scrolling event corresponding to the scrolling end point can be used as the merged event.

[0096] Step 406: Perform weighted statistics on the merged event and the second operation event whose trigger frequency is less than or equal to the preset frequency threshold to obtain the user activity.

[0097] The user activity representation weight of the merged event is determined according to the event type of the merged event, and the user activity representation weight of the merged event and the user activity representation weight of the second operation event are weightedly counted to obtain the user activity.

[0098] It can be understood that the second operation event whose trigger frequency is less than or equal to the preset frequency threshold is an event with a relatively low occurrence frequency. Even if all such low-frequency events are responded to, it will not occupy too many server resources. Therefore, the second operation event does not need to be merged to calculate user activity, thereby improving the utilization efficiency of server resources.

[0099] By merging events and then calculating user activity, the embodiment of the present invention can avoid inflated user activity caused by high-frequency events, thereby avoiding waste of server resources.

[0100] In an exemplary embodiment, Figure 5As shown, the process of generating the session persistence request in step 206 further includes steps 502 to 508:

[0101] Step 502: Obtain the load status of the server.

[0102] The server load can be determined based on the usage of the server's session data processing resources. Specifically, the load can be the ratio of the server's currently occupied session data processing resources to the server's total session data processing resources, i.e., the load ratio. For example, the load ratio can be 50%, indicating that 50% of the server's session data processing resources are currently occupied.

[0103] Step 504: Determine a discard ratio for a third operation event whose triggering frequency is greater than a preset frequency threshold according to a comparison result between the load condition and a preset load threshold.

[0104] Among them, the third operation event has the same definition as the first operation event in the aforementioned embodiment, and will not be repeated here. Considering that if all third operation events with a trigger frequency greater than the preset frequency threshold are included in the calculation of user activity, the user activity finally calculated may be higher, and thus the probability of server load occupation is higher, and when the server load rate is high, further occupation of server resources may aggravate the load pressure of the server, which may cause unstable server performance or even crash failure, etc., therefore, it is necessary to discard the third operation event, thereby reducing the processing pressure of the server and ensuring the stability of the server performance. Correspondingly, when the server load rate is relatively low, it indicates that the server is currently relatively idle, and its resources available for session processing are relatively sufficient. Therefore, the discard ratio of the third event can be adaptively reduced or even not discarded.

[0105] Therefore, specifically, the discard ratio may be positively correlated with the load rate of the server, that is, the greater the load pressure of the server, the greater the discard ratio for the third operation event, thereby effectively ensuring the stability of the server performance.

[0106] Preferably, in order to control the discarding of the third operation event more accurately and finely, there can be multiple preset load thresholds, thereby making a finer-grained division of the gears in which the current server load situation is located, thereby avoiding excessive server load pressure caused by too few discards or affecting the normal session process of the client due to too many discards, and achieving a balance between server performance and client functions.

[0107] For example, when the CPU usage of the server is less than 30%, the discard ratio can be set to a lower value or zero, i.e., no discard processing is performed. When the CPU usage of the server is greater than 30% but less than 70%, only the merged events in the aforementioned embodiment can be retained. When the CPU usage of the server is greater than 70%, the discard ratio can be set to a higher value or 100%, i.e., all third operation events are discarded to relieve the processing pressure on the server.

[0108] Step 506: discard the third operation event according to the discard ratio to obtain a processed operation event.

[0109] The number of events to be discarded is determined based on the discard ratio, and this number of events is discarded from the third operation events to obtain processed operation events. For example, the discard ratio may be 30%, and the total number of third operation events may be 100. In this case, 30 events are discarded from the third operation events to obtain processed operation events.

[0110] Step 508: Calculate the user activity based on the processed operation events and a fourth operation event whose triggering frequency is less than or equal to a preset frequency threshold.

[0111] The fourth operation event has the same definition as the second operation event in the aforementioned embodiment, and will not be described again here.

[0112] The user activity representation weight of the processed event is determined according to the event type of the processed event, and weighted statistics are performed based on the user activity representation weight of the processed event and the user activity representation weight of the fourth operation event to obtain the user activity.

[0113] The embodiment of the present invention can effectively alleviate the processing pressure of the server by discarding events according to the server load and then calculating the user activity.

[0114] In an exemplary embodiment, Figure 6 As shown, the process of generating the session persistence request in step 206 further includes steps 602 to 606:

[0115] Step 602: Compare the user activity with an activity threshold.

[0116] The activity threshold is used to characterize the occurrence of operational events triggered by an active user. The activity threshold can be preset or derived from historical session processing data. Specifically, based on the user activity at the time of a historical session interruption, the activity threshold is set to a value slightly lower than the user activity at the time of the session interruption, thereby avoiding session interruptions caused by setting the activity threshold too high. False session interruptions can be determined by sending a reconnection request to the client after the session interruption or by user feedback.

[0117] Optionally, in order to improve the resource utilization efficiency of the server and avoid idle or unwarranted occupation of server resources, the activity threshold can also be dynamically adjusted according to the current load of the server. Specifically, the activity threshold can be set to be negatively correlated with the server load ratio. That is, when the server load ratio is larger, the activity threshold is larger, that is, the threshold for session refresh is higher, thereby alleviating the load pressure on the server.

[0118] Step 604: If the user activity is greater than or equal to the activity threshold, generate the session maintenance request and enter the next monitoring cycle.

[0119] If the user activity is greater than or equal to the activity threshold, it is determined that there is an interactive operation within the current listening period of the user on the client, and the corresponding session should be maintained to avoid affecting the normal working process of the client.

[0120] Step 606: If the user activity is less than the activity threshold, directly enter the next monitoring cycle.

[0121] If the user activity is less than the activity threshold, it is determined that there is no interactive operation in the current listening period of the user on the client, and the immediate interruption of the corresponding session will not avoid affecting the normal working process of the client, so there is no need to generate a session maintenance request and directly enter the next listening period. It should be noted that the duration of the next listening period can be consistent with the duration of the current listening period. Optionally, the duration of the next listening period can be the same as the duration of the current listening period, or it can be adjusted based on the duration of the current listening period, wherein the adjustment mechanism can include shortening the duration of the next listening period if the monitoring result of the previous monitoring result indicates that the user on the client is not active.

[0122] The embodiment of the present invention is based on the behavioral rule that the less active a user is during historical listening time, the less likely he is to be active during future listening time. According to the monitoring result of the previous listening cycle, the duration of the previous listening cycle is attenuated to obtain the duration of the next listening cycle. This can avoid the situation where the user activity is falsely low due to a too short next listening cycle or falsely high due to a too long next listening cycle, thereby wasting server resources.

[0123] In one embodiment of the present invention, based on an analysis of the regularity of the user's operational behavior, the user's activity or inactivity is persistent over time. That is, the less active the user is during the current listening period, the lower the probability that the user will be active during future listening periods. Correspondingly, if the user is currently active, the user is likely to remain active during a future listening period. Therefore, the process of determining the duration of the next listening period further includes:

[0124] Based on the user activity in the current listening period, the length of the next listening period is adjusted; wherein the length of the next listening period is positively correlated with the user activity in the current listening period.

[0125] The positive correlation indicates that the higher the user activity in the current listening period, the longer the next listening period will be. Correspondingly, the lower the user activity in the current listening period, the shorter the next listening period will be. The positive correlation may include linear positive correlation, nonlinear positive correlation, etc.

[0126] In an exemplary embodiment, Figure 7 As shown, the process of adjusting the duration of the next monitoring period in the above embodiment may further include:

[0127] Step 702: Determine a monitoring duration attenuation coefficient based on the maximum session duration set by the server for the client; wherein, when the server does not receive the session maintenance request, it counts down the maximum session maintenance duration to obtain the remaining session maintenance duration of the client; when the remaining session maintenance duration is zero, the server terminates the session with the client.

[0128] Among them, in order to prevent the waste of server resources, the server can be set up with a session maintenance mechanism. For example, the server will record the timestamp of the client's last interactive request. If there is no new request for more than a preset threshold (such as 30 minutes), it is considered inactive. The preset threshold here is the maximum session maintenance time, and the maximum session maintenance time can be regarded as the longest time the server can tolerate the client's inactivity. For example, the maximum session maintenance time set by the server for the client can be 10 minutes. Each time the client is detected to be active, the server resets the corresponding remaining session maintenance time of the client to 10 minutes, and until the next refresh, the corresponding remaining session maintenance time of the client is consumed in a countdown manner.

[0129] Taking into account that under normal circumstances, user behavior is consistent over a period of time, that is, the less active the user is during the historical listening time, the lower the probability of being active during the future listening time. Therefore, by setting the listening time attenuation coefficient, the listening time attenuation coefficient is decayed based on the duration of the current listening cycle to obtain the duration of the next listening cycle, thereby saving listening resources and improving the efficiency of session processing.

[0130] In an embodiment of the present invention, in order to more accurately determine the attenuation ratio of the next monitoring cycle to the current monitoring cycle, avoid too few monitoring samples resulting from too little attenuation, which leads to falsely low user activity, and too much attenuation resulting in falsely high user activity, thereby wasting server resources, the monitoring time attenuation coefficient is determined according to the maximum session duration set by the server, so that the maximum session duration is used as the benchmark for monitoring time attenuation, thereby ensuring the validity of the monitoring results while avoiding waste of server resources.

[0131] Specifically, the maximum session duration may be reduced by a certain ratio to obtain a monitoring duration attenuation coefficient. For example, the reduction ratio may be k, the maximum session duration may be τ, and the monitoring duration attenuation coefficient may be kτ.

[0132] Step 704: nonlinearly decay the remaining session duration corresponding to the client according to the monitoring duration decay coefficient to obtain the length of the next monitoring period.

[0133] To make the duration of the next listening period more intelligent and reasonable, instead of linear attenuation, the remaining session duration can be nonlinearly attenuated according to the listening duration attenuation coefficient to obtain the length of the next listening period. For example, T_next = T_remaining × (1 - e^(-kτ));

[0134] Where T_next is the duration of the next listening cycle; T_remaining is the remaining session duration; kτ is the listening duration decay coefficient; and e is the natural logarithm, achieving exponential nonlinear decay with respect to the previous listening cycle. For example, if k is 0.1, when τ = 10 minutes, T_next = 10x(1-e^(-0.1x10)) ≈ 6.32 minutes; when τ = 5 minutes, T_next = 5x(1-e^(-0.1x5)) ≈ 1.97 minutes. When T_remaining = 600 seconds, T_next = 300 seconds (k = 0.00693). Correspondingly, when T_remaining = 300 seconds, T_next = 150 seconds; and when T_remaining = 150 seconds, T_next = 75 seconds.

[0135] In another embodiment, the operation event is input through the target page in the client; Figure 8 As shown, in step 206, the following is also included:

[0136] Step 802: Determine the time difference between the client and the server and the page visibility of the target page.

[0137] Among them, considering that the client and the server respectively set and save their own local time, if the local time of the client and the server differ greatly, the session persistence request will be deemed as timed out by the server and invalid, which will cause the refresh of the target page to fail. Therefore, in order to ensure the validity of the session persistence request, the time difference between the local time of the client and the server is determined.

[0138] Furthermore, page visibility refers to whether a page is visible to the user. This can be represented by the web page's visibility attribute, which can be visible, hidden, or regenerating. If a page is in an invisible state, such as hidden or regenerating, maintaining a session for the target page will unnecessarily occupy server resources.

[0139] Step 804: When the time difference is less than a preset deviation value threshold and the page visibility representation is visible, generate the session maintenance request.

[0140] If the time difference is less than the preset deviation value threshold, the session maintenance request will not be determined by the server to be invalid due to the time error. Moreover, if the page visibility representation is visible, the target page is visible to the user. Therefore, it is meaningful to maintain the session between the target page and the server, and it will not cause unnecessary occupation of server resources. Therefore, in an embodiment of the present invention, when the time difference is less than the preset deviation value threshold and the page visibility representation is visible, generating the session maintenance request is valid and functional, thereby further ensuring the utilization efficiency of server resources.

[0141] In a specific embodiment, Figure 9 As shown, a flow chart of a session data processing method is provided, including:

[0142] Monitor whether a server response operation exists. If a server response operation exists, the server sends the server response operation to cause the server to refresh the remaining session duration corresponding to the client. Specifically, the server resets the remaining session duration corresponding to the client to a preset maximum session duration. Correspondingly, if no server response operation is detected, the remaining session duration corresponding to the client is obtained, and the length of the current listening period is determined based on the remaining session duration. Determine whether the length of the current listening period is greater than zero. If so, enter the current listening period and monitor whether there are server response operations such as page scrolling, keyboard input, mouse movement, and mouse clicks on the client during the current listening period. If not, stop detecting and terminate the algorithm. If a non-server response operation is detected during the current listening period, generate a session persistence request, which is used to request that the session between the client and the server be persisted, and enter the next listening period. If no non-server response operation is detected during the current listening period, update the remaining session duration, and update the duration of the next listening period based on the updated remaining session duration, and enter the next listening period. The remaining session duration is updated as x' = xy each time; correspondingly, the duration of the next listening period can be updated as y' = round(a x'), where x is the remaining session duration before the update, y is the duration of the next listening period before the update, x' is the remaining session duration before the update, y' is the duration of the next listening period after the update, and a is the preset listening duration decay ratio. For example, a can be 1 / 2, meaning that the duration of the next listening period is positively correlated to the maximum session duration at the end of the client's current listening period, such as half of the maximum duration.

[0143] In a specific embodiment, Figure 10 As shown, a flow chart of a session data processing method is provided, including:

[0144] Event capture: Captures client-side operational events. Event classification and weighting: Classifies captured operational events by event type and, based on the classification results, determines the user activity weight for each operational event. Sliding time window accumulation: Accumulates operational events within a sliding time window using a weighted value to represent the client's user activity within that window. This value is compared with a preset threshold. If the value is greater than or equal to the threshold, a session persistence request is generated, requesting the server to persist the client's session. If the value is less than the threshold, decay monitoring is initiated. In decay monitoring, the length of the sliding time window is decayed, accumulating operational events within shorter sliding time windows.

[0145] In a specific embodiment, Figure 11 As shown, a flow chart of a session data processing method is provided, including:

[0146] The original event stream on the client is monitored and classified by an event classifier based on event frequency. Events with a trigger frequency greater than or equal to a preset frequency threshold are identified as high-frequency events, while events with a trigger frequency less than the preset frequency threshold are identified as low-frequency events. Considering that real-time processing of high-frequency events, i.e., generating session persistence requests for all high-frequency events, would overconsume server resources and waste server resources, high-frequency events are added to an event merging queue and time-slice batch processing is performed on the events in the event merging queue, i.e., events within a preset time slice are merged and processed. Correspondingly, low-frequency events are added to a real-time processing queue, i.e., each time a low-frequency event is monitored, an immediate response is performed by generating a session persistence request. The time slice length for time-slice batch processing and the specific event merging strategy can be adaptively adjusted based on the event type of the high-frequency event. For example, for a mouse movement operation event, the time slice length can be set to 100ms. The event merging strategy can include sampling the mouse movement trajectory, determining the mouse movement direction vector based on the sampling results, and extracting the mouse movement direction angle to replace the multiple coordinate points in the mouse movement trajectory. For page scrolling events, the time slice can be set to 300ms. Based on the inertia of the movement and the speed of the page scrolling, the end point of the page scrolling is predicted, and the page scrolling events are merged into a single event for the page scrolling to the end point. For keyboard input or mouse input events, the time slice can be set to 500ms, consolidating multiple input events into a single input event for a long text.

[0147] It should be understood that, although the various steps in the flowcharts involved in the various embodiments described above are displayed in sequence according to the instructions of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowcharts involved in the various embodiments described above can include multiple steps or multiple stages, and these steps or stages are not necessarily executed and completed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of steps or stages in other steps.

[0148] Based on the same inventive concept, embodiments of the present application also provide a session data processing device for implementing the aforementioned session data processing method. The solution provided by this device is similar to the solution described in the aforementioned method. Therefore, the specific limitations of one or more session data processing device embodiments provided below can be found in the above-described limitations of the session data processing method and will not be further elaborated here.

[0149] In an exemplary embodiment, Figure 12 As shown, a session data processing device 900 is provided, comprising: a monitoring module 902, a determining module 904 and a generating module 906, wherein:

[0150] The monitoring module 902 is used to monitor the operation events on the client that are not server response operations during the current monitoring period and obtain monitoring results;

[0151] A determination module 904 is configured to determine the user activity corresponding to the client according to the monitoring result;

[0152] The generating module 906 is configured to generate a session maintaining request based on the user activity; the session maintaining request is used to request the server to maintain the session with the client.

[0153] Each module in the aforementioned session data processing apparatus may be implemented in whole or in part through software, hardware, or a combination thereof. Each module may be embedded in or independent of a processor within a computer device in the form of hardware, or may be stored in a memory within the computer device in the form of software, so that the processor can call and execute the corresponding operations of each module.

[0154] In one embodiment, the monitoring result includes the event type of each operation event; the determination module 904 further includes:

[0155] A weight determination unit, configured to determine a user activity representation weight corresponding to each operation event according to the event type;

[0156] The first statistical unit is configured to perform weighted statistics on each operation event according to a user activity representation weight corresponding to the operation event to obtain the user activity.

[0157] In one embodiment, the monitoring result further includes the event attributes and trigger frequency of the operation event; the determination module 904 further includes:

[0158] a first correlation calculation unit, configured to calculate, based on event attributes of the operation events, a correlation between the first operation events whose triggering frequencies are greater than a preset frequency threshold;

[0159] a first merging processing unit, configured to merge the first operation events whose correlations meet a preset condition to obtain a merged event;

[0160] The second statistical unit is configured to perform weighted statistics on the merged event and the second operation event whose trigger frequency is less than or equal to the preset frequency threshold to obtain the user activity.

[0161] In one embodiment, the monitoring result further includes the event attributes and trigger frequency of the operation event; the determination module 904 further includes:

[0162] a second correlation calculation unit, configured to calculate, based on event attributes of the operation events, a correlation between the first operation events whose triggering frequencies are greater than a preset frequency threshold;

[0163] a second merging processing unit, configured to merge the first operation events whose correlations meet a preset condition to obtain a merged event;

[0164] The third statistical unit is configured to perform weighted statistics on the merged event and the second operation event whose trigger frequency is less than or equal to the preset frequency threshold to obtain the user activity.

[0165] In one embodiment, the generating module 906 includes:

[0166] An acquiring unit, configured to acquire the load condition of the server;

[0167] a discard ratio determining unit, configured to determine a discard ratio for a third operation event having a trigger frequency greater than a preset frequency threshold according to a comparison result between the load condition and a preset load threshold;

[0168] a discard processing unit, configured to discard the third operation event according to the discard ratio to obtain a processed operation event;

[0169] A calculation unit is used to calculate the user activity based on the processed operation event and a fourth operation event whose trigger frequency is less than or equal to a preset frequency threshold.

[0170] In one embodiment, the generating module 906 includes:

[0171] a comparing unit, configured to compare the user activity with an activity threshold;

[0172] A first generating unit is configured to generate the session maintaining request and then enter the next monitoring period if the user activity is greater than or equal to the activity threshold;

[0173] The monitoring unit is configured to directly enter the next monitoring cycle if the user activity is less than the activity threshold.

[0174] In one embodiment, the data processing device 900 further includes:

[0175] An adjusting unit is configured to adjust the length of the next listening period based on the user activity in the current listening period; wherein the length of the next listening period is positively correlated with the user activity in the current listening period.

[0176] In one embodiment, the adjusting unit further comprises:

[0177] a coefficient determination unit, configured to determine a monitoring duration attenuation coefficient based on a maximum session duration set by the server for the client; wherein, when the server does not receive the session hold request, it counts down the maximum session duration to obtain a remaining session duration corresponding to the client; and when the remaining session duration is zero, the server terminates the session with the client;

[0178] The attenuation unit is configured to perform nonlinear attenuation on the remaining session duration corresponding to the client according to the monitoring duration attenuation coefficient to obtain the length of the next monitoring period.

[0179] In one embodiment, the operation event is input through a target page in the client;

[0180] The generation module 906 further includes:

[0181] a determining unit, configured to determine a time difference between the client and the server and page visibility of the target page;

[0182] The second generating unit is configured to generate the session maintaining request when the time difference is smaller than a preset deviation value threshold and the page visibility representation is visible.

[0183] In an exemplary embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as shown in FIG. Figure 13 As shown. The computer device includes a processor, memory, an input / output interface, a communication interface, a display unit, and an input device. The processor, memory, and input / output interface are connected via a system bus, and the communication interface, display unit, and input device are connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with external terminals via wired or wireless means, and the wireless means can be implemented via Wi-Fi, a mobile cellular network, near-field communication (NFC), or other technologies. When executed by the processor, the computer program implements a method for processing session data. The display unit of the computer device is used to form a visually visible image, and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device casing, or an external keyboard, touchpad or mouse.

[0184] Those skilled in the art will understand that Figure 13 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.

[0185] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:

[0186] During the current monitoring cycle, monitor the operation events on the client that are not server response operations and obtain the monitoring results;

[0187] Determine the user activity corresponding to the client according to the monitoring result;

[0188] A session maintenance request is generated based on the user activity; the session maintenance request is used to request the server to maintain the session with the client.

[0189] In one embodiment, the monitoring result includes the event type of each operation event; when the processor executes the computer program, the processor further implements the following steps:

[0190] Determining, according to the event type, a user activity representation weight corresponding to each operation event;

[0191] According to the user activity representation weight corresponding to the operation event, weighted statistics are performed on the operation events to obtain the user activity.

[0192] In one embodiment, the monitoring result further includes the event attributes and trigger frequency of the operation event; and when the processor executes the computer program, the processor further implements the following steps:

[0193] Calculating, according to the event attributes of the operation events, the correlation between the first operation events whose triggering frequencies are greater than a preset frequency threshold;

[0194] Merge the first operation events whose correlations meet the preset conditions to obtain merged events;

[0195] The user activity is obtained by performing weighted statistics on the merged event and the second operation event whose trigger frequency is less than or equal to the preset frequency threshold.

[0196] In one embodiment, the monitoring result further includes the event attributes and trigger frequency of the operation event; and when the processor executes the computer program, the processor further implements the following steps:

[0197] Calculating, according to the event attributes of the operation events, the correlation between the first operation events whose triggering frequencies are greater than a preset frequency threshold;

[0198] Merge the first operation events whose correlations meet the preset conditions to obtain merged events;

[0199] The user activity is obtained by performing weighted statistics on the merged event and the second operation event whose trigger frequency is less than or equal to the preset frequency threshold.

[0200] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0201] Obtaining the load status of the server;

[0202] determining, based on a comparison result of the load condition and a preset load threshold, a discard ratio for a third operation event whose triggering frequency is greater than a preset frequency threshold;

[0203] discarding the third operation event according to the discard ratio to obtain a processed operation event;

[0204] The user activity is calculated according to the processed operation events and a fourth operation event whose triggering frequency is less than or equal to a preset frequency threshold.

[0205] In one embodiment, when the processor executes the computer program, the processor further implements the following steps: comparing the user activity with an activity threshold;

[0206] If the user activity is greater than or equal to the activity threshold, generating the session maintenance request and entering the next monitoring cycle;

[0207] If the user activity is less than the activity threshold, directly enter the next monitoring cycle.

[0208] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0209] Based on the user activity in the current listening period, the length of the next listening period is adjusted; wherein the length of the next listening period is positively correlated with the user activity in the current listening period.

[0210] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0211] Determining a monitoring duration attenuation coefficient based on a maximum session duration set by the server for the client; wherein, when the server does not receive the session hold request, it counts down the maximum session duration to obtain a remaining session duration corresponding to the client; when the remaining session duration reaches zero, the server terminates the session with the client;

[0212] Non-linearly decay the remaining session duration corresponding to the client according to the monitoring duration decay coefficient to obtain the length of the next monitoring period.

[0213] In one embodiment, the operation event is input through a target page in the client; when the processor executes the computer program, the following steps are further implemented:

[0214] Determining a time difference between the client and the server and page visibility of the target page;

[0215] When the time difference is less than a preset deviation value threshold and the page visibility representation is visible, the session maintenance request is generated.

[0216] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:

[0217] During the current monitoring cycle, monitor the operation events on the client that are not server response operations and obtain the monitoring results;

[0218] Determine the user activity corresponding to the client according to the monitoring result;

[0219] A session maintenance request is generated based on the user activity; the session maintenance request is used to request the server to maintain the session with the client.

[0220] In one embodiment, the monitoring result includes the event type of each operation event; when the computer program is executed by the processor, the following steps are further implemented:

[0221] Determining, according to the event type, a user activity representation weight corresponding to each operation event;

[0222] According to the user activity representation weight corresponding to the operation event, weighted statistics are performed on the operation events to obtain the user activity.

[0223] In one embodiment, the monitoring result further includes the event attributes and trigger frequency of the operation event; and when the computer program is executed by the processor, the following steps are further implemented:

[0224] Calculating, according to the event attributes of the operation events, the correlation between the first operation events whose triggering frequencies are greater than a preset frequency threshold;

[0225] Merge the first operation events whose correlations meet the preset conditions to obtain merged events;

[0226] The user activity is obtained by performing weighted statistics on the merged event and the second operation event whose trigger frequency is less than or equal to the preset frequency threshold.

[0227] In one embodiment, the monitoring result further includes the event attributes and trigger frequency of the operation event; and when the computer program is executed by the processor, the following steps are further implemented:

[0228] Calculating, according to the event attributes of the operation events, the correlation between the first operation events whose triggering frequencies are greater than a preset frequency threshold;

[0229] Merge the first operation events whose correlations meet the preset conditions to obtain merged events;

[0230] The user activity is obtained by performing weighted statistics on the merged event and the second operation event whose trigger frequency is less than or equal to the preset frequency threshold.

[0231] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:

[0232] Obtaining the load status of the server;

[0233] determining, based on a comparison result of the load condition and a preset load threshold, a discard ratio for a third operation event whose triggering frequency is greater than a preset frequency threshold;

[0234] discarding the third operation event according to the discard ratio to obtain a processed operation event;

[0235] The user activity is calculated according to the processed operation events and a fourth operation event whose triggering frequency is less than or equal to a preset frequency threshold.

[0236] In one embodiment, when the computer program is executed by a processor, the computer program further implements the following steps: comparing the user activity with an activity threshold;

[0237] If the user activity is greater than or equal to the activity threshold, generating the session maintenance request and entering the next monitoring cycle;

[0238] If the user activity is less than the activity threshold, directly enter the next monitoring cycle.

[0239] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:

[0240] Based on the user activity in the current listening period, the length of the next listening period is adjusted; wherein the length of the next listening period is positively correlated with the user activity in the current listening period.

[0241] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:

[0242] Determining a monitoring duration attenuation coefficient based on a maximum session duration set by the server for the client; wherein, when the server does not receive the session hold request, it counts down the maximum session duration to obtain a remaining session duration corresponding to the client; when the remaining session duration reaches zero, the server terminates the session with the client;

[0243] Non-linearly decay the remaining session duration corresponding to the client according to the monitoring duration decay coefficient to obtain the length of the next monitoring period.

[0244] In one embodiment, the operation event is input through a target page in the client; when the computer program is executed by the processor, the following steps are further implemented:

[0245] Determining a time difference between the client and the server and page visibility of the target page;

[0246] When the time difference is less than a preset deviation value threshold and the page visibility representation is visible, the session maintenance request is generated.

[0247] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0248] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0249] Those skilled in the art will understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. In particular, any reference to memory, database, 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 various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The databases involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the various embodiments provided herein may be, but are not limited to, general-purpose processors, central processing units (CPUs), graphics processing units (GPUs), digital signal processors (DSPs), programmable logic devices (PLDs), quantum computing-based data processing logic devices, artificial intelligence (AI) processors, and the like.

[0250] The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, 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.

[0251] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.

Claims

1. A method for processing session data, characterized in that: The method comprises: During the current monitoring cycle, monitor the operation events on the client that are not server response operations and obtain the monitoring results; Determine the user activity corresponding to the client according to the monitoring result; A session maintenance request is generated based on the user activity; the session maintenance request is used to request the server to maintain the session with the client.

2. The method according to claim 1, characterized in that The monitoring result includes the event type of each operation event; Determining the user activity corresponding to the client according to the monitoring result includes: Determining, according to the event type, a user activity representation weight corresponding to each operation event; According to the user activity representation weight corresponding to the operation event, weighted statistics are performed on the operation events to obtain the user activity.

3. The method according to claim 2, characterized in that The monitoring result also includes the event attributes and trigger frequency of the operation event; the user activity determination process also includes: Calculating, according to the event attributes of the operation events, the correlation between the first operation events whose triggering frequencies are greater than a preset frequency threshold; Merge the first operation events whose correlations meet the preset conditions to obtain merged events; The user activity is obtained by performing weighted statistics on the merged event and the second operation event whose trigger frequency is less than or equal to the preset frequency threshold.

4. The method according to claim 1, wherein The process of generating the session persistence request further includes: Obtaining the load status of the server; determining, based on a comparison result of the load condition and a preset load threshold, a discard ratio for a third operation event whose triggering frequency is greater than a preset frequency threshold; discarding the third operation event according to the discard ratio to obtain a processed operation event; The user activity is calculated according to the processed operation events and a fourth operation event whose triggering frequency is less than or equal to a preset frequency threshold.

5. The method according to claim 1, wherein The generating a session maintaining request based on the user activity includes: Comparing the user activity with an activity threshold; If the user activity is greater than or equal to the activity threshold, generating the session maintenance request and entering the next monitoring cycle; If the user activity is less than the activity threshold, directly enter the next monitoring cycle.

6. The method according to claim 5, characterized in that The method further comprises: Based on the user activity in the current listening period, the length of the next listening period is adjusted; wherein the length of the next listening period is positively correlated with the user activity in the current listening period.

7. The method according to claim 6, characterized in that The adjustment process of the length of the next monitoring period includes: Determining a monitoring duration attenuation coefficient based on a maximum session duration set by the server for the client; wherein, when the server does not receive the session hold request, it counts down the maximum session duration to obtain a remaining session duration corresponding to the client; when the remaining session duration reaches zero, the server terminates the session with the client; Non-linearly decay the remaining session duration corresponding to the client according to the monitoring duration decay coefficient to obtain the length of the next monitoring period.

8. The method according to claim 1, characterized in that The operation event is input through a target page in the client; before generating the session maintenance request, the method further includes: Determining a time difference between the client and the server and page visibility of the target page; When the time difference is less than a preset deviation value threshold and the page visibility representation is visible, the session maintenance request is generated.

9. A session data processing device, characterized in that: The device comprises: The monitoring module is used to monitor the operation events on the client that are not server response operations during the current monitoring cycle and obtain the monitoring results; A determination module, configured to determine the user activity corresponding to the client according to the monitoring result; A generating module is used to generate a session maintaining request based on the user activity; the session maintaining request is used to request the server to maintain the session between the server and the client.

10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 8 are implemented.

11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.

12. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.

Citation Information

Patent Citations

  • Method and device for assessment of client activity degree and storage medium

    CN107704997A

  • Login state keeping method and device, computer equipment and storage medium

    CN114567662A

  • Data processing method and device for activity judgment, equipment and medium

    CN115904902A