CN109729139A - Access request retransmission method, device, equipment and readable storage medium storing program for executing - Google Patents

Access request retransmission method, device, equipment and readable storage medium storing program for executing Download PDF

Info

Publication number
CN109729139A
CN109729139A CN201810622931.3A CN201810622931A CN109729139A CN 109729139 A CN109729139 A CN 109729139A CN 201810622931 A CN201810622931 A CN 201810622931A CN 109729139 A CN109729139 A CN 109729139A
Authority
CN
China
Prior art keywords
server
access request
session
originally created
identification code
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
CN201810622931.3A
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.)
Ping An Puhui Enterprise Management Co Ltd
Original Assignee
Ping An Puhui Enterprise Management Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Puhui Enterprise Management Co Ltd filed Critical Ping An Puhui Enterprise Management Co Ltd
Priority to CN201810622931.3A priority Critical patent/CN109729139A/en
Publication of CN109729139A publication Critical patent/CN109729139A/en
Pending legal-status Critical Current

Links

Landscapes

  • Computer And Data Communications (AREA)

Abstract

The present invention provides a kind of access request retransmission method, comprising: receives the configuration file of input, and according to the configuration file, the identity code of each server in configuration server cluster;When receiving the access request of client transmission, according to the identity code of session identification code and current server in the access request, determine whether current server is that the affiliated session of the access request is originally created server;If current server is not that the access request affiliated session is originally created server, the access request is forwarded to and described is originally created server.The present invention also provides a kind of access request retransmission unit, equipment and readable storage medium storing program for executing.The access request of same user is concentrated on the server process for the session for creating access request for the first time by the present invention, then without considering the stationary problem of session information, and does not access third party database, reduce system complexity, reduce development cost and human cost.

Description

