Session control sharing method and system in distributed cluster system

By storing session information in the NoSQL distributed cache cluster, efficient session control sharing in the distributed system is realized, the impact of the session sharing mechanism on system resource overhead and business performance in the existing technology is solved, and a secure and flexible single-user login mechanism is realized.

CN114979234BActive Publication Date: 2025-05-02INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202210425629.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-22
Publication Date
2025-05-02
Estimated Expiration
2042-04-22

AI Technical Summary

Technical Problem

The prior art is difficult to realize efficient session control sharing in distributed systems, especially in the high concurrency scenarios of multiple users, which leads to the impact of system resource overhead and business performance, and the performance of the single-user login mechanism is insufficient.

Method used

By storing session information in the NoSQL distributed cache cluster, efficient session synchronization and sharing between multiple application server nodes can be achieved. The specific method includes: the first service node in the application server cluster obtains the client's login request, generates session cache data and stores it in the distributed cache system; when the second service node intercepts subsequent requests to the client, it obtains the session cache data from the distributed cache system, and processes the client's request.

Benefits of technology

The security and efficiency of Session data sharing in distributed scenarios are realized, the consumption of system resources is reduced, the session control information failure caused by node failure in the sticky Session scheme is avoided, and the performance limitations of relational databases are overcome when horizontal expansion is overcome.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114979234B_ABST
    Figure CN114979234B_ABST
Patent Text Reader

Abstract

The present application provides a session control sharing method and system in a distributed cluster system, which is applicable to an application server cluster including multiple service nodes. The method includes: obtaining a login request generated by a client according to user account information through a first service node in the application server cluster, performing session processing on the login request to generate session cache data, and storing the session cache data in a predetermined distributed cache system; when a second service node in the application server cluster intercepts a login request initiated again by the client, obtaining the session cache data in the distributed cache system according to the login request; and processing the request processing logic subsequently provided by the client according to the session cache data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of Internet interaction and can be applied to the financial field and other fields, and in particular to a method and system for sharing session control in a distributed cluster system. Background Art

[0002] Session control Session is generally used in the application server and client session process, and can be used to store user login related information, session required attributes and related configuration information. Existing Session sharing methods usually have the following solutions:

[0003] Solution 1: Session sharing based on traditional relational database. This solution is to store the session information generated by login in the relational database, and other node application servers obtain the session information from it to achieve session sharing. Disadvantages: The performance of relational databases is difficult to expand or the cost is higher. In multi-user high concurrency scenarios, the performance of the database is difficult to meet the requirements, which may drag down the client performance. At the same time, retrieving the corresponding session information from a large amount of temporary session data is also a big challenge for the database. Solution 2: Sticky Session. Sticky Session means locking the user to the application server of a certain node. For example, when user A requests, the load balancing server loads user A's request to the node 1 server. If the load balancing server sets the sticky Session, user A's request will be forwarded to node 1 every time, which is similar to binding A's request to the node 1 server. Disadvantages: There is a lack of fault tolerance mechanism. When the node 1 service fails, the user A's request is transferred to the node 2 server, and the session information will become invalid. Solution 3: Application server clustering mechanism. This solution uses the session replication mechanism to replicate the session information of a single application service node to other nodes. Such as the Clustering mechanism of Tomcat server and the Jboss buddy replication mechanism of Jboss microcontainer. Disadvantages: It puts a certain pressure on the network load. If the amount of Session replication is too large, it will cause network congestion and slow down the server performance.

[0004] Single-user login means that the same account can only log in to one client, and cannot log in at the same time. After user A logs in, user B can log in. When B logs in successfully, user A will be kicked offline. The usual practice for single-user login is to add a few more fields to the user database table, such as the login flag field, the login time field, etc. Every time a user initiates a request, the interceptor will compare the login session information in the Session and the database table. When it finds updated login information in the data table, it means that the account has been recently logged in by other users, and the account will be forced offline. Disadvantages: This solution needs to maintain two copies of session information, one in the database table and the other in the cookie (data stored on the user's local terminal, which is text data stored in the user's local terminal for the website to identify the user and track the session). The comparison of session information requires frequent reading of session information from the database table, which will affect business performance. In summary, how to efficiently implement session sharing of single-user login in a distributed system has become an urgent need for performance design in web systems. Summary of the invention

