WO2023165429A1 - 一种会话状态管理方法、***、装置、设备及存储介质 - Google Patents

一种会话状态管理方法、***、装置、设备及存储介质 Download PDF

Info

Publication number
WO2023165429A1
WO2023165429A1 PCT/CN2023/078217 CN2023078217W WO2023165429A1 WO 2023165429 A1 WO2023165429 A1 WO 2023165429A1 CN 2023078217 W CN2023078217 W CN 2023078217W WO 2023165429 A1 WO2023165429 A1 WO 2023165429A1
Authority
WO
WIPO (PCT)
Prior art keywords
session
service
state information
processing result
session state
Prior art date
Application number
PCT/CN2023/078217
Other languages
English (en)
French (fr)
Inventor
林晋佳
Original Assignee
百果园技术(新加坡)有限公司
林晋佳
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 百果园技术(新加坡)有限公司, 林晋佳 filed Critical 百果园技术(新加坡)有限公司
Publication of WO2023165429A1 publication Critical patent/WO2023165429A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes

Definitions

  • the embodiments of the present application relate to the field of computer technology, and in particular to a session state management method, system, device, device, and storage medium.
  • the embodiments of the present application provide a session state management method, system, device, device, and storage medium, which can ensure the consistency of the session state and solve the technical problem of poor consistency of the existing session state management.
  • the embodiment of the present application provides a session state management method, including:
  • the proxy server receives the service processing result corresponding to the session service forwarded by the proxy server, the proxy server forwards the service processing result based on the session identifier contained in the service processing result, and the session identifier includes mapping information between the service processing result and the corresponding processing server;
  • the session state information of the session service is determined based on the service processing result, and the session state information is updated to the local cache, so that the session state information is synchronized to the cache of the computer room in the associated large area through the local cache.
  • the embodiment of the present application provides a session state management system, including: a business server, a proxy server, a processing server, and a local cache;
  • the service server is configured to process the session service from the first client to the second client, generate a corresponding service processing result, and report the service processing result to the proxy server;
  • the proxy server is configured to forward the service processing result to the corresponding processing server based on the session identifier included in the service processing result, and the session identifier includes mapping information between the service processing result and the corresponding processing server;
  • the processing server is configured to receive the service processing result of the corresponding session service forwarded by the proxy server, determine the session state information of the session service based on the service processing result, and update the session state information to the local cache;
  • the local cache is configured to store and synchronize session state information to the cache in the computer room associated with the large area.
  • the embodiment of the present application provides a session state management device, including:
  • the receiving module is configured to receive the service processing result corresponding to the session service forwarded by the proxy server, and the proxy server forwards the service processing result based on the session identifier included in the service processing result, and the session identifier includes mapping information between the service processing result and the corresponding processing server;
  • the update module is configured to determine the session state information of the session service based on the service processing result, and update the session state information to the local cache, so as to synchronize the session state information to the cache of the associated regional computer room through the local cache.
  • the embodiment of the present application provides a session state management device, including:
  • the memory configured to store one or more programs
  • the one or more processors When the one or more programs are executed by the one or more processors, the one or more processors implement the session state management method as described in the first aspect.
  • the embodiment of the present application provides a storage medium containing computer-executable instructions, and the computer-executable instructions are configured to execute the session state management method as described in the first aspect when executed by a computer processor.
  • the session status information of the session service is determined based on the service processing result by receiving the service processing result of the corresponding session service forwarded by the proxy server. Then update the session state information to the local cache, so as to synchronize the session state information to the cache of the computer room in the associated large area through the local cache.
  • the proxy server forwards the service processing result based on the session identifier contained in the service processing result, and the session identifier includes mapping information between the service processing result and the corresponding processing server.
  • the service processing result is forwarded through the session identifier for the corresponding processing server to process and record the session state, and the session state is synchronized through the local cache, so that the session state management of both parties in the session can be maintained at a high level Consistency, improving the timeliness of session state storage. At the same time, it also avoids the decentralized management of session data and optimizes the session state management effect.
  • Fig. 1 is a flowchart of a session state management method provided by an embodiment of the present application
  • FIG. 2 is a schematic structural diagram of a session state management system provided by an embodiment of the present application.
  • Fig. 3 is a flow chart of session state management when creating a session in the embodiment of the present application.
  • Fig. 4 is a flowchart of session state management during heartbeat monitoring in an embodiment of the present application
  • Fig. 5 is a flow chart of session state management when ending a session in an embodiment of the present application
  • Fig. 6 is a flow chart of session state management during audio and video connection in the embodiment of the present application.
  • FIG. 7 is a schematic structural diagram of a session state management device provided by an embodiment of the present application.
  • Fig. 8 is a schematic structural diagram of a session state management device provided by an embodiment of the present application.
  • a session state management method and system provided by the present application aims to select a processing server to receive the service processing result according to the mapping information of the service processing result contained in the session identifier and the corresponding processing server, so as to update the session state, and pass the local cache Synchronize the session state to each large area cache. In this way, it can be ensured that each session data of the session service is forwarded to the same processing server for processing, avoiding decentralized processing of data, and ensuring the consistency and timeliness of session state data storage.
  • the traditional session state management scheme it mainly adopts the following management modes:
  • a single-point processing method is adopted, and a single-point server provides the function of session state management, and interacts with the local database and cache to manage session state information.
  • This model has a single point of server failure , the background cannot provide services. Global session state business processing must be returned to the server, and cross-region processing business will inevitably increase delay and request failure rate.
  • Multi-point servers Using multi-point processing, multiple servers in each region provide the function of session state management, and each server interacts with the local database and cache to manage session state information. Multi-point servers will cause user data to be scattered and inconvenient to manage. If asynchronous and synchronous databases and caches are used, it is difficult to guarantee data consistency and timeliness. If a strongly consistent database and cache are used, the processing capability of the service will be reduced and the delay of request processing will be increased.
  • each business side implements a set of session state management system according to their own needs and actual conditions. Since the session state data among various service parties is not common, the user may exist in multiple sessions of different services at the same time. This will increase the development and maintenance costs of the session management system, and increase the possibility of system errors.
  • Figure 1 shows a flowchart of a session state management method provided by an embodiment of the present application.
  • the session state management method provided in this embodiment can be executed by a session state management device, and the session state management device can use software and/or Realized by means of hardware, the session state management device may be composed of two or more physical entities, or may be composed of one physical entity.
  • the session state management device may be a computing device such as a processing server of the session state management system.
  • the session state management method specifically includes:
  • S120 Determine the session state information of the session service based on the service processing result, and update the session state information to the local cache, so as to synchronize the session state information to the cache of the computer room in the associated large area through the local cache.
  • the processing server executes the above session state management method to implement session state management.
  • session state management can be performed through the above-mentioned processing server in a globalized business.
  • a session state management system including the processing server is provided to create, manage and monitor the session states among various clients.
  • the processing server provides a unified session state management interface. For a session service between the two parties in the session, the service processing results of each business service generated by it will be reported to the processing server, so as to manage the session state according to the processing server.
  • the above-mentioned service processing results are generated by the service processor that handles the conversation business.
  • the business server processes the above business service according to its own business logic, generates the corresponding service processing result, and then reports it to the processing server through the proxy server, so as to manage the session status of both parties through the processing server.
  • the session state management system of the embodiment of the present application includes a business server, a proxy server, a processing server, and a local cache;
  • the business server is configured to process the session business from the first client to the second client, generate a corresponding service processing result, and The service processing result is reported to the proxy server;
  • the proxy server is configured to forward the service processing result to the corresponding processing server based on the session identifier contained in the service processing result, and the session identifier includes the mapping information between the service processing result and the corresponding processing server;
  • the processing server configuration In order to receive the service processing result of the corresponding session service forwarded by the proxy server, determine the session state information of the session service based on the service processing result, and update the session state information to the local cache;
  • the local cache is configured to store and synchronize the session state information to the associated large area computer room in the cache.
  • FIG. 2 a schematic structural diagram of a session state management system according to an embodiment of the present application is provided.
  • the session service when processing the session service initiated by the client 17 in the Asian region to the client 18 in the European region, the session service will first be handed over to the service server 15 of the client 17 and the client 18 for processing. If the streaming media connection service is included in the session service, it will be processed by the streaming media server 16 .
  • the business server 15 is configured to process various actual business services of the session business, and directly interacts with the client.
  • the media server 16 is responsible for providing streaming media communication services such as video and voice.
  • the business server 15 and the streaming media server will generate a service processing result when providing corresponding services, and send this service processing result to the proxy server 11, so that the service processing result is forwarded to the corresponding processing server 12 by the proxy server 11, and the processing server 12
  • the session state is managed based on the above session state management method.
  • some requests from the client such as a heartbeat request for monitoring the session connection status of the client, can also be directly reported to the proxy server 11, and forwarded to the corresponding processing server 12 for processing through the proxy server.
  • the proxy server 11 forwards the service processing result, it will The session identifier contained in the result forwards the service processing result. Since the session identifier contains the mapping information between the service processing result and the corresponding processing server 12, when the client, business server or streaming media service needs to interact with the processing server, it will send the service processing result or request to the agent in the region to which it belongs server. The proxy server sends the mapping information of the service processing result to the corresponding processing server 12 to the corresponding processing server for processing. Moreover, when both parties in the session initially create the session, the service server will send the service processing result of the session creation to the proxy server.
  • the proxy server selects a processing server from each processing server in the corresponding large area to process each service processing result of the current session business according to the region to which the client requesting to create the session belongs. Further, a session identifier is generated based on the mapping information of the service processing result and the corresponding processing server, and the currently received service processing result is sent to the corresponding processing server based on the session identifier. At the same time, the session identifier is returned to the business server, and the subsequent business server will add the session identifier to it when uploading the service processing result, so that the proxy server can determine the receiver of the corresponding service processing result.
  • the mapping information of the session identifier can be represented by a hash value.
  • the proxy server forwards the service processing result, it can determine the target processing server by calculating the hash value, and then forward the service processing result.
  • the session identifier also needs to include region information.
  • the proxy server in the region to which client A belongs will select a processing server from multiple processing servers in the region to manage according to the set rules (such as load balancing rules) The session state of both parties. Then a session identifier of the current session is generated, and the session identifier identifies the region to which client A belongs and the processing server used to manage the state of the current session. The session identifier will be sent to the two parties in the session and the service server and streaming media server to which they belong, so as to add the session identifier in the service processing result.
  • the set rules such as load balancing rules
  • the proxy servers to which both parties in the session belong first determine the region they belong to according to the session identifier. Then select the corresponding processing server to forward the service processing result through the consistent hash of the session identifier in the large area.
  • a processing server 12 in the Asia region is pre-selected in the session identifier to manage the session status of both parties. Then, when the client 17 receives the service processing result from the proxy server in the region to which the client 18 belongs, it will select the corresponding processing server 12 in the Asia region to manage the session state according to the consistent hash of the session identifier.
  • the processing server 12 obtains the service processing result and updates the session state, if it determines that the session state has changed. Also updates session state information into the pre-built message center
  • the message middleware 14 is configured to allow the service server 15 to query session state information to execute corresponding session service logic.
  • the session state data is stored in different regions and bidirectionally synchronized to each large region cache, which can improve the disaster recovery capability and ensure the final consistency of the session state data.
  • the above-mentioned service processing result is a result generated when the business server and the streaming media server process the corresponding session service.
  • the service processing result records corresponding session state information, which may specifically be a session creation result, a session end result, or a streaming media connection result. Then the processing server can execute corresponding session state management logic according to the received processing results of different services.
  • the service processing result is a session creation result
  • perform an initialization operation of the session service based on the session creation result generate first state information, use the first state information as the session state information, and update it to a local cache.
  • the session timeout time of the session service is also initialized based on the session creation result, and the session timeout time is stored in a local cache, and the session timeout time is configured to detect the client session connection status.
  • the session state management flow of steps a1-a12 when creating a session is provided.
  • client 1 and client 2 first initiate a session request.
  • the session request is received by the business server and the business logic is processed.
  • the service server notifies the client 2 of the called party through offline or online notification.
  • the service server sends the session creation result of processing the session creation service to the proxy server in the region to which it belongs.
  • the proxy server generates a corresponding session state identifier and a flag for background verification according to the area where it is deployed. Then the proxy server selects the processing server in the corresponding area to forward according to the session state identifier.
  • the session identifier Because the session identifier is created by the proxy server according to its own region, it must select the processing server in the same region to receive the service processing result. After the processing server receives the service processing result, it can check according to the flag generated by the proxy server, and at the same time judge whether there is an unfinished session between the two sides of the current session, and if so, return a status error message.
  • the processing server After completing the verification and confirming that the status of both parties in the session is normal, determine the current session creation according to the session creation result On success, the processing server initializes the session data. Among them, the session timeout period of the clients of both parties in the session can be set, which can be used to check the heartbeat of the client later and determine whether the user is disconnected. Optionally, the processing server can also set a maximum timeout period of the current session, that is, if the session still exists beyond the maximum timeout period, the processing server will actively close the session.
  • the initialization operation will also initialize the session state, define the initialization result of the session state as the first state information, and then use the first state information as the session state information and store it in the local cache.
  • the processing server will generate session data according to the current session state, and return the session data to the business server.
  • the session data is sent from the processing server to the proxy server, and then the proxy server returns to the calling business server.
  • the business server will notify the client of the corresponding session data and business data after confirming the information of successfully creating the session. This enables the client to establish audio and video connections based on session data, and process and display corresponding business modules based on business data.
  • the processing server when the processing server processes the session creation result, it can also send an inquiry application to the proxy server, so as to query the current session state of the called party client through the proxy server, and then decide whether to continue the session service or stop the call, and give The calling client returns specific prompts.
  • the local cache will bidirectionally synchronize the data to caches in other regions around the world to ensure that the session state information in all regions is eventually consistent.
  • the above-mentioned session creation can be a session mode for different scenarios such as phone calls and games, and the processing server only needs to provide an interface to access the corresponding session creation result to perform session state management corresponding to the session mode.
  • the processing server will regularly detect the client whose connection timed out according to the heartbeat of the client.
  • the session state management flow during heartbeat monitoring in steps b1-b7 is provided.
  • the processing server receives the client heartbeat request forwarded by the proxy server within the session timeout period, the session timeout period is updated based on the current time; if the client heartbeat request forwarded by the proxy server is not received within the session timeout period , determine that the client corresponding to the session service is in an offline state, update the locally cached session state information based on the offline state, and delete the session timeout period.
  • the client after the client successfully creates a session, it also needs to periodically send a heartbeat request to the processing server through the proxy server, so as to ensure that the processing server can monitor the session and find out whether the client status is abnormal in time.
  • the processing server After the processing server receives the client's heartbeat request, it will update the timeout time of the corresponding client.
  • the timeout time update method is the current time plus the customer order timeout time before the update.
  • the processing server After the processing server successfully initializes the session timeout of the client, it will start to regularly check whether the user has timed out.
  • the processing server When the processing server has not received a heartbeat request from a client for a long time, and the client's session timeout is reached, the processing server will update the session status as the client is offline, and clear the client's timeout (subsequent regular checks will not be checked again the client). And record the client disconnection event to the message middleware. Since the business server will actively consume the events of the message middleware, after obtaining the message that the client is offline, it can process the corresponding client offline business logic.
  • the processing server will re-update the timeout period of the client. And record the client reconnection event to the message middleware.
  • the business server actively consumes the events of the message middleware, obtains the message of the client's reconnection, and processes the corresponding business logic.
  • the user on the service side is notified of changes in the session status in real time, and different services are isolated from each other without interfering with each other. In this way, the pressure on the deployed services can be reduced without affecting the user experience
  • the processor when the processor manages the session state, it will acquire the first distributed lock corresponding to the session end result based on the session identifier, and the first distributed lock is configured to prohibit the corresponding session business Initiate the session end request again. Then generate the second state information based on the session end result, use the second state information as the session state information and update it to the local cache. Afterwards, remove the session timeout on the client side.
  • the session state management process when the session is ended in steps d1-d8 is provided.
  • the service server judges that the current session ends, it sends the session end result to the nearest proxy server.
  • the proxy server forwards the session end result to the uniquely corresponding processing server according to the session identifier.
  • the processing server After receiving the session end result, the processing server first obtains the distributed lock of the current session end result according to the session identifier, and defines the distributed lock as the first distributed lock.
  • the first distributed lock is used to prohibit other session end requests of the session service, so as to ensure that all operations of the same session service are processed in series. Then clear the timeout period corresponding to the client and session, and update the session status.
  • the end session state is defined as the second state information, and the second state information is used as the session state information and updated to the local cache. And record the state of ending the session to the message middleware, and then notify the streaming media server and the service server that the session ends, so that the streaming media server and the service server execute the corresponding business logic when the session ends.
  • the session end result may be that the service server consumes a user disconnection event and automatically ends the session. It can also be that the user operation of the client terminal actively terminates the session. It can also be session timeout, processing service The server actively terminates the session and notifies the service server through the message middleware.
  • the embodiment of the present application does not impose fixed restrictions on the manner of ending the session, so details will not be described here.
  • this embodiment of the present application uses independent processing logic to manage the session state.
  • the service processing result is a streaming media connection result for audio and video
  • the processing server manages the session state it will obtain the second distributed lock corresponding to the streaming media connection result based on the session identifier, and the second distributed lock is configured as Forbid the corresponding session service to initiate a streaming media connection request again; generate the third state information based on the streaming media connection result, use the third state information as the session state information and update it to the local cache; initialize the streaming media connection timeout time, and configure the streaming media connection timeout time In order to detect the status of client streaming media connection.
  • a session state management process for c1-c6 audio and video connections is provided.
  • the connection media server determines that the connection of the client is successful
  • the streaming media server notifies the processing server that the corresponding client has successfully connected the streaming media through the proxy server based on the result of the streaming media connection.
  • the processing server After receiving the streaming media connection result, the processing server first obtains the distributed lock corresponding to the streaming media connection result according to the session identifier, and defines the distributed lock as the second distributed lock.
  • the second distributed lock is configured to prohibit the corresponding session service from initiating a streaming media connection request again, so as to avoid multiple streaming media connections from the same client at the same time, so as to ensure that all operations of the same session service are processed serially.
  • the state information is generated based on the successful state of the streaming media connection, defined as the third state information, and the third state information is used as the session state information and updated to the local cache.
  • connection timeout time corresponding to the streaming media timeout time of the client.
  • the processing server judges that both parties of the session are connected successfully, it will record the session status as the official start of the streaming media session, and record the session status to the message middleware.
  • the business server obtains the message of the successful connection between the two parties of the session by actively consuming the events of the message middleware, and processes the corresponding business logic.
  • the processing server acquires corresponding session states for different service processing results, and updates them to the local cache, so as to realize the session state management process of the embodiment of the present application.
  • the session state information of the session service is determined based on the service processing result. Then update the session state information to the local cache, so as to synchronize the session state information to the cache of the computer room in the associated large area through the local cache.
  • the proxy server forwards the service processing result based on the session identifier contained in the service processing result, and the session identifier includes mapping information between the service processing result and the corresponding processing server.
  • the service processing result is forwarded through the session identifier for the corresponding processing server to process and record the session state, and the session state is synchronized through the local cache, so that the session state management of both parties in the session can maintain a high consistency and improve Timeliness of session state storage. At the same time, it also avoids the decentralized management of session data, and the optimization will Session state management effect.
  • FIG. 7 is a schematic structural diagram of a session state management device provided by the present application.
  • the session state management device provided in this embodiment specifically includes: a receiving module 21 and an updating module 22 .
  • the receiving module 21 is configured to receive the service processing result corresponding to the session service forwarded by the proxy server, and the proxy server forwards the service processing result based on the session identifier included in the service processing result, and the session identifier includes mapping information between the service processing result and the corresponding processing server ;
  • the update module 22 is configured to determine the session state information of the session service based on the service processing result, and update the session state information to the local cache, so as to synchronize the session state information to the cache of the associated large area computer room through the local cache.
  • the update module 22 also updates the session state information to the pre-built message middleware, the message middleware is configured for the service server to query the session state information, the service server is configured to process the session business and generate a service processing result, and the service processing result Report to proxy server.
  • the service processing result is a session creation result
  • the update module 22 is configured to perform an initialization operation of a session service based on the session creation result, generate first state information, use the first state information as the session state information, and update it to a local cache.
  • the session timeout time of the session service is initialized based on the session creation result, the session timeout time is stored in a local cache, and the session timeout time is configured to detect the connection state of the client session.
  • the session timeout period is updated based on the current time; if the client heartbeat request forwarded by the proxy server is not received within the session timeout period, determine The client corresponding to the session service is in an offline state, and the locally cached session state information is updated based on the offline state, and the session timeout period is deleted.
  • the service processing result is the session end result;
  • the update module 22 is configured to obtain the first distributed lock corresponding to the session end result based on the session identifier, and the first distributed lock is configured to prohibit the corresponding session service from initiating the session end request again; based on The second state information is generated as a result of the session ending, and the second state information is used as the session state information and updated to the local cache; the session timeout period is deleted.
  • the service processing result is a streaming media connection result
  • the update module 22 is configured to obtain a second distributed lock corresponding to the streaming media connection result based on the session identifier, and the second distributed lock is configured to prohibit the corresponding session service from initiating a streaming media connection again Request; generate third state information based on streaming media connection results, use the third state information as session state information and update to local cache; initialize streaming media connection timeout Time, the streaming media connection timeout is configured to detect the client streaming media connection status.
  • the session state information of the session service is determined based on the service processing result. Then update the session state information to the local cache, so as to synchronize the session state information to the cache of the computer room in the associated large area through the local cache.
  • the proxy server forwards the service processing result based on the session identifier contained in the service processing result, and the session identifier includes mapping information between the service processing result and the corresponding processing server.
  • the service processing result is forwarded through the session identifier for the corresponding processing server to process and record the session state, and the session state is synchronized through the local cache, so that the session state management of both parties in the session can maintain a high consistency and improve Timeliness of session state storage. At the same time, it also avoids the decentralized management of session data and optimizes the session state management effect.
  • the session state management device provided in the embodiment of the present application can be configured to execute the session state management method provided in the above embodiment, and has corresponding functions and beneficial effects.
  • the embodiment of the present application also provides a session state management device.
  • the memory 32 as a computer-readable storage medium, can be configured to store software programs, computer-executable programs and modules, such as program instructions/modules corresponding to the session state management method described in any embodiment of the present application (for example, session state management receiving module 21 and updating module in the device).
  • the communication module 33 is configured to perform data transmission.
  • the processor 31 executes various functional applications and data processing of the device by running software programs, instructions and modules stored in the memory, that is, implements the above-mentioned session state management method.
  • the input device 34 may be configured to receive input of numeric or character information, and to generate key signal input related to user settings and function control of the device.
  • the output device 35 may include a display device such as a display screen.
  • the session state management device provided above can be configured to execute the session state management method provided in the above embodiment, and has corresponding functions and beneficial effects.
  • the embodiments of the present application further provide a storage medium containing computer-executable instructions, the computer-executable instructions are configured to execute a session state management method when executed by a computer processor, the storage medium It can be any of various types of memory devices or storage devices.
  • a storage medium containing computer-executable instructions provided in the embodiments of the present application the computer-executable instructions are not limited to the session state management method described above, and can also perform the session state management provided in any embodiment of the present application Related operations in the method.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer And Data Communications (AREA)

