CN112612670B - Session information statistical method, device, exchange equipment and storage medium - Google Patents

Session information statistical method, device, exchange equipment and storage medium Download PDF

Info

Publication number
CN112612670B
CN112612670B CN202011401578.XA CN202011401578A CN112612670B CN 112612670 B CN112612670 B CN 112612670B CN 202011401578 A CN202011401578 A CN 202011401578A CN 112612670 B CN112612670 B CN 112612670B
Authority
CN
China
Prior art keywords
information
session
quintuple
statistical information
quintuple 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
CN202011401578.XA
Other languages
Chinese (zh)
Other versions
CN112612670A (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.)
Beijing Armyfly Technology Co Ltd
Original Assignee
Beijing Armyfly 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 Beijing Armyfly Technology Co Ltd filed Critical Beijing Armyfly Technology Co Ltd
Priority to CN202011401578.XA priority Critical patent/CN112612670B/en
Publication of CN112612670A publication Critical patent/CN112612670A/en
Application granted granted Critical
Publication of CN112612670B publication Critical patent/CN112612670B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/3024Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a central processing unit [CPU]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3051Monitoring arrangements for monitoring the configuration of the computing system or of the computing system component, e.g. monitoring the presence of processing resources, peripherals, I/O links, software programs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/903Querying
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/50Reducing energy consumption in communication networks in wire-line communication networks, e.g. low power modes or reduced link rate

Abstract

The invention discloses a method and a device for counting session information, exchange equipment and a storage medium, wherein the method comprises the following steps: carrying out session identification on the data message received in real time, and updating session statistical information according to an identification result, wherein the session statistical information comprises the total number of sessions and session description information of each session; and responding to a session statistical information query request of a master processor in the switching equipment, and transmitting the current session statistical information to the master processor. The technical scheme of the embodiment of the invention can improve the updating efficiency of the session statistical information and the accuracy of the updating result.

Description

Session information statistical method, device, exchange equipment and storage medium
Technical Field
The embodiment of the invention relates to the technical field of wireless communication, in particular to a session information statistical method, a session information statistical device, exchange equipment and a storage medium.
Background
The session refers to a process of communication between an end user and an interactive system, and once the session is established, the session exists all the time, and the interactive system does not release session resources with the end user until the idle time of the end user exceeds the preset time.
The existing method for counting session information comprises the following steps: the logic chip is used for identifying different sessions according to the message description information in the data message sent by the terminal user, the identified message description information corresponding to the new session is packaged into new session description information to be sent to the main control processor, and the main control processor updates the existing session statistical information according to the new session description information. The main control processor adds the received new session description information to the stored session statistical information, performs session number statistics through a Central Processing Unit (CPU), and then presents the session number statistical result and the session description information corresponding to each session to the user. In addition, the logic chip can also age the session according to the aging time set by the user for the session, package the message description information corresponding to the aging session into aging session description information and send the aging session description information to the main control processor, and the main control processor updates the stored session statistical information according to the received aging session description information. The master control processor may delete the corresponding session description information according to the aging session description information, and update the statistical result of the number of sessions.
However, under the condition of more sessions, the master control processor receives a large amount of new session description information and aged session description information, and if the CPU does not process the information in time, the updating process of the session statistical information takes a long time, and the updating result is inaccurate, thereby affecting the session statistical information presented to the user.
Disclosure of Invention
Embodiments of the present invention provide a session information statistics method, an apparatus, an exchange device, and a storage medium, which can improve update efficiency of session statistics information and accuracy of an update result.
In a first aspect, an embodiment of the present invention provides a session information statistics method, which is executed by a logic chip in a switching device, and the method includes:
carrying out session identification on the data message received in real time, and updating session statistical information according to an identification result, wherein the session statistical information comprises the total number of sessions and session description information of each session;
the current session statistics are transmitted to the master processor in response to a session statistics query request by the master processor in the switching device.
In a second aspect, an embodiment of the present invention further provides a session information statistics method, which is executed by a master processor in a switching device, and the method includes:
when detecting that the session statistical information query condition is met, sending a session statistical information query request to a logic chip in the switching equipment;
and receiving the current session statistical information fed back by the logic chip aiming at the session statistical information query request.
In a third aspect, an embodiment of the present invention further provides a session information statistics apparatus, which is applied to a logic chip in a switching device, and the apparatus includes:
the session identification module is used for carrying out session identification on the data message received in real time and updating session statistical information according to an identification result, wherein the session statistical information comprises the total number of sessions and session description information of each session;
and the session statistical information transmission module is used for responding to a session statistical information query request of a main control processor in the switching equipment and transmitting the current session statistical information to the main control processor.
In a fourth aspect, an embodiment of the present invention further provides a session information statistics apparatus, applied to a master processor in a switching device, where the apparatus includes:
the query request sending module is used for sending a session statistical information query request to a logic chip in the switching equipment when detecting that the session statistical information query condition is met;
and the session statistical information receiving module is used for receiving the current session statistical information fed back by the logic chip according to the session statistical information query request.
In a fifth aspect, an embodiment of the present invention further provides a switching device, where the switching device includes:
a logic chip and a master processor;
the logic chip is used for executing the session information statistical method provided by any embodiment of the invention;
the master control processor is used for executing the session information statistical method provided by any embodiment of the invention.
In a sixth aspect, an embodiment of the present invention further provides a computer-readable storage medium, where the storage medium stores a computer program, and the computer program, when executed by a logic chip or a master processor, implements a session information statistics method provided in any embodiment of the present invention.
According to the technical scheme of the embodiment of the invention, the logic chip is used for carrying out session identification on the data message received in real time, updating the session statistical information according to the identification result, responding to the session statistical information query request of the main control processor in the switching equipment and transmitting the current session statistical information to the main control processor, so that the problems of long time consumption and inaccurate updating result of session statistical information update caused by the fact that the main control processor receives a large amount of session description information under the condition of more sessions can be avoided, and the updating efficiency of the session statistical information and the accuracy of the updating result can be improved.
Drawings
Fig. 1 is a flowchart of a session information statistics method according to a first embodiment of the present invention;
fig. 2 is a flowchart of a session information statistics method in the second embodiment of the present invention;
fig. 3 is a flowchart of a session information statistics method in the third embodiment of the present invention;
fig. 4 is a flowchart of a session information statistics method in the fourth embodiment of the present invention;
fig. 5 is a block diagram of a session information statistics apparatus in a fifth embodiment of the present invention;
fig. 6 is a structural diagram of a session information statistic apparatus in a sixth embodiment of the present invention;
fig. 7 is a schematic structural diagram of a switching device in a seventh embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not to be construed as limiting the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Example one
Fig. 1 is a flowchart of a session information statistics method according to an embodiment of the present invention, where this embodiment is applicable to a case of performing statistics on session information between an end user and an interactive system, and the method may be executed by a session information statistics apparatus, where the apparatus may be implemented by software and/or hardware, and may be generally integrated in a logic chip in a switching device, and specifically includes the following steps:
step 110, performing session identification on the data message received in real time, and updating session statistical information according to the identification result, wherein the session statistical information includes the total number of sessions and session description information of each session.
In this embodiment, the switching device may specifically be a device that performs forwarding processing on a received data packet (for example, a unicast packet or a multicast packet, and the like), and typically, the switching device may be a two-layer switch, a three-layer switch, a router, or the like. When the terminal communicates with the interactive system, the terminal usually sends the data packet to the switching device first, and the switching device forwards the data packet to the interactive system.
In this embodiment, the Logic chip may refer to a hardware unit having a preset Logic processing function in the switching Device, and specifically, the Logic chip may be implemented by a Complex Programmable Logic Device (CPLD) or a Field Programmable Gate Array (FPGA). When the terminal communicates with the interactive system, the terminal may first send the data packet to a specific switching chip in the switching device, and after receiving the data packet, the switching chip sends the data packet to the logic chip in real time.
In this step, optionally, after the logic chip receives the data packet, the session corresponding to the data packet may be identified according to the source information and the destination information in the data packet. The source information may be address information of a sender (i.e., a terminal) corresponding to the data packet, and the destination information may be address information of a receiver (i.e., an interactive system) corresponding to the data packet. Typically, the Address information may be a Media Access Control (MAC) Address, an Internet Protocol Address (IP Address), or the like. If the source information and the destination information corresponding to the two data messages are the same, the two data messages can be considered to correspond to the same session; if the source information and the destination information corresponding to the currently received data packet are different from the source information and the destination information corresponding to all the previously received data packets, it may be determined that the currently received data packet corresponds to a new session.
In a specific embodiment, after receiving a current data packet, a logic chip first extracts packet description information (that is, source information and destination information) from the current data packet, and then compares the packet description information with stored session description information (that is, stored packet description information corresponding to each session), if the packet description information corresponding to the current data packet is different from the stored session description information, it may be considered that the current data packet corresponds to a new session, and adds one to the total number of sessions in the session statistical information, and adds the packet description information corresponding to the current data packet to the session statistical information, so as to complete updating of the session statistical information.
Step 120, responding to the session statistics query request of the master processor in the switching device, and transmitting the current session statistics to the master processor.
In this embodiment, the master processor may send a session statistics query request to the logic chip at regular time, or may send the session statistics query request to the logic chip after receiving a query instruction sent by an end user. After receiving the session statistical information query request, the logic chip may transmit the currently stored session statistical information to the master processor.
In a specific embodiment, the master control processor may further be connected to a display device (e.g., a display screen) for presenting the received session statistics information to the user through the display device, so that the user can query the session statistics information; alternatively, the master processor may also send session statistics information to the terminal, so that the terminal presents the session statistics information to the user.
In this embodiment, the logic chip performs session identification on the received data packet, and updates the session statistical information according to the identification result, instead of updating the session statistical information by using the master processor, so that the problems that the session statistical information is updated in a long time and the update result is inaccurate due to a large amount of session description information received by the master processor under the condition of a large number of sessions can be avoided; and secondly, the session statistical information is updated through the logic chip, so that the updating efficiency of the session statistical information can be improved.
The technical scheme of the embodiment of the invention carries out session identification on the data message received in real time through the logic chip, updates the session statistical information according to the identification result, responds to the session statistical information query request of the main control processor in the switching equipment, and transmits the current session statistical information to the main control processor, thereby avoiding the problems of long time consumption and inaccurate update result of session statistical information update caused by receiving a large amount of session description information by the main control processor under the condition of more sessions, and improving the update efficiency of the session statistical information and the accuracy of the update result.
Example two
This embodiment is a further refinement of the above embodiment, and the same or corresponding terms as those of the above embodiment are explained, and this embodiment is not described again. Fig. 2 is a flowchart of a session information statistical method provided in the second embodiment, in this embodiment, the technical solution of this embodiment may be combined with one or more methods in the solutions of the foregoing embodiments, as shown in fig. 2, the method provided in this embodiment may further include:
step 210, extracting the target quintuple information from the data message received in real time, and comparing the target quintuple information with each quintuple information in the current session statistical information.
The quintuple information is session description information in the above embodiment. Specifically, the five-tuple information in the data packet may include a source IP address, a destination IP address, a protocol type, a source port number, and a destination port number corresponding to the data packet. Wherein, the source IP address is the IP address of the sender (namely the terminal) corresponding to the data message; the destination IP address is the IP address of the receiver (namely the interactive system) corresponding to the data message; the Protocol type is a Transmission Protocol type to which the data message conforms, such as a Hyper Text Transfer Protocol (HTTP) or a Transmission Control Protocol (TCP); the source port number is a port number corresponding to a port for sending a data message in the terminal; and the port number corresponding to the port for receiving the data message in the destination port number interactive system.
In this step, optionally, target quintuple information may be extracted from the received data packet according to a preset identifier, and the target quintuple information may be compared with each quintuple information in the current session statistics information.
Step 220, judging whether the target quintuple information is matched with one quintuple information in the current session statistical information, if so, returning to execute step 210; if not, step 230 is performed to update the session statistics.
In this step, it may be determined whether the target quintuple information is the same as one of the current session statistics information, and if there is a quintuple information that is the same as the target quintuple information in the current session statistics information, it is determined that the target quintuple information matches the quintuple information, and the target quintuple information is considered to correspond to the same session as the quintuple information. In this case, the logic chip does not update the session statistics information, continues to receive a new data packet, and extracts new target quintuple information in the new data packet.
And step 230, adding one to the total number of the sessions in the session statistical information, and adding target five-tuple information to the session statistical information.
If no quintuple information identical to the target quintuple information exists in the current session statistical information, the target quintuple information is determined not to be matched with all the quintuple information in the current session statistical information, and the target quintuple information is considered to correspond to a new session. In this case, the total number of sessions in the session statistics information is incremented by one, and the target five tuple information is added to the session statistics information to complete the update of the session statistics information.
In this embodiment, by using quintuple information in a data packet as session description information, different data packets can be effectively distinguished, and accuracy of a session identification result can be further ensured.
Step 240, responding to the session statistic information query request of the master processor in the switching device, and transmitting the current session statistic information to the master processor.
In an implementation manner of the embodiment of the present invention, optionally, before the updating the session statistics information, the method further includes: and reading the currently stored session statistical information from a storage chip. After updating the session statistical information, the method further comprises the following steps: and writing the updated session statistical information into the storage chip so that the storage chip carries out replacement storage on the session statistical information.
The Memory chip may be a Double Data Rate Synchronous Random Access (DDR) Memory chip.
The technical scheme of the embodiment of the invention extracts target quintuple information from data messages received in real time through a logic chip, compares the target quintuple information with each quintuple information in the current session statistical information, judges whether the target quintuple information is matched with one quintuple information in the current session statistical information, if not, adds one to the total number of sessions in the session statistical information, adds the target quintuple information into the session statistical information, and transmits the current session statistical information to a master control processor when receiving a session statistical information query request sent by the master control processor. The embodiment of the invention can ensure the accuracy of the session identification result and improve the updating efficiency of the session statistical information and the accuracy of the updating result.
EXAMPLE III
This embodiment is a further refinement of the above embodiment, and the same or corresponding terms as those of the above embodiment are explained, and this embodiment is not described again. Fig. 3 is a flowchart of a session information statistical method provided in a third embodiment, in this embodiment, the technical solution of this embodiment may be combined with one or more methods in the solutions of the foregoing embodiments, as shown in fig. 3, the method provided in this embodiment may further include:
and 310, extracting target quintuple information from the data message received in real time, and comparing the target quintuple information with each quintuple information in the current session statistical information.
Step 320, judging whether the target quintuple information is matched with one quintuple information in the current session statistical information, if so, executing step 330; if not, steps 340-350 are performed to facilitate updating the session statistics.
In this step, the current session statistics may be read from the DDR chip.
And step 330, re-timing the timer corresponding to the stored five-tuple information in the current session statistical information according to the preset session aging time.
In this embodiment, a user may preset, in the logic chip, a session aging time corresponding to each data packet. After the logic chip obtains the session aging time corresponding to each data packet set by the user, a mapping relation between the quintuple information of each data packet and the corresponding session aging time can be established. And after the logic chip adds one quintuple information into the current session statistical information, establishing a timer for the quintuple information according to the session aging time corresponding to the quintuple information. And the timing duration of the timer is equal to the session aging time.
If the target quintuple information is matched with stored quintuple information in the session statistics information, the target quintuple information and the stored quintuple information are considered to correspond to the same session, and the session is ongoing, under the condition, a timer corresponding to the stored quintuple information is re-timed according to preset session aging time so as to ensure that the session can continue to be normally conducted, and meanwhile, the logic chip continues to receive new data messages and extracts new target quintuple information in the new data messages.
And 340, adding one to the total number of the sessions in the session statistical information, and adding target five-tuple information to the session statistical information.
In this step, optionally, the total number of sessions may be incremented by one in the DDR chip, and the target five-tuple information may be written into the DDR chip.
Step 350, establishing a timer corresponding to the target quintuple information, and triggering the timer to time; the timing duration of the timer is preset session aging time.
Step 360, responding to the session statistic information query request of the master processor in the switching device, and transmitting the current session statistic information to the master processor.
In an implementation manner of the embodiment of the present invention, optionally, the session information statistics method further includes: and removing the aged quintuple information from the session statistical information according to the preset session aging time.
Removing aged quintuple information from the session statistical information according to preset session aging time, wherein the removing aged quintuple information comprises the following steps of: detecting whether new quintuple information matched with the stored quintuple information is received or not in the timing duration of a timer corresponding to each stored quintuple information in session statistics information; if not, the stored quintuple information is used as aged quintuple information, the aged quintuple information is removed from the session statistical information, and the total number of sessions in the session statistical information is updated.
In a specific embodiment, within the timing duration of a timer corresponding to one stored five-tuple information, if a new five-tuple information matching the stored five-tuple information is received, it may be considered that a session corresponding to the stored five-tuple information is in progress, and in this case, the timer corresponding to the stored five-tuple information may be re-timed according to a preset session aging time to ensure that the session may continue to be normally performed;
in another specific embodiment, within the timing duration of the timer corresponding to one stored five-tuple information, if no new five-tuple information matching the stored five-tuple information is received, it may be considered that the session corresponding to the stored five-tuple information may have ended, in this case, the stored five-tuple information may be used as aged five-tuple information, the aged five-tuple information is removed from the session statistics information, and the total number of sessions in the session statistics information is reduced by one.
In this embodiment, the logic chip removes the aged quintuple information from the session statistical information according to the preset session aging time, instead of removing the aged quintuple information by using the master processor, so that the problems that the session statistical information is updated in a long time and the updating result is inaccurate due to the fact that the master processor receives a large amount of aged session description information under the condition of more sessions can be avoided.
The technical scheme of the embodiment of the invention extracts target quintuple information from a data message received in real time through a logic chip, compares the target quintuple information with each quintuple information in the current session statistical information, judges whether the target quintuple information is matched with one stored quintuple information in the current session statistical information, and if so, retimes a timer corresponding to the stored quintuple information according to preset session aging time; and if not, adding one to the total number of the sessions in the session statistical information, adding target quintuple information to the session statistical information, establishing a timer corresponding to the target quintuple information, and transmitting the current session statistical information to the master processor when receiving a session statistical information query request sent by the master processor. The embodiment of the invention can improve the updating efficiency of the session statistical information and the accuracy of the updating result.
Example four
Fig. 4 is a flowchart of a session information statistics method according to a fourth embodiment of the present invention, where this embodiment is applicable to a case of performing statistics on session information between an end user and an interactive system, and the method may be executed by a session information statistics apparatus, where the apparatus may be implemented by software and/or hardware, and may be generally integrated in a master processor in a switching device, and specifically includes the following steps:
step 410, when detecting that the session statistic information query condition is satisfied, sending a session statistic information query request to a logic chip in the switching device.
In a specific embodiment, the master processor may establish a timer for sending the query request, and a timing duration of the timer may be preset according to a query requirement of the user. The main control processor can detect whether the timer is up, if so, the main control processor sends a session statistical information query request to a logic chip in the switching equipment, and controls the timer to count again according to the timing duration.
In another specific embodiment, the master processor may further send a session statistics query request to the logic chip after receiving a query instruction sent by an end user.
Step 420, receiving the current session statistical information fed back by the logic chip according to the session statistical information query request.
In this step, after receiving the current session statistical information, the master control processor may present the received session statistical information to the user through the display device, so that the user may query the session statistical information; alternatively, the master processor may also send session statistics information to the terminal, so that the terminal presents the session statistics information to the user.
According to the technical scheme of the embodiment of the invention, when the main control processor detects that the session statistical information query condition is met, the main control processor sends the session statistical information query request to the logic chip in the switching equipment and receives the current session statistical information fed back by the logic chip aiming at the session statistical information query request, so that the updating efficiency of the session statistical information and the accuracy of the updating result can be improved.
EXAMPLE five
Fig. 5 is a structural diagram of a session information statistics apparatus according to a fifth embodiment of the present invention, where the apparatus is applied to a logic chip in a switching device, and includes: a session identification module 510 and a session statistics information transmission module 520.
The session identification module 510 is configured to perform session identification on a data packet received in real time, and update session statistical information according to an identification result, where the session statistical information includes a total number of sessions and session description information of each session; a session statistic information transmission module 520, configured to transmit current session statistic information to the master processor in response to a session statistic information query request of the master processor in the switching device.
The technical scheme of the embodiment of the invention carries out session identification on the data message received in real time through the logic chip, updates the session statistical information according to the identification result, responds to the session statistical information query request of the main control processor in the switching equipment, and transmits the current session statistical information to the main control processor, thereby avoiding the problems of long time consumption and inaccurate update result of session statistical information update caused by receiving a large amount of session description information by the main control processor under the condition of more sessions, and improving the update efficiency of the session statistical information and the accuracy of the update result.
On the basis of the above embodiments, the session description information is quintuple information;
the session identification module 510 may include:
a quintuple information extraction unit, configured to extract target quintuple information from the data packet received in real time, and compare the target quintuple information with each quintuple information in the current session statistics information;
a target quintuple information adding unit, configured to add one to the total number of sessions in the session statistics information and add the target quintuple information to the session statistics information if the target quintuple information is not matched with each quintuple information in the current session statistics information;
the timer establishing unit is used for establishing a timer corresponding to the target quintuple information and triggering the timer to time; the timing duration of the timer is preset session aging time;
the timing unit is used for re-timing a timer corresponding to the stored quintuple information according to the preset session aging time if the target quintuple information is matched with the stored quintuple information in the session statistics information;
the memory chip reading unit is used for reading the currently stored session statistical information from the memory chip before updating the session statistical information;
and the memory chip writing unit is used for writing the updated session statistical information into the memory chip after updating the session statistical information so as to enable the memory chip to replace and store the session statistical information.
The session information statistic device further comprises:
and the aging quintuple information removing module is used for removing the aging quintuple information from the session statistical information according to the preset session aging time.
The aging quintuple information removing module comprises:
a quintuple information detection unit, configured to detect whether new quintuple information matching the stored quintuple information is received within a timing duration of a timer corresponding to each stored quintuple information in the session statistics information;
and the aging quintuple information confirming unit is used for taking the existing quintuple information as aging quintuple information if new quintuple information matched with the existing quintuple information is not received in the timing duration of the timer corresponding to each existing quintuple information in the session statistical information, removing the aging quintuple information from the session statistical information, and updating the total number of sessions in the session statistical information.
The session information statistical device provided by the embodiment of the invention can execute the session information statistical method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
EXAMPLE six
Fig. 6 is a structural diagram of a session information statistics apparatus according to a sixth embodiment of the present invention, where the apparatus is applied to a master processor in a switching device, and includes: an inquiry request sending module 610 and a session statistics information receiving module 620.
The query request sending module 610 is configured to send a session statistics query request to a logic chip in the switching device when it is detected that a session statistics query condition is satisfied; a session statistic information receiving module 620, configured to receive current session statistic information fed back by the logic chip according to the session statistic information query request.
According to the technical scheme of the embodiment of the invention, when the main control processor detects that the session statistical information query condition is met, the main control processor sends the session statistical information query request to the logic chip in the switching equipment and receives the current session statistical information fed back by the logic chip aiming at the session statistical information query request, so that the updating efficiency of the session statistical information and the accuracy of the updating result can be improved.
The session information statistical device provided by the embodiment of the invention can execute the session information statistical method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
EXAMPLE seven
Fig. 7 is a schematic structural diagram of a switch device according to a seventh embodiment of the present invention, and as shown in fig. 7, the switch device includes a logic chip 710, a master processor 720, a memory chip 730, a switch chip 740, and a memory 750.
The switch chip 740 is connected to the logic chip 710 through an HG interface, and configured to send a real-time received data packet to the logic chip 710, where the HG interface is an interface compliant with the Higig protocol; the logic chip 710 is connected to the main control processor 720 through a network interface, and specifically, the logic chip 710 may be connected to the main control processor 720 through a Peripheral Component Interconnect Express (PCIE) interface for transmitting the session statistics information to the main control processor; the memory chip 730 is configured to store the session statistics information updated by the logic chip 710.
The memory 750 is connected to the logic chip 710 and the main control processor 720, respectively, and the memory 750 is a computer-readable storage medium, which can be used to store software programs, computer-executable programs, and modules, such as program instructions/modules corresponding to a session information statistics method in an embodiment of the present invention (for example, the session identification module 510 and the session statistics information transmission module 520 in a session information statistics apparatus). The logic chip 710 executes various functional applications and data processing of the switching device by executing software programs, instructions and modules stored in the memory 750, so as to implement one of the above-mentioned session information statistics methods. That is, the program when executed by the logic chip implements:
carrying out session identification on the data message received in real time, and updating session statistical information according to an identification result, wherein the session statistical information comprises the total number of sessions and session description information of each session;
and responding to a session statistical information query request of a master processor in the switching equipment, and transmitting the current session statistical information to the master processor.
The memory 750, as a computer-readable storage medium, can also be used for storing program instructions/modules corresponding to a session information statistics method according to an embodiment of the present invention (for example, the query request sending module 610 and the session statistics information receiving module 620 in a session information statistics apparatus). The master processor 720 executes various functional applications and data processing of the switching device by executing software programs, instructions and modules stored in the memory 750, so as to implement one of the above-mentioned session information statistical methods. That is, the program when executed by the processor implements:
when detecting that the session statistical information query condition is met, sending a session statistical information query request to a logic chip in the switching equipment;
and receiving the current session statistical information fed back by the logic chip according to the session statistical information query request.
The memory 750 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the terminal, and the like. Further, memory 750 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some examples, the memory 750 may further include memory located remotely from the logic chip 710 and the master processor 720, which may be connected to the switching device through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
Example eight
The eighth embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to implement the method according to any embodiment of the present invention. Of course, the embodiment of the present invention provides a computer-readable storage medium, which can perform related operations in a session information statistics method according to any embodiment of the present invention. That is, the program, when executed by a logic chip in the switching device, implements:
carrying out session identification on the data message received in real time, and updating session statistical information according to an identification result, wherein the session statistical information comprises the total number of sessions and session description information of each session;
the current session statistics are transmitted to the master processor in response to a session statistics query request by the master processor in the switching device.
The computer-readable storage medium provided in the embodiments of the present invention may further perform related operations in another session information statistics method provided in any embodiment of the present invention. That is, the program when executed by a master processor in the switching device implements:
when detecting that the session statistical information query condition is met, sending a session statistical information query request to a logic chip in the switching equipment;
and receiving the current session statistical information fed back by the logic chip aiming at the session statistical information query request.
From the above description of the embodiments, it is obvious for those skilled in the art that the present invention can be implemented by software and necessary general hardware, and certainly, can also be implemented by hardware, but the former is a better embodiment in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which can be stored in a computer-readable storage medium, such as a floppy disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a FLASH Memory (FLASH), a hard disk or an optical disk of a computer, and includes instructions for enabling a switching device to execute the methods according to the embodiments of the present invention.
It should be noted that, in the embodiment of the session information statistics apparatus, the included units and modules are only divided according to functional logic, but are not limited to the above division as long as the corresponding functions can be implemented; in addition, specific names of the functional units are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present invention.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (8)

