WO2017016259A1 - Counting method and apparatus for service attribute, and computer storage medium - Google Patents

Counting method and apparatus for service attribute, and computer storage medium Download PDF

Info

Publication number
WO2017016259A1
WO2017016259A1 PCT/CN2016/080974 CN2016080974W WO2017016259A1 WO 2017016259 A1 WO2017016259 A1 WO 2017016259A1 CN 2016080974 W CN2016080974 W CN 2016080974W WO 2017016259 A1 WO2017016259 A1 WO 2017016259A1
Authority
WO
WIPO (PCT)
Prior art keywords
counter
module
attribute
counting
optimized
Prior art date
Application number
PCT/CN2016/080974
Other languages
French (fr)
Chinese (zh)
Inventor
张春晖
闫振林
包闯
安康
Original Assignee
深圳市中兴微电子技术有限公司
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 深圳市中兴微电子技术有限公司 filed Critical 深圳市中兴微电子技术有限公司
Publication of WO2017016259A1 publication Critical patent/WO2017016259A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/50Network service management, e.g. ensuring proper service fulfilment according to agreements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/14Network analysis or design
    • H04L41/142Network analysis or design using statistical or mathematical methods

Definitions

  • the present invention relates to the field of communications, and in particular, to a method and device for counting service attributes, and a computer storage medium.
  • the service statistics counting index is continuously increased and changes with the application scenario. This requires the statistical counting technology to flexibly adapt to different application scenarios.
  • the embodiments of the present invention are expected to provide a method and device for counting service attributes to meet the requirements of various application scenarios and improve flexibility.
  • an embodiment of the present invention provides a service attribute counting apparatus, including: a configuration module and at least one counting pipeline module; wherein the counting pipeline module includes: a key value generating module, an index module, and a counter updating module; Key-value generation module, configured to receive industry a request signal; optimizing an attribute field to be optimized in the service attribute carried in the service request signal to obtain an optimized attribute field; at least according to preset configuration information, a common attribute field in the service attribute, and the The optimized attribute field is generated and sent to the index module; the indexing module is configured to receive the corresponding key value; and determine a one-to-one corresponding counter index according to the corresponding key value An address is sent to the counter update module, and the counter update module is configured to perform a counting operation according to the counter index address and update a counter table, wherein an entry of the counter table is corresponding to the service attribute The value of the counter.
  • the key value generating module includes: a mapping table module and a logical operation module; wherein the mapping table module is configured to store the preset mapping table delivered by the configuration module, and press The attribute field to be optimized is mapped according to a preset mapping table, and a corresponding mapping value is obtained; the mapping value is determined as the optimized attribute field; and the logical operation module is configured to be configured according to the configuration information. And generating the common attribute field and the key value corresponding to the optimized attribute field, and sending the key value to the index module.
  • the service request signal may also be a counting request added by the user in the process of the service process, where the counting request carries a custom attribute; the logical operation module is further configured to be according to the preset The configuration information, the common attribute field, the optimized attribute field, and the custom attribute generate the corresponding key value.
  • the indexing module includes: an offset table module and an index calculation module; wherein the offset table module is configured to store an offset address of a counter and a counter offset enable signal; a module, configured to read, in a preset offset table, a counter offset address and a counter offset enable signal corresponding to the corresponding key value; and a counter base address and a location carried in the service request signal according to the The counter offset address and the counter offset enable signal are determined to determine the counter index address.
  • the index calculation module is further configured to be based on the configuration module
  • the counter updates the counter enable signal in the control information to determine whether the counter pipeline module in which it is located is enabled; when the counter pipeline module in which it is located is enabled, according to the corresponding key value, the preset bias is The corresponding counter offset address and the counter offset enable signal are read in the shift table.
  • the index calculation module is further configured to determine whether to update the counter table according to a counter enable signal and a counter offset enable signal in the counter update control information from the configuration module;
  • the counter update module is configured to perform a counting operation and update the counter table according to the counter index address when the index calculation module determines to update the counter table.
  • the service attribute counting apparatus further includes: a scheduling module, configured to receive at least one service request signal, and schedule the at least one service request signal to the at least one of the parallel according to a preset scheduling rule Count the flow module.
  • the service attribute counting apparatus further includes: a counter overflow processing module configured to sequentially read out the value of the counter in the counter table before the counter overflows, and send the value to the direct memory access DMA Module.
  • the embodiment of the present invention provides a method for counting service attributes, including: optimizing an attribute field to be optimized in a service attribute carried in a received service request signal, and obtaining an optimized attribute field; Setting the configuration information, the common attribute field in the service attribute, and the optimized attribute field to generate a corresponding key value; determining, according to the corresponding key value, a one-to-one corresponding counter index address; The address is counted and the counter table is updated, wherein the entry of the counter table is the value of the counter corresponding to the service attribute.
  • the attribute field to be optimized in the service attribute carried in the received service request signal is optimized, and the optimized attribute field is obtained, including: presetting the attribute field to be optimized according to a preset
  • the mapping table is mapped to obtain a corresponding mapping value;
  • the shot value is determined as the optimized attribute field;
  • the service request signal may also be a counting request added by the user in the process of the service process, where the counting request carries a custom attribute; the at least according to the preset configuration information, the message attribute Generating a corresponding key value in the normal attribute field and the optimized attribute field, including: according to the preset configuration information, the common attribute field, the optimized attribute field, and the customized attribute, The corresponding key value is generated.
  • determining, according to the corresponding key value, a one-to-one counter index address comprising: reading a counter offset address corresponding to the corresponding key value in a preset offset table And a counter offset enable signal; determining the counter index address according to the counter base address carried in the service request signal, the counter offset address, and the counter offset enable signal.
  • the performing the counting operation and updating the counter table according to the counter index address includes: determining to update the counter when the counter enable signal and the counter offset enable signal are determined according to the counter update control information At the time of the table, according to the counter index address, the counting operation is performed and the counter table is updated.
  • the method further comprises: sequentially reading out the value of the counter in the counter table before the counter overflows.
  • an embodiment of the present invention provides a computer storage medium, where the computer storage medium stores executable instructions, and the executable instructions are used to execute a method for counting service attributes provided by the embodiments of the present invention.
  • An embodiment of the present invention provides a method and a device for counting service attributes, and a computer storage medium.
  • the service attributes carried in the service request signal are flexibly classified, and corresponding key values are generated for each type of service attribute, and then determined.
  • the counter index address corresponding to the above key value Next, based on the counter index address, counting is performed, and the counter table is updated. It can be seen that the counting method of the service attribute provided by the embodiment of the present invention can adapt to the counting requirement of different application scenarios, and the storage resource sharing is reduced to reduce the resource occupation while greatly improving the flexibility of the service attribute counting.
  • FIG. 1 is a schematic structural diagram of a service attribute apparatus according to an embodiment of the present invention
  • FIG. 2 is a schematic flowchart of a method for counting service attributes in an embodiment of the present invention
  • FIG. 3 is a schematic diagram of a correspondence between an attribute field and a key value according to an embodiment of the present invention
  • FIG. 4 is a schematic structural diagram of a key value generating module according to an embodiment of the present invention.
  • FIG. 5 is a schematic structural diagram of an index module according to an embodiment of the present invention.
  • the embodiment of the present invention provides a service attribute counting device.
  • the device includes: a configuration module 1 and at least one counting pipeline module 2; wherein the counting pipeline module 2 includes: a key value generating module 21 and an index module 22 And a counter update module 23;
  • the key value generating module 21 is configured to receive a service request signal, and optimize an attribute field to be optimized in a service attribute carried in the service request signal to obtain an optimized attribute field;
  • the configuration information, the common attribute field in the service attribute, and the optimized attribute field, generate corresponding key values, and send to the index module 22;
  • the indexing module 22 is configured to receive a corresponding key value; according to the corresponding key value, determine a one-to-one corresponding counter index address, and send it to the counter update module 23;
  • the counter update module 23 is configured to perform a counting operation according to the counter index address and update the counter table, wherein the entry of the counter table is the value of the counter corresponding to the service attribute.
  • the configuration module 1 is a CPU interface operation module, and all static registers are configured through the CPU port, and all the entries are configured and read by indirect reading and writing.
  • a method for counting service attributes provided by an embodiment of the present invention is described below in conjunction with the foregoing service attribute counting apparatus.
  • the method includes:
  • the service attribute carried in the service request signal received by the service attribute technology device may be as follows: CNG, the priority of the message in the exchange phase; IFP_CNG, the priority of the message in the last routing stage; Priority, the message Ingress priority; VLAN Formate, virtual local area network (VLAN) format; Outer Dot1p, external label; Inner Dot1p, internal label; Port, port; TOS, service type; Packet Resolution, message processing result; SVP Type, for customer service or Network-oriented; Drop, discard indication; IP packet, IP packet.
  • CNG the priority of the message in the exchange phase
  • IFP_CNG the priority of the message in the last routing stage
  • Priority the message Ingress priority
  • VLAN Formate virtual local area network (VLAN) format
  • Outer Dot1p external label
  • Inner Dot1p internal label
  • Port port
  • TOS service type
  • Packet Resolution message processing result
  • SVP Type for customer service or Network-oriented
  • Drop discard indication
  • IP packet IP packet
  • Similar attribute fields are combined for optimization to save counter resources. For example, the packets of the same message attribute are classified into one class, or the packets with the same message color are classified into one class. In this way, the attribute field can be optimized from a discrete state to a more continuous state by optimizing the attribute field, thereby improving the utilization of the offset table.
  • the user can configure the optimization rule through the configuration module.
  • the key value generation module can view the service attribute carried in the service request signal to see whether there is an attribute field that needs to be optimized. If yes, optimize these fields to get the optimized attribute fields.
  • the configuration module sends the key to the key generation module.
  • the preset optimization rule is implemented in the form of a mapping table.
  • the attribute field to be optimized can be mapped according to the mapping table to obtain a corresponding mapping value. At this time, the mapping value can be confirmed as the optimized attribute field. .
  • the user can configure optimization rules through the configuration module.
  • the 2 bit data representing the color of the message can be placed at the high level of the key value.
  • the key value generating module receives the service request signal, all the service requests may be mapped according to the mapping table.
  • the corresponding entry of the mapping table is the original field.
  • the manner of optimizing the attribute field in the service attribute may also be in other manners, which is not specifically limited by the present invention.
  • the method before the step S201, further includes: receiving the at least one service request signal, and scheduling the at least one service request signal into the at least one counting pipeline module in parallel according to a preset scheduling rule. That is, since at least one of the counting pipeline modules is parallel, in order to improve the counting efficiency, at least one service request signal may be scheduled according to a preset scheduling rule, such as a priority algorithm and a polling algorithm, before counting.
  • the service request signal is entered into the corresponding counting pipeline module according to the carried counter base address to perform counting.
  • S202 Generate a corresponding key value according to at least preset configuration information, a common attribute field in the service attribute, and an optimized attribute field.
  • the key value generation module optimizes the attribute field that needs to be optimized, it directly generates a corresponding key value for the optimized attribute field and the common attribute field that does not need to be optimized according to the configuration information.
  • the configuration module needs to provide configuration information as shown in FIG. 3, and which one of the specified key values is enabled in the configuration information (if enabled, the position is 1) ; if not enabled, the position is 0) and when enabled, each attribute field is The specific location in the key value.
  • the service attribute is 64bit, which is attr[63:0], the final generated key value is key[7:0], and the configuration signal is key_cfg[55:0], then the signal value of the key is: if key_cfg [48] (SELECTOR_0_EN in Figure 3) has a value of 0, then the value of key[0] is 0; otherwise the value of key[0] is attr[5:0] (the position specified by the SELECTOR_FOR_BIT_0 value in Figure 3); If key_cfg[49] (SELECTOR_1_EN in Figure 3) has a value of 0, the value of key[1] is 0; otherwise the value of key[1] is attr[11:6] (the position specified by the SELECTOR_FOR_BIT_1 value in Figure 3) .
  • the service request signal in the foregoing S201 may also be a counting request added by the user during the service processing process, where the counting request carries a custom attribute, for example, a user added debug counting function, and the counting function
  • the storage space is shared with the service counter and is only used in the debug state, and does not occupy the space of the counter table.
  • S202 may generate corresponding key values according to preset configuration information, common attribute fields, optimized attribute fields, and custom attributes.
  • the service attribute counting device can generate corresponding key values for the common attribute field, the optimized attribute field, and the custom attribute, respectively.
  • S203 Determine, according to the corresponding key value, a one-to-one counter index address
  • the index module stores a preset offset table, and the table entry is an offset address of the counter and a counter offset enable signal.
  • the check information may also be included.
  • the counter offset address and the counter offset enable signal corresponding to the key value may be read in the preset offset table, and then, according to the counter carried in the service request signal.
  • the base address, the counter offset address, and the counter offset enable signal determine the counter index address.
  • the index module may first update the counter enable signal in the control information according to the counter sent by the configuration module to determine where it is located. Whether the count pipeline module is enabled, if yes, execute S203, and if not, end the count.
  • the indexing module may further determine, according to the counter enable signal in the counter update control information and the counter offset enable signal in the preset offset table, whether to update the counter table, and send the result to the count update module.
  • S204 Perform a counting operation according to the counter index address and update the counter table, wherein the entry of the counter table is a value of a counter corresponding to the service attribute.
  • the count update module finds the value of the corresponding counter according to the counter index address sent by the index module, and then performs a counting operation while updating the value of the counter in the counter table.
  • the service attribute counting device further includes a counter overflow processing module, which adopts a method of sequentially moving, that is, sequentially reads out the value of the counter in the counter table before the counter overflows, and sends the value to the direct memory access (DMA) module. , to send to the CPU for processing.
  • DMA direct memory access
  • the counting update module may include: an arbitration module and a counter counting module, wherein the arbitration module is configured to receive the counter index address from the index module to count the table update request, and then adopt certain scheduling principles, such as priority The algorithm dispatches the above request to the counter counting module, so that the counter counting module completes the counting operation and updates the calculated value to the counter table.
  • the counter technology module needs to ensure that the values of the participating counts are the latest values.
  • the arbitration module is further configured to receive the read and write request and the scan request from the CPU. Similarly, using a certain scheduling principle, such as a priority algorithm, according to the request scheduling, reading or writing the corresponding from the counter table. Entry.
  • a certain scheduling principle such as a priority algorithm
  • the scheduling module needs to perform statistics on the packet priority, the processing result of the packet, the IP packet, and all the packet requests of the input port, and the scheduling module schedules the counting request to the corresponding one according to the counter base address information carried in the service request.
  • the first counting pipeline module performs statistics on a certain priority (Priority, CNG, and IFP_CNG) of the packet; the second counting pipeline module performs statistics on the processing result of the packet; and the third counting pipeline module
  • the statistics are collected for the IP packet; the fourth counting pipeline module performs statistics on all the packet requests of the input port; the fifth and sixth counting the pipeline module is idle.
  • the counter enable signal corresponding to the module is set to off.
  • the priority attribute of the counter in the first counting pipeline module includes Priority (4bit), CNG (2bit) and IFP_CNG (2bit).
  • the 8bit theoretically has 256 cases, but this counter only counts Priority and CNG is 01 and If the IFP_CNG is in the state of 11, the invalid state can be mapped to 0 by the CPU, and the mapped 8-bit attribute is stored in the preset mapping table, that is, the optimized attribute field; the second counts the result of the counter in the pipeline module.
  • the attributes include the Packet Resolution (6bit), SVP Type (1bit), and Drop (1bit) fields.
  • the Packet Resolution is a discontinuous hole.
  • the invalid state can be mapped to 0 by the CPU, and the mapped 8-bit attribute is stored in the preset.
  • the optimized attribute field In the mapping table, the optimized attribute field; the third packet counts the IP packet attribute in the pipeline module to be 1bit without optimization, and is directly sent to the subsequent stage; the fourth counting pipeline module does not need to optimize the counter of the user-defined attribute. Directly sent to the subsequent stage; assume that all optimized attributes are a (40bit), where a[7:0] is the priority attribute, a[15:8] is the message processing result attribute, and a[30] is the IP. Attribute, a[39] is used Custom port attributes, the remaining fields are other types of attributes; the configuration information of the first and second counting pipeline modules can be specified to enable all 8-bit key values, and the un-enable key values are set to 0, enabling use.
  • Counter update control letter for the first 4 count flow modules The counter enable signal is configured to 1 to enable counting, and the remaining counting pipeline modules are configured to 0 to turn off counting.
  • the counter offset enable and the counter offset address are obtained.
  • the counter enable signals in the invalid key values optimized by the mapping table are all set to 0, and the valid key values have respective offset addresses. These offset addresses can be the same or different.
  • the counter index address is obtained. Finally, based on the counter index address, counting is performed and the count table is updated.
  • the method and device for counting service attributes provided by the embodiment of the present invention can flexibly classify the service attributes carried in the service request signal, generate corresponding key values for each type of service attributes, and then determine The counter index address corresponding to the above key value is counted based on the counter index address, and the counter table is updated. It can be seen that the counting method of the service attribute provided by the embodiment of the present invention can adapt to the counting requirement of different application scenarios, and the storage resource sharing is reduced to reduce the resource occupation while greatly improving the flexibility of the service attribute counting.
  • the embodiment of the present invention further provides a service attribute counting device, which is consistent with the service attribute counting device in one or more of the foregoing embodiments.
  • the device includes: a configuration module 1 and at least one counting pipeline module 2; wherein the counting pipeline module 2 includes: a key value generating module 21, an indexing module 22, and a counter updating module 23; wherein the above key value generation
  • the module 21 is configured to receive a service request signal, and optimize an attribute field to be optimized in the service attribute carried in the service request signal to obtain an optimized attribute field; at least according to preset configuration information, a common attribute field in the service attribute, and The optimized attribute field is generated, and the corresponding key value is generated and sent to the indexing module 22;
  • the indexing module 22 is configured to receive the corresponding key value; and according to the corresponding key value, determine a one-to-one corresponding counter index address, and send it to the a counter update module 23;
  • the counter update module 23 configured to perform a counting operation and update a counter table according to the counter index address, wherein the counter table is The item is the value of the counter corresponding to the business attribute.
  • the key value generating module 21 includes: a mapping table module 211 and a logic operation module 212.
  • the mapping table module 211 is configured to store a preset mapping table delivered by the configuration module 1. And mapping the attribute field to be optimized according to the preset mapping table to obtain a corresponding mapping value; determining the mapping value as the optimized attribute field; and the logic operation module 212 is configured to generate a common attribute field according to the configuration information.
  • the key value corresponding to the optimized attribute field is sent to the index calculation module 22.
  • the service request signal may also be a counting request added by the user in the process of the service processing, and the counting request carries a custom attribute;
  • the logical operation module 212 is further configured to be based on the preset configuration information, the common attribute field, The optimized attribute fields and custom attributes are generated to generate corresponding key values.
  • the indexing module 22 includes: an offset table module 221 and an index calculation module 222; wherein the offset table module 221 is configured to store the offset address of the counter and the counter offset enable
  • the signal calculation module 222 is configured to read, in the preset offset table, a counter offset address and a counter offset enable signal corresponding to the corresponding key values; and based on the counter base address carried in the service request signal, The counter offset address and the counter offset enable signal determine the counter index address.
  • the index calculation module 222 is further configured to determine, according to the counter enable signal in the counter update control information from the configuration module 1, whether the count pipeline module 2 in which it is located is enabled; when the count is in its own flow When the module 2 is enabled, the corresponding counter offset address and the counter offset enable signal are read in the preset offset table according to the corresponding key value.
  • the index calculation module 222 is further configured to determine whether to update the counter table according to the counter enable signal and the counter offset enable signal in the counter update control information from the configuration module 1;
  • the counter update module 23 is configured to determine the update counter table when the index module 22 determines At the time, according to the counter index address, the counting operation is performed and the counter table is updated.
  • the service attribute counting apparatus further includes: a scheduling module, configured to receive at least one service request signal, and schedule at least one service request signal to the at least one counting pipeline module 2 in parallel according to a preset scheduling rule.
  • the service attribute counting device further includes: a counter overflow processing module configured to sequentially read out the value of the counter in the counter table before the counter overflows, and send the value to the direct memory access DMA module.
  • each of the above devices may be implemented by an application specific integrated circuit (ASIC), a logic programmable gate array (FGPA), or a complex programmable logic device (CPLD).
  • ASIC application specific integrated circuit
  • FGPA logic programmable gate array
  • CPLD complex programmable logic device
  • embodiments of the present invention can be provided as a method, system, or computer program product. Accordingly, the present invention can take the form of a hardware embodiment, a software embodiment, or a combination of software and hardware. Moreover, the invention can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) including computer usable program code.
  • the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
  • the device is implemented in a flow chart A function specified in a block or blocks of a process or multiple processes and/or block diagrams.
  • These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device.
  • the instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.
  • the embodiment of the invention provides a method and a device for counting service attributes, and by flexibly classifying the service attributes carried in the service request signal, generating corresponding key values for each type of service attributes, and then determining the key values. Corresponding counter index address, next, according to the counter index address, counting, and updating the counter table. It can be seen that the counting method of the service attribute provided by the embodiment of the present invention can adapt to the counting requirement of different application scenarios, and the storage resource sharing is reduced to reduce the resource occupation while greatly improving the flexibility of the service attribute counting.

