Method, apparatus, device and storage medium for session reestablishment

By reconstructing the session connection by searching the cache and utilizing the target domain name information, the problem of random session allocation after user reconnection is solved, ensuring session continuity and user experience.

CN115714758BActive Publication Date: 2025-12-23CHINA CONSTRUCTION BANK +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211400683.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-09
Publication Date
2025-12-23
Estimated Expiration
2042-11-09

AI Technical Summary

Technical Problem

In scenarios where backend services are deployed in multiple centers and clusters, when a user closes and reopens a webpage, the session may be randomly assigned to a new customer service representative, resulting in a discontinuous session experience and affecting the user experience.

Method used

Upon receiving a session request, the system searches the target cache for stored information based on the current session identifier, determines the target domain name information, and re-establishes the communication connection with the target service node, ensuring a reconnection to the same central and service node as the previous session.

Benefits of technology

It enables accurate reconnection to the backend machine of the previous session when the connection is lost and reconnected, ensuring the integrity of the session experience and improving the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115714758B_ABST
    Figure CN115714758B_ABST
Patent Text Reader

Abstract

The application provides a method, device, equipment and storage medium for session reestablishment. It relates to the technical field of artificial intelligence intelligent service. The method comprises the following steps: when a session request for re-entering a session is received, it is determined whether the target cache includes storage information corresponding to the current session identifier based on the current session identifier corresponding to a target user; if the target cache includes target storage information corresponding to the current session identifier, the target cluster corresponding to the current session identifier and the target service node belonging to the target cluster are determined based on the target domain name information in the target storage information; after communication with the target service node is established, a session window corresponding to the session request is reestablished, the previous backend machine where the session service is located is accurately reconnected, the previous unfinished session is continued, the integrity of the session experience is ensured, and the user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of artificial intelligence intelligent service, and particularly relates to a session re-establishment method and device, equipment and a storage medium. BACKGROUND

[0002] With the development of Internet technology, project architecture has experienced a series of architecture evolutions from MVC to PRC, SOA, and evolved into the current two-site three-center and multi-AP (Access Point) cluster load balancing deployment mode.

[0003] In the scenario of multi-center and multi-cluster deployment of backend services, when providing artificial customer service, the front-end webpage provides many-to-many artificial customer service, and after the customer closes and leaves the service page, if the webpage is opened again, a new request connection is often initiated, which may be randomly assigned to another artificial customer service, causing the artificial service to start a new process again, affecting the integrity of the customer session experience. SUMMARY

[0004] The present application provides a session re-establishment method, device, equipment and storage medium to accurately reconnect to the backend machine of the previous session service and continue the previous unfinished session, ensuring the integrity of the session experience and achieving the technical effect of improving user experience.

[0005] In a first aspect, the present application provides a session re-establishment method, comprising:

[0006] Upon receiving a session request for re-entering a session, it is determined whether the target cache includes storage information corresponding to the current session identifier of the target user based on the current session identifier; wherein the storage information includes a historical session identifier and corresponding domain name information;

[0007] If the target storage information corresponding to the current session identifier is included, the target cluster corresponding to the current session identifier and the target service node belonging to the target cluster are determined based on the target domain name information in the target storage information.

[0008] After establishing communication with the target service node, a session window corresponding to the session request is re-established.

[0009] In a second aspect, the present application provides a session re-establishment device, comprising:

[0010] The storage information determination module is configured to, when receiving a session request for re-entering a session, determine whether the target cache includes storage information corresponding to a current session identifier of a target user based on the current session identifier; wherein the storage information includes a historical session identifier and corresponding domain name information;

[0011] The service node determination module is configured to, if the target storage information corresponding to the current session identifier is included, determine a target cluster corresponding to the current session identifier and a target service node belonging to the target cluster based on target domain name information in the target storage information.

[0012] The session window reconstruction module is configured to, after establishing communication with the target service node, reconstruct a session window corresponding to the session request.

[0013] In a third aspect, an electronic device is provided, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor executes the program to implement the method for re-establishing a session according to any of the embodiments of the present application.

[0014] In a fourth aspect, a computer readable storage medium is provided, which stores a computer program executable by a processor to implement the method for re-establishing a session according to any of the embodiments of the present application.

[0015] In a fifth aspect, a computer program product is provided, which includes a computer program executable by a processor to implement the method for re-establishing a session according to any of the embodiments of the present application.

[0016] The application provides a session re-establishment method, device, equipment and storage medium. When a session request of re-entering a session is received, whether the target cache includes storage information corresponding to the current session identifier is determined based on the current session identifier corresponding to a target user. If the target storage information corresponding to the current session identifier is included, the target cluster corresponding to the current session identifier and the target service node belonging to the target cluster are determined based on the target domain name information in the target storage information. After communication with the target service node is established, a session window corresponding to the session request is re-established. The application solves the problem that in the prior art, when a user disconnects and reconnects a session service, the user is randomly allocated to a new session customer service, resulting in poor user experience. The application realizes that the central domain name information of a previous session is cached in a target cache before disconnection and reconnection. When the user disconnects and reconnects the session service, the domain name information stored in the target cache is called to realize reconnection to the center of the previous session, so that the center of the current session and the center of the previous session are the same center, and the target cluster and the corresponding target service node under the same center are determined and reconnected, the accuracy of the determination of the backend machine of the previous session service is improved, the user can continue the previous session, the integrity of the session experience is ensured, and the technical effect of improving the user experience is achieved. BRIEF DESCRIPTION OF DRAWINGS

[0017] The accompanying drawings, which are incorporated herein and form part of the specification, illustrate embodiments consistent with the present application and, together with the description, further serve to explain the principles of the application.