Access request retransmission method, device, equipment and readable storage medium storing program for executing
Technical field
The present invention relates to the technical field of server cluster more particularly to a kind of access request retransmission methods, device, equipment And readable storage medium storing program for executing.
Background technique
Currently, can realize that the user of millions accesses using server cluster and load-balancing technique, load balancer meeting Situation is accessed according to user, the access request of user is distributed to the server process in server cluster.Server is receiving When the access request for not carrying session ID sent to client, session is created, session ID is generated, and in server It is middle to store relevant session information, the session ID of generation is then returned into client, client local is stored in, passes through After a period of time, client re-initiates the access request for carrying the session ID, should due to equally loaded etc. Access request is assigned to other server process, and the session information of the access request is not stored in other servers, Cause other servers that can not handle access request.
To solve the above problems, existing settling mode is setting third party database, by the session information of access request It stores to third party database, so that each server in server cluster can obtain session information, guarantees in each server Session information it is synchronous, however, third party database needs to charge, increase cost, and by third party database access service Device cluster increases the complexity of system, needs more personal management, and human cost is higher.
Therefore, how while guaranteeing that session information is synchronous, reduce system complexity, reduce development cost and manpower at It originally is current urgent problem to be solved.
Summary of the invention
The main purpose of the present invention is to provide a kind of access request retransmission method, device, equipment and readable storage medium storing program for executing, It is intended to improve the convenience and efficiency of access request forwarding.
To achieve the above object, the present invention provides a kind of access request retransmission method, the access request retransmission method packet Include following steps:
The configuration file of input is received, and according to the configuration file, the identity of each server in configuration server cluster Identification code;
When receiving the access request of client transmission, taken according to the session identification code in the access request with current It is engaged in the identity code of device, determines whether current server is that the access request affiliated session is originally created server;
If current server is not that the affiliated session of the access request is originally created server, by the access request Server is originally created described in being forwarded to.
Optionally, according to the configuration file, the step of identity code of each server, is wrapped in configuration server cluster It includes:
The network address of each server in server cluster is obtained, and obtains network address and body from the configuration file The mapping table of part identification code;
The mapping table is inquired, by the corresponding identity code of the network address of each server, is allocated to each service Device.
Optionally, according to the identity code of session identification code and current server in the access request, determination is worked as Whether preceding server is that the access request affiliated session includes: the step of being originally created server
The identity code for being originally created server is extracted from the session identification code in the access request;
Obtain current server identity code, and determine described in be originally created server identity code whether with The identity code of current server is identical;
If the identity code for being originally created server is identical as the identity code of current server, it is determined that when Preceding server is originally created server for the affiliated session of the access request, otherwise determines that current server is not the access Session belonging to requesting is originally created server.
Optionally, according to the identity code of session identification code and current server in the access request, determination is worked as Preceding server whether be the affiliated session of the access request the step of being originally created server before, further includes:
When receiving the access request of client transmission, determine whether the access request carries session identification code;
If the access request carries session identification code, then follow the steps: being known according to the session in the access request The identity code of other code and current server, determine current server whether be the affiliated session of the access request original wound Build server;
If the access request does not carry session identification code, according to the present load of server each in server cluster Session number is originally created server to access request distribution;
By the access request be forwarded to it is described be originally created server, the visit is created by the server that is originally created It asks the session of request, and according to the identity code for being originally created server, generates session identification code.
Optionally, the present load session number according to server each in server cluster, to the access request point Include: with the step of being originally created server
According to the present load session number of server each in server cluster, the distribution priority of each server is determined;
The server for distributing highest priority is determined as to the server that is originally created of the access request, and by the original File server distributes to the access request.
Optionally, the access request retransmission method further include:
When obtaining the idle record of each session identification code of each server storage in server cluster with interval preset time The idle duration of the maximum of long and each session identification code;
Delete the session identification code that the idle record duration is more than the maximum idle duration.
Optionally, according to the identity code of session identification code and current server in the access request, determination is worked as Preceding server whether be the affiliated session of the access request the step of being originally created server after, further includes:
If current server is originally created server for the affiliated session of the access request, the access request is verified In session identification code;
When session identification code in the access request passes through verifying, the access request is handled.
In addition, to achieve the above object, the present invention also provides a kind of access request retransmission unit, the access request forwarding Device includes:
Reception configuration module, configuration file for receiving input, and according to the configuration file, configuration server cluster In each server identity code;
Receive determining module, for when receive client transmission access request when, according in the access request The identity code of session identification code and current server determines whether current server is the affiliated session of the access request It is originally created server;
Access request forwarding module, if not being that the affiliated session of the access request is originally created clothes for current server It is engaged in device, then the access request is forwarded to and described is originally created server.
In addition, to achieve the above object, the present invention also provides a kind of access request forwarding device, the access request forwarding Equipment includes that the access request that can be executed on the memory and by the processor of processor, memory and being stored in turns Program is sent out, wherein realizing such as above-mentioned access request forwarding side when the access request retransmission process is executed by the processor The step of method.
In addition, to achieve the above object, the present invention also provides a kind of readable storage medium storing program for executing, being deposited on the readable storage medium storing program for executing Access request retransmission process is contained, wherein realizing such as above-mentioned access when the access request retransmission process is executed by processor The step of requesting retransmission method.
The present invention provides a kind of access request retransmission method, device, equipment and readable storage medium storing program for executing, and the present invention receives input Configuration file, and according to the configuration file, the identity code of each server in configuration server cluster, then when receiving When access request, according to the identity code of session identification code and current server in access request, current server is determined It whether is that the affiliated session of access request is originally created server, if current server is not the original of the affiliated session of access request File server, then by access request be forwarded to it is described be originally created server, due to by the access request collection of same user In the session of creation access request for the first time server process, then without considering the stationary problem of session information, and do not access Third party database reduces system complexity, reduces development cost and human cost.
Detailed description of the invention
Fig. 1 is the hardware structural diagram for the access request forwarding device that various embodiments of the present invention are related to;
Fig. 2 is the flow diagram of access request retransmission method first embodiment of the present invention;
Fig. 3 is the flow diagram of access request retransmission method second embodiment of the present invention;
Fig. 4 is the flow diagram of access request retransmission method 3rd embodiment of the present invention;
Fig. 5 is the functional block diagram of access request retransmission unit first embodiment of the present invention.
The embodiments will be further described with reference to the accompanying drawings for the realization, the function and the advantages of the object of the present invention.
Specific embodiment
It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, it is not intended to limit the present invention.
The present embodiments relate to access request retransmission method be mainly used in access request forwarding device, which asks Asking forwarding device to can be PC (personal computer personal computer), portable computer, mobile terminal etc. has display With the equipment of processing function.
Referring to Fig.1, Fig. 1 is the hardware configuration signal of access request forwarding device involved in the embodiment of the present invention Figure.In the embodiment of the present invention, access request forwarding device may include (such as the central processing unit Central of processor 1001 Processing Unit, CPU), communication bus 1002, user interface 1003, network interface 1004, memory 1005.Wherein, Communication bus 1002 is for realizing the connection communication between these components;User interface 1003 may include display screen (Display), input unit such as keyboard (Keyboard);Network interface 1004 optionally may include that the wired of standard connects Mouth, wireless interface (such as WI-FI interface);Memory 1005 can be high speed RAM memory, be also possible to stable memory (non-volatile memory), such as magnetic disk storage, memory 1005 optionally can also be independently of aforementioned processor 1001 storage device.It will be understood by those skilled in the art that hardware configuration shown in Fig. 1 is not constituted to limit of the invention It is fixed, it may include perhaps combining certain components or different component layouts than illustrating more or fewer components.
With continued reference to Fig. 1, the memory 1005 in Fig. 1 as a kind of readable storage medium storing program for executing may include operating system, net Network communication module and access request retransmission process.In Fig. 1, network communication module is mainly used for connecting server, with service Device carries out data communication;And processor 1001 can call the access request retransmission process stored in memory 1005, and execute Access request retransmission method provided in an embodiment of the present invention.
The embodiment of the invention provides a kind of access request retransmission methods.
It is the flow diagram of access request retransmission method first embodiment of the present invention referring to Fig. 2, Fig. 2.
In the present embodiment, which is realized by access request forwarding device, and access request forwarding is set It is standby to can be the terminal devices such as PC, palm PC and tablet computer, it is chosen as equipment shown in FIG. 1, the access request forwarding Method the following steps are included:
Step S101, receives the configuration file of input, and according to configuration file, each server in configuration server cluster Identity code;
Step S102, when receive client transmission access request when, according in access request session identification code and The identity code of current server determines whether current server is that access request affiliated session is originally created server;
Step S103 asks access if current server is not that access request affiliated session is originally created server It asks to be forwarded to and is originally created server.
The session information of access request is stored to third party database, so that the equal energy of each server in server cluster Session information is obtained, guarantees that the session information in each server is synchronous, however, third party database needs to charge, increases into This, and by third party database access server cluster, the complexity of system is increased, more personal management, manpower are needed Higher cost.In view of the above problem, a kind of access request retransmission method is proposed in the present embodiment, access described in detail below is asked Seek the specific steps of retransmission method:
Step S101, receives the configuration file of input, and according to configuration file, each server in configuration server cluster Identity code;
In the present embodiment, equipment receives the configuration file of input, and according to the configuration file, each in configuration server cluster The identity code of server.Wherein, the configuration file include the network address, port numbers of each server in server cluster, Mapping relations between identity code and network address and identity code, the identity code are used for unique identification service Device.Or equipment detects in default storage region whether be stored with configuration file with interval preset time, if detected default It is stored with configuration file in storage region, then reads the configuration file from default storage region, and according to the configuration file, matches Set the identity code of each server in server cluster;If being not detected in default storage region and being stored with configuration file, Then improve the preset time.It should be noted that preset time can be configured by those skilled in the art based on actual conditions, The present embodiment is not especially limited this.
Specifically, in the present embodiment, step S101 includes:
Step a1, obtains the network address of each server in server cluster, and network address is obtained from configuration file With the mapping table of identity code;
In the present embodiment, equipment obtains the network of each server in server cluster after receiving configuration file Location, and from the configuration file obtain network address and identity code mapping table, i.e., the network address of each server There is one-to-one relationship with the identity code of each server.
Step a2 inquires mapping table for the corresponding identity code of the network address of each server and is allocated to each clothes Business device.
In the present embodiment, equipment obtained from the configuration file network address and identity code mapping table it Afterwards, the mapping table of network address and identity code is inquired, is determined corresponding with the network address of each server each Identity code, and by the corresponding identity code of the network address of each server, it is allocated to each server.For example, server Cluster includes four servers, respectively server A, server B, server C and server D, and corresponding network address is divided Not Wei network address a, network address b, network address c and network address d, mapping between network address and identity code closes System is for network address a- identity code 2, network address b- identity code 4, network address c- identity code 1 and network Location d- identity code 3, then the identity code of server A, server B, server C and server D are respectively identification Code 2, identity code 4, identity code 1 and identity code 3.
Step S102, when receive client transmission access request when, according in access request session identification code and The identity code of current server determines whether current server is that access request affiliated session is originally created server;
In the present embodiment, when receiving the access request of client generation, equipment is according to the session in the access request The identity code of identification code and current server determines whether current server is being originally created for the affiliated session of access request Server.Wherein, which carries user password, user account, subscriber identity information, session identification code and client Identification code etc., it is the server for creating the affiliated session of access request for the first time that this, which is originally created server, is stored with the access request The session identification code of affiliated session.
In specific implementation, in the identity code according to session identification code and current server in the access request, Determine whether current server is that the affiliated session of access request is originally created before server, it is also necessary to determine the access request Whether session identification code is carried, if the access request carries session identification code, according to the session in the access request The identity code of identification code and current server determines whether current server is being originally created for the affiliated session of access request Server creates the affiliated session of the access request if the access request does not carry session identification code, and generates correspondence Session identification code.
Specifically, in the present embodiment, step S102 includes:
Step b1 extracts the identity code for being originally created server from the session identification code in access request;
In the present embodiment, when receiving access request, equipment extracts original from the session identification code in the access request The identity code of file server, wherein it is to create the affiliated session of access request for the first time that this, which is originally created server, Server is stored with the session identification code of the affiliated session of the access request, and includes session identification code in the session identification code.
Step b2 obtains the identity code of current server, and determines that the identity code for being originally created server is It is no identical as the identity code of current server;
In the present embodiment, after extracting and being originally created the identity code of server, current server is obtained Identity code, and determine whether the identity code for being originally created server is identical as the identity code of current server, Determine whether current server is that the access request affiliated session is originally created server.
Step b3, if the identity code for being originally created server is identical as the identity code of current server, really Determine current server and be originally created server for the affiliated session of access request, otherwise determines that current server is not access request Affiliated session is originally created server.
In the present embodiment, if being originally created the identity code of server and the identity code phase of current server Together, it is determined that current server is originally created server for the affiliated session of access request, if being originally created the body of server Part identification code is different from the identity code of current server, it is determined that current server is not the original of the affiliated session of access request File server.
Step S103 asks access if current server is not that access request affiliated session is originally created server It asks to be forwarded to and is originally created server.
In the present embodiment, what equipment determined current server not and be the affiliated session of access request is originally created server, then Access request is forwarded to and is originally created server, server is originally created by this, access request is handled, i.e., to this Session identification code in access request is verified, specially determine in original server the session identification code that stores whether with this Session identification code matching in access request, if the meeting in the session identification code stored in original server and the access request Talk about identification code matching, it is determined that the affiliated session of the access request exists, then the access request is responded, if in original server The session identification code of storage and the session identification code in the access request mismatch, it is determined that the affiliated session of the access request is not In the presence of.
Further, in this embodiment after step S102, further includes:
Step c, if be originally created server of the current server for the affiliated session of access request, in authentication-access request Session identification code;
In the present embodiment, if current server is originally created server for the affiliated session of access request, by current Session identification code in the server authentication access request is deposited in the session identification code in the access request and current server Whether the session identification code of storage is identical, if the session stored in the session identification code in the access request and current server is known Other code is identical, it is determined that the session identification code in access request passes through verifying.
Step d when the session identification code in access request passes through verifying, handles access request.
In the present embodiment, when the session identification code in access request passes through verifying, access is handled by current server and is asked It asks, and after handling the access request, response message is returned into client.To the session identification code in the access request into Row verifying, improves the safety of access.
In the present embodiment, the present invention receives the configuration file of input, and according to the configuration file, in configuration server cluster The identity code of each server, then when receiving access request, according to the session identification code in access request and currently The identity code of server, determines whether current server is that access request affiliated session is originally created server, if Current server is not that access request affiliated session is originally created server, then access request is forwarded to described be originally created Server, due to by the access request of same user concentrate on for the first time create access request session server process, then without It need to consider the stationary problem of session information, and not access third party database, reduce system complexity, reduce development cost and people Power cost.
Further, referring to Fig. 3, it is based on above-mentioned first embodiment, proposes the of access request retransmission method of the present invention Two embodiments, the difference with previous embodiment are, before step S102, the access request retransmission method further include:
Step S104 determines whether access request carries session knowledge when receiving the access request of client transmission Other code;
It should be noted that the present invention is based on previous embodiments to propose a kind of specific generating mode of session identification code, It is only explained below, it is other to can refer to previous embodiment.
In the present embodiment, when receiving the access request of client transmission, equipment determines whether the access request carries There is session identification code, if the access request carries session identification code, thens follow the steps S102, i.e., according in access request The identity code of session identification code and current server determines whether current server is the original of the affiliated session of access request Server is created, if current server is originally created server for the affiliated session of access request, by current server The access request is managed, if current server is not that access request affiliated session is originally created server, by access request It is forwarded to and is originally created server, by being originally created the server process access request.
Step S105, if access request does not carry session identification code, according to working as server each in server cluster Preceding load session number is originally created server to access request distribution;
In the present embodiment, if the access request does not carry session identification code, according to respectively being serviced in server cluster The present load session number of device is originally created server to access request distribution, specifically, respectively services according in server cluster The present load session number of device determines the distribution priority of each server, then determines the server for distributing highest priority For the server that is originally created of access request, and server will be originally created and distribute to access request.
Step S106, by access request be forwarded to it is described be originally created server, by being originally created server creation access The session of request, and according to the identity code for being originally created server, generate session identification code.
In the present embodiment, after being originally created server to access request distribution, access request is forwarded to the original wound Server is built, the session of server creation access request is originally created by this, and according to the identification for being originally created server Code generates session identification code, that is, generates the random number of one group of presetting digit capacity, record current creation time, and obtain the original wound The identity code for building server is then based on the random number, current creation time and identity code, and generating includes original wound Build the session identification code of the identity code of server.
In the present embodiment, the present invention creates session when access request does not carry session identification code, and based on service The identity code of device generates the session identification code comprising the identity code, convenient for subsequent based in the session identification code The access request for belonging to the session is concentrated on same server by identity code, without considering session identification code in each clothes The Preserving problems of business device.
Further, referring to Fig. 4, above-mentioned first or second embodiments is based on, access request forwarding side of the present invention is proposed The 3rd embodiment of method, the difference with previous embodiment be, the access request retransmission method further include:
Step 107, the spare time of each session identification code of each server storage in server cluster is obtained with interval preset time Set the idle duration of maximum of record duration and each session identification code;
It should be noted that the present invention is based on previous embodiments to propose a kind of specific deletion mode of session identification code, It is only explained below, other can refer to previous embodiment.
In the present embodiment, each session identification code of each server storage in server cluster is obtained with interval preset time The maximum of idle record duration and each session identification code is left unused duration, wherein a length of session identification code is not when the idle record The duration used.It should be noted that above-mentioned preset time and maximum idle duration can be by those skilled in the art's bases It is configured in actual conditions, the present embodiment is not especially limited this.
Step 108, the session identification code that idle record duration is more than maximum idle duration is deleted.
In the present embodiment, it is more than that the session of the idle duration of the maximum is known that idle record duration is selected from each session identification code Other code, and delete the session identification code that idle record duration is more than maximum idle duration.
In the present embodiment, the present invention can be more than maximum idle duration in the idle record duration of session identification code, i.e., can When talking about identification code failure, session identification code is deleted, storage resource is discharged, improves the utilization rate of storage resource.
In addition, the embodiment of the present invention also provides a kind of access request retransmission unit.
It is the functional block diagram of access request retransmission unit first embodiment of the present invention referring to Fig. 5, Fig. 5.
Access request retransmission unit of the present invention is virtual bench, is stored in the storage of access request forwarding device shown in Fig. 1 It is functional for realizing the institute of access request retransmission process in device 1005;The configuration file of input is received, and according to the configuration File, the identity code of each server in configuration server cluster;When receiving the access request of client transmission, according to The identity code of session identification code and current server in the access request determines whether current server is the visit That asks session belonging to requesting is originally created server;If current server is not being originally created for the affiliated session of the access request The access request is then forwarded to and described is originally created server by server.
Specifically, in the present embodiment, the access request retransmission unit includes:
Reception configuration module 101, configuration file for receiving input, and according to the configuration file, configuration server The identity code of each server in cluster;
Receive determining module 102, for when receive client transmission access request when, according in the access request Session identification code and current server identity code, determine whether current server is the affiliated session of the access request Be originally created server;
Access request forwarding module 103, if for current server not being the original wound of the affiliated session of the access request Server is built, then the access request is forwarded to and described is originally created server.
Further, the reception configuration module 101 is also used to:
The network address of each server in server cluster is obtained, and obtains network address and body from the configuration file The mapping table of part identification code;
The mapping table is inquired, by the corresponding identity code of the network address of each server, is allocated to each service Device.
Further, the reception determining module 102 is also used to:
The identity code for being originally created server is extracted from the session identification code in the access request;
Obtain current server identity code, and determine described in be originally created server identity code whether with The identity code of current server is identical;
If the identity code for being originally created server is identical as the identity code of current server, it is determined that when Preceding server is originally created server for the affiliated session of the access request, otherwise determines that current server is not the access Session belonging to requesting is originally created server.
Further, the access request retransmission unit further include:
The reception determining module 102 is also used to determine the access when receiving the access request of client transmission Whether request carries session identification code;
The reception determining module 102, if being also used to the access request carries session identification code, according to the visit The identity code for asking the session identification code and current server in request, determines whether current server is the access request Affiliated session is originally created server;
Distribution module, if not carrying session identification code for the access request, according to respectively being taken in server cluster The present load session number of business device is originally created server to access request distribution;
The access request forwarding module 103, be also used to for the access request being forwarded to it is described be originally created server, By the session for being originally created server and creating the access request, and according to the identification for being originally created server Code generates session identification code.
Further, the distribution module is also used to:
According to the present load session number of server each in server cluster, the distribution priority of each server is determined;
The server for distributing highest priority is determined as to the server that is originally created of the access request, and by the original File server distributes to the access request.
Further, the access request retransmission unit further include:
Module is obtained, for obtaining each session identification code of each server storage in server cluster with interval preset time Idle record duration and each session identification code maximum leave unused duration;
Removing module, for deleting the session identification code that the idle record duration is more than the maximum idle duration.
Further, the access request retransmission unit further include:
Authentication module is tested if being originally created server for current server for the affiliated session of the access request Demonstrate,prove the session identification code in the access request;
Processing module handles the access request when passing through verifying for the session identification code in the access request.
Wherein, the function of modules is realized and above-mentioned access request retransmission method reality in above-mentioned access request retransmission unit It is corresponding to apply each step in example, function and realization process no longer repeat one by one here.
In addition, the embodiment of the present invention also provides a kind of readable storage medium storing program for executing.
Access request retransmission process is stored on readable storage medium storing program for executing of the present invention, wherein the access request retransmission process quilt When processor executes, realize such as the step of above-mentioned access request retransmission method.
Wherein, access request retransmission process, which is performed realized method, can refer to access request retransmission method of the present invention Each embodiment, details are not described herein again.
It should be noted that, in this document, the terms "include", "comprise" or its any other variant are intended to non-row His property includes, so that the process, method, article or the system that include a series of elements not only include those elements, and And further include other elements that are not explicitly listed, or further include for this process, method, article or system institute it is intrinsic Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including being somebody's turn to do There is also other identical elements in the process, method of element, article or system.
The serial number of the above embodiments of the invention is only for description, does not represent the advantages or disadvantages of the embodiments.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side Method can be realized by means of software and necessary general hardware platform, naturally it is also possible to by hardware, but in many cases The former is more preferably embodiment.Based on this understanding, technical solution of the present invention substantially in other words does the prior art The part contributed out can be embodied in the form of software products, which is stored in one as described above In storage medium (such as ROM/RAM, magnetic disk, CD), including some instructions are used so that terminal device (it can be mobile phone, Computer, server, air conditioner or network equipment etc.) execute method described in each embodiment of the present invention.
The above is only a preferred embodiment of the present invention, is not intended to limit the scope of the invention, all to utilize this hair Equivalent structure or equivalent flow shift made by bright specification and accompanying drawing content is applied directly or indirectly in other relevant skills Art field, is included within the scope of the present invention.

