Search

EP-4489376-B1 - SESSION STATE MANAGEMENT METHOD AND SYSTEM, APPARATUS, DEVICE, AND STORAGE MEDIUM

EP4489376B1EP 4489376 B1EP4489376 B1EP 4489376B1EP-4489376-B1

Inventors

  • LIN, Jinjia

Dates

Publication Date
20260513
Application Date
20230224

Claims (12)

  1. A method for managing a session state, executed by a processing server, comprising: receiving (S110) a service processing result corresponding to a session service forwarded by a proxy server, wherein the service processing result is forwarded by the proxy server based on a session identifier in the service processing result to a processing server corresponding to the service processing result, the session identifier comprising mapping information between the service processing result and the processing server corresponding to the service processing result, wherein the service processing result is generated by a service server by processing a session service from a first client to a second client and reported by the service server to the proxy server; the processing server corresponding to the service processing result is pre-selected by the proxy server from a plurality of processing servers, and the session identifier is generated by the proxy server based on the mapping information between the service processing result and the corresponding processing server, returned to the service server, and added to service processing results in subsequent uploads of the service processing results by the service server; and the first client and the second client are in a same region or different regions, and in a case that the first client and the second client are in different regions, the session identifier further comprises region information; and determining (S120) session state information of the session service based on the service processing result, and updating the session state information to a local cache so as to synchronize the session state information to a cache of an associated regional data center through the local cache.
  2. The method for managing the session state according to claim 1, wherein, upon determining (S120) the session state information of the session service based on the service processing result, the method further comprises: updating the session state information to a pre-constructed message middleware, wherein the message middleware is configured to be used for a service server to query the session state information, the service server being configured to process the session service and generate the service processing result, and report the service processing result to the proxy server.
  3. The method for managing the session state according to claim 1, wherein the service processing result is a session creation result; and determining (S120) the session state information of the session service based on the service processing result, and updating the session state information to the local cache, comprises: performing an initialization operation of the session service based on the session creation result, generating first state information, and determining the first state information as the session state information and updating the session state information to the local cache.
  4. The method for managing the session state according to claim 3, wherein performing the initialization operation of the session service based on the session creation result further comprises: initializing a session timeout period of the session service based on the session creation result, and storing the session timeout period in the local cache, wherein the session timeout period is configured to detect a session connection state of a client.
  5. The method for managing the session state according to claim 4, wherein, upon performing the initialization operation of the session service based on the session creation result, the method further comprises: in a case that a client heartbeat request forwarded by the proxy server is received within the session timeout period, updating the session timeout period based on current time; and in a case that the client heartbeat request forwarded by the proxy server is not received within the session timeout period, determining that a client corresponding to the session service is in an offline state, updating the session state information in the local cache based on the offline state, and deleting the session timeout period.
  6. The method for managing the session state according to claim 4, wherein the service processing result is a session end result; and determining (S120) the session state information of the session service based on the service processing result, and updating the session state information to the local cache, comprises: generating second state information based on the session end result, and determining the second state information as the session state information and updating the session state information to the local cache.
  7. The method for managing the session state according to claim 6, wherein, prior to determining the second state information as the session state information and updating the session state information to the local cache, the method further comprises: acquiring a first distributed lock corresponding to the session end result based on the session identifier, wherein the first distributed lock is configured to prohibit initiating a session end request corresponding to the session service again; and upon determining the second state information as the session state information and updating the session state information to the local cache, the method further comprises: deleting the session timeout period.
  8. The method for managing the session state according to claim 1, wherein the service processing result is a streaming media connection result; and determining (S120) the session state information of the session service based on the service processing result, and updating the session state information to the local cache, comprises: generating third state information based on the streaming media connection result, and determining the third state information as the session state information and updating the session state information to the local cache.
  9. The method for managing the session state according to claim 8, wherein, prior to determining the third state information as the session state information and updating the session state information to the local cache, the method further comprises: acquiring a second distributed lock corresponding to the streaming media connection result based on the session identifier, wherein the second distributed lock is configured to prohibit initiating a streaming media connection request corresponding to the session service again; and upon determining the third state information as the session state information, the method further comprises: initializing a streaming media connection timeout period, wherein the streaming media connection timeout period is configured to detect a streaming media connection state of a client.
  10. A system for managing a session state, comprising: a service server (15), a proxy server (11), a processing server (12), and a local cache, wherein the service server (15) is configured to process a session service from a first client to a second client, generate a service processing result corresponding to the session service, and report the service processing result to the proxy server (11); the proxy server (11) is configured to forward the service processing result to the processing server (12) corresponding to the service processing result based on a session identifier in the service processing result, wherein the session identifier comprises mapping information between the service processing result and the processing server (12) corresponding to the service processing result, wherein the processing server corresponding to the service processing result is pre-selected by the proxy server from a plurality of processing servers, and the session identifier is generated by the proxy server based on the mapping information between the service processing result and the corresponding processing server, returned to the service server, and added to service processing results in subsequent uploads of the service processing results by the service server; and the first client and the second client are in a same region or different regions, and in a case that the first client and the second client are in different regions, the session identifier further comprises region information; the processing server (12) is configured to receive the service processing result corresponding to the session service forwarded by the proxy server (11), determine session state information of the session service based on the service processing result, and update the session state information to the local cache; and the local cache is configured to store and synchronize the session state information to a cache of an associated regional data center.
  11. A processing server, comprising: a receiving module (21), configured to receive a service processing result corresponding to a session service forwarded by a proxy server, wherein the service processing result is forwarded by the proxy server based on a session identifier in the service processing result to a processing server corresponding to the service processing result, the session identifier comprising mapping information between the service processing result and the processing server corresponding to the service processing result, wherein the service processing result is generated by a service server by processing a session service from a first client to a second client and reported by the service server to the proxy server; the processing server corresponding to the service processing result is pre-selected by the proxy server from a plurality of processing servers, and the session identifier is generated by the proxy server based on the mapping information between the service processing result and the corresponding processing server, returned to the service server, and added to service processing results in subsequent uploads of the service processing results by the service server; and the first client and the second client are in a same region or different regions, and in a case that the first client and the second client are in different regions, the session identifier further comprises region information; and an updating module (22), configured to determine session state information of the session service based on the service processing result, and update the session state information to a local cache so as to synchronize the session state information to a cache of an associated regional data center through the local cache.
  12. A storage medium comprising one or more computer-executable instructions, wherein the one or more computer-executable instructions, when executed by a computer processor, cause the computer processor to perform the method for managing the session state as defined in any one of claims 1 to 9.