[0018] Figure 1 The flow of the session re-establishment method provided by the embodiment of the application Figure 1 ;

[0019] Figure 2 The flow of the session re-establishment method provided by the embodiment of the application Figure 2 ;

[0020] Figure 3 The flow of the session re-establishment method provided by the embodiment of the application Figure 3 ;

[0021] Figure 4 An example diagram of the session re-establishment method provided by the embodiment of the application is shown in the figure.

[0022] Figure 5 An example diagram of the session re-establishment method provided by the embodiment of the application is shown in the figure.

[0023] Figure 6 The structure diagram of the session re-establishment device provided by the embodiment of the application is shown in the figure.

[0024] Figure 7 A structural schematic diagram of an electronic device provided by an embodiment of the present application is shown.

[0025] The specific embodiments of the present application have been shown by the above-described drawings, and will be described in more detail hereinafter. These drawings and the written description are not intended to restrict the scope of the present application in any way, but to illustrate the concept of the present application by referring to specific embodiments. DETAILED DESCRIPTION

[0026] The exemplary embodiments will be described in detail herein with reference to the attached drawings. The same or similar components are denoted by the same or similar reference numerals throughout the drawings and the written description, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not meant to represent all implementations consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present application as detailed in the appended claims.

[0027] The technical solutions of the present application and how the technical solutions of the present application solve the above-mentioned technical problems will be described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes can not be described again in some embodiments. The embodiments of the present application will be described below with reference to the drawings. The acquisition, storage, use, processing, etc. of data in the technical solutions of the present application all comply with the relevant provisions of national laws and regulations.

[0028] Before introducing the technical solutions, the application scenarios can be exemplarily described. The technical solutions can be applied in a scenario based on two-site three-center multi-cluster deployment, for example, when a user uses a manual service implemented based on a web page in the front end, after closing the web page and re-entering the web page, the original manual customer service can be connected, and the technical effects of no user information, still achieving line disconnection and reconnection to the previous manual customer service, and ensuring uninterrupted service session can be achieved by using the technical solutions.

[0029] The two places refer to the same city and different places; the three centers refer to a production center, a same-city disaster recovery center and a different-place disaster recovery center. The same-city double center refers to establishing two data centers that can independently undertake the operation of a key system in the same city or a nearby city. The double center has basically the same business processing capability and synchronizes data in real time through a high-speed link, can simultaneously share the operation of a business and a management system, and can switch operation. The different-place disaster recovery center refers to establishing a backup disaster recovery center in a different city, which is used for data backup of the double center. The three data centers in the two cities are interconnected, and if one data center fails or suffers a disaster, the other data centers can normally operate and implement takeover of key business or all business. For example, when the double center fails, the different-place disaster recovery center can use backup data to recover the business.

[0030] The embodiment of the application provides a session reestablishment method. Figure 1 The embodiment of the application provides a session reestablishment method. Figure 1 As shown in the figure, the session reestablishment method comprises the following steps. Figure 1 As shown in the figure, the session reestablishment method comprises the following steps.

[0031] S101, receiving a session request for re-entering a session.

[0032] The session request refers to an instruction or code for requesting connection to a session service, and is used for requesting connection to a session service.

[0033] In this embodiment, when a user closes or leaves a web page and triggers a control for re-entering the web page, it is considered that a session request for re-entering a session is received.

[0034] Optionally, the session request for re-entering a session comprises at least one of the following: after a time length of disconnecting and / or exiting a session reaches a first preset time length threshold, triggering a control for re-entering a session again; after network interruption in a session process reaches a second preset time length threshold, re-establishing network communication.

[0035] The first preset time length threshold and the second preset time length threshold are both preset time length thresholds, which can be 0.1s or 0.3s, and can be determined by a technician in actual work. The triggering operation can be clicking, touching, sliding or dragging.

[0036] For example, when a user A uses an artificial service based on a web page in the front end, after disconnecting and / or exiting the web page, re-enters the web page, initiates a new request connection again, at this time, it can be considered that the server receives a session request for re-entering a session; or after network interruption in a session process reaches a second preset time length threshold, automatically triggers an operation for re-entering a session, and requests to establish network communication.

[0037] S102, judging whether the target cache includes storage information corresponding to the current session identifier based on the current session identifier corresponding to the target user, if yes, performing S103, if not, performing S104.

[0038] Wherein, the target user refers to the user who needs to enter the session. The session identifier can be used to represent the uniqueness of the session. For example, in actual application, when establishing a session for a user, a unique session identifier such as sessionID is allocated to the session. The target cache refers to the cache space, which can be a browser cache or a custom set cache. The storage information includes historical session identifiers and corresponding domain name information. The domain name information refers to the domain name information allocated to the session when the session is created, so as to access the webpage based on the domain name information.

[0039] It should be noted that in the two-site three-center mode, multiple application clusters are deployed on the same center, and the artificial customer service uses a machine on a certain cluster. When the user requests to re-enter the last session, it is necessary to address a certain center in the two-site three-center mode, to address the specific cluster and machine under the center, and to successfully connect to the machine and the customer service for the session.

[0040] In this embodiment, upon receiving the session request for re-entering the session, the session request can be parsed to obtain the session identifier carried in the session request as the current session identifier. Further, it can be judged whether the target cache stores the historical session identifier corresponding to the current session identifier and the corresponding domain name information, so as to access the webpage based on the stored domain name information when it exists.

[0041] S103, determining the target cluster corresponding to the current session identifier and the target service node belonging to the target cluster based on the target domain name information in the target storage information.

[0042] Wherein, the target cluster can include multiple servers (i.e. service nodes), each service node can correspond to a computer device and is independent of each other. In actual application, the service for the session with the user can be deployed on a certain computer device, and after the device used by the user communicates with the computer device service, the normal progress of the session can be ensured.

