A session processing method, client and system
Through the client's real-time monitoring of user operation behavior and generation of session processing results, it solves the problem of user input failure caused by automatic session disconnection in the existing technology, realizes more intelligent and humanized session processing, and ensures effective session management.
Patent Information
- Application Number
- CN202210716396.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-19
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2042-05-19
AI Technical Summary
Existing session processing technology will automatically disconnect the session when the user has no input for a long time, causing user input failure and affecting the user experience.
The client monitors the user's operation behavior in real time, generates session processing results and returns them to the server, avoiding automatic disconnection caused by the server's unilateral timeout determination and ensuring that the session connection is not disconnected until the user confirms.
It solves the problem of user business interruption caused by unreasonable session retention time processing, ensures effective processing of invalid sessions, and improves the intelligence and user-friendliness of the system.
Smart Images

Figure CN115118762B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a session processing method, client and system. Background Art
[0002] With the rapid development of computer technology, more and more systems need to establish session connections with users to obtain the session content input by users. In the existing session processing process, the traffic input from the client to the server is usually used as the judgment standard. When there is no traffic input for a long time, the session is considered idle and the server will automatically disconnect the session connection.
[0003] However, for some user input scenarios, such as when the user needs to enter a large amount of information, or when the user takes too long to prepare to input information due to thinking, the session will be automatically disconnected due to the server's unilateral timeout determination, resulting in user input failure and a poor user experience. Summary of the invention
[0004] In view of this, the embodiment of the present invention provides a method, client and system for session processing, which monitors the user's operation behavior in real time through the client, and then returns the generated session processing result to the server, avoiding the situation where the session is automatically disconnected due to the unilateral timeout judgment of the server, and the session connection can only be disconnected after the client returns the session processing result confirming the disconnection at the same time. It can solve the problem of user service interruption caused by unreasonable session holding time processing, ensure the effective processing of invalid sessions, and is more intelligent and humane.
[0005] To achieve the above objective, according to a first aspect of an embodiment of the present invention, a session processing method is provided.
[0006] A session processing method according to an embodiment of the present invention includes: receiving a session disconnection request sent by a server; determining a current operation state of a user according to the session disconnection request, wherein the operation state is obtained by monitoring the operation behavior of the user; generating a session processing result corresponding to the session disconnection request according to the operation state; the session processing result indicates disconnecting the current session or maintaining the current session; and returning the session processing result to the server, so that the server disconnects the current session or maintains the current session according to the session processing result.
[0007] Optionally, before generating a session processing result corresponding to the session disconnection request according to the operation state, the method further includes: if there is unfinished input information in the user input interface, storing the input information and the user identifier of the user in a cache in correspondence.
[0008] Optionally, the method also includes: creating a new session connection with the server and determining the current user corresponding to the new session connection; determining whether a user identifier corresponding to the current user exists in the cache; if so, obtaining input information corresponding to the user identifier and filling the input information into the user input interface.
[0009] Optionally, generating a session processing result corresponding to the session disconnection request according to the operation status includes: using an event listener to monitor the user's operation behavior; when the user is operating, determining that the operation status is in operation, and generating a session processing result indicating that the current session is maintained; when the user is not operating, determining that the operation status is not operated, and generating a session processing result indicating that the current session is disconnected.
[0010] To achieve the above objective, according to another aspect of an embodiment of the present invention, another session processing method applied to a server is provided.
[0011] A session processing method according to an embodiment of the present invention includes: obtaining flow data from a client; sending a session disconnection request to the client when the flow data satisfies a session disconnection policy; receiving a session processing result returned by the client, and disconnecting the current session or maintaining the current session according to the session processing result.
[0012] Optionally, the acquiring of flow data from the client includes: acquiring flow information flowing into a server network card; and parsing the flow information to obtain the flow data.
[0013] Optionally, the session disconnection strategy includes: the traffic data is less than a preset traffic threshold and the time for which the traffic data is less than the preset traffic threshold is greater than or equal to a preset time threshold.
[0014] Optionally, if the server does not receive the session processing result, the server puts the session disconnection request into a retry queue and resends the session disconnection request to the client every preset first time period; if the session processing result is still not received within a preset second time period, the current session is disconnected.
[0015] To achieve the above objective, according to another aspect of an embodiment of the present invention, a session processing client is provided.
[0016] A session processing client according to an embodiment of the present invention comprises: a receiving module, which is used to receive a session disconnection request sent by a server; a determining module, which is used to determine a user's current operation state according to the session disconnection request, wherein the operation state is obtained by monitoring the user's operation behavior; a generating module, which is used to generate a session processing result corresponding to the session disconnection request according to the operation state; the session processing result indicates disconnecting the current session or maintaining the current session; and a sending module, which is used to return the session processing result to the server, so that the server disconnects the current session or maintains the current session according to the session processing result.
[0017] To achieve the above objective, according to another aspect of an embodiment of the present invention, a session processing system is provided.
[0018] A session processing system provided by an embodiment of the present invention comprises: the above-mentioned client and server, wherein the server is used to obtain flow data from the client; when the flow data satisfies the session disconnection policy, the server sends a session disconnection request to the client; the client is used to receive the session disconnection request sent by the server; according to the session disconnection request, the user's current operation state is determined, and the operation state is obtained by monitoring the user's operation behavior; according to the operation state, a session processing result corresponding to the session disconnection request is generated; the session processing result indicates disconnecting the current session or maintaining the current session; and the session processing result is returned to the server; the server is also used to disconnect the current session or maintain the current session according to the session processing result.
[0019] To achieve the above objective, according to another aspect of an embodiment of the present invention, an electronic device for session processing is provided.
[0020] An electronic device for session processing according to an embodiment of the present invention comprises: one or more processors; a storage device for storing one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors implement a method for session processing according to an embodiment of the present invention.
[0021] To achieve the above objective, according to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided.
[0022] A computer-readable storage medium according to an embodiment of the present invention stores a computer program, and when the program is executed by a processor, a session processing method according to an embodiment of the present invention is implemented.
[0023] One embodiment of the above invention has the following advantages or beneficial effects: the client monitors the user's operation behavior in real time, and then returns the generated session processing result to the server, avoiding the situation where the session is automatically disconnected due to the unilateral timeout judgment of the server, and the session connection can only be disconnected after the client returns the session processing result confirming the disconnection at the same time. It can solve the problem of user service interruption caused by unreasonable session holding time processing, ensure the effective processing of invalid sessions, and be more intelligent and humane.
[0024] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.
[0026] Figure 1 is a schematic diagram of main steps of a session processing method according to an embodiment of the present invention;
[0027] Figure 2 is a schematic diagram of main steps of generating a session processing result according to an embodiment of the present invention;
[0028] Figure 3 is a schematic diagram of main steps of providing unfinished input information to a user according to an embodiment of the present invention;
[0029] Figure 4 is a schematic diagram of main steps of another session processing method according to an embodiment of the present invention;
[0030] Figure 5 is a schematic diagram of the main steps of obtaining flow data according to an embodiment of the present invention;
[0031] Figure 6 is a schematic diagram of main steps in an abnormal situation according to an embodiment of the present invention;
[0032] Figure 7 is a schematic diagram of main modules of a client for session processing according to an embodiment of the present invention;
[0033] Figure 8 is a schematic diagram of a system for session processing according to an embodiment of the present invention;
[0034] Fig. 9 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;
[0035] Fig.10 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION
[0036] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0037] It should be pointed out that the embodiments of the present invention and the technical features therein may be combined with each other without conflict.
[0038] Figure 1 It is a schematic diagram of main steps of a method for session processing according to an embodiment of the present invention.
[0039] like Figure 1 As shown, the session processing method applied to the client provided by the embodiment of the present invention mainly includes the following steps:
[0040] Step S101: receiving a session disconnection request sent by a server;
[0041] Step S102: determining the current operation state of the user according to the session disconnection request, where the operation state is obtained by monitoring the operation behavior of the user;
[0042] Step S103: generating a session processing result corresponding to the session disconnection request according to the operation state; the session processing result indicates disconnecting the current session or maintaining the current session;
[0043] Step S104: returning the session processing result to the server, so that the server disconnects the current session or maintains the current session according to the session processing result.
[0044] The current operation state of the user refers to the operation state of the user at the current moment, that is, the real-time operation state. For step S102, in an optional embodiment, after receiving the session disconnection request sent by the server, a global event listener can be automatically established and started, and after returning the session processing result to the server, the event listener is closed.
[0045] The user's operating status can be customized according to actual needs. In an optional embodiment, it can be simply defined as operating and not operating to distinguish whether the session needs to be disconnected. In another optional embodiment, the operating state can also be specifically defined as inputting text, selecting data, moving the mouse, etc.
[0046] For the step of receiving the session disconnection request sent by the server in step S101, in an optional embodiment, a plug-in technology, such as a browser plug-in or a JavaScript plug-in, can be used to automatically establish an asynchronous processing channel, and a separate channel is used to process the session disconnection request, which is not associated with the business system and will not affect the existing business system, thereby ensuring the security of the business system.
[0047] In an optional embodiment, step S103 is as follows: Figure 2 As shown, it may further include:
[0048] Step S201: using an event listener to monitor the user's operation behavior;
[0049] Step S202: Determine whether the user is operating;
[0050] If yes, then executing step S203: determining that the operation state is in operation, and generating a session processing result indicating that the current session is maintained;
[0051] If not, step S204 is executed: determining that the operation state is not operated, and generating a session processing result indicating disconnection of the current session.
[0052] By using event listeners to monitor user operation behaviors, you can obtain the user's operation status in real time, better determine whether the user is using the session, and provide more user-friendly session processing results.
[0053] In actual application, there may be a situation where the user does not perform any operation for a long time. In this case, it is not possible to determine the operation status as not performed when the user does not perform any operation. Therefore, in an optional embodiment, step S203 may further include: when the user does not perform any operation for a period longer than a preset period, determining the operation status as not performed. That is, a certain amount of time is left for the user to think, rather than immediately determining the operation status as not performed when the user does not perform any operation is monitored.
[0054] In a further optional embodiment, before generating a session processing result corresponding to the session disconnection request according to the operation state, it also includes: if there is unfinished input information in the user input interface, storing the input information and the user identifier of the user in a cache in correspondence.
[0055] Among them, by scanning the user input interface, it can be determined whether there is unfinished input information in the user input interface. In an optional embodiment, the browser fingerprint technology can be used to obtain the user ID of the user, and the cache technology can be used to store the input information in correspondence with the user ID of the user. Among them, the user ID obtained by the browser fingerprint is used as the key name of the cache, and the unfinished input information is used as the key value, and the corresponding storage is performed in the form of key name and key value. By adopting the browser fingerprint technology and the cache technology, it is possible to prevent data loss caused by the removal of local cookies on the basis of quickly locating the data, thereby improving the security and reliability of data storage. At the same time, by storing the unfinished input information of the user, the unfinished input information of the last time can be directly provided to the user when the user logs in next time, so that the user can continue to input and improve the user's experience.
[0056] In an optional embodiment, the step of providing the user with unfinished input information is as follows: Figure 3 As shown, including:
[0057] Step S301: creating a new session connection with the server, and determining the current user corresponding to the new session connection;
[0058] Step S302: Determine whether the user identifier corresponding to the current user exists in the cache;
[0059] If yes, execute step S303: obtain input information corresponding to the user identifier and fill the input information into the user input interface;
[0060] If not, execute step S304: end the process.
[0061] Through the above steps, after the user re-creates a session connection, the user can be provided with unfinished input information, thereby improving the user's experience.
[0062] It can be seen from the session processing method according to the embodiment of the present invention that the client monitors the user's operation behavior in real time, and then returns the generated session processing result to the server, avoiding the situation where the session is automatically disconnected due to the unilateral timeout judgment of the server, and the session connection can only be disconnected after the client returns the session processing result confirming the disconnection at the same time. It can solve the problem of user service interruption caused by unreasonable session holding time processing, ensure the effective processing of invalid sessions, and is more intelligent and humane.
[0063] Figure 4 It is a schematic diagram of main steps of another method for session processing applied to a server according to an embodiment of the present invention.
[0064] like Figure 4As shown, the session processing method provided by the embodiment of the present invention mainly includes the following steps:
[0065] Step S401: Obtaining traffic data from the client;
[0066] Step S402: When the traffic data satisfies the session disconnection policy, a session disconnection request is sent to the client;
[0067] Step S403: receiving the session processing result returned by the client, and disconnecting the current session or maintaining the current session according to the session processing result.
[0068] In an optional embodiment, for the process of obtaining flow data in step S401, raw socket technology or listener technology may be used to obtain flow data from the client in real time. Figure 5 As shown, including:
[0069] Step S501: Obtaining traffic information flowing into the server network card;
[0070] Step S502: Analyze the flow information to obtain flow data;
[0071] By parsing the traffic information flowing into the network card as described above to obtain traffic data, compared with the existing dynamic proxy and bytecode enhancement technology, it can be completely separated from the business system and will not be invasive to the business system. At the same time, it has the pluggable characteristics of the plug-in, is lighter, and is easy to load and unload.
[0072] In an optional embodiment, the session disconnection strategy includes: the flow data is less than a preset flow threshold and the time when the flow data is less than the preset flow threshold is greater than or equal to a preset time threshold. For example, the preset flow threshold can be set to 1KB and the preset time threshold can be set to 5min, that is, when the time when the zero flow data is less than 1KB is greater than or equal to 5min, the session disconnection strategy is satisfied and a session disconnection request is sent to the client.
[0073] When the network is normal, the server will receive the session processing result. However, when an abnormal situation occurs, such as a network abnormality, or the client does not generate a session processing result due to its own abnormality, in an optional embodiment, Figure 6 As shown, including:
[0074] Step S601: placing the session disconnection request into a retry queue, and resending the session disconnection request to the client every first preset time period;
[0075] Step S602: If the session processing result is not received within the preset second time period, disconnect the current session.
[0076] If the session processing result is not received due to a short-term exception, the session processing result can be received normally after resending the session disconnection request once or multiple times. However, if the session processing result is not received due to a network failure or other failures that cannot be repaired temporarily, in order to save server resources, it cannot be sent repeatedly. Therefore, a preset second time period is set to ensure that the current session is disconnected if the session processing result is still not received within the second time period. In this way, multiple attempts can be made when a failure occurs to ensure that the session is disconnected according to the user's usage, thereby improving the user's experience. At the same time, retrying within a limited time can also better save server resources and avoid unnecessary waste of resources.
[0077] In an optional embodiment, after disconnecting the current session or maintaining the current session according to the session processing result, a prompt message may be sent to the client to prompt the user that the current session has been disconnected or the current conversation has not been disconnected, and prompt input in time.
[0078] It can be seen from the session processing method according to the embodiment of the present invention that the client monitors the user's operation behavior in real time, and then returns the generated session processing result to the server, avoiding the situation where the session is automatically disconnected due to the unilateral timeout judgment of the server, and the session connection can only be disconnected after the client returns the session processing result confirming the disconnection at the same time. It can solve the problem of user service interruption caused by unreasonable session holding time processing, ensure the effective processing of invalid sessions, and is more intelligent and humane.
[0079] Figure 7 4 is a schematic diagram of main modules of a client for session processing according to an embodiment of the present invention.
[0080] like Figure 7 As shown, the client 700 for session processing in the embodiment of the present invention includes:
[0081] The receiving module 701 is used to receive a session disconnection request sent by the server;
[0082] A determination module 702 is used to determine the current operation state of the user according to the session disconnection request, where the operation state is obtained by monitoring the operation behavior of the user;
[0083] A generating module 703, configured to generate a session processing result corresponding to the session disconnection request according to the operation state; the session processing result indicates disconnecting the current session or maintaining the current session;
[0084] The sending module 704 is used to return the session processing result to the server, so that the server disconnects the current session or maintains the current session according to the session processing result.
[0085] In an optional embodiment, the client 700 also includes a storage module, which is used to, before generating a session processing result corresponding to the session disconnection request according to the operation state, further include: when there is unfinished input information in the user input interface, store the input information and the user identifier of the user in a cache.
[0086] In an optional embodiment, the client 700 also includes an establishment module for creating a new session connection with the server and determining the current user corresponding to the new session connection; judging whether a user identifier corresponding to the current user exists in the cache; if so, obtaining input information corresponding to the user identifier and filling the input information into the user input interface.
[0087] In an optional embodiment, the generation module 703 is also used to monitor the user's operation behavior using an event listener; when the user is operating, the operation status is determined to be in operation, and a session processing result indicating that the current session is maintained is generated; when the user is not operating, the operation status is determined to be not operated, and a session processing result indicating that the current session is disconnected is generated.
[0088] It can be seen from the client of the session processing according to the embodiment of the present invention that the client monitors the user's operation behavior in real time and then returns the generated session processing result to the server, avoiding the situation where the session is automatically disconnected due to the unilateral timeout judgment of the server, and the session connection can only be disconnected after the client returns the session processing result confirming the disconnection at the same time. It can solve the problem of user service interruption caused by unreasonable session holding time processing, ensure the effective processing of invalid sessions, and is more intelligent and humane.
[0089] Figure 8 is a schematic diagram of a system for session processing according to an embodiment of the present invention.
[0090] like Figure 8 As shown, the session processing system 800 of the embodiment of the present invention includes: a client 801 and a server 802, wherein:
[0091] The client 801 is used to receive a session disconnection request sent by the server; determine the user's current operation state according to the session disconnection request, and the operation state is obtained by monitoring the user's operation behavior; generate a session processing result corresponding to the session disconnection request according to the operation state; the session processing result indicates disconnecting the current session or maintaining the current session; and return the session processing result to the server. The server 802 is used to obtain traffic data from the client; send a session disconnection request to the client when the traffic data meets the session disconnection policy; receive the session processing result returned by the client, and disconnect the current session or maintain the current session according to the session processing result.
[0092] In an optional embodiment, the server 802 is further used to obtain the flow information of the server network card; and parse the flow information to obtain the flow data.
[0093] In an optional embodiment, the session disconnection strategy includes: the traffic data is less than a preset traffic threshold and the time for which the traffic data is less than the preset traffic threshold is greater than or equal to a preset time threshold.
[0094] In an optional embodiment, the server 802 is also used to, if the session processing result is not received, put the session disconnection request into a retry queue, and resend the session disconnection request to the client every preset first time period; if the session processing result is still not received within a preset second time period, disconnect the current session.
[0095] It can be seen from the session processing system according to the embodiment of the present invention that the client monitors the user's operation behavior in real time, and then returns the generated session processing result to the server, avoiding the situation where the session is automatically disconnected due to the unilateral timeout judgment of the server, and the client needs to return the session processing result confirming the disconnection at the same time before the session connection can be disconnected. At the same time, the server is used to determine whether the traffic data meets the session disconnection policy, which can establish a double guarantee for disconnecting the session connection. Through the interaction between the client and the server, it can solve the problem of user service interruption caused by unreasonable session holding time processing, ensure the effective processing of invalid sessions, and at the same time be more intelligent and humane.
[0096] Fig. 9 An exemplary system architecture 900 is shown to which the method or system for session processing according to an embodiment of the present invention may be applied.
[0097] like Fig. 9As shown, system architecture 900 may include terminal devices 901, 902, 903, network 904 and server 905. Network 904 is used to provide a medium for communication links between terminal devices 901, 902, 903 and server 905. Network 904 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0098] The user can use the terminal devices 901, 902, 903 to interact with the server 905 through the network 904 to receive or send data, etc. Various communication client applications can be installed on the terminal devices 901, 902, 903, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc.
[0099] The terminal devices 901 , 902 , and 903 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers, etc.
[0100] The server 905 may be a server that provides various services, such as a background management server that supports the session processing results sent by the user using the terminal devices 901, 902, and 903. The background management server may analyze and process the received data such as the product information query request, and feed back the processing results (such as disconnecting the current session or maintaining the current session) to the terminal device.
[0101] It should be noted that the session processing method of the first aspect provided in the embodiment of the present invention is generally executed by the terminal devices 901 , 902 , 903 , and accordingly, the session processing system is generally set in the terminal devices 901 , 902 , 903 .
[0102] It should be understood that Fig. 9 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0103] Reference below Fig.10 , which shows a schematic diagram of the structure of a computer system 1000 of a terminal device suitable for implementing an embodiment of the present invention. Fig.10 The terminal device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0104] like Fig.10As shown, the computer system 1000 includes a central processing unit (CPU) 1001, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage part 1008 into a random access memory (RAM) 1003. In the RAM 1003, various programs and data required for the operation of the system 1000 are also stored. The CPU 1001, the ROM 1002, and the RAM 1003 are connected to each other through a bus 1004. An input / output (I / O) first interface 1005 is also connected to the bus 1004.
[0105] The following components are connected to the I / O first interface 1005: an input section 1006 including a keyboard, a mouse, etc.; an output section 1007 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1008 including a hard disk, etc.; and a communication section 1009 including a network first interface card such as a LAN card, a modem, etc. The communication section 1009 performs communication processing via a network such as the Internet. A drive 1010 is also connected to the I / O first interface 1005 as needed. A removable medium 1011, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1010 as needed, so that a computer program read therefrom is installed into the storage section 1008 as needed.
[0106] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 1009, and / or installed from the removable medium 1011. When the computer program is executed by the central processing unit (CPU) 1001, the above-mentioned functions defined in the system of the present invention are executed.
[0107] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0108] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0109] The modules involved in the embodiments of the present invention may be implemented in software or hardware. The modules described may also be set in a processor, for example, it may be described as: a processor includes a receiving module, a determining module, a generating module and a sending module. The names of these modules do not constitute a limitation on the modules themselves in some cases, for example, the receiving module may also be described as "a module for receiving a session disconnection request sent by a server".
[0110] As another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiment; or may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes: receiving a session disconnection request sent by a server; determining the current operation state of the user according to the session disconnection request, wherein the operation state is obtained by monitoring the operation behavior of the user; generating a session processing result corresponding to the session disconnection request according to the operation state; the session processing result indicates disconnecting the current session or maintaining the current session; and returning the session processing result to the server, so that the server disconnects the current session or maintains the current session according to the session processing result.
[0111] According to the technical solution of the embodiment of the present invention, the client monitors the user's operation behavior in real time, and then returns the generated session processing result to the server, avoiding the situation of being automatically disconnected due to the unilateral timeout judgment of the server, and the client needs to return the session processing result confirming the disconnection at the same time before the session connection can be disconnected. At the same time, the server is used to determine whether the traffic data meets the session disconnection policy, which can establish a double guarantee for disconnecting the session connection. Through the interaction between the client and the server, it can solve the problem of user service interruption caused by unreasonable session holding time processing, ensure the effective processing of invalid sessions, and at the same time be more intelligent and humane.
[0112] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for session processing, characterized in that: Applied to the client, including: Receive the session disconnection request sent by the server; Determine the current operation state of the user according to the session disconnection request, where the operation state is obtained by monitoring the operation behavior of the user; Generate a session processing result corresponding to the session disconnection request according to the operation state; the session processing result indicates disconnecting the current session or maintaining the current session; Returning the session processing result to the server, so that the server disconnects the current session or maintains the current session according to the session processing result; Before generating a session processing result corresponding to the session disconnection request according to the operation state, the method further includes: when there is unfinished input information in the user input interface, using the browser fingerprint technology to obtain the user ID of the user, using the user ID as the key name of the cache and the unfinished input information as the key value, and storing the input information and the user ID of the user in the cache in correspondence; The method also includes: creating a new session connection with the server and determining a current user corresponding to the new session connection; determining whether a user identifier corresponding to the current user exists in the cache; if so, obtaining input information corresponding to the user identifier and filling the input information into the user input interface.
2. The method according to claim 1, characterized in that Generating a session processing result corresponding to the session disconnection request according to the operation state includes: Using an event listener to monitor the user's operation behavior; In the case where the user is operating, determining that the operation state is in operation, and generating a session processing result indicating that the current session is maintained; In the case that the user has not performed any operation, the operation state is determined to be no operation, and a session processing result indicating disconnection of the current session is generated.
3. A method for session processing, characterized in that: Applied to the server, including: Obtaining flow data from the client, including: obtaining flow information flowing into the server network card; parsing the flow information to obtain the flow data; When the traffic data satisfies the session disconnection policy, a session disconnection request is sent to the client; the session disconnection policy includes: the traffic data is less than a preset traffic threshold and the time for which the traffic data is less than the preset traffic threshold is greater than or equal to a preset time threshold; The session processing result returned by the client is received, and the current session is disconnected or maintained according to the session processing result; wherein the session processing result indicates disconnecting the current session or maintaining the current session, and is generated by the client according to the operation state.
4. The method according to claim 3, characterized in that Also includes: In the case where the session processing result is not received, placing the session disconnection request into a retry queue, and resending the session disconnection request to the client every preset first time period; If the session processing result is still not received within the preset second time period, the current session is disconnected.
5. A session processing client, characterized in that: include: A receiving module, used for receiving a session disconnection request sent by a server; A determination module, used to determine the current operation state of the user according to the session disconnection request, wherein the operation state is obtained by monitoring the operation behavior of the user; A generating module, configured to generate a session processing result corresponding to the session disconnection request according to the operation state; The session processing result indicates disconnecting the current session or maintaining the current session; A sending module, used for returning the session processing result to the server, so that the server disconnects the current session or maintains the current session according to the session processing result; a storage module, configured to, before generating a session processing result corresponding to the session disconnection request according to the operation state, if there is unfinished input information in the user input interface, obtain a user ID of the user by using the browser fingerprint technology, use the user ID as a cache key name, use the unfinished input information as a key value, and store the input information and the user ID of the user in a cache in correspondence; Establishing a module, used to create a new session connection with the server, and determine the current user corresponding to the new session connection; judging whether the user identifier corresponding to the current user exists in the cache; If yes, the input information corresponding to the user identification is obtained and the input information is filled into the user input interface.
6. A system for session processing, characterized in that: include: The client and server as described in claim 5, wherein: The server is used to obtain flow data from the client, including: obtaining flow information flowing into the server network card; parsing the flow information to obtain the flow data; sending a session disconnection request to the client when the flow data meets the session disconnection strategy; the session disconnection strategy includes: the flow data is less than a preset flow threshold and the time when the flow data is less than the preset flow threshold is greater than or equal to a preset time threshold; after receiving the session processing result sent by the client, disconnecting the current session or maintaining the current session according to the session processing result; The client is used to receive a session disconnection request sent by a server; determine the current operation state of the user according to the session disconnection request, wherein the operation state is obtained by monitoring the operation behavior of the user; generate a session processing result corresponding to the session disconnection request according to the operation state; the session processing result indicates disconnecting the current session or maintaining the current session; and return the session processing result to the server session processing result; before generating the session processing result corresponding to the session disconnection request according to the operation state, it also includes: in the case where there is unfinished input information in the user input interface, using the browser fingerprint technology to obtain the user ID of the user, using the user ID as the key name of the cache, using the unfinished input information as the key value, and storing the input information and the user ID of the user in the cache in correspondence; creating a new session connection with the server, and determining the current user corresponding to the new session connection; judging whether the user ID corresponding to the current user exists in the cache; if so, obtaining the input information corresponding to the user ID and filling the input information into the user input interface.
7. An electronic device for session processing, characterized in that: include: one or more processors; A storage client is used to store one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 4.
8. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.
