CN114979234A - Session control sharing method and system in distributed cluster system - Google Patents

Session control sharing method and system in distributed cluster system Download PDF

Info

Publication number
CN114979234A
CN114979234A CN202210425629.5A CN202210425629A CN114979234A CN 114979234 A CN114979234 A CN 114979234A CN 202210425629 A CN202210425629 A CN 202210425629A CN 114979234 A CN114979234 A CN 114979234A
Authority
CN
China
Prior art keywords
session
data
cache data
distributed
client
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210425629.5A
Other languages
Chinese (zh)
Inventor
向东东
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202210425629.5A priority Critical patent/CN114979234A/en
Publication of CN114979234A publication Critical patent/CN114979234A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5083Techniques for rebalancing the load in a distributed system
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Software Systems (AREA)
  • Computing Systems (AREA)
  • Signal Processing (AREA)
  • Data Mining & Analysis (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer And Data Communications (AREA)

Abstract

The application provides a session control sharing method and a session control sharing system in a distributed cluster system, which are suitable for an application server cluster comprising a plurality of service nodes, wherein the method comprises the following steps: obtaining a login request generated by a client according to user account information through a first service node in the application server cluster, carrying out session processing on the login request to generate session cache data, and storing the session cache data to a preset distributed cache system; when a second service node in the application server cluster intercepts a login request initiated again by a client, obtaining the session cache data in the distributed cache system according to the login request; and processing the subsequent request processing logic provided by the client according to the session cache data.

Description

Session control sharing method and system in distributed cluster system
Technical Field
The application relates to the field of internet interaction, can be applied to the financial field and other fields, and particularly relates to a session control sharing method and system in a distributed cluster system.
Background
Session control Session, which is generally used in the Session process of application server and client, can be used to store the related information of user login, the attributes required by the Session, and the related configuration information. The existing Session sharing method generally has the following schemes:
the first scheme is as follows: session sharing based on traditional relational databases. The method comprises the steps that Session information generated by login is stored in a relational database, and other node application servers acquire the Session information from the relational database to realize Session sharing. The disadvantages are as follows: the performance of the relational database is difficult to expand or the cost is higher, the performance of the database is difficult to meet the requirements under the multi-user high-concurrency scene, and the performance of the client side can be possibly tired. Meanwhile, it is a great challenge for the database to retrieve the corresponding Session information from a large amount of temporary Session data. Scheme II: sticky Session. Sticky Session refers to locking a user to an application server of a certain node, if a user requests, a load balancing server loads the request of the user a to a node 1 server, and if the load balancing server sets sticky Session, the request of the user a is forwarded to the node 1 every time, which is similar to binding the request of the user a with the node 1 server. The disadvantages are as follows: in the absence of a fault tolerance mechanism, the Session information will fail when the request of the a user is transferred to the node 2 server when the node 1 service fails. And a third scheme is as follows: application server Clustering mechanism. The scheme is that a Session replication mechanism is utilized to replicate Session information of a single application service node to other nodes. Such as the Clustering mechanism of Tomcat server, the Jboss replication mechanism of Jboss micro containers. The disadvantages are as follows: a certain pressure is applied to the network load, and if the Session copy amount is too large, network congestion is caused, and the performance of the server is slowed down.
The single-user login means that the same account can only be logged in at one client and cannot be logged in at the same time. After the user A logs in, the user B can log in, and when the user B logs in successfully, the user A can be kicked off the line. The common practice of single-user login is to add several more fields in the user database table, such as login flag field, login time field, etc. The interceptor compares the login Session information in the Session and the database table every time the user initiates a request, and when the updated login information is found in the database table, the interceptor indicates that the account is recently logged in by other users and the interceptor is forced to be offline. The disadvantages are as follows: this solution requires maintaining two pieces of session information, one in a database table and one in a cookie (data stored on the user's local terminal, text data stored in the user's local terminal by the website for identifying the user and tracking the session), and frequent reading of the session information from the database table for comparing the session information may affect the service performance. In summary, how to efficiently implement session sharing of single user login in a distributed system becomes an urgent need for performance design in a web system.
Disclosure of Invention
The application aims to provide a session control sharing method and a session control sharing system in a distributed cluster system, which solve the problems of real-time synchronization and efficient sharing of login sessions among a plurality of application nodes and reduce the influence of a session sharing mechanism on system resource overhead and service performance; meanwhile, the problem that the performance of the existing single-user login mechanism is insufficient is solved.
To achieve the above object, the present application provides a session control sharing method in a distributed cluster system, which is applied to an application server cluster including a plurality of service nodes, and the method includes: acquiring a login request generated by a client according to user account information through a first service node in the application server cluster, carrying out session processing on the login request to generate session cache data, and storing the session cache data to a preset distributed cache system; when a second service node in the application server cluster intercepts a login request initiated again by a client, obtaining the session cache data in the distributed cache system according to the login request; and processing the subsequent request processing logic provided by the client according to the session cache data.
In the method for sharing session control 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 authority verification on the user account information through preset authority information; generating encrypted object data and a user identity through the user account information according to a verification result; constructing session cache data according to the encrypted object data and the user identity identification data; and generating a login success status code according to the session cache data, and feeding back the login success status code to the client.
In the above method for sharing session control in a distributed cluster system, optionally, the constructing session cache data according to the encrypted object data and the user identification data further includes: generating cookie data according to the user identity data; and feeding back the cookie data to the client for storage along with the login success status code.
In the above method for sharing session control in a distributed cluster system, optionally, storing the session cache data in a predetermined distributed cache system further includes: and setting the failure duration of the session cache data stored in the distributed cache system according to a preset period parameter.
In the above method for sharing session control in a distributed cluster system, optionally, obtaining the session cache data in the distributed cache system according to the login request includes: acquiring cookie data uploaded by a client according to the login request, and acquiring corresponding session cache data in the distributed cache system according to the cookie data; and updating the failure duration of the session cache data stored in the distributed cache system according to the obtained session cache data.
In the session control sharing method in the distributed cluster system, optionally, processing a request processing logic subsequently provided by the client according to the session cache data further includes: and emptying the session cache data cached by the first service node.
In the above method for sharing session control in a distributed cluster system, optionally, the method further includes: a main node and a plurality of auxiliary nodes form a non-relational data cluster, and a distributed cache system is formed according to the non-relational data clusters; and each service node in the application server cluster is in communication connection with the auxiliary node.
In the session control sharing method in the distributed cluster system, optionally, storing the session cache data in a predetermined distributed cache system includes: after any auxiliary node in the distributed cache system receives the session cache data, synchronizing the session cache data to all auxiliary nodes in the distributed cache system.
The application also provides a session control sharing system in the distributed cluster system, wherein the system comprises a client, an application server cluster and a distributed cache system; the client is used for receiving user account information input by a user and generating a login request according to the user account information; the application server cluster comprises a plurality of service nodes, each server node is used for carrying out session processing on the login request to generate session cache data, and the session cache data are stored in a preset distributed cache system; when a login request initiated by the client again is intercepted, obtaining the session cache data in the distributed cache system according to the login request, and processing a request processing logic subsequently provided by the client according to the session cache data; the distributed cache system comprises a plurality of non-relational data clusters, each non-relational data cluster comprises a main node and a plurality of auxiliary nodes, and each auxiliary node is used for storing the session cache data.
The application also provides an electronic device, which comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor executes the computer program to realize the method.
The present application also provides a computer-readable storage medium storing a computer program for executing the above method.
The beneficial technical effect of this application lies in: session information is stored in a NoSQL (non-relational data) distributed cache cluster to realize efficient Session synchronization and sharing among a plurality of application server nodes, and the problems of security of Session data sharing and high consumption of system resources in a distributed scene are solved. By storing Session data in the distributed cache cluster, a safe and flexible single-user login mechanism is realized, and the failure of Session control information caused by node failure in a sticky Session scheme can be effectively avoided; meanwhile, based on the advantages of horizontal expansion of the NoSQL distributed cache cluster, the performance limitations of the existing relational databases such as the relational database in the aspects of data migration, cross-database join, distributed transaction processing and the like during horizontal expansion are overcome; furthermore, based on the self strong consistency characteristic of the distributed cache cluster, the synchronization of session control is realized, so that the problem of network congestion caused by overlarge session control replication quantity of the conventional application server Clustering mechanism is solved, and the problem of performance bottleneck of realizing a single-user login mechanism by using a database is solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application, are incorporated in and constitute a part of this application, and are not intended to limit the application. In the drawings:
fig. 1 is a schematic flowchart of a session control sharing method in a distributed cluster system according to an embodiment of the present application;
fig. 2 is a schematic diagram of application logic of a session control sharing method in a distributed cluster system according to an embodiment of the present application;
fig. 3 is a schematic diagram illustrating a generation flow of session cache data according to an embodiment of the present application;
fig. 4 is a schematic service flow diagram of session control according to an embodiment of the present application;
fig. 5 is a schematic view illustrating a time setting process of session cache data according to an embodiment of the present application;
FIG. 6 is a schematic diagram of session flow logic provided in accordance with an embodiment of the present application;
fig. 7 is a schematic logic flow diagram illustrating a user account being logged in again according to an embodiment of the present disclosure;
fig. 8 is a schematic structural diagram of a session control sharing system in a distributed cluster system according to an embodiment of the present application;
fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The following detailed description will be provided with reference to the drawings and examples to explain how to apply the technical means to solve the technical problems and to achieve the technical effects. It should be noted that, as long as there is no conflict, the embodiments and the features of the embodiments in the present application may be combined with each other, and the technical solutions formed are all within the scope of the present application.
Additionally, the steps illustrated in the flow charts of the figures may be performed in a computer system such as a set of computer-executable instructions and, although a logical order is illustrated in the flow charts, in some cases, the steps illustrated or described may be performed in an order different than here.
Referring to fig. 1, a session control sharing method in a distributed cluster system provided in the present application is applicable to an application server cluster including a plurality of service nodes, and the method includes:
s101, a login request generated by a client according to user account information is obtained through a first service node in the application server cluster, session processing is carried out on the login request to generate session cache data, and the session cache data are stored in a preset distributed cache system;
s102, when a second service node in the application server cluster intercepts a login request initiated again by a client, obtaining the session cache data in the distributed cache system according to the login request;
s103, processing the subsequent request processing logic provided by the client according to the session cache data.
Specifically, in step S101, a login request provided by a client may be obtained through any service node in an application server cluster, where the login request includes user account information (e.g., identity information, login account password information, or information capable of indicating a user identity under the definition of other rules), the service node generates corresponding session cache data through session processing control according to the login request, and then synchronizes the session cache data with other nodes based on a synchronization mechanism of a distributed cache system, thereby ensuring that in step S102 and step S103, any service node in a subsequent application server cluster may access from any service node in the distributed cache system to continue to complete session control corresponding to the login request.
In the above embodiment, the method may further comprise, before: a non-relational data cluster is formed by a main node and a plurality of auxiliary nodes, and a distributed cache system is formed according to the non-relational data clusters; and each service node in the application server cluster is in communication connection with the auxiliary node. The structure can effectively ensure the effective implementation of the synchronization mechanism of the distributed cache system; then, storing the session cache data in a predetermined distributed cache system includes: after any auxiliary node in the distributed cache system receives the session cache data, synchronizing the session cache data to all auxiliary nodes in the distributed cache system. In actual work, the distributed cache system can be formed by a plurality of NoSQL clusters, and each cluster comprises a main node master node and a plurality of auxiliary node slave nodes. The distributed cache provides session cache data reading and storing services for a plurality of application server nodes. Each cache data is stored in the distributed cache in the form of key-value pairs. The application server cluster is composed of a plurality of server nodes, and each server receives client requests routed by the load balancing equipment. Specifically, as shown in fig. 2, the user 1 initiates a login request by using a user account information user account, the node 1 server processes the request to generate session cache data A, B, the session cache data is stored in the distributed cache cluster, and the slave node in the cluster synchronizes the cache A, B to other slave nodes in the cluster in real time. When the client initiates the request again, the request is loaded to node 2. The node 2 intercepts the request, and session data related to the user can be acquired from any slave node in the distributed cache, so that the user is confirmed to be in a logged-in state, and the request processing logic can be continuously completed. Similarly, each of the nodes 3 to n may share the session data stored in the distributed cache to the node 1. Session cache data A, B is stored as one copy in each node of the application server.
Referring to fig. 3, in an embodiment of the present application, performing session processing on the login request to generate session cache data further includes:
s301, obtaining user account information according to the login request, and performing authority verification on the user account information through preset authority information;
s302, generating encrypted object data and a user identity through the user account information according to a verification result;
s303, constructing session cache data according to the encrypted object data and the user identity data;
s304, a login success status code is generated according to the session cache data, and the login success status code is fed back to the client.
Specifically, in the step S301, the authority rules for the user account information, such as the user identity, the account usage authority, and the like, are mainly used to perform authority verification on the user account information, for example, B, C, D is identified as a user that can participate in session control in the preset authority information, at this time, it is determined that the user is a type B user according to the user account information, and then the subsequent step S302 can be continued, otherwise, when the user is a type a user, because the user is not included in the authority information, the representative does not give its authority, and therefore the subsequent operation can be terminated and a prompt can be fed back; in actual work, there are many ways of authority verification, such as a way of key verification, a way of comparing a black list and a white list, etc., and related technicians in the field can select settings according to actual needs, which is not further limited herein.
Based on the verification result in step S301, in step S302, corresponding encrypted object data and user identity may be generated according to the user account information, where the user identity indicates an initiator of the login request, and the encrypted object data is user md5 data in the session control processing process.
Next, in step S303, session cache data is constructed based on the two data (encrypted object data and user identity) generated in step S302, where the encrypted object data and the user identity respectively correspond to the session cache data A, B in the foregoing embodiment.
Finally, in step S304, based on the constructed session cache data, the reminding data is fed back, and if the login success status code informs the client that the creation is completed, the subsequent session control can be performed.
In an embodiment of the present application, the constructing session cache data according to the encrypted object data and the user identification data in step S303 may further include: generating cookie data according to the user identity data; feeding the cookie data back to the client side along with the login success status code for storage; so that subsequent clients can locate the corresponding session control session based on the cookie data. Specifically, in actual work, please refer to fig. 4, the client initiates a login request/login with a user account, and the application server receives the login request and performs the following session processing steps:
1) and executing the step S301, inquiring the database to perform authority verification on the login account user, and completing the authority verification to confirm that the login account is a user capable of using session control.
2) The http failure object is created to store user information, the http failure object can be created in advance or triggered to be created based on a permission verification result in the step, and related technicians in the field can select creation time according to actual needs, and the function of the http failure object is to provide session data sharing of each module after login.
HttpSession session=request.getSession();
session, setattenbute ("user", userBean)// store user information;
session.setAttribute(SessionConstant.SESSION_USER_ID,userId);
session, session _ SUCCESS _ log, true)// LOGIN id;
3) the generation of the encrypted object data in step S302 is performed, that is, the encrypted account object UserMd5 is generated, and the SessionMap object is created to store UserBean and UserMd 5.
Ojb UserMd5=DigestUtils.md5Hex(userInfo);
Map SessionMap=new SessionMap();
SessionMap.put("userkey",UserMd5);
sessionMap.put("beankey",UserBean);
4) The user id in step S302 is generated, that is, a token user id is generated, and the token and the application identifier appid (application identification) are stored in the cookie.
Token token=TokenUtils.create(uuid,time,sign);
Cookie cookie=new Cookie(appId,token);
5) And emptying the relevant data of the user in the distributed cache.
6) Setting caches A and B, wherein [ UserMd5, appId and token ] are stored in the A, and [ appId, token and Session map ] are stored in the B; (construction example of Session cache data in step S303)
cachePool.setex(UserMd5,appId,token);
cachePool.setex(appId,token,SessionMap);
7) And returning the login success status code to the client, and storing the cookie data along with the response data to the client in the step 4).
In an embodiment of the present application, storing the session cache data in a predetermined distributed cache system further includes: and setting the failure duration of the session cache data stored in the distributed cache system according to a preset period parameter. Because the session cache data cannot be kept for long time, unnecessary storage resource waste is brought to a distributed cache system, and therefore the use interval duration of the session cache data is limited by setting the failure duration; for example, after a session cache data is constructed, when a login request corresponding to the session cache data is not received within a time period of a set invalidation time period, the session cache data can be invalidated, so that the maintenance cost is reduced, otherwise, when a new login request exists during the use interval, the invalidation time period can be updated, so that the corresponding use interval time period is recalculated; specifically, referring to fig. 5, obtaining the session cache data in the distributed cache system according to the login request includes:
s501, obtaining cookie data uploaded by a client according to the login request, and obtaining corresponding session cache data in the distributed cache system according to the cookie data;
s502, updating the failure duration of the session cache data stored in the distributed cache system according to the obtained session cache data.
In actual work, please refer to fig. 4 and 5 in combination, in a general session request, a request will initiate a secondary request to an application server with cookie data; and the application server side acquires cookie data and acquires appId and token data from the cookie. The appId + token data is used to obtain the buffer B from the distributed buffer, and obtain the SessionMap session data in step 3) from the buffer B, where the pseudo code is as follows:
SessionMap=cachePool.get(appId,token);
obtaining encrypted account object UserMd5 from SessionMap:
UserMd5=SessionMap.get("userkey");
based on the obtained data, updating the failure duration of the data A and the data B in the distributed cache:
sessiontool. updatesessionstatus (UserMd5, appId, token)// update cache a;
sessiontool.updatesessionstatus (UserMd5, appId, token)// update cache B;
thus, as long as the request interval initiated by the client does not exceed the expiration time of the session, the cached data A, B will always exist and the user account will always maintain the login status. When the A, B cache disappears, the client will re-walk the login logic.
In an embodiment of the present application, the processing, according to the session cache data, the request processing logic subsequently provided by the client further includes: and emptying the session cache data cached by the first service node. Therefore, unnecessary cache data of the first service node is deleted, and storage resources are saved; specifically, referring to fig. 6, in actual work, a logic diagram after a user account is logged in by the user 2 is shown. After the User account is logged in by the User 1, two session cache data of A [ UserMd5, appId, token ] and B [ appId, token and Session map ] are stored in the distributed cache; at this time, the user 2 initiates a login request by using a user account, performs a session processing step in fig. 2, creates http session2 and token2 user identities, and empties the caches a and B by using the encryption information UserMd5 and the application identity appId of the user account:
deleteSessionKey(request,UserMd5,appId);
session.invalidate();
at this time, the caches a and B in the cluster do not exist, so that single-user login control is realized. User 2's login request will create new caches A2[ UserMd5, appId, token2] and B2[ appId, token2, SessionMap2 ].
On this basis, referring to fig. 7, when the user 2 logs in using the user account as well, the cache data A, B is emptied, the user account is forced to be offline at the user 1 client, and the user 2 initiates a request to create new caches a2 and B2, which are created by the user 1 first. Similarly, the user 2 account is forced down when user 1 logs in again using the user account.
Referring to fig. 8, the present application further provides a session control sharing system in a distributed cluster system, where the system includes a client, an application server cluster, and a distributed cache system; the client is used for receiving user account information input by a user and generating a login request according to the user account information; the application server cluster comprises a plurality of service nodes, and each server node is used for carrying out session processing on the login request to generate session cache data and storing the session cache data to a preset distributed cache system; when a login request initiated by the client again 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 a plurality of non-relational data clusters, each non-relational data cluster comprises a main node and a plurality of auxiliary nodes, and each auxiliary node is used for storing the session cache data.
The beneficial technical effect of this application lies in: the Session information stored in the NoSQL distributed cache cluster is used for realizing efficient Session synchronization and sharing among a plurality of application server nodes, and the problems of security of Session data sharing and excessive consumption of system resources in a distributed scene are solved. By storing the session data in the distributed cache cluster, a safe and flexible single-user login mechanism is realized, and the problem of performance bottleneck of realizing the single-user login mechanism by using a database is solved.
The application also provides an electronic device, which comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor executes the computer program to realize the method.
The present application also provides a computer-readable storage medium storing a computer program for executing the above method.
As shown in fig. 9, the electronic device 600 may further include: communication module 110, input unit 120, audio processing unit 130, display 160, power supply 170. It is noted that the electronic device 600 does not necessarily include all of the components shown in FIG. 9; furthermore, the electronic device 600 may also comprise components not shown in fig. 9, which may be referred to in the prior art.
As shown in fig. 9, the central processor 100, sometimes referred to as a controller or operational control, may include a microprocessor or other processor device and/or logic device, the central processor 100 receiving input and controlling the operation of the various components of the electronic device 600.
The memory 140 may be, for example, one or more of a buffer, a flash memory, a hard drive, a removable media, a volatile memory, a non-volatile memory, or other suitable device. The information relating to the failure may be stored, and a program for executing the information may be stored. And the central processing unit 100 may execute the program stored in the memory 140 to realize information storage or processing, etc.
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 an object to be displayed, such as an image or a character. The display may be, for example, an LCD display, but is not limited thereto.
The memory 140 may be a solid state memory such as Read Only Memory (ROM), Random Access Memory (RAM), a SIM card, or the like. There may also be a memory that holds information even when power is off, can be selectively erased, and is provided with more data, an example of which is sometimes called an EPROM or the like. The memory 140 may also be some other type of device. Memory 140 includes buffer memory 141 (sometimes referred to as a buffer). The memory 140 may include an application/function storage section 142, and the application/function storage section 142 is used to store application programs and function programs or a flow for executing the operation of the electronic device 600 by the central processing unit 100.
The memory 140 may also include a data store 143, the data store 143 for storing data, such as contacts, digital data, pictures, sounds, and/or any other data used by the electronic device. The driver storage portion 144 of the memory 140 may include various drivers of the electronic device for communication functions and/or for performing other functions of the electronic device (e.g., messaging application, address book application, etc.).
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 an input signal and receive an output signal, which may be the same as in the case of a conventional mobile communication terminal.
Based on different communication technologies, a plurality of communication modules 110, such as a cellular network module, a bluetooth module, and/or a wireless local area network module, may be provided in the same electronic device. The communication module (transmitter/receiver) 110 is also coupled to a speaker 131 and a microphone 132 via an audio processor 130 to provide audio output via the speaker 131 and receive audio input from the microphone 132 to implement general telecommunications functions. Audio processor 130 may include any suitable buffers, decoders, amplifiers and so forth. In addition, an audio processor 130 is also coupled to the central processor 100, so that recording on the local can be enabled through a microphone 132, and so that sound stored on the local can be played through a speaker 131.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The above-mentioned embodiments are provided to further explain the objects, technical solutions and advantages of the present application in detail, and it should be understood that the above-mentioned embodiments are only examples of the present application and are not intended to limit the scope of the present application, and any modifications, equivalents, improvements and the like made within the spirit and principle of the present application should be included in the scope of the present application.

