Summary of the invention
The invention provides a kind of persistence service implementing method and persistence service system, solving when server is delayed machine, upgrading or cutover, the problem of the conversation that causes because of the interruption current service.
The invention provides a kind of persistence service system, this system comprises user subsystem, application service cluster subsystem and concentrated session management subsystem, and described application service cluster subsystem comprises a plurality of application servers, wherein:
Described user subsystem is used to initiate the application service request;
Described application service cluster subsystem, be used for application service request scheduling application server according to described user subsystem initiation, and obtain session information from described concentrated session management subsystem by the application server that is dispatched to, for described user subsystem provides conversational services;
Described concentrated session management subsystem is used to the application server that is dispatched in the described application service cluster subsystem that session information is provided.
Preferably, described application service cluster subsystem also is used for setting up session according to described application service request, and the session information of setting up is sent to described concentrated session management subsystem, comprises session term of validity information in the described session information;
Described concentrated session management subsystem also is used to manage the session information that described application service cluster subsystem is set up.
Preferably, described application service cluster subsystem also comprises dispatching management module;
Described dispatching management module is used for the running status by monitoring all application servers and the session of current service, the dispatch application server.
Preferably, described user subsystem also is used to obtain the application version information that described application service request need be used, and increases described application version information in described application service request;
Described dispatching management module also is used for by the running status of monitoring all application servers, the session of current service and the application version information of deployment, dispatch application server.
Preferably, described dispatching management module, be be used for monitoring current scheduling to the application version information of application server deployment and application version information that described application service request comprises when not matching, according to current scheduling to the application service request of the application version information that carries recommendation transmitted of application server reschedule and answer server.
Preferably, described dispatching management module is when being used to monitor the current application server that conversational services is being provided and interrupting, and dispatches new application server and provides service for current sessions.
Preferably, described application service cluster subsystem also is used to described user subsystem to provide after the conversational services, sends the conversation end request to described concentrated session management subsystem;
Described concentrated session management subsystem also is used for according to described conversation end request or described session term of validity information deletion session information.
The present invention also provides a kind of persistence service implementing method, be applied to comprise the persistence service system of user subsystem, application service cluster subsystem and concentrated session management subsystem, it is characterized in that, described application service cluster subsystem comprises a plurality of application servers, and this method comprises:
Described user subsystem is initiated the application service request;
The application service request scheduling application server that described application service cluster subsystem is initiated according to described user subsystem, and obtain session information from described concentrated session management subsystem by the application server that is dispatched to, for described user subsystem provides conversational services.
Preferably, described obtain session information by the application server that is dispatched to from described concentrated session management subsystem before, described method also comprises:
Set up session according to described application service request, and the session information of setting up is sent to described concentrated session management subsystem, comprise session term of validity information in the described session information.
Preferably, described application service cluster subsystem also comprises dispatching management module;
The application service request scheduling application server that described application service cluster subsystem is initiated according to described user subsystem comprises:
Described dispatching management module is by the running status of all application servers of monitoring and the session of current service, dispatch application server.
Preferably, include the application version information that described application service request need be used in the described application service request;
Described method also comprises: described dispatching management module is by running status, the session of current service and the application version information of deployment of all application servers of monitoring, dispatch application server.
Preferably, described dispatching management module is by running status, the session of current service and the application version information of deployment of all application servers of monitoring, and the dispatch application server comprises:
Described dispatching management module monitor current scheduling to the application version information of application server deployment and described application service request in the application version information that comprises when not matching, according to current scheduling to the application service request of the application version information that carries recommendation transmitted of application server reschedule and answer server.
Preferably, described dispatching management module is by the running status of all application servers of monitoring and the session of current service, and the dispatch application server comprises:
Described dispatching management module monitors the current application server that conversational services is being provided when interrupting, and dispatches new application server and provides service for current sessions.
Preferably, described application service cluster subsystem provides after the conversational services for described user subsystem, and described method also comprises:
Described application service cluster subsystem sends the conversation end request to described concentrated session management subsystem;
Described concentrated session management subsystem is according to described conversation end request or described session term of validity information deletion session information.
Above-mentioned persistence service implementing method and persistence service system, by session is separated with service, session is managed concentratedly, keep the ill-mannered state property of service, solved when server is delayed machine, upgrading or dilatation, needed to interrupt the conversation problem that current service causes.
Embodiment
For making the purpose, technical solutions and advantages of the present invention clearer, hereinafter will be elaborated to embodiments of the invention in conjunction with the accompanying drawings.Need to prove that under the situation of not conflicting, embodiment among the application and the feature among the embodiment be combination in any mutually.
The invention provides a kind of persistence service system, this system comprises user subsystem, application service cluster subsystem and concentrated session management subsystem, and described application service cluster subsystem comprises a plurality of application servers, wherein:
Described user subsystem is used to initiate the application service request;
Described application service cluster subsystem, be used for application service request scheduling application server according to described user subsystem initiation, and obtain session information from described concentrated session management subsystem by the application server that is dispatched to, for described user subsystem provides conversational services;
Described concentrated session management subsystem is used to the application server that is dispatched in the described application service cluster subsystem that session information is provided.
Wherein, described application service cluster subsystem also is used for setting up session according to described application service request, and the session information of setting up is sent to described concentrated session management subsystem, comprises session term of validity information in the described session information; Described concentrated session management subsystem also is used to manage the session information that described application service cluster subsystem is set up.
Particularly, described application service cluster subsystem also comprises dispatching management module; Described dispatching management module is used for the running status by monitoring all application servers and the session of current service, the dispatch application server.
In addition, in order to solve the scheduling between a plurality of versions of current sessions and subsequent session, also comprise the application version information that the application service request need be used in the above-mentioned application service request, described dispatching management module is by running status, the session of current service and the application version information of deployment of all application servers of monitoring, dispatch application server; When monitor current scheduling to the application version information of application server deployment and described application service request in the application version information that comprises when not matching, according to current scheduling to the application service request of the application version information that carries recommendation transmitted of application server reschedule and answer server.
As shown in Figure 1, be the structural representation of persistence service system embodiment of the present invention, this system comprises user subsystem 11, application service cluster subsystem 12 and concentrated session management subsystem 13, wherein:
User subsystem is responsible for obtaining subscription client information, comprises client and application version information.And in the application service request message, increase client and application version information, set up conversational services.
Application service cluster subsystem by the state of monitoring all application server operations in the described application service cluster subsystem, the session of current service, the information such as application version of deployment, carries out unified scheduling to user's application service request.The application server of described application service cluster subsystem provides conversational services according to the result of dispatching management module scheduling for the user.
Concentrate session management subsystem, be responsible for the centralized management of user conversation, comprise the life cycle management of session, provide session data etc. for the application server of described application service cluster subsystem.
Said system, by session is separated with service, session is managed concentratedly, realize the ill-mannered state property of service, forming one can provide the cutover of free of discontinuities online upgrading, Single Point of Faliure not to interrupt session, the compatible persistence service system of many versions.
The above-mentioned persistence service system of user subsystem, application service cluster subsystem and concentrated session management subsystem that comprises realizes that the persistence service method comprises:
Step 1, described user subsystem are responsible for obtaining client and application version information, initiate the request and the response of handling application service of application service;
User subsystem is obtained client and applied version information, and increases this client and application version information in the application service request.
Client comprises B/S (Browser/Server) client and C/S (Client/Server) client, and the C/S client comprises version information, and the B/S client does not comprise version information.
User subsystem increases client and application version information in request message when the request application service.For the B/S client, have only client-side information in the request message, there is not application version information, this moment, acquiescence provided conversational services according to the more recent application version; For the C/S client, comprise client-side information, application version information in the request message.
The scheduling and the conversational services of step 2, described application service cluster subsystem responsible application server;
Described application service cluster subsystem application server is dispatched; Application server provides conversational services according to unified scheduling result.
Described application service cluster subsystem comprises dispatching management module, this module is responsible for the monitoring of all application server states in the described application service cluster subsystem, the information of monitoring comprises the state of application server operation, the session of current service, the application version of deployment etc., and carries out unified scheduling according to the result of monitoring.Especially, when certain application server service disruption of described application service cluster subsystem, dispatching management module can be dispatched to new application server and provide service for current sessions, does not interrupt to guarantee session.
Described application service cluster subsystem comprises a plurality of application servers, and application server provides conversational services according to the result of dispatching management module scheduling for the user, and application server comprises the application version information of this server disposition and the application version information of recommendation.Under the default situations, application server directly provides conversational services for the user, if the application version of this application server deployment and user's session does not match, then transmit this user conversation request to dispatching management module, and the application version information of in transmitting message, adding its recommendation, dispatch processing by dispatching management module once more according to transmitting message.
Step 3, described concentrated session management subsystem are responsible for the centralized management of user conversation.
Described concentrated session management subsystem is managed the session that application server in the described application service cluster subsystem produces concentratedly.
Comprise information such as applied version, the term of validity in the session, do not comprise the information of application server, guarantee the ill-mannered state property of service, so that all application servers can use these sessions.For example session 1 is produced by application server 1, this moment delay machine or do upgrade maintenance of application server 1, application server 1 no longer provides service, but session 1 still is kept in the described concentrated session management subsystem, after described dispatching management module monitors the state of application server 1 operation, dispatch application server 2 directly uses the data of session 1 in the described concentrated session management subsystem by application server 2, so just can keep the continuity of session 1.Because session is created by application server, therefore, the application version that session comprises is meant the application version of disposing in the application server.
Described concentrated session management subsystem is responsible for the life cycle management of session, comprises foundation, the deletion of session.The foundation of session is initiated by the application server of described application service cluster subsystem, and the deletion of session can initiatively be deleted according to described application service cluster subsystem application server session ending request, also can delete automatically according to the term of validity of session.
Described concentrated session management subsystem is responsible for the inquiry of session, owing to do not comprise Application Server information in the session, can be used by all application servers in the described application service cluster subsystem.
Also comprise between described step 2 and the step 3: the application server in the described application service cluster subsystem, when the session of receiving the user for the first time begins to ask, create user conversation and session is sent to described concentrated session management subsystem managing, this application server is not preserved session information.
If user's session exists, application server in the described application service cluster subsystem, after the message of receiving the dispatching management module scheduling, directly from described concentrated session management subsystem, obtain session information, and provide service for the user according to session information.
Application server in the described application service cluster subsystem notifies described concentrated session management subsystem to delete this session information when the user conversation normal termination.
Persistence service implementation method provided by the invention, by session is separated with service, session is managed concentratedly, the ill-mannered state property that keeps service, solve when server is delayed machine, upgrading or cutover, problems such as conversation that needs interruption current service causes and the parallel service dispatch difficulty of many versions have realized providing the cutover of free of discontinuities online upgrading, Single Point of Faliure not to interrupt session, the compatible persistence service of many versions.
The present invention also provides a kind of persistence service implementing method, be applied to comprise the persistence service system of user subsystem, application service cluster subsystem and concentrated session management subsystem, described application service cluster subsystem comprises a plurality of application servers, and this method comprises:
Described user subsystem is initiated the application service request;
The application service request scheduling application server that described application service cluster subsystem is initiated according to described user subsystem, and obtain session information from described concentrated session management subsystem by the application server that is dispatched to, for described user subsystem provides conversational services.
Wherein, can comprise the application version information of client in the above-mentioned application service request,, help solving the problem of incompatible version, and unremitting service can be provided by in the application service request, increasing the application version information of client.
As shown in Figure 2, be the schematic flow sheet of persistence service implementation method embodiment of the present invention, this method comprises:
Step 201, obtain client and applied version information, initiate the application service request;
For the B/S client, have only client-side information in the request, there is not application version information, for the C/S client, comprise client-side information and application version information in the request;
Step 202, application service cluster subsystem are dispatched, and for the application service request that does not have application version information, acquiescence provides service according to up-to-date application version, and application server provides conversational services according to unified scheduling result;
Especially, this step has following two kinds of situations:
(1), when step 2021a, application service cluster subsystem are providing the application server of conversational services to interrupt (machine, upgrade maintenance etc. for example cut off the power supply, delay), causes the service disruption on this application server; The dispatching management module of step 2021b, application service cluster subsystem monitors the state of this server, and dispatches new application server and provide service for current sessions, does not interrupt to guarantee session, and detailed process as shown in Figure 3.
(2), the application server of step 2022a, application service cluster subsystem 102 when handling the application service request of this application server according to scheduling result, find that the version of this request and its application service does not match; Step 2022b, transmit this user conversation request to dispatching management module, and add the application version information of its recommendation in transmitting message, dispatch processing by dispatching management module once more according to transmitting message, detailed process as shown in Figure 4.
Step 203, application service cluster subsystem judge whether set up session according to the application service request;
For user's the conversation request first time, there is not session information in the system, for the request of the lasting application service that causes owing to reasons such as application server interruption, application server version do not match, concentrate in the session management subsystem to have had session information.
The application server of step 204, application service cluster subsystem is created user conversation and session is sent to concentrate in the session management subsystem and manages;
This application server is not preserved session information, by concentrated session management subsystem unified management;
The application server of step 205, application service cluster subsystem obtains session information from concentrate session management subsystem, for the user provides uninterrupted conversational services;
Step 206, concentrated session management subsystem are initiatively deleted session data according to application service cluster sub-system conversation ending request, also can delete automatically according to the term of validity of session.
Compare with existing persistence service system, have the following advantages based on the persistent object system of centralized session:
(1) session separates with service, and service possesses ill-mannered state property.The present invention separates session with service, the interruption of application server does not influence session, reschedules and can provide continuous conversational services for the user by load balancing.
(2) support many versions to use parallel service.Existing systems, subscription client, application service end generally all are synchronous upgradings, to guarantee the compatible of version.The present invention increases application version information at subscription client, application server, and the unified scheduling by dispatching management module realizes the parallel service of a plurality of versions.Especially, application server also comprises the application version information of recommendation, when the version of user's session and this application server does not match, this application server can be according to the application version information of recommending, user's application service request is transmitted to load balancing module, reschedule by the latter, so just can provide unremitting persistence service for the user.
This shows that the present invention adopts the persistence method of servicing based on centralized session, realized that a session separates, serves ill-mannered state property with service, many versions are used the persistent object system of parallel service.
One of ordinary skill in the art will appreciate that all or part of step in the said method can instruct related hardware to finish by program, said procedure can be stored in the computer-readable recording medium, as read-only memory, disk or CD etc.Alternatively, all or part of step of the foregoing description also can use one or more integrated circuits to realize.Correspondingly, each the module/unit in the foregoing description can adopt the form of hardware to realize, also can adopt the form of software function module to realize.The present invention is not restricted to the combination of the hardware and software of any particular form.
Above embodiment is only unrestricted in order to technical scheme of the present invention to be described, only with reference to preferred embodiment the present invention is had been described in detail.Those of ordinary skill in the art should be appreciated that and can make amendment or be equal to replacement technical scheme of the present invention, and do not break away from the spirit and scope of technical solution of the present invention, all should be encompassed in the middle of the claim scope of the present invention.