[0043] In actual application, it can be detected whether the target cache includes the storage information corresponding to the current session identifier, if yes, the storage information can be taken as the target storage information. Further, the domain name information in the target storage information can be extracted, which is the central domain name allocated to the user in the last session, and the domain name information can be taken as the target domain name information. After the target domain name is determined, the session request can be sent to the target domain name information, and addressed to the specific target cluster under the center and the machine belonging to the target cluster, i.e. the target service node. For example, when the central domain name allocated to the user in the last session is queried, it can be checked whether the local (i.e. the target cache) has the central domain name cache record (i.e. the target storage information), if yes, the session request can be directly sent to the cache domain name. After being addressed to the central domain name, the specific machine in the center can be addressed as the target service node.

[0044] In S104, the session association information of the current session is determined, and the domain name information in the session association information and the corresponding current session identifier are taken as the storage information and stored in the target cache.

[0045] It should be noted that if the user is first requested to enter the session, the server can allocate a domain name of a center to the session of the user in the two-site three-center mode, so as to enter the session based on the domain name of the center, and at the same time, the allocated central domain name can be stored in the target cache, so as to obtain the allocated central domain name from the target cache when re-entering the session after disconnection, so as to reconnect the user to the same center, and realize the disconnection reconnection.

[0046] Optionally, if it is detected that the current session is the first session or the current session is the non-first session and the target cache does not include the storage information, the session association information of the current session is determined, and the domain name information in the session association information and the corresponding current session identifier are taken as the storage information and stored in the target cache.

[0047] In the embodiment, if the user is a first time request to enter the session, at this time, a domain name of a certain center can be allocated for the session, and the identification of the request session and the allocated domain name of the center are taken as the session association information, and the session association information is taken as the storage information and stored in the target cache. If the user enters the session again, the target cache does not include the storage information corresponding to the current session identification, which can be that the storage information has been invalidated and automatically cleaned, at this time, a domain name of a center needs to be allocated for the session again, and the identification of the request session and the allocated domain name of the center are taken as the session association information and stored in the target cache, so that the center domain name information in the session association information is obtained from the target cache when the line is reconnected. For example, if the local does not exist the cache center domain name, a request is sent to the addressing service, the center domain name allocated by the server is requested back, and the center domain name and the current time are recorded into the target cache provided by the Web browser for next time check.

[0048] It should be noted that if it is detected that the current session is a first time session or the current session is a non-first time session and the target cache does not include the storage information, it means that the center domain name information is not found, and accordingly, the service node for the session has not been allocated. At this time, a domain name of a certain center can be allocated for the session, and based on the cluster information under the center and the server information under the cluster, a server in the cluster under the center can be allocated for the current session, for example, an idle server can be allocated to the current session, and the allocated cluster and server are saved in the cache corresponding to the center domain name, so that after the target domain name information is determined, the target cluster corresponding to the target domain name information and the target service node belonging to the target cluster can be determined from the cache.

[0049] In order to ensure the effectiveness of data processing, when a domain name of a center, a cluster under the center, and a service node under the cluster are allocated for the session, the current session association information can be allocated for the current session based on the data required to be processed by the current session and the traffic proportion of each center. Optionally, the session association information can include domain name information, target cluster, and corresponding target service node information. The implementation manner of determining the session association information of the current session can be: determining the target service center corresponding to the current session based on the session attribute of the current session and the load balancing information corresponding to each domain name service center; and determining the session association information of the current session based on the target service center.

[0050] The session attribute includes network traffic corresponding to the session processing information, and the network traffic can be used to represent the amount of data to be processed, such as the larger the network traffic, the greater the amount of data processing. The domain name service center can be a production center, a local disaster recovery center, and a remote disaster recovery center. The load balancing information includes network device information, server bandwidth information, throughput information, data processing capacity, network flexibility and availability, and the like. The session association information includes the target cluster corresponding to the current session and the corresponding target service node.

[0051] In the embodiment, when the corresponding session association information is allocated to the current session, the appropriate service center can be allocated to the current session as the target service center through the session attribute of the current session and the load balancing information corresponding to each domain name service center. For example, the service center domain name can be allocated to the user according to the current service state and the center traffic proportion target, so as to realize multi-center load balancing. Further, the specific cluster under the target service center and the specific machine under the cluster can be determined, such as randomly allocating the idle server to the current session, and the domain name of the target service center, the specific cluster and the specific machine under the cluster and the like can be taken as the session association information.

[0052] For example, when connecting to the session service for the first time, the connection request can be forwarded to the Apache Web server through the F5 load balancing, the Apache Web server forwards the connection request to a certain cluster and allocates it to a certain machine (i.e. service node) under the cluster, and successfully connects to the service based on the machine IP. The route node number (RouteId) can be generated according to the cluster information and the machine IP as the session association information, the server can push the session association information to the front end through the event, and the front end can cache the session association information and the current time in the browser cache (i.e. target cache) after receiving the session association information. Multi-center load balancing is realized, the balance of data processing is improved, and the efficiency and performance of data processing are improved.

[0053] S105, after establishing communication with the target service node, reestablishing the session window corresponding to the session request.

[0054] Specifically, after determining the target service node, the service connection can be established based on the IP of the user client and the machine IP of the target service node, and the session window corresponding to the session request can be reestablished when the service connection is successful.

[0055] For example, after determining the target cluster and the target service node, the session request can be forwarded to the corresponding cluster and the corresponding target service node, the service communication with the target service node is requested, and the session window corresponding to the session request is reestablished after the service connection is successful.

