CN110891247B - Method, system, equipment and medium for client stateless access cluster - Google Patents

Method, system, equipment and medium for client stateless access cluster Download PDF

Info

Publication number
CN110891247B
CN110891247B CN201911011293.2A CN201911011293A CN110891247B CN 110891247 B CN110891247 B CN 110891247B CN 201911011293 A CN201911011293 A CN 201911011293A CN 110891247 B CN110891247 B CN 110891247B
Authority
CN
China
Prior art keywords
session
access
client
server
overtime
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.)
Active
Application number
CN201911011293.2A
Other languages
Chinese (zh)
Other versions
CN110891247A (en
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.)
Fujian Xingwang Wisdom Software Co ltd
Original Assignee
Fujian Xingwang Wisdom Software Co ltd
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 Fujian Xingwang Wisdom Software Co ltd filed Critical Fujian Xingwang Wisdom Software Co ltd
Priority to CN201911011293.2A priority Critical patent/CN110891247B/en
Publication of CN110891247A publication Critical patent/CN110891247A/en
Application granted granted Critical
Publication of CN110891247B publication Critical patent/CN110891247B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/06Selective distribution of broadcast services, e.g. multimedia broadcast multicast service [MBMS]; Services to user groups; One-way selective calling services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W24/00Supervisory, monitoring or testing arrangements
    • H04W24/02Arrangements for optimising operational condition
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W28/00Network traffic management; Network resource management
    • H04W28/02Traffic management, e.g. flow control or congestion control
    • H04W28/08Load balancing or load distribution

Landscapes

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

Abstract

The invention provides a method, a system, equipment and a medium for stateless cluster access of a client, wherein the method comprises the following steps: and (3) server registration process: receiving registration of all servers capable of executing access or session overtime tasks in the cluster system through a task allocation service to obtain an access execution server or a session overtime execution server; and (3) access allocation process: when receiving a client access request, randomly selecting one access execution server for processing an access request task of the client by the task allocation service; after the access is successful, the session data is stored in a redis cache server; session timeout process assignment procedure: and randomly selecting one session overtime execution server through the task allocation service to perform session overtime processing on the session data of the redis cache server. The invention can fully utilize the idle resources of the cluster and effectively improve the performance and reliability of the cluster.

Description

