CN111629074B - Session sequencing method and device of gateway equipment - Google Patents

Session sequencing method and device of gateway equipment Download PDF

Info

Publication number
CN111629074B
CN111629074B CN202010743173.8A CN202010743173A CN111629074B CN 111629074 B CN111629074 B CN 111629074B CN 202010743173 A CN202010743173 A CN 202010743173A CN 111629074 B CN111629074 B CN 111629074B
Authority
CN
China
Prior art keywords
period
value
session
sorting
session information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010743173.8A
Other languages
Chinese (zh)
Other versions
CN111629074A (en
Inventor
刘小伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuhan Sipuling Technology Co Ltd
Original Assignee
Wuhan Sipuling Technology 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 Wuhan Sipuling Technology Co Ltd filed Critical Wuhan Sipuling Technology Co Ltd
Priority to CN202010743173.8A priority Critical patent/CN111629074B/en
Publication of CN111629074A publication Critical patent/CN111629074A/en
Application granted granted Critical
Publication of CN111629074B publication Critical patent/CN111629074B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/66Arrangements for connecting between networks having differing types of switching systems, e.g. gateways

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention relates to the technical field of gateway session sequencing, and discloses a session sequencing method of gateway equipment, which comprises the following steps: traversing all session information according to the sorting attribute selected by the user, and searching a maximum value and a minimum value of the sorting attribute; dividing the session information into periods according to the sorting attribute value, the sorting attribute maximum value and the sorting attribute minimum value of the session information; defining a period array with a set size, counting the number of session information contained in each period, taking the period number as the serial number of an array element, taking the number of the session information contained in the period as the value of a corresponding array element, and establishing the period array; acquiring a sequencing position range of the conversations to be sequenced, and screening out a conversation list of the conversations to be sequenced by combining the array in the period; recording a session pointer of each session information in the session list, and establishing a pointer array; and addressing and sorting the session to be sorted according to the pointer array. The invention has the technical effect of high conversation sequencing efficiency.

Description

Session sequencing method and device of gateway equipment
Technical Field
The invention relates to the technical field of gateway session sequencing, in particular to a method and a device for sequencing sessions of gateway equipment and a computer storage medium.
Background
With the rapid development of network technology, the session handled by the gateway device is getting larger and larger, and it is expected by an administrator or a user that it can be sorted (in an ascending or descending order) based on the IPv4 address, port, application ID, and the like, and can be viewed quickly. When sessions reach the tens of millions (or even larger), using conventional sorting methods requires at least n log2n computations, where n is the number of sessions, which is very time consuming and also takes up a large amount of memory.
Disclosure of Invention
The invention aims to overcome the technical defects, provides a session sequencing method and device of gateway equipment and a computer storage medium, and solves the technical problems of large session sequencing calculation amount, long time consumption and large memory occupation in the prior art.
In order to achieve the above technical object, a technical solution of the present invention provides a session ordering method for a gateway device, including the following steps:
traversing all session information in the session linked list according to the sorting attribute selected by the user, and searching for a maximum sorting attribute value and a minimum sorting attribute value;
dividing the session information into periods according to the sorting attribute value, the sorting attribute maximum value and the sorting attribute minimum value of the session information;
defining a period array with a set size, counting the number of session information contained in each period, taking the period number as the serial number of an array element, taking the number of the session information contained in the period as the value of a corresponding array element, and establishing the period array;
acquiring a sorting position range of the conversations to be sorted selected by the user, and screening out a conversation list of the conversations to be sorted by combining the period array;
recording a session pointer of each session information in the session list, and establishing a pointer array;
and addressing the session to be sorted according to the pointer array and sorting the session.
The invention also provides a session sequencing device of the gateway equipment, which comprises a processor and a memory, wherein the memory is stored with a computer program, and the computer program is executed by the processor to realize the session sequencing method of the gateway equipment.
The present invention also provides a computer storage medium having a computer program stored thereon, which, when executed by a processor, implements a session ordering method for the gateway device.
Compared with the prior art, the invention has the beneficial effects that: the method and the device firstly search the maximum value and the minimum value of the ordering attribute based on the ordering attribute selected by the user, and can divide the period of part of session information based on the maximum value and the minimum value of the ordering attribute, thereby establishing a period array with a set size, and realizing the primary ordering classification according to the ordering attribute, wherein the period number is the ordering number. After the preliminary sorting, the sessions to be sorted can be quickly screened according to the array in the period, and corresponding session pointers are recorded after screening, so that the quick addressing sorting can be carried out. The division precision of the period, namely the size of the period array can be reasonably set according to the residual capacity of the memory, and when the memory is insufficient, a smaller period array can be defined, so that the occupation requirement of the conversation sequencing on the memory is reduced.
Drawings
Fig. 1 is a flowchart of an embodiment of a session ordering method of a gateway device provided in the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Example 1
As shown in fig. 1, embodiment 1 of the present invention provides a session ordering method for a gateway device, including the following steps:
s1, traversing all session information in the session linked list according to the sorting attribute selected by the user, and searching the maximum value and the minimum value of the sorting attribute;
s2, dividing the session information according to the sorting attribute value, the sorting attribute maximum value and the sorting attribute minimum value of the session information;
s3, defining a period array with a set size, counting the number of session information contained in each period, taking the period number as the serial number of an array element, taking the number of the session information contained in the period as the value of a corresponding array element, and establishing the period array;
s4, acquiring the sequencing position range of the to-be-sequenced conversation selected by the user, and screening out a conversation list of the to-be-sequenced conversation by combining the period array;
s5, recording a session pointer of each session information in the session list, and establishing a pointer array;
and S6, addressing the session to be sorted according to the pointer array and sorting the session.
Specifically, in this embodiment, the sorting attribute selected by the user is the IPv4 source address, and the maximum value and the minimum value of the IPv4 source address are found by traversing all session information according to the IPv4 source address; defining a period array containing 10 ten thousand integer value elements, preferably using the stack space of a program, occupying about 390KB, and regarding each array element as a period category; traversing all the session information again, counting the number of sessions contained in each period according to the sorting attribute value, and realizing the establishment of the period array; defining a pointer array containing 10 ten thousand pointer type elements, preferably adopting a program stack space, occupying about 390KB, and determining the position of the session information needing to be sorted in the array in the period according to a sorting position range of a session interval selected by an administrator or a user; the selected 10 ten thousand sessions are sorted using an open source sorting algorithm, and session information desired by an administrator or a user is output.
The invention reduces the sequencing range through the array during the establishment, rapidly screens out the conversation items to be sequenced, and can rapidly sequence massive conversations through a small amount of memory, thereby improving the efficiency of a manager or a user for checking the conversation information.
Because the memory occupies less, the invention is very effective for some embedded gateways with lower CPU main frequency and smaller memory, and is also effective for high-end gateway equipment with higher CPU main frequency and sufficient memory. When the memory is relatively abundant, the sizes of the period array and the pointer array may be adjusted to be large, for example, the period array including 10 ten thousand integer values in this embodiment is changed to the period array in which 100 ten thousand integer values are allocated to the dynamic memory, so as to improve the precision of the sorting output result.
Preferably, the sorting attribute is any one of a source address, a destination address, a source port, a destination port, a protocol type, a matching policy ID, a number of sending packets, a number of receiving packets, a total number of packets, a creation time, a presence time, an ingress interface, and an egress interface.
The user selects corresponding sorting attributes according to requirements, taking the IPv4 source address as an example, and calculating the maximum value and the minimum value of the IPv4 source address in the session linked list specifically comprises the following steps:
the method comprises the steps of defining unsigned integer value variables of total, min _ ip and max _ ip, converting an IPv4 source address of a first session in a session linked list into an unsigned integer value of vip, namely a sequencing attribute value, assigning the unsigned integer value of vip to the min _ ip and max _ ip variables, and setting an initial value of the total to be 1.
The conversion method comprises the following steps:
if the IPv4 source address is: 192.168.1.1, then:
vip 1= 192<<24 + 168<<16 + 1<<8 + 1 = 3232235777 (0xC0A80101)
assigning an initial value: min _ ip = max _ ip = vip 1;
sequentially polling IPv4 source addresses of the rest sessions in the session linked list, converting the IPv4 source addresses into unsigned integer values vip2, comparing the unsigned integer values vip2 with min _ ip and max _ ip, and assigning the vip2 to the min _ ip if the vip2 is smaller than the min _ ip; if vip2 is greater than max _ ip, assign it to max _ ip;
and adding 1 to the total value every time polling is performed, and finally counting the total number of the sessions.
Expressed in code as follows:
if (vip2<min_ip)
min_ip = vip2
else if (vip2>max_ip)
max_ip = vip2
the conversion mode of converting other sorting attributes into sorting attribute values is as follows:
1. destination IPv4 address: the conversion mode is the same as that of the IPv4 source address;
2. source port, destination port: directly using the port value (0-65535) as the sorting attribute value;
3. protocol type: the enumerated values (0-255) of the protocol types are directly used as the sorting attribute values;
4. policy ID: the range of the ID value is related to the specification of the equipment, generally within 1000000, and the value can be directly used as a sorting attribute value;
5. number of transmission packets, number of reception packets, total number of packets: directly using the package value (0-4294967295) as the sorting attribute value;
6. creation time, lifespan: for example, '2020-06-2601: 00: 00', which has been converted into seconds since 1970, with the value of the seconds as the value of the ordering attribute, a systematic function mktime conversion can be used.
Preferably, the period division is performed on the session information according to the sorting attribute value, the sorting attribute maximum value, and the sorting attribute minimum value of the session information, and specifically includes:
and calculating the sorting position value of each piece of session information according to the sorting attribute value of each piece of session information by combining the sorting attribute maximum value and the sorting attribute minimum value, and taking the sorting position value as a period number.
Preferably, the method includes calculating a ranking position value of each piece of session information according to a ranking attribute value of each piece of session information in combination with the ranking attribute maximum value and the ranking attribute minimum value, and taking the ranking position value as a duration number, specifically:
the period number when the session information is arranged in ascending order according to the sequence attribute value:
seq1 = (vip - min_ip) *total / (max_ip - min_ip + 1)
wherein seq1 is the period number in ascending order, vip is the ordering attribute value of the session information, min _ ip is the minimum value of the ordering attribute, max _ ip is the maximum value of the ordering attribute, and total is the total number of the session information;
the period number when the session information is sorted in descending order according to the sorting attribute value:
seq 2= total - 1- ((vip - min_ip) *total / (max_ip - min_ip + 1))
where seq2 is the period number in descending order.
Specifically, the size of the period array defined in this embodiment is 10 ten thousand, the array type is an unsigned integer value, and an initial value is assigned to the period array: signaled int count [100000] = {0 };
sequentially traversing the session linked list to count the number of session information in each period, judging whether the session linked list reaches the end, if so, ending the processing flow, otherwise, calculating the period of the current session information, namely the subscript corresponding to the count array, wherein the calculation method comprises the following steps:
the maximum value and the minimum value of the IPv4 source address are min _ ip and max _ ip respectively, and the total number of sessions is total. For the ascending order of session information: seq = (vip-min _ ip) × total/(max _ ip-min _ ip + 1)
For the descending order of session information: seq = total-1- ((vip-min _ ip)' total/(max _ ip-min _ ip + 1))
After the period number seq of the session information is calculated, adding 1 to the count [ seq ];
and after the period numbers of all the session information are calculated and counted, the period array is established.
Preferably, the method includes the steps of obtaining a ranking position range of the sessions to be ranked selected by the user, and screening out a session list of the sessions to be ranked by combining the period array, and specifically includes:
determining a starting sorting value and an ending sorting value of the conversation to be sorted according to the sorting position range;
calculating the initial period number of the initial period in which the sessions to be sequenced are located according to the initial sequencing value and the number of the sessions contained in each period;
calculating the number of the ending period in which the sessions to be sequenced are located according to the ending sequencing value and the number of the sessions contained in each period;
calculating a starting period deviation value according to the starting sequence value and the number of the sessions in the starting period;
calculating an offset value of the ending period according to the sequencing position range and the number of the sessions contained in each period;
and screening out a session list of the sessions to be sorted according to the starting period number, the starting period offset value, the ending period number and the ending period offset value.
According to the sequencing position range selected by an administrator or a user, determining a session information list which needs to be sequenced, wherein the sequencing session information list is viewed by a software tool, such as a browser, and the number of session information items viewed each time is limited, and is generally in the range of 20-500. Taking 100 pieces per page as an example, for example, an administrator selects to view the 65 th page session information, and what is actually viewed is a session list with the ranking attribute values arranged in the 6500 th to 6599 th positions. Therefore, according to the viewing mode of the user, the page number input by the user is simply calculated, and the sequencing position range can be obtained. And combining the sequencing position range and the period array to obtain the period distribution range of the session to be sequenced in the period array.
Preferably, the method for calculating the number of the start period of the session to be sorted according to the start sorting value and the number of sessions included in each period includes: sequentially accumulating the elements in the period array, and recording the sequence numbers of the corresponding elements as the initial period numbers when the accumulated value is not less than the initial sequence value for the first time;
calculating the number of the ending period in which the sessions to be sequenced are located according to the ending sequencing value and the number of the sessions contained in each period, and specifically comprising the following steps: sequentially accumulating the elements in the period array, and recording the sequence numbers of the corresponding elements as the period end numbers when the accumulated value is not less than the sequence end value for the first time;
calculating a start period offset value according to the start ranking value and the number of sessions in the start period, specifically:
seq_min_offset = (pos_start - sum_before)
wherein seq _ min _ offset is an offset value of a starting period, sum _ before is a total number of sessions in each period before the starting period, and pos _ start is a starting ordering value;
calculating an offset value of the ending period according to the sequencing position range and the number of sessions contained in each period, specifically:
seq_max_fill =sum - (count[seq_min]+ ... + count[seq_max-1]- seq_min_offset)
wherein seq _ max _ file is an offset value of an ending period, sum is the total number of sessions to be sorted, seq _ min is a starting period number, count [ seq _ min ] is a starting period value, seq _ max is an ending period number, seq _ max-1 is a period number before the ending period number, and count [ seq _ max-1] is a period value before the ending period number.
Specifically, the count array is polled to calculate the following values: 1. the subscript range of the count array where 10 ten thousand sessions participating in this sorting are located: seq _ min-seq _ max, i.e., a start period number and an end period number (the precise sort position of the administrator sort is in the range of post _ start-post _ end, which correspond to the period session of the counts [ seq _ min ]. count [ seq _ max ]); 2. calculating the offset position of the first session (post _ start) of the sessions to be sorted in the start period: seq _ min _ offset, i.e., the offset value of the start period, such as the start period includes 1000 sessions, and our statistics need to count the ordered sessions from the 101 th of the 1000, then the offset value of the start period is 101; 3. calculating the offset position of the last session (post end) of the sessions to be sorted in the end period: seq _ max _ fill, i.e. the end period offset value, for example, the end period includes 2000 sessions, but the total number of sessions in the seq = seq _ min ~ seq _ max-1 has reached 99950, then the session of seq = seq _ max can only add 50 (100000-.
The specific details are as follows:
seq _ min, seq _ max calculation: polling each element of the count array, accumulating, and when the accumulated value is greater than or equal to post _ start, seq _ min is the current period number; when the accumulated value is greater than or equal to the post _ end, seq _ max is the current period number.
Calculation of seq _ min _ offset: polling the count array and accumulating the value thereof, recording the previous accumulation sum _ before of which the value exceeds pos _ start and the accumulation sum when the value exceeds pos _ start, and if pos _ start is greater than sum _ before, seq _ min _ offset = (pos _ start-sum _ before), otherwise eq _ min _ offset = 0;
the calculation process of seq _ max _ fill: seq _ max _ fill = 100000- (count [ seq _ min ] +. + count [ seq _ max-1] -seq _ min _ offset).
Preferably, the session pointer of each piece of session information in the session list is recorded, and a pointer array is established, specifically:
sequentially searching the session information with the period number equal to the initial period number, subtracting one from the initial period offset value every time one session information is found, judging whether the initial period offset value is equal to zero, if so, assigning the pointer of the current session information to the pointer array, and turning to the next step, otherwise, continuously searching;
and sequentially assigning the pointer of each session information to a pointer array, judging whether the sorting attribute value of the current session information is greater than the finishing sorting value, if so, stopping assigning the pointer array, otherwise, continuing assigning the pointer of the next session information.
Specifically, in this embodiment, a pointer array with a size of 10 ten thousand is defined, and an initial value is assigned: void × ss [100000] = {0 };
calculating the period seq of the session information in the session list, then recording the pointer addresses of 10 ten thousand sessions to be sequenced, and selecting an asynchronous processing method according to the value of the period seq of the session:
1. if seq is equal to seq _ min, subtracting 1 from seq _ min _ offset every time the seq is equal to seq _ min _ offset, and assigning the session pointer to the ss array when seq _ min _ offset is equal to 0;
2. if seq is larger than seq _ min and seq is smaller than seq _ max, assigning the session pointer to the ss array;
3. and if the seq is equal to seq _ max, if the number of the assignment values of the ss array reaches 10 ten thousand, stopping assignment, and otherwise, assigning the session pointer to the ss array.
Sequencing the sessions in the ss array;
up to 10 ten thousand sessions which need to be sorted are added into the ss array, and the 10 ten thousand sessions contain session information with sorting positions between pos and pos +100 expected by an administrator. Therefore, the quick response to the sorting instruction of the administrator can be realized according to the ss array.
In the embodiment, the sorting algorithm is a quick sorting algorithm qsort in a C/C + + standard library stdlib. And taking out the corresponding 100 sessions from the ordered array ss and returning the sessions to the corresponding software (such as browser requests). The corresponding 100 array elements are ss [ pos%5000] - [ ss [ pos%5000 + 99 ].
The invention can be applied to various service scenes, in particular to an embedded gateway device with insufficient memory, aiming at the session items of more than 10 ten thousand levels.
Taking 1000 ten thousand sessions as an example, the conventional fast sequencing resource consumption is as follows:
and (4) calculating times: 2.3 hundred million times at least (10000000 log 210000000)
Memory: 38MB at least
After the method provided by the invention is used, the resource consumption is as follows:
and (4) calculating times: 3000 ten thousand (10000000 3 + 100000 log 2100000)
Memory: 780KB
From the above data, it can be seen that the present invention provides a great improvement in both sequencing time and memory consumption.
Example 2
Embodiment 2 of the present invention provides a session sequencing apparatus for a gateway device, including a processor and a memory, where the memory stores a computer program, and when the computer program is executed by the processor, the session sequencing method for the gateway device provided in embodiment 1 is implemented.
The session sequencing device of the gateway device provided by the embodiment of the invention is used for realizing the session sequencing method of the gateway device, so that the session sequencing device of the gateway device has the technical effects, and the session sequencing device of the gateway device also has the technical effects, which are not described herein again.
Preferably, the computer program is stored in a stack space of the memory.
Example 3
Embodiment 3 of the present invention provides a computer storage medium having stored thereon a computer program that, when executed by a processor, implements the session ordering method of the gateway device provided in embodiment 1.
The computer storage medium provided in the embodiments of the present invention is used to implement the session sorting method for the gateway device, and therefore, the technical effect of the session sorting method for the gateway device is also achieved by the computer storage medium, which is not described herein again.
The above-described embodiments of the present invention should not be construed as limiting the scope of the present invention. Any other corresponding changes and modifications made according to the technical idea of the present invention should be included in the protection scope of the claims of the present invention.

Claims (10)

1. A session sequencing method of a gateway device is characterized by comprising the following steps:
traversing all session information in the session linked list according to the sorting attribute selected by the user, and searching for a maximum sorting attribute value and a minimum sorting attribute value;
dividing the session information into periods according to the sorting attribute value, the sorting attribute maximum value and the sorting attribute minimum value of the session information;
defining a period array with a set size, setting the size of the period array according to the residual capacity of the memory, defining a smaller period array when the memory is insufficient, increasing the size of the period array when the memory is relatively sufficient, counting the number of session information contained in each period, taking the period number as the serial number of the array element, taking the number of the session information contained in the period as the value of the corresponding array element, and establishing the period array;
acquiring a sorting position range of the conversations to be sorted selected by the user, and screening out a conversation list of the conversations to be sorted by combining the period array;
recording a session pointer of each session information in the session list, and establishing a pointer array;
and addressing the session to be sorted according to the pointer array and sorting the session.
2. The session sequencing method of the gateway device of claim 1, wherein the sequencing attribute is any one of a source address, a destination address, a source port, a destination port, a protocol type, a matching policy ID, a number of sent packets, a number of received packets, a total number of packets, a creation time, a presence time, an ingress interface, and an egress interface.
3. The session sequencing method of the gateway device according to claim 1, wherein the session information is divided into periods according to the sequencing attribute value of the session information, the maximum value of the sequencing attribute, and the minimum value of the sequencing attribute, specifically:
and calculating the sorting position value of each piece of session information according to the sorting attribute value of each piece of session information by combining the sorting attribute maximum value and the sorting attribute minimum value, and taking the sorting position value as a period number.
4. The session sequencing method of the gateway device according to claim 3, wherein according to a sequencing attribute value of each piece of session information, a sequencing position value of each piece of session information is calculated in combination with the maximum value and the minimum value of the sequencing attribute, and taking the sequencing position value as a period number specifically includes:
the period number when the session information is arranged in ascending order according to the sequence attribute value:
seq1 = (vip - min_ip) *total / (max_ip - min_ip + 1)
wherein seq1 is the period number in ascending order, vip is the ordering attribute value of the session information, min _ ip is the minimum value of the ordering attribute, max _ ip is the maximum value of the ordering attribute, and total is the total number of the session information;
the period number when the session information is sorted in descending order according to the sorting attribute value:
seq 2= total - 1- ((vip - min_ip) *total / (max_ip - min_ip + 1))
where seq2 is the period number in descending order.
5. The session sorting method of the gateway device according to claim 1, wherein a sorting position range of the sessions to be sorted selected by the user is obtained, and a session list of the sessions to be sorted is screened out by combining the period array, specifically:
determining a starting sorting value and an ending sorting value of the conversation to be sorted according to the sorting position range;
calculating the initial period number of the initial period in which the sessions to be sequenced are located according to the initial sequencing value and the number of the sessions contained in each period;
calculating the number of the ending period in which the sessions to be sequenced are located according to the ending sequencing value and the number of the sessions contained in each period;
calculating a starting period deviation value according to the starting sequence value and the number of the sessions in the starting period;
calculating an offset value of the ending period according to the sequencing position range and the number of the sessions contained in each period;
and screening out a session list of the sessions to be sorted according to the starting period number, the starting period offset value, the ending period number and the ending period offset value.
6. The method according to claim 5, wherein a starting period number of a starting period in which the sessions to be sorted are located is calculated according to the starting sorting value and the number of sessions included in each period, and specifically: sequentially accumulating the elements in the period array, and recording the sequence numbers of the corresponding elements as the initial period numbers when the accumulated value is not less than the initial sequence value for the first time;
calculating the number of the ending period in which the sessions to be sequenced are located according to the ending sequencing value and the number of the sessions contained in each period, and specifically comprising the following steps: sequentially accumulating the elements in the period array, and recording the sequence numbers of the corresponding elements as the period end numbers when the accumulated value is not less than the sequence end value for the first time;
calculating a start period offset value according to the start ranking value and the number of sessions in the start period, specifically:
seq_min_offset = (pos_start - sum_before)
wherein seq _ min _ offset is an offset value of a starting period, sum _ before is a total number of sessions in each period before the starting period, and pos _ start is a starting ordering value;
calculating an offset value of the ending period according to the sequencing position range and the number of sessions contained in each period, specifically:
seq_max_fill =sum - (count[seq_min]+ ... + count[seq_max-1]- seq_min_offset)
wherein seq _ max _ file is an offset value of an ending period, sum is the total number of sessions to be sorted, seq _ min is a starting period number, count [ seq _ min ] is a starting period value, seq _ max is an ending period number, seq _ max-1 is a period number before the ending period number, and count [ seq _ max-1] is a period value before the ending period number.
7. The method according to claim 5, wherein a session pointer of each piece of session information in the session list is recorded, and a pointer array is established, specifically:
sequentially searching the session information with the period number equal to the initial period number, subtracting one from the initial period offset value every time one session information is found, judging whether the initial period offset value is equal to zero, if so, assigning the pointer of the current session information to the pointer array, and turning to the next step, otherwise, continuously searching;
and sequentially assigning the pointer of each session information to a pointer array, judging whether the sorting attribute value of the current session information is greater than the finishing sorting value, if so, stopping assigning the pointer array, otherwise, continuing assigning the pointer of the next session information.
8. A session sequencing apparatus of a gateway device, comprising a processor and a memory, wherein the memory stores a computer program, and the computer program, when executed by the processor, implements a session sequencing method of the gateway device according to any one of claims 1 to 7.
9. The session sequencing apparatus of gateway device of claim 8, wherein said computer program is stored in a stack space of said memory.
10. A computer storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements a session ordering method for a gateway device according to any one of claims 1-7.
CN202010743173.8A 2020-07-29 2020-07-29 Session sequencing method and device of gateway equipment Active CN111629074B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010743173.8A CN111629074B (en) 2020-07-29 2020-07-29 Session sequencing method and device of gateway equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010743173.8A CN111629074B (en) 2020-07-29 2020-07-29 Session sequencing method and device of gateway equipment

Publications (2)

Publication Number Publication Date
CN111629074A CN111629074A (en) 2020-09-04
CN111629074B true CN111629074B (en) 2020-10-30

Family

ID=72272918

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010743173.8A Active CN111629074B (en) 2020-07-29 2020-07-29 Session sequencing method and device of gateway equipment

Country Status (1)

Country Link
CN (1) CN111629074B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112437125B (en) * 2020-11-10 2022-05-03 阿波罗智联(北京)科技有限公司 Information concurrent processing method and device, electronic equipment and storage medium
CN113364863B (en) * 2021-06-03 2022-12-30 上海微盟企业发展有限公司 Method, system and equipment for distributing behavior data session ID

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030036932A1 (en) * 2001-08-03 2003-02-20 Lin Kuang Shin Method of implementation suitable for detailed list shopping mode in B to B web site products
CN102761517B (en) * 2011-04-25 2015-06-24 工业和信息化部电信传输研究所 Content reduction method for high-speed network
CN103973797B (en) * 2014-05-13 2017-04-12 公安部第一研究所 Method for conducting requests through Session
US20180278600A1 (en) * 2016-01-19 2018-09-27 Regwez, Inc. Multi-factor masked access control system
CN109684052B (en) * 2018-12-26 2021-04-09 华为技术有限公司 Transaction analysis method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN111629074A (en) 2020-09-04

Similar Documents

Publication Publication Date Title
CN108881448B (en) API request processing method and device
WO2022062795A1 (en) Service request allocation method, apparatus and computer device, and storage medium
CN106656800B (en) Path selection method and system, network acceleration node and network acceleration system
CN111629074B (en) Session sequencing method and device of gateway equipment
CN109040243B (en) Message processing method and device
CN107819797B (en) Access request processing method and device
CN110460879B (en) Video request scheduling method, device, server and storage medium
CN113225196B (en) Service level configuration method and device
US10296394B2 (en) Consistent hashing
WO2018028344A1 (en) Method and device for load processing
CN112654003A (en) Method, device, storage medium and electronic equipment for sending message
JP5154313B2 (en) SIP message distribution method and SIP message distribution apparatus
CN105872082A (en) Fine-grained resource response system based on load balancing algorithm of container cluster
CN109582829B (en) Processing method, device, equipment and readable storage medium
CN115168017B (en) Task scheduling cloud platform and task scheduling method thereof
CN108200185B (en) Method and device for realizing load balance
CN115842828A (en) Gateway load balancing control method, device, equipment and readable storage medium
JP4961994B2 (en) BAND USE CONTROL SYSTEM, BAND USE CONTROL METHOD, DEVICE AND ITS PROGRAM
CN112711587B (en) Data processing method and device, electronic equipment and storage medium
CN110535853B (en) Video request scheduling method, device, server and storage medium
CN116684098A (en) Block chain-based data processing method, device, equipment, medium and product
CN113873001A (en) Load balancing optimization method based on HTTP request classification
CN113301445A (en) Address allocation method and device for content distribution network
CN110968409A (en) Data processing method and device
CN106921607B (en) Password operation management method and system under password server cluster

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant