CN109150936A - The sharing method and device of session object Session in a kind of distributed type assemblies - Google Patents

The sharing method and device of session object Session in a kind of distributed type assemblies Download PDF

Info

Publication number
CN109150936A
CN109150936A CN201710463414.1A CN201710463414A CN109150936A CN 109150936 A CN109150936 A CN 109150936A CN 201710463414 A CN201710463414 A CN 201710463414A CN 109150936 A CN109150936 A CN 109150936A
Authority
CN
China
Prior art keywords
session
session object
server
storage
target
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
CN201710463414.1A
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.)
Beijing Boln Software Ltd By Share Ltd
Original Assignee
Beijing Boln Software Ltd By Share 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 Beijing Boln Software Ltd By Share Ltd filed Critical Beijing Boln Software Ltd By Share Ltd
Priority to CN201710463414.1A priority Critical patent/CN109150936A/en
Publication of CN109150936A publication Critical patent/CN109150936A/en
Pending legal-status Critical Current

Links

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
    • 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
    • H04L67/148Migration or transfer of sessions

Landscapes

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

Abstract

The present invention provides the sharing methods and device of session object Session in a kind of distributed type assemblies.This method comprises: receiving the session object Session search request that application server is sent, session object Session search request includes session object Session identification number;Fragment value is obtained according to session object Session identification number;Target session object Session storage server is determined from session object Session storage server cluster according to fragment value;Session object Session search request is forwarded to target session object Session storage server;Receive the session object Session data corresponding with session object Session identification number that target session object Session storage server is sent;Session object Session data corresponding with session object Session identification number are sent to application server.Application server of the embodiment of the present invention does not store Session data, and the duplication of Session data need not be carried out between application server, improves the performance and horizontal extension ability of distributed system.

Description