Method, system, equipment and medium for client stateless access cluster
Technical Field
The invention relates to a method, a system, equipment and a medium for accessing a client to a cluster.
Background
The trunking communication system is a mobile communication system for group dispatching and commanding communication, and is mainly applied to the field of professional mobile communication. The system has available channels shared by all users of the system, has the function of automatically selecting channels, and is a multipurpose and high-efficiency wireless dispatching communication system for sharing resources, sharing cost, sharing channel equipment and services. Clustering is a popular communication technology at present, and can obtain gains of performance, reliability, scalability and the like under the condition of low cost, so that the clustering is widely applied.
In general, a client needs to access a cluster system to invoke a service of the cluster system first, and then can invoke other services of the cluster system after the access is successful. The client accesses the cluster system, and the general implementation scheme in the market is to access the cluster system in a state mode. What is stateful access? Such as: when the client A is accessed into the cluster system, the specific server A in the cluster system processes the access request of the client A, after the access is successful, the server A is bound with the client A, and the subsequent request interaction of the client A is completed by the server A. Because the access of the client A is successful, the session data of the client is stored in the server A, the session heartbeat processing of the client A is also completed by the server A, and the server B and the server C cannot intervene in the processing of the request of the client A, namely, the request with the state is accessed and the request with the state.
Obviously, the stateful access causes resource waste of other servers, the performance of the whole cluster system cannot be improved, the concurrency of the cluster system cannot be improved, and the reliability is greatly reduced. Moreover, after the access is successful, the stateful access generally generates client session data, how to trigger the determination of the expiration of the client session data? At present, a common method in the market is that a specific server in a cluster system traverses client session data which is in charge of the specific server, so that a judgment method cannot be triggered once the specific server is down, and other idle servers cannot intervene to judge whether the client session data is expired or not, because the client session data is only on the specific server. This way of stateful access to the clustered system has significant drawbacks.
Disclosure of Invention
The technical problem to be solved by the present invention is to provide a method, a system, a device and a medium for stateless access of a client to a cluster, which can effectively solve the problems of resource waste, performance failure to improve, reliability reduction, scalability reduction, and failure to trigger a method for determining the expiration of client session data due to the crash of a specific execution server in a cluster system when the client has stateful access to the cluster system.
The method of the invention is realized as follows: a method for stateless access of a client to a cluster, comprising:
and (3) server registration process: receiving registration of all servers capable of executing access or session overtime tasks in the cluster system through a task allocation service to obtain an access execution server or a session overtime execution server;
and (3) access allocation process: when receiving a client access request, randomly selecting one access execution server for processing an access request task of the client by the task allocation service; after the access of the client is successful, the session data of the client is stored in a redis cache server;
session timeout process assignment procedure: after the session data of the client is cached successfully, one session overtime execution server is randomly selected by the task allocation service to access the redis cache server so as to perform session overtime processing on the session data of the client.
The system of the invention is realized as follows: a system for stateless access of a client to a cluster, comprising:
a server registration module: the system comprises a cluster system, a server and a session overtime execution server, wherein the cluster system is used for receiving the registration of all servers capable of executing access or session overtime tasks in the cluster system and obtaining the access execution server or the session overtime execution server;
an access allocation module: the access execution server is used for randomly selecting one access execution server for processing an access request task of the client when receiving an access request of the client; after the access of the client is successful, the session data of the client is stored in a redis cache server;
a session timeout processing assignment module: after the session data of the client is cached successfully, one session overtime execution server is randomly selected to access the redis cache server, so that session overtime processing is performed on the session data of the client.
The device of the invention is realized as follows: a computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor when executing the program implementing the process of:
and (3) server registration process: receiving registration of all servers capable of executing access or session overtime tasks in the cluster system through a task allocation service to obtain an access execution server or a session overtime execution server;
and (3) access allocation process: when receiving a client access request, randomly selecting one access execution server for processing an access request task of the client by the task allocation service; after the access of the client is successful, the session data of the client is stored in a redis cache server;
session timeout process assignment procedure: after the session data of the client is cached successfully, one session overtime execution server is randomly selected by the task allocation service to access the redis cache server so as to perform session overtime processing on the session data of the client.
The medium of the invention is realized by the following steps: a computer-readable storage medium, on which a computer program is stored which, when executed by a processor, carries out the process of:
and (3) server registration process: receiving registration of all servers capable of executing access or session overtime tasks in the cluster system through a task allocation service to obtain an access execution server or a session overtime execution server;
and (3) access allocation process: when receiving a client access request, randomly selecting one access execution server for processing an access request task of the client by the task allocation service; after the access of the client is successful, the session data of the client is stored in a redis cache server;
session timeout process assignment procedure: after the session data of the client is cached successfully, one session overtime execution server is randomly selected by the task allocation service to access the redis cache server so as to perform session overtime processing on the session data of the client.
The invention has the following advantages:
1. the invention can reasonably distribute the client access task and the session overtime task through the task distribution service by developing the task distribution service in the cluster system, so that the resources of the idle server can be fully utilized, and the overall cluster system performance and reliability are improved.
2. The invention sets a special redis cache server to store the session data of the client for all the session overtime execution servers to access the session data of the client, so that the access execution servers or the session overtime execution servers can be completely separated without being bound with specific clients, and the execution of tasks can not be influenced even if a certain server is down.
Drawings
The invention will be further described with reference to the following examples with reference to the accompanying drawings.
FIG. 1 is a flow chart of the method of the present invention.
FIG. 2 is a block diagram of the system of the present invention.
FIG. 3 is a block diagram illustrating a task allocation service process implemented in an exemplary application scenario of the present invention
Fig. 4 is a schematic diagram of an architecture of an exemplary application scenario for implementing allocation of an access request.
Fig. 5 is a schematic diagram illustrating an architecture of a session data timeout process of a distribution client according to an exemplary embodiment of the present invention.
Detailed Description
Referring to fig. 1, the method for stateless accessing to a cluster by a client according to the present invention includes:
and (3) server registration process: receiving registration of all servers capable of executing access or session overtime tasks in the cluster system through a task allocation service to obtain an access execution server or a session overtime execution server;
and (3) access allocation process: when receiving a client access request, randomly selecting one access execution server for processing an access request task of the client by the task allocation service; after the access of the client is successful, the session data of the client is stored in a redis cache server;
session timeout process assignment procedure: after the session data of the client is cached successfully, one session overtime execution server is randomly selected by the task allocation service to access the redis cache server so as to perform session overtime processing on the session data of the client.
The method can also comprise the following steps:
and (3) disconnecting the session process: and after the session timeout executor processes the timeout data, disconnecting the session between the client and the cluster system.
Based on the above method, the present invention further provides a system for stateless access to a cluster by a client, as shown in fig. 2, the system is a task allocation service, and the system includes:
a server registration module: the system comprises a cluster system, a server and a session overtime execution server, wherein the cluster system is used for receiving the registration of all servers capable of executing access or session overtime tasks in the cluster system and obtaining the access execution server or the session overtime execution server;
an access allocation module: the access execution server is used for randomly selecting one access execution server for processing an access request task of the client when receiving an access request of the client; after the access of the client is successful, the session data of the client is stored in a redis cache server;
a session timeout processing assignment module: after the session data of the client is cached successfully, one session overtime execution server is randomly selected to access the redis cache server, so that session overtime processing is performed on the session data of the client.
Further comprising:
a disconnection session module: and the session timeout executor is used for disconnecting the session between the client and the cluster system after the session timeout executor processes the timeout data.
Based on the foregoing method, the present invention further provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor executes the computer program to implement the following processes:
and (3) server registration process: receiving registration of all servers capable of executing access or session overtime tasks in the cluster system through a task allocation service to obtain an access execution server or a session overtime execution server;
and (3) access allocation process: when receiving a client access request, randomly selecting one access execution server for processing an access request task of the client by the task allocation service; after the access of the client is successful, the session data of the client is stored in a redis cache server;
session timeout process assignment procedure: after the session data of the client is cached successfully, one session overtime execution server is randomly selected by the task allocation service to access the redis cache server so as to perform session overtime processing on the session data of the client.
The method can also comprise the following steps:
and (3) disconnecting the session process: and after the session timeout executor processes the timeout data, disconnecting the session between the client and the cluster system.
Based on the above method, the present invention also provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the following:
and (3) server registration process: receiving registration of all servers capable of executing access or session overtime tasks in the cluster system through a task allocation service to obtain an access execution server or a session overtime execution server;
and (3) access allocation process: when receiving a client access request, randomly selecting one access execution server for processing an access request task of the client by the task allocation service; after the access of the client is successful, the session data of the client is stored in a redis cache server;
session timeout process assignment procedure: after the session data of the client is cached successfully, one session overtime execution server is randomly selected by the task allocation service to access the redis cache server so as to perform session overtime processing on the session data of the client.
The method can also comprise the following steps:
and (3) disconnecting the session process: and after the session timeout executor processes the timeout data, disconnecting the session between the client and the cluster system.
As shown in fig. 3, in a typical application scenario, a cluster system needs to develop a task allocation service, a server for executing a task is called an execution server, and the cluster system has two types of execution servers, an access execution server and a session timeout execution server. The two types of execution servers are registered in the task distribution service along with the startup of the servers, and the interactive protocol of the execution servers and the task distribution service uses an http protocol. The task allocation service is used as the core of the cluster system and needs to undertake the allocation flow of an access request task of an allocation client and the allocation flow of a session overtime processing task, and when the task allocation service receives an access request of the client, one access execution server is randomly selected by the task allocation service to process the access request task of the client; after the session data of the client is cached successfully, one session overtime execution server is randomly selected by the task allocation service to perform session overtime processing on the session data of the client.
As shown in fig. 4, a process of accessing the client to the cluster system is shown, when the client initiates an access request, the client first passes through the task allocation service, the task allocation service randomly selects one access executor, and the access executor starts to process the access process. If the access is successful, the client session data is recorded to a redis cache server.
As shown in fig. 5, a session data timeout processing flow of a task distribution service distribution client is displayed, the task distribution service randomly selects a session timeout executor at regular time, the session timeout executor obtains all client session data from a redis cache server, traverses each client session data, traverses the process and determines whether the session data is expired, and if so, deletes the corresponding client session data. Whether the data of the disconnected session is expired is generally as follows: and according to the current system time, subtracting the latest updating time of the client session, and carrying out overtime processing when the time difference exceeds a certain range after subtracting.
Although specific embodiments of the invention have been described above, it will be understood by those skilled in the art that the specific embodiments described are illustrative only and are not limiting upon the scope of the invention, and that equivalent modifications and variations can be made by those skilled in the art without departing from the spirit of the invention, which is to be limited only by the appended claims.

