CN116016640A - Session holding method and device, electronic equipment and storage medium - Google Patents
Session holding method and device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN116016640A CN116016640A CN202211723658.6A CN202211723658A CN116016640A CN 116016640 A CN116016640 A CN 116016640A CN 202211723658 A CN202211723658 A CN 202211723658A CN 116016640 A CN116016640 A CN 116016640A
- Authority
- CN
- China
- Prior art keywords
- online
- member port
- port
- list
- ports
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 50
- 238000012163 sequencing technique Methods 0.000 claims abstract description 12
- 238000012423 maintenance Methods 0.000 claims abstract description 4
- 238000004590 computer program Methods 0.000 claims description 9
- 238000004891 communication Methods 0.000 abstract description 4
- 238000010586 diagram Methods 0.000 description 10
- 230000006870 function Effects 0.000 description 5
- 230000002776 aggregation Effects 0.000 description 4
- 238000004220 aggregation Methods 0.000 description 4
- 230000003247 decreasing effect Effects 0.000 description 4
- 238000012545 processing Methods 0.000 description 4
- 230000009471 action Effects 0.000 description 3
- 230000008569 process Effects 0.000 description 3
- 238000012217 deletion Methods 0.000 description 2
- 230000037430 deletion Effects 0.000 description 2
- 238000006467 substitution reaction Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000011160 research Methods 0.000 description 1
Images
Landscapes
- Computer And Data Communications (AREA)
Abstract
The embodiment of the invention provides a session maintaining method, a session maintaining device, electronic equipment and a storage medium, and relates to the technical field of communication, wherein the method comprises the following steps: determining all the member ports for maintaining the traffic session, sequencing the member ports according to the sequence, repeating for N times to obtain a reference list, determining the member ports to be replaced when the dropped member ports exist in the reference list, replacing the dropped member ports based on the member ports to be replaced and the reference list to obtain an online member list, and maintaining the traffic session based on the online member list. When the member port selected by the current flow is disconnected, the current flow can be uniformly distributed to other member ports working normally, so that session maintenance is realized.
Description
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a session maintaining method, a session maintaining device, an electronic device, and a storage medium.
Background
In the existing load balancing application scenario, there are mainly equivalent links (Equal Cost Multi Path, ECMP) and link aggregation (Link Aggregation Group, LAG), the ECMP is three-layer equivalent routing, and the LAG is two-layer application scenario. In data center applications, traffic needs to be directed to different servers for processing through load balancing. Meanwhile, the operation of flexibly increasing and decreasing the servers is needed according to the load condition of the current server, and the operation of increasing and decreasing the servers is the addition and deletion of the member ports for the load balancing member table.
When the member ports are added and deleted, the server accessed by the existing traffic is affected, so that the customer experience is deteriorated, and therefore, the session is significant in the scene.
Disclosure of Invention
The invention aims to provide a session keeping method, a session keeping device, electronic equipment and a storage medium, which can realize session keeping when a currently selected member port is disconnected.
In order to achieve the above purpose, the technical solution adopted in the embodiment of the present application is as follows:
in a first aspect, an embodiment of the present application provides a session maintaining method, where the method includes:
determining all member ports for forwarding the traffic session;
sequencing the member ports according to the sequence, and repeating the sequencing for N times to obtain a reference ranking list;
when the dropped member ports exist in the reference list, determining the member ports to be replaced;
replacing the dropped member port based on the member port to be replaced and the reference list to obtain an online member list;
and maintaining the streaming session based on the online member list.
In an alternative embodiment, the method further comprises:
when the dropped member ports exist in the reference list, the dropped member ports are removed from all the member ports, and an online member port is obtained;
and taking the online member port as a member port to be replaced.
In an optional embodiment, the step of replacing the dropped member port based on the member port to be replaced and the reference list to obtain an online member list includes:
determining a target online member port adjacent to the last offline member port in the reference list;
ordering the online member ports by taking the target online member port as the head, and obtaining an online member port arrangement sequence;
and replacing each online member port in the reference list in turn by each online member port in the online member port arrangement sequence to obtain an online member list.
In an optional embodiment, when the number of dropped member ports is one, and the number of dropped member ports included in the reference list is two, the step of replacing each dropped member port in the reference list with each online member port in the online member port arrangement sequence sequentially to obtain an online member list includes:
determining a target online member port from the online member port arrangement sequence;
replacing a first target dropped member port in the reference list with the target online member port;
determining a next online member port of the target online member port in the online member port arrangement order;
and replacing a second target dropped member port in the reference list with a next online member port of the target online member port to obtain an online member list.
In an optional embodiment, the member port to be replaced is a spare member port corresponding to a preset different member port, and the step of replacing the dropped member port based on the member port to be replaced and the reference list to obtain an online member list includes:
determining a target standby member port corresponding to the dropped member port;
determining the sequence of the standby member ports in the target standby member ports;
and based on each standby member port in the standby member port sequence, sequentially replacing each dropped member port in the reference arrangement table to obtain an online member arrangement list.
In an alternative embodiment, the method further comprises:
when the dropped member port is restored to an online state, determining a position corresponding to the dropped member port in the reference list;
determining a target member port in the online member list that matches the location based on the location;
and replacing the dropped member port with the target member port.
In an alternative embodiment, the step of maintaining the traffic session based on the online member ranking list includes:
determining message information of a received message;
calculating a hash value of the message based on the message information;
determining a number of online member ports in the online member rank list;
performing touch operation based on the hash value and the number of the online member ports to obtain a touch value;
determining a target online member port from the online member list based on the touch value;
forwarding the message based on the target online member port, wherein the modulus value of each member port in the reference list is consistent with the modulus value of each online member port in the online member list.
In a second aspect, an embodiment of the present application provides a session maintaining apparatus, including:
a first determining module, configured to determine all member ports forwarding the traffic session;
the sequencing module is used for sequencing the member ports according to the sequence and repeating the sequencing for N times to obtain a reference ranking list;
the second determining module is used for determining a member port to be replaced when the dropped member port exists in the reference list;
the replacing module is used for replacing the dropped member ports based on the member ports to be replaced and the reference list to obtain an online member list;
and the session maintaining module is used for maintaining the streaming session based on the online member list.
In a third aspect, an embodiment of the present application provides an electronic device, including a memory storing a computer program and a processor implementing the steps of the session keeping method when the processor executes the computer program.
In a fourth aspect, embodiments of the present application provide a storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the session maintaining method.
The application has the following beneficial effects:
according to the method, all the member ports for maintaining the traffic session are determined, the member ports are ordered according to the sequence, N times are repeated to obtain a reference ranking list, when the dropped member ports exist in the reference ranking list, the member ports to be replaced are determined, the dropped member ports are replaced based on the member ports to be replaced and the reference ranking list, an online member ranking list is obtained, and the traffic session is maintained based on the online member ranking list. When the number of the member ports of the member group where the current flow is located is changed, the member ports selected by the current flow are unchanged, when the member ports selected by the current flow are dropped, the current flow can be uniformly distributed on other member ports in an online state, and when the number of the member ports of the group is increased (or the member ports which are dropped before are restored to the online state at present), the route selection of the flow which is forwarded at present is not affected. The invention can be realized by a relatively simple method, and the session can be realized by software on hardware equipment which does not support the session maintenance.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed in the embodiments will be briefly described below, it being understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and other related drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic block diagram of an electronic device according to an embodiment of the present invention;
fig. 2 is a schematic flow chart of a session maintaining method according to an embodiment of the present invention;
FIG. 3 is a diagram showing the reference arrangement of 6 member ports according to an embodiment of the present invention;
FIG. 4 is a second flow chart of a session maintaining method according to an embodiment of the present invention;
FIG. 5 is a third flow chart of a session keeping method according to an embodiment of the present invention;
FIG. 6 is a flowchart of a session keeping method according to an embodiment of the present invention;
FIG. 7 is a diagram showing the reference arrangement of 4 member ports according to an embodiment of the present invention;
FIG. 8 is a fifth flow chart of a session keeping method according to an embodiment of the present invention;
fig. 9 is a block diagram of a session maintaining apparatus according to an embodiment of the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments of the present invention. The components of the embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations.
Thus, the following detailed description of the embodiments of the invention, as presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. 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.
It should be noted that: like reference numerals and letters denote like items in the following figures, and thus once an item is defined in one figure, no further definition or explanation thereof is necessary in the following figures.
In the description of the present invention, it should be noted that, if the terms "upper", "lower", "inner", "outer", and the like indicate an azimuth or a positional relationship based on the azimuth or the positional relationship shown in the drawings, or the azimuth or the positional relationship in which the inventive product is conventionally put in use, it is merely for convenience of describing the present invention and simplifying the description, and it is not indicated or implied that the apparatus or element referred to must have a specific azimuth, be configured and operated in a specific azimuth, and thus it should not be construed as limiting the present invention.
Furthermore, the terms "first," "second," and the like, if any, are used merely for distinguishing between descriptions and not for indicating or implying a relative importance.
In the description of the present application, it should also be noted that, unless explicitly specified and limited otherwise, the terms "disposed," "mounted," "connected," and "connected" are to be construed broadly, and may be, for example, fixedly connected, detachably connected, or integrally connected; can be mechanically or electrically connected; can be directly connected or indirectly connected through an intermediate medium, and can be communication between two elements. The specific meaning of the terms in this application will be understood by those of ordinary skill in the art in a specific context.
Through a great deal of researches by the inventor, in the existing load balancing application scene, the equivalent links (Equal Cost Multi Path, ECMP) and link aggregation (Link Aggregation Group, LAG) are mainly available, the ECMP is a three-layer equivalent route, and the LAG is a two-layer application scene. In data center applications, traffic needs to be directed to different servers for processing through load balancing. Meanwhile, the operation of flexibly increasing and decreasing the servers is needed according to the load condition of the current server, and the operation of increasing and decreasing the servers is the addition and deletion of the member ports for the load balancing member table.
When the member ports are added and deleted, the server accessed by the existing traffic is affected, so that the customer experience is deteriorated, and therefore, the session is significant in the scene.
In view of the above-mentioned problems, the present embodiment provides a session maintaining method, apparatus, electronic device, and storage medium, where the session maintaining method, apparatus, electronic device, and storage medium are capable of obtaining a reference list by determining all member ports for maintaining a traffic session, ordering the member ports in order, and repeating N times, where when there are dropped member ports in the reference list, determining a member port to be replaced, replacing the dropped member port based on the member port to be replaced and the reference list, obtaining an online member list, and maintaining the traffic session based on the online member list. When the number of the member ports of the member group where the current flow is located is changed, the member ports selected by the current flow are unchanged, when the member ports selected by the current flow are dropped, the current flow can be uniformly distributed on other member ports in an online state, and when the number of the member ports of the group is increased (or the member ports which are dropped before are restored to the online state at present), the route selection of the flow which is forwarded at present is not affected. The invention can also be realized by a relatively simple method, and the session holding can be realized by software on hardware equipment which does not support the session holding, and the scheme provided by the embodiment is explained in detail below.
The embodiment provides an electronic device capable of holding a session. In one possible implementation, the electronic device may be a user terminal, for example, the electronic device may be, but is not limited to, a server, a smart phone, a personal computer (PersonalComputer, PC), a tablet, a personal digital assistant (Personal Digital Assistant, PDA), a mobile internet device (Mobile Internet Device, MID), or the like.
Referring to fig. 1, fig. 1 is a schematic structural diagram of an electronic device 100 according to an embodiment of the disclosure. The electronic device 100 may also include more or fewer components than shown in fig. 1, or have a different configuration than shown in fig. 1. The components shown in fig. 1 may be implemented in hardware, software, or a combination thereof.
The electronic device 100 comprises session holding means 110, a memory 120 and a processor 130.
The memory 120 and the processor 130 are electrically connected directly or indirectly to each other to realize data transmission or interaction. For example, the components may be electrically connected to each other via one or more communication buses or signal lines. The session maintaining means 110 comprises at least one software function module which may be stored in the memory 120 in the form of software or firmware (firmware) or cured in an Operating System (OS) of the electronic device 100. The processor 130 is configured to execute executable modules stored in the memory 120, such as software functional modules and computer programs included in the session holding device 110.
The Memory 120 may be, but is not limited to, a random access Memory (RandomAccess Memory, RAM), a Read Only Memory (ROM), a programmable Read Only Memory (Programmable Read-Only Memory, PROM), an erasable Read Only Memory (Erasable ProgrammableRead-Only Memory, EPROM), an electrically erasable Read Only Memory (Electric Erasable ProgrammableRead-Only Memory, EEPROM), etc. The memory 120 is configured to store a program, and the processor 130 executes the program after receiving an execution instruction.
Referring to fig. 2, fig. 2 is a flowchart of a session maintaining method applied to the electronic device 100 of fig. 1, and the method includes steps described in detail below.
Step 201: all member ports for forwarding the traffic session are determined.
Step 202: the member ports are ordered in sequence and repeated N times to obtain a reference ordered list.
Step 203: and when the dropped member ports exist in the reference list, determining the member ports to be replaced.
Step 204: and replacing the dropped member port based on the member port to be replaced and the reference list to obtain an online member list.
Step 205: the traffic session is maintained based on the online member ranking list.
All member ports forward the traffic session.
It should be noted that when the load balancing has N member ports, the number of member ports recorded and informed to the hardware by the software is not just N. This ensures a more uniform replacement.
In one example, when the number of member ports is 6, including member port 0, member port 1, member port 2, member port 3, member port 4, and member port 5, the ordering is in order based on the member ports. For example, the number of member ports recorded in the software and notified to the hardware is 16, and as shown in fig. 3, the reference arrangement of 6 member ports represents the intention, where the reference arrangement list includes member ports as member ports 0, 1, 2, 3, 4, and 5. And in the order 0123450123450123.
When a certain member port in the reference list drops, determining a member port to be replaced, wherein the member port to be replaced is used for replacing the dropped member port in the reference list to obtain an online member list, and processing the traffic session based on the online member list, so that the traffic of the online member port is ensured not to change.
There are various implementations for determining a member port to be replaced, and in one implementation, as shown in fig. 4, the method includes the following steps:
step 301: and when the dropped member ports exist in the reference list, eliminating the dropped member ports from all the member ports to obtain the online member ports.
Step 302: the online member port is used as a member port to be replaced.
In an example, when the member port 0 is a dropped member port in the reference list shown in fig. 3, and all the member ports included in the reference list are the member port 0, the member port 1, the member port 2, the member port 3, the member port 4 and the member port 5, the dropped member port 0 is removed from all the member ports, so as to obtain the member port 1, the member port 2, the member port 3, the member port 4 and the member port 5, and the member port 1, the member port 2, the member port 3, the member port 4 and the member port 5 are online member ports, and the online member port is used as a member port to be replaced, and the dropped member port is replaced based on the member port to be replaced.
There are various implementations of determining online member listings, in one implementation, as shown in FIG. 5, including the steps of:
step 204-1: and determining the target online member port adjacent to the last offline member port in the reference list.
Step 204-2: and ordering the online member ports by taking the target online member ports as the head, and obtaining the online member port arrangement sequence.
Step 204-3: and replacing each online member port in the reference list by each online member port in the online member port arrangement sequence in sequence to obtain an online member list.
Based on the specific manner of replacing each dropped member port in the reference list in the online member port arrangement order, this embodiment is exemplified in the case where the number of dropped member ports is one and the number of dropped member ports included in the reference list is two.
The specific alternative modes comprise: the target online member port is determined from the online member port ranking order. And replacing the first target dropped member port in the reference list with the target online member port. The next online member port of the target online member port is determined in the online member port ranking order. And replacing a second target dropped member port in the reference list with a next online member port of the target online member port to obtain an online member list.
In an example, when the reference list is the reference list as shown in fig. 3 and the dropped member port is the member port 2, it is determined that the target online member port adjacent to the last dropped member port 2 in the reference list is the member port 3. And taking the target online member port as the head, namely taking the member port 3 as the head, and sequencing all online member ports to obtain the online member port arrangement sequence, namely, the online member port arrangement sequence is 3, 4, 5, 0 and 1. And replacing each drop member port in the reference list by each online member port in the online member port arrangement sequence in turn, for example, replacing a first drop member port in the reference list by an online member port 3 in the online member port arrangement sequence, replacing a second drop member port in the reference list by an online member port 4 in the online member port arrangement sequence, replacing a third drop member port in the reference list by an online member port 5 in the online member port arrangement sequence, and replacing each drop member port in the reference list by each online member port in the online member port arrangement sequence until all drop member ports in the reference list are replaced, thereby obtaining the online member list.
In another example, when the reference list is as shown in fig. 3 and the dropped member ports are the member port 2 and the member port 3, determining that the target online member port adjacent to the last dropped member port 3 in the reference list is the member port 4, and ordering all online member ports by taking the target online member port as the head, namely taking the member port 4 as the head, to obtain an online member port arrangement sequence, namely, the online member port arrangement sequence is 4, 5, 0 and 1. Replacing each online member port in the reference list in turn by each online member port in the online member port arrangement sequence, for example: the method comprises the steps of replacing a dropped member port 2 ordered at the tail of a table in a reference ranking list with an online member port 4 in an online member port ranking sequence, replacing a dropped member port 3 ordered at the tail of the table in the reference ranking list with an online member port 5 in the online member port ranking sequence, ordering a dropped member port 2 at the head end in the reference ranking list with an online member port 0 in the online member port ranking sequence, and ordering a dropped member port 3 at the head end in the reference ranking list with an online member port 1 in the online member port ranking sequence. And obtaining the online member list after all the dropped member ports in the reference list are replaced completely.
In another example, when the reference list is as shown in fig. 3 and the dropped member ports are the member port 2 and the member port 3, determining that the target online member port adjacent to the last dropped member port 3 in the reference list is the member port 4, and ordering all online member ports by taking the target online member port as the head, namely taking the member port 4 as the head, to obtain an online member port arrangement sequence, namely, the online member port arrangement sequence is 4, 5, 0 and 1. Replacing each online member port in the reference list in turn by each online member port in the online member port arrangement sequence, for example: the online member ports 4 in the online member port arrangement sequence are replaced with the reference list and are ranked in the first offline member port 2, the online member ports 5 in the online member port arrangement sequence are replaced with the second offline member ports 3 in the reference list, the online member ports 0 in the online member port arrangement sequence are replaced with the reference list and the third offline member ports 2, and the online member ports 1 in the online member port arrangement sequence are replaced with the fourth offline member ports 3 in the reference list. And obtaining the online member list after all the dropped member ports in the reference list are replaced completely.
In another implementation of determining an online member ranking list, as shown in FIG. 6, the method comprises the steps of:
step 204-5: and determining a target standby member port corresponding to the dropped member port.
Step 204-6: and determining the sequence of the standby member ports in the target standby member ports.
Step 204-7: and replacing each dropped member port in the reference list in turn based on each standby member port in the standby member port sequence to obtain the online member list.
In one example, different dropped member ports are set to correspond to different spare member ports. For example: the spare member ports of the member port 0 are set as the member port 1 and the member port 3, the spare member ports of the member port 1 are set as the member port 0, the member port 2 and the member port 3, the spare member ports of the member port 1 are set as the member port 0 and the member port 3, and the spare member ports of the member port 3 are set as the member port 0 and the member port 2.
As shown in fig. 7, the reference arrangement of 4 member ports represents an intention, and the reference arrangement list in the figure includes member port 0, member port 1, member port 2, and member port 3, and the order is 0123012301230123.
When the member port 1 is a dropped member port, the standby member port corresponding to the member port 1 is determined, that is, the target standby member port corresponding to the dropped member port 1 is the member port 0, the member port 2 and the member port 3. And sequentially replacing each member port 1 in the reference list with the target standby member port to obtain an online member list.
In an example, when the member port 1 and the member port 2 are both dropped member ports, the spare member ports corresponding to the member port 1 and the spare member ports corresponding to the member port 2 are determined, that is, the member port 0, the member port 2 and the member port 3 are determined as first target spare member ports, and the member port 0 and the member port 3 are determined as second target spare member ports, because the member port 2 is a spare member port of the member port 1, the member port 2 is a dropped member port, and the first target spare member port and the second target spare member port are both the member port 0 and the member port 3. And sequentially replacing each member port 1 and each member port 2 in the reference list by the member port 0 and the member port 3. The order of the online member list is 0033003300330033.
In another example, the member ports 0 and 3 are used as the first target standby member ports, the member ports 0 and 3 are used as the second target standby member ports, the member ports in the first target standby member ports are sequentially replaced with the dropped member port 1, the member ports in the second target standby member ports are sequentially replaced with the dropped member port 2, and the obtained online member rank list is 0003033300030333.
When all drop ports are restored to the online state, the implementation manner of changing the online member list is changed, as shown in fig. 8, and includes the following steps:
step 401: and when the dropped member port is restored to the online state, determining the position corresponding to the dropped member in the reference list.
Step 402: based on the location, a target member port matching the location is determined in the online member list.
Step 403: and replacing the dropped member port with the target member port.
In one example, when the reference list is as shown in fig. 3, the member port order of the reference list is 0123450123450123, and the drop member port is member port 2, the online member list order is 0143450153450103. The corresponding locations of the drop member ports 2 are determined in the reference list to be location 3, location 9 and location 15. The target member ports corresponding to the position 3, the position 9 and the position 15 in the online member arrangement table are determined to be the target member port 4, the target member port 5 and the target member port 0 respectively. The dropped member port 2 is replaced with the target member port 4, the target member port 5, and the target member port 0, respectively.
In another example, when the reference list is as shown in fig. 3, and the dropped member ports are member port 2 and member port 3, the online member list order is 0101450145450145.
When the dropped member port 2 is restored to the online state, determining that the corresponding position of the dropped member port 2 is position 3, position 9 and position 15 in the reference list, determining that the corresponding target member ports of position 3, position 9 and position 15 in the online member list are target member port 0, target member port 4 and target member port 4, replacing the dropped member port 2 with the target member port 0, target member port 4 and target member port 4 respectively to obtain a first member port list, wherein the arrangement order of the first member port list is 0121450125450125, determining that the corresponding position of the dropped member port 3 is position 4, position 10 and position 16 in the first member port list based on the first member port list and the reference list, namely, based on the reference list 0123450123450123, and determining that the corresponding member ports of position 4, position 10 and position 16 in the first member port list are member ports 1, member port 5 and member port 5, and determining that the online member port arrangement order is when the member port 2 is restored to the online state: 0145, replacing the member port 0 corresponding to the first member port list position 4 with the member port 0 in the online member port arrangement sequence, replacing the member port 5 corresponding to the first member port list position 10 with the member port 1 in the online member port arrangement sequence, replacing the member port 5 corresponding to the first member port list position 16 with the member port 2 in the online member port arrangement sequence, obtaining a second member port list, and processing the traffic session based on the second member port list.
It should be noted that, the modulus value of each member port in the second member port list is consistent with the modulus value of each member port in the reference list, so that when the member port is dropped, the route selection of the current forwarded flow is not affected. .
Referring to fig. 9, an embodiment of the present application further provides a session holding apparatus 110 applied to the electronic device 100 shown in fig. 1, where the session holding apparatus 110 includes:
a first determining module 111, configured to determine all member ports forwarding the traffic session;
a ranking module 112, configured to rank the member ports in order, and repeat N times to obtain a reference ranking list;
a second determining module 113, configured to determine a member port to be replaced when there is a dropped member port in the reference list;
a replacing module 114, configured to replace the dropped member port based on the member port to be replaced and the reference list, to obtain an online member list;
the session keeping module 115 is configured to keep a traffic session based on the online member list.
The present application also provides an electronic device 100, the electronic device 100 comprising a processor 130 and a memory 120. The memory 120 stores computer-executable instructions that, when executed by the processor 130, implement the session maintenance method.
The embodiments of the present application also provide a computer-readable storage medium storing a computer program that, when executed by the processor 130, implements the session maintaining method.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners as well. The apparatus embodiments described above are merely illustrative, for example, flow diagrams and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, the functional modules in the embodiments of the present application may be integrated together to form a single part, or each module may exist alone, or two or more modules may be integrated to form a single part. The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
It is 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 the element.
The foregoing is merely various embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily think about changes or substitutions within the technical scope of the present application, and the changes and substitutions are intended to be covered in the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Claims (10)
1. A session maintenance method, the method comprising:
determining all member ports for forwarding the traffic session;
sequencing the member ports according to the sequence, and repeating the sequencing for N times to obtain a reference ranking list;
when the dropped member ports exist in the reference list, determining the member ports to be replaced;
replacing the dropped member port based on the member port to be replaced and the reference list to obtain an online member list;
and maintaining the streaming session based on the online member list.
2. The method according to claim 1, wherein the method further comprises:
when the dropped member ports exist in the reference list, the dropped member ports are removed from all the member ports, and an online member port is obtained;
and taking the online member port as a member port to be replaced.
3. The method according to claim 2, wherein the step of replacing the dropped member port based on the member port to be replaced and the reference list to obtain an online member list includes:
determining a target online member port adjacent to the last offline member port in the reference list;
ordering the online member ports by taking the target online member port as the head, and obtaining an online member port arrangement sequence;
and replacing each online member port in the reference list in turn by each online member port in the online member port arrangement sequence to obtain an online member list.
4. The method according to claim 3, wherein when the number of dropped member ports is one and the number of dropped member ports included in the reference list is two, the step of replacing each dropped member port in the reference list with each online member port in the online member port arrangement sequence sequentially to obtain an online member list includes:
determining a target online member port from the online member port arrangement sequence;
replacing a first target dropped member port in the reference list with the target online member port;
determining a next online member port of the target online member port in the online member port arrangement order;
and replacing a second target dropped member port in the reference list with a next online member port of the target online member port to obtain an online member list.
5. The method of claim 1, wherein the member ports to be replaced are spare member ports corresponding to preset different member ports, and the step of replacing the dropped member ports based on the member ports to be replaced and the reference list to obtain an online member list includes:
determining a target standby member port corresponding to the dropped member port;
determining the sequence of the standby member ports in the target standby member ports;
and replacing each dropped member port in the reference list in turn based on each standby member port in the standby member port sequence to obtain an online member list.
6. The method according to claim 1, wherein the method further comprises:
when the dropped member port is restored to an online state, determining a position corresponding to the dropped member port in the reference list;
determining a target member port in the online member list that matches the location based on the location;
and replacing the dropped member port with the target member port.
7. The method of claim 1, wherein the step of maintaining a traffic session based on the online member ranking list comprises:
determining message information of a received message;
calculating a hash value of the message based on the message information;
determining a number of online member ports in the online member rank list;
performing touch operation based on the hash value and the number of the online member ports to obtain a touch value;
determining a target online member port from the online member list based on the touch value;
forwarding the message based on the target online member port, wherein the modulus value of each member port in the reference list is consistent with the modulus value of each online member port in the online member list.
8. A session maintaining apparatus, the apparatus comprising:
a first determining module, configured to determine all member ports forwarding the traffic session;
the sequencing module is used for sequencing the member ports according to the sequence and repeating the sequencing for N times to obtain a reference ranking list;
the second determining module is used for determining a member port to be replaced when the dropped member port exists in the reference list;
the replacing module is used for replacing the dropped member ports based on the member ports to be replaced and the reference list to obtain an online member list;
and the session maintaining module is used for maintaining the streaming session based on the online member list.
9. An electronic device comprising a memory storing a computer program and a processor implementing the steps of the method of any one of claims 1-7 when the computer program is executed by the processor.
10. A storage medium having stored thereon a computer program, which when executed by a processor performs the steps of the method according to any of claims 1-7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211723658.6A CN116016640A (en) | 2022-12-30 | 2022-12-30 | Session holding method and device, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211723658.6A CN116016640A (en) | 2022-12-30 | 2022-12-30 | Session holding method and device, electronic equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116016640A true CN116016640A (en) | 2023-04-25 |
Family
ID=86029495
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211723658.6A Pending CN116016640A (en) | 2022-12-30 | 2022-12-30 | Session holding method and device, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116016640A (en) |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20120210416A1 (en) * | 2011-02-16 | 2012-08-16 | Fortinet, Inc. A Delaware Corporation | Load balancing in a network with session information |
CN108965006A (en) * | 2018-07-18 | 2018-12-07 | 迈普通信技术股份有限公司 | A kind of communication reliability improvement method and device |
CN109347623A (en) * | 2018-10-18 | 2019-02-15 | 盛科网络(苏州)有限公司 | Conversate the method and device of holding in a kind of application of balancing link load |
JP2019201342A (en) * | 2018-05-17 | 2019-11-21 | 富士通株式会社 | Verification packet generation device, verification system, and verification packet generation program |
US11128561B1 (en) * | 2019-07-29 | 2021-09-21 | Innovium, Inc. | Auto load balancing |
WO2022057514A1 (en) * | 2020-09-18 | 2022-03-24 | 中兴通讯股份有限公司 | Link fault detection method and apparatus and computer-readable storage medium |
CN114338538A (en) * | 2021-12-30 | 2022-04-12 | 锐捷网络股份有限公司 | Table item updating method and device, electronic equipment and storage medium |
CN115277884A (en) * | 2022-07-14 | 2022-11-01 | 苏州盛科通信股份有限公司 | Subnet replacement method and device, exchange chip, electronic equipment and storage medium |
-
2022
- 2022-12-30 CN CN202211723658.6A patent/CN116016640A/en active Pending
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20120210416A1 (en) * | 2011-02-16 | 2012-08-16 | Fortinet, Inc. A Delaware Corporation | Load balancing in a network with session information |
JP2019201342A (en) * | 2018-05-17 | 2019-11-21 | 富士通株式会社 | Verification packet generation device, verification system, and verification packet generation program |
CN108965006A (en) * | 2018-07-18 | 2018-12-07 | 迈普通信技术股份有限公司 | A kind of communication reliability improvement method and device |
CN109347623A (en) * | 2018-10-18 | 2019-02-15 | 盛科网络(苏州)有限公司 | Conversate the method and device of holding in a kind of application of balancing link load |
US11128561B1 (en) * | 2019-07-29 | 2021-09-21 | Innovium, Inc. | Auto load balancing |
WO2022057514A1 (en) * | 2020-09-18 | 2022-03-24 | 中兴通讯股份有限公司 | Link fault detection method and apparatus and computer-readable storage medium |
CN114338538A (en) * | 2021-12-30 | 2022-04-12 | 锐捷网络股份有限公司 | Table item updating method and device, electronic equipment and storage medium |
CN115277884A (en) * | 2022-07-14 | 2022-11-01 | 苏州盛科通信股份有限公司 | Subnet replacement method and device, exchange chip, electronic equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108566296B (en) | Network device layering method, network management device and computer readable storage medium | |
CN106997431B (en) | Data processing method and device | |
CN109102273B (en) | Method and system for realizing distributed intelligent payment routing | |
CN104426968B (en) | Data managing method and device | |
CN108875035B (en) | Data storage method of distributed file system and related equipment | |
CN108337739A (en) | Establish method and device, the data processing method of wireless debugging connection | |
CN116016640A (en) | Session holding method and device, electronic equipment and storage medium | |
CN113050735A (en) | Method and device for controlling wine cabinet and intelligent wine cabinet | |
CN101562574A (en) | Method for updating routing list and device thereof | |
CN108781189B (en) | Load balancing method and related equipment | |
CN102300177A (en) | terminal, server and identification code updating method | |
CN107547378B (en) | VPN route learning method and device | |
CN111954300B (en) | Offline positioning method, device, equipment and storage medium | |
CN107016548B (en) | Client system, information processing method, reading and writing method and device | |
CN101674251B (en) | Method for upgrade processing for recursive router, device and router therefor | |
CN109005301B (en) | Intermediate number management and control method and intermediate number management and control device | |
US8386452B2 (en) | Data combination system and data combination method | |
CN111130871B (en) | Protection switching method and device and network equipment | |
CN102685005B (en) | Method for routing and router | |
CN103685034A (en) | Routing management method and nodes | |
CN201893809U (en) | Data transmission system based on three-tier architecture | |
CN108206782B (en) | Message forwarding method, device, chip and server | |
CN107026888A (en) | Large Volume Data conveyer and method | |
CN116074231B (en) | Message forwarding path determining method, device, network equipment and storage medium | |
CN111046249A (en) | Data storage, positioning and application method and related device |
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 |