Sharing method and device for Session object Session in distributed cluster
Technical Field
The invention relates to the technical field of computers, in particular to a sharing method and device of Session objects in distributed clusters.
Background
In order to improve the data processing efficiency and the data processing reliability, a centralized server is improved, and a distributed cluster data processing architecture is provided. The distributed cluster comprises a plurality of application servers, and the Web server sends a data processing request sent by the client to a specific application server in the distributed cluster for processing according to a load balancing strategy.
The Session object Session represents the process of one-time Session between the server and the client, the Session object Session is stored in the server, and different users are distinguished by Session object identification Session identification numbers for each client. Under the default condition, each application server stores a copy of Session object Session data of the application server, if the request of the user is distributed to another application server next time, the previously created Session object Session cannot be obtained, the user must log in again, and the user experience is poor. In order to implement sharing of Session object sessions in a distributed cluster, Session object sessions in a memory are synchronized among multiple application servers in the prior art, so that Session object sessions are kept consistent and transparent to the outside. If one of the application servers fails, the Web server can search other available application servers and distribute requests according to the principle of load balance, and because Session objects Session among the application servers are synchronized, the Session object Session of the user can be ensured not to be lost.
However, in the process of implementing the embodiment of the present invention, the inventor finds that Session object Session replication in the existing sharing method for Session object sessions in a distributed cluster may reduce performance of a distributed system, and particularly, when a larger object is stored in a Session object Session and the object changes faster, performance reduction is more significant. When the number of the application server instances is increased, the number of times of Session object Session replication and the number of Session object Session data in each application server are increased by multiple, so that the horizontal extension of the distributed system is limited. The content of Session object Session in a specific application server is synchronized to other application servers in a broadcast manner, which may cause a network traffic bottleneck. The application server stores a plurality of Session objects, the memory is increased, the garbage recovery burden is increased, and the performance is seriously reduced.
Disclosure of Invention
The embodiment of the invention provides a sharing method and a sharing device of Session objects in a distributed cluster, which are used for solving the problems of system performance reduction and limited horizontal extension caused by Session object Session replication in the prior art.
The embodiment of the invention provides a sharing method of Session object Session in a distributed cluster, which comprises the following steps:
receiving a Session object Session search request sent by an application server, wherein the Session object Session search request comprises a Session object Session identification number;
acquiring a fragment value according to the Session identification number of the Session object;
determining a target Session object Session storage server from the Session object Session storage server cluster according to the fragmentation value;
forwarding the Session object Session search request to the target Session object Session storage server;
receiving Session object Session data which is sent by the target Session object Session storage server and corresponds to the Session object Session identification number;
and sending the Session object Session data corresponding to the Session object Session identification number to the application server.
Optionally, the obtaining a segment value according to the Session identifier of the Session object includes:
and acquiring a fragment value according to the Session identification number of the Session object by adopting a Hash algorithm.
Optionally, the determining a target Session object Session storage server from the Session object Session storage server cluster according to the fragment value includes:
receiving a fragment value storage server list sent by a registration center server, wherein the fragment value storage server list comprises a corresponding relation between a fragment value and a Session object Session storage server;
and determining a target Session object Session storage server from the Session object Session storage server cluster according to the corresponding relation between the fragment value and the Session object Session storage server.
The embodiment of the invention provides a sharing method of Session object Session in a distributed cluster, which comprises the following steps:
receiving a Session object Session search request sent by a client, wherein the Session object Session search request comprises a Session object Session identification number;
selecting a target Session object Session storage proxy server from a Session object Session storage proxy server cluster;
forwarding the Session object Session search request to the target Session object Session storage proxy server;
and receiving Session object Session data corresponding to the Session object Session identification number returned by the target Session object Session storage proxy server.
Optionally, the method further comprises:
and receiving a target Session object Session storage proxy server cluster list sent by the registration center server.
The embodiment of the invention provides a sharing device of Session object Session in a distributed cluster, which comprises:
a Session object search request receiving unit, configured to receive a Session object Session search request sent by an application server, where the Session object Session search request includes a Session object Session identification number;
a fragment value obtaining unit, configured to obtain a fragment value according to the Session identifier of the Session object;
the target Session object storage server determining unit is used for determining a target Session object Session storage server from the Session object Session storage server cluster according to the fragment value;
a Session object search request forwarding unit, configured to forward the Session object Session search request to the target Session object Session storage server;
a Session object data receiving unit, configured to receive Session object Session data sent by the target Session object Session storage server and corresponding to the Session object Session identification number;
and the Session object data sending unit is used for sending the Session object Session data corresponding to the Session object Session identification number to the application server.
Optionally, the slice value obtaining unit is further configured to:
and acquiring a fragment value according to the Session identification number of the Session object by adopting a Hash algorithm.
Optionally, the target session object storage server determining unit is further configured to:
receiving a fragment value storage server list sent by a registration center server, wherein the fragment value storage server list comprises a corresponding relation between a fragment value and a Session object Session storage server;
and determining a target Session object Session storage server from the Session object Session storage server cluster according to the corresponding relation between the fragment value and the Session object Session storage server.
The embodiment of the invention provides a sharing device of Session object Session in distributed cluster, comprising:
a Session object search request receiving unit, configured to receive a Session object Session search request sent by a client, where the Session object Session search request includes a Session object Session identification number;
the target Session object storage proxy server selecting unit is used for selecting a target Session object Session storage proxy server from the Session object Session storage proxy server cluster;
a Session object search request forwarding unit, configured to forward the Session object Session search request to the target Session object Session storage proxy server;
and the Session object data receiving unit is used for receiving the Session object Session data which is returned by the target Session object Session storage proxy server and corresponds to the Session object Session identification number.
Optionally, the method further comprises:
and the Session object storage proxy server cluster list receiving unit is used for receiving the target Session object Session storage proxy server cluster list sent by the registration center server.
According to the Session sharing method and device for the Session object in the distributed cluster, the application servers do not store Session data, and the Session data do not need to be copied among the application servers, so that compared with the prior art, the occupied memory is smaller, and the garbage recycling performance is improved; the number of application server instances and the service capacity are linearly increased, and the horizontal expansion of a distributed system is facilitated; session data only interacts between the application server and the Session object storage server, which is more beneficial to network flow control and avoids flow bottleneck.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a flowchart illustrating a sharing method of Session object Session in a distributed cluster according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a sharing method of Session object Session in a distributed cluster according to an embodiment of the present invention;
fig. 3 is a flowchart illustrating a Session object Session sharing method in a distributed cluster according to another embodiment of the present invention;
fig. 4 is a schematic structural diagram of a sharing apparatus for Session object Session in a distributed cluster according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a sharing apparatus for Session object Session in a distributed cluster according to another embodiment of the present invention;
FIG. 6 is a block diagram of an electronic device according to an embodiment of the invention;
fig. 7 is a schematic physical structure diagram of an electronic device according to another embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
FIG. 1 is a schematic flow diagram of a method of one embodiment of the present invention. As shown in fig. 1, the method of this embodiment uses a Session object Session storage proxy server as an execution subject, and includes:
s11: receiving a Session object Session search request sent by an application server, wherein the Session object Session search request comprises a Session object Session identification number;
it should be noted that, the application server in the embodiment of the present invention receives a Session object Session search request sent by a client, and sends the Session object Session search request to a Session object Session storage Proxy server (Redis-Proxy).
S12: acquiring a fragment value according to the Session identification number of the Session object;
it should be noted that, in the embodiment of the present invention, the Session object Session storage Proxy server (Redis-Proxy) obtains the fragment value according to the Session object Session identification number in the Session object Session search request. Fragmentation refers to the process of splitting a Session object Session data set into multiple Session object Session storage servers (Redis), each Session object Session storage server (Redis) including a subset of Session data corresponding to each Session identification number.
S13: determining a target Session object Session storage server from the Session object Session storage server cluster according to the fragmentation value;
it should be noted that, in the embodiment of the present invention, the Redis-Proxy obtains the fragmentation value according to the Session identification number, so that the corresponding Redis instance can be located, and the Redis instance does not need to be located by attaching the Redis identification number to the Session identification number.
S14: forwarding the Session object Session search request to the target Session object Session storage server;
it should be noted that, the application server in the embodiment of the present invention no longer accesses the Redis by a direct connection manner, but accesses the Redis instance by the Redis-Proxy; Redis-Proxy supports the same command protocol as Redis, and is transparent to the application server.
For example, Session data is limited to 1024 shards, with 0-511 shards stored to Redis1 and 512-1023 shards stored to Redis 2. And the Redis-Proxy calculates a slicing value according to the Session identification number, and then selects a corresponding Redis instance to read or write Session data. The Session identification number generated by the application server does not need to add information such as a Redis identification number.
S15: receiving Session object Session data which is sent by the target Session object Session storage server and corresponds to the Session object Session identification number;
it should be noted that, in the embodiment of the present invention, the Session storage server as the target Session object sends Session data corresponding to the Session identification number to the Session storage Proxy server (Redis-Proxy).
S16: sending the Session object Session data corresponding to the Session object Session identification number to the application server;
it should be noted that the Session storage Proxy server (Redis-Proxy) receives Session data corresponding to the Session identification number and forwards the Session data to the application server.
According to the Session sharing method for the Session object in the distributed cluster, the application servers do not store Session data, and the Session data does not need to be copied among the application servers, so that compared with the prior art, the memory occupation is smaller, and the garbage recycling performance is improved; the number of application server instances and the service capacity are linearly increased, and the horizontal expansion of a distributed system is facilitated; session data only interacts between the application server and the Session object storage server, which is more beneficial to network flow control and avoids flow bottleneck.
In an optional implementation manner of the embodiment of the present invention, the obtaining a fragment value according to the Session identifier includes:
and acquiring a fragment value according to the Session identification number of the Session object by adopting a Hash algorithm.
Further, the determining a target Session object Session storage server from the Session object Session storage server cluster according to the fragmentation value includes:
receiving a fragment value storage server list sent by a registration center server, wherein the fragment value storage server list comprises a corresponding relation between a fragment value and a Session object Session storage server;
and determining a target Session object Session storage server from the Session object Session storage server cluster according to the corresponding relation between the fragment value and the Session object Session storage server.
It should be noted that, instead of static configuration, the Redis and the Redis-Proxy in the embodiment of the present invention dynamically acquire storage services such as etcd/zookeeper (as shown in fig. 2) of the registry server, so as to easily implement horizontal capacity expansion of the Redis and the Redis-Proxy.
In the embodiment of the invention, in the capacity expansion of the Redis, on one hand, the etcd/zookeeper fragment information needs to be updated, and on the other hand, the original data needs to be migrated to the correct Redis.
Taking fig. 2 as an example, the 0-511 fragments are stored in the instance Redis1, and the 512-1023 fragments are stored in the instance Redis2, at this time, the Redis3 is added, and the equilibrium fragments are realized, and the 341 and 511,512 and 680 fragments are migrated to the Redis3 through the management command. And (3) final fragment layout:
Redis1 Redis2 Redis3
0-340 681-1023 341-680
after the migration is completed [ 341- & gt 680 ], the fragmented data is stored to Redis3, and the subsequent request of the fragmented fragment is forwarded to Redis 3.
In the reduction of Redis in the embodiment of the present invention, contrary to the expansion, as in the above example, the data in segments [ 341- > 680 ] are respectively migrated to Redis1 and Redis2, and finally the Redis3 is removed.
In addition, in the embodiment of the invention, when a master node of Redis goes down, the slave node automatically becomes the master node to provide service.
Fig. 3 is a flowchart illustrating a Session object Session sharing method in a distributed cluster according to another embodiment of the present invention. As shown in fig. 3, the method of the embodiment of the present invention uses an application server as an execution subject, and includes:
s31: receiving a Session object Session search request sent by a client, wherein the Session object Session search request comprises a Session object Session identification number;
s32: selecting a target Session object Session storage proxy server from a Session object Session storage proxy server cluster;
it should be noted that the application server needs to obtain a Redis-Proxy list from storage services such as etcd/zookeeper (as shown in fig. 2) of the registry server, select one Redis-Proxy as a target Session object Session storage Proxy server according to a balancing algorithm or a random algorithm, and send a Redis command to the target Session object Session storage Proxy server.
S33: forwarding the Session object Session search request to the target Session object Session storage proxy server;
s34: and receiving Session object Session data corresponding to the Session object Session identification number returned by the target Session object Session storage proxy server.
According to the Session sharing method for the Session object in the distributed cluster, the application servers do not store Session data, and the Session data does not need to be copied among the application servers, so that compared with the prior art, the memory occupation is smaller, and the garbage recycling performance is improved; the number of application server instances and the service capacity are linearly increased, and the horizontal expansion of a distributed system is facilitated; session data only interacts between the application server and the Session object storage server, which is more beneficial to network flow control and avoids flow bottleneck.
In an optional implementation manner of the embodiment of the present invention, the method further includes:
and receiving a target Session object Session storage proxy server cluster list sent by the registration center server.
Fig. 4 is a schematic structural diagram of a sharing apparatus for Session object Session in a distributed cluster according to an embodiment of the present invention. As shown in fig. 4, the apparatus in the embodiment of the present invention includes a session object search request receiving unit 41, a fragment value obtaining unit 42, a target session object storage server determining unit 43, a session object search request forwarding unit 44, a session object data receiving unit 45, and a session object data sending unit 46, specifically:
a Session object search request receiving unit 41, configured to receive a Session object Session search request sent by an application server, where the Session object Session search request includes a Session object Session identification number;
a fragment value obtaining unit 42, configured to obtain a fragment value according to the Session identifier of the Session object;
a target Session object storage server determining unit 43, configured to determine a target Session object Session storage server from the Session object Session storage server cluster according to the fragmentation value;
a Session object search request forwarding unit 44, configured to forward the Session object Session search request to the target Session object Session storage server;
a Session object data receiving unit 45, configured to receive Session object Session data sent by the target Session object Session storage server and corresponding to the Session object Session identification number;
a Session object data sending unit 46, configured to send the Session object Session data corresponding to the Session object Session identification number to the application server.
According to the sharing device of the Session object Session in the distributed cluster, the application servers do not store Session data, and the Session data does not need to be copied between the application servers, so that compared with the prior art, the sharing device of the Session object Session in the distributed cluster has the advantages that the occupied memory is smaller, and the garbage recycling performance is improved; the number of application server instances and the service capacity are linearly increased, and the horizontal expansion of a distributed system is facilitated; session data only interacts between the application server and the Session object storage server, which is more beneficial to network flow control and avoids flow bottleneck.
In an optional implementation manner of the embodiment of the present invention, the fragment value obtaining unit 42 is further configured to:
and acquiring a fragment value according to the Session identification number of the Session object by adopting a Hash algorithm.
The target session object storage server determining unit 43 is further configured to:
receiving a fragment value storage server list sent by a registration center server, wherein the fragment value storage server list comprises a corresponding relation between a fragment value and a Session object Session storage server;
and determining a target Session object Session storage server from the Session object Session storage server cluster according to the corresponding relation between the fragment value and the Session object Session storage server.
Fig. 5 is a schematic structural diagram of a sharing apparatus for Session object Session in a distributed cluster according to another embodiment of the present invention. As shown in fig. 5, the apparatus of the embodiment of the present invention includes a session object search request receiving unit 51, a target session object storage proxy server selecting unit 52, a session object search request forwarding unit 53, and a session object data receiving unit 54, specifically:
a Session object search request receiving unit 51, configured to receive a Session object Session search request sent by a client, where the Session object Session search request includes a Session object Session identification number;
a target Session object storage proxy server selecting unit 52, configured to select a target Session object storage proxy server from the Session object storage proxy server cluster;
a Session object search request forwarding unit 53, configured to forward the Session object Session search request to the target Session object Session storage proxy server;
and a Session object data receiving unit 54, configured to receive Session object Session data corresponding to the Session object Session identification number and returned by the target Session object Session storage proxy server.
According to the sharing device of the Session object Session in the distributed cluster, the application servers do not store Session data, and the Session data does not need to be copied between the application servers, so that compared with the prior art, the sharing device of the Session object Session in the distributed cluster has the advantages that the occupied memory is smaller, and the garbage recycling performance is improved; the number of application server instances and the service capacity are linearly increased, and the horizontal expansion of a distributed system is facilitated; session data only interacts between the application server and the Session object storage server, which is more beneficial to network flow control and avoids flow bottleneck.
In an optional implementation manner of the embodiment of the present invention, the apparatus further includes:
and the Session object storage proxy server cluster list receiving unit is used for receiving the target Session object Session storage proxy server cluster list sent by the registration center server.
The apparatus of the embodiment of the present invention may be used to implement the above method embodiments, and the principle and technical effect are similar, which are not described herein again.
Fig. 6 is a schematic physical structure diagram of an electronic device according to an embodiment of the present invention.
Referring to fig. 6, the electronic device includes: a first processor (processor)61, a first memory (memory)62, and a first bus 63; wherein,
the first processor 61 and the first memory 62 communicate with each other through a first bus 63;
the first processor 61 is arranged to call program instructions in the first memory 62 to perform the sharing method of Session object sessions in distributed clusters as provided by the method embodiment described above in relation to fig. 1.
In addition, the logic instructions in the first memory 62 may be implemented in the form of software functional units and stored in a computer readable storage medium when the logic instructions are sold or used as independent products. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
Fig. 7 is a schematic physical structure diagram of an electronic device according to another embodiment of the present invention.
Referring to fig. 7, the electronic device includes: a second processor (processor)71, a second memory (memory)72, and a second bus 73; wherein,
the second processor 71 and the second memory 72 complete communication with each other through a second bus 73;
the second processor 71 is configured to call program instructions in the second memory 72 to execute the sharing method of Session object Session in distributed cluster provided by the method embodiment described above in relation to fig. 3.
In addition, the logic instructions in the second memory 72 may be implemented in the form of software functional units and stored in a computer readable storage medium when the logic instructions are sold or used as independent products. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The present embodiments provide a computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions which, when executed by a computer, enable the computer to perform the methods provided by the above-described method embodiments.
The present embodiments provide a non-transitory computer-readable storage medium storing computer instructions that cause the computer to perform the methods provided by the method embodiments described above.
According to the Session sharing method and device for the Session object in the distributed cluster, the application servers do not store Session data, and the Session data do not need to be copied among the application servers, so that compared with the prior art, the occupied memory is smaller, and the garbage recycling performance is improved; the number of application server instances and the service capacity are linearly increased, and the horizontal expansion of a distributed system is facilitated; session data only interacts between the application server and the Session object storage server, which is more beneficial to network flow control and avoids flow bottleneck.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention 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 invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. 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.
It is to be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
In the description of the present invention, numerous specific details are set forth. It is understood, however, that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description. Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be interpreted as reflecting an intention that: that the invention as claimed requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention.
The above examples are only for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (10)