Abstract

Disclosed is a counting apparatus for a service attribute, comprising: a configuration module and at least one counting turnover module. The counting turnover module comprises: a key value generation module, an index module, and a counter updating module. The key value generation module is configured to receive a service request signal, optimize an attribute field to be optimized in a service attribute carried in the service request signal so as to obtain an optimized attribute field, generate corresponding key values, at least, according to pre-set configuration information, a common attribute field in the service attribute, and the optimized attribute field, and send same to the index module. The index module is configured to receive the corresponding key values, determine counter index addresses, in one-to-one correspondence, according to the corresponding key values, and send same to the counter updating module. The counter updating module is configured to execute, according to the counter index addresses, a counting operation and update a counter table. Also disclosed are a counting method for a service attribute and a computer storage medium.

Description

业务属性的计数方法及装置、计算机存储介质Method and device for counting business attributes, computer storage medium 技术领域Technical field
本发明涉及通信领域,尤其涉及一种业务属性的计数方法及装置、计算机存储介质。The present invention relates to the field of communications, and in particular, to a method and device for counting service attributes, and a computer storage medium.
背景技术Background technique
随着通信设备的业务处理能力不断加强,业务统计计数指标不断增加且随着应用场景的变化而变化,这就需要统计计数技术能够灵活的适应不同的应用场景。As the service processing capability of the communication device is continuously strengthened, the service statistics counting index is continuously increased and changes with the application scenario. This requires the statistical counting technology to flexibly adapt to different application scenarios.
目前,现有的统计计数技术都是针对已知的统计需求进行统计计数和资源分配。针对不同的报文属性采用不同的计数装置,并不存在兼容多种应用场景的计数装置,比如,针对某一种业务下的不同报文属性进行分类统计计数,或者对相同/相似的报文属性进行优化后再计数时,并不能通过同一个计数装置来实现。Currently, existing statistical counting techniques are for statistical counting and resource allocation for known statistical requirements. Different counting devices are used for different packet attributes, and there is no counting device that is compatible with multiple application scenarios. For example, the statistics of different message attributes of a certain service are counted, or the same/similar messages are used. When the attribute is optimized and then counted, it cannot be implemented by the same counting device.
所以,就存在现有技术的报文属性计数装置不能灵活地适应于多种应用场景。Therefore, there is a prior art message attribute counting device that cannot be flexibly adapted to a plurality of application scenarios.
发明内容Summary of the invention
有鉴于此,本发明实施例期望提供一种业务属性的计数方法及装置,以满足多种应用场景的需求,提高灵活性。In view of this, the embodiments of the present invention are expected to provide a method and device for counting service attributes to meet the requirements of various application scenarios and improve flexibility.
为达到上述目的,本发明的技术方案是这样实现的:In order to achieve the above object, the technical solution of the present invention is achieved as follows:
第一方面,本发明实施例提供一种业务属性计数装置,包括:配置模块以及至少一个计数流水模块;其中,所述计数流水模块包括:键值生成模块、索引模块以及计数器更新模块;所述键值生成模块,配置为接收业 务请求信号;对所述业务请求信号中携带的业务属性中待优化的属性字段进行优化,获得优化后的属性字段;至少根据预设的配置信息、所述业务属性中普通属性字段以及所述优化后的属性字段,生成对应的键值,并发送至所述索引模块;所述索引模块,配置为接收所述对应的键值;根据所述对应的键值,确定一一对应的计数器索引地址,并发送至所述计数器更新模块;所述计数器更新模块,配置为根据所述计数器索引地址,进行计数操作并更新计数器表,其中,所述计数器表的表项为所述业务属性所对应的计数器的值。In a first aspect, an embodiment of the present invention provides a service attribute counting apparatus, including: a configuration module and at least one counting pipeline module; wherein the counting pipeline module includes: a key value generating module, an index module, and a counter updating module; Key-value generation module, configured to receive industry a request signal; optimizing an attribute field to be optimized in the service attribute carried in the service request signal to obtain an optimized attribute field; at least according to preset configuration information, a common attribute field in the service attribute, and the The optimized attribute field is generated and sent to the index module; the indexing module is configured to receive the corresponding key value; and determine a one-to-one corresponding counter index according to the corresponding key value An address is sent to the counter update module, and the counter update module is configured to perform a counting operation according to the counter index address and update a counter table, wherein an entry of the counter table is corresponding to the service attribute The value of the counter.
在上述方案中,所述键值生成模块,包括:映射表模块以及逻辑运算模块;其中,所述映射表模块,配置为存储所述配置模块下发的所述预设映射表,并按将所述待优化的属性字段按照预设的映射表进行映射,获得对应的映射值;将所述映射值确定为所述优化后的属性字段;所述逻辑运算模块,配置为根据所述配置信息,生成所述普通属性字段以及所述优化后的属性字段对应的键值,并发送至所述索引模块。In the above solution, the key value generating module includes: a mapping table module and a logical operation module; wherein the mapping table module is configured to store the preset mapping table delivered by the configuration module, and press The attribute field to be optimized is mapped according to a preset mapping table, and a corresponding mapping value is obtained; the mapping value is determined as the optimized attribute field; and the logical operation module is configured to be configured according to the configuration information. And generating the common attribute field and the key value corresponding to the optimized attribute field, and sending the key value to the index module.
在上述方案中,所述业务请求信号还可以为用户在业务处理过程中添加的计数请求,所述计数请求中携带有自定义属性;所述逻辑运算模块,还配置为根据所述预设的配置信息、所述普通属性字段、所述优化后的属性字段以及所述自定义属性,生成所述对应的键值。In the foregoing solution, the service request signal may also be a counting request added by the user in the process of the service process, where the counting request carries a custom attribute; the logical operation module is further configured to be according to the preset The configuration information, the common attribute field, the optimized attribute field, and the custom attribute generate the corresponding key value.
在上述方案中,所述索引模块,包括:偏移表模块以及索引计算模块;其中,所述偏移表模块,配置为存储计数器的偏移地址以及计数器偏移使能信号;所述索引计算模块,配置为在预设偏移表中读取与所述对应的键值一一对应的计数器偏移地址以及计数器偏移使能信号;根据所述业务请求信号中携带的计数器基地址、所述计数器偏移地址以及所述计数器偏移使能信号,确定所述计数器索引地址。In the above solution, the indexing module includes: an offset table module and an index calculation module; wherein the offset table module is configured to store an offset address of a counter and a counter offset enable signal; a module, configured to read, in a preset offset table, a counter offset address and a counter offset enable signal corresponding to the corresponding key value; and a counter base address and a location carried in the service request signal according to the The counter offset address and the counter offset enable signal are determined to determine the counter index address.
在上述方案中,所述索引计算模块,还配置为根据来自所述配置模块 的计数器更新控制信息中的计数器使能信号,确定自身所处的计数流水模块是否使能;当自身所处的计数流水模块使能时,根据所述对应的键值,在所述预设偏移表中读取对应的所述计数器偏移地址以及所述计数器偏移使能信号。In the above solution, the index calculation module is further configured to be based on the configuration module The counter updates the counter enable signal in the control information to determine whether the counter pipeline module in which it is located is enabled; when the counter pipeline module in which it is located is enabled, according to the corresponding key value, the preset bias is The corresponding counter offset address and the counter offset enable signal are read in the shift table.
在上述方案中,所述索引计算模块,还配置为根据来自所述配置模块的计数器更新控制信息中的计数器使能信号和所述计数器偏移使能信号,确定是否更新所述计数器表;所述计数器更新模块,配置为当所述索引计算模块确定更新所述计数器表时,根据所述计数器索引地址,进行计数操作并更新计数器表。In the above solution, the index calculation module is further configured to determine whether to update the counter table according to a counter enable signal and a counter offset enable signal in the counter update control information from the configuration module; The counter update module is configured to perform a counting operation and update the counter table according to the counter index address when the index calculation module determines to update the counter table.
在上述方案中,所述业务属性计数装置,还包括:调度模块,配置为接收至少一个业务请求信号,并按照预设调度规则,将所述至少一个业务请求信号调度至并行的所述至少一个计数流水模块中。In the foregoing solution, the service attribute counting apparatus further includes: a scheduling module, configured to receive at least one service request signal, and schedule the at least one service request signal to the at least one of the parallel according to a preset scheduling rule Count the flow module.
在上述方案中,所述业务属性计数装置,还包括:计数器溢出处理模块,配置为在计数器溢出之前,顺序的读出所述计数器表中所述计数器的值,并发送至直接内存存取DMA模块。In the above solution, the service attribute counting apparatus further includes: a counter overflow processing module configured to sequentially read out the value of the counter in the counter table before the counter overflows, and send the value to the direct memory access DMA Module.
第二方面,本发明实施例提供一种业务属性的计数方法,包括:对接收到的业务请求信号中携带的业务属性中待优化的属性字段进行优化,获得优化后的属性字段;至少根据预设的配置信息、所述业务属性中普通属性字段以及所述优化后的属性字段,生成对应的键值;根据所述对应的键值,确定一一对应的计数器索引地址;根据所述计数器索引地址,进行计数操作并更新计数器表,其中,所述计数器表的表项为所述业务属性所对应的计数器的值。In a second aspect, the embodiment of the present invention provides a method for counting service attributes, including: optimizing an attribute field to be optimized in a service attribute carried in a received service request signal, and obtaining an optimized attribute field; Setting the configuration information, the common attribute field in the service attribute, and the optimized attribute field to generate a corresponding key value; determining, according to the corresponding key value, a one-to-one corresponding counter index address; The address is counted and the counter table is updated, wherein the entry of the counter table is the value of the counter corresponding to the service attribute.
在上述方案中,所述将对接收到的业务请求信号中携带的业务属性中待优化的属性字段进行优化,获得优化后的属性字段,包括:将所述待优化的属性字段按照预设的映射表进行映射,获得对应的映射值;将所述映 射值确定为所述优化后的属性字段;In the foregoing solution, the attribute field to be optimized in the service attribute carried in the received service request signal is optimized, and the optimized attribute field is obtained, including: presetting the attribute field to be optimized according to a preset The mapping table is mapped to obtain a corresponding mapping value; The shot value is determined as the optimized attribute field;
根据所述配置信息,生成所述普通属性字段以及所述优化后的属性字段对应的键值。And generating, according to the configuration information, the common attribute field and the key value corresponding to the optimized attribute field.
在上述方案中,所述业务请求信号还可以为用户在业务处理过程中添加的计数请求,所述计数请求中携带有自定义属性;所述至少根据预设的配置信息、所述报文属性中普通属性字段以及所述优化后的属性字段,生成对应的键值,包括:根据所述预设的配置信息、所述普通属性字段、所述优化后的属性字段以及所述自定义属性,生成所述对应的键值。In the above solution, the service request signal may also be a counting request added by the user in the process of the service process, where the counting request carries a custom attribute; the at least according to the preset configuration information, the message attribute Generating a corresponding key value in the normal attribute field and the optimized attribute field, including: according to the preset configuration information, the common attribute field, the optimized attribute field, and the customized attribute, The corresponding key value is generated.
在上述方案中,所述根据所述对应的键值,确定一一对应的计数器索引地址,包括:在预设偏移表中读取与所述对应的键值一一对应的计数器偏移地址以及计数器偏移使能信号;根据所述业务请求信号中携带的计数器基地址、所述计数器偏移地址以及所述计数器偏移使能信号,确定所述计数器索引地址。In the above solution, determining, according to the corresponding key value, a one-to-one counter index address, comprising: reading a counter offset address corresponding to the corresponding key value in a preset offset table And a counter offset enable signal; determining the counter index address according to the counter base address carried in the service request signal, the counter offset address, and the counter offset enable signal.
在上述方案中,所述根据所述计数器索引地址,进行计数操作并更新计数器表,包括:当根据计数器更新控制信息中的计数器使能信号和所述计数器偏移使能信号确定更新所述计数器表时,根据所述计数器索引地址,进行计数操作并更新计数器表。In the above solution, the performing the counting operation and updating the counter table according to the counter index address includes: determining to update the counter when the counter enable signal and the counter offset enable signal are determined according to the counter update control information At the time of the table, according to the counter index address, the counting operation is performed and the counter table is updated.
在上述方案中,所述方法还包括:在计数器溢出之前,顺序的读出所述计数器表中所述计数器的值。In the above aspect, the method further comprises: sequentially reading out the value of the counter in the counter table before the counter overflows.
第三方面,本发明实施例提供一种计算机存储介质,所述计算机存储介质中存储有可执行指令,所述可执行指令用于执行本发明实施例提供的业务属性的计数方法。In a third aspect, an embodiment of the present invention provides a computer storage medium, where the computer storage medium stores executable instructions, and the executable instructions are used to execute a method for counting service attributes provided by the embodiments of the present invention.
本发明实施例提供了一种业务属性的计数方法及装置、计算机存储介质,通过将业务请求信号中携带的业务属性进行灵活地分类,针对每一类业务属性生成对应的键值,然后确定出与上述键值对应的计数器索引地址, 接下来,根据该计数器索引地址,进行计数,并更新计数器表。可见,本发明实施例提供的业务属性的计数方法能够适应不同应用场景的计数需求,在大大提高业务属性计数灵活性的同时,实现了存储资源共享降低了资源占用。An embodiment of the present invention provides a method and a device for counting service attributes, and a computer storage medium. The service attributes carried in the service request signal are flexibly classified, and corresponding key values are generated for each type of service attribute, and then determined. The counter index address corresponding to the above key value, Next, based on the counter index address, counting is performed, and the counter table is updated. It can be seen that the counting method of the service attribute provided by the embodiment of the present invention can adapt to the counting requirement of different application scenarios, and the storage resource sharing is reduced to reduce the resource occupation while greatly improving the flexibility of the service attribute counting.
附图说明DRAWINGS
图1为本发明实施例中的业务属性装置的结构示意图;FIG. 1 is a schematic structural diagram of a service attribute apparatus according to an embodiment of the present invention;
图2为本发明实施例中的业务属性的计数方法流程示意图;2 is a schematic flowchart of a method for counting service attributes in an embodiment of the present invention;
图3为本发明实施例中的属性字段与键值的对应关系示意图;FIG. 3 is a schematic diagram of a correspondence between an attribute field and a key value according to an embodiment of the present invention;
图4为本发明实施例中的键值生成模块的结构示意图;4 is a schematic structural diagram of a key value generating module according to an embodiment of the present invention;
图5为本发明实施例中的索引模块的结构示意图。FIG. 5 is a schematic structural diagram of an index module according to an embodiment of the present invention.
具体实施方式detailed description
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述。The technical solutions in the embodiments of the present invention will be clearly and completely described in the following with reference to the accompanying drawings.
本发明实施例提供一种业务属性计数装置,如图1所示,该装置包括:配置模块1以及至少一个计数流水模块2;其中,计数流水模块2包括:键值生成模块21、索引模块22以及计数器更新模块23;The embodiment of the present invention provides a service attribute counting device. As shown in FIG. 1 , the device includes: a configuration module 1 and at least one counting pipeline module 2; wherein the counting pipeline module 2 includes: a key value generating module 21 and an index module 22 And a counter update module 23;
结合本发明实施例,上述键值生成模块21,配置为接收业务请求信号;对业务请求信号中携带的业务属性中待优化的属性字段进行优化,获得优化后的属性字段;至少根据预设的配置信息、业务属性中普通属性字段以及优化后的属性字段,生成对应的键值,并发送至索引模块22;In combination with the embodiment of the present invention, the key value generating module 21 is configured to receive a service request signal, and optimize an attribute field to be optimized in a service attribute carried in the service request signal to obtain an optimized attribute field; The configuration information, the common attribute field in the service attribute, and the optimized attribute field, generate corresponding key values, and send to the index module 22;
上述索引模块22,配置为接收对应的键值;根据对应的键值,确定一一对应的计数器索引地址,并发送至计数器更新模块23;The indexing module 22 is configured to receive a corresponding key value; according to the corresponding key value, determine a one-to-one corresponding counter index address, and send it to the counter update module 23;
上述计数器更新模块23,配置为根据计数器索引地址,进行计数操作并更新计数器表,其中,计数器表的表项为业务属性所对应的计数器的值。 The counter update module 23 is configured to perform a counting operation according to the counter index address and update the counter table, wherein the entry of the counter table is the value of the counter corresponding to the service attribute.
需要说明的是,配置模块1为CPU接口操作模块,通过CPU端口完成所有静态寄存器的配置,同时通过间接读写的方式完成对所有表项的配置和读取。It should be noted that the configuration module 1 is a CPU interface operation module, and all static registers are configured through the CPU port, and all the entries are configured and read by indirect reading and writing.
下面结合上述业务属性计数装置,对本发明实施例提供的一种业务属性的计数方法进行说明。A method for counting service attributes provided by an embodiment of the present invention is described below in conjunction with the foregoing service attribute counting apparatus.
参见图2所示,该方法包括:Referring to Figure 2, the method includes:
S201:对接收到的业务请求信号中携带的业务属性中待优化的属性字段进行优化,获得优化后的属性字段;S201: Optimize an attribute field to be optimized in a service attribute carried in the received service request signal, and obtain an optimized attribute field.
例如,业务属性技术装置接收到的业务请求信号中携带的业务属性可以有以下几种:CNG,处于交换阶段的报文优先级;IFP_CNG,处于最后路由阶段的报文优先级;Priority,报文的入口优先级;VLAN Formate,虚拟局域网(VLAN)格式;Outer Dot1p,外部标签;Inner Dot1p,内部标签;Port,端口;TOS,服务类型;Packet Resolution,报文处理结果;SVP Type,面向客服或面向网络;Drop,丢弃指示;IP Packet,是否IP报文。当然,还可以有其它属性,本发明不做具体限定。For example, the service attribute carried in the service request signal received by the service attribute technology device may be as follows: CNG, the priority of the message in the exchange phase; IFP_CNG, the priority of the message in the last routing stage; Priority, the message Ingress priority; VLAN Formate, virtual local area network (VLAN) format; Outer Dot1p, external label; Inner Dot1p, internal label; Port, port; TOS, service type; Packet Resolution, message processing result; SVP Type, for customer service or Network-oriented; Drop, discard indication; IP packet, IP packet. Of course, there may be other attributes, which are not specifically limited in the present invention.
那么,由于在某些应用场景中,仅仅对这些相似的属性字段中部分属性字段进行统计无法满足统计需求,但又不需要细分至每一个属性独立进行统计,那么,可以根据应用场景需求将相似的属性字段做合并优化,以节约计数器资源。比如,将同一报文属性的报文分成一类,或者将报文颜色相同的报文分成一类等。如此,可以通过对属性字段的优化,将属性字段由离散状态转换为较连续状态,进而提高偏移表的利用率。Then, in some application scenarios, only the statistics of some attribute fields in these similar attribute fields cannot meet the statistical requirements, but do not need to be subdivided into each attribute to perform statistics independently, then, according to the application scenario requirements, Similar attribute fields are combined for optimization to save counter resources. For example, the packets of the same message attribute are classified into one class, or the packets with the same message color are classified into one class. In this way, the attribute field can be optimized from a discrete state to a more continuous state by optimizing the attribute field, thereby improving the utilization of the offset table.
这样,用户可以通过配置模块对优化规则进行配置,然后,当键值生成模块接收到业务请求信号以后,就可以对业务请求信号中携带的业务属性进行查看,看其中是否存在需要优化的属性字段,如是,则对这些字段进行优化,获得优化后的属性字段,比如,配置模块向键值生成模块下发 预设的优化规则,该规则以映射表的形式体现,待优化的属性字段可以按照该映射表进行映射,得到对应的映射值,此时,就可以将该映射值确认为优化后的属性字段。In this way, the user can configure the optimization rule through the configuration module. Then, after receiving the service request signal, the key value generation module can view the service attribute carried in the service request signal to see whether there is an attribute field that needs to be optimized. If yes, optimize these fields to get the optimized attribute fields. For example, the configuration module sends the key to the key generation module. The preset optimization rule is implemented in the form of a mapping table. The attribute field to be optimized can be mapped according to the mapping table to obtain a corresponding mapping value. At this time, the mapping value can be confirmed as the optimized attribute field. .
举例来说,假设将同一报文颜色的报文分成一类,那么,就存在红包、黄包、绿包和无色包共四类报文,那么,用户就可以通过配置模块配置优化规则,使得表征报文颜色的2bit数据能够被放置在键值的高位。For example, if the packets of the same packet color are classified into one class, then there are four types of packets: red packets, yellow packets, green packets, and colorless packets. Then, the user can configure optimization rules through the configuration module. The 2 bit data representing the color of the message can be placed at the high level of the key value.
当然,当键值生成模块接收到业务请求信号以后,还可以将所有的业务请求均按照映射表进行映射,此时,对于用户认为不需要进行优化的字段,映射表的对应表项为原字段即可。在实际应用中,对业务属性中的属性字段进行优化的方式还可以有其它方式,本发明不做具体限定。Certainly, after the key value generating module receives the service request signal, all the service requests may be mapped according to the mapping table. At this time, for the field that the user thinks does not need to be optimized, the corresponding entry of the mapping table is the original field. Just fine. In an actual application, the manner of optimizing the attribute field in the service attribute may also be in other manners, which is not specifically limited by the present invention.
在另一实施例中,在S201之前,上述方法还包括:接收至少一个业务请求信号,并按照预设调度规则,将至少一个业务请求信号调度至并行的至少一个计数流水模块中。也就是说,由于至少一个计数流水模块是并行的,那么,为了提高计数效率,在进行计数之前,可以按照预设的调度规则,如优先级算法、轮询算法对至少一个业务请求信号进行调度,使业务请求信号根据携带的计数器基地址进入对应的计数流水模块中,以进行计数。In another embodiment, before the step S201, the method further includes: receiving the at least one service request signal, and scheduling the at least one service request signal into the at least one counting pipeline module in parallel according to a preset scheduling rule. That is, since at least one of the counting pipeline modules is parallel, in order to improve the counting efficiency, at least one service request signal may be scheduled according to a preset scheduling rule, such as a priority algorithm and a polling algorithm, before counting. The service request signal is entered into the corresponding counting pipeline module according to the carried counter base address to perform counting.
S202:至少根据预设的配置信息、业务属性中普通属性字段以及优化后的属性字段,生成对应的键值;S202: Generate a corresponding key value according to at least preset configuration information, a common attribute field in the service attribute, and an optimized attribute field.
例如,键值生成模块对需要优化的属性字段进行优化后,就直接根据配置信息,为对优化后的属性字段以及无需优化的普通属性字段生成对应的键值。For example, after the key value generation module optimizes the attribute field that needs to be optimized, it directly generates a corresponding key value for the optimized attribute field and the common attribute field that does not need to be optimized according to the configuration information.
举例来说,假设需要生成8bit键值,那么,就需要配置模块提供如图3示的配置信息,该配置信息中指定键值中哪一位是否使能(使能的情况下,该位置1;不使能的情况下,该位置0)以及在使能情况下每个属性字段在 键值中所处的具体位置。For example, if it is necessary to generate an 8-bit key value, then the configuration module needs to provide configuration information as shown in FIG. 3, and which one of the specified key values is enabled in the configuration information (if enabled, the position is 1) ; if not enabled, the position is 0) and when enabled, each attribute field is The specific location in the key value.
比如,业务属性为64bit,即为attr[63:0],最终生成的键值为key[7:0],配置信号为key_cfg[55:0],则key的每位信号值为:如果key_cfg[48](图3中的SELECTOR_0_EN)值为0,则key[0]的值为0;否则key[0]值为attr[5:0](图3中的SELECTOR_FOR_BIT_0值所指定的位置);如果key_cfg[49](图3中的SELECTOR_1_EN)值为0,则key[1]的值为0;否则key[1]值为attr[11:6](图3中SELECTOR_FOR_BIT_1值所指定的位置)。以此类推,此处不再一一赘述。For example, the service attribute is 64bit, which is attr[63:0], the final generated key value is key[7:0], and the configuration signal is key_cfg[55:0], then the signal value of the key is: if key_cfg [48] (SELECTOR_0_EN in Figure 3) has a value of 0, then the value of key[0] is 0; otherwise the value of key[0] is attr[5:0] (the position specified by the SELECTOR_FOR_BIT_0 value in Figure 3); If key_cfg[49] (SELECTOR_1_EN in Figure 3) has a value of 0, the value of key[1] is 0; otherwise the value of key[1] is attr[11:6] (the position specified by the SELECTOR_FOR_BIT_1 value in Figure 3) . By analogy, we will not repeat them here.
在另一实施例中,上述S201中的业务请求信号还可以为用户在业务处理过程中添加的计数请求,该计数请求中携带有自定义属性,比如,用户增加的debug计数功能,这个计数功能同业务计数器共享存储空间,并且仅在debug状态下使用,并不会占用计数器表的空间。In another embodiment, the service request signal in the foregoing S201 may also be a counting request added by the user during the service processing process, where the counting request carries a custom attribute, for example, a user added debug counting function, and the counting function The storage space is shared with the service counter and is only used in the debug state, and does not occupy the space of the counter table.
那么,S202可以为根据预设的配置信息、普通属性字段、优化后的属性字段以及自定义属性,生成对应的键值。此时,该业务属性计数装置就能够分别针对普通的属性字段、优化后的属性字段以及自定义属性生成对应的键值。Then, S202 may generate corresponding key values according to preset configuration information, common attribute fields, optimized attribute fields, and custom attributes. At this time, the service attribute counting device can generate corresponding key values for the common attribute field, the optimized attribute field, and the custom attribute, respectively.
S203:根据对应的键值,确定一一对应的计数器索引地址;S203: Determine, according to the corresponding key value, a one-to-one counter index address;
例如,索引模块中存储有一预设偏移表,该表的表项为计数器的偏移地址和计数器偏移使能信号,当然,还可以包括校验信息。当索引模块接收到上述键值之后,就可以在预设偏移表中读取与键值一一对应的计数器偏移地址以及计数器偏移使能信号,然后,根据业务请求信号中携带的计数器基地址、计数器偏移地址以及计数器偏移使能信号,确定计数器索引地址。For example, the index module stores a preset offset table, and the table entry is an offset address of the counter and a counter offset enable signal. Of course, the check information may also be included. After the index module receives the above key value, the counter offset address and the counter offset enable signal corresponding to the key value may be read in the preset offset table, and then, according to the counter carried in the service request signal. The base address, the counter offset address, and the counter offset enable signal determine the counter index address.
在具体实施过程中,当索引模块接收到上述键值之后,还可以先根据配置模块下发的计数器更新控制信息中的计数器使能信号,判断自身所处 的计数流水模块是否使能,若是,则执行S203,若否,则结束计数。In the specific implementation process, after the index module receives the above key value, it may first update the counter enable signal in the control information according to the counter sent by the configuration module to determine where it is located. Whether the count pipeline module is enabled, if yes, execute S203, and if not, end the count.
可选地,索引模块还可以根据计数器更新控制信息中的计数器使能信号以及预设偏移表中的计数器偏移使能信号,确定是否要更新计数表,并将结果发送给计数更新模块。Optionally, the indexing module may further determine, according to the counter enable signal in the counter update control information and the counter offset enable signal in the preset offset table, whether to update the counter table, and send the result to the count update module.
S204:根据计数器索引地址,进行计数操作并更新计数器表,其中,计数器表的表项为业务属性所对应的计数器的值。S204: Perform a counting operation according to the counter index address and update the counter table, wherein the entry of the counter table is a value of a counter corresponding to the service attribute.
例如,计数更新模块根据索引模块发送来的计数器索引地址,找到对应的计数器的值,然后,进行计数操作,同时更新计数器表中该计数器的值。For example, the count update module finds the value of the corresponding counter according to the counter index address sent by the index module, and then performs a counting operation while updating the value of the counter in the counter table.
需要说明的是,只有索引模块确定要更新计数表时,执行S204,若索引模块确定不需要更新计数表,则结束计数。It should be noted that, when only the indexing module determines that the counting table is to be updated, S204 is executed, and if the indexing module determines that the counting table is not required to be updated, the counting is ended.
在实际应用中,如果计数器的位宽较小,容易溢出,就必须在计数器溢出之前将计数器的值搬移出计数器表。那么,业务属性计数装置还包括计数器溢出处理模块,采用顺序搬移的方法,即在计数器溢出之前,顺序的读出计数器表中计数器的值,送至直接内存存取(DMA,Direct Memory Access)模块,以送至CPU进行处理。In practical applications, if the counter has a small bit width and is prone to overflow, the counter value must be moved out of the counter table before the counter overflows. Then, the service attribute counting device further includes a counter overflow processing module, which adopts a method of sequentially moving, that is, sequentially reads out the value of the counter in the counter table before the counter overflows, and sends the value to the direct memory access (DMA) module. , to send to the CPU for processing.
在具体实施过程中,计数更新模块可以包括:仲裁模块以及计数器计数模块,其中,仲裁模块配置为接收来自索引模块的计数器索引地址以计数表更新请求,然后,采用一定的调度原则,如优先级算法,将上述请求调度至计数器计数模块,使得计数器计数模块完成计数操作,并将计算后的值更新至计数器表。在上述过程中,计数器技术模块需要保证参与计数的值均为最新值。In a specific implementation process, the counting update module may include: an arbitration module and a counter counting module, wherein the arbitration module is configured to receive the counter index address from the index module to count the table update request, and then adopt certain scheduling principles, such as priority The algorithm dispatches the above request to the counter counting module, so that the counter counting module completes the counting operation and updates the calculated value to the counter table. In the above process, the counter technology module needs to ensure that the values of the participating counts are the latest values.
可选地,仲裁模块还配置为接收来自CPU的读写请求和扫描请求,同样地,采用一定的调度原则,如优先级算法,根据上述请求调度,从计数器表中读出或者写入相应的表项。 Optionally, the arbitration module is further configured to receive the read and write request and the scan request from the CPU. Similarly, using a certain scheduling principle, such as a priority algorithm, according to the request scheduling, reading or writing the corresponding from the counter table. Entry.
下面以具体实例来对上述方法进行说明。The above method will be described below by way of specific examples.
假设业务属性计数装置最多支持6个计数器同时计数,则存在6个并行处理的计数流水模块。现需要分别对报文的优先级、报文的处理结果、IP报文和输入端口的所有报文请求进行统计,则调度模块根据业务请求中携带的计数器基地址信息将计数请求调度至对应的计数器流水模块中,第一条计数流水模块针对报文的某个优先级(Priority、CNG和IFP_CNG)进行统计;第二条计数流水模块针对报文的处理结果进行统计;第三条计数流水模块针对IP报文进行统计;第四条计数流水模块针对输入端口所有的报文请求进行统计;第五和第六条计数流水模块空闲,此时,用户可配置计数器更新控制信息将这两条流水模块对应的计数器使能信号设置为关闭。Assuming that the service attribute counting device supports up to six counters simultaneously counting, there are six parallel processing counter pipeline modules. The scheduling module needs to perform statistics on the packet priority, the processing result of the packet, the IP packet, and all the packet requests of the input port, and the scheduling module schedules the counting request to the corresponding one according to the counter base address information carried in the service request. In the counter pipeline module, the first counting pipeline module performs statistics on a certain priority (Priority, CNG, and IFP_CNG) of the packet; the second counting pipeline module performs statistics on the processing result of the packet; and the third counting pipeline module The statistics are collected for the IP packet; the fourth counting pipeline module performs statistics on all the packet requests of the input port; the fifth and sixth counting the pipeline module is idle. At this time, the user can configure the counter update control information to flow the two streams. The counter enable signal corresponding to the module is set to off.
第一条计数流水模块中计数器的优先级属性中包括Priority(4bit)、CNG(2bit)和IFP_CNG(2bit),这8bit理论上共256种情况,但本计数器只统计Priority、以及CNG为01和IFP_CNG为11的状态,则可通过CPU将所有的无效状态映射为0,映射后的8bit属性存放在预设的映射表中,即优化后的属性字段;第二条计数流水模块中计数器的结果属性包括Packet Resolution(6bit)、SVP Type(1bit)和Drop(1bit)字段,其中Packet Resolution为不连续有空洞,可通过CPU将所有的无效状态映射为0,映射后的8bit属性存放在预设的映射表中,即优化后的属性字段;第三条计数流水模块中IP报文属性为1bit无需优化,直接送至后级;第四条计数流水模块为用户自定义属性的计数器无需优化,直接送至后级;假设所有经过优化后的属性为a(40bit),其中a[7:0]为优先级属性,a[15:8]为报文处理结果属性,a[30]为IP属性,a[39]为用户自定义的端口属性,其余字段为其它类型属性;第一和第二条计数流水模块的配置信息可指定8bit键值全部使能,不使能的键值对应设定为0,使能的使用a中提取的值,第三和第四条计数流水模块只需使能最低位,高7位为0。前4条计数流水模块的计数器更新控制信 息中计数器使能信号配置为1,使能计数,其余计数流水模块配置为0,关闭计数。根据键值,索引预设偏移表后获得计数器偏移使能和计数器偏移地址,通过映射表优化后的无效键值中计数器使能信号全部设置为0,有效键值拥有各自偏移地址,这些偏移地址可以相同也可以不同。再根据计数器偏移地址后和计数器基地址相加得到计数器索引地址。最后,根据计数器索引地址,进行计数,并更新计数表。The priority attribute of the counter in the first counting pipeline module includes Priority (4bit), CNG (2bit) and IFP_CNG (2bit). The 8bit theoretically has 256 cases, but this counter only counts Priority and CNG is 01 and If the IFP_CNG is in the state of 11, the invalid state can be mapped to 0 by the CPU, and the mapped 8-bit attribute is stored in the preset mapping table, that is, the optimized attribute field; the second counts the result of the counter in the pipeline module. The attributes include the Packet Resolution (6bit), SVP Type (1bit), and Drop (1bit) fields. The Packet Resolution is a discontinuous hole. The invalid state can be mapped to 0 by the CPU, and the mapped 8-bit attribute is stored in the preset. In the mapping table, the optimized attribute field; the third packet counts the IP packet attribute in the pipeline module to be 1bit without optimization, and is directly sent to the subsequent stage; the fourth counting pipeline module does not need to optimize the counter of the user-defined attribute. Directly sent to the subsequent stage; assume that all optimized attributes are a (40bit), where a[7:0] is the priority attribute, a[15:8] is the message processing result attribute, and a[30] is the IP. Attribute, a[39] is used Custom port attributes, the remaining fields are other types of attributes; the configuration information of the first and second counting pipeline modules can be specified to enable all 8-bit key values, and the un-enable key values are set to 0, enabling use. The value extracted in a, the third and fourth counting pipeline modules only need to enable the lowest bit, and the upper 7 bits are 0. Counter update control letter for the first 4 count flow modules The counter enable signal is configured to 1 to enable counting, and the remaining counting pipeline modules are configured to 0 to turn off counting. According to the key value, after the preset offset table is indexed, the counter offset enable and the counter offset address are obtained. The counter enable signals in the invalid key values optimized by the mapping table are all set to 0, and the valid key values have respective offset addresses. These offset addresses can be the same or different. Then, according to the counter offset address and the counter base address, the counter index address is obtained. Finally, based on the counter index address, counting is performed and the count table is updated.
至此,便完成了对业务属性进行计数的过程。At this point, the process of counting the business attributes is completed.
由上述可知,本发明实施例提供的一种业务属性的计数方法及装置,通过将业务请求信号中携带的业务属性进行灵活地分类,针对每一类业务属性生成对应的键值,然后确定出与上述键值对应的计数器索引地址,接下来,根据该计数器索引地址,进行计数,并更新计数器表。可见,本发明实施例提供的业务属性的计数方法能够适应不同应用场景的计数需求,在大大提高业务属性计数灵活性的同时,实现了存储资源共享降低了资源占用。It can be seen from the above that the method and device for counting service attributes provided by the embodiment of the present invention can flexibly classify the service attributes carried in the service request signal, generate corresponding key values for each type of service attributes, and then determine The counter index address corresponding to the above key value is counted based on the counter index address, and the counter table is updated. It can be seen that the counting method of the service attribute provided by the embodiment of the present invention can adapt to the counting requirement of different application scenarios, and the storage resource sharing is reduced to reduce the resource occupation while greatly improving the flexibility of the service attribute counting.
基于同一发明构思,本发明实施例还提供一种业务属性计数装置,与上述一个或者多个实施例中的业务属性计数装置一致。Based on the same inventive concept, the embodiment of the present invention further provides a service attribute counting device, which is consistent with the service attribute counting device in one or more of the foregoing embodiments.
参见图1所示,该装置包括:配置模块1以及至少一个计数流水模块2;其中,计数流水模块2包括:键值生成模块21、索引模块22以及计数器更新模块23;其中,上述键值生成模块21,配置为接收业务请求信号;对业务请求信号中携带的业务属性中待优化的属性字段进行优化,获得优化后的属性字段;至少根据预设的配置信息、业务属性中普通属性字段以及优化后的属性字段,生成对应的键值,并发送至索引模块22;上述索引模块22,配置为接收对应的键值;根据对应的键值,确定一一对应的计数器索引地址,并发送至计数器更新模块23;上述计数器更新模块23,配置为根据计数器索引地址,进行计数操作并更新计数器表,其中,计数器表的表 项为业务属性所对应的计数器的值。Referring to FIG. 1 , the device includes: a configuration module 1 and at least one counting pipeline module 2; wherein the counting pipeline module 2 includes: a key value generating module 21, an indexing module 22, and a counter updating module 23; wherein the above key value generation The module 21 is configured to receive a service request signal, and optimize an attribute field to be optimized in the service attribute carried in the service request signal to obtain an optimized attribute field; at least according to preset configuration information, a common attribute field in the service attribute, and The optimized attribute field is generated, and the corresponding key value is generated and sent to the indexing module 22; the indexing module 22 is configured to receive the corresponding key value; and according to the corresponding key value, determine a one-to-one corresponding counter index address, and send it to the a counter update module 23; the counter update module 23 configured to perform a counting operation and update a counter table according to the counter index address, wherein the counter table is The item is the value of the counter corresponding to the business attribute.
在上述方案中,参见图4所示,键值生成模块21,包括:映射表模块211以及逻辑运算模块212;其中,映射表模块211,配置为存储配置模块1下发的预设映射表,并按将待优化的属性字段按照预设的映射表进行映射,获得对应的映射值;将映射值确定为优化后的属性字段;逻辑运算模块212,配置为根据配置信息,生成普通属性字段以及优化后的属性字段对应的键值,并发送至索引计算模块22。In the above solution, as shown in FIG. 4, the key value generating module 21 includes: a mapping table module 211 and a logic operation module 212. The mapping table module 211 is configured to store a preset mapping table delivered by the configuration module 1. And mapping the attribute field to be optimized according to the preset mapping table to obtain a corresponding mapping value; determining the mapping value as the optimized attribute field; and the logic operation module 212 is configured to generate a common attribute field according to the configuration information. The key value corresponding to the optimized attribute field is sent to the index calculation module 22.
在上述方案中,业务请求信号还可以为用户在业务处理过程中添加的计数请求,计数请求中携带有自定义属性;逻辑运算模块212,还配置为根据预设的配置信息、普通属性字段、优化后的属性字段以及自定义属性,生成对应的键值。In the above solution, the service request signal may also be a counting request added by the user in the process of the service processing, and the counting request carries a custom attribute; the logical operation module 212 is further configured to be based on the preset configuration information, the common attribute field, The optimized attribute fields and custom attributes are generated to generate corresponding key values.
在上述方案中,参见图5所示,索引模块22,包括:偏移表模块221以及索引计算模块222;其中,偏移表模块221,配置为存储计数器的偏移地址以及计数器偏移使能信号;索引计算模块222,配置为在预设偏移表中读取与对应的键值一一对应的计数器偏移地址以及计数器偏移使能信号;根据业务请求信号中携带的计数器基地址、计数器偏移地址以及计数器偏移使能信号,确定计数器索引地址。In the above solution, as shown in FIG. 5, the indexing module 22 includes: an offset table module 221 and an index calculation module 222; wherein the offset table module 221 is configured to store the offset address of the counter and the counter offset enable The signal calculation module 222 is configured to read, in the preset offset table, a counter offset address and a counter offset enable signal corresponding to the corresponding key values; and based on the counter base address carried in the service request signal, The counter offset address and the counter offset enable signal determine the counter index address.
在上述方案中,索引计算模块222,还配置为根据来自配置模块1的计数器更新控制信息中的计数器使能信号,确定自身所处的计数流水模块2是否使能;当自身所处的计数流水模块2使能时,根据对应的键值,在预设偏移表中读取对应的计数器偏移地址以及计数器偏移使能信号。In the above solution, the index calculation module 222 is further configured to determine, according to the counter enable signal in the counter update control information from the configuration module 1, whether the count pipeline module 2 in which it is located is enabled; when the count is in its own flow When the module 2 is enabled, the corresponding counter offset address and the counter offset enable signal are read in the preset offset table according to the corresponding key value.
在上述方案中,索引计算模块222,还配置为根据来自配置模块1的计数器更新控制信息中的计数器使能信号和计数器偏移使能信号,确定是否更新计数器表;In the above solution, the index calculation module 222 is further configured to determine whether to update the counter table according to the counter enable signal and the counter offset enable signal in the counter update control information from the configuration module 1;
相应地,计数器更新模块23,配置为当索引模块22确定更新计数器表 时,根据计数器索引地址,进行计数操作并更新计数器表。Correspondingly, the counter update module 23 is configured to determine the update counter table when the index module 22 determines At the time, according to the counter index address, the counting operation is performed and the counter table is updated.
在上述方案中,业务属性计数装置,还包括:调度模块,配置为接收至少一个业务请求信号,并按照预设调度规则,将至少一个业务请求信号调度至并行的至少一个计数流水模块2中。In the foregoing solution, the service attribute counting apparatus further includes: a scheduling module, configured to receive at least one service request signal, and schedule at least one service request signal to the at least one counting pipeline module 2 in parallel according to a preset scheduling rule.
在上述方案中,业务属性计数装置,还包括:计数器溢出处理模块,配置为在计数器溢出之前,顺序的读出计数器表中计数器的值,并发送至直接内存存取DMA模块。In the above solution, the service attribute counting device further includes: a counter overflow processing module configured to sequentially read out the value of the counter in the counter table before the counter overflows, and send the value to the direct memory access DMA module.
实际应用中上述装置中的各模块可以由专用集成电路(ASIC)、逻辑可编程门阵列(FGPA)或复杂可编程逻辑器件(CPLD)实现。In practical applications, each of the above devices may be implemented by an application specific integrated circuit (ASIC), a logic programmable gate array (FGPA), or a complex programmable logic device (CPLD).
本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用硬件实施例、软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器和光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art will appreciate that embodiments of the present invention can be provided as a method, system, or computer program product. Accordingly, the present invention can take the form of a hardware embodiment, a software embodiment, or a combination of software and hardware. Moreover, the invention can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) including computer usable program code.
本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其它可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其它可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present invention has been described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (system), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or FIG. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing device to produce a machine for the execution of instructions for execution by a processor of a computer or other programmable data processing device. Means for implementing the functions specified in one or more of the flow or in a block or blocks of the flow chart.
这些计算机程序指令也可存储在能引导计算机或其它可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个 流程或多个流程和/或方框图一个方框或多个方框中指定的功能。The computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device. The device is implemented in a flow chart A function specified in a block or blocks of a process or multiple processes and/or block diagrams.
这些计算机程序指令也可装载到计算机或其它可编程数据处理设备上,使得在计算机或其它可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其它可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device. The instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.
以上所述,仅为本发明的较佳实施例而已,并非用于限定本发明的保护范围。The above is only the preferred embodiment of the present invention and is not intended to limit the scope of the present invention.
工业实用性Industrial applicability
本发明实施例提供了一种业务属性的计数方法及装置、通过将业务请求信号中携带的业务属性进行灵活地分类,针对每一类业务属性生成对应的键值,然后确定出与上述键值对应的计数器索引地址,接下来,根据该计数器索引地址,进行计数,并更新计数器表。可见,本发明实施例提供的业务属性的计数方法能够适应不同应用场景的计数需求,在大大提高业务属性计数灵活性的同时,实现了存储资源共享降低了资源占用。 The embodiment of the invention provides a method and a device for counting service attributes, and by flexibly classifying the service attributes carried in the service request signal, generating corresponding key values for each type of service attributes, and then determining the key values. Corresponding counter index address, next, according to the counter index address, counting, and updating the counter table. It can be seen that the counting method of the service attribute provided by the embodiment of the present invention can adapt to the counting requirement of different application scenarios, and the storage resource sharing is reduced to reduce the resource occupation while greatly improving the flexibility of the service attribute counting.