Abstract

本申请实施例公开了一种会话状态管理方法、***、装置、设备及存储介质。本申请实施例提供的技术方案,通过接收代理服务器转发的对应会话业务的服务处理结果,基于服务处理结果确定会话业务的会话状态信息。进而将会话状态信息更新至本地缓存,以通过本地缓存同步会话状态信息至关联大区机房的缓存中。其中,代理服务器基于服务处理结果包含的会话标识符转发该服务处理结果,该会话标识符包括服务处理结果与对应处理服务器的映射信息。采用上述技术手段,可以使会话双方的会话状态管理保持较高的一致性,提升会话状态存储的时效性。同时也避免了会话数据分散管理,优化会话状态管理效果。

Description

一种会话状态管理方法、***、装置、设备及存储介质
本申请要求在2022年03月1日提交中国专利局、申请号为202210195846.X的中国专利申请的优先权,该申请的全部内容通过引用结合在本申请中。
技术领域
本申请实施例涉及计算机技术领域,尤其涉及一种会话状态管理方法、***、装置、设备及存储介质。
背景技术
目前,随着各类社交应用产品的迭代更新,应用中各种临时会话需求场景也日渐增多。如用户之间的即时音视频会话、通过匹配发起的游戏等场景。在这些会话场景中,需要对会话状态进行管理,以实现相应的业务功能(如根据会话时间扣取游戏道具等)。现有管理会话状态的方式主要采用多点服务器的方式,各个服务器通过获取所属大区的相关会话数据,已根据会话数据更新会话状态至缓存,进行会话状态管理。通过多点服务器以提升会话数据的并发处理能力,降低单个服务器的数据处理压力。
但是,简单采用多点服务器管理会话状态,会使会话双方的会话数据分散管理,难以保障数据存储的一致性和时效性。以此影响会话状态管理效果,导致相关业务处理出错。
发明内容
本申请实施例提供一种会话状态管理方法、***、装置、设备及存储介质,能够保障会话状态的一致性,解决现有会话状态管理一致性较差的技术问题。
在第一方面,本申请实施例提供了一种会话状态管理方法,包括:
接收代理服务器转发的对应会话业务的服务处理结果,代理服务器基于服务处理结果包含的会话标识符转发服务处理结果,会话标识符包括服务处理结果与对应处理服务器的映射信息;
基于服务处理结果确定会话业务的会话状态信息,将会话状态信息更新至本地缓存,以通过本地缓存同步会话状态信息至关联大区机房的缓存中。
在第二方面,本申请实施例提供了一种会话状态管理***,包括:业务服务器、代理服务器、处理服务器和本地缓存;
业务服务器配置为处理第一客户端向第二客户端的会话业务,生成对应的服务处理结果,将服务处理结果上报至代理服务器;
代理服务器配置为基于服务处理结果包含的会话标识符转发服务处理结果至对应的处理服务器,会话标识符包括服务处理结果与对应的处理服务器的映射信息;
处理服务器配置为接收代理服务器转发的对应会话业务的服务处理结果,基于服务处理结果确定会话业务的会话状态信息,将会话状态信息更新至本地缓存;
本地缓存配置为存储并同步会话状态信息至关联大区机房的缓存中。
在第三方面,本申请实施例提供了一种会话状态管理装置,包括:
接收模块,配置为接收代理服务器转发的对应会话业务的服务处理结果,代理服务器基于服务处理结果包含的会话标识符转发服务处理结果,会话标识符包括服务处理结果与对应处理服务器的映射信息;
更新模块,配置为基于服务处理结果确定会话业务的会话状态信息,将会话状态信息更新至本地缓存,以通过本地缓存同步会话状态信息至关联大区机房的缓存中。
在第四方面,本申请实施例提供了一种会话状态管理设备,包括:
存储器以及一个或多个处理器;
所述存储器,配置为存储一个或多个程序;
当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现如第一方面所述的会话状态管理方法。
在第五方面,本申请实施例提供了一种包含计算机可执行指令的存储介质,所述计算机可执行指令在由计算机处理器执行时配置为执行如第一方面所述的会话状态管理方法。
本申请实施例通过接收代理服务器转发的对应会话业务的服务处理结果,基于服务处理结果确定会话业务的会话状态信息。进而将会话状态信息更新至本地缓存,以通过本地缓存同步会话状态信息至关联大区机房的缓存中。其中,代理服务器基于服务处理结果包含的会话标识符转发该服务处理结果,该会话标识符包括服务处理结果与对应处理服务器的映射信息。采用上述技术手段,通过会话标识符转发服务处理结果供对应的处理服务器处理并记录会话状态,并通过本地缓存同步会话状态,以此可以使会话双方的会话状态管理保持较高 的一致性,提升会话状态存储的时效性。同时也避免了会话数据分散管理,优化会话状态管理效果。
附图说明
图1是本申请实施例提供的一种会话状态管理方法的流程图;
图2是本申请实施例提供的一种会话状态管理***的结构示意图;
图3是本申请实施例中创建会话时的会话状态管理流程图;
图4是本申请实施例中心跳监控时的会话状态管理流程图;
图5是本申请实施例中结束会话时的会话状态管理流程图;
图6是本申请实施例中音视频连接时的会话状态管理流程图;
图7是本申请实施例提供的一种会话状态管理装置的结构示意图;
图8是本申请实施例提供的一种会话状态管理设备的结构示意图。
具体实施方式
为了使本申请的目的、技术方案和优点更加清楚,下面结合附图对本申请具体实施例作进一步的详细描述。可以理解的是,此处所描述的具体实施例仅仅用于解释本申请,而非对本申请的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与本申请相关的部分而非全部内容。在更加详细地讨论示例性实施例之前应当提到的是,一些示例性实施例被描述成作为流程图描绘的处理或方法。虽然流程图将各项操作(或步骤)描述成顺序的处理,但是其中的许多操作可以被并行地、并发地或者同时实施。此外,各项操作的顺序可以被重新安排。当其操作完成时所述处理可以被终止,但是还可以具有未包括在附图中的附加步骤。所述处理可以对应于方法、函数、规程、子例程、子程序等等。
本申请提供的一种会话状态管理方法及***,旨在根据会话标识符包含的服务处理结果与对应处理服务器的映射信息,选择处理服务器接收服务处理结果,以进行会话状态更新,并通过本地缓存同步会话状态至各个大区缓存。以此可以确保会话业务的各个会话数据都转发到同一处理服务器处理,避免了数据分散处理,保障会话状态数据存储的一致性和时效性。对于传统的会话状态管理方案,其主要采用如下管理模式:
1、采用单点处理方式,由一个单点服务器提供会话状态管理的功能,并且和本地数据库、缓存交互管理会话状态信息。这种模式在单点服务器发生故障 时,后台不能提供服务。全球会话状态业务处理都必须回源到该服务器,而跨区处理业务必然带来延迟的增加和请求失败率的提升。
2、采用多点处理方式,由各个区域多个服务器提供会话状态管理的功能,每个服务器都和本地数据库、缓存交互管理会话状态信息。多点服务器会导致用户数据分散不方便管理。如果使用异步同步的数据库和缓存,数据的一致性和时效性难以保证。如果使用强一致性的数据库和缓存,则降低了服务的处理能力,并增加请求处理的延时。
3、采用分区处理方式,用户选择加入一个服务区与同服务区的其他用户互动。这样不同服务区之间的用户无法互动,相当于隔离了不同服务区的用户之间的会话。服务区之间的用户数量可能不均匀,用户量大的服务区的服务压力较大。
4、采用业务方独立处理的方式,各个业务方针对各自的需求和实际情况自行实现一套会话状态管理***。由于各个业务方之间会话状态数据并不共通,导致用户可能同时存在多个不同业务的会话中。以此会提高会话管理***的开发和维护成本,并且增加了***出错的可能性。
显然,现有会话状态管理方式均无法保障会话状态信息存储的一致性,基于此,提供本申请实施例的一种会话状态管理方法及***,以解决现有会话状态管理一致性较差的技术问题。
实施例:
图1给出了本申请实施例提供的一种会话状态管理方法的流程图,本实施例中提供的会话状态管理方法可以由会话状态管理设备执行,该会话状态管理设备可以通过软件和/或硬件的方式实现,该会话状态管理设备可以是两个或多个物理实体构成,也可以是一个物理实体构成。一般而言,该会话状态管理设备可以是会话状态管理***的处理服务器等计算设备。
下述以处理服务器为执行会话状态管理方法的主体为例,进行描述。参照图1,该会话状态管理方法具体包括:
S110、接收代理服务器转发的对应会话业务的服务处理结果,代理服务器基于服务处理结果包含的会话标识符转发服务处理结果,会话标识符包括服务处理结果与对应处理服务器的映射信息;
S120、基于服务处理结果确定会话业务的会话状态信息,将会话状态信息更新至本地缓存,以通过本地缓存同步会话状态信息至关联大区机房的缓存中。
本申请实施例通过处理服务器执行上述会话状态管理方法,以实现会话状态管理。对于任何业务需求方,都可以在全球化的业务中通过上述处理服务器进行会话状态管理。其中,通过提供一个包含该处理服务器的会话状态管理***,以创建、管理和监控各个客户端之间的会话状态。处理服务器提供统一的会话状态管理接口,对于会话双方的一个会话业务,其产生的每个业务服务的服务处理结果都会上报至处理服务器,以根据处理服务器进行会话状态管理。
需要说明的是,上述服务处理结果以由处理会话业务的业务处理器生成,业务处理器在处理会话双方的一个会话业务时,会产生相应的多个业务服务,如创建会话、连接流媒体、结束会话等业务服务,业务服务器根据自身的业务逻辑处理上述业务服务后,生成相应的服务处理结果,然后通过代理服务器上报至处理服务器,以通过处理服务器进行会话双方的会话状态管理。
具体地,本申请实施例的会话状态管理***包括业务服务器、代理服务器、处理服务器和本地缓存;业务服务器配置为处理第一客户端向第二客户端的会话业务,生成对应的服务处理结果,将服务处理结果上报至代理服务器;代理服务器配置为基于服务处理结果包含的会话标识符转发服务处理结果至对应的处理服务器,会话标识符包括服务处理结果与对应的处理服务器的映射信息;处理服务器配置为接收代理服务器转发的对应会话业务的服务处理结果,基于服务处理结果确定会话业务的会话状态信息,将会话状态信息更新至本地缓存;本地缓存配置为存储并同步会话状态信息至关联大区机房的缓存中。
示例性的,参照图2,提供本申请实施例会话状态管理***的结构示意图。其中,在处理亚洲大区客户端17向欧洲大区客户端18发起的会话业务时,首先该会话业务会交由客户端17和客户端18的业务服务器15处理。如果在会话业务中包括流媒体连接业务,则由流媒体服务器16处理。其中,业务服务器15配置为处理会话业务的各项实际业务服务,其和客户端直接交互。媒体服务器16则负责提供视频、语音等流媒体的通信服务。业务服务器15和流媒体服务器在提供相应服务时会生成服务处理结果,将这一服务处理结果发送至代理服务器11,以通过代理服务器11转发服务处理结果给对应的处理服务器12,由处理服务器12基于上述会话状态管理方法管理会话状态。此外,对于客户端的部分请求,如用于监测客户端会话连接状态的心跳请求,也可以直接上报至代理服务器11,通过代理服务器转发给对应的处理服务器12处理。
需要说明的是,代理服务器11在转发服务处理结果时,会基于服务处理结 果包含的会话标识符转发服务处理结果。由于会话标识符包含了服务处理结果与对应处理服务器12的映射信息,当客户端、业务服务器或流媒体服务其需要和处理服务器交互时,都会把服务处理结果或者请求发送给所属大区的代理服务器。由代理服务器按照服务处理结果与对应处理服务器12的映射信息发送到对应的处理服务器处理。并且,在会话双方一开始创建会话时,业务服务器会将创建会话的服务处理结果发送给代理服务器。代理服务器根据请求创建会话的客户端的所属大区从对应大区的各个处理服务器中选择一个处理服务器处理当前会话业务的各个服务处理结果。进而基于服务处理结果与对应处理服务器的映射信息生成一个会话标识符,基于该会话标识符发送当前接收到的服务处理结果至对应处理服务器。同时将会话标识符返回给业务服务器,后续业务服务器在上传服务处理结果时,会在其中添加该会话标识符,以便于代理服务器确定对应服务处理结果的接收方。
可选地,该会话标识符的映射信息可以使用哈希值表示,代理服务器在转发服务处理结果时,即可通过计算哈希值确定目标处理服务器,然后进行服务处理结果转发。此外,对于处于不同大区的会话双方,为了确保服务处理结果都能够集中到同一个处理服务器处理,则该会话标识符还需要包含的大区信息。
例如,客户端A在向客户端B发起会话时,客户端A所属大区代理服务器会在所属大区内按照设定规则(如负载均衡规则)从多个处理服务器中选择一个处理服务器来管理双方的会话状态。然后生成当前会话的会话标识符,会话标识符标识了客户端A所属大区,以及用于管理当前会话状态的处理服务器。该会话标识符会发送给会话双方及其所属的业务服务器和流媒体服务器,以在服务处理结果中添加该会话标识符。
之后,会话双方所属的代理服务器接收到服务处理结果后,首先根据会话标识符确定所属大区。然后在该大区通过会话标识符一致性哈希选择对应处理服务器转发服务处理结果。如图2所示,以客户端17向客户端18的会话业务为例,预先在会话标识符中选定了亚洲大区一个处理服务器12管理会话双方的会话状态。则客户端17向客户端18所属大区的代理服务器在接受到服务处理结果时,都会根据会话标识符一致性哈希选择亚洲大区的对应处理服务器12管理会话状态。
此外,如图2所示,处理服务器12在获取到服务处理结果进行会话状态更新时,若确定会话状态发生改变。还将会话状态信息更新至预构建的消息中间 件14,消息中间件14配置为供业务服务器15查询会话状态信息,以执行相应的会话业务逻辑。
以此,通过对应会话业务生成会话标识符,使用会话标识符使用固定的转发规则转发服务处理结果,可以确保对同一会话业务的所有高频操作都回源到唯一的处理服务器串行执行,避免了会话数据分散处理导致的逻辑错误问题,并且保证了会话数据的一致性。此外,通过提供多点处理服务器管理不同会话业务的会话状态,可以解决了单点故障问题,减少因单点故障导致服务不可以用的情况。会话状态数据分区域存储,并双向同步至各个大区缓存,可以提高容灾能力,确保会话状态数据最终一致。当用户量级或使用处理服务器的业务增多时,可以通过在机房增加处理服务器部署的方式平滑扩展,优化会话状态管理效果。
具体地,由于上述服务处理结果为业务服务器和流媒体服务器处理相应会话业务服务的时候所产生的结果。该服务处理结果记录了相应的会话状态信息,其具体可以是会话创建结果、会话结束结果或者流媒体连接结果。则处理服务器根据接收到的不同服务处理结果,即可执行相应的会话状态管理逻辑。
其中,若服务处理结果为会话创建结果基于所述会话创建结果执行所述会话业务的初始化操作,生成第一状态信息,以所述第一状态信息作为所述会话状态信息并更新至本地缓存。并且,初始化操作时,还基于所述会话创建结果初始化所述会话业务的会话超时时间,将所述会话超时时间存储至本地缓存,所述会话超时时间配置为检测客户端会话连接状态。
示例性的,参照图3,提供步骤a1-a12的创建会话时的会话状态管理流程。在会话创建时,先由客户端1客户端2发起会话请求。会话请求由业务服务器接收并且处理业务逻辑。业务服务器通过离线或在线通知的方式通知被呼叫方客户端2。待客户端2接受会话后,业务服务器发送处理会话创建服务的会话创建结果到所属大区的代理服务器。代理服务器根据自己部署的区域,生成对应的会话状态标识符和供后台验证的标志。然后代理服务器根据会话状态标识符选择对应区域的处理服务器转发。因为会话标识符由代理服务器根据自己所处区域创建,所以此处必定是选择同区域的处理服务器接收服务处理结果。处理服务器收到服务处理结果后可以根据代理服务器生成标志进行校验,同时判断当前会话双方是否存在未完成的会话,若存在,则返回状态错误信息。
完成校验确认会话双方状态正常后,根据会话创建结果确定当前会话创建 成功,处理服务器会初始化会话数据。其中,可以设置会话双方客户端的会话超时时间,以用于后续检查客户端心跳,判断用户是否掉线。可选的,处理服务器还可以设置当前会话的最大超时时间,即超过这个最大超时时间如果该会话依然存在,处理服务器会主动关闭会话。
并且,由于是刚开始创建会话,因此初始化操作还会初始化会话状态,将会话状态初始化结果定义为第一状态信息,然后使用第一状态信息作为会话状态信息存储至本地缓存。
完成上述操作后,处理服务器会根据当前会话状态生成会话数据,返回会话数据给业务服务器。会话数据从处理服务器到代理服务器,再由代理服务器返回调用的业务服务器。业务服务器收到会话数据,确定成功创建会话的信息后,会通知客户端双方相应的会话数据和业务数据。以使客户端后根据会话数据建立音视频连接,根据业务数据处理和展示相应业务模块。
可选的,处理服务器在处理会话创建结果时,还可以向代理服务器发送查询申请,以通过代理服务器查询被呼叫方客户端当前的会话状态,然后再决定是否继续会话业务或停止呼叫,并给呼叫方客户端返回特定的提示。
处理服务器将会话状态信息更新到本地缓存后,本地缓存会双向同步数据至全球其他大区的缓存,以保证所有大区的会话状态信息最终一致。
需要说明的是,上述会话创建可以是针对电话、游戏等不同场景的会话方式,处理服务器只需提供接口接入对应的会话创建结果,即可执行对应会话方式的会话状态管理。
可选地,基于上述初始化操作设置的客户端的会话超时时间,处理服务器会定时根据客户端心跳检测连接超时的客户端。参见图4,提供步骤b1-b7的心跳监控时的会话状态管理流程。其中,处理服务器在会话超时时间内接收到代理服务器转发的客户端心跳请求的情况下,基于当前时间更新会话超时时间;在会话超时时间内未接收到代理服务器转发的客户端心跳请求的情况下,确定会话业务对应的客户端处于掉线状态,基于掉线状态更新本地缓存的会话状态信息,并删除会话超时时间。
如图4所示,客户端创建会话成功后,也需要定时通过代理服务器发送心跳请求至处理服务器,以确保处理服务器可以监控会话情况,并且及时发现客户端状态是否异常。处理服务器收到客户端的心跳请求后,会更新对应客户端的超时时间,超时时间的更新方式为当前时间加上更新前的客户单超时时间。 处理服务器在初始化客户端的会话超时时间后成功后,就会开始定时检查用户是否超时。
当处理服务器长时间没有收到某客户端的心跳请求,并且达到了客户端的会话超时时间,处理服务器会更新会话状态为该客户端掉线,清除该客户端的超时时间(后续定时检查不会再检查该客户端)。并且将客户端掉线事件记录到消息中间件。由于业务服务器会主动消费消息中间件的事件,在获得该客户端掉线的消息后,即可处理相应的客户端掉线业务逻辑。
之后,当本来被认定为掉线的客户端重新发送心跳请求后,处理服务器会重新更新该客户端的超时时间。并且将客户端重连事件记录到消息中间件。业务服务器主动消费消息中间件的事件,获得该客户端重连的消息,并且处理相应的业务逻辑。
通过监控客户端连接状态,实时通知业务侧用户会话状态的变化,并且不同业务相互隔离,互不干扰。以此可以降低已经部署的服务压力,并且不影响用户使用体验
可选地,若服务处理结果为会话结束结果,则处理器在管理会话状态时,会基于会话标识符获取对应会话结束结果的第一分布式锁,第一分布式锁配置为禁止对应会话业务再次发起会话结束请求。然后基于会话结束结果生成第二状态信息,以第二状态信息作为会话状态信息并更新至本地缓存。之后,删除客户端的会话超时时间。
其中,参照图5,提供d1-d8步骤结束会话时的会话状态管理流程。业务服务器判断当前会话结束时,发送会话结束结果到就近的代理服务器。代理服务器根据会话标识符转发会话结束结果到唯一对应的处理服务器。处理服务器收到会话结束结果,先根据会话标识符获取当前会话结束结果的分布式锁,定义该分布式锁为第一分布式锁。通过该第一分布式锁以禁止该会话业务的其他会话结束请求,保证同一个会话业务所有操作串行处理。进而清除对应客户端和会话的超时时间,更新会话状态。将结束会话状态定义为第二状态信息,以第二状态信息作为会话状态信息并更新至本地缓存。并且将结束会话状态记录到消息中间件,然后通知流媒体服务器和业务服务器会话结束,以使流媒体服务器和业务服务器执行会话结束时的相应的业务逻辑。
可选地,会话结束结果可以是业务服务器消费到用户掉线事件,自动结束会话。也可以是客户端用户操作主动终止会话。也可以是会话超时,处理服务 器主动结束会话,并且通过消息中间件通知业务服务器。本申请实施例对会话结束方式不做固定限制,在此不多赘述。
此外,可选地,针对流媒体服务器上报的创建流媒体连接的结果,本申请实施例采用独立的处理逻辑进行会话状态管理。其中,若服务处理结果是针对音频、视频的流媒体连接结果,处理服务器在管理会话状态时,会基于会话标识符获取对应流媒体连接结果的第二分布式锁,第二分布式锁配置为禁止对应会话业务再次发起流媒体连接请求;基于流媒体连接结果生成第三状态信息,以第三状态信息作为会话状态信息并更新至本地缓存;初始化流媒体连接超时时间,流媒体连接超时时间配置为检测客户端流媒体连接状态。
具体地,参照图6,提供c1-c6音视频连接时的会话状态管理流程。其中,连接媒体服务器在确定客户端连接成功时,流媒体服务器基于流媒体连接结果,通过代理服务器通知处理服务器对应客户端流媒体连接成功。处理服务器收到流媒体连接结果后,先根据会话标识符获取对应流媒体连接结果的分布式锁,定义该分布式锁为第二分布式锁。第二分布式锁配置为禁止对应会话业务再次发起流媒体连接请求,避免同一个客户端同时出现多个流媒体连接,以保证同一个会话业务所有操作串行处理。进而基于流媒体连接成功状态生成状态信息,定义其为第三状态信息,以第三状态信息作为会话状态信息并更新至本地缓存。
进一步根据设置对应客户端的流媒体超时时间连接超时时间。当处理服务器判断会话双方都连接成功时,会记录会话状态为流媒体会话正式开始,将会话状态记录到消息中间件。之后,业务服务器通过主动消费消息中间件的事件,获得会话双方成功连接的消息,并且处理相应的业务逻辑。
处理服务器针对不同的服务处理结果获取相应的会话状态,并更新至本地缓存,以此实现本申请实施例的会话状态管理流程。
上述,通过接收代理服务器转发的对应会话业务的服务处理结果,基于服务处理结果确定会话业务的会话状态信息。进而将会话状态信息更新至本地缓存,以通过本地缓存同步会话状态信息至关联大区机房的缓存中。其中,代理服务器基于服务处理结果包含的会话标识符转发该服务处理结果,该会话标识符包括服务处理结果与对应处理服务器的映射信息。采用上述技术手段,通过会话标识符转发服务处理结果供对应的处理服务器处理并记录会话状态,并通过本地缓存同步会话状态,以此可以使会话双方的会话状态管理保持较高的一致性,提升会话状态存储的时效性。同时也避免了会话数据分散管理,优化会 话状态管理效果。
在上述实施例的基础上,图7为本申请提供的一种会话状态管理装置的结构示意图。参考图7,本实施例提供的会话状态管理装置具体包括:接收模块21和更新模块22。
其中,接收模块21配置为接收代理服务器转发的对应会话业务的服务处理结果,代理服务器基于服务处理结果包含的会话标识符转发服务处理结果,会话标识符包括服务处理结果与对应处理服务器的映射信息;
更新模块22配置为基于服务处理结果确定会话业务的会话状态信息,将会话状态信息更新至本地缓存,以通过本地缓存同步会话状态信息至关联大区机房的缓存中。
具体地,更新模块22还将会话状态信息更新至预构建的消息中间件,消息中间件配置为供业务服务器查询会话状态信息,业务服务器配置为处理会话业务并生成服务处理结果,将服务处理结果上报至代理服务器。
具体地,服务处理结果为会话创建结果;更新模块22配置为基于会话创建结果执行会话业务的初始化操作,生成第一状态信息,以第一状态信息作为会话状态信息并更新至本地缓存。其中,基于会话创建结果初始化会话业务的会话超时时间,将会话超时时间存储至本地缓存,会话超时时间配置为检测客户端会话连接状态。之后,在会话超时时间内接收到代理服务器转发的客户端心跳请求的情况下,基于当前时间更新会话超时时间;在会话超时时间内未接收到代理服务器转发的客户端心跳请求的情况下,确定会话业务对应的客户端处于掉线状态,基于掉线状态更新本地缓存的会话状态信息,并删除会话超时时间。
具体地,服务处理结果为会话结束结果;更新模块22配置为基于会话标识符获取对应会话结束结果的第一分布式锁,第一分布式锁配置为禁止对应会话业务再次发起会话结束请求;基于会话结束结果生成第二状态信息,以第二状态信息作为会话状态信息并更新至本地缓存;删除会话超时时间。
具体地,服务处理结果为流媒体连接结果;更新模块22配置为基于会话标识符获取对应流媒体连接结果的第二分布式锁,第二分布式锁配置为禁止对应会话业务再次发起流媒体连接请求;基于流媒体连接结果生成第三状态信息,以第三状态信息作为会话状态信息并更新至本地缓存;初始化流媒体连接超时 时间,流媒体连接超时时间配置为检测客户端流媒体连接状态。
上述,通过接收代理服务器转发的对应会话业务的服务处理结果,基于服务处理结果确定会话业务的会话状态信息。进而将会话状态信息更新至本地缓存,以通过本地缓存同步会话状态信息至关联大区机房的缓存中。其中,代理服务器基于服务处理结果包含的会话标识符转发该服务处理结果,该会话标识符包括服务处理结果与对应处理服务器的映射信息。采用上述技术手段,通过会话标识符转发服务处理结果供对应的处理服务器处理并记录会话状态,并通过本地缓存同步会话状态,以此可以使会话双方的会话状态管理保持较高的一致性,提升会话状态存储的时效性。同时也避免了会话数据分散管理,优化会话状态管理效果。
本申请实施例提供的会话状态管理装置可以配置为执行上述实施例提供的会话状态管理方法,具备相应的功能和有益效果。
在上述实际上例的基础上,本申请实施例还提供了一种会话状态管理设备,参照图8,该会话状态管理设备包括:处理器31、存储器32、通信模块33、输入装置34及输出装置35。存储器32作为一种计算机可读存储介质,可配置为存储软件程序、计算机可执行程序以及模块,如本申请任意实施例所述的会话状态管理方法对应的程序指令/模块(例如,会话状态管理装置中的接收模块21和更新模块)。通信模块33配置为进行数据传输。处理器31通过运行存储在存储器中的软件程序、指令以及模块,从而执行设备的各种功能应用以及数据处理,即实现上述的会话状态管理方法。输入装置34可配置为接收输入的数字或字符信息,以及产生与设备的用户设置以及功能控制有关的键信号输入。输出装置35可包括显示屏等显示设备。上述提供的会话状态管理设备可配置为执行上述实施例提供的会话状态管理方法,具备相应的功能和有益效果。
在上述实施例的基础上,本申请实施例还提供一种包含计算机可执行指令的存储介质,所述计算机可执行指令在由计算机处理器执行时配置为执行一种会话状态管理方法,存储介质可以是任何的各种类型的存储器设备或存储设备。当然,本申请实施例所提供的一种包含计算机可执行指令的存储介质,其计算机可执行指令不限于如上所述的会话状态管理方法,还可以执行本申请任意实施例所提供的会话状态管理方法中的相关操作。

Claims (13)

  1. 一种会话状态管理方法,其特征在于,包括:
    接收代理服务器转发的对应会话业务的服务处理结果,所述代理服务器基于所述服务处理结果包含的会话标识符转发所述服务处理结果,所述会话标识符包括所述服务处理结果与对应处理服务器的映射信息;
    基于所述服务处理结果确定所述会话业务的会话状态信息,将所述会话状态信息更新至本地缓存,以通过本地缓存同步所述会话状态信息至关联大区机房的缓存中。
  2. 根据权利要求1所述的会话状态管理方法,其特征在于,在基于所述服务处理结果确定所述会话业务的会话状态信息之后,还包括:
    将所述会话状态信息更新至预构建的消息中间件,所述消息中间件配置为供业务服务器查询所述会话状态信息,所述业务服务器配置为处理所述会话业务并生成所述服务处理结果,将所述服务处理结果上报至所述代理服务器。
  3. 根据权利要求1所述的会话状态管理方法,其特征在于,所述服务处理结果为会话创建结果;
    所述基于所述服务处理结果确定所述会话业务的会话状态信息,将所述会话状态信息更新至本地缓存,包括:
    基于所述会话创建结果执行所述会话业务的初始化操作,生成第一状态信息,以所述第一状态信息作为所述会话状态信息并更新至本地缓存。
  4. 根据权利要求3所述的会话状态管理方法,其特征在于,所述基于所述会话创建结果执行所述会话业务的初始化操作,还包括:
    基于所述会话创建结果初始化所述会话业务的会话超时时间,将所述会话超时时间存储至本地缓存,所述会话超时时间配置为检测客户端会话连接状态。
  5. 根据权利要求4所述的会话状态管理方法,其特征在于,在基于所述会话创建结果执行所述会话业务的初始化操作之后,还包括:
    在所述会话超时时间内接收到所述代理服务器转发的客户端心跳请求的情况下,基于当前时间更新所述会话超时时间;
    在所述会话超时时间内未接收到所述代理服务器转发的客户端心跳请求的情况下,确定所述会话业务对应的客户端处于掉线状态,基于所述掉线状态更新本地缓存的所述会话状态信息,并删除所述会话超时时间。
  6. 根据权利要求4所述的会话状态管理方法,其特征在于,所述服务处理结果为会话结束结果;
    所述基于所述服务处理结果确定所述会话业务的会话状态信息,将所述会话状态信息更新至本地缓存,包括:
    基于所述会话结束结果生成第二状态信息,以所述第二状态信息作为所述会话状态信息并更新至本地缓存。
  7. 根据权利要求6所述的会话状态管理方法,其特征在于,在以所述第二状态信息作为所述会话状态信息并更新至本地缓存之前,还包括:
    基于所述会话标识符获取对应所述会话结束结果的第一分布式锁,所述第一分布式锁配置为禁止对应所述会话业务再次发起会话结束请求;
    在以所述第二状态信息作为所述会话状态信息并更新至本地缓存之后,还包括:
    删除所述会话超时时间。
  8. 根据权利要求1所述的会话状态管理方法,其特征在于,所述服务处理结果为流媒体连接结果;
    所述基于所述服务处理结果确定所述会话业务的会话状态信息,将所述会话状态信息更新至本地缓存,包括:
    基于所述流媒体连接结果生成第三状态信息,以所述第三状态信息作为所述会话状态信息并更新至本地缓存。
  9. 根据权利要求8所述的会话状态管理方法,其特征在于,在以所述第三状态信息作为所述会话状态信息并更新至本地缓存之前,还包括:
    基于所述会话标识符获取对应所述流媒体连接结果的第二分布式锁,所述第二分布式锁配置为禁止对应所述会话业务再次发起流媒体连接请求;
    在以所述流媒体连接状态信息作为所述会话状态信息之后,还包括:
    初始化流媒体连接超时时间,所述流媒体连接超时时间配置为检测客户端流媒体连接状态。
  10. 一种会话状态管理***,其特征在于,包括:业务服务器、代理服务器、处理服务器和本地缓存;
    所述业务服务器配置为处理第一客户端向第二客户端的会话业务,生成对应的服务处理结果,将所述服务处理结果上报至所述代理服务器;
    所述代理服务器配置为基于所述服务处理结果包含的会话标识符转发所述服务处理结果至对应的所述处理服务器,所述会话标识符包括所述服务处理结果与对应的所述处理服务器的映射信息;
    所述处理服务器配置为接收代理服务器转发的对应会话业务的服务处理结果,基于所述服务处理结果确定所述会话业务的会话状态信息,将所述会话状态信息更新至所述本地缓存;
    所述本地缓存配置为存储并同步所述会话状态信息至关联大区机房的缓存中。
  11. 一种会话状态管理装置,其特征在于,包括:
    接收模块,配置为接收代理服务器转发的对应会话业务的服务处理结果,所述代理服务器基于所述服务处理结果包含的会话标识符转发所述服务处理结果,所述会话标识符包括所述服务处理结果与对应处理服务器的映射信息;
    更新模块,配置为基于所述服务处理结果确定所述会话业务的会话状态信息,将所述会话状态信息更新至本地缓存,以通过本地缓存同步所述会话状态信息至关联大区机房的缓存中。
  12. 一种会话状态管理设备,其特征在于,包括:
    存储器以及一个或多个处理器;
    所述存储器,配置为存储一个或多个程序;
    当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现如权利要求1-9任一所述的会话状态管理方法。
  13. 一种包含计算机可执行指令的存储介质,其特征在于,所述计算机可执行指令在由计算机处理器执行时配置为执行如权利要求1-9任一所述的会话状态管理方法。