1. A session information statistical method is executed by a logic chip in a switching device, and is characterized by comprising the following steps:
carrying out session identification on the data message received in real time, and updating session statistical information according to an identification result, wherein the session statistical information comprises the total number of sessions and session description information of each session;
the session description information is quintuple information;
the session identification of the data message received in real time and the update of the session statistical information according to the identification result comprise:
extracting target quintuple information from the data message received in real time, and comparing the target quintuple information with each quintuple information in the current session statistical information;
if the target quintuple information is not matched with each quintuple information in the current session statistical information, adding one to the total number of sessions in the session statistical information, and adding the target quintuple information into the session statistical information;
after adding the target five-tuple information into the session statistical information, the method further comprises the following steps:
establishing a timer corresponding to the target quintuple information, and triggering the timer to time; the timing duration of the timer is preset session aging time;
after comparing the target quintuple information with each quintuple information in the current session statistical information, the method further includes:
if the target quintuple information is matched with stored quintuple information in the session statistics information, a timer corresponding to the stored quintuple information is re-timed according to preset session aging time;
removing aged quintuple information from the session statistical information according to preset session aging time, wherein the removing of the aged quintuple information comprises the following steps:
detecting whether new quintuple information matched with the stored quintuple information is received or not in the timing duration of a timer corresponding to each stored quintuple information in session statistics information;
if not, taking the existing quintuple information as aged quintuple information, removing the aged quintuple information from the session statistical information, and updating the total number of sessions in the session statistical information;
the current session statistics are transmitted to the master processor in response to a session statistics query request by the master processor in the switching device.
2. The method of claim 1, further comprising:
and removing the aged quintuple information from the session statistical information according to the preset session aging time.
3. The method according to any one of claims 1-2, further comprising, prior to updating the session statistics: reading the currently stored session statistical information from a storage chip;
after updating the session statistics, the method further comprises:
and writing the updated session statistical information into the storage chip so that the storage chip carries out replacement storage on the session statistical information.
4. A session information statistics method performed by a master processor in a switching device, comprising:
when detecting that the session statistical information query condition is met, sending a session statistical information query request to a logic chip in the switching equipment;
receiving current session statistical information fed back by the logic chip aiming at the session statistical information query request;
the current session statistical information is updated information of the session statistical information;
the updating the session statistical information includes:
extracting target quintuple information from the data message received in real time, and comparing the target quintuple information with each quintuple information in the current session statistical information;
if the target quintuple information is not matched with each quintuple information in the current session statistical information, adding one to the total number of sessions in the session statistical information, and adding the target quintuple information into the session statistical information;
after adding the target five-tuple information into the session statistics information, the method further comprises the following steps:
establishing a timer corresponding to the target quintuple information, and triggering the timer to time; the timing duration of the timer is preset session aging time;
after comparing the target quintuple information with each quintuple information in the current session statistical information, the method further includes:
if the target quintuple information is matched with stored quintuple information in the session statistics information, a timer corresponding to the stored quintuple information is re-timed according to preset session aging time;
removing aged quintuple information from the session statistical information according to preset session aging time, wherein the removing of the aged quintuple information comprises the following steps:
detecting whether new quintuple information matched with the stored quintuple information is received or not within the timing duration of a timer corresponding to each stored quintuple information in the session statistics information;
if not, the stored quintuple information is used as aged quintuple information, the aged quintuple information is removed from the session statistical information, and the total number of sessions in the session statistical information is updated.
5. A session information statistic device, applied to a logic chip in a switching device, the device comprising:
the session identification module is used for carrying out session identification on the data message received in real time and updating session statistical information according to an identification result, wherein the session statistical information comprises the total number of sessions and session description information of each session;
the session identification module comprises:
a quintuple information extraction unit, configured to extract target quintuple information from the data packet received in real time, and compare the target quintuple information with each quintuple information in the current session statistics information;
a target quintuple information adding unit, configured to add one to the total number of sessions in the session statistics information and add the target quintuple information to the session statistics information if the target quintuple information is not matched with each quintuple information in the current session statistics information;
the timer establishing unit is used for establishing a timer corresponding to the target quintuple information and triggering the timer to time; the timing duration of the timer is preset session aging time;
the timing unit is used for re-timing a timer corresponding to the stored quintuple information according to the preset session aging time if the target quintuple information is matched with the stored quintuple information in the session statistics information;
an aging quintuple information confirming unit, configured to, within a timing duration of a timer corresponding to each stored quintuple information in session statistics information, if no new quintuple information matching the stored quintuple information is received, take the stored quintuple information as aging quintuple information, remove the aging quintuple information from the session statistics information, and update a total number of sessions in the session statistics information;
and the session statistical information transmission module is used for responding to a session statistical information query request of a main control processor in the switching equipment and transmitting the current session statistical information to the main control processor.
6. A session information statistics apparatus applied to a master processor in a switching device, the apparatus comprising:
the query request sending module is used for sending a session statistical information query request to a logic chip in the switching equipment when detecting that the session statistical information query condition is met;
the session statistical information receiving module is used for receiving the current session statistical information fed back by the logic chip aiming at the session statistical information query request;
the current session statistical information is updated information of the session statistical information;
the updating the session statistical information includes:
extracting target quintuple information from the data message received in real time, and comparing the target quintuple information with each quintuple information in the current session statistical information;
if the target quintuple information is not matched with each quintuple information in the current session statistical information, adding one to the total number of sessions in the session statistical information, and adding the target quintuple information into the session statistical information;
after adding the target five-tuple information into the session statistics information, the method further comprises the following steps:
establishing a timer corresponding to the target quintuple information, and triggering the timer to time; the timing duration of the timer is preset session aging time;
after comparing the target quintuple information with each quintuple information in the current session statistical information, the method further includes:
if the target quintuple information is matched with stored quintuple information in the session statistics information, a timer corresponding to the stored quintuple information is retimed according to preset session aging time;
removing aged quintuple information from the session statistical information according to preset session aging time, wherein the removing of the aged quintuple information comprises the following steps:
detecting whether new quintuple information matched with the stored quintuple information is received or not within the timing duration of a timer corresponding to each stored quintuple information in the session statistics information;
if not, the stored quintuple information is used as aged quintuple information, the aged quintuple information is removed from the session statistical information, and the total number of sessions in the session statistical information is updated.
7. A switching device, comprising: a logic chip and a master processor;
the logic chip is used for executing the session information statistical method of any one of claims 1 to 3;
the master processor for performing the session information statistics method of claim 4.
8. A computer-readable storage medium on which a computer program is stored, wherein the program, when executed by a logic chip or a master processor, implements the session information statistics method according to any one of claims 1-3 or 4.
CN202011401578.XA 2020-12-02 2020-12-02 Session information statistical method, device, exchange equipment and storage medium Active CN112612670B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011401578.XA CN112612670B (en) 2020-12-02 2020-12-02 Session information statistical method, device, exchange equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011401578.XA CN112612670B (en) 2020-12-02 2020-12-02 Session information statistical method, device, exchange equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112612670A CN112612670A (en) 2021-04-06
CN112612670B true CN112612670B (en) 2023-04-11

Family

ID=75228777

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011401578.XA Active CN112612670B (en) 2020-12-02 2020-12-02 Session information statistical method, device, exchange equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112612670B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113965408B (en) * 2021-11-09 2023-01-20 北京锐安科技有限公司 Method, device, medium and equipment for extracting HTTP (hyper text transport protocol) message

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101582791A (en) * 2008-05-16 2009-11-18 北京启明星辰信息技术股份有限公司 Method and system for monitoring real-time messaging session
CN105227348A (en) * 2015-08-25 2016-01-06 广东睿江科技有限公司 A kind of Hash storage means based on IP five-tuple
CN107483507A (en) * 2017-09-30 2017-12-15 北京东土军悦科技有限公司 A kind of conversation analysis method, equipment and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6816455B2 (en) * 2001-05-09 2004-11-09 Telecom Italia S.P.A. Dynamic packet filter utilizing session tracking

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101582791A (en) * 2008-05-16 2009-11-18 北京启明星辰信息技术股份有限公司 Method and system for monitoring real-time messaging session
CN105227348A (en) * 2015-08-25 2016-01-06 广东睿江科技有限公司 A kind of Hash storage means based on IP five-tuple
CN107483507A (en) * 2017-09-30 2017-12-15 北京东土军悦科技有限公司 A kind of conversation analysis method, equipment and storage medium

Also Published As

Publication number Publication date
CN112612670A (en) 2021-04-06

Similar Documents

Publication Publication Date Title
US10305783B2 (en) Packet control method, switch, and controller
US11689501B2 (en) Data transfer method and virtual switch
US10382457B2 (en) Attack stream identification method, apparatus, and device on software defined network
EP3331205B1 (en) Data packet transmission method utilized in ipv6 network and device utilizing same
CN112751833B (en) RTP message identification method and device, electronic equipment and readable storage medium
WO2017157318A1 (en) Link discovery method and apparatus
WO2019085923A1 (en) Data processing method and device, and computer
CN113067810B (en) Network packet capturing method, device, equipment and medium
CN113438642A (en) 5G-oriented user traceability association method and system
US20220393908A1 (en) Message Encapsulation Method and Apparatus, and Message Decapsulation Method and Apparatus
WO2017129011A1 (en) Message processing method and network device
CN112612670B (en) Session information statistical method, device, exchange equipment and storage medium
CN115174676A (en) Convergence and shunt method and related equipment thereof
CN112887312B (en) Slow protocol message processing method and related device
WO2024037366A1 (en) Forwarding rule issuing method, and intelligent network interface card and storage medium
US7649906B2 (en) Method of reducing buffer usage by detecting missing fragments and idle links for multilink protocols and devices incorporating same
CN110213176B (en) Message processing method, device, equipment and medium of switch
US9525629B2 (en) Method and apparatus for transmitting data packets
CN107612848B (en) Debugging method and device and computer readable storage medium
CN107528929A (en) The processing method and processing device of arp entry
CN114143385B (en) Network traffic data identification method, device, equipment and medium
GB2621412A (en) Correlating protocol data units transiting networks with differing addressing schemes
WO2017118428A1 (en) Method and apparatus for realizing message error detection
CN114598675A (en) Control method, device, equipment and medium for realizing host blocking based on ARP
CN107086965B (en) ARP (Address resolution protocol) table entry generation method and device and switch

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