CN117880119A - Message statistics method and device, electronic equipment and storage medium - Google Patents

Message statistics method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN117880119A
CN117880119A CN202311629071.3A CN202311629071A CN117880119A CN 117880119 A CN117880119 A CN 117880119A CN 202311629071 A CN202311629071 A CN 202311629071A CN 117880119 A CN117880119 A CN 117880119A
Authority
CN
China
Prior art keywords
acl
storage information
message
vni
linked list
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311629071.3A
Other languages
Chinese (zh)
Inventor
郭世豪
李友
陈翔
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Metabrain Intelligent Technology Co Ltd
Original Assignee
Suzhou Metabrain Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Metabrain Intelligent Technology Co Ltd filed Critical Suzhou Metabrain Intelligent Technology Co Ltd
Priority to CN202311629071.3A priority Critical patent/CN117880119A/en
Publication of CN117880119A publication Critical patent/CN117880119A/en
Pending legal-status Critical Current

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention relates to the technical field of communication, and provides a message processing method, a message processing device, electronic equipment and a storage medium, wherein the method comprises the following steps: acquiring a statistical request of an outgoing direction ACL of a message sent by receiving equipment, wherein the statistical request comprises a VNI field, and the VNI field characterizes a unique identifier of the receiving equipment; and matching the VNI fields on the storage information of each structural body in the linked list, and taking the successful matching number as the statistical number of the outgoing direction ACLs of the messages sent by the designated equipment. The invention constructs the linked list by matching the input direction ACL issued by the chip with the message VNI and adding metadata to the message, and the output direction ACL matches the message execution action of the designated metadata, and matches the VNI field to be queried on the storage information of each structure in the linked list, so as to achieve the aim of matching the output direction ACL with the VNI field in the chip without supporting the output direction ACL, and also realize the statistics of the message.

Description