Claims (8)

1. A method for a client to access a cluster in a stateless manner is characterized in that: the method comprises the following steps:
and (3) server registration process: receiving registration of all servers capable of executing access or session overtime tasks in the cluster system through a task allocation service to obtain an access execution server or a session overtime execution server;
and (3) access allocation process: when receiving a client access request, randomly selecting one access execution server for processing an access request task of the client by the task allocation service; after the access of the client is successful, the session data of the client is stored in a redis cache server;
session timeout process assignment procedure: after the session data of the client is cached successfully, one session overtime execution server is randomly selected by the task allocation service to access the redis cache server so as to perform session overtime processing on the session data of the client.
2. The method of claim 1, wherein the method comprises: further comprising:
and (3) disconnecting the session process: and after the session timeout execution server processes the timeout data, disconnecting the session between the client and the cluster system.
3. A system for stateless access of clients to a cluster, comprising: the method comprises the following steps:
a server registration module: the system comprises a cluster system, a server and a session overtime execution server, wherein the cluster system is used for receiving the registration of all servers capable of executing access or session overtime tasks in the cluster system and obtaining the access execution server or the session overtime execution server;
an access allocation module: the access execution server is used for randomly selecting one access execution server for processing an access request task of the client when receiving an access request of the client; after the access of the client is successful, the session data of the client is stored in a redis cache server;
a session timeout processing assignment module: after the session data of the client is cached successfully, one session overtime execution server is randomly selected to access the redis cache server, so that session overtime processing is performed on the session data of the client.
4. The system of claim 3, wherein: further comprising:
a disconnection session module: and the session timeout executing server is used for disconnecting the session between the client and the cluster system after the session timeout executing server processes the timeout data.
5. A computer device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein: the processor implements the following processes when executing the program:
and (3) server registration process: receiving registration of all servers capable of executing access or session overtime tasks in the cluster system through a task allocation service to obtain an access execution server or a session overtime execution server;
and (3) access allocation process: when receiving a client access request, randomly selecting one access execution server for processing an access request task of the client by the task allocation service; after the access of the client is successful, the session data of the client is stored in a redis cache server;
session timeout process assignment procedure: after the session data of the client is cached successfully, one session overtime execution server is randomly selected by the task allocation service to access the redis cache server so as to perform session overtime processing on the session data of the client.
6. A computer device according to claim 5, wherein: the processor executes the program and further realizes the following processes:
and (3) disconnecting the session process: and after the session timeout execution server processes the timeout data, disconnecting the session between the client and the cluster system.
7. A computer-readable storage medium having stored thereon a computer program, characterized in that: the program when executed by a processor implements the following process:
and (3) server registration process: receiving registration of all servers capable of executing access or session overtime tasks in the cluster system through a task allocation service to obtain an access execution server or a session overtime execution server;
and (3) access allocation process: when receiving a client access request, randomly selecting one access execution server for processing an access request task of the client by the task allocation service; after the access of the client is successful, the session data of the client is stored in a redis cache server;
session timeout process assignment procedure: after the session data of the client is cached successfully, one session overtime execution server is randomly selected by the task allocation service to access the redis cache server so as to perform session overtime processing on the session data of the client.
8. A computer-readable storage medium according to claim 7, wherein: the processor executes the program and further realizes the following processes:
and (3) disconnecting the session process: and after the session timeout execution server processes the timeout data, disconnecting the session between the client and the cluster system.
CN201911011293.2A 2019-10-23 2019-10-23 Method, system, equipment and medium for client stateless access cluster Active CN110891247B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911011293.2A CN110891247B (en) 2019-10-23 2019-10-23 Method, system, equipment and medium for client stateless access cluster

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911011293.2A CN110891247B (en) 2019-10-23 2019-10-23 Method, system, equipment and medium for client stateless access cluster