PCT/CN2023/078217 2022-03-01 2023-02-24 一种会话状态管理方法、***、装置、设备及存储介质 WO2023165429A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210195846.X 2022-03-01
CN202210195846.XA CN114584602B (zh) 2022-03-01 2022-03-01 一种会话状态管理方法、***、装置、设备及存储介质

Publications (1)

Publication Number Publication Date
WO2023165429A1 true WO2023165429A1 (zh) 2023-09-07

Family

ID=81776117

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/078217 WO2023165429A1 (zh) 2022-03-01 2023-02-24 一种会话状态管理方法、***、装置、设备及存储介质

Country Status (2)

Country Link
CN (1) CN114584602B (zh)
WO (1) WO2023165429A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114584602B (zh) * 2022-03-01 2023-08-29 百果园技术(新加坡)有限公司 一种会话状态管理方法、***、装置、设备及存储介质
CN115412603B (zh) * 2022-11-02 2022-12-27 中国电子科技集团公司第十五研究所 一种消息中间件的消息客户端模块的高可用的方法及装置

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070033284A1 (en) * 2005-08-02 2007-02-08 Kwang Nam Gung System server for data processing with multiple clients and a data processing method
JP2007316837A (ja) * 2006-05-24 2007-12-06 Fujitsu Ltd サーバシステム
CN102664909A (zh) * 2011-01-28 2012-09-12 微软公司 通过用户标识符重新建立推送通知信道
CN104380278A (zh) * 2012-06-29 2015-02-25 英特尔公司 用于一个或多个客户端和数据中心的服务器之间的客户端管理会话持续性的设备、***和方法
US9171019B1 (en) * 2013-02-19 2015-10-27 Amazon Technologies, Inc. Distributed lock service with external lock information database
CN106921721A (zh) * 2015-12-28 2017-07-04 华为软件技术有限公司 一种服务器、会话管理方法和***
CN107517227A (zh) * 2016-06-15 2017-12-26 阿里巴巴集团控股有限公司 用于分布式一致性***的会话实现方法以及装置
CN110769019A (zh) * 2018-07-27 2020-02-07 阿里巴巴集团控股有限公司 会话处理方法、装置和***
CN110839084A (zh) * 2019-11-19 2020-02-25 中国建设银行股份有限公司 会话管理方法、装置、设备和介质
CN113645261A (zh) * 2020-04-27 2021-11-12 ***通信集团江西有限公司 一种会话数据处理方法、装置、存储介质和计算机设备
CN114584602A (zh) * 2022-03-01 2022-06-03 百果园技术(新加坡)有限公司 一种会话状态管理方法、***、装置、设备及存储介质

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4309629B2 (ja) * 2002-09-13 2009-08-05 株式会社日立製作所 ネットワークシステム
US8095658B2 (en) * 2004-05-07 2012-01-10 International Business Machines Corporation Method and system for externalizing session management using a reverse proxy server
CN100536600C (zh) * 2006-03-14 2009-09-02 中兴通讯股份有限公司 一种将定位业务中定位引擎接入业务管理平台的方法
US10637929B1 (en) * 2013-09-23 2020-04-28 Ribbon Communications Operating Company, Inc. Methods and apparatus for storing and/or retrieving session state information
CN105338095A (zh) * 2015-11-17 2016-02-17 中国建设银行股份有限公司 一种会话数据处理方法和装置
CN107733995A (zh) * 2017-09-21 2018-02-23 北京信安世纪科技股份有限公司 一种会话保持方法、装置和电子设备
CN112751748B (zh) * 2020-12-28 2023-04-18 百果园技术(新加坡)有限公司 会话消息管理方法、装置、服务器和可读存储介质

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070033284A1 (en) * 2005-08-02 2007-02-08 Kwang Nam Gung System server for data processing with multiple clients and a data processing method
JP2007316837A (ja) * 2006-05-24 2007-12-06 Fujitsu Ltd サーバシステム
CN102664909A (zh) * 2011-01-28 2012-09-12 微软公司 通过用户标识符重新建立推送通知信道
CN104380278A (zh) * 2012-06-29 2015-02-25 英特尔公司 用于一个或多个客户端和数据中心的服务器之间的客户端管理会话持续性的设备、***和方法
US9171019B1 (en) * 2013-02-19 2015-10-27 Amazon Technologies, Inc. Distributed lock service with external lock information database
CN106921721A (zh) * 2015-12-28 2017-07-04 华为软件技术有限公司 一种服务器、会话管理方法和***
CN107517227A (zh) * 2016-06-15 2017-12-26 阿里巴巴集团控股有限公司 用于分布式一致性***的会话实现方法以及装置
CN110769019A (zh) * 2018-07-27 2020-02-07 阿里巴巴集团控股有限公司 会话处理方法、装置和***
CN110839084A (zh) * 2019-11-19 2020-02-25 中国建设银行股份有限公司 会话管理方法、装置、设备和介质
CN113645261A (zh) * 2020-04-27 2021-11-12 ***通信集团江西有限公司 一种会话数据处理方法、装置、存储介质和计算机设备
CN114584602A (zh) * 2022-03-01 2022-06-03 百果园技术(新加坡)有限公司 一种会话状态管理方法、***、装置、设备及存储介质