Message statistics method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a method and apparatus for processing a message, an electronic device, and a storage medium.
Background
Chip build ACLs of computer devices (e.g., routing devices) support matching many fields in both the ingress and egress directions, but the matching capabilities of these fields are supported differently in the ingress and egress directions ACLs. The support capability is also different for chips of different devices, for ACLs in the same direction. For example, for some chips, the ingress ACL and the egress ACL may both match the VNI (network identifier) field of the message, and for other chips, the ingress ACL may match the VNI field of the message, but the egress ACL may not match the VNI field of the message. If the user wants to count the message of the designated VNI sent out from a certain port, the user will send an outgoing direction ACL matching message VNI and count, and because some chips do not support the outgoing direction ACL matching the VNI field, the chips will return an error, and the error message is prompted to be unsupported, so that the function that the user wants to realize cannot be realized.
Disclosure of Invention
Aiming at the problems existing in the prior art, the invention provides a message processing method, a message processing device, electronic equipment and a storage medium.
The invention provides a message processing method, which comprises the following steps:
acquiring a statistical request of an outgoing direction ACL of a message sent by receiving equipment, wherein the statistical request comprises a VNI field, and the VNI field characterizes a unique identifier of the receiving equipment;
matching the VNI fields on the storage information of each structural body in the linked list, and taking the number of successful matching as the statistical number of the outgoing direction ACLs of the messages sent by the designated equipment;
wherein, structure body storage information in the linked list includes:
the method comprises the steps that an output direction ACL number of a matched VNI message issued by a sending device, an input direction ACL number of metadata generated by a chip of the sending device for the VNI message, the output direction ACL number of the metadata, the VNI to be matched with an ACL list item and a list tail mark are matched; the transmitting device is a device that transmits a message to the receiving device.
In one embodiment, the method further comprises:
acquiring an outgoing direction ACL number which is scheduled to be deleted by the sending equipment;
traversing the linked list, determining structural body storage information to be deleted in the linked list based on an exit direction ACL number to be deleted, deleting the ACL corresponding to the structural body storage information to be deleted, and deleting the structural body storage information to be deleted in the linked list;
if the structural body storage information to be deleted has the table tail identification, the table tail identification is added to the structural body storage information on the structural body storage information to be deleted based on the serial number of each structural body storage information in the linked list.
In one embodiment, the method further comprises the processing step of constructing the linked list, including:
acquiring an ACL issued by the newly added transmitting equipment, determining the newly added ACL as an output direction ACL and matching a message VNI, and constructing structure storage information corresponding to the newly added ACL;
when the newly added ACL is determined to be the first ACL, the structure body storage information corresponding to the newly added ACL is used as the table head information of the linked list, and meanwhile, the table tail identification is added in the structure body storage information corresponding to the newly added ACL;
when it is determined that the newly added ACL is not the first ACL, the structure body storage information corresponding to the newly added ACL is placed at the tail of the existing linked list and used as the tail information of the linked list, and meanwhile, the tail identification is added in the structure body storage information corresponding to the newly added ACL.
In one embodiment, the building of structure storage information corresponding to a newly added ACL includes:
recording a VNI, creating an access direction ACL for generating metadata aiming at the VNI message by a chip of the sending equipment, and recording an access direction ACL number for generating the metadata into the structural body storage information;
the chip of the transmitting device creates an outgoing direction ACL matching metadata, and records the outgoing direction ACL number matching metadata into the structure body storage information.
In one embodiment, the table tail identifier is represented by a next_user_entry field, the next_user_entry field is set to 0, and the table tail information representing that the corresponding structure body storage information is a linked list.
In one embodiment, the deleting the ACL corresponding to the structure storage information to be deleted includes:
acquiring an input direction ACL number of metadata generated for a VNI message and an output direction ACL number of matching metadata from the structure storage information to be deleted based on the output direction ACL number to be deleted;
based on the input direction ACL number of the metadata generated for the VNI message and the output direction ACL number of the matching metadata, deleting the input direction ACL corresponding to the input direction ACL number of the generated metadata and deleting the output direction ACL of the output direction ACL number of the matching metadata in the database;
accordingly, the method further comprises:
storing the deleted ACL in a cache, and storing the structural body storage information to be deleted in an auxiliary linked list as structural body storage information to be restored;
determining deleting time based on deleting time, restoring the deleted ACL to a database after receiving a restoring signal when the deleting time is smaller than a preset restoring time, and restoring the structural body storage information to the original position of the linked list based on the structural body storage information to be restored in the auxiliary linked list.
The invention also provides a message statistics device, which comprises:
the acquisition module is used for acquiring a statistical request of an outgoing direction ACL of a message sent by the receiving equipment, wherein the statistical request comprises a VNI field, and the VNI field characterizes a unique identifier of the receiving equipment;
the statistic module is used for matching the VNI field on the storage information of each structure body in the linked list, and taking the number of successful matching as the statistic number of the outgoing direction ACL of the message sent by the designated equipment;
wherein, structure body storage information in the linked list includes:
the method comprises the steps that an output direction ACL number of a matched VNI message issued by a sending device, an input direction ACL number of metadata generated by a chip of the sending device for the VNI message, the output direction ACL number of the metadata, the VNI to be matched with an ACL list item and a list tail mark are matched; the transmitting device is a device that transmits a message to the receiving device.
The invention also provides an electronic device, which comprises a memory, a processor and a computer program stored in the memory and capable of running on the processor, wherein the processor realizes the message statistics method when executing the program.
The present invention also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a message statistics method as described above.
The invention also provides a computer program product comprising a computer program which, when executed by a processor, implements a message processing method as described above.
According to the message counting method, the device, the electronic equipment and the storage medium, through matching the input direction ACL issued by the chip with the message VNI and adding metadata to the message, the output direction ACL is matched with the message execution action of the designated metadata to construct a linked list, the VNI fields to be queried are matched with the VNI fields on the storage information of each structure in the linked list, and the number of successful matching is used as the counting number of the output direction ACL of the message sent by the designated equipment, so that the aim that the output direction ACL is not supported to be matched with the VNI fields on some chips is achieved, and the message counting purpose can be achieved.
Drawings
In order to more clearly illustrate the invention or the technical solutions of the prior art, the following description will briefly explain the drawings used in the embodiments or the description of the prior art, and it is obvious that the drawings in the following description are some embodiments of the invention, and other drawings can be obtained according to the drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a message statistics method provided by the invention;
FIG. 2 is a schematic diagram of a specific flow of message statistics and deletion provided by the present invention;
FIG. 3 is a schematic diagram of a message statistics device according to the present invention;
fig. 4 is a schematic structural diagram of an electronic device provided by the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present invention more apparent, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is apparent that the described embodiments are some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The following describes a message processing method, a device, an electronic apparatus, and a storage medium according to the present invention with reference to fig. 1 to fig. 4.
Fig. 1 shows a flow chart of a message processing method provided by the present invention, referring to fig. 1, the method includes:
11. acquiring a statistical request of an outgoing direction ACL of a message sent by receiving equipment, wherein the statistical request comprises a VNI field, and the VNI field characterizes a unique identifier of the receiving equipment;
12. matching the VNI fields on the storage information of each structural body in the linked list, and taking the number of successful matching as the statistical number of the outgoing direction ACLs of the messages sent by the designated equipment; the structure body storage information in the linked list comprises: the method comprises the steps that an output direction ACL number of a matched VNI message issued by a sending device, an input direction ACL number of metadata generated by a chip of the sending device for the VNI message, the output direction ACL number of the metadata, the VNI to be matched with an ACL list item and a list tail mark are matched; the transmitting device is a device that transmits a message to the receiving device.
In this regard, an access control list (Access Control List, hereinafter referred to as ACL) is a function commonly used for a switch. The system can control various behaviors of the message and has important position on a message processing pipeline of the exchange chip.
The exchange chip has a plurality of components including an in-direction processing module, an out-direction processing module, an exchange module and the like, and ACLs are classified into different sub-ACL types according to different action modules, including an in-direction ACL, an out-direction ACL and the like. The incoming ACL and outgoing ACL resources are mutually different, and the fields that can be matched and the actions that can be issued and the number of ACLs that can be issued are different.
Chip build ACLs of computer devices (e.g., routing devices) support matching many fields in both the ingress and egress directions, but the matching capabilities of these fields are supported differently in the ingress and egress directions ACLs. The support capability is also different for chips of different devices, for ACLs in the same direction. For example, for some chips, the ingress ACL and the egress ACL may both match the VNI (network identifier) field of the message, and for other chips, the ingress ACL may match the VNI field of the message, but the egress ACL may not match the VNI field of the message. If the user wants to count the message of the designated VNI sent out from a certain port, the user will send an outgoing direction ACL matching message VNI and count, and because some chips do not support the outgoing direction ACL matching the VNI field, the chips will return an error, and the error message is prompted to be unsupported, so that the function that the user wants to realize cannot be realized.
In this regard, the present invention provides a method for processing a message, in order to save the operation cost of a user, so that the user cannot feel the difference between chips, when an outgoing direction module on a chip that does not support an outgoing direction ACL configures an outgoing direction ACL to match a VNI of the message, two ACLs are issued, the first ACL is an incoming direction ACL for matching the VNI of the message, metadata (five-tuple) is generated, the metadata will accompany the message to reach the outgoing direction module, and at this time, a second ACL will hit, the second ACL is an outgoing direction ACL, matches the metadata corresponding to the message, and then the user performs the action desired by the user, such as counting.
In the present invention, for a computer device (the above-mentioned transmitting device), in the process of transmitting a message, the transmitting device performs a complete process of transmitting the message, and the hierarchical structure may be divided into a bottom chip (communication logic portion), a middle layer (business logic portion), and an upper layer (presentation operation portion). In order to achieve the above-mentioned implementation effect, the middle layer needs to create a data structure for the output direction ACL (here, the output direction ACL may be used as a user_entry due to user configuration) of the upper layer matching packet VNI, and record the correspondence between the user_entry and the two ACLs actually issued by the chip (here, the input direction ACL may be used as an ingress_chip_entry due to bottom layer chip configuration), and the output direction ACL may be used as an egress_chip_entry). To cope with a simultaneous configuration of multiple user entries matching different VNIs by the upper layer, a linked list may be constructed to manage these ACLs.
And constructing corresponding structure body storage information according to a preset data structure aiming at each message in the linked list. The structure storage information includes the following information:
an outgoing direction ACL number (user_entry_id) issued by the user, namely an outgoing direction ACL number of the matched VNI message issued by the sending device;
the chip corresponding to the input direction ACL number (ingress_chip_entry_id) for generating metadata, that is, the input direction ACL number for generating metadata for the VNI message created by the bottom chip of the sending device;
an outgoing direction ACL number (egress_chip_entry_id) matching this metadata, i.e., an outgoing direction ACL number matching metadata;
VNIs to be matched by ACL entries;
and unifying the structure body storage information corresponding to the user_entry issued by all users, namely configuring the table tail identification of the last member storage information in the linked list, wherein the storage information represents the last member storage information in the linked list, and the traversing operation in the linked list is convenient. It should be further noted that the table tail identifier is represented by a next_user_entry field, that is, a next_user_entry field is configured in each structure body storage information, and when the next_user_entry field is set to 0, the table tail information that characterizes the corresponding structure body storage information as a linked list is represented. If the next_user_entry field is set to 1, the corresponding structure body storage information is represented by non-table tail information.
In the invention, when the output direction statistics of the VNI message of a certain designated device (namely a designated receiving device) is queried, a statistical request of the output direction ACL of the message sent by the receiving device is obtained, wherein the statistical request comprises a VNI field, and the VNI field represents the unique identification of the receiving device.
Traversing the VNI fields in the statistic request in a linked list, matching the VNI fields on the storage information of each structural body in the linked list, if the VNI fields are the same, the corresponding ingress chip entry in the storage information of the structural body is matched with the VNI to be queried by the upper layer, and generating corresponding metadata after the VNI fields are matched with the VNI to be queried by the upper layer, wherein the count statistics of the designated VNI messages to be queried by the upper layer is the hit number of egress chip entry of the matched metadata in the structural body. Directly calling the chip interface to inquire the hit times of the chip entry in the outgoing direction and returning to the upper layer. I.e. the number of successful matches is used as the statistical number of the outgoing direction ACLs of the messages sent by the designated equipment.
According to the message processing method provided by the invention, the input direction ACL issued by the chip is matched with the message VNI and metadata is added to the message, the output direction ACL is matched with the message execution action of the designated metadata to construct a linked list, the VNI fields to be queried are matched with the VNI fields on the storage information of each structure in the linked list, and the number of successful matching is used as the statistic number of the output direction ACL of the message sent by the designated equipment, so that the aim of matching the output direction ACL with the VNI fields is achieved when some chips do not support the output direction ACL, and the purpose of message statistics can be achieved.
In a further method of the above method, when deleting a VNI message of a specific device (i.e., a specific receiving device), the outgoing ACL number that the sending device plans to delete is acquired at this time.
Traversing the linked list, determining structural body storage information to be deleted in the linked list based on the exit direction ACL number to be deleted, deleting the ACL corresponding to the structural body storage information to be deleted, and deleting the structural body storage information to be deleted in the linked list.
If the structural body storage information to be deleted has the table tail identification, the table tail identification is added to the structural body storage information on the structural body storage information to be deleted based on the serial number of each structural body storage information in the linked list.
In this regard, in the present invention, when the transmission of a message to a certain device is stopped, the ACL that controls the transmission of the message is deleted. At this time, since there is structure storage information for the message transmission in the linked list, in order to avoid an error of the subsequent count, it is necessary to delete the corresponding structure storage information in the linked list and delete the corresponding ACL in the database. During the deletion process, it is also necessary to traverse the linked list. The user_entry_id of each structure body storage information is then compared with the user_entry number to be deleted by the upper layer, and if so, the structure body storage information is deleted in the linked list. If the structure body storage information with the table tail identification is deleted, the table tail identification is configured on other structure body storage information in the linked list at the moment so as to show the integrity of the linked list information and continue to serve the subsequent traversal. Because all members in the linked list are arranged by number, the arrangement is equivalent to the arrangement by number. For this purpose, the next_user_entry field of the structure body storage information of the last piece of structure body storage information to be deleted is set to 0. When each piece of structure body storage information is used as a node, the next_user_entry field is set to 0, which means that the structure body storage information plays a role of a tail node in a linked list, so that a node of a layer above the deleted tail node is used as a new tail node.
According to the method, the corresponding structure body storage information can be deleted rapidly and accurately by traversing the linked list, so that effective management of the information is facilitated.
In a further method of the above method, it should be noted that deletion of the structure stored information in the linked list is performed by:
acquiring an input direction ACL number of metadata generated for the VNI message and an output direction ACL number of matching metadata from structure storage information to be deleted based on the output direction ACL number to be deleted;
based on the input direction ACL number of metadata generated for VNI message and the output direction ACL number of matching metadata, the input direction ACL corresponding to the input direction ACL number of generating metadata is deleted, and the output direction ACL of matching metadata is deleted in the database.
In the present invention, the computer device has the condition of recovering the message sent to a certain receiving device, so in order to avoid the complicated processing procedure and construction failure caused by reconstructing the corresponding structure body storage information in the linked list, the deleted ACL can be temporarily stored in the cache, and the structure body storage information to be deleted can be stored in the auxiliary linked list as the structure body storage information to be recovered. Here, both the cache and the auxiliary linked list serve as carriers for temporarily storing information to be deleted.
In the invention, a recovery time length is configured for each piece of deleted information, if the signal to be recovered is not received in the recovery time length, the information is not needed, and the information is completely deleted from the cache and the auxiliary linked list. And when the deleting time is smaller than the preset restoring time, restoring the deleted ACL to the database, and restoring the structural body storage information to the original position of the linked list based on the structural body storage information to be restored in the auxiliary linked list.
In the further method, the deleted information is controlled, so that the information can be recovered in the effective time, the reutilization of the information is improved, and the repeated construction is avoided.
In a further method of the above method, the following explanation is given to the processing steps of constructing the linked list, specifically as follows:
and acquiring an ACL issued by the newly added transmitting equipment, firstly judging whether the ACL is in an output direction, and when the ACL is in the output direction and the ACL is matched with the message VNI, constructing corresponding structure body storage information for the ACL in the output direction, and storing the structure body storage information in a linked list.
In the present invention, the linked list is necessarily constructed. The aim is to deal with the fact that the upper layer is simultaneously provided with a plurality of user entries matched with different VNIs, so that a linked list can be constructed to manage the ACLs.
When it is determined that the newly added ACL is the first ACL, the characterization has not yet constructed a linked list, i.e., there is no table structure of the linked list. The first time of construction is needed, then the structure body storage information corresponding to the newly added ACL is used as the header information of the linked list, that is, the structure body storage information corresponding to the newly added ACL is the header node of the linked list. And in a certain time, only one structural body storage information still exists in the linked list, and in order to ensure the integrity of the linked list, a table tail mark is added in the structural body storage information at the moment.
Accordingly, when it is determined that the newly added ACL is not the first ACL, it is indicated that it is after generation of other structure storing information, to this end, the structure storing information corresponding to the newly added ACL is placed at the end of the existing linked list as the end information of the linked list, while the end identifier is added in the structure storing information corresponding to the newly added ACL.
Further explaining, in the process of constructing the structure body storage information, recording the VNI, creating an incoming direction ACL of metadata generated by the chip of the sending equipment aiming at the VNI message, and recording the incoming direction ACL number of the metadata generated into the structure body storage information;
the chip of the transmitting device creates an outgoing direction ACL matching metadata, and records the outgoing direction ACL number matching metadata into the structure body storage information.
In the further method, the corresponding relation between the user_entry and the two ACLs actually issued by the chips is recorded through the linked list, so that the direction ACL matching VNI field is not supported by some chips, the query information can be carried out based on the traversal linked list, and the message statistics is realized.
FIG. 2 is a flow chart of constructing and deleting structure storage information for a traverse linked list. The contents of the above-mentioned submitted processes can be intuitively understood with reference to fig. 2, and detailed descriptions of the drawings are not repeated here.
The message statistics device provided by the invention is described below, and the message statistics device described below and the message processing method described above can be referred to correspondingly.
Fig. 3 shows a schematic structural diagram of a packet statistics apparatus provided by the present invention, referring to fig. 3, the apparatus includes an obtaining module 31 and a statistics module 32, where:
the acquisition module is used for acquiring a statistical request of an outgoing direction ACL of a message sent by the receiving equipment, wherein the statistical request comprises a VNI field, and the VNI field characterizes a unique identifier of the receiving equipment;
the statistical module is used for matching the VNI field on the storage information of each structural body in the linked list, and taking the number of successful matching as the statistical number of the outgoing direction ACL of the message sent by the designated equipment;
the structure body storage information in the linked list comprises:
the method comprises the steps that an output direction ACL number of a matched VNI message issued by a sending device, an input direction ACL number of metadata generated by a chip of the sending device for the VNI message, the output direction ACL number of the metadata, the VNI to be matched with an ACL list item and a list tail mark are matched; the transmitting device is a device that transmits a message to the receiving device.
In a further arrangement of the above arrangement, the arrangement comprises a deletion module for:
acquiring an outgoing direction ACL number which is scheduled to be deleted by a sending device;
traversing a linked list, determining structure body storage information to be deleted in the linked list based on an exit direction ACL number to be deleted, deleting the ACL corresponding to the structure body storage information to be deleted, and deleting the structure body storage information to be deleted in the linked list;
if the structural body storage information to be deleted has the table tail identification, the table tail identification is added to the structural body storage information on the structural body storage information to be deleted based on the serial number of each structural body storage information in the linked list.
In a further arrangement of the above arrangement, the arrangement comprises a construction module for:
acquiring an ACL issued by newly added transmitting equipment, determining the newly added ACL as an output direction ACL and matching a message VNI, and constructing structure storage information corresponding to the newly added ACL;
when the newly added ACL is determined to be the first ACL, the structure body storage information corresponding to the newly added ACL is used as the table head information of the linked list, and meanwhile, the table tail identification is added in the structure body storage information corresponding to the newly added ACL;
when it is determined that the newly added ACL is not the first ACL, the structure body storage information corresponding to the newly added ACL is placed at the tail of the existing linked list and used as the tail information of the linked list, and meanwhile, the tail identification is added in the structure body storage information corresponding to the newly added ACL.
In a further arrangement of the above arrangement, the construction module is specifically configured to, during the process of constructing the structure storage information corresponding to the newly added ACL:
recording a VNI, creating an access direction ACL for generating metadata aiming at the VNI message by a chip of the sending equipment, and recording an access direction ACL number for generating the metadata into the structural body storage information;
the chip of the transmitting device creates an outgoing direction ACL matching metadata, and records the outgoing direction ACL number matching metadata into the structure body storage information.
In a further apparatus of the above apparatus, the table tail identifier is represented by a next_user_entry field, the next_user_entry field is set to 0, and the table tail information representing that the corresponding structure body storage information is a linked list.
In a further arrangement of the above arrangement, the deletion module is specifically configured to, during a process of deleting an ACL corresponding to structure storage information to be deleted:
acquiring an input direction ACL number of metadata generated for the VNI message and an output direction ACL number of matching metadata from structure storage information to be deleted based on the output direction ACL number to be deleted;
based on the input direction ACL number of the metadata generated for the VNI message and the output direction ACL number of the matching metadata, deleting the input direction ACL corresponding to the input direction ACL number of the generated metadata and deleting the output direction ACL of the output direction ACL number of the matching metadata in the database;
correspondingly, the device also comprises a recovery module for:
storing the deleted ACL in a cache, and storing the structural body storage information to be deleted in an auxiliary linked list as structural body storage information to be restored;
determining deleting time based on deleting time, restoring the deleted ACL to a database after receiving a restoring signal when the deleting time is smaller than a preset restoring time, and restoring the structural body storage information to the original position of the linked list based on the structural body storage information to be restored in the auxiliary linked list.
The message statistics device provided by the invention constructs a linked list by matching the input direction ACL issued by the chip with the message VNI and adding metadata to the message, wherein the output direction ACL matches the message execution action of the designated metadata, matches the VNI field to be queried with the VNI field on the storage information of each structure in the linked list, and uses the number of successful matching as the statistics number of the output direction ACL of the message sent by the designated equipment, so that the aim of matching the output direction ACL with the VNI field is achieved when some chips do not support the output direction ACL, and the purpose of message statistics can be realized.
Fig. 4 illustrates a physical schematic diagram of an electronic device, as shown in fig. 4, which may include: a processor (processor) 41, a communication interface (Communications Interface) 42, a memory (memory) 43 and a communication bus 44, wherein the processor 41, the communication interface 42 and the memory 43 perform communication with each other through the communication bus 44. Processor 41 may invoke logic instructions in memory 43 to perform a packet statistics method comprising: acquiring a statistical request of an outgoing direction ACL of a message sent by receiving equipment, wherein the statistical request comprises a VNI field, and the VNI field characterizes a unique identifier of the receiving equipment; matching the VNI fields on the storage information of each structural body in the linked list, and taking the number of successful matching as the statistical number of the outgoing direction ACLs of the messages sent by the designated equipment;
the structure body storage information in the linked list comprises:
the method comprises the steps that an output direction ACL number of a matched VNI message issued by a sending device, an input direction ACL number of metadata generated by a chip of the sending device for the VNI message, the output direction ACL number of the metadata, the VNI to be matched with an ACL list item and a list tail mark are matched; the transmitting device is a device that transmits a message to the receiving device.
Further, the logic instructions in the memory 43 described above may be implemented in the form of software functional units and may be stored in a computer readable storage medium when sold or used as a stand alone product. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
In another aspect, the present invention also provides a computer program product, where the computer program product includes a computer program, where the computer program can be stored on a non-transitory computer readable storage medium, and when the computer program is executed by a processor, the computer can execute a packet statistics method provided by the above methods, and the method includes: acquiring a statistical request of an outgoing direction ACL of a message sent by receiving equipment, wherein the statistical request comprises a VNI field, and the VNI field characterizes a unique identifier of the receiving equipment; matching the VNI fields on the storage information of each structural body in the linked list, and taking the number of successful matching as the statistical number of the outgoing direction ACLs of the messages sent by the designated equipment;
the structure body storage information in the linked list comprises:
the method comprises the steps that an output direction ACL number of a matched VNI message issued by a sending device, an input direction ACL number of metadata generated by a chip of the sending device for the VNI message, the output direction ACL number of the metadata, the VNI to be matched with an ACL list item and a list tail mark are matched; the transmitting device is a device that transmits a message to the receiving device.
In yet another aspect, the present invention further provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, is implemented to perform the method of packet statistics provided by the above methods, the method comprising: acquiring a statistical request of an outgoing direction ACL of a message sent by receiving equipment, wherein the statistical request comprises a VNI field, and the VNI field characterizes a unique identifier of the receiving equipment; matching the VNI fields on the storage information of each structural body in the linked list, and taking the number of successful matching as the statistical number of the outgoing direction ACLs of the messages sent by the designated equipment;
the structure body storage information in the linked list comprises:
the method comprises the steps that an output direction ACL number of a matched VNI message issued by a sending device, an input direction ACL number of metadata generated by a chip of the sending device for the VNI message, the output direction ACL number of the metadata, the VNI to be matched with an ACL list item and a list tail mark are matched; the transmitting device is a device that transmits a message to the receiving device.
The apparatus embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
From the above description of the embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus necessary general hardware platforms, or of course may be implemented by means of hardware. Based on this understanding, the foregoing technical solution may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method described in the respective embodiments or some parts of the embodiments.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present invention, and are not limiting; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims (10)