Claims (10)

1. a kind of access request retransmission method, which is characterized in that be applied to server cluster, the access request retransmission method packet Include following steps:
The configuration file of input is received, and according to the configuration file, the identification of each server in configuration server cluster Code;
When receiving the access request of client transmission, according to the session identification code and current server in the access request Identity code, determine whether current server is that the access request affiliated session is originally created server;
If current server is not that the access request affiliated session is originally created server, the access request is forwarded Server is originally created to described.
2. access request retransmission method as described in claim 1, which is characterized in that according to the configuration file, configuration service The step of identity code of each server, includes: in device cluster
The network address of each server in server cluster is obtained, and obtains network address and identity knowledge from the configuration file The mapping table of other code;
The mapping table is inquired, by the corresponding identity code of the network address of each server, is allocated to each server.
3. access request retransmission method as described in claim 1, which is characterized in that known according to the session in the access request The identity code of other code and current server, determine current server whether be the affiliated session of the access request original wound The step of building server include:
The identity code for being originally created server is extracted from the session identification code in the access request;
Obtain current server identity code, and determine described in be originally created server identity code whether with currently The identity code of server is identical;
If the identity code for being originally created server is identical as the identity code of current server, it is determined that current clothes Business device is originally created server for the affiliated session of the access request, otherwise determines that current server is not the access request Affiliated session is originally created server.
4. access request retransmission method as claimed in any one of claims 1-3, which is characterized in that according to the access request In session identification code and current server identity code, determine whether current server is meeting belonging to the access request Words the step of being originally created server before, further includes:
When receiving the access request of client transmission, determine whether the access request carries session identification code;
If the access request carries session identification code, then follow the steps: according to the session identification code in the access request With the identity code of current server, determine whether current server is that the access request affiliated session is originally created clothes Business device;
If the access request does not carry session identification code, according to the present load session of server each in server cluster Number is originally created server to access request distribution;
By the access request be forwarded to it is described be originally created server, by it is described be originally created server and create the access ask The session asked, and according to the identity code for being originally created server, generate session identification code.
5. access request retransmission method as claimed in claim 4, which is characterized in that described according to respectively being serviced in server cluster The present load session number of device, distributing the step of being originally created server to the access request includes:
According to the present load session number of server each in server cluster, the distribution priority of each server is determined;
The server for distributing highest priority is determined as to the server that is originally created of the access request, and by the original wound It builds server and distributes to the access request.
6. access request retransmission method as claimed in any one of claims 1-3, which is characterized in that the access request forwarding Method further include:
The idle record duration of each session identification code of each server storage in server cluster is obtained with interval preset time, with And the idle duration of maximum of each session identification code;
Delete the session identification code that the idle record duration is more than the maximum idle duration.
7. access request retransmission method as claimed in any one of claims 1-3, which is characterized in that according to the access request In session identification code and current server identity code, determine whether current server is meeting belonging to the access request Words the step of being originally created server after, further includes:
If current server is originally created server for the affiliated session of the access request, verify in the access request Session identification code;
When session identification code in the access request passes through verifying, the access request is handled.
8. a kind of access request retransmission unit, which is characterized in that the access request retransmission unit includes:
Receive configuration module, configuration file for receiving input, and according to the configuration file, it is each in configuration server cluster The identity code of server;
Receive determining module, for when receive client transmission access request when, according to the session in the access request The identity code of identification code and current server determines whether current server is the original of the affiliated session of the access request Create server;
Access request forwarding module, if not being that the affiliated session of the access request is originally created service for current server The access request is then forwarded to and described is originally created server by device.
9. a kind of access request forwarding device, which is characterized in that the access request forwarding device include processor, memory, And it is stored in the access request retransmission process that can be executed on the memory and by the processor, wherein the access request When retransmission process is executed by the processor, realizing the access request retransmission method as described in any one of claims 1 to 7 Step.
10. a kind of readable storage medium storing program for executing, which is characterized in that access request retransmission process is stored on the readable storage medium storing program for executing, When wherein the access request retransmission process is executed by processor, realize that the access as described in any one of claims 1 to 7 is asked The step of seeking retransmission method.
CN201810622931.3A 2018-06-15 2018-06-15 Access request retransmission method, device, equipment and readable storage medium storing program for executing Pending CN109729139A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810622931.3A CN109729139A (en) 2018-06-15 2018-06-15 Access request retransmission method, device, equipment and readable storage medium storing program for executing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810622931.3A CN109729139A (en) 2018-06-15 2018-06-15 Access request retransmission method, device, equipment and readable storage medium storing program for executing