[0056] The embodiment determines whether the target cache includes storage information corresponding to the current session identifier based on the current session identifier corresponding to the target user when receiving a session request for re-entering the session, determines the target cluster corresponding to the current session identifier and the target service node belonging to the target cluster based on the target domain name information in the target storage information if the target storage information corresponding to the current session identifier is included, and re-establishes the session window corresponding to the session request by establishing communication with the target service node, thereby solving the problem of poor user experience effect caused by randomly allocating a new session customer service to the user when reconnecting the session service in the prior art, achieving the technical effect of improving the accuracy of the backend machine determination of the previous session service, and realizing the technical effect of accurately reconnecting to the backend machine where the previous session service is located when reconnecting the session service without user information, so that the user can continue the previous unfinished session, ensuring the integrity of the session experience, and improving the user experience.

[0057] On the basis of the above-mentioned embodiment, when determining the target cluster corresponding to the current session identifier and the target service node belonging to the target cluster based on the target domain name information in the target storage information, the target cluster and the target service node for the session can be determined by judging whether the node routing and the historical storage duration corresponding to the node routing satisfy the condition, and the application provides the following embodiments accordingly. Figure 2 The flow of the session re-establishing method provided by the embodiment of the application Figure 2 As shown in Figure 2 , the session re-establishing method comprises the following steps:

[0058] S201, judging whether to store node routing based on the target domain name information in the target storage information, if yes, performing S202, and if no, performing S203.

[0059] The node routing can include cluster information and service node IP.

[0060] In the embodiment, after finding the target domain name information, it can be checked whether the node routing under the target domain name information and the historical storage duration corresponding to the node routing are stored in the target cache. When the node routing is stored and the node routing is not invalid, the target cluster and the target service node in the node routing are obtained.

[0061] It should be noted that after the user is offline, the session will have a certain holding time to wait for the user, and the user can connect back to the machine where the customer service is located within this time to continue the session. If the time exceeds this time, the artificial customer service will leave, and even if the connection is reconnected, it may be queued to wait for the customer service. In order to improve the effect of the session service, whether the node routing is invalid can be determined based on the historical storage time length corresponding to the node routing. If it is invalid, it means that the session is timed out and the customer service is waiting for the user. If it is not invalid, the target cluster and the target service node can be determined based on the node routing to make interconnection with the target service node and reconnect to the last session customer service.

[0062] S202, determine whether the historical storage time length corresponding to the node routing does not reach the target storage time length threshold, if yes, execute S2021, if not, execute S2022.

[0063] The target storage time length threshold can correspond to the customer service session waiting time, which can be 10 minutes or 12 minutes, and is not limited.

[0064] In this embodiment, the historical storage time length corresponding to the node routing can be determined, and the historical storage time length is compared and analyzed with the target storage time length threshold to determine whether the historical storage time length does not reach the target storage time length threshold.

[0065] S2021, positioning to the target cluster and the target service node based on the node routing.

[0066] Specifically, when the node routing exists in the cache and the historical storage time length does not reach the target storage time length threshold, it can be considered that the session is not timed out and the node routing is available. The node routing can be analyzed to obtain the target cluster and the target service node contained in the node routing, and positioning to the target cluster and the target service node is realized to interconnect with the target service node.

[0067] For example, when the user leaves the webpage and reopens the webpage, it can be checked whether the routing node number (i.e. node routing) corresponding to the target domain name information exists, and whether the corresponding historical storage time length is within a certain range (i.e. target storage time length threshold). If the routing node number exists and the storage time length is within a certain range, the condition is met, and the routing node number can be sent to the server to request connection. The server parses the corresponding cluster and machine IP from the routing node number, and forwards the session request to the corresponding cluster and machine to realize interconnection.

[0068] S2022, allocating the target cluster and the corresponding target service node for the node routing, and generating the routing identifier corresponding to the node routing and caching to establish the session connection based on the target cluster, the target service node and the corresponding routing node identifier.

[0069] Specifically, if the node route exists in the cache, but the historical storage duration reaches the target storage duration threshold, it can be considered that the session is timed out, the customer service has left, the target cluster and the corresponding target service node can be re-assigned to the session, and the session is re-established by interconnecting the target service node. And generate a routing identifier corresponding to the node route based on the target cluster and the corresponding target service node. For example, the rule for generating the routing identifier can be: cluster + machine IP, and the dot in the IP is removed. The routing identifier can be saved in the cache, so that when the session is reconnected, the session connection is established based on the target cluster and the target service node in the routing identifier, and the session is reconnected.

[0070] S203, return to execute the step of assigning the target cluster and the corresponding target service node to the node route to establish the session connection.

[0071] Specifically, when it is detected that the node route is not included in the cache, it can be the first time that the user connects the session, and the node route has not been assigned, or it can be that the session is invalid, and the node route is cleared. At this time, the target cluster and the corresponding target service node can be re-assigned to the session, and the corresponding routing identifier cache is generated to establish the session connection based on the target cluster, the target service node and the corresponding routing node identifier.

[0072] The embodiment determines whether to store the node route and the historical storage duration corresponding to the node route based on the target domain name information in the target storage information, to determine the target cluster and the target service node according to the historical storage duration and whether the node route is included, to ensure the accuracy of the target cluster and the target service node determination, to improve the accuracy of the line disconnection and reconnection, and to request the allocation of the target cluster and the target service node when the target cluster and the target service node are invalid, to establish the session based on the allocated target cluster and target service node, to improve the timeliness of the session service connection, and to improve the user experience.