1. A method for processing a message, comprising:
acquiring a statistical request of an outgoing direction ACL of a message sent by receiving equipment, wherein the statistical request comprises a VNI field, and the VNI field characterizes a unique identifier of the receiving equipment;
matching the VNI fields on the storage information of each structural body in the linked list, and taking the number of successful matching as the statistical number of the outgoing direction ACLs of the messages sent by the designated equipment;
wherein, structure body storage information in the linked list includes:
the method comprises the steps that an output direction ACL number of a matched VNI message issued by a sending device, an input direction ACL number of metadata generated by a chip of the sending device for the VNI message, the output direction ACL number of the metadata, the VNI to be matched with an ACL list item and a list tail mark are matched; the transmitting device is a device that transmits a message to the receiving device.
2. The message processing method according to claim 1, wherein the method further comprises:
acquiring an outgoing direction ACL number which is scheduled to be deleted by the sending equipment;
traversing the linked list, determining structural body storage information to be deleted in the linked list based on an exit direction ACL number to be deleted, deleting the ACL corresponding to the structural body storage information to be deleted, and deleting the structural body storage information to be deleted in the linked list;
if the structural body storage information to be deleted has the table tail identification, the table tail identification is added to the structural body storage information on the structural body storage information to be deleted based on the serial number of each structural body storage information in the linked list.
3. The message processing method according to claim 1 or 2, further comprising a processing step of constructing the linked list, including:
acquiring an ACL issued by the newly added transmitting equipment, determining the newly added ACL as an output direction ACL and matching a message VNI, and constructing structure storage information corresponding to the newly added ACL;
when the newly added ACL is determined to be the first ACL, the structure body storage information corresponding to the newly added ACL is used as the table head information of the linked list, and meanwhile, the table tail identification is added in the structure body storage information corresponding to the newly added ACL;
when it is determined that the newly added ACL is not the first ACL, the structure body storage information corresponding to the newly added ACL is placed at the tail of the existing linked list and used as the tail information of the linked list, and meanwhile, the tail identification is added in the structure body storage information corresponding to the newly added ACL.
4. A method according to claim 3, wherein said constructing structure storage information corresponding to a newly added ACL comprises:
recording a VNI, creating an access direction ACL for generating metadata aiming at the VNI message by a chip of the sending equipment, and recording an access direction ACL number for generating the metadata into the structural body storage information;
the chip of the transmitting device creates an outgoing direction ACL matching metadata, and records the outgoing direction ACL number matching metadata into the structure body storage information.
5. The method according to claim 4, wherein the table tail identifier is represented by a next_user_entry field, the next_user_entry field is set to 0, and the table tail information representing that the corresponding structure body storage information is a linked list.
6. A method according to claim 3, wherein deleting the ACL corresponding to the structure storage information to be deleted comprises:
acquiring an input direction ACL number of metadata generated for a VNI message and an output direction ACL number of matching metadata from the structure storage information to be deleted based on the output direction ACL number to be deleted;
based on the input direction ACL number of the metadata generated for the VNI message and the output direction ACL number of the matching metadata, deleting the input direction ACL corresponding to the input direction ACL number of the generated metadata and deleting the output direction ACL of the output direction ACL number of the matching metadata in the database;
accordingly, the method further comprises:
storing the deleted ACL in a cache, and storing the structural body storage information to be deleted in an auxiliary linked list as structural body storage information to be restored;
determining deleting time based on deleting time, restoring the deleted ACL to a database after receiving a restoring signal when the deleting time is smaller than a preset restoring time, and restoring the structural body storage information to the original position of the linked list based on the structural body storage information to be restored in the auxiliary linked list.
7. A message statistics apparatus, comprising:
the acquisition module is used for acquiring a statistical request of an outgoing direction ACL of a message sent by the receiving equipment, wherein the statistical request comprises a VNI field, and the VNI field characterizes a unique identifier of the receiving equipment;
the statistic module is used for matching the VNI field on the storage information of each structure body in the linked list, and taking the number of successful matching as the statistic number of the outgoing direction ACL of the message sent by the designated equipment;
wherein, structure body storage information in the linked list includes:
the method comprises the steps that an output direction ACL number of a matched VNI message issued by a sending device, an input direction ACL number of metadata generated by a chip of the sending device for the VNI message, the output direction ACL number of the metadata, the VNI to be matched with an ACL list item and a list tail mark are matched; the transmitting device is a device that transmits a message to the receiving device.
8. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the message statistics method of any of claims 1 to 6 when the program is executed by the processor.
9. A non-transitory computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when executed by a processor, implements the packet counting method according to any one of claims 1 to 6.
10. A computer program product comprising a computer program which, when executed by a processor, implements the message processing method according to any of claims 1 to 6.
CN202311629071.3A 2023-11-30 2023-11-30 Message statistics method and device, electronic equipment and storage medium Pending CN117880119A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311629071.3A CN117880119A (en) 2023-11-30 2023-11-30 Message statistics method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311629071.3A CN117880119A (en) 2023-11-30 2023-11-30 Message statistics method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117880119A true CN117880119A (en) 2024-04-12