[0005] The purpose of this application is to provide a session control sharing method and system in a distributed cluster system, solve the problem of real-time synchronization and efficient sharing of login sessions between multiple application nodes, reduce the impact of the session sharing mechanism on system resource overhead and business performance; and solve the problem of insufficient performance of the current single-user login mechanism.

[0006] To achieve the above-mentioned purpose, the present application provides a session control sharing method in a distributed cluster system, which is applicable to an application server cluster including multiple service nodes, and the method includes: obtaining a login request generated by a client according to user account information through a first service node in the application server cluster, performing session processing on the login request to generate session cache data, and storing the session cache data in a predetermined distributed cache system; when a second service node in the application server cluster intercepts a login request initiated again by the client, obtaining the session cache data in the distributed cache system according to the login request; and processing the request processing logic subsequently provided by the client according to the session cache data.

[0007] In the above-mentioned session control sharing method in the distributed cluster system, optionally, performing session processing on the login request to generate session cache data includes: obtaining user account information according to the login request, and performing permission verification on the user account information through predetermined permission information; generating encrypted object data and user identity identification through the user account information according to the verification result; constructing session cache data according to the encrypted object data and the user identity identification data; generating a login success status code according to the session cache data, and feeding back the login success status code to the client.

[0008] In the above-mentioned session control sharing method in the distributed cluster system, optionally, constructing session cache data according to the encrypted object data and the user identity data further includes: generating cookie data according to the user identity data; and feeding back the cookie data along with the login success status code to the client for storage.

[0009] In the above-mentioned session control sharing method in the distributed cluster system, optionally, storing the session cache data in a predetermined distributed cache system further includes: setting an expiration time of the session cache data stored in the distributed cache system according to a preset period parameter.

[0010] In the above-mentioned session control sharing method in the distributed cluster system, optionally, obtaining the session cache data in the distributed cache system according to the login request includes: obtaining cookie data uploaded by the client according to the login request, and obtaining corresponding session cache data in the distributed cache system according to the cookie data; and updating the expiration time of the session cache data stored in the distributed cache system according to the obtained session cache data.

[0011] In the above-mentioned session control sharing method in the distributed cluster system, optionally, processing the request processing logic subsequently provided by the client according to the session cache data further includes: clearing the session cache data cached by the first service node.

[0012] In the above-mentioned session control sharing method in the distributed cluster system, optionally, the method also includes: forming a non-relational data cluster through a main node and multiple secondary nodes, and establishing a distributed cache system based on multiple non-relational data clusters; each service node in the application server cluster is communicated with the secondary node.

[0013] In the above-mentioned session control sharing method in the distributed cluster system, optionally, storing the session cache data in a predetermined distributed cache system includes: after any secondary node in the distributed cache system receives the session cache data, synchronizing the session cache data to all secondary nodes in the distributed cache system.

[0014] The present application also provides a session control sharing system in a distributed cluster system, the system comprising a client, an application server cluster and a distributed cache system; the client is used to receive user account information input by a user, and generate a login request according to the user account information; the application server cluster comprises multiple service nodes, each server node is used to perform session processing on the login request to generate session cache data, and store the session cache data in a predetermined distributed cache system; and, when a login request initiated again by the client is intercepted, the session cache data is obtained in the distributed cache system according to the login request, and the request processing logic subsequently provided by the client is processed according to the session cache data; the distributed cache system comprises multiple non-relational data clusters, the non-relational data cluster comprises a master node and multiple slave nodes, and the slave nodes are used to store the session cache data.

[0015] The present application also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above method when executing the computer program.

[0016] The present application also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program for executing the above method.