[0073] On the basis of the above embodiment, before determining the target cluster corresponding to the current session identifier and the target service node belonging to the target cluster based on the target domain name information in the target storage information, the generation time corresponding to the target domain name information can be saved in the target cache, so that the generation time is used to judge whether the domain name is invalid in the subsequent process, to improve the accuracy of the line disconnection and reconnection of the same center, and correspondingly, the present application provides the following embodiments:

[0074] Figure 3 The flow of the session re-establishing method provided by the embodiment of the present application Figure 3 As shown in Figure 4 , the session re-establishing method comprises the following steps:

[0075] S301, determine a stored duration of the target storage information according to a storage timestamp corresponding to the target domain name information and a current timestamp.

[0076] The storage timestamp can be understood as a storage moment, and the current timestamp can be understood as a current moment.

[0077] It should be noted that when the session association information of the current session is determined based on the target service center, the session association information and the corresponding storage timestamp can be saved in the cache, so that when it is detected whether the target domain name information is within the valid duration, the storage timestamp is used for determination.

[0078] In this embodiment, the target domain name information can be obtained from the target cache, the storage timestamp corresponding to the target domain name information is determined, and the current timestamp is subtracted from the storage timestamp. The stored duration of the target storage information can be obtained, so as to determine whether the target domain name information is within the valid period based on the stored duration.

[0079] S302, determine whether the stored duration is less than a preset storage duration threshold, if yes, execute S303, if not, execute S304.

[0080] S303, execute the operation of determining the target cluster and the target service node.

[0081] The preset storage duration threshold can be determined by the technician according to the actual working condition, and the technical solution is not limited.

[0082] Specifically, the stored duration can be compared and analyzed with the preset storage duration threshold. If the stored duration is less than the preset storage duration threshold, it can be indicated that the target domain name information is valid, the request can be forwarded to the target domain name information, and it is determined from the cache whether there is a target cluster and a target service node corresponding to the target domain name information. If there is, the communication with the target service node is established, and the session window corresponding to the session request is re-established. If not, the target cluster and the target service node corresponding to the session are allocated.

[0083] S304, determine that the target storage information has been invalidated, and execute the step of determining the current session association information if it is detected that the current session is a non-first session and the target cache does not include the storage information.

[0084] In this embodiment, if the stored duration reaches the preset storage duration threshold, it indicates that the target storage information has been invalidated. At this time, the addressing service can allocate the session association information for the current session, that is, execute the step of determining the current session association information if it is detected that the current session is a non-first session and the target cache does not include the storage information.

[0085] Exemplarily, upon receiving a session request for re-entering a session, it is first checked whether there is a cached central domain name record (i.e. target storage information) locally, if there is a cached record, the time of the record is checked, if the cached record time is within a certain range (e.g. 15 minutes), the session request is directly sent to the cached domain name; if there is no cached central domain name locally or the cached central domain name has existed for more than a preset storage time threshold, a request is sent to the addressing service to request a central domain name assigned by the server, and the requested central domain name and the current time are recorded in the target cache provided by the web browser for next time checking, so as to improve the accuracy of reconnection to the same center after disconnection and improve the timeliness of session service connection.

[0086] In the embodiment, the stored time length of the target storage information is determined according to the storage timestamp corresponding to the target domain name information and the current timestamp; if the stored time length is less than the preset storage time threshold, the operation of determining the target cluster and the target service node is performed, so as to ensure the validity of the target domain name information, improve the accuracy of reconnection after disconnection, and request the service to assign domain name information when the target domain name information is invalid, so as to reconnect to the central center based on the assigned domain name information, improve the timeliness of reconnection, and improve the user experience.

[0087] On the basis of the above-mentioned embodiments, in order to make the skilled in the art further clear the technical solutions of the embodiments of the present application, the method for re-establishing a session will be described in detail through specific examples as follows:

[0088] In actual application, in the two-site three-center mode, the total distribution domain name can be used as a session entrance, a specific sub-center domain name is assigned to a customer, and the sub-center domain name is used for session connection service, so that the user can reconnect to the last connected center when reconnecting to the session, or can be connected to the center assigned by the back end. Exemplarily, see Figure 4 , Figure 5The example diagram of the method of session re-establishment provided by the embodiments of the present application can connect to the service center when the user enters the session again. The specific implementation manner can be that when the user enters the webpage, the user sends a request to the front-end total addressing service domain name. When the front-end addressing service is requested, it is first checked whether there is a sub-center domain name cache record in the local target cache. If there is a cache record, the time of recording the sub-center domain name cache is checked, and it is judged whether the sub-center domain name cache is within a preset storage time threshold (such as 15 minutes). If yes, the request transaction is directly sent to the cache domain name, the connection service to the center cache domain name is initiated, and the sub-center is connected. If there is no cache sub-center domain name in the local, or the cache domain name has been more than the preset storage time threshold, a request is sent to the front-end addressing service to request the center domain name allocated by the server, and the center domain name and the current storage time stamp are recorded in the target cache provided by the web browser for next reconnection check. When the center domain name allocated by the server, different center domain names can be allocated for the user according to the current service state and the proportion of the flow of each center, so as to realize the multi-center load balancing.

[0089] The present scheme can also point the total addressing service domain name to different IP through DNS (Domain Name System, domain name system), so as to realize the switching of the centers deployed by the front-end total addressing service. When there is no user information, the front-end addressing service and the web browser sub-center domain name cache are used to realize the load balancing on the two-site three-center addressing, and the continuity of the center addressing in a short time, and to improve the timeliness and accuracy of the disconnection reconnection of the user in the process of using the artificial service.