Family

ID=90585406

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311629071.3A Pending CN117880119A (en) 2023-11-30 2023-11-30 Message statistics method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117880119A (en)

Similar Documents

Publication Publication Date Title
JP4509916B2 (en) SNMP-based network management apparatus and method
JP4453983B2 (en) Query sending method and query sending system to database
CN107911249B (en) Method, device and equipment for sending command line of network equipment
US8589353B2 (en) Method for backing up terminal data and system thereof
CN109714239B (en) Management message issuing method, VNFM (virtual network management frequency) equipment and server
CN110502487B (en) Cache management method and device
CN110351111A (en) A kind of subscription processing method, network node and customer data base
CN109327557A (en) A kind of management method and device of virtual machine IP address
CN111314450B (en) Data transmission method and device, electronic equipment and computer storage medium
CN112367211B (en) Method, device and storage medium for generating configuration template by device command line
CN103546380A (en) Message forwarding method and device based on strategy routing
CN106294151A (en) Daily record method of testing and device
CN103888424B (en) Concentrating type data encryption system and its data processing method
CN113704790A (en) Abnormal log information summarizing method and computer equipment
US10440523B2 (en) Communication control device, communication device, and computer program product for managing a group of devices
CN101582881B (en) Method and device for controlling access
CN107094085B (en) Signaling transmission method and device
CN109714208A (en) A kind of equipment is included in method, storage medium and the electronic equipment of network management
US10693731B2 (en) Flow entry management method and device
CN106557530B (en) Operation system, data recovery method and device
CN117880119A (en) Message statistics method and device, electronic equipment and storage medium
CN115150829B (en) Network access authority management method and device
KR101202237B1 (en) Method and terminal device for erasing data of terminal
CN109922316A (en) Media resource scheduling and managing medium resource method, apparatus and electronic equipment
CN108667644A (en) Configure the method and forwarding unit of ACL business

Legal Events

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