Publications (1)

Publication Number Publication Date
CN109729139A true CN109729139A (en) 2019-05-07

Family

ID=66293872

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810622931.3A Pending CN109729139A (en) 2018-06-15 2018-06-15 Access request retransmission method, device, equipment and readable storage medium storing program for executing

Country Status (1)

Country Link
CN (1) CN109729139A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110191165A (en) * 2019-05-20 2019-08-30 深圳前海微众银行股份有限公司 A kind of processing code executes the method and device of request
CN110955718A (en) * 2019-12-04 2020-04-03 深圳市网心科技有限公司 Data visualization configuration method, server, system and medium
CN111769939A (en) * 2020-06-29 2020-10-13 北京海泰方圆科技股份有限公司 Business system access method and device, storage medium and electronic equipment
WO2022143104A1 (en) * 2020-12-29 2022-07-07 华为技术有限公司 Packet processing method and apparatus

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150215278A1 (en) * 2014-01-30 2015-07-30 Comcast Cable Communications, Llc Autonomous configuration of device and service identifiers
CN105472002A (en) * 2015-12-09 2016-04-06 国家电网公司 Session synchronization method based on instant copying among cluster nodes
CN105610853A (en) * 2016-01-18 2016-05-25 网易(杭州)网络有限公司 Communication method and system, and application server
CN106101290A (en) * 2016-08-25 2016-11-09 Tcl集团股份有限公司 A kind of method and system of server cluster management
CN107295086A (en) * 2017-06-28 2017-10-24 杭州云英网络科技有限公司 Collect group session anti-loss method and system
CN107995304A (en) * 2017-12-13 2018-05-04 杭州迪普科技股份有限公司 A kind of session keeping method and device based on cookie

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150215278A1 (en) * 2014-01-30 2015-07-30 Comcast Cable Communications, Llc Autonomous configuration of device and service identifiers
CN105472002A (en) * 2015-12-09 2016-04-06 国家电网公司 Session synchronization method based on instant copying among cluster nodes
CN105610853A (en) * 2016-01-18 2016-05-25 网易(杭州)网络有限公司 Communication method and system, and application server
CN106101290A (en) * 2016-08-25 2016-11-09 Tcl集团股份有限公司 A kind of method and system of server cluster management
CN107295086A (en) * 2017-06-28 2017-10-24 杭州云英网络科技有限公司 Collect group session anti-loss method and system
CN107995304A (en) * 2017-12-13 2018-05-04 杭州迪普科技股份有限公司 A kind of session keeping method and device based on cookie

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110191165A (en) * 2019-05-20 2019-08-30 深圳前海微众银行股份有限公司 A kind of processing code executes the method and device of request
CN110191165B (en) * 2019-05-20 2023-05-12 深圳前海微众银行股份有限公司 Method and device for processing code execution request
CN110955718A (en) * 2019-12-04 2020-04-03 深圳市网心科技有限公司 Data visualization configuration method, server, system and medium
CN111769939A (en) * 2020-06-29 2020-10-13 北京海泰方圆科技股份有限公司 Business system access method and device, storage medium and electronic equipment
CN111769939B (en) * 2020-06-29 2021-02-09 北京海泰方圆科技股份有限公司 Business system access method and device, storage medium and electronic equipment
WO2022143104A1 (en) * 2020-12-29 2022-07-07 华为技术有限公司 Packet processing method and apparatus