[0090] On the basis of the above scheme, after connecting to the service center, the target cluster can be determined, and the target service node belonging to the target cluster is determined, and the communication with the target service node is established, and the service is successfully connected. For example, see Figure 5 , Figure 6An example diagram of the session re-establishment method provided by the embodiments of the present application can initiate a connection to a sub-center based on the center domain name information, at which time it is necessary to internally address a specific machine in the center, and the specific implementation manner can be: it can be checked in the cache whether there is a routing node number (i.e., a routing identifier) corresponding to the sub-center, and it is determined whether the routing node number corresponds to a timestamp within a target storage time threshold (such as 10 minutes), if yes, the condition is met, and when requesting a connection, the routing node number is uploaded to the server. The server parses the corresponding cluster and machine IP from the routing node number, and forwards the session request to the corresponding cluster (i.e., the target cluster) and the corresponding machine (i.e., the target service node) according to the parsed information. According to the routing node number, the specified target service node is connected, and the service connection is successful. It should be noted that when connecting to the session service for the first time, the connection request can be forwarded to the Apache Web server through the F5 load balancing, the Apache Web server forwards the connection request to a certain cluster, and allocates it to a certain machine (i.e., a service node) under the cluster, and successfully connects to the service based on the machine IP. The routing node number (RouteId) can be generated according to the cluster information and the machine IP as the session association information, and the server can push the session association information to the front end through an event. After the front end receives the session association information, the session association information and the current time are cached in the browser cache (i.e., the target cache). The return of the routing node number and the front-end regular refreshing of the routing node number timestamp can be used to point to a specific machine number when connecting to the service. By recording the time when the user leaves the service, the artificial customer service that reconnects to the last session can be realized within a certain time after leaving the service, otherwise, the artificial service is re-allocated. Generally speaking, the artificial customer service has a certain maintenance time after the user logs off, and the user can connect to the machine where the customer service is located within this time to continue the session.

[0091] It should be noted that in the customer service session scenario, the customer can be in a tourist state and has not performed a login operation in the front-end application, and therefore the front-end page does not hold specific customer information and cannot perform specific allocation through customer information. Based on the present technical solution, the artificial customer service disconnection reconnection of the Web page in the two-site three-center and multi-cluster deployment mode can be realized by addressing the reconnection to the nearest connected center, the cluster under the center, and the specific machine in the cluster through the browser cache, to realize the connection to the last service customer service.

[0092] The embodiment determines whether the target cache includes the storage information corresponding to the current session identifier based on the current session identifier corresponding to the target user when receiving the session request for re-entering the session, and determines the target cluster corresponding to the current session identifier and the target service node belonging to the target cluster based on the target domain name information in the target storage information if the target storage information corresponding to the current session identifier is included. After communication with the target service node is established, the session window corresponding to the session request is reconstructed, which solves the problem in the prior art that the user is randomly allocated to a new session customer service when reconnecting the session service, resulting in a poor user experience effect. The central domain name information of the previous session is cached in the target cache before the line is disconnected and reconnected, the domain name information stored in the target cache is called when the line is disconnected and reconnected, the center of the previous session is reconnected, the center of the current session is the same as the center of the previous session, and then the target cluster and the corresponding target service node under the same center are determined and reconnected, the accuracy of the backend machine of the previous session service is improved, the user can continue the previous session, the integrity of the session experience is ensured, and the technical effect of improving the user experience is achieved.

[0093] Figure 6 The structure of the session re-establishment device provided by the embodiment of the application is shown in the figure. Figure 7 As shown in the figure, the session re-establishment device comprises a storage information determination module 601, a service node determination module 602 and a session window reconstruction module 603.

[0094] The storage information determination module 601 is configured to determine whether the target cache includes the storage information corresponding to the current session identifier based on the current session identifier corresponding to the target user when receiving the session request for re-entering the session. The storage information includes the historical session identifier and the corresponding domain name information. The service node determination module 602 is configured to determine the target cluster corresponding to the current session identifier and the target service node belonging to the target cluster based on the target domain name information in the target storage information if the target storage information corresponding to the current session identifier is included. The session window reconstruction module 603 is configured to reconstruct the session window corresponding to the session request by establishing communication with the target service node.

[0095] The embodiment determines whether the target cache includes the storage information corresponding to the current session identifier based on the current session identifier corresponding to the target user when receiving the session request for re-entering the session; if the target storage information corresponding to the current session identifier is included, the target cluster corresponding to the current session identifier and the target service node belonging to the target cluster are determined based on the target domain name information in the target storage information; and after the communication with the target service node is established, the session window corresponding to the session request is reconstructed, thereby solving the problem that in the prior art, when a user reconnects the session service, the user is randomly allocated to a new session customer service, resulting in a poor use experience effect, and achieving the following technical effects: the central domain name information of the previous session is cached in the target cache before the line is disconnected and reconnected; the domain name information stored in the target cache is called when the line is disconnected and reconnected, the center of the previous session is reconnected, the center of the current session is the same as the center of the previous session, the target cluster and the corresponding target service node under the same center are determined and reconnected, the accuracy of the determination of the backend machine of the previous session service is improved, the user can continue the previous session that is not completed, the integrity of the session experience is ensured, and the technical effect of improving the user experience is achieved.

[0096] In some embodiments, optionally, the session request for re-entering the session includes at least one of the following:

[0097] The control for re-entering the session is triggered again after the duration of disconnection and / or exit from the session reaches the first preset duration threshold.

[0098] The network communication is re-established after the network interruption in the session process reaches the second preset duration threshold.

[0099] In some embodiments, optionally, the apparatus further includes a session detection module, which is configured to determine the session association information of the current session and store the domain name information in the session association information and the corresponding current session identifier as storage information in the target cache if it is detected that the current session is the first session or the current session is not the first session and the target cache does not include the storage information.

[0100] In some embodiments, optionally, the session detection module includes a target service center determination unit and a session association information determination unit.