1. A method for sharing Session object in distributed cluster, comprising:
receiving a Session object Session search request sent by an application server, wherein the Session object Session search request comprises a Session object Session identification number;
acquiring a fragment value according to the Session identification number of the Session object;
determining a target Session object Session storage server from the Session object Session storage server cluster according to the fragmentation value;
forwarding the Session object Session search request to the target Session object Session storage server;
receiving Session object Session data which is sent by the target Session object Session storage server and corresponds to the Session object Session identification number;
and sending the Session object Session data corresponding to the Session object Session identification number to the application server.
2. The method according to claim 1, wherein said obtaining a fragment value according to the Session identifier of the Session object comprises:
and acquiring a fragment value according to the Session identification number of the Session object by adopting a Hash algorithm.
3. The method of claim 1, wherein determining a target Session object Session storage server from a cluster of Session object Session storage servers based on the shard value comprises:
receiving a fragment value storage server list sent by a registration center server, wherein the fragment value storage server list comprises a corresponding relation between a fragment value and a Session object Session storage server;
and determining a target Session object Session storage server from the Session object Session storage server cluster according to the corresponding relation between the fragment value and the Session object Session storage server.
4. A method for sharing Session object in distributed cluster, comprising:
receiving a Session object Session search request sent by a client, wherein the Session object Session search request comprises a Session object Session identification number;
selecting a target Session object Session storage proxy server from a Session object Session storage proxy server cluster;
forwarding the Session object Session search request to the target Session object Session storage proxy server;
and receiving Session object Session data corresponding to the Session object Session identification number returned by the target Session object Session storage proxy server.
5. The method of claim 4, further comprising:
and receiving a target Session object Session storage proxy server cluster list sent by the registration center server.
6. An apparatus for sharing Session object Session in a distributed cluster, comprising:
a Session object search request receiving unit, configured to receive a Session object Session search request sent by an application server, where the Session object Session search request includes a Session object Session identification number;
a fragment value obtaining unit, configured to obtain a fragment value according to the Session identifier of the Session object;
the target Session object storage server determining unit is used for determining a target Session object Session storage server from the Session object Session storage server cluster according to the fragment value;
a Session object search request forwarding unit, configured to forward the Session object Session search request to the target Session object Session storage server;
a Session object data receiving unit, configured to receive Session object Session data sent by the target Session object Session storage server and corresponding to the Session object Session identification number;
and the Session object data sending unit is used for sending the Session object Session data corresponding to the Session object Session identification number to the application server.
7. The apparatus of claim 6, wherein the slice value obtaining unit is further configured to:
and acquiring a fragment value according to the Session identification number of the Session object by adopting a Hash algorithm.
8. The apparatus of claim 6, wherein the target session object storage server determining unit is further configured to:
receiving a fragment value storage server list sent by a registration center server, wherein the fragment value storage server list comprises a corresponding relation between a fragment value and a Session object Session storage server;
and determining a target Session object Session storage server from the Session object Session storage server cluster according to the corresponding relation between the fragment value and the Session object Session storage server.
9. An apparatus for sharing Session object Session in a distributed cluster, comprising:
a Session object search request receiving unit, configured to receive a Session object Session search request sent by a client, where the Session object Session search request includes a Session object Session identification number;
the target Session object storage proxy server selecting unit is used for selecting a target Session object Session storage proxy server from the Session object Session storage proxy server cluster;
a Session object search request forwarding unit, configured to forward the Session object Session search request to the target Session object Session storage proxy server;
and the Session object data receiving unit is used for receiving the Session object Session data which is returned by the target Session object Session storage proxy server and corresponds to the Session object Session identification number.
10. The apparatus of claim 9, further comprising:
and the Session object storage proxy server cluster list receiving unit is used for receiving the target Session object Session storage proxy server cluster list sent by the registration center server.
CN201710463414.1A 2017-06-19 2017-06-19 The sharing method and device of session object Session in a kind of distributed type assemblies Pending CN109150936A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710463414.1A CN109150936A (en) 2017-06-19 2017-06-19 The sharing method and device of session object Session in a kind of distributed type assemblies

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710463414.1A CN109150936A (en) 2017-06-19 2017-06-19 The sharing method and device of session object Session in a kind of distributed type assemblies

Publications (1)

Publication Number Publication Date
CN109150936A true CN109150936A (en) 2019-01-04

Family

ID=64804156

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710463414.1A Pending CN109150936A (en) 2017-06-19 2017-06-19 The sharing method and device of session object Session in a kind of distributed type assemblies

Country Status (1)

Country Link
CN (1) CN109150936A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110134372A (en) * 2019-07-10 2019-08-16 启迪云计算有限公司 A kind of rule-based zookeeper session external management system
CN110633256A (en) * 2019-10-10 2019-12-31 广东电网有限责任公司肇庆供电局 Session Session sharing method in distributed cluster system
CN111698299A (en) * 2020-05-28 2020-09-22 平安银行股份有限公司 Session object copying method, device, distributed micro-service architecture and medium
CN113050890A (en) * 2021-03-26 2021-06-29 北京沃东天骏信息技术有限公司 Data migration method and device
WO2021135114A1 (en) * 2020-06-05 2021-07-08 平安科技(深圳)有限公司 Cluster environment-based telephone session management method, apparatus, and computer device
CN113645261A (en) * 2020-04-27 2021-11-12 中国移动通信集团江西有限公司 Session data processing method, device, storage medium and computer equipment

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN201682522U (en) * 2010-02-08 2010-12-22 阿里巴巴集团控股有限公司 Conversation information storage system and application server
CN103095859A (en) * 2011-11-04 2013-05-08 阿里巴巴集团控股有限公司 Multi-domain-name dialogue information sharing method and system
CN103200212A (en) * 2012-01-04 2013-07-10 中国移动通信集团公司 Method and system achieving distributed conversation under cloud computing environment
CN103389986A (en) * 2012-05-09 2013-11-13 阿里巴巴集团控股有限公司 Method, device and system for storing and searching Session information
CN103473272A (en) * 2013-08-20 2013-12-25 小米科技有限责任公司 Data processing method, device and system
US9083770B1 (en) * 2013-11-26 2015-07-14 Snapchat, Inc. Method and system for integrating real time communication features in applications
CN105701002A (en) * 2014-11-26 2016-06-22 阿里巴巴集团控股有限公司 Test based execution path recording method and apparatus
CN105812351A (en) * 2016-02-23 2016-07-27 平安科技(深圳)有限公司 Method and system for sharing session
CN105933408A (en) * 2016-04-20 2016-09-07 中国银联股份有限公司 Implementation method and device of Redis universal middleware
CN106357778A (en) * 2016-09-27 2017-01-25 山东浪潮商用系统有限公司 Session information sharing method, device and system
CN106603713A (en) * 2016-12-29 2017-04-26 深圳Tcl新技术有限公司 Session management method and system
CN106713391A (en) * 2015-11-13 2017-05-24 北京新媒传信科技有限公司 Session information sharing method and sharing system

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN201682522U (en) * 2010-02-08 2010-12-22 阿里巴巴集团控股有限公司 Conversation information storage system and application server
CN103095859A (en) * 2011-11-04 2013-05-08 阿里巴巴集团控股有限公司 Multi-domain-name dialogue information sharing method and system
CN103200212A (en) * 2012-01-04 2013-07-10 中国移动通信集团公司 Method and system achieving distributed conversation under cloud computing environment
CN103389986A (en) * 2012-05-09 2013-11-13 阿里巴巴集团控股有限公司 Method, device and system for storing and searching Session information
CN103473272A (en) * 2013-08-20 2013-12-25 小米科技有限责任公司 Data processing method, device and system
US9083770B1 (en) * 2013-11-26 2015-07-14 Snapchat, Inc. Method and system for integrating real time communication features in applications
CN105701002A (en) * 2014-11-26 2016-06-22 阿里巴巴集团控股有限公司 Test based execution path recording method and apparatus
CN106713391A (en) * 2015-11-13 2017-05-24 北京新媒传信科技有限公司 Session information sharing method and sharing system
CN105812351A (en) * 2016-02-23 2016-07-27 平安科技(深圳)有限公司 Method and system for sharing session
CN105933408A (en) * 2016-04-20 2016-09-07 中国银联股份有限公司 Implementation method and device of Redis universal middleware
CN106357778A (en) * 2016-09-27 2017-01-25 山东浪潮商用系统有限公司 Session information sharing method, device and system
CN106603713A (en) * 2016-12-29 2017-04-26 深圳Tcl新技术有限公司 Session management method and system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
SJFBJS: "redis分片", 《HTTPS://BLOG.51CTO.COM/11886896/1881832》 *

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110134372A (en) * 2019-07-10 2019-08-16 启迪云计算有限公司 A kind of rule-based zookeeper session external management system
CN110633256A (en) * 2019-10-10 2019-12-31 广东电网有限责任公司肇庆供电局 Session Session sharing method in distributed cluster system
CN113645261A (en) * 2020-04-27 2021-11-12 中国移动通信集团江西有限公司 Session data processing method, device, storage medium and computer equipment
CN111698299A (en) * 2020-05-28 2020-09-22 平安银行股份有限公司 Session object copying method, device, distributed micro-service architecture and medium
CN111698299B (en) * 2020-05-28 2023-08-01 平安银行股份有限公司 Session object replication method, device, distributed micro-service architecture and medium
WO2021135114A1 (en) * 2020-06-05 2021-07-08 平安科技(深圳)有限公司 Cluster environment-based telephone session management method, apparatus, and computer device
CN113050890A (en) * 2021-03-26 2021-06-29 北京沃东天骏信息技术有限公司 Data migration method and device

Similar Documents

Publication Publication Date Title
CN109150936A (en) The sharing method and device of session object Session in a kind of distributed type assemblies
WO2020186909A1 (en) Virtual network service processing method, apparatus and system, and controller and storage medium
US9665428B2 (en) Distributing erasure-coded fragments in a geo-distributed storage system
US9607019B1 (en) Splitting database partitions
CN102708165B (en) Document handling method in distributed file system and device
US20120166403A1 (en) Distributed storage system having content-based deduplication function and object storing method
US20150254325A1 (en) Managing a distributed database across a plurality of clusters
EP2824872B1 (en) Host providing system and communication control method
US8930547B2 (en) Techniques for achieving storage and network isolation in a cloud storage environment
US20180225048A1 (en) Data Processing Method and Apparatus
US9229762B2 (en) Host providing system and host providing method
US20190079791A1 (en) Data Storage Method and Apparatus
US11263184B1 (en) Partition splitting in a distributed database
CN117008818A (en) Data processing method, apparatus, computer device, and computer readable storage medium
CN107547400B (en) Virtual machine migration method and device
CN108153759A (en) A kind of data transmission method of distributed data base, middle tier server and system
CN110113217B (en) Micro-service management method, device, management platform and storage medium
CN110769020B (en) Resource request processing method, device, equipment and system
CN111262771B (en) Virtual private cloud communication system, system configuration method and controller
US10481963B1 (en) Load-balancing for achieving transaction fault tolerance
CN108173892B (en) Cloud mirror image operation method and device
CN111857548B (en) Data reading method, device and system
US20160182623A1 (en) System and method for optimizing web service availability with a node group agreement protocol
CN106649141A (en) Storage interaction device and storage system based on ceph
CN113225362B (en) Server cluster system and implementation method thereof

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20190104

RJ01 Rejection of invention patent application after publication