Similar Documents

Publication Publication Date Title
CN103384237B (en) Method for sharing IaaS cloud account, shared platform and network device
CN109729139A (en) Access request retransmission method, device, equipment and readable storage medium storing program for executing
CN110278187A (en) Multiple terminals single-point logging method, system, sync server and medium
CN105516086B (en) Method for processing business and device
CN110661829B (en) File downloading method and device, client and computer readable storage medium
CN107888787B (en) Method and device for processing media access request
CN104754153A (en) Customer service system and customer service method thereof
US8942673B2 (en) Method and apparatus for providing cellphone service from any device
CN107770269A (en) A kind of service response method and its terminal
CN110008019B (en) Method, device and system for sharing server resources
CN107622771A (en) Home appliance and its control method, system and computer-readable recording medium
CN109561054A (en) A kind of data transmission method, controller and access device
CN111935017B (en) Cross-network application calling method and device and routing equipment
CN107395559A (en) Data processing method and equipment based on redis
CN106453349A (en) An account number login method and apparatus
CN105224541B (en) Uniqueness control method, information storage means and the device of data
CN108600564A (en) The method and apparatus of customer service
CN105357239A (en) Method and device for providing service, and method and device for acquiring service
CN104253702B (en) A kind of terminal management method and system
CN105871851B (en) Based on SaaS identity identifying method
CN104731660A (en) Data distribution method, device and system
CN108124021A (en) Internet protocol IP address obtains, the method, apparatus and system of website visiting
CN110673970A (en) Cross-process calling system and method based on web application
CN110378680A (en) A kind of data processing method, device, storage medium and server
CN109474626A (en) A kind of method for network authorization and device based on SNS

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

Application publication date: 20190507