Claims (15)

  1. 一种业务属性计数装置,包括:配置模块以及至少一个计数流水模块;其中,A service attribute counting device includes: a configuration module and at least one counting pipeline module; wherein
    所述计数流水模块包括:键值生成模块、索引模块以及计数器更新模块;The counting pipeline module includes: a key value generating module, an index module, and a counter updating module;
    所述键值生成模块,配置为接收业务请求信号;对所述业务请求信号中携带的业务属性中待优化的属性字段进行优化,获得优化后的属性字段;至少根据预设的配置信息、所述业务属性中普通属性字段以及所述优化后的属性字段,生成对应的键值,并发送至所述索引模块;The key value generating module is configured to receive a service request signal, optimize an attribute field to be optimized in a service attribute carried in the service request signal, and obtain an optimized attribute field; at least according to preset configuration information, Generating a corresponding key value in the common attribute field and the optimized attribute field in the service attribute, and sending the corresponding key value to the index module;
    所述索引模块,配置为接收所述对应的键值;根据所述对应的键值,确定一一对应的计数器索引地址,并发送至所述计数器更新模块;The indexing module is configured to receive the corresponding key value; determine a one-to-one corresponding counter index address according to the corresponding key value, and send the counter indexing module to the counter updating module;
    所述计数器更新模块,配置为根据所述计数器索引地址,进行计数操作并更新计数器表,其中,所述计数器表的表项为所述业务属性所对应的计数器的值。The counter update module is configured to perform a counting operation according to the counter index address and update a counter table, wherein the entry of the counter table is a value of a counter corresponding to the service attribute.
  2. 根据权利要求1所述的装置,其中,所述键值生成模块,包括:映射表模块以及逻辑运算模块;其中,The device according to claim 1, wherein the key value generating module comprises: a mapping table module and a logical operation module; wherein
    所述映射表模块,配置为存储所述配置模块下发的所述预设映射表,并按将所述待优化的属性字段按照预设的映射表进行映射,获得对应的映射值;将所述映射值确定为所述优化后的属性字段;The mapping table module is configured to store the preset mapping table delivered by the configuration module, and map the attribute field to be optimized according to a preset mapping table to obtain a corresponding mapping value; The mapping value is determined as the optimized attribute field;
    所述逻辑运算模块,配置为根据所述配置信息,生成所述普通属性字段以及所述优化后的属性字段对应的键值,并发送至所述索引模块。The logic operation module is configured to generate the common attribute field and the key value corresponding to the optimized attribute field according to the configuration information, and send the key value to the index module.
  3. 根据权利要求1所述的装置,其中,所述业务请求信号为用户在业务处理过程中添加的计数请求,所述计数请求中携带有自定义属性;The device according to claim 1, wherein the service request signal is a counting request added by a user in a service processing process, and the counting request carries a custom attribute;
    所述逻辑运算模块,还配置为根据所述预设的配置信息、所述普通属性字段、所述优化后的属性字段以及所述自定义属性,生成所述对应的键 值。The logic operation module is further configured to generate the corresponding key according to the preset configuration information, the common attribute field, the optimized attribute field, and the customized attribute. value.
  4. 根据权利要求1所述的装置,其中,所述索引模块,包括:偏移表模块以及索引计算模块;其中,The apparatus according to claim 1, wherein the indexing module comprises: an offset table module and an index calculation module; wherein
    所述偏移表模块,配置为存储计数器的偏移地址以及计数器偏移使能信号;The offset table module is configured to store an offset address of the counter and a counter offset enable signal;
    所述索引计算模块,配置为在预设偏移表中读取与所述对应的键值一一对应的计数器偏移地址以及计数器偏移使能信号;根据所述业务请求信号中携带的计数器基地址、所述计数器偏移地址以及所述计数器偏移使能信号,确定所述计数器索引地址。The index calculation module is configured to read, in a preset offset table, a counter offset address and a counter offset enable signal corresponding to the corresponding key values; and the counter carried in the service request signal The base address, the counter offset address, and the counter offset enable signal determine the counter index address.
  5. 根据权利要求4所述的装置,其中,所述索引计算模块,还配置为根据来自所述配置模块的计数器更新控制信息中的计数器使能信号,确定所述索引计算模块自身所处的计数流水模块是否使能;当所处的计数流水模块使能时,根据所述对应的键值,在所述预设偏移表中读取对应的所述计数器偏移地址以及所述计数器偏移使能信号。The apparatus according to claim 4, wherein said index calculation module is further configured to determine a count flow of said index calculation module itself according to a counter enable signal in said counter update control information from said configuration module Whether the module is enabled; when the counting pipeline module is enabled, reading the corresponding counter offset address and the counter offset enable in the preset offset table according to the corresponding key value signal.
  6. 根据权利要求4所述的装置,其中,所述索引计算模块,还配置为根据来自所述配置模块的计数器更新控制信息中的计数器使能信号和所述计数器偏移使能信号,确定是否更新所述计数器表;The apparatus according to claim 4, wherein said index calculation module is further configured to determine whether to update based on a counter enable signal and said counter offset enable signal in the counter update control information from said configuration module The counter table;
    所述计数器更新模块,配置为当所述索引计算模块确定更新所述计数器表时,根据所述计数器索引地址,进行计数操作并更新所述计数器表。The counter update module is configured to perform a counting operation and update the counter table according to the counter index address when the index calculation module determines to update the counter table.
  7. 根据权利要求1所述的装置,其中,所述业务属性计数装置,还包括:调度模块,配置为接收至少一个业务请求信号,并按照预设调度规则,将所述至少一个业务请求信号调度至并行的所述至少一个计数流水模块中。The apparatus according to claim 1, wherein the service attribute counting means further comprises: a scheduling module configured to receive at least one service request signal, and to schedule the at least one service request signal to the preset scheduling rule The at least one of the parallel pipelines is in parallel.
  8. 根据权利要求1所述的装置,其中,所述业务属性计数装置,还包括:计数器溢出处理模块,配置为在计数器溢出之前,顺序地读出所述计 数器表中所述计数器的值,并发送至直接内存存取DMA模块。The apparatus according to claim 1, wherein said service attribute counting means further comprises: a counter overflow processing module configured to sequentially read said meter before said counter overflows The value of the counter described in the table is sent to the direct memory access DMA module.
  9. 一种业务属性的计数方法,包括:A method for counting business attributes, including:
    对接收到的业务请求信号中携带的业务属性中待优化的属性字段进行优化,获得优化后的属性字段;Optimizing the attribute field to be optimized in the service attribute carried in the received service request signal, and obtaining the optimized attribute field;
    至少根据预设的配置信息、所述业务属性中普通属性字段以及所述优化后的属性字段,生成对应的键值;Generating a corresponding key value according to at least preset configuration information, a common attribute field in the service attribute, and the optimized attribute field;
    根据所述对应的键值,确定一一对应的计数器索引地址;Determining a one-to-one counter index address according to the corresponding key value;
    根据所述计数器索引地址,进行计数操作并更新计数器表,其中,所述计数器表的表项为所述业务属性所对应的计数器的值。And performing a counting operation according to the counter index address, and updating the counter table, wherein the entry of the counter table is a value of a counter corresponding to the service attribute.
  10. 根据权利要求9所述的方法,其中,所述将对接收到的业务请求信号中携带的业务属性中待优化的属性字段进行优化,获得优化后的属性字段,包括:The method according to claim 9, wherein the attribute field to be optimized in the service attribute carried in the received service request signal is optimized to obtain an optimized attribute field, including:
    将所述待优化的属性字段按照预设的映射表进行映射,获得对应的映射值;And mapping the attribute field to be optimized according to a preset mapping table to obtain a corresponding mapping value;
    将所述映射值确定为所述优化后的属性字段;Determining the mapping value as the optimized attribute field;
    根据所述配置信息,生成所述普通属性字段以及所述优化后的属性字段对应的键值。And generating, according to the configuration information, the common attribute field and the key value corresponding to the optimized attribute field.
  11. 根据权利要求9所述的方法,其中,所述业务请求信号为用户在业务处理过程中添加的计数请求,所述计数请求中携带有自定义属性;The method according to claim 9, wherein the service request signal is a counting request added by a user in a service processing process, and the counting request carries a custom attribute;
    所述至少根据预设的配置信息、所述报文属性中普通属性字段以及所述优化后的属性字段,生成对应的键值,包括:And generating, according to the preset configuration information, the common attribute field in the message attribute, and the optimized attribute field, a corresponding key value, including:
    根据所述预设的配置信息、所述普通属性字段、所述优化后的属性字段以及所述自定义属性,生成所述对应的键值。And generating the corresponding key value according to the preset configuration information, the common attribute field, the optimized attribute field, and the custom attribute.
  12. 根据权利要求9所述的方法,其中,所述根据所述对应的键值,确定一一对应的计数器索引地址,包括: The method of claim 9, wherein the determining the one-to-one counter index address according to the corresponding key value comprises:
    在预设偏移表中读取与所述对应的键值一一对应的计数器偏移地址以及计数器偏移使能信号;Reading a counter offset address and a counter offset enable signal corresponding to the corresponding key values in a preset offset table;
    根据所述业务请求信号中携带的计数器基地址、所述计数器偏移地址以及所述计数器偏移使能信号,确定所述计数器索引地址。Determining the counter index address according to the counter base address carried in the service request signal, the counter offset address, and the counter offset enable signal.
  13. 根据权利要求12所述的方法,其中,所述根据所述计数器索引地址,进行计数操作并更新计数器表,包括:The method according to claim 12, wherein said performing a counting operation and updating a counter table according to said counter index address comprises:
    当根据计数器更新控制信息中的计数器使能信号和所述计数器偏移使能信号确定更新所述计数器表时,根据所述计数器索引地址,进行计数操作并更新计数器表。When it is determined that the counter table is updated based on the counter enable signal in the counter update control information and the counter offset enable signal, a counting operation is performed and the counter table is updated based on the counter index address.
  14. 根据权利要求9所述的方法,其中,所述方法还包括:The method of claim 9 wherein the method further comprises:
    在计数器溢出之前,顺序地读出所述计数器表中所述计数器的值。The value of the counter in the counter table is sequentially read out before the counter overflows.
  15. 一种计算机存储介质,所述计算机存储介质中存储有可执行指令,所述可执行指令用于执行权利要求9至14任一项所述的业务属性的计数方法。 A computer storage medium storing executable instructions for performing the counting method of the service attribute according to any one of claims 9 to 14.
PCT/CN2016/080974 2015-07-28 2016-05-04 Counting method and apparatus for service attribute, and computer storage medium WO2017016259A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510449744.6 2015-07-28
CN201510449744.6A CN106411545A (en) 2015-07-28 2015-07-28 Service attribute counting method and device

Publications (1)

Publication Number Publication Date
WO2017016259A1 true WO2017016259A1 (en) 2017-02-02

Family

ID=57884056

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/080974 WO2017016259A1 (en) 2015-07-28 2016-05-04 Counting method and apparatus for service attribute, and computer storage medium

Country Status (2)

Country Link
CN (1) CN106411545A (en)
WO (1) WO2017016259A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111045874A (en) * 2019-10-31 2020-04-21 北京航天自动控制研究所 General method for solving process step data interpretation by test-launch control software modeling
CN111917824A (en) * 2020-06-19 2020-11-10 深圳奇迹智慧网络有限公司 Configuration method and device of internet of things equipment, computer equipment and storage medium

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109947762A (en) * 2017-08-16 2019-06-28 深圳市中兴微电子技术有限公司 A kind of Hash table management method and device, computer readable storage medium
CN112968784B (en) * 2021-01-29 2022-04-01 新华三信息安全技术有限公司 Flow charging method and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060106755A1 (en) * 2004-11-12 2006-05-18 Sap Aktiengesellschaft, A Germany Corporation Tracking usage of data elements in electronic business communications
CN102298551A (en) * 2010-06-23 2011-12-28 中兴通讯股份有限公司 Variable-rule method and system for counting real-time performance based on events
CN102752122A (en) * 2011-04-19 2012-10-24 中兴通讯股份有限公司 Device and method for acquiring multidimensional static performance data in network management
CN104579722A (en) * 2013-10-11 2015-04-29 中兴通讯股份有限公司 Flow statistics capability negotiation method and apparatus
CN104636395A (en) * 2013-11-15 2015-05-20 北京信威通信技术股份有限公司 Count processing method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060106755A1 (en) * 2004-11-12 2006-05-18 Sap Aktiengesellschaft, A Germany Corporation Tracking usage of data elements in electronic business communications
CN102298551A (en) * 2010-06-23 2011-12-28 中兴通讯股份有限公司 Variable-rule method and system for counting real-time performance based on events
CN102752122A (en) * 2011-04-19 2012-10-24 中兴通讯股份有限公司 Device and method for acquiring multidimensional static performance data in network management
CN104579722A (en) * 2013-10-11 2015-04-29 中兴通讯股份有限公司 Flow statistics capability negotiation method and apparatus
CN104636395A (en) * 2013-11-15 2015-05-20 北京信威通信技术股份有限公司 Count processing method and device

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111045874A (en) * 2019-10-31 2020-04-21 北京航天自动控制研究所 General method for solving process step data interpretation by test-launch control software modeling
CN111045874B (en) * 2019-10-31 2023-05-12 北京航天自动控制研究所 Universal method for modeling solving flow step data interpretation by test initiation control software
CN111917824A (en) * 2020-06-19 2020-11-10 深圳奇迹智慧网络有限公司 Configuration method and device of internet of things equipment, computer equipment and storage medium