[0017] The beneficial technical effect of the present application is: using NoSQL (non-relational data) distributed cache cluster to store session information to achieve efficient session synchronization and sharing between multiple application server nodes, and solve the security of session data sharing in distributed scenarios and the problem of excessive consumption of system resources. By storing session data in a distributed cache cluster, a safe and flexible single-user login mechanism can be implemented, which can effectively avoid the failure of session control information caused by node failure in the sticky session solution; at the same time, based on the advantages of horizontal expansion of NoSQL distributed cache clusters, the performance limitations of existing relational databases such as relational databases in data migration, cross-database joins, distributed transaction processing, etc. during horizontal expansion are overcome; further, based on the strong consistency characteristics of the distributed cache cluster itself, the synchronization of session control is achieved, thereby avoiding the network congestion problem caused by excessive session control replication in the existing application server Clustering mechanism, thereby solving the performance bottleneck problem of using a database to implement a single-user login mechanism. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The drawings described herein are used to provide a further understanding of the present application, constitute a part of the present application, and do not constitute a limitation of the present application. In the drawings:

[0019] Figure 1A flow chart of a session control sharing method in a distributed cluster system provided by an embodiment of the present application;

[0020] Figure 2 A schematic diagram of the application logic of the session control sharing method in a distributed cluster system provided by an embodiment of the present application;

[0021] Figure 3 A schematic diagram of a process for generating session cache data provided in an embodiment of the present application;

[0022] Figure 4 A schematic diagram of a business process of session control provided in an embodiment of the present application;

[0023] Figure 5 A schematic diagram of a flow chart for setting the time limit for session cache data provided in an embodiment of the present application;

[0024] Figure 6 A logical diagram of a session flow provided by an embodiment of the present application;

[0025] Figure 7 A schematic diagram of a logic flow of a user account being logged in again provided in an embodiment of the present application;

[0026] Figure 8 A schematic diagram of the structure of a session control sharing system in a distributed cluster system provided in an embodiment of the present application;

[0027] Fig. 9 A schematic diagram of the structure of an electronic device provided in one embodiment of the present application. DETAILED DESCRIPTION

[0028] The following will describe the implementation methods of the present application in detail in conjunction with the accompanying drawings and embodiments, so that the implementation process of how the present application applies technical means to solve technical problems and achieve technical effects can be fully understood and implemented accordingly. It should be noted that as long as there is no conflict, the various embodiments in the present application and the various features in the embodiments can be combined with each other, and the technical solutions formed are all within the protection scope of the present application.

[0029] In addition, the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be performed in an order different from that shown here.

[0030] Please refer to Figure 1 As shown, a session control sharing method in a distributed cluster system provided by the present application is applicable to an application server cluster including multiple service nodes, and the method includes:

[0031] S101 obtains a login request generated by a client according to user account information through a first service node in the application server cluster, performs session processing on the login request to generate session cache data, and stores the session cache data in a predetermined distributed cache system;

[0032] S102: when the second service node in the application server cluster intercepts a login request initiated again by the client, the second service node obtains the session cache data in the distributed cache system according to the login request;

[0033] S103 processes the request processing logic subsequently provided by the client according to the session cache data.

[0034] Specifically, in step S101, the login request provided by the client can be obtained through any service node in the application server cluster, wherein the login request includes user account information (such as identity information, login account password information or other information that can indicate the user identity under other rules), and the service node generates corresponding session cache data through session processing control according to the login request, and then synchronizes it on other nodes based on the synchronization mechanism of the distributed cache system, thereby ensuring that in steps S102 and S103, any subsequent service node in the application server cluster can access from any service node in the distributed cache system to continue to complete the session control corresponding to the login request.

[0035] In the above embodiment, the method may also include: forming a non-relational data cluster through a master node and multiple slave nodes, and forming a distributed cache system based on multiple non-relational data clusters; each service node in the application server cluster is communicated with the slave node. This structure can effectively ensure that the synchronization mechanism of the aforementioned distributed cache system is effectively implemented; thereafter, storing the session cache data in a predetermined distributed cache system includes: after any slave node in the distributed cache system receives the session cache data, the session cache data is synchronized to all slave nodes in the distributed cache system. In actual work, the distributed cache system can be composed of multiple NoSQL clusters, and the cluster includes a master node and multiple slave nodes. The distributed cache provides session cache data reading and storage services for multiple application server nodes. Each cache data is stored in the distributed cache in the form of a key-value pair. The application server cluster consists of multiple server nodes, and each server accepts client requests routed by a load balancing device. For details, please refer to Figure 2As shown, user 1 uses the user account information user account to initiate a login request. Node 1 server processes the request, generates session cache data A and B, and stores them in the distributed cache cluster. The slave nodes in the cluster synchronize cache A and B to other slave nodes in the cluster in real time. When the client initiates a request again, the request is loaded to node 2. Node 2 intercepts the request and can obtain session data related to the user from any slave node in the distributed cache, thereby confirming that the user is logged in and can continue to complete the request processing logic. Similarly, nodes 3 to n can all share the session data stored in the distributed cache by node 1. The session cache data A and B are like a copy saved in each node of the application server.