Claims (11)

1. A method for sharing session control in a distributed cluster system, which is applicable to an application server cluster comprising a plurality of service nodes, the method comprising:
obtaining a login request generated by a client according to user account information through a first service node in the application server cluster, carrying out session processing on the login request to generate session cache data, and storing the session cache data to a preset distributed cache system;
when a second service node in the application server cluster intercepts a login request initiated again by a client, obtaining the session cache data in the distributed cache system according to the login request;
and processing the subsequent request processing logic provided by the client according to the session cache data.
2. The method of claim 1, wherein performing session processing on the login request to generate session cache data further comprises:
obtaining user account information according to the login request, and performing authority verification on the user account information through preset authority information;
generating encrypted object data and a user identity through the user account information according to a verification result;
constructing session cache data according to the encrypted object data and the user identity data; and generating a login success status code according to the session cache data, and feeding back the login success status code to the client.
3. The method of claim 2, wherein constructing session cache data according to the encrypted object data and the user identification data further comprises:
generating cookie data according to the user identity data;
and feeding back the cookie data to the client for storage along with the login success status code.
4. The method according to claim 3, wherein storing the session cache data in a predetermined distributed cache system further comprises:
and setting the failure duration of the session cache data stored in the distributed cache system according to a preset period parameter.
5. The method according to claim 4, wherein obtaining the session cache data in the distributed cache system according to the login request comprises:
acquiring cookie data uploaded by a client according to the login request, and acquiring corresponding session cache data in the distributed cache system according to the cookie data;
and updating the invalidation duration of the session cache data stored in the distributed cache system according to the obtained session cache data.
6. The method according to claim 1, wherein processing the request processing logic subsequently provided by the client according to the session cache data further comprises: and emptying the session cache data cached by the first service node.
7. The method of claim 1, further comprising, before the step of sharing session control information in the distributed cluster system: a main node and a plurality of auxiliary nodes form a non-relational data cluster, and a distributed cache system is formed according to the non-relational data clusters; and each service node in the application server cluster is in communication connection with the auxiliary node.
8. The method according to claim 7, wherein storing the session cache data in a predetermined distributed cache system comprises:
after any auxiliary node in the distributed cache system receives the session cache data, the session cache data are synchronized to all auxiliary nodes in the distributed cache system.
9. A session control sharing system in a distributed cluster system is characterized by comprising a client, an application server cluster and a distributed cache system;
the client is used for receiving user account information input by a user and generating a login request according to the user account information;
the application server cluster comprises a plurality of service nodes, each server node is used for carrying out session processing on the login request to generate session cache data, and the session cache data are stored in a preset distributed cache system; when a login request initiated by the client again 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 a plurality of non-relational data clusters, each non-relational data cluster comprises a main node and a plurality of auxiliary nodes, and each auxiliary node is used for storing the session cache data.
10. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method of any of claims 1 to 8 when executing the computer program.
11. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program for executing the method of any one of claims 1 to 8 by a computer.
CN202210425629.5A 2022-04-22 2022-04-22 Session control sharing method and system in distributed cluster system Pending CN114979234A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210425629.5A CN114979234A (en) 2022-04-22 2022-04-22 Session control sharing method and system in distributed cluster system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210425629.5A CN114979234A (en) 2022-04-22 2022-04-22 Session control sharing method and system in distributed cluster system

Publications (1)

Publication Number Publication Date
CN114979234A true CN114979234A (en) 2022-08-30

Family

ID=82978866

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210425629.5A Pending CN114979234A (en) 2022-04-22 2022-04-22 Session control sharing method and system in distributed cluster system

Country Status (1)

Country Link
CN (1) CN114979234A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116860862A (en) * 2023-09-05 2023-10-10 北京百特云享科技有限公司 Front-end caching method of low-code platform and related equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106603713A (en) * 2016-12-29 2017-04-26 深圳Tcl新技术有限公司 Session management method and system
CN107483418A (en) * 2017-07-27 2017-12-15 阿里巴巴集团控股有限公司 Login process method, method for processing business, device and server
WO2018036314A1 (en) * 2016-08-22 2018-03-01 中兴通讯股份有限公司 Single-sign-on authentication method and apparatus, and storage medium
CN109547512A (en) * 2017-09-22 2019-03-29 中国移动通信集团浙江有限公司 A kind of method and device of the distributed Session management based on NoSQL
CN111382142A (en) * 2020-03-04 2020-07-07 海南金盘智能科技股份有限公司 Database operation method, server and computer storage medium
CN111464534A (en) * 2020-03-31 2020-07-28 深圳市思迪信息技术股份有限公司 Session keeping method and device in distributed system

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018036314A1 (en) * 2016-08-22 2018-03-01 中兴通讯股份有限公司 Single-sign-on authentication method and apparatus, and storage medium
CN107770140A (en) * 2016-08-22 2018-03-06 南京中兴软件有限责任公司 A kind of single sign-on authentication method and device
CN106603713A (en) * 2016-12-29 2017-04-26 深圳Tcl新技术有限公司 Session management method and system
CN107483418A (en) * 2017-07-27 2017-12-15 阿里巴巴集团控股有限公司 Login process method, method for processing business, device and server
CN109547512A (en) * 2017-09-22 2019-03-29 中国移动通信集团浙江有限公司 A kind of method and device of the distributed Session management based on NoSQL
CN111382142A (en) * 2020-03-04 2020-07-07 海南金盘智能科技股份有限公司 Database operation method, server and computer storage medium
CN111464534A (en) * 2020-03-31 2020-07-28 深圳市思迪信息技术股份有限公司 Session keeping method and device in distributed system

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116860862A (en) * 2023-09-05 2023-10-10 北京百特云享科技有限公司 Front-end caching method of low-code platform and related equipment
CN116860862B (en) * 2023-09-05 2023-12-08 北京百特云享科技有限公司 Front-end caching method of low-code platform and related equipment
CN116860862B8 (en) * 2023-09-05 2023-12-26 北京百特云享科技有限公司 Front-end caching method of low-code platform and related equipment