[0101] The target service center determination unit is configured to determine the target service center corresponding to the current session based on the session attribute of the current session and the load balancing information corresponding to each domain name service center; wherein the session attribute includes the network traffic corresponding to the session processing information.

[0102] a session association information determination unit, configured to determine session association information of the current session based on the target service center;

[0103] The session association information comprises a target cluster corresponding to the current session and a corresponding target service node.

[0104] In some embodiments, the apparatus optionally further comprises a timestamp comparison module, which comprises a stored duration determination unit and a re-execution unit.

[0105] The stored duration determination unit is configured to determine a stored duration of the target storage information according to a storage timestamp corresponding to the target domain name information and a current timestamp.

[0106] The re-execution unit is configured to perform an operation of determining a target cluster and a target service node if the stored duration is less than a preset storage duration threshold.

[0107] In some embodiments, the timestamp comparison module is further configured to determine that the target storage information has expired and perform the step of determining the current session association information if it is detected that the current session is a non-first session and the target cache does not comprise the storage information, if the stored duration reaches the preset storage duration threshold.

[0108] In some embodiments, the service node determination module 602 is further configured to determine whether a node route is stored and a historical storage duration corresponding to the node route based on target domain name information in the target storage information, to determine the target cluster and the target service node according to the historical storage duration and whether the node route is included.

[0109] In some embodiments, the service node determination module 602 is further configured to locate the target cluster and the target service node based on the node route if the node route is included and the historical storage duration does not reach a target storage duration threshold.

[0110] In some embodiments, the service node determination module 602 is further configured to assign a target cluster and a corresponding target service node to the node route and generate a routing identifier corresponding to the node route and cache it if the node route is included and the historical storage duration reaches a target storage duration threshold, to establish a session connection based on the target cluster, the target service node and the corresponding routing identifier.

[0111] In some embodiments, the service node determining module 602 is further configured to, if the node route is not included, return to perform the step of assigning a target cluster and a corresponding target service node for the node route to establish a session connection.

[0112] The device for session reestablishment provided by the embodiments of the present application can be used to execute the technical solutions of the method for session reestablishment in the above embodiments, and has similar implementation principles and technical effects, which will not be described here again.

[0113] It should be noted that the division of each module of the above device is only a logical division of functions, and all or part of the modules can be integrated into one physical entity, or can be physically separated. The modules can all be implemented in the form of software called by a processing element; all can be implemented in the form of hardware; or some modules can be implemented in the form of software called by a processing element, and some modules can be implemented in the form of hardware. For example, the storage information determining module 601 can be a separately established processing element, or can be integrated into a chip of the above device, and in addition, the storage information determining module 601 can be stored in the form of program code in the memory of the above device, and the functions of the above storage information determining module 601 can be called and executed by a processing element of the above device. The implementation of other modules is similar. In addition, all or part of the modules can be integrated together, or can be independently implemented. The processing element herein can be an integrated circuit having a signal processing capability. In the implementation process, each step of the above method or each module can be completed by the integrated logic circuit of hardware or the instruction of software in the processing element.

[0114] Figure 7 The structure diagram of the electronic device provided by the embodiments of the present application is shown in FIG. 1. As shown in the figure, the electronic device can include a transceiver 121, a processor 122, and a memory 123. ​

[0115] The processor 122 executes the computer execution instructions stored in the memory, so that the processor 122 executes the schemes in the above embodiments. The processor 122 can be a general-purpose processor, including a central processing unit CPU, a network processor NP, etc.; can also be a digital signal processor DSP, an application-specific integrated circuit ASIC, a field programmable gate array FPGA or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.

[0116] The memory 123 is connected with the processor 122 through a system bus and completes mutual communication, and the memory 123 is used to store computer program instructions.

[0117] The transceiver 121 can be used to send a target processing result corresponding to a service request.​

[0118] The system bus can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The system bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or only one type of bus. The transceiver is used to realize the communication between the database access device and other computers (such as clients, read-write libraries and read-only libraries). The memory can include random access memory (RAM) and can also include non-volatile memory.

[0119] The electronic device provided by the embodiment of the present application can be the terminal device of the above-mentioned embodiment.

[0120] The embodiment of the present application further provides a chip for running instructions, which is used for executing the technical solution of the session re-establishment method in the above-mentioned embodiment.

[0121] The embodiment of the present application further provides a computer readable storage medium, which stores computer instructions, and when the computer instructions are run on a computer, the computer executes the technical solution of the session re-establishment method of the above-mentioned embodiment.

[0122] The embodiment of the present application further provides a computer program product, which includes a computer program stored in a computer readable storage medium, at least one processor can read the computer program from the computer readable storage medium, and when the at least one processor executes the computer program, the technical solution of the session re-establishment method in the above-mentioned embodiment can be realized.

[0123] Other embodiments of the application will be apparent to those skilled in the art from consideration of the specification and practice of the application disclosed herein. The specification and examples given are exemplary only and the true scope and spirit of the application is indicated by the following claims. It will be appreciated by persons skilled in the art that numerous variations and / or modifications can be made to the application as described above without departing from the scope or spirit of the application. It is intended that all such variations and / or modifications be included within the scope of the application. The specification and examples given are exemplary only and the true scope and spirit of the application is indicated by the following claims.

[0124] It should be understood that the application is not limited to the precise construction that has been described above and shown in the accompanying drawings, and that various modifications and changes can be effected therein by those skilled in the art without departing from the scope of the application. The scope of the application is limited only by the appended claims.

Claims