Description

TECHNICAL FIELD Embodiments of the present disclosure relate to the field of computer technologies, and in particular, relate to a method and system for managing a session state, a processing server, and a storage medium. BACKGROUND Currently, with the iterative update of various social application products, various scenarios demanding temporary sessions in the applications are increasing, such as instant audio and video sessions between users and games initiated by matching. In these session scenarios, it is necessary to manage the session state to achieve the corresponding service functions (e.g., deducting game items according to the session time). CN104735098B discloses a session information control method and system. The session information control method includes the steps that an interceptor intercepts a visit request to a certain application server in a server cluster of a user, a session is created and a session mark is distributed according to the visit request, the session mark is stored in a client, session information is created in the certain application server in the server cluster, and the session information is synchronized in all application servers in a data synchronizing server cluster; when the interceptor captures session information updating, the interceptor synchronously updates the corresponding session information of all the application servers in the cluster according to the session mark. By means of the session information control method and system, the session information can be synchronously updated in the server cluster, the universality is high, efficiency is high, and the required storage space is small. US2021/263779A1 discloses embodiments of systems, apparatuses and methods providing enhanced function as a service (FaaS) to users, e.g., computer developers and cloud service providers (CSPs). A computing system configured to provide such enhanced FaaS service include one or more controls architectural subsystems, software and orchestration subsystems, network and storage subsystems, and security subsystems. The computing system executes functions in response to events triggered by the users in an execution environment provided by the architectural subsystems, which represent an abstraction of execution management and shield the users from the burden of managing the execution. The software and orchestration subsystems allocate computing resources for the function execution by intelligently spinning up and down containers for function code with decreased instantiation latency and increased execution scalability while maintaining secured execution. Furthermore, the computing system enables customers to pay only when their code gets executed with a granular billing down to millisecond increments. CN109361778A discloses a method and terminal for managing a session. The method includes the steps: S1, when an application server receives a session request from a load balancer, a Session ID corresponding to the session request is acquired; S2, a Hash value corresponding to the Session ID is calculated according to a preset Hash algorithm to obtain a first Hash value; and S3, two or more Memcached cache servers corresponding to the first Hash value synchronously manage session information corresponding to the Session ID, wherein the Hash value and the Memcached cache servers have a one-to-many relationship. The efficiency that a user accesses different pages on the same website is improved. SUMMARY Embodiments of the present disclosure provide a method and system for managing a session state, a processing server, and a storage medium. The invention is set out in the appended set of claims. BRIEF DESCRIPTION OF THE DRAWINGS FIG. 1 is a flowchart of a method for managing a session state according to some embodiments of the present disclosure;FIG. 2 is a schematic structural diagram of a system for managing a session state according to some embodiments of the present disclosure;FIG. 3 is a flowchart of session state management for session creation in some embodiments of the present disclosure;FIG. 4 is a flowchart of session state management during heartbeat monitoring in some embodiments of the present disclosure;FIG. 5 is a flowchart of session state management for ending a session in some embodiments of the present disclosure;FIG. 6 is a flowchart of session state management during audio and video connections in some embodiments of the present disclosure;FIG. 7 is a schematic structural diagram of a processing server according to some embodiments of the present disclosure; andFIG. 8 is a schematic structural diagram of a device for managing a session state according to some embodiments of the present disclosure. DETAILED DESCRIPTION For clearer descriptions of the objectives, technical solutions, and advantages of the present disclosure, specific embodiments of the present disclosure are further described in detail below with reference to the accompanying drawings. It can be underst