Also Published As

Publication number Publication date
CN106411545A (en) 2017-02-15

Similar Documents

Publication Publication Date Title
US10469396B2 (en) Event processing with enhanced throughput
CN109144696B (en) Task scheduling method and device, electronic equipment and storage medium
WO2017016259A1 (en) Counting method and apparatus for service attribute, and computer storage medium
US9396154B2 (en) Multi-core processor for managing data packets in communication network
US8381230B2 (en) Message passing with queues and channels
JP2020529171A (en) Traffic measurement methods, devices, and systems
CN107104824B (en) Network topology determination method and device
US9929970B1 (en) Efficient resource tracking
US20150134591A1 (en) Method, apparatus, and computer program product for data quality analysis
CN107241305B (en) Network protocol analysis system based on multi-core processor and analysis method thereof
US20160371122A1 (en) File processing workflow management
US9584332B2 (en) Message processing method and device
CN105450618A (en) Operation method and operation system of big data process through API (Application Programming Interface) server
CN108512782A (en) Accesses control list is grouped method of adjustment, the network equipment and system
US20210049042A1 (en) Electronic apparatus and method for controlling thereof
TWI652623B (en) A method and apparatus for information lookup request processing or exception packet processing at a look-aside processor unit
CN103986585A (en) Message preprocessing method and device
CN111061758B (en) Data storage method, device and storage medium
WO2021208682A1 (en) Data sampling method, apparatus and device for network device, and medium
CN108595483B (en) Data processing method and related device
US20210132987A1 (en) Computer program for asynchronous data processing in a database management system
CN103166845A (en) Data processing method and device
US8543722B2 (en) Message passing with queues and channels
CN110912826A (en) Method and device for expanding IPFIX table items by using ACL
US20180262407A1 (en) Telemetry Architecture for Integrated Circuits and Cloud Infrastructure

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16829626

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16829626

Country of ref document: EP

Kind code of ref document: A1