1. A method of session re-establishment, applied in a scenario based on two- site three-center multi-cluster deployment, characterized in that, Comprise: Upon receiving a session request for re-entering a session, based on a current session identifier corresponding to a target user, determine whether the target cache includes storage information corresponding to the current session identifier; wherein the storage information includes a historical session identifier and corresponding domain name information; If the target storage information corresponding to the current session identifier is included, based on the target domain name information in the target storage information, determine a target cluster corresponding to the current session identifier, and a target service node belonging to the target cluster; After establishing communication with the target service node, re-establish a session window corresponding to the session request; Wherein, based on the target domain name information in the target storage information, determining a target cluster corresponding to the current session identifier, and a target service node belonging to the target cluster, comprises: Based on the target domain name information in the target storage information, determine whether a node route and a historical storage duration corresponding to the node route are stored, to determine the target cluster and the target service node according to the historical storage duration and whether the node route is included; wherein the target domain name information is the central domain name allocated to the target user during the last session; Wherein, before the target cluster and the target service node are determined based on the target domain name information in the target storage information, it further comprises: According to the storage timestamp corresponding to the target domain name information and the current timestamp, determine the stored duration of the target storage information; If the stored duration is less than a preset storage duration threshold, perform the operation of determining the target cluster and the target service node; If the stored duration reaches the preset storage duration threshold, determine that the target storage information has expired, and perform the step of determining the current session association information if it is detected that the current session is a non-first session and the target cache does not include the storage information.

2. The method of claim 1, wherein, The session request for re-entering the session includes at least one of the following: After the duration of disconnecting and / or exiting the session reaches a first preset duration threshold, the control for re-entering the session is triggered again; After the network interruption during the session reaches a second preset duration threshold, the network communication is re-established.

3. The method of claim 1, wherein, Further comprise: When it is detected that the current session is a first session or the current session is a non-first session and the target cache does not include the storage information, determine the session association information of the current session, and store the domain name information in the session association information and the corresponding current session identifier as storage information in the target cache.

4. The method of claim 3, wherein, The determination of the session association information of the current session comprises: Based on the session attribute of the current session and the load balancing information corresponding to each domain name service center, determine a target service center corresponding to the current session; wherein the session attribute includes network traffic corresponding to session processing information; Based on the target service center, determine the session association information of the current session; The session association information includes a target cluster corresponding to the current session and a corresponding target service node.

5. The method of claim 1, wherein, The determination of whether to store a node route and a historical storage duration corresponding to the node route, to determine the target cluster and the target service node according to the historical storage duration and whether the node route is included, comprises: If the node route is included and the historical storage duration does not reach a target storage duration threshold, the target cluster and the target service node are located based on the node route.

6. The method of claim 1, wherein, The determination of whether to store a node route and a historical storage duration corresponding to the node route, to determine the target cluster and the target service node according to the historical storage duration and whether the node route is included, comprises: If the node route is included and the historical storage duration reaches a target storage duration threshold, a target cluster and a corresponding target service node are assigned to the node route, a route identifier corresponding to the node route is generated and cached, and a session connection is established based on the target cluster, the target service node and the corresponding route node identifier.

7. The method of claim 1, wherein, The determination of whether to store a node route and a historical storage duration corresponding to the node route, to determine the target cluster and the target service node according to the historical storage duration and whether the node route is included, further comprises: If the node route is not included, the step of assigning a target cluster and a corresponding target service node to the node route is returned to establish a session connection.

8. An apparatus for session re-establishment, the apparatus comprising: Comprise: A storage information determination module is configured to, when a session request of re-entering a session is received, determine whether storage information corresponding to a current session identifier of a target user is included in a target cache based on the current session identifier; wherein the storage information includes a historical session identifier and corresponding domain name information. A service node determination module is configured to, if target storage information corresponding to the current session identifier is included, determine a target cluster corresponding to the current session identifier and a target service node belonging to the target cluster based on target domain name information in the target storage information. A session window reconstruction module is configured to, after establishing communication with the target service node, re-establish a session window corresponding to the session request. The service node determination module is further configured to determine whether to store a node route and a historical storage duration corresponding to the node route based on target domain name information in the target storage information, to determine the target cluster and the target service node according to the historical storage duration and whether the node route is included; wherein the target domain name information is a central domain name assigned to the target user during a previous session. A timestamp comparison module, comprising: a stored duration determination unit and a re-execution unit. The stored duration determination unit is configured to determine a stored duration of the target storage information according to a storage timestamp corresponding to the target domain name information and a current timestamp. The re-execution unit is configured to perform the operation of determining the target cluster and the target service node if the stored time length is less than a preset storage time length threshold. The timestamp comparison module is further configured to determine that the target storage information is invalid if the stored time length reaches the preset storage time length threshold, and perform the step of determining the session association information of the current session if it is detected that the current session is a non-first session and the target cache does not include the storage information.

9. The apparatus of claim 8, wherein, The apparatus further includes: The session detection module is configured to determine the session association information of the current session if it is detected that the current session is a first session or the current session is a non-first session and the target cache does not include the storage information, and store the domain name information and the corresponding current session identifier in the session association information as the storage information into the target cache.

10. An electronic device, comprising: It includes: A processor and a memory connected in communication with the processor; The memory stores computer execution instructions; The processor executes the computer execution instructions stored in the memory to implement the session re-establishment method according to any one of claims 1-7.

11. A computer readable storage medium, characterized in that, The computer readable storage medium stores computer execution instructions, and the computer execution instructions are executed by the processor to implement the session re-establishment method according to any one of claims 1-7.

12. A computer program product, characterised in that, It includes a computer program, and the computer program is executed by the processor to implement the session re-establishment method according to any one of claims 1-7.

Citation Information

Patent Citations

  • User service method and device based on social platform, computer equipment and medium

    CN112561545A