Publications (2)

Publication Number Publication Date
CN110891247A CN110891247A (en) 2020-03-17
CN110891247B true CN110891247B (en) 2021-11-23

Family

ID=69746401

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911011293.2A Active CN110891247B (en) 2019-10-23 2019-10-23 Method, system, equipment and medium for client stateless access cluster

Country Status (1)

Country Link
CN (1) CN110891247B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104580226A (en) * 2015-01-15 2015-04-29 上海瀚之友信息技术服务有限公司 Session data sharing system and method
CN107317831A (en) * 2016-04-27 2017-11-03 上海炬宏信息技术有限公司 Website access method based on memory database
CN107948017A (en) * 2017-09-30 2018-04-20 用友金融信息技术股份有限公司 Highly available cluster system
CN110012098A (en) * 2019-04-04 2019-07-12 浙江工业大学 A kind of web high concurrent access process system and method

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2979824C (en) * 2015-03-16 2021-04-27 Webtext Holdings Limited Method and system for transferring messages between messaging systems

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104580226A (en) * 2015-01-15 2015-04-29 上海瀚之友信息技术服务有限公司 Session data sharing system and method
CN107317831A (en) * 2016-04-27 2017-11-03 上海炬宏信息技术有限公司 Website access method based on memory database
CN107948017A (en) * 2017-09-30 2018-04-20 用友金融信息技术股份有限公司 Highly available cluster system
CN110012098A (en) * 2019-04-04 2019-07-12 浙江工业大学 A kind of web high concurrent access process system and method

Also Published As

Publication number Publication date
CN110891247A (en) 2020-03-17

Similar Documents

Publication Publication Date Title
WO2018157439A1 (en) Service processing method and device
EP3621269A1 (en) Live broadcast method, system and related device
CN105095022B (en) Data backup method and device
US20160080483A1 (en) Method for setting gateway device identity, and management gateway device
CN110958281B (en) Data transmission method and communication device based on Internet of things
US20180349178A1 (en) A method and system for scalable job processing
CN110633442A (en) Pushing method and device and electronic equipment
CN106897299B (en) Database access method and device
CN113612861B (en) Remote access method, system and computer readable storage medium
CN110677475A (en) Micro-service processing method, device, equipment and storage medium
CN111541555A (en) Group chat optimization method and related product
CN110868323B (en) Bandwidth control method, device, equipment and medium
CN109947081B (en) Internet vehicle control method and device
CN114338769A (en) Access request processing method and device
WO2012000455A1 (en) Client terminal and load balancing method
CN111866544B (en) Data processing method, device, equipment and computer readable storage medium
CN110891247B (en) Method, system, equipment and medium for client stateless access cluster
US11595871B2 (en) Systems and methods for securely sharing context between MEC clusters
CN111930482A (en) Task processing method, device and equipment based on node cluster and storage medium
CN111935651B (en) Cluster service implementation method, device, medium, base station and system
US9479579B2 (en) Grouping processing method and system
CN110798512A (en) Centralized data pushing method, intelligent terminal and storage medium
CN110958240A (en) Message subscription system and method
CN107506491B (en) OSD data distribution method and device of distributed file system
US9124620B2 (en) Establishing a remote session between a receiving station and a sending station

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
GR01 Patent grant
GR01 Patent grant