Multi-port multi-channel message classification and statistics device and method
By using a multi-port multi-channel message classification statistics device on the network stream processor chip, the combined structure of RAM and addition counting units is used to reduce the number of independent counters, and the chip area, high power consumption and in the prior art are solved. The poor performance problem achieves more efficient data processing.
Patent Information
- Application Number
- CN202411080934.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-08
- Publication Date
- 2025-01-10
- Estimated Expiration
- 2044-08-08
AI Technical Summary
The existing network stream processor chips allocate an independent counter to each message statistics item of each channel on each port, resulting in large chip area, high power consumption and poor performance.
The multi-port multi-channel message classification statistics device is adopted, including a message classification statistics structure of RAM storage unit, FIFO storage unit, FIFO reading data unit, RAM reading data unit and addition counting unit. The message statistics module of the sending direction of this structure is used. The receiving direction message statistics module classifies and counts messages from different ports and channels, reducing the number of addition counters, and using multiple small bit width counters to form a larger counter.
The area of the network stream processor chip is reduced, the power consumption of the chip is reduced, and data processing performance is improved.
Smart Images

Figure CN118646682B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of network communication technology, and in particular to a multi-port multi-channel message classification and statistics device and method. Background Art
[0002] In the 5G era, communication technology is developing rapidly. The Network Processor (NP chip) is a chip specially designed for high-speed network communication. It can cope with the explosive growth of traffic and diversified business needs, and provide powerful programming capabilities and high-performance data processing capabilities. There are multi-port and multi-channel high-speed Ethernet interfaces in the network flow processor chip. The messages sent and received by each port and each channel are classified and counted according to statistical items, which has strong practical significance in many aspects such as network traffic management, scheduling, and billing.
[0003] The Ethernet interface of the existing network flow processor chip allocates an independent counter to each message statistical item of each channel of each port, so as to meet the demand for parallel statistics of various statistical items of Ethernet messages.
[0004] However, the technical solution of allocating an independent counter to each message statistic item of each channel of each port requires a large number of registers to implement, which will result in a larger area and dynamic power consumption of the network flow processor chip, thereby affecting the data processing performance of the network flow processor chip. Summary of the invention
[0005] In view of the shortcomings of the prior art described above, the purpose of the present application is to provide a multi-port multi-channel message classification and statistics device and method, which is used to solve the problems of large area, high power consumption and poor performance of network flow processor chips caused by allocating an independent counter to each message statistics item of each port and each channel.
[0006] To achieve the above-mentioned purpose and other related purposes, the first aspect of the present application provides a multi-port multi-channel message classification and statistics device, the multi-port multi-channel message classification and statistics device comprising: a sending direction message statistics module and a receiving direction message statistics module, respectively used to classify and count the sending direction messages and receiving direction messages of different ports and channels using a message classification and statistics structure; wherein the message classification and statistics structure comprises: a RAM storage unit, comprising: a plurality of RAMs, respectively used to store the statistical values of the sending direction messages or receiving direction messages of each port and channel about each preset target statistical item; a FIFO storage unit, used to temporarily store the message statistics request of the sending direction messages or receiving direction messages of each port and channel; a FIFO read data unit, connected to the FIFO storage unit, used to sequentially read the message statistics from the FIFO storage based on a preset frequency; The FIFO reads the pending message statistics request from the storage unit and sends it to the RAM read data unit; the RAM read data unit is connected to the FIFO read data unit and the RAM storage unit, and is used to parse the received pending message statistics request, and perform a read data operation on the RAM storage unit according to the current message statistics information obtained by the parsing, so as to obtain the statistical value of the specified target statistical item; the addition counting unit is connected to the RAM read data unit and the RAM storage unit, and the addition counting unit includes: a plurality of addition counters, which are respectively used to update the statistical value of each target statistical item of the sending direction message or the receiving direction message; the addition counting unit selects the corresponding addition counter according to the current message statistics information to update the statistical value of each specified target statistical item, and writes the updated statistical value back to the RAM storage unit.
[0007] In some embodiments of the first aspect of the present application, the message classification statistics structure also includes: a software query interface unit, connected to the RAM storage unit, used to respond to a message statistics value query request from external software, perform a read data operation on the RAM storage unit, and obtain and output the statistical value of the sending direction message or the receiving direction message of the specified port and channel regarding the specified target statistical item.
[0008] In some embodiments of the first aspect of the present application, the FIFO read data unit is also correspondingly connected to the software query interface unit, and is used to obtain the read busy state of the software query interface unit based on a preset frequency. When the read busy state is idle, the message statistics request to be processed is read from the FIFO storage unit and sent to the RAM read data unit, so that the RAM read data unit performs a read data operation on the RAM storage unit.
[0009] In some embodiments of the first aspect of the present application, a read data operation is performed on the RAM storage unit according to the current message statistical information obtained by parsing, and the method for obtaining the statistical value of the specified target statistical item includes: obtaining the port number, channel number, one or more specified target statistical items and corresponding statistical data to be counted of the message to be counted in the current message statistical information, and judging whether the port number, channel number and each specified target statistical item are consistent with the last processed message statistical information; if they are consistent, sending a quick operation instruction to the addition counting unit, so that the addition counting unit performs a quick update statistical value operation according to the port number, channel number, each specified target statistical item and the corresponding statistical data to be counted; if they are inconsistent, sending a non-quick operation instruction to the addition counting unit, and locking the RAM address used to store the statistical values of each specified target statistical item of the corresponding port and channel according to the obtained port number, channel number and each specified target statistical item, and reading the corresponding statistical values from each locked RAM address, so that the addition counting unit performs a non-quick update statistical value operation according to the port number, channel number, each specified target statistical item and the corresponding statistical value and the statistical data to be counted.
[0010] In some embodiments of the first aspect of the present application, the addition counting unit selects a corresponding addition counter according to the current message statistical information to update the statistical value of each designated target statistical item, and writes the updated statistical value back to the RAM storage unit. The method includes: selecting a corresponding addition counter according to each designated target statistical item obtained; judging whether the received operation instruction type is a quick operation instruction or a non-quick operation instruction; if it is a quick operation instruction, performing a quick update statistical value operation, based on each addition counter, performing an addition operation on the temporarily stored statistical value of each designated target statistical item and the corresponding to-be-stated data sent by the RAM read data unit to obtain the updated statistical value of each designated target statistical item; if it is a non-quick operation instruction, performing a non-quick update statistical value operation, based on each addition counter, performing an addition operation on the statistical value of each designated target statistical item sent by the RAM read data unit and the corresponding to-be-stated data to obtain the updated statistical value of each designated target statistical item; temporarily storing the updated statistical value of each designated target statistical item in the corresponding addition counter, and performing a write data operation on the RAM storage unit to write the updated statistical value back to the RAM storage unit.
[0011] In some embodiments of the first aspect of the present application, a write data operation is performed on the RAM storage unit to write the updated statistical values of each designated target statistical item back to the RAM storage unit, including: locking the RAM address in the RAM storage unit for storing the statistical values of each designated statistical item of the corresponding port and channel according to the port number, channel number and each designated statistical item; and writing the updated statistical value of each designated target statistical item into the locked corresponding RAM address.
[0012] In some embodiments of the first aspect of the present application, the RAM storage unit includes: a RAM initialization subunit, connected to each RAM, used to write zeros to all addresses of each RAM in response to a reset signal of the multi-port multi-channel message classification and statistics device; an ECC generation subunit, connected to each RAM, used to generate additional correction codes for the statistical value data stored in each RAM; and an ECC error correction subunit, connected to each RAM, used to detect and correct errors occurring when reading statistical value data from the RAM.
[0013] In some embodiments of the first aspect of the present application, each of the adder counters includes: a plurality of small bit width counters cascaded to each other.
[0014] To achieve the above-mentioned purpose and other related purposes, the second aspect of the present application provides a multi-port multi-channel sending direction message classification and statistics method, which is applied to the sending direction message statistics module in the multi-port multi-channel message classification and statistics device described in any one of the above embodiments, and the method includes: using multiple RAMs in the RAM storage unit to respectively store the statistical values of the sending direction messages of each port and channel about each preset target statistical item; using the FIFO storage unit to temporarily store the message statistics request of the sending direction messages of each port and channel; using the FIFO read data unit to sequentially read the messages to be processed from the FIFO storage unit based on the preset frequency. A message statistics request is received and sent to a RAM read data unit; the received message statistics request to be processed is parsed through the RAM read data unit, and a read data operation is performed on the RAM storage unit according to the current message statistics information obtained by the analysis to obtain the statistical value of the specified target statistical item; through the addition counting unit, a corresponding addition counter is selected according to the current message statistics information to update the statistical value of each specified target statistical item, and the updated statistical value is written back to the RAM storage unit; wherein the addition counting unit includes: a plurality of addition counters, which are respectively used to update the statistical value of each target statistical item of the sending direction message.
[0015] To achieve the above-mentioned purpose and other related purposes, the third aspect of the present application provides a multi-port multi-channel receiving direction message classification and statistics method, which is applied to the receiving direction message statistics module in the multi-port multi-channel message classification and statistics device described in any one of the above embodiments, and the method includes: using multiple RAMs in the RAM storage unit to respectively store the statistical values of the receiving direction messages of each port and channel about each preset target statistical item; using the FIFO storage unit to temporarily store the message statistics request of the receiving direction message of each port and channel; using the FIFO read data unit to sequentially read the messages to be processed from the FIFO storage unit based on the preset frequency. A message statistics request is received and sent to a RAM read data unit; the received message statistics request to be processed is parsed through the RAM read data unit, and a read data operation is performed on the RAM storage unit according to the current message statistics information obtained by the analysis to obtain the statistical value of the specified target statistical item; through the addition counting unit, a corresponding addition counter is selected according to the current message statistics information to update the statistical value of each specified target statistical item, and the updated statistical value is written back to the RAM storage unit; wherein the addition counting unit includes: a plurality of addition counters, which are respectively used to update the statistical value of each target statistical item of the receiving direction message.
[0016] As described above, the present application provides a multi-port multi-channel message classification and statistics device and method, by setting a message classification and statistics structure including a RAM storage unit, a FIFO storage unit, a FIFO read data unit, a RAM read data unit and an addition counting unit, and by setting a sending direction message statistics module and a receiving direction message statistics module that adopt the message classification and statistics structure, it is possible to classify and count the sending direction messages and receiving direction messages of different ports and channels; the present application is based on multiple RAMs to store the statistical values of the sending direction messages or receiving direction messages of each port and channel about each preset target statistical item, and based on the FIFO storage unit to temporarily store the statistical values of each port and channel The message statistics request of the sending direction message or the receiving direction message of the channel is read from the FIFO storage unit in sequence based on a preset frequency through the FIFO read data unit, so that the RAM read data unit and the addition counting unit perform read data operations and write data operations on each RAM, thereby completing the update of the corresponding statistical value; therefore, the present application has the following beneficial effects: the present application solves the problem of large area, high power consumption and poor performance of the network flow processor chip caused by the existing allocation of an independent counter to each message statistics item of each port and each channel, and can reduce the area of the network flow processor chip, reduce the power consumption of the chip and improve the performance of the chip. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1Shown is a structural schematic diagram of a multi-port multi-channel message classification and statistics device in one embodiment of the present application.
[0018] Figure 2 Shown is a schematic diagram of address allocation of each RAM of the RAM storage unit of the sending direction message statistics module in one embodiment of the present application.
[0019] Figure 3 Shown is a schematic diagram of address allocation of each RAM of the RAM storage unit of the receiving direction message statistics module in one embodiment of the present application.
[0020] Figure 4 Shown is a schematic diagram of a process for updating the statistical values of a designated target statistical item in one embodiment of the present application.
[0021] Figure 5 Shown is a schematic diagram of address allocation of the APB bus in one embodiment of the present application.
[0022] Figure 6 Shown is a flowchart of a multi-port multi-channel sending direction message classification and statistics method in one embodiment of the present application.
[0023] Figure 7 Shown is a flowchart of a multi-port multi-channel receiving direction message classification and statistics method in one embodiment of the present application. DETAILED DESCRIPTION
[0024] The following describes the embodiments of the present application through specific examples, and those skilled in the art can easily understand other advantages and effects of the present application from the contents disclosed in this specification. The present application can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present application. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.
[0025] Before further describing the present invention in detail, the nouns and terms involved in the embodiments of the present invention are explained. The nouns and terms involved in the embodiments of the present invention are subject to the following explanations.
[0026] <1> RAM (Random Access Memory): Random access memory is used to store program codes, data and instructions when the computer is running.
[0027] <2> FIFO (First In First Out): is a first-in-first-out data storage and buffer.
[0028] <3> Counter: is a device used for counting. By initializing the value of a register to 0 and incrementing its value at specific events or clock cycles, the behavior of a counter can be simulated.
[0029] <4> ECC (Error-Correcting Code): Error correction code is a technology used to detect and correct data corruption or data errors. It is widely used in computer memory (RAM), hard disk drives (HDD), solid-state drives (SSD), communication systems, satellite communications and broadcasting systems.
[0030] <5> VLAN (Virtual Local Area Network): A virtual local area network is a technology used to isolate different network traffic in a switching network. A VLAN tag is added to a data frame to identify which VLAN the frame belongs to.
[0031] <6> APB (Advanced Peripheral Bus) bus: a bus architecture used in embedded systems and SoC (System on Chip), mainly used to connect the CPU core of the processor with various low-speed peripherals, such as I / O controllers, interrupt controllers, timers, etc.
[0032] The technical solutions of the embodiments of the present application can be applied to various communication systems, such as: Long Term Evolution (LTE) system, LTE frequency division duplex (FDD) system, fifth generation (5G) communication system, new radio access technology (NR), LTE time division duplex (TDD), Worldwide Interoperability for Microwave Access (WiMAX), Universal Mobile Telecommunication System (UMTS), and vehicle-to-XV2X. Among them, V2X can include vehicle to network (V2N), vehicle to vehicle (V2V), vehicle to infrastructure (V2I), vehicle to pedestrian (V2P), Long Term Evolution-Vehicle (LTE-V), Internet of Vehicles, machine type communication (MTC), Internet of Things (IoT), Long Term Evolution-Machine (LTE-M), Machine to Machine (M2M), etc.
[0033] In order to solve the problems in the above-mentioned background technology, the present invention provides a multi-port and multi-channel message classification and statistics device and method, which are applied to a network flow processor chip, aiming to solve the problems of large area, high power consumption and poor performance of the network flow processor chip caused by the existing allocation of an independent counter to each message statistics item of each port and each channel, thereby reducing the area of the network flow processor chip, reducing the power consumption of the chip and improving the performance of the chip.
[0034] At the same time, in order to make the purpose, technical solution and advantages of the present invention more clear, the technical solution in the embodiment of the present invention is further described in detail through the following embodiments and in combination with the accompanying drawings. It should be understood that the specific embodiments described here are only used to explain the present invention and are not used to limit the invention.
[0035] like Figure 1 As shown, a schematic diagram of the structure of a multi-port multi-channel message classification and statistics device in an embodiment of the present invention is shown. The multi-port multi-channel message classification and statistics device in this embodiment includes: a sending direction message statistics module 1 and a receiving direction message statistics module 2. Among them, the sending direction message statistics module 1 is used to classify and count the sending direction messages of different ports and different channels using a message classification and statistics structure; the receiving direction message statistics module 2 is used to classify and count the receiving direction messages of different ports and different channels using a message classification and statistics structure.
[0036] Specifically, the message classification statistics structure includes: a RAM storage unit, a FIFO storage unit, a FIFO read data unit, a RAM read data unit and an addition counting unit. Figure 1 As shown, the sending direction message statistics module 1 and the receiving direction message statistics module 2 each include a RAM storage unit, a FIFO storage unit, a FIFO read data unit, a RAM read data unit and an addition counting unit, which are respectively used to classify and count the received sending direction messages and receiving direction messages. Figure 1 As shown, each FIFO read data unit is connected to the corresponding FIFO storage unit, each RAM read data unit is connected to the corresponding FIFO read data unit and RAM storage unit, and each addition counting unit is connected to the corresponding RAM read data unit and RAM storage unit.
[0037] It should be noted that the units in the sending direction message statistics module 1 and the receiving direction message statistics module 2 are not related to each other, and the only difference is that the types of messages processed are different; and due to the different types of messages processed, the sending direction message statistics module 1 and the receiving direction message statistics module 2 can preset different target statistical items.
[0038] The RAM storage unit includes: a plurality of RAMs, each used to store the statistical values of the sending direction messages or receiving direction messages of each port and channel about each preset target statistical item.
[0039] In a specific embodiment, a network flow processor chip has 4 ports, each port includes 8 channels; the preset target statistical items of the sending direction message include: 7 types of the number of all message bytes, the number of broadcast messages, the number of correct messages, the number of VLAN messages, the number of error messages, the number of unicast messages and the number of multicast messages; the preset target statistical items of the receiving direction message include: 16 types of the number of all message bytes, the total number of all messages, the number of correct message bytes, the number of 64-byte messages, the number of error messages, the number of 65-127 byte messages, the number of unicast messages, the number of 128-255 byte messages, the number of multicast messages, the number of 256-511 byte messages, the number of broadcast messages, the number of 512-1023 byte messages, the number of correct messages, the number of 1024-1518 byte messages, the number of VLAN messages and the number of 1519-maximum allowed length messages. Therefore, the RAM storage unit in the sending direction message statistics module 1 described in the present application sets 4 RAMs for the statistical values of 7 types of target statistical items of the sending direction messages of the 4 ports with a total of 32 channels, and the RAM storage unit in the receiving direction message statistics module 2 described in the present application sets 8 RAMs for the statistical values of 16 types of target statistical items of the sending direction messages of the 4 ports with a total of 32 channels. That is, each RAM stores the statistical values of 2 types of target statistical items of the 4 ports with a total of 32 channels. Each RAM is allocated with 64 corresponding addresses for storing the statistical values of 2 types of target statistical items of 32 channels, such as Figure 2 as well as Figure 3 As shown, absolute addresses No. 0-31 respectively store the statistical values of the first type of target statistical items of each channel, and absolute addresses No. 32-63 respectively store the statistical values of the second type of target statistical items of each channel.
[0040] It should be noted that the target statistical items can be set according to needs, such as adding other types of target statistical items. The present invention does not limit the type and number of specific target statistical items, and ensures that the statistical values of the target statistical items of each channel of each port are assigned a specified RAM address.
[0041] In one embodiment, the RAM storage unit further includes: a RAM initialization subunit, an ECC generation subunit, and an ECC error correction subunit. The RAM initialization subunit is connected to each RAM, and is used to write zeros to all addresses of each RAM in response to the reset signal of the multi-port multi-channel message classification and statistics device; the ECC generation subunit is connected to each RAM, and is used to generate additional correction codes for the statistical value data stored in each RAM; the ECC error correction subunit is connected to each RAM, and is used to detect and correct errors that occur when reading statistical value data from the RAM. Therefore, in addition to the RAM addresses allocated for storing the statistical values of each target statistical item of each port and channel, each RAM is also allocated with RAM addresses for storing correction codes to improve the reliability and integrity of the statistical value data stored in the RAM.
[0042] In a preferred embodiment, each RAM adopts a dual-port RAM, each having a read data port and a write data port. In addition, when connecting the RAM storage unit, a selector connection can be designed to ensure that only one read data operation or write data operation instruction is sent to each RAM each time, avoiding read and write conflicts of each RAM, and making the multi-port multi-channel message classification and statistics device process message statistics request rates each time consistent, thereby ensuring the performance of the device and the chip.
[0043] The FIFO storage unit is used to temporarily store the message statistics request of the sending direction message or the receiving direction message of each port and channel. The message statistics request includes the message statistics request signal, the statistics type indication, and the corresponding port number and channel number.
[0044] The FIFO read data unit is used to read the message statistics requests to be processed from the FIFO storage unit in sequence based on a preset frequency and send them to the RAM read data unit. Specifically, the FIFO read data unit gives priority to reading the message statistics requests that are first sent to the FIFO storage unit for temporary storage based on the first-in-first-out principle. When reading, a certain read delay is set according to the rate at which the sending direction message statistics module 1 and the receiving direction message statistics module 2 classify and count the messages, so that the FIFO read data unit can read the message statistics requests to be processed based on a certain frequency, so that the multi-port multi-channel message classification and statistics device always processes the received messages at a certain frequency.
[0045] The purpose of the design of the present application in this embodiment is: to temporarily store the message statistics request through the FIFO storage unit first, and then read the message statistics request based on a certain frequency through the FIFO data reading unit, so that the sending direction message statistics module 1 and the receiving direction message statistics module 2 only need to process the message statistics request of one channel of one port each time, and convert irregular requests into regular processing rhythm within the module, thereby improving the data processing performance of the multi-port multi-channel message classification and statistics device, and then helping to improve the performance of the corresponding network flow processor chip.
[0046] The RAM data reading unit is used to parse the received message statistics request to be processed, and perform a data reading operation on the RAM storage unit according to the current message statistics information obtained by the analysis, so as to obtain the statistical value of the specified target statistical item. The method of parsing the current message statistics information includes: obtaining the current message statistics information according to the message statistics request signal, the statistics type indication, and the corresponding port number and channel number contained in the message statistics request to be processed, wherein the current message statistics information includes the port number, channel number, one or more specified target statistical items and the corresponding statistics to be counted of the message to be counted.
[0047] In one embodiment, a read data operation is performed on the RAM storage unit according to the current message statistical information obtained by parsing, and a method for obtaining the statistical value of the specified target statistical item includes: obtaining the port number, channel number, one or more specified target statistical items and corresponding to-be-counted data of the message to be counted in the current message statistical information, and judging whether the port number, channel number and each specified target statistical item are consistent with the last processed message statistical information; if they are consistent, a quick operation instruction is sent to the addition counting unit, so that the addition counting unit performs a quick update statistical value operation according to the port number, channel number, each specified target statistical item and the corresponding to-be-counted data; if they are inconsistent, a non-quick operation instruction is sent to the addition counting unit, and according to the obtained port number, channel number and each specified target statistical item, a RAM address for storing the statistical value of each specified target statistical item of the corresponding port and channel is locked, and the corresponding statistical value is read from each locked RAM address, so that the addition counting unit performs a non-quick update statistical value operation according to the port number, channel number, each specified target statistical item and the corresponding statistical value and to-be-counted data.
[0048] The addition counting unit includes: a plurality of addition counters, which are respectively used to update the statistical values of each target statistical item of the sending direction message or the receiving direction message. In a specific embodiment, the preset target statistical items of the sending direction message include: the number of all message bytes, the number of broadcast messages, the number of correct messages, the number of VLAN messages, the number of error messages, the number of unicast messages, and the number of multicast messages. Therefore, the addition counting unit in the sending direction message statistics module 1 includes 7 addition counters to respectively perform the update statistical value operation on the target statistical items of each type of the sending direction message; and the preset target statistical items of the receiving direction message include: the number of all message bytes, the total number of all messages, the number of correct message bytes, the number of 64-byte message ... The number of section messages, the number of error messages, the number of 65-127 byte messages, the number of unicast messages, the number of 128-255 byte messages, the number of multicast messages, the number of 256-511 byte messages, the number of broadcast messages, the number of 512-1023 byte messages, the number of correct messages, the number of 1024-1518 byte messages, the number of VLAN messages, and the number of 1519-maximum allowed length messages are 16 types, so the receiving direction message statistics module 2 includes 16 adder counters to respectively perform the update statistical value operation on the target statistical items of each type of receiving direction messages. It should be noted that the adder counter in this application is set according to the number of types of target statistical items preset in the message, and the specific number is not limited in this application.
[0049] The purpose of the design of the present application in this embodiment is to set the same number of adder counters according to the number of target statistical items, so that each adder counter processes a corresponding statistical value of a specified target statistical item. At this time, each adder counter can process the statistical values of the target statistical items of all ports and channels. Therefore, the present application greatly reduces the number of adder counters, thereby reducing the number of registers used.
[0050] For example, a network flow processor chip has 4 ports, each port includes 8 channels, the target statistical items of the sending direction message include 7 types, and the target statistical items of the receiving direction message include 16 types. In the prior art, each message statistical item of each port and each channel is allocated with an independent counter, so the classification statistics of the sending direction message requires 4*8*7 independent counters, and the classification statistics of the receiving direction message requires 4*8*16 independent counters. However, in the present application, the addition counting unit of the sending direction message statistics module only requires 7 independent counters, and the addition counting unit of the receiving direction message statistics module only requires 16 independent counters. It can be seen from this that the technical solution of the present application greatly reduces the addition counters, thereby reducing the number of registers used, and further significantly reducing the chip area and chip power consumption of the network flow processor chip.
[0051] It should be understood that a register is a high-speed storage device that can be used to store instructions, data or addresses, and the adder counter can be implemented based on a register to perform addition operations and temporarily store operation results.
[0052] In a preferred embodiment, each of the adder counters includes: a plurality of small bit width counters cascaded to each other. The present application uses a plurality of small bit width counters to form a counter with more bits, thereby expanding the counting range; and, compared with a large bit width counter, a plurality of small bit width counters are simpler, involve less logic, have shorter path delays, and can better guarantee the timing requirements of the adder counter when counting.
[0053] The adder counting unit selects a corresponding adder counter according to the current message statistical information to update the statistical value of each designated target statistical item, and writes the updated statistical value back to the RAM storage unit.
[0054] In one embodiment, the implementation process of updating the statistical values of designated target statistical items specifically includes: selecting a corresponding adder counter according to each designated target statistical item obtained; determining whether the received operation instruction type is a quick operation instruction or a non-quick operation instruction; if it is a quick operation instruction, executing a quick statistical value update operation, based on each adder counter, performing an addition operation on the temporarily stored statistical values of each designated target statistical item and the corresponding to-be-stated data sent by the RAM read data unit to obtain the updated statistical values of each designated target statistical item; if it is a non-quick operation instruction, executing a non-quick statistical value update operation, based on each adder counter, performing an addition operation on the statistical values of each designated target statistical item sent by the RAM read data unit and the corresponding to-be-stated data to obtain the updated statistical values of each designated target statistical item; temporarily storing the updated statistical values of each designated target statistical item in the corresponding adder counter, and performing a write data operation on the RAM storage unit to write the updated statistical values back to the RAM storage unit.
[0055] In one embodiment, a write data operation is performed on the RAM storage unit to write the updated statistical values of each designated target statistical item back to the RAM storage unit, including: locking the RAM address in the RAM storage unit for storing the statistical values of each designated statistical item of the corresponding port and channel according to the port number, channel number and each designated statistical item; and writing the updated statistical value of each designated target statistical item into the locked corresponding RAM address.
[0056] The present application temporarily stores the statistical values of one or more designated target statistical items of a channel of a port so that when the statistical values of the target statistical items of the channel of the port are updated later, there is no need to read the statistical values from the RAMs of the RAM storage unit, but the temporarily stored statistical values can be directly added, thereby realizing a quick path for updating the statistical values.
[0057] For example, if the sending direction message statistics module 1 or the receiving direction message statistics module 2 continuously receives multiple message statistics requests about the same port and the same channel and the same or multiple target statistical items, a shortcut path is used to update its statistical values: for the message statistical information obtained by the first message statistical request, a read data operation is performed on the RAM storage unit to obtain the statistical values of each corresponding target statistical item of the specified port and the specified channel; a corresponding adder counter is selected, and an addition operation is performed on each obtained statistical value and each corresponding to-be-stated data contained in the message statistical information to obtain an updated statistical value of each corresponding target statistical item of the specified port and the specified channel; the updated statistical values are temporarily stored in the corresponding adder counter and written back to each RAM of the RAM storage unit; when processing the second message statistical request, since the message statistical request for the same port and the same channel and the same or multiple target statistical items is processed, there is no need to read the statistical values from each RAM, and only the temporarily stored statistical values need to be added to continue to update the statistical values of the corresponding target statistical items of the specified port and the specified channel.
[0058] Because the statistical logic of this application is based on the addition of the counting history value and the incremental value, and the RAM read and write operations, ECC encoding and error correction, and data addition operations all have delays, if the updated value of the statistical item is written back to the RAM as the end of an atomic operation, then the atomic operation of updating the statistical value requires multiple clock cycles. If it is executed serially one by one in the order of statistical requests, the efficiency is very low, which seriously affects the system performance. On the contrary, if the performance requirements of serial statistics are to be met, higher requirements are placed on the system design and clock frequency, which increases the system cost. However, if a shortcut path is used, the number of times the RAM is read is reduced, and the processing rate of updating the statistical value is increased, the chip performance of the network flow processing chip is further improved, and the chip power consumption of the network flow processing chip is reduced.
[0059] In one embodiment, the message classification statistics structure further includes: a software query interface unit connected to the RAM storage unit. Figure 1As shown, the sending direction message statistics module 1 and the receiving direction message statistics module 2 each include a software query interface unit. Each software query interface unit is connected to a corresponding RAM storage unit. The software query interface unit is used to respond to a message statistics value query request from an external software, perform a data read operation on the RAM storage unit, obtain and output the statistical value of the sending direction message or the receiving direction message of the specified port and channel about the specified target statistical item.
[0060] In a specific embodiment, the software query interface units of the sending direction message statistics module 1 and the receiving direction message statistics module 2 can share the same APB bus to connect with external software, but occupy different address spaces respectively. Figure 4 As shown, the APB bus includes 16 address lines, of which 3 address lines are used to address 4 RAMs storing statistical values of 7 types of target statistical items in the sending direction and 8 RAMs storing statistical values of 16 types of target statistical items in the receiving direction; 5 address lines are used to address the channel numbers of 32 channels in total of 8 channels of 4 ports.
[0061] In one embodiment, the FIFO read data unit is also correspondingly connected to the software query interface unit, and is used to obtain the read busy state of the software query interface unit based on a preset frequency. When the read busy state is idle, the message statistics request to be processed is read from the FIFO storage unit and sent to the RAM read data unit, so that the RAM read data unit performs a read data operation on the RAM storage unit.
[0062] The purpose of the design of the present application in this embodiment is to obtain the read busy status of the software query interface unit through the FIFO read data unit at a regular time, and only when the software query interface unit is idle, that is, when no external software needs to query the statistical value of the specified target statistical item of a certain port and channel, the FIFO read data unit will read the message statistical request. In this way, it is avoided that when the software query interface unit performs a read data operation on the RAM storage unit, the RAM read data unit also performs a read data operation on the RAM storage unit or the addition counting unit performs a write data operation on the RAM storage unit, thereby avoiding the read and write conflict of the RAM storage unit, and further improving the performance of the network flow processor chip.
[0063] It should be noted that, when the RAM depth and bit width are large, registers are often added to the RAM read data to meet the timing requirements. The RAM read data unit and the addition counting unit described in this application are implemented using registers, so that it takes a large number of clock cycles from the RAM read data unit issuing a RAM read operation instruction to the addition counting unit executing a write operation. However, the multi-port multi-channel message classification and statistics device described in this application, while avoiding read and write conflicts for each RAM, makes separate considerations for each cycle of the RAM read and write process, and sets a read delay that meets the requirements in the FIFO read data unit, that is, sets a specific read message statistics request frequency, which can improve the average processing performance of the device to 1 / 2 of the clock frequency, that is, only 1 / 2 of the original number of clock cycles is required.
[0064] In order to better describe the specific structure and working mode of the multi-port multi-channel message classification and statistics device, this application is combined with the following specific embodiments and Figure 5 Further details are given.
[0065] Embodiment: A message classification and statistics device for 32 channels.
[0066] like Figure 5 As shown, the device specifically includes: a module for classifying and counting messages in the sending direction and a module for classifying and counting messages in the receiving direction. Each module includes: a FIFO unit, a FIFO read generation logic unit, a RAM unit, an addition unit, a register group, an APB state machine and a plurality of selectors. Among them, 4 RAM units are set according to the 7 types of target statistical items preset in the sending direction message to store the statistical values of the corresponding 32 channels, and 8 RAM units are set according to the 16 types of target statistical items preset in the receiving direction message to store the statistical values of the corresponding 32 channels. The two modules work in a similar manner. Taking the module for classifying and counting messages in the sending direction as an example, its working method includes the following steps.
[0067] A request for sending direction message statistics is received through the FIFO unit, wherein the request includes a sending direction message statistics request signal, a sending direction message statistics type indication, a port number to which the sending direction message belongs, and a channel number.
[0068] Through the FIFO read generation logic unit, the busy state of the APB state machine is regularly queried, and the current addition busy state is sent to the APB state machine. When the APB state machine is idle, that is, when the read data operation is not performed on each RAM unit, a sending direction message statistics request is actively read from the FIFO unit as the current pending message statistics request, and the port number, channel number, one or more target statistics items to be counted and the current pending statistics of the message to be counted are obtained according to the current pending message statistics request, and whether the shortcut path condition is met, the read data operation is performed on each RAM, or the shortcut operation instruction is directly sent to the addition unit. It should be noted that if the device receives a reset signal when it starts working, it is necessary to initialize each RAM unit first, that is, write zero to the RAM address of each RAM unit, and notify the FIFO read generation logic unit after the initialization is completed, so that the FIFO read generation logic unit can start reading the current pending message statistics request. The shortcut path condition refers to the continuous receipt of statistical requests for the same target statistics item to be counted on the same channel of the same port. At this time, the classified statistics of the messages to be counted can be performed based on the shortcut path.
[0069] By performing a read data operation on each RAM unit, the RAM address used to store the statistical values of each target statistical item to be counted corresponding to the port number and channel number is locked, and the corresponding statistical value is read from each RAM address. Among them, each RAM is a dual-port RAM, which has only one read data port and one write data port. A selector is set when reading each RAM unit to ensure that only one instruction is sent to each RAM unit at a time, such as sending an initialization instruction or a read data operation instruction, to avoid read and write conflicts of each RAM. After reading the statistical values of each target statistical item to be counted of the specified port and channel from each RAM address, each statistical value is sent to the addition unit. At this time, a selector can also be added to send only one operation instruction to each RAM unit at a time.
[0070] Through the adding unit, the statistical values read from each RAM unit and the corresponding current statistical data to be counted are added to obtain the updated statistical values. The updated statistical values are temporarily stored in the register group and written back to each RAM unit. It should be noted that if the adding unit receives a shortcut operation instruction, it is not necessary to perform a read data operation on each RAM unit to obtain the statistical value. The temporarily stored statistical values can be directly obtained from each register group, and the addition operation can be performed according to the corresponding current statistical data to be counted to obtain the updated statistical values. In this way, the number of read data for each RAM unit can be reduced, thereby increasing the data processing rate, thereby improving the performance of the device and reducing its power consumption. It should be noted that the register group includes a plurality of registers for temporarily storing the statistical values corresponding to each target statistical item, and the number of registers is the same as the number of each target statistical item. For example, if the sending direction message is preset with 7 types of target statistical items, the corresponding module sets 7 registers, which are respectively used to perform the statistical value addition operation of each type of target statistical item and temporarily store its statistical value; similarly, if the receiving direction is preset with 16 types of target statistical items, the corresponding module sets 16 registers.
[0071] When the external software needs to query the statistical value of one or more target statistical items of the message, the request is sent to the APB state machine through the APB bus, and the APB state machine performs a read data operation on each RAM unit to obtain the statistical value of each target statistical item of the corresponding port and channel, and sends it to the external software. Similarly, a selector can be set when performing a read data operation on each RAM unit.
[0072] This application sets each RAM unit to store the statistical values of all target statistical items of all channels of all ports, and based on the FIFO unit to temporarily store the message statistical request and based on the FIFO read to generate the logic unit, on the one hand, it converts the external irregular message statistical request into the internal regular processing rhythm of the device, so that the device can always process the message statistical request based on a fixed rate to perform message classification statistics; on the other hand, it also makes the device need to process the message statistical request of one channel of one port each time, so that it is only necessary to set multiple registers for the number of target statistical items, without setting registers for each type of target statistical item of each channel of each port, which greatly reduces the number of registers, thereby greatly reducing the chip area and chip power consumption of the network flow processor chip where the device is located, and improving the chip performance. At the same time, a shortcut path is designed when the message statistical request of the same channel of the same port is continuously received, which further improves the chip performance.
[0073] It should be understood that the division of modules in the embodiments of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation. In addition, each functional module in each embodiment of the present application may be integrated into a processor, or may exist physically separately, or two or more modules may be integrated into one module. The above-mentioned integrated modules may be implemented in the form of hardware or in the form of software functional modules.
[0074] Furthermore, in the embodiments of the present application, words such as "first" and "second" are used to distinguish between identical or similar items with substantially identical functions and effects. For example, the first XX and the second XX are only used to distinguish different XXs, and do not limit their order. Those skilled in the art will understand that words such as "first" and "second" do not limit the quantity and execution order, and words such as "first" and "second" do not necessarily limit them to be different.
[0075] It should be noted that in the embodiments of the present application, words such as "exemplary" or "for example" represent examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0076] In the embodiments of the present application, "at least one" refers to one or more, and "plurality" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can represent: a, b, c, ab, ac, bc or abc, where a, b, c can be single or multiple.
[0077] like Figure 6 As shown, a flow chart of a multi-port multi-channel sending direction message classification and statistics method provided by an embodiment of the present application is shown. The multi-port multi-channel sending direction message classification and statistics method is applied to the sending direction message statistics module 1 in any of the multi-port multi-channel message classification and statistics devices described above, and includes the following steps.
[0078] Step S601: Statistical values of preset target statistical items of the sending direction messages of each port and channel are stored respectively through multiple RAMs in the RAM storage unit.
[0079] Step S602: temporarily storing the message statistics request of the sending direction messages of each port and channel through the FIFO storage unit.
[0080] Step S603: The message statistics requests to be processed are read from the FIFO storage unit in sequence based on a preset frequency through the FIFO read data unit, and sent to the RAM read data unit.
[0081] Step S604: parsing the received message statistics request to be processed through the RAM read data unit, and performing a read data operation on the RAM storage unit according to the current message statistics information obtained through the parsing to obtain the statistical value of the specified target statistical item.
[0082] Step S605: Selecting a corresponding adder counter according to the current message statistical information through the adder counting unit to update the statistical value of each designated target statistical item, and writing the updated statistical value back to the RAM storage unit. The adder counting unit includes: a plurality of adder counters, each used to update the statistical value of each target statistical item of the message in the sending direction.
[0083] It should be understood that the specific processes of the above corresponding steps have been described in detail in the above device embodiments, and for the sake of brevity, they will not be repeated here.
[0084] like Figure 7 As shown, a flow chart of a multi-port multi-channel receiving direction message classification and statistics method provided by an embodiment of the present application is shown. The multi-port multi-channel receiving direction message classification and statistics method is applied to the receiving direction message statistics module 2 in any of the multi-port multi-channel message classification and statistics devices described above, and includes the following steps.
[0085] Step S701: Statistical values of preset target statistical items of receiving direction messages of each port and channel are stored respectively through multiple RAMs in the RAM storage unit.
[0086] Step S702: temporarily storing the message statistics request of the receiving direction message of each port and channel through the FIFO storage unit.
[0087] Step S703: The message statistics requests to be processed are read from the FIFO storage unit in sequence based on a preset frequency through the FIFO read data unit, and sent to the RAM read data unit.
[0088] Step S704: parsing the received message statistics request to be processed through the RAM read data unit, and performing a read data operation on the RAM storage unit according to the current message statistics information obtained through the parsing to obtain the statistical value of the specified target statistical item.
[0089] Step S705: The adder counting unit selects a corresponding adder counter according to the current message statistical information to update the statistical value of each designated target statistical item, and writes the updated statistical value back to the RAM storage unit. The adder counting unit includes: a plurality of adder counters, each of which is used to update the statistical value of each target statistical item of the message in the receiving direction.
[0090] It should be understood that the specific processes of the above corresponding steps have been described in detail in the above device embodiments, and for the sake of brevity, they will not be repeated here.
[0091] According to the method provided by the embodiments of the present application, the present application also provides a computer program product, which includes: computer program code, when the computer program code is run on a computer, the computer executes the multi-port multi-channel sending direction message classification and statistics method and the multi-port multi-channel receiving direction message classification and statistics method of any of the above embodiments.
[0092] According to the method provided by the embodiments of the present application, the present application also provides a computer-readable storage medium, which stores a program code. When the program code is run on a computer, the computer executes the multi-port multi-channel sending direction message classification and statistics method and the multi-port multi-channel receiving direction message classification and statistics method of any of the above embodiments.
[0093] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0094] In summary, the present application provides a multi-port multi-channel message classification and statistics device and method, which can classify and count the sending direction messages and receiving direction messages of different ports and channels by setting a message classification and statistics structure including a RAM storage unit, a FIFO storage unit, a FIFO read data unit, a RAM read data unit and an addition counting unit, and by setting a sending direction message statistics module and a receiving direction message statistics module that adopt the message classification and statistics structure; the present application is based on multiple RAMs to store the statistical values of the sending direction messages or the receiving direction messages of each port and channel about each preset target statistical item, and based on the FIFO storage unit to temporarily store the statistical values of each port and channel The message statistics request of the sending direction message or the receiving direction message of the channel is read from the FIFO storage unit in sequence based on a preset frequency through the FIFO read data unit, so that the RAM read data unit and the addition counting unit perform read data operations and write data operations on each RAM, thereby completing the update of the corresponding statistical value; therefore, the present application has the following beneficial effects: the present application solves the problem of large area, high power consumption and poor performance of the network flow processor chip caused by the existing allocation of an independent counter to each message statistics item of each port and each channel, and can reduce the area of the network flow processor chip, reduce the power consumption of the chip and improve the performance of the chip.
[0095] Therefore, the present application effectively overcomes various shortcomings in the prior art and has high industrial utilization value.
[0096] The above embodiments are merely illustrative of the principles and effects of the present application and are not intended to limit the present application. Anyone familiar with the technology may modify or change the above embodiments without violating the spirit and scope of the present application. Therefore, all equivalent modifications or changes made by a person of ordinary skill in the art without departing from the spirit and technical ideas disclosed in the present application shall still be covered by the claims of the present application.
Claims
1. A multi-port multi-channel message classification and statistics device, characterized in that: include: The sending direction message statistics module and the receiving direction message statistics module are used to classify and count the sending direction messages and the receiving direction messages of different ports and channels respectively by using the message classification statistics structure; The message classification statistics structure includes: The RAM storage unit includes: a plurality of RAMs, each used to store the statistical values of the sending direction messages or the receiving direction messages of each port and channel about each preset target statistical item; A FIFO storage unit is used to temporarily store the message statistics request of the sending direction message or the receiving direction message of each port and channel; A FIFO data reading unit, connected to the FIFO storage unit, for sequentially reading the message statistics requests to be processed from the FIFO storage unit based on a preset frequency, and sending them to the RAM data reading unit; A RAM data reading unit connected to the FIFO data reading unit and the RAM storage unit, used to parse the received message statistics request to be processed, and perform a data reading operation on the RAM storage unit according to the current message statistics information obtained by the parsing, so as to obtain the statistical value of the specified target statistical item; An adder counting unit is connected to the RAM data reading unit and the RAM storage unit, and the adder counting unit includes: a plurality of adder counters, which are respectively used to update the statistical values of each target statistical item of the sending direction message or the receiving direction message; the adder counting unit selects the corresponding adder counter according to the current message statistical information to update the statistical value of each designated target statistical item, and writes the updated statistical values back to the RAM storage unit; A method for performing a data read operation on the RAM storage unit according to the current message statistical information obtained by parsing to obtain the statistical value of the designated target statistical item includes: obtaining the port number, channel number, one or more designated target statistical items and corresponding data to be counted of the message to be counted in the current message statistical information, and judging whether the port number, channel number and each designated target statistical item are consistent with the last processed message statistical information; if they are consistent, sending a quick operation instruction to the addition counting unit, so that the addition counting unit performs a quick update statistical value operation according to the port number, channel number, each designated target statistical item and the corresponding data to be counted; if they are inconsistent, sending a non-quick operation instruction to the addition counting unit, and locking the RAM address for storing the statistical value of each designated target statistical item of the corresponding port and channel according to the obtained port number, channel number and each designated target statistical item, and reading the corresponding statistical value from each locked RAM address, so that the addition counting unit performs a non-quick update statistical value operation according to the port number, channel number, each designated target statistical item and the corresponding statistical value and the data to be counted; The addition counting unit selects the corresponding addition counter according to the current message statistical information to update the statistical value of each designated target statistical item, and writes the updated statistical value back to the RAM storage unit in the following manners: selecting the corresponding addition counter according to each designated target statistical item obtained; judging whether the received operation instruction type is a quick operation instruction or a non-quick operation instruction; if it is a quick operation instruction, performing a quick update statistical value operation, based on each addition counter, performing an addition operation on the temporarily stored statistical value of each designated target statistical item and the corresponding to-be-stated data sent by the RAM read data unit to obtain the updated statistical value of each designated target statistical item; if it is a non-quick operation instruction, performing a non-quick update statistical value operation, based on each addition counter, performing an addition operation on the statistical value of each designated target statistical item sent by the RAM read data unit and the corresponding to-be-stated data to obtain the updated statistical value of each designated target statistical item; temporarily storing the updated statistical value of each designated target statistical item in the corresponding addition counter, performing a write data operation on the RAM storage unit, and writing the updated statistical value back to the RAM storage unit.
2. The multi-port multi-channel message classification and statistics device according to claim 1, characterized in that: The message classification statistics structure also includes: a software query interface unit, connected to the RAM storage unit, used to respond to a message statistics value query request from external software, perform a data read operation on the RAM storage unit, and obtain and output the statistical value of the sending direction message or the receiving direction message of the specified port and channel regarding the specified target statistical item.
3. The multi-port multi-channel message classification and statistics device according to claim 2, characterized in that: The FIFO read data unit is also correspondingly connected to the software query interface unit, and is used to obtain the read busy state of the software query interface unit based on a preset frequency. When the read busy state is idle, the message statistics request to be processed is read from the FIFO storage unit and sent to the RAM read data unit, so that the RAM read data unit performs a read data operation on the RAM storage unit.
4. The multi-port multi-channel message classification and statistics device according to claim 1, characterized in that: The method of performing a data write operation on the RAM storage unit to write the updated statistical value of each designated target statistical item back to the RAM storage unit includes: According to the port number, channel number and each designated statistical item, locking the RAM address in the RAM storage unit for storing the statistical value of each designated statistical item corresponding to the port and channel; Write the updated statistical value of each designated target statistical item into the corresponding locked RAM address.
5. The multi-port multi-channel message classification and statistics device according to claim 1, characterized in that: The RAM storage unit comprises: A RAM initialization subunit, connected to each RAM, for responding to a reset signal of the multi-port multi-channel message classification and statistics device, writing zeros to all addresses of each RAM; An ECC generation subunit, connected to each RAM, for generating an additional correction code for the statistical value data stored in each RAM; The ECC error correction subunit is connected to each RAM and is used to detect and correct errors that occur when reading statistical value data from the RAM.
6. The multi-port multi-channel message classification and statistics device according to claim 1, characterized in that: Each of the adder counters includes: a plurality of small bit width counters cascaded to each other.
7. A method for classifying and counting messages in a multi-port and multi-channel sending direction, applied to a sending direction message counting module in a multi-port and multi-channel message classification and counting device as claimed in any one of claims 1 to 6, characterized in that: The method comprises: The statistical values of the preset target statistical items of the sending direction messages of each port and channel are stored respectively through the multiple RAMs in the RAM storage unit; The message statistics request of the sending direction messages of each port and channel is temporarily stored through the FIFO storage unit; Reading the message statistics requests to be processed from the FIFO storage unit in sequence based on a preset frequency through the FIFO read data unit, and sending them to the RAM read data unit; Parsing the received message statistics request to be processed through the RAM reading data unit, and performing a data reading operation on the RAM storage unit according to the current message statistics information obtained through the parsing to obtain the statistical value of the specified target statistical item; The adding counting unit selects a corresponding adding counter according to the current message statistical information to update the statistical value of each designated target statistical item, and writes the updated statistical value back to the RAM storage unit; wherein the adding counting unit includes: a plurality of adding counters, each used to update the statistical value of each target statistical item of the message in the sending direction; A method for performing a data read operation on the RAM storage unit according to the current message statistical information obtained by parsing to obtain the statistical value of the designated target statistical item includes: obtaining the port number, channel number, one or more designated target statistical items and corresponding data to be counted of the message to be counted in the current message statistical information, and judging whether the port number, channel number and each designated target statistical item are consistent with the last processed message statistical information; if they are consistent, sending a quick operation instruction to the addition counting unit, so that the addition counting unit performs a quick update statistical value operation according to the port number, channel number, each designated target statistical item and the corresponding data to be counted; if they are inconsistent, sending a non-quick operation instruction to the addition counting unit, and locking the RAM address for storing the statistical value of each designated target statistical item of the corresponding port and channel according to the obtained port number, channel number and each designated target statistical item, and reading the corresponding statistical value from each locked RAM address, so that the addition counting unit performs a non-quick update statistical value operation according to the port number, channel number, each designated target statistical item and the corresponding statistical value and the data to be counted; The addition counting unit selects the corresponding addition counter according to the current message statistical information to update the statistical value of each designated target statistical item, and writes the updated statistical value back to the RAM storage unit in the following manners: selecting the corresponding addition counter according to each designated target statistical item obtained; judging whether the received operation instruction type is a quick operation instruction or a non-quick operation instruction; if it is a quick operation instruction, performing a quick update statistical value operation, based on each addition counter, performing an addition operation on the temporarily stored statistical value of each designated target statistical item and the corresponding to-be-stated data sent by the RAM read data unit to obtain the updated statistical value of each designated target statistical item; if it is a non-quick operation instruction, performing a non-quick update statistical value operation, based on each addition counter, performing an addition operation on the statistical value of each designated target statistical item sent by the RAM read data unit and the corresponding to-be-stated data to obtain the updated statistical value of each designated target statistical item; temporarily storing the updated statistical value of each designated target statistical item in the corresponding addition counter, performing a write data operation on the RAM storage unit, and writing the updated statistical value back to the RAM storage unit.
8. A multi-port multi-channel receiving direction message classification and statistics method, applied to the receiving direction message statistics module in the multi-port multi-channel message classification and statistics device as claimed in any one of claims 1 to 6, characterized in that: The method comprises: The statistical values of the receiving direction messages of each port and channel about each preset target statistical item are stored respectively through the multiple RAMs in the RAM storage unit; The message statistics request of the receiving direction message of each port and channel is temporarily stored through the FIFO storage unit; Reading the message statistics requests to be processed from the FIFO storage unit in sequence based on a preset frequency through the FIFO read data unit, and sending them to the RAM read data unit; Parsing the received message statistics request to be processed through the RAM reading data unit, and performing a data reading operation on the RAM storage unit according to the current message statistics information obtained through the parsing to obtain the statistical value of the specified target statistical item; By means of the adder counting unit, according to the current message statistical information, a corresponding adder counter is selected to update the statistical value of each designated target statistical item, and the updated statistical value is written back to the RAM storage unit; wherein the adder counting unit comprises: a plurality of adder counters, each used to update the statistical value of each target statistical item of the message in the receiving direction; A method for performing a data read operation on the RAM storage unit according to the current message statistical information obtained by parsing to obtain the statistical value of the designated target statistical item includes: obtaining the port number, channel number, one or more designated target statistical items and corresponding data to be counted of the message to be counted in the current message statistical information, and judging whether the port number, channel number and each designated target statistical item are consistent with the last processed message statistical information; if they are consistent, sending a quick operation instruction to the addition counting unit, so that the addition counting unit performs a quick update statistical value operation according to the port number, channel number, each designated target statistical item and the corresponding data to be counted; if they are inconsistent, sending a non-quick operation instruction to the addition counting unit, and locking the RAM address for storing the statistical value of each designated target statistical item of the corresponding port and channel according to the obtained port number, channel number and each designated target statistical item, and reading the corresponding statistical value from each locked RAM address, so that the addition counting unit performs a non-quick update statistical value operation according to the port number, channel number, each designated target statistical item and the corresponding statistical value and the data to be counted; The addition counting unit selects the corresponding addition counter according to the current message statistical information to update the statistical value of each designated target statistical item, and writes the updated statistical value back to the RAM storage unit in the following manners: selecting the corresponding addition counter according to each designated target statistical item obtained; judging whether the received operation instruction type is a quick operation instruction or a non-quick operation instruction; if it is a quick operation instruction, performing a quick update statistical value operation, based on each addition counter, performing an addition operation on the temporarily stored statistical value of each designated target statistical item and the corresponding to-be-stated data sent by the RAM read data unit to obtain the updated statistical value of each designated target statistical item; if it is a non-quick operation instruction, performing a non-quick update statistical value operation, based on each addition counter, performing an addition operation on the statistical value of each designated target statistical item sent by the RAM read data unit and the corresponding to-be-stated data to obtain the updated statistical value of each designated target statistical item; temporarily storing the updated statistical value of each designated target statistical item in the corresponding addition counter, performing a write data operation on the RAM storage unit, and writing the updated statistical value back to the RAM storage unit.
Citation Information
Patent Citations
Channelizing logic single channel statistic method and apparatus
CN101141296A
Statistics counting equipment and realization method thereof, and system with statistics counting equipment
CN105207794A