Similar Documents

Publication Publication Date Title
CN111555893B (en) Message data transmission method, device, computer equipment and storage medium
CN110278187B (en) Multi-terminal single sign-on method, system, synchronous server and medium
CN110888858B (en) Database operation method and device, storage medium and electronic device
EP2852093B1 (en) Method, system, and device for sharing documents
CN111770172A (en) Message middleware consumption proxy method, device, proxy server and storage medium
CN112612985A (en) Websocket-based multi-user and multi-type message pushing system and method
CN107197036A (en) A kind of consistent processing method of information based on block chain and terminal
CN111786812A (en) Node management method, node management device, computer equipment and storage medium
CN113391823A (en) Gray scale publishing method, device and system
CN112291364A (en) Message pushing processing method and device
CN108874947B (en) Data processing system and data processing method
CN108289074A (en) User account login method and device
CN111666589A (en) Block chain distributed risk data sharing system and method
CN114979234A (en) Session control sharing method and system in distributed cluster system
CN112766998A (en) Data processing method and device for business activities
CN114844663A (en) Desktop sharing method, system, storage medium and equipment
CN112929257B (en) Multi-scene message sending method, device, server and storage medium
CN111090818B (en) Resource management method, resource management system, server and computer storage medium
US20230111782A1 (en) Request processing method based on consortium blockchain, device, and storage medium
CN109104472B (en) Block chain network networking method, device, equipment and computer readable storage medium
CN110063089B (en) Computing system, method and storage medium for transmitting content
CN113300848B (en) Method and device for determining certificate state
US11226983B2 (en) Sub-scope synchronization
CN109302446B (en) Cross-platform access method and device, electronic equipment and storage medium
CN111885148B (en) Session synchronization method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination