Disclosure of Invention
In view of the above, the present invention aims to provide a session maintaining method, apparatus, device and medium in a load balancing system, which can avoid the problem of excessive pressure of a single server by randomly distributing index values in a ring hash space. The specific scheme is as follows:
in a first aspect, the present application provides a session maintaining method in a load balancing system, including:
Receiving a client request corresponding to a target session sent by a target client, analyzing the client request to obtain a quintuple corresponding to the client request, and inquiring whether cache data corresponding to the quintuple exists in a preset shared memory cache;
If the cache data does not exist in the preset shared memory cache, acquiring a hash value corresponding to the client request based on a target hash algorithm and the five-tuple, and acquiring a first target index value from a preset annular hash space based on the hash value;
determining a first target upstream server corresponding to the client request according to the first target index value, wherein the first target index value is data in a preset annular hash space, the preset annular hash space is positioned in a load balancing node of a preset load balancing system, the index values corresponding to the upstream servers with different weights occupy different proportions in the preset annular hash space, and the index values corresponding to the upstream servers are randomly distributed in the preset annular hash space;
Judging whether the first target upstream server is abnormal or not, if so, sequentially searching a second target index value backwards based on the first target index value, and sending the client request to a second target upstream server which is corresponding to the second target index value and does not have abnormality so as to hold the target session.
Optionally, the session maintaining method in the load balancing system further includes:
The running state of each upstream server is monitored in real time to determine a normal server and an abnormal server in each upstream server;
And moving the abnormal server out of the target service range corresponding to the client request, carrying out continuous monitoring on the running state of the abnormal server, and if the abnormal state information of the abnormal server is the abnormal state information of the abnormal server, bringing the abnormal server into the target service range again.
Optionally, the session maintaining method in the load balancing system further includes:
And if the cache data corresponding to the five-tuple exists in the preset shared memory cache, acquiring the first target index value corresponding to the client request from the cache data, and jumping to the step of determining a first target upstream server corresponding to the client request according to the first target index value.
Optionally, before the obtaining the first target index value from the preset annular hash space based on the hash value, the method further includes:
constructing the preset annular hash space, determining the server performance corresponding to each upstream server, and respectively giving corresponding target weights to each upstream server according to the server performance;
And setting target quantity of index values corresponding to the upstream servers respectively according to the target weight, and randomly mapping each index value to an index position of the preset annular hash space based on the target quantity.
Optionally, the session maintaining method in the load balancing system further includes:
receiving a history client request sent by the target client, and analyzing the history client request to obtain a history quintuple corresponding to the history client request;
Acquiring a historical hash value corresponding to the historical client request by using the target hash algorithm and the historical quintuple, and storing the historical quintuple and the historical hash value into the preset shared memory cache based on a preset storage duration;
And judging whether the storage time length of the history five-tuple and the history hash value in the preset shared memory buffer is longer than the preset storage time length, and deleting the history five-tuple and the history hash value if the storage time length of the history five-tuple and the history hash value in the preset shared memory buffer is longer than the preset storage time length.
Optionally, the session maintaining method in the load balancing system further includes:
if the first target upstream server corresponding to the first target index value is not abnormal, the client request is directly sent to the first target upstream server, and session maintenance is carried out on the client request by utilizing the first target upstream server.
In a second aspect, the present application provides a session holding apparatus in a load balancing system, including:
The data query module is used for receiving a client request corresponding to a target session sent by a target client, analyzing the client request to obtain a quintuple corresponding to the client request, and querying whether cache data corresponding to the quintuple exists in a preset shared memory cache or not;
the index value acquisition module is used for acquiring a hash value corresponding to the client request based on a target hash algorithm and the five-tuple if the cache data do not exist in the preset shared memory cache, and acquiring a first target index value from a preset annular hash space based on the hash value;
The server determining module is used for determining a first target upstream server corresponding to the client request according to the first target index value, wherein the first target index value is data in a preset annular hash space, the preset annular hash space is positioned in a load balancing node of a preset load balancing system, the index values corresponding to the upstream servers with different weights occupy different proportions in the preset annular hash space, and the index values corresponding to the upstream servers are randomly distributed in the preset annular hash space;
and the first request sending module is used for judging whether the first target upstream server is abnormal, if so, sequentially searching a second target index value backwards based on the first target index value, and sending the client request to the second target upstream server which is corresponding to the second target index value and does not have the abnormality, so as to hold the target session.
Optionally, the session maintaining device in the load balancing system further includes:
And the step jump module is used for acquiring the first target index value corresponding to the client request from the cache data if the cache data corresponding to the five-tuple exists in the preset shared memory cache, and jumping to the step of determining the first target upstream server corresponding to the client request according to the first target index value.
In a third aspect, the present application provides an electronic device, comprising:
a memory for storing a computer program;
And a processor for executing the computer program to implement the session maintaining method in the load balancing system.
In a fourth aspect, the present application provides a computer readable storage medium storing a computer program which, when executed by a processor, implements the session keeping method in the aforementioned load balancing system.
The method comprises the steps of firstly receiving a client request corresponding to a target session sent by a target client, analyzing the client request to obtain a quintuple corresponding to the client request, inquiring whether cache data corresponding to the quintuple exist in a preset shared memory cache, then obtaining hash values corresponding to the client request based on a target hash algorithm and the quintuple if the cache data do not exist in the preset shared memory cache, obtaining a first target index value from a preset annular hash space based on the hash values, then determining a first target upstream server corresponding to the client request according to the first target index value, wherein the first target index value is data in the preset annular hash space, the preset annular hash space is located in a load balancing node of a preset load balancing system, index values corresponding to upstream servers with different weights are distributed randomly in the preset annular space if the cache data do not exist in the preset annular hash space, finally judging whether the first target upstream server exists in the first annular hash space, and sequentially searching for an abnormal target session to a second target upstream server according to the first target index value, and sequentially searching for the abnormal target session if the first target upstream server exists in the first target hash space. Therefore, the application records the mapping relation between the five-tuple and the index value through the shared memory cache. When the upstream server is dynamically added and deleted, the caching mechanism ensures that continuous requests of the same client always read historical index values, so that most of sessions are still routed to the original server when the server is changed, the problem of session interruption caused by the server change is avoided, index values are randomly distributed in the annular hash space, when the target server is abnormal, the index values are sequentially traversed from the fault index position, the requests of the fault server are uniformly dispersed to a plurality of healthy servers, and the problem of overlarge pressure of a single server caused by centralized migration of the sessions to the same server is avoided.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The current session maintaining method generally has the problem that the session is interrupted when the server is changed with high probability. Therefore, the application provides a session maintaining method in a load balancing system, which avoids the problem of overlarge pressure of a single server by randomly distributing index values in a ring hash space.
Referring to fig. 1, the embodiment of the invention discloses a session maintaining method in a load balancing system, which comprises the following steps:
Step S11, receiving a client request corresponding to a target session sent by a target client, analyzing the client request to obtain a quintuple corresponding to the client request, and inquiring whether cache data corresponding to the quintuple exists in a preset shared memory cache.
The session maintaining method in this embodiment is a method for implementing session maintaining in a load balancing system, and needs to be used with other load balancing related technologies, such as a distributed load balancing technology, a health checking technology, and other common technologies.
The method and the system ensure that the load of each node is maintained at a reasonable level by dispersing the request of the client to a plurality of load balancing nodes, thereby realizing efficient and reliable service delivery. Compared with the main and standby type load balancing, the performance of the distributed load balancing can be obviously improved, and the improvement times of the distributed load balancing are closely related to the number of load balancing nodes. Session maintenance not only needs to be implemented on a single load balancing node, but also needs to be synchronized among nodes so as to ensure that the requests of the same client can be correctly routed to the same upstream server when being distributed to different load balancing nodes, and the problem of session interruption caused by inconsistency among the nodes is avoided. How to implement an efficient synchronization mechanism between load balancing nodes will be described in detail below.
As shown in fig. 2, when a request (i.e., a client request) arrives at a node, it needs to determine whether the request hits a cache (i.e., a preset shared memory cache), obtain a hash value corresponding to the request according to a corresponding determination result, find a corresponding health server from the ring hash space by using the hash value, and forward the request to the health server, so as to maintain a target session corresponding to the client request.
The session maintaining method in the embodiment further comprises the steps of monitoring the running states of the upstream servers in real time to determine a normal server and an abnormal server in the upstream servers, moving the abnormal server out of a target service range corresponding to the client request, maintaining the running states of the abnormal servers, and if abnormal state information of the abnormal servers is obtained, bringing the abnormal servers into the target service range again.
Specifically, the health check technology is a core component in the load balancing system, and the main function of the health check technology is to monitor the health state of the upstream server in real time, so that only the upstream server in a normal running state can receive the flow. By implementing a health check, the load balancer can automatically identify and remove those upstream servers that are experiencing anomalies. Once these servers resume normal operation, the load balancer can re-bring them into service in time. This process not only increases the overall usability of the system, but also enhances the stability of the system. When the health check result of an upstream server shows an abnormality, the session keeping mechanism at this time has actually lost its original meaning. Because the server has not been able to handle the client's request properly, it must be immediately removed from the forwarding pool. In this case, the session maintenance technique needs to reduce the influence on the client session maintenance result as much as possible in the process of dynamically adding and deleting the upstream server. Specifically, to ensure that most of the original forwarding results remain stable, session interruption caused by the change of the server is avoided. This not only helps to maintain the continuity of the user experience, but also ensures efficient operation of the system.
And step S12, if the cache data does not exist in the preset shared memory cache, acquiring a hash value corresponding to the client request based on a target hash algorithm and the five-tuple, and acquiring a first target index value from a preset annular hash space based on the hash value.
The session maintaining method in the embodiment further comprises the steps of receiving a history client request sent by the target client, analyzing the history client request to obtain a history quintuple corresponding to the history client request, obtaining a history hash value corresponding to the history client request by using a target hash algorithm and the history quintuple, storing the history quintuple and the history hash value into a preset shared memory cache based on a preset storage duration, judging whether the storage duration of the history quintuple and the history hash value in the preset shared memory cache is longer than the preset storage duration, and deleting the history quintuple and the history hash value if the storage duration of the history quintuple and the history hash value in the preset shared memory cache is longer than the preset storage duration.
In this embodiment, if the cache data corresponding to the five-tuple exists in the preset shared memory cache, the first target index value corresponding to the client request is obtained from the cache data, and the step of determining the first target upstream server corresponding to the client request according to the first target index value is skipped, and if the hash value corresponding to the client request does not exist in the preset shared memory cache, the calculation is required by using the five-tuple corresponding to the client request.
Specifically, the load balancing node specifically opens up a shared memory area (i.e. a preset shared memory cache) between processes, and the area is dedicated to caching session maintenance information. This information includes the five-tuple of the client request, source IP address (Internet Protocol Address, i.e., internet protocol address), source port, destination IP address, destination port, protocol number, and upstream server details forwarded to. The data format is designed as 'source IP: source port: destination IP: destination port: protocol number: upstream server: expiration time', so as to ensure the integrity and traceability of information. In addition, in order to maintain the cleanness and high efficiency of the memory, an expiration cleaning mechanism must be introduced to timely clean the expiration data.
In the initial state, when the first request arrives at the load balancing node, session keeping information in the shared memory is still empty. At this point, the node will intelligently calculate which upstream server the request should be forwarded to according to preset rules.
The hash algorithm in this embodiment selects the algorithm with high discreteness and low collision rate, and the algorithm with high calculation speed can make the efficiency higher, so that the CRC32 (Cyclic Redundancy Check, i.e. cyclic redundancy check) algorithm is selected. The key for calculating the hash value is "source IP: source port: destination IP: destination port: protocol number". Assuming that the source IP of the client request packet is 172.168.10.11, the source port is 52769, the destination IP is 172.168.10.8, the destination port is 8080, the protocol is TCP (Transmission Control Protocol, the transmission control protocol), the key is "172.168.10.11:52769:172.168.10.8:8080:6", and the code example is as follows:
public static long crc32(String key)
{
CRC32 crc32 = new CRC32();
byte[] data = key.getBytes();
crc32.update(data);
long result = crc32.getValue();
long index = result % 1024;
return index;
}
The hash value of "172.168.10.11:52769:172.168.10.8:8080:6" calculated according to the CRC32 algorithm is 3907580823 (i.e. the hash value corresponding to the client request), the result after taking the remainder to the 10 th power of 2 is 919, the data packet is forwarded to the upstream server corresponding to the index value (i.e. the first target index value) located at the index position of the hash ring 919, and the information "172.168.10.11:52769:172.168.10.8:8080:6:919: $ { expire time }" is written into the cache. After the operation is performed for a period of time, the buffer memory in the load balancing node writes some session maintaining information, and when a subsequent client request arrives at the load balancing node, whether hash calculation is performed is judged according to whether the buffer memory is hit or not. If the cache is hit, the index of the upstream server is matched, and the cache expiration time is refreshed.
It should be noted that, there may be multiple continuous client requests in a session, and the five-tuple of the client requests corresponding to the same session are the same, so if the client request corresponding to a session has arrived before the load balancing node, the corresponding five-tuple and the hash value are stored in the preset shared memory cache, and when the subsequent client request corresponding to the same session arrives, the hash value does not need to be recalculated.
In the embodiment, before the first target index value is obtained from the preset annular hash space based on the hash value, the method further comprises the steps of constructing the preset annular hash space, determining server performances corresponding to all upstream servers respectively, giving corresponding target weights to all the upstream servers respectively according to the server performances, setting target numbers of the index values corresponding to all the upstream servers respectively according to the target weights, and randomly mapping all the index values to index positions of the preset annular hash space based on the target numbers.
That is, the present embodiment can adjust the number of index values corresponding to the upstream server in the preset annular hash space according to the weight of the upstream server.
By opening up a shared memory in the load balancing node and caching the five-tuple corresponding to the client session in the shared memory, the client request corresponding to the same session does not need to recalculate the hash value when the client request subsequently enters the load balancing node, so that the computing resource of the system is saved, and the efficiency of forwarding the client request is improved.
And step S13, determining a first target upstream server corresponding to the client request according to the first target index value, wherein the first target index value is data in a preset annular hash space, the preset annular hash space is positioned in a load balancing node of a preset load balancing system, the ratio of index values corresponding to upstream servers with different weights occupied in the preset annular hash space is different, and the index values corresponding to the upstream servers are randomly distributed in the preset annular hash space.
Because each index value only corresponds to a unique upstream server, the upstream server corresponding to the client request can be found through the first target index value.
In addition, index values corresponding to the upstream servers in the embodiment are randomly distributed in the preset annular hash space, and each upstream server corresponds to at least 100 virtual nodes, and the virtual nodes are randomly and uniformly mapped on the annular space. For example, within the interval of index [0-9], we map 10 upstream servers (numbered 1-10) randomly, in a random order, such as 4,2, 5, 8, 10,1, 3, 7, 6, 9. Likewise, the mapping order is also random, such as 5, 4, 10,1, 7, 9, 3, 2, 8, 6, within the interval of [10,19 ].
Step S14, judging whether the first target upstream server is abnormal, if so, sequentially searching a second target index value backwards based on the first target index value, and sending the client request to a second target upstream server which is corresponding to the second target index value and does not have abnormality, so as to hold the target session.
This embodiment is divided into two cases, if the upstream server (i.e. the first target upstream server) is determined to be healthy by the health check, the client request is forwarded to the corresponding upstream server, and if the upstream server is determined to be unhealthy by the health check, i.e. the upstream server corresponding to the index position 919 cannot respond to the request, the backward matching is continued, and the upstream server of the index position is selected 920 until an upstream server (i.e. the second target upstream server) whose health check result is normal is selected. According to the characteristic of the end-to-end connection of the hash ring, if the health check result of the upstream server with the index of 1023 is abnormal, the upstream server is matched backwards from the position with the index of 0 until one upstream server with the health check result of normal is selected.
That is, in this embodiment, if the first target upstream server is not abnormal, the client request is directly sent to the first target upstream server, and session maintenance is performed on the client request by using the first target upstream server.
It should be noted that, when the health check result of a certain upstream server is abnormal, only the adjacent upstream servers on the hash ring are affected at this time, and because the segments on the hash ring are randomly distributed, the backward nodes of the upstream server are random, so that a fault of one upstream server can be avoided, and the situation that the original upstream server 1 is responsible for processing all the requests are forwarded to the upstream server 2 can be avoided. By randomly distributing index values in the annular hash space, most of original forwarding results can be ensured to be kept stable when the upstream server is dynamically added and deleted, and session interruption caused by server change is avoided. And one upstream server fails, so that the request of the upstream server can be uniformly distributed to other upstream servers, and the request distribution is more reasonable. By reducing the amount of computation by using the caching technique, CPU pressure is reduced.
Therefore, the application records the mapping relation between the five-tuple and the index value through the shared memory cache. When the upstream server is dynamically added and deleted, the caching mechanism ensures that continuous requests of the same client always read historical index values, so that most of sessions are still routed to the original server when the server is changed, the problem of session interruption caused by the server change is avoided, index values are randomly distributed in the annular hash space, when the target server is abnormal, the index values are sequentially traversed from the fault index position, the requests of the fault server are uniformly dispersed to a plurality of healthy servers, and the problem of overlarge pressure of a single server caused by centralized migration of the sessions to the same server is avoided.
As can be seen from the foregoing embodiments, the present application describes the overall flow of session maintenance in the load balancing system, and in order to make the technical solution in the present application more complete, the present application will be described in detail below with reference to index values in the ring hash space if an upstream server is arranged. Referring to fig. 3, an embodiment of the present application discloses a process of index value arrangement, including:
and S21, constructing an annular hash space, determining the server performance corresponding to each upstream server, and respectively giving corresponding target weights to each upstream server according to the server performance.
In the present embodiment, it is assumed that the upstream servers are fixed to 10, and the number does not increase. In order to realize efficient and uniform load distribution, a hash value space annular construction method is adopted. The hash value space is mapped with the virtual nodes, wherein the hash value space is constructed into a ring shape, and the value range is reduced by 1 from the power of 10 of 0 to 2.
In practical applications, there is often a difference in performance between upstream servers. For example, the upstream server 1 may be a virtual machine configured as 4 cores 8GB, while the upstream server 2 may be a virtual machine configured as a higher 8 cores 16 GB. To cope with this performance difference, a weight distribution mechanism is introduced. Specifically, the upstream server 1 may be set with a weight of 1, and the upstream server 2 may be set with a weight of 2. In this way, different upstream servers may be subsequently assigned to a corresponding number of virtual nodes based on their different weights.
And S22, setting target numbers of index values corresponding to the upstream servers respectively according to the target weights, and randomly mapping the index values to index positions of the preset annular hash space based on the target numbers.
In this embodiment, it is assumed that there are still 10 upstream servers in the system, but the first upstream server has its weight set to 2 and the weights of the remaining 9 upstream servers are all 1 because of higher performance. In this case, when mapping on the hash ring, the number of segments needs to be adjusted to reflect this weight difference. Specifically, the number of segments should be modified from 10 to 11.
Taking the [0,10] interval as an example, the mapping index may be 5, 4, 3, 2,1, 6, 7, 8, 9, 10, 1. Here, the upstream server 1 is mapped twice on the hash ring, and the other 9 upstream servers are each mapped once, due to the weight of 2. In this way, the present embodiment can adjust the mapping ratio according to the number of virtual nodes, thereby finely controlling the number of requests allocated to each upstream server.
This weight-based virtual node mapping strategy makes request allocation more reasonable and balanced. The performance difference of the upstream server is considered, and the high-performance server can bear more requests by dynamically adjusting the mapping proportion, so that the processing capacity and the efficiency of the whole system are improved.
Furthermore, to ensure that multiple load balancing nodes can maintain consistent results when processing requests, we ensure that the mapping order is exactly the same across all nodes. Therefore, the same hash algorithm is used, and even if the requests of the same client are forwarded to different load balancing nodes or one of the load balancing nodes fails, the requests can be ensured to be forwarded to the same upstream server, so that the problem of inconsistent forwarding caused by different nodes is avoided.
By randomly mapping and introducing virtual nodes in the segmented interval, the problem of uneven distribution of an upstream server is solved, and the distribution result is more random and uniform. The design effectively improves the efficiency and accuracy of load balancing, and provides more stable and rapid service experience for the client.
Referring to fig. 4, an embodiment of the present invention discloses a session maintaining device in a load balancing system, including:
The data query module 11 is configured to receive a client request corresponding to a target session sent by a target client, parse the client request to obtain a quintuple corresponding to the client request, and query whether cache data corresponding to the quintuple exists in a preset shared memory cache;
The index value obtaining module 12 is configured to obtain, if the cache data does not exist in the preset shared memory cache, a hash value corresponding to the client request based on a target hash algorithm and the five-tuple, and obtain a first target index value from a preset annular hash space based on the hash value;
The server determining module 13 is configured to determine a first target upstream server corresponding to the client request according to the first target index value, where the first target index value is data in a preset annular hash space, the preset annular hash space is located in a load balancing node of a preset load balancing system, the index values corresponding to upstream servers with different weights occupy different proportions in the preset annular hash space, and the index values corresponding to the upstream servers are randomly distributed in the preset annular hash space;
And the first request sending module 14 is configured to determine whether the first target upstream server is abnormal, and if the first target upstream server is abnormal, sequentially find a second target index value backwards based on the first target index value, and send the client request to a second target upstream server corresponding to the second target index value and having no abnormality, so as to perform session maintenance on the target session.
Therefore, the application records the mapping relation between the five-tuple and the index value through the shared memory cache. When the upstream server is dynamically added and deleted, the caching mechanism ensures that continuous requests of the same client always read historical index values, so that most of sessions are still routed to the original server when the server is changed, the problem of session interruption caused by the server change is avoided, index values are randomly distributed in the annular hash space, when the target server is abnormal, the index values are sequentially traversed from the fault index position, the requests of the fault server are uniformly dispersed to a plurality of healthy servers, and the problem of overlarge pressure of a single server caused by centralized migration of the sessions to the same server is avoided.
In some specific embodiments, the session maintaining device in the load balancing system further includes:
the server monitoring module is used for monitoring the running state of each upstream server in real time so as to determine a normal server and an abnormal server in each upstream server;
And the server control module is used for moving the abnormal server out of the target service range corresponding to the client request, carrying out continuous monitoring on the running state of the abnormal server, and if the abnormal state information of the abnormal server is sent, re-bringing the abnormal server into the target service range.
In some specific embodiments, the session maintaining device in the load balancing system further includes:
And the step jump module is used for acquiring the first target index value corresponding to the client request from the cache data if the cache data corresponding to the five-tuple exists in the preset shared memory cache, and jumping to the step of determining the first target upstream server corresponding to the client request according to the first target index value.
In some specific embodiments, the index value obtaining module 12 further includes:
The weight giving unit is used for constructing the preset annular hash space, determining the server performance corresponding to each upstream server, and giving corresponding target weight to each upstream server according to the server performance;
And the index value mapping unit is used for setting the target number of the index values respectively corresponding to the upstream servers according to the target weight, and randomly mapping each index value to the index position of the preset annular hash space based on the target number.
In some specific embodiments, the session maintaining device in the load balancing system further includes:
The request analysis module is used for receiving a history client request sent by the target client and analyzing the history client request to obtain a history five-tuple corresponding to the history client request;
The hash value acquisition module is used for acquiring a historical hash value corresponding to the historical client request by utilizing the target hash algorithm and the historical five-tuple, and storing the historical five-tuple and the historical hash value into the preset shared memory cache based on a preset storage duration;
And the data deleting module is used for judging whether the storage time length of the history five-tuple and the history hash value in the preset shared memory buffer is longer than the preset storage time length, and deleting the history five-tuple and the history hash value if the storage time length of the history five-tuple and the history hash value in the preset shared memory buffer is longer than the preset storage time length.
In some specific embodiments, the session maintaining device in the load balancing system further includes:
And the second request sending module is used for directly sending the client request to the first target upstream server if the first target upstream server corresponding to the first target index value is not abnormal, and carrying out session maintenance on the client request by using the first target upstream server.
Further, the embodiment of the present application further discloses an electronic device, and fig. 5 is a block diagram of an electronic device 20 according to an exemplary embodiment, where the content of the figure is not to be considered as any limitation on the scope of use of the present application.
Fig. 5 is a schematic structural diagram of an electronic device 20 according to an embodiment of the present application. The electronic device 20 may include, in particular, at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input-output interface 25, and a communication bus 26. Wherein the memory 22 is configured to store a computer program that is loaded and executed by the processor 21 to implement relevant steps in the session keeping method in the load balancing system disclosed in any of the foregoing embodiments. In addition, the electronic device 20 in the present embodiment may be specifically an electronic computer.
In this embodiment, the power supply 23 is configured to provide working voltages for each hardware device on the electronic device 20, the communication interface 24 is capable of creating a data transmission channel with an external device for the electronic device 20, and the communication protocol to be followed is any communication protocol applicable to the technical solution of the present application, which is not specifically limited herein, and the input/output interface 25 is configured to obtain external input data or output data to the external device, and the specific interface type of the input/output interface may be selected according to the specific application needs and is not specifically limited herein.
The memory 22 may be a carrier for storing resources, such as a read-only memory, a random access memory, a magnetic disk, or an optical disk, and the resources stored thereon may include an operating system 221, a computer program 222, and the like, and the storage may be temporary storage or permanent storage.
The operating system 221 is used for managing and controlling various hardware devices on the electronic device 20 and the computer program 222, which may be Windows Server, netware, unix, linux, etc. The computer program 222 may further include a computer program that can be used to perform other specific tasks in addition to the computer program that can be used to perform the session maintenance method in the load balancing system performed by the electronic device 20 as disclosed in any of the previous embodiments.
Furthermore, the application also discloses a computer readable storage medium for storing a computer program, wherein the computer program is executed by a processor to realize the session maintaining method in the load balancing system. For specific steps of the method, reference may be made to the corresponding contents disclosed in the foregoing embodiments, and no further description is given here.
In this specification, each embodiment is described in a progressive manner, and each embodiment is mainly described in a different point from other embodiments, so that the same or similar parts between the embodiments are referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant points refer to the description of the method section.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative elements and steps are described above generally in terms of functionality in order to clearly illustrate the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. The software modules may be disposed in Random Access Memory (RAM), memory, read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
Finally, it is further noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, 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 one does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises an element.
While the foregoing has been provided to illustrate the principles and embodiments of the present application, specific examples have been provided herein to assist in understanding the principles and embodiments of the present application, and are intended to be in no way limiting, for those of ordinary skill in the art will, in light of the above teachings, appreciate that the principles and embodiments of the present application may be varied in any way.