[0036] Please refer to Figure 3 As shown, in one embodiment of the present application, performing session processing on the login request to generate session cache data further includes:

[0037] S301 obtains user account information according to the login request, and performs permission verification on the user account information through predetermined permission information;

[0038] S302 generates encryption object data and user identity identification through the user account information according to the verification result;

[0039] S303 constructs session cache data according to the encrypted object data and the user identity data;

[0040] S304 generates a login success status code according to the session cache data, and feeds back the login success status code to the client.

[0041] The generation of session cache data is achieved through the above embodiment. Specifically, in the above step S301, the user account information is mainly verified by using the permission rules for the user account information such as the pre-set permission information such as the user identity identification and the account usage permission. For example, the pre-set permission information identifies the three types of users B, C, and D as users who can participate in the session control. At this time, if the user is confirmed to be a type B user according to the user account information, the subsequent step S302 can be continued. On the contrary, when the user is a type A user, because it is not included in the permission information, it means that the user is not given the permission, so the subsequent operation can be terminated and feedback reminders can be fed back. In actual work, there are many ways to verify the permission, such as the key verification method, the black and white list comparison method, etc. The relevant technical personnel in this field can select the setting according to the actual needs, and the present application does not make further limitations here.

[0042] Based on the verification result of step S301, in step S302, the corresponding encrypted object data and user identity identifier can be generated according to the user account information, wherein the user identity identifier indicates the initiator of the login request, and the encrypted object data is the UserMd5 data in the session control processing process, and its function is to protect the security of the session control through cryptographic technology. The specific principle and implementation logic are conventional encryption conversion technologies, which will not be described in detail here.

[0043] Then, in step S303, session cache data is constructed based on the two data (encryption object data and user identity identifier) ​​generated in the above step S302, wherein the encryption object data and the user identity identifier correspond to the session cache data A and B in the above embodiment respectively.

[0044] Finally, in step S304, reminder data is fed back based on the constructed session cache data, such as a login success status code to inform the client that the creation is complete and subsequent session control can be performed.

[0045] In one embodiment of the present application, the aforementioned step S303 may further include: generating cookie data according to the encrypted object data and the user identity data; feeding back the cookie data along with the login success status code to the client for storage; so that the subsequent client can locate the corresponding session control session based on the cookie data. For details, please refer to Figure 4 As shown in the figure, the client initiates a login request / login with the user account. The application server accepts the login request and performs the following session processing steps:

[0046] 1) Execute step S301, query the database to perform permission verification on the login account user, so as to complete the permission verification to confirm that the login account is a user who can use session control.

[0047] 2) Create an HttpSession object to store user information. In this step, the HttpSession object can be created in advance or triggered based on the permission verification result. Relevant technicians in this field can choose the creation time according to actual needs. Its function is to provide session data sharing for each module after login.

[0048] HttpSession session=request.getSession();

[0049] session.setAttribute("user",userBean) / / Store user information;

[0050] session.setAttribute(SessionConstant.SESSION_USER_ID,userId);

[0051] session.setAttribute(SessionConstant.SESSION_SUCCESS_LOGIN,true) / / Login ID;

[0052] 3) Generate the encrypted object data in step S302, that is, generate the encrypted account object UserMd5, and create a SessionMap object to store UserBean and UserMd5.

[0053] Ojb UserMd5=DigestUtils.md5Hex(userInfo);

[0054] Map SessionMap=new SessionMap();

[0055] SessionMap.put("userkey",UserMd5);

[0056] sessionMap.put("beankey",UserBean);

[0057] 4) Generate the user identity in step S302, that is, generate a token user identity, and store the token and application identification appId (application identification) in a cookie.

[0058] Token token=TokenUtils.create(uuid,time,sign);

[0059] Cookie cookie=new Cookie(appId,token);

[0060] 5) Clear the user's related data in the distributed cache.

[0061] 6) Set up cache A and B, A stores [UserMd5, appId, token], B stores [appId, token, SessionMap]; (Session cache data construction example in step S303)

[0062] cachePool.setex(UserMd5,appId,token);

[0063] cachePool.setex(appId,token,SessionMap);

[0064] 7) Return the login success status code to the client, and the cookie data in step 4) will be saved to the client along with the response data.

[0065] In one embodiment of the present application, storing the session cache data in a predetermined distributed cache system also includes: setting the expiration time of the session cache data stored in the distributed cache system according to preset period parameters. Because the session cache data cannot be kept in use for a long time, it will cause unnecessary waste of storage resources to the distributed cache system. Therefore, the present application limits the usage interval of the session cache data by setting an expiration time; for example, when a session cache data is constructed, if no login request corresponding to the session cache data is received within the set expiration time, it can be set to invalid, thereby reducing maintenance costs. On the contrary, if there is a new login request during the usage interval, the expiration time can be updated to recalculate the corresponding usage interval; for details, please refer to Figure 5 As shown, obtaining the session cache data in the distributed cache system according to the login request includes:

[0066] S501 obtains cookie data uploaded by the client according to the login request, and obtains corresponding session cache data in the distributed cache system according to the cookie data;

[0067] S502 updates the expiration time of the session cache data stored in the distributed cache system according to the obtained session cache data.

[0068] In actual work, please refer to Figure 4 and Figure 5 As shown, in a general session request, the request will carry cookie data to initiate a secondary request to the application server; the application server obtains the cookie data and obtains the appId and token data from the cookie. The appId+token data will be used to obtain cache B from the distributed cache, and obtain the SessionMap session data in step 3) from cache B. The pseudo code is as follows:

[0069] SessionMap=cachePool.get(appId,token);

[0070] Get the encrypted account object UserMd5 from SessionMap:

[0071] UserMd5=SessionMap.get("userkey");

[0072] Based on the data obtained above, update the expiration time of data A and data B in the distributed cache:

[0073] SessionTool.updateSessionStatus(UserMd5,appId,token) / / Update cache A;

[0074] SessionTool.updateSessionStatus(SessionTool.updateSessionStatus(UserMd5,appId,token) / / Update cache B;

[0075] Therefore, as long as the interval between requests initiated by the client does not exceed the expiration time of the session, the cache data A and B will always exist, and the user account will always keep the login status. When the A and B caches disappear, the client will go through the login logic again.

[0076] In one embodiment of the present application, the request processing logic subsequently provided by the client according to the session cache data further includes: clearing the session cache data cached by the first service node. In this way, unnecessary cache data of the first service node is deleted to save storage resources; please refer to Figure 6 As shown in the figure, in actual work, the logical diagram of the user account after being logged in by user 2. After the user account is logged in by user 1, the distributed cache will store two session cache data A[UserMd5,appId,token] and B[appId,token,SessionMap]; at this time, user 2 uses the user account to initiate a login request and makes Figure 2 In the session processing steps, create HttpSession2 and token2 user identity, and use the encrypted information UserMd5 of the user account and the application identity appId to clear caches A and B:

[0077] deleteSessionKey(request,UserMd5,appId);

[0078] session.invalidate();

[0079] At this point, caches A and B in the cluster will no longer exist, thus achieving single-user login control. User 2's login request will create new caches A2[UserMd5,appId,token2] and B2[appId,token2,SessionMap2].

[0080] On this basis, please refer to Figure 7 As shown in the figure, user 1 first creates caches A and B. When user 2 logs in with the same user account, cache data A and B are cleared, the user account is forced offline on the user 1 client, and the request initiated by user 2 creates new caches A2 and B2. Similarly, when user 1 logs in with the user account again, the user 2 account will also be forced offline.

[0081] Please refer to Figure 8 As shown, the present application also provides a session control sharing system in a distributed cluster system, the system comprising a client, an application server cluster and a distributed cache system; the client is used to receive user account information input by a user, and generate a login request according to the user account information; the application server cluster comprises multiple service nodes, each server node is used to perform session processing on the login request to generate session cache data, and store the session cache data in a predetermined distributed cache system; and, when a login request initiated again by the client is intercepted, the session cache data is obtained in the distributed cache system according to the login request, and the request processing logic subsequently provided by the client is processed according to the session cache data; the distributed cache system comprises multiple non-relational data clusters, the non-relational data cluster comprises a master node and multiple slave nodes, and the slave nodes are used to store the session cache data.

[0082] The beneficial technical effect of this application is: using the NoSQL distributed cache cluster to store session information to achieve efficient session synchronization and sharing between multiple application server nodes, solving the security of session data sharing in distributed scenarios and the problem of excessive consumption of system resources. By storing session data in the distributed cache cluster, a secure and flexible single-user login mechanism is implemented, solving the performance bottleneck problem of using a database to implement a single-user login mechanism.

[0083] The present application also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above method when executing the computer program.

[0084] The present application also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program for executing the above method.

[0085] like Fig. 9 As shown, the electronic device 600 may further include: a communication module 110, an input unit 120, an audio processing unit 130, a display 160, and a power supply 170. It is worth noting that the electronic device 600 does not necessarily have to include Fig. 9In addition, the electronic device 600 may also include Fig. 9 For components not shown, reference may be made to the prior art.

[0086] like Fig. 9 As shown, the central processor 100 is sometimes also referred to as a controller or an operation control, and may include a microprocessor or other processor devices and / or logic devices. The central processor 100 receives inputs and controls the operations of various components of the electronic device 600.

[0087] The memory 140 may be, for example, one or more of a cache, a flash memory, a hard drive, a removable medium, a volatile memory, a non-volatile memory or other suitable devices. The above-mentioned information related to the failure may be stored, and a program for executing the relevant information may also be stored. The CPU 100 may execute the program stored in the memory 140 to implement information storage or processing.

[0088] The input unit 120 provides input to the CPU 100. The input unit 120 is, for example, a key or a touch input device. The power supply 170 is used to provide power to the electronic device 600. The display 160 is used to display display objects such as images and text. The display may be, for example, an LCD display, but is not limited thereto.

[0089] The memory 140 may be a solid-state memory, such as a read-only memory (ROM), a random access memory (RAM), a SIM card, etc. It may also be a memory that saves information even when the power is off, can be selectively erased, and is provided with more data, examples of which are sometimes referred to as EPROMs, etc. The memory 140 may also be some other type of device. The memory 140 includes a buffer memory 141 (sometimes referred to as a buffer). The memory 140 may include an application / function storage unit 142, which is used to store application programs and function programs or processes for executing the operation of the electronic device 600 through the central processor 100.

[0090] The memory 140 may also include a data storage unit 143 for storing data, such as contacts, digital data, pictures, sounds, and / or any other data used by the electronic device. The driver storage unit 144 of the memory 140 may include various drivers for communication functions of the electronic device and / or for executing other functions of the electronic device (such as messaging applications, address book applications, etc.).

[0091] The communication module 110 is a transmitter / receiver 110 that transmits and receives signals via an antenna 111. The communication module (transmitter / receiver) 110 is coupled to the central processor 100 to provide input signals and receive output signals, which may be the same as the case of a conventional mobile communication terminal.

[0092] Based on different communication technologies, multiple communication modules 110 may be provided in the same electronic device, such as a cellular network module, a Bluetooth module and / or a wireless LAN module. The communication module (transmitter / receiver) 110 is also coupled to a speaker 131 and a microphone 132 via an audio processor 130 to provide an audio output via the speaker 131 and receive an audio input from the microphone 132, thereby realizing a common telecommunication function. The audio processor 130 may include any suitable buffer, decoder, amplifier, etc. In addition, the audio processor 130 is also coupled to the central processor 100, so that the sound can be recorded on the local machine through the microphone 132, and the sound stored on the local machine can be played through the speaker 131.

[0093] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0094] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0095] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1A function specified in one or more boxes.

[0096] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0097] The specific embodiments described above further illustrate the purpose, technical solutions and beneficial effects of the present application. It should be understood that the above description is only a specific embodiment of the present application and is not intended to limit the scope of protection of the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the scope of protection of the present application.

Claims

1. A session control sharing method in a distributed cluster system, applicable to an application server cluster including multiple service nodes, characterized in that: The method comprises: Obtaining a login request generated by a client according to user account information through a first service node in the application server cluster, performing session processing on the login request to generate session cache data, and storing the session cache data in a predetermined distributed cache system; When the second service node in the application server cluster intercepts a login request initiated again by the client, the second service node obtains the session cache data in the distributed cache system according to the login request; Processing the request processing logic subsequently provided by the client according to the session cache data; Processing the request processing logic subsequently provided by the client according to the session cache data also includes: clearing the session cache data cached by the first service node; Performing session processing on the login request to generate session cache data also includes: Obtaining user account information according to the login request, and performing authority verification on the user account information using predetermined authority information; Generate encryption object data and user identity through the user account information according to the verification result; Constructing session cache data according to the encrypted object data and the user identity data; Generate a login success status code according to the session cache data, and feed back the login success status code to the client; Constructing session cache data according to the encrypted object data and the user identity data further comprises: Generate cookie data according to the user identification data; The cookie data is fed back to the client for storage along with the login success status code.

2. The method for sharing session control in a distributed cluster system according to claim 1, characterized in that: Storing the session cache data in a predetermined distributed cache system further includes: The expiration time of the session cache data stored in the distributed cache system is set according to a preset period parameter.

3. The method for sharing session control in a distributed cluster system according to claim 2, characterized in that: Obtaining the session cache data in the distributed cache system according to the login request includes: Obtaining cookie data uploaded by the client according to the login request, and obtaining corresponding session cache data in the distributed cache system according to the cookie data; The expiration time of the session cache data stored in the distributed cache system is updated according to the obtained session cache data.

4. The method for sharing session control in a distributed cluster system according to claim 1, characterized in that: The method also includes: forming a non-relational data cluster through a main node and multiple secondary nodes, and establishing a distributed cache system based on the multiple non-relational data clusters; each service node in the application server cluster is communicatively connected with the secondary nodes.

5. The method for sharing session control in a distributed cluster system according to claim 4, characterized in that: Storing the session cache data in a predetermined distributed cache system includes: After receiving the session cache data, any secondary node in the distributed cache system synchronizes the session cache data to all secondary nodes in the distributed cache system.

6. A session control sharing system in a distributed cluster system, characterized in that: The system includes a client, an application server cluster and a distributed cache system; The client is used to receive user account information input by a user, and generate a login request according to the user account information; The application server cluster includes a plurality of service nodes, each server node is used to perform session processing on the login request to generate session cache data, and store the session cache data in a predetermined distributed cache system; And, when a login request initiated again by the client is intercepted, the session cache data is obtained in the distributed cache system according to the login request, and the request processing logic subsequently provided by the client is processed according to the session cache data; processing the request processing logic subsequently provided by the client according to the session cache data also includes: clearing the session cache data cached by the first service node; performing session processing on the login request to generate session cache data also includes: obtaining user account information according to the login request, and performing permission verification on the user account information through predetermined permission information; Generate encryption object data and user identity through the user account information according to the verification result; Constructing session cache data according to the encrypted object data and the user identity data; Generate a login success status code according to the session cache data, and feed back the login success status code to the client; constructing the session cache data according to the encrypted object data and the user identity data further comprises: generating cookie data according to the user identity data; feeding back the cookie data along with the login success status code to the client for storage; The distributed cache system includes multiple non-relational data clusters, each of which includes a primary node and multiple secondary nodes, and each secondary node is used to store the session cache data.

7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 5 is implemented.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program for causing a computer to execute the method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Single sign on authentication method and device

    CN107770140A

  • Distributed session management method and device based on NoSQL (Not Only SQL)

    CN109547512A

  • Session keeping method and device in distributed system

    CN111464534A