Also Published As

Publication number Publication date
CN114584602A (zh) 2022-06-03
CN114584602B (zh) 2023-08-29

Similar Documents

Publication Publication Date Title
WO2023165429A1 (zh) 一种会话状态管理方法、***、装置、设备及存储介质
US11172023B2 (en) Data synchronization method and system
US8112525B2 (en) Engine near cache for reducing latency in a telecommunications environment
US8219697B2 (en) Diameter protocol and SH interface support for SIP server architecture
US8001250B2 (en) SIP and HTTP convergence in network computing environments
US7661027B2 (en) SIP server architecture fault tolerance and failover
RU2517382C2 (ru) Способ и система для синхронизации данных в сети доставки контента
US9723048B2 (en) System and method for providing timer affinity through notifications within a session-based server deployment
KR20120089591A (ko) 네트워크 환경에서 비-지속성 메시지의 다중 큐를 관리하기 위한 시스템 및 방법
CN107528891B (zh) 一种基于WebSocket的自动集群方法及其***
WO2021051966A1 (zh) 一种信息推送方法及***
US20090006598A1 (en) System and Method for Efficient Storage of Long-Lived Session State in a SIP Server
WO2023046088A1 (zh) 一种应用于音视频数据传输的端到端***解决方法
WO2023093641A1 (zh) 用户关系链存储方法、装置、***、电子设备及存储介质
CN111880929B (zh) 一种实例管理方法及装置、计算机设备
CN109327335A (zh) 一种云监控解决***及方法
CN109189748A (zh) 一种缓存一致性处理方法及nfs服务器
CN110417876A (zh) 会话方法、分布式***中的节点服务器及主控设备
CN106357744A (zh) Smb客户端重连集群的方法、***及smb客户端
US10255339B2 (en) Data change controller
JP5276567B2 (ja) サービス提供システム、分散処理管理装置、ファイル更新方法およびプログラム
CN112910796B (zh) 流量管理方法、装置、设备、存储介质以及程序产品
WO2019161721A1 (zh) 一种基于互通rcs***的对应关系处理方法及装置
CN111565209B (zh) 客户端即时通信方法、装置、设备及介质
WO2016150334A1 (zh) 一种语音信箱服务器及语音信箱***的实现方法

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23762829

Country of ref document: EP

Kind code of ref document: A1