Message copying method and device, electronic equipment and readable storage medium

Message replication is performed through a linked list structure, which solves the problem of excessive storage space usage when the number of VSIs is large, and achieves efficient message replication and port management.

CN118869641APending Publication Date: 2024-10-29XEL TECH INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410964228.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-18
Publication Date
2024-10-29

AI Technical Summary

Technical Problem

When the number of VSIs is large, existing message replication methods use bitmaps to store the VSI replication status, which results in excessive storage space usage and inconvenient management.

Method used

By obtaining the key fields of the message to be processed, determining its corresponding target linked list, and using the linked list structure to copy the message, the bitmap storage of the port copy status is avoided, thereby reducing the storage space occupied and simplifying the management of the target port. .

Benefits of technology

It effectively reduces the storage space occupied during packet copying and improves the management efficiency of target ports. It avoids waste of storage space and management complexity especially when there are a large number of VSIs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118869641A_ABST
    Figure CN118869641A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of network communication, and discloses a message copying method and device, electronic equipment and a readable storage medium, and the method comprises the steps: obtaining a to-be-processed message, and determining a key field corresponding to the to-be-processed message; determining at least one target linked list corresponding to the to-be-processed message in the at least one message copy linked list based on the key field; wherein the target linked list comprises at least one target list item and target list item information corresponding to each target list item, and the target list item information comprises a target port; and copying the to-be-processed message to a target port corresponding to each target table item in each target linked list based on each target linked list. According to the method and the device, the storage space required to be occupied for storing the target port can be reduced, and the management of the target port can be facilitated to a great extent.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of network communication technology, and in particular to a message replication method, device, electronic device and readable storage medium. Background Art

[0002] With the development of network card virtual switching technology, the application of message replication is becoming more and more abundant. Among them, message replication includes multicast replication, broadcast replication, mixed unicast replication and mixed multicast replication. When performing message replication, the message header corresponding to the message is usually parsed and the relevant fields are extracted. Then, the relevant fields are searched in the lookup table and the corresponding bitmap is obtained. The bitmap is used to indicate whether the virtual station interface (VSI) receives the message. In the bitmap, each bit corresponds to a VSI, and each bit is used to indicate whether the corresponding VSI receives the message (for example, 0 indicates that the corresponding VSI does not receive the message, and 1 indicates that the corresponding VSI receives the message). Finally, the message is copied to the VSI based on the obtained VSI bitmap.

[0003] However, when the number of VSIs is large, using a bitmap to store the VSI replication status may cause the problem of excessive storage space usage. Therefore, the existing message replication method needs further improvement. Summary of the invention

[0004] The embodiments of the present application provide a message replication method, device, electronic device and readable storage medium, which can reduce the storage space required for storing message replication ports and facilitate the management of message replication ports. Specifically, the embodiments of the present application disclose the following technical solutions: A first aspect of an embodiment of the present application provides a message replication method, the method comprising: obtaining a message to be processed, and determining a key field corresponding to the message to be processed; based on the key field, determining at least one target linked list corresponding to the message to be processed in at least one message replication linked list; wherein the target linked list comprises at least one target table entry and target table entry information corresponding to each of the target table entries, and the target table entry information comprises a target port; based on each of the target linked lists, copying the message to be processed to a target port corresponding to each of the target table entries in the target linked lists.

[0005] In some embodiments, based on the key field, determining at least one target linked list corresponding to the message to be processed in at least one message copy linked list includes: determining the message description information corresponding to the message to be processed based on the key field; based on the message description information, determining at least one target header pointer corresponding to the message description information in a lookup table; wherein the lookup table includes multiple description information to be matched and at least one linked list header pointer corresponding to each of the description information to be matched; based on the at least one target header pointer, determining the at least one target linked list in the at least one message copy linked list.

[0006] In some embodiments, based on the message description information, determining in a lookup table at least one target header pointer corresponding to the message description information includes: determining, based on the multiple description information to be matched in the lookup table, matching description information that matches the message description information among the multiple description information to be matched; determining, based on the at least one linked list header pointer corresponding to each of the description information to be matched, at least one matching head pointer corresponding to the matching description information, and determining the at least one matching head pointer as the at least one target header pointer.

[0007] In some embodiments, the target table entry information also includes a target table entry pointer and a target flag bit. Based on each of the target linked lists, the message to be processed is copied to the target port corresponding to each of the target table entries in the target linked lists, including: traversing the at least one target table entry in the first linked list, and copying the message to be processed to the first port corresponding to the first table entry currently traversed; wherein the target linked list includes the first linked list, the at least one target table entry in the target linked list includes the first table entry, and the target port includes the first port; when the value of the first flag bit corresponding to the first table entry is the first value, determine the second table entry pointed to by the first table entry pointer corresponding to the first table entry, and copy the message to be processed to the second port corresponding to the second table entry; wherein the at least one target table entry in the target linked list includes the second table entry, the target flag bit includes the first flag bit, the target table entry pointer includes the first table entry pointer, and the target port includes the second port.

[0008] In some embodiments, the method further includes: when the value of the first flag bit corresponding to the first entry is a second value, ending the traversal of the at least one target entry in the first linked list.

[0009] In some embodiments, based on each of the above-mentioned target linked lists, the above-mentioned message to be processed is copied to the target port corresponding to each of the above-mentioned target table items in each of the above-mentioned target linked lists, including: traversing the above-mentioned at least one target table item in the first linked list, and copying the above-mentioned message to be processed to the target port corresponding to each of the above-mentioned target table items in the above-mentioned first linked list; wherein the above-mentioned target linked list includes the above-mentioned first linked list; determining whether there is an untraversed second linked list in the above-mentioned target linked list; if the above-mentioned second linked list exists, traversing the above-mentioned at least one target table item in the above-mentioned second linked list, and copying the above-mentioned message to be processed to the target port corresponding to each of the above-mentioned target table items in the above-mentioned second linked list; if the above-mentioned second linked list does not exist, ending the copying of the above-mentioned message to be processed.

[0010] In some embodiments, the method further includes: if the at least one target linked list corresponding to the message to be processed is not determined in the at least one message copy linked list, then the message to be processed is not copied.

[0011] A second aspect of an embodiment of the present application provides a message replication device, comprising: a first determination module, configured to obtain a message to be processed and determine a key field corresponding to the message to be processed; a second determination module, configured to determine at least one target linked list corresponding to the message to be processed in at least one message replication linked list based on the key field; wherein the target linked list comprises at least one target table entry and target table entry information corresponding to each of the target table entries, and the target table entry information comprises a target port; the message replication module, configured to copy the message to be processed to the target port corresponding to each of the target table entries in the target linked list based on each of the target linked lists.

[0012] A third aspect of an embodiment of the present application provides an electronic device, comprising: a processor and a memory, the memory being used to store computer executable instructions; the processor being used to read the instructions from the memory and execute the instructions to implement the message copying method described in the first aspect.

[0013] A fourth aspect of an embodiment of the present application provides a computer-readable storage medium, wherein the storage medium stores computer program instructions. When a computer reads the instructions, the message copying method described in the first aspect is executed.

[0014] A fifth aspect of an embodiment of the present application provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer executes the message replication method described in the first aspect above.

[0015] The message replication method provided in the embodiment of the present application can obtain the message to be processed and determine the key field corresponding to the message to be processed. Then, based on the key field, at least one target linked list corresponding to the message to be processed is determined in at least one message replication linked list; wherein the target linked list includes at least one target table item and target table item information corresponding to each target table item, and the target table item information includes a target port. Afterwards, based on each target linked list, the message to be processed is copied to the target port corresponding to each target table item in each target linked list. The present application does not need to store the replication status of the port through a bitmap, thereby reducing the storage space required for copying the message, and can greatly facilitate the management of the target port. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0017] Figure 1 A flowchart of a message duplication method provided in some embodiments of the present application; Figure 2A A schematic diagram of the structure of a message replication linked list provided in some embodiments of the present application; Figure 2B A schematic diagram of the structure of a message copy table entry provided in some embodiments of the present application; Figure 3 A flowchart of another message duplication method provided in some embodiments of the present application; Figure 4 A flowchart of another message duplication method provided in some embodiments of the present application; Figure 5 A schematic diagram of a target linked list provided for some embodiments of the present application; Figure 6 A flowchart of another message duplication method provided in some embodiments of the present application; Figure 7 A schematic diagram of a message copying device provided in some embodiments of the present application; Figure 8 A schematic diagram of an electronic device according to some embodiments of the present application. DETAILED DESCRIPTION

[0018] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present invention and to make the above-mentioned purposes, features and advantages of the embodiments of the present invention more obvious and understandable, the technical solutions in the embodiments of the present invention are further described in detail below with reference to the accompanying drawings.

[0019] The message replication method provided by the present application is described in detail below in conjunction with the accompanying drawings.

[0020] Figure 1 A flowchart of a message duplication method provided in some embodiments of the present application. Figure 1 As shown, the message replication method may include steps 110 to 130.

[0021] Step 110, obtaining a message to be processed, and determining a key field corresponding to the message to be processed.

[0022] In some embodiments, a network device may receive a network message and process the network message (hereinafter referred to as a message to be processed). The network device may include a network processor (NPU), a switch, a router, a server network card (NIC), etc. The specific type of the network device is not limited in the embodiments of the present application.

[0023] After obtaining the message to be processed, the network device can parse the message header corresponding to the message to be processed and extract the key fields in the message header. Among them, the key fields in the message header may include the source MAC address (Source Media Access Control Address, SMAC), the destination MAC address (Destination Media Access Control Address, DMAC), the virtual local area network (Virtual Local Area Network, VLAN), etc. The specific content of the key fields is not limited in the embodiments of the present application.

[0024] Step 120: Based on the key field, determine at least one target linked list corresponding to the message to be processed in at least one message copy linked list.

[0025] In some embodiments, one or more message replication linked lists (hereinafter referred to as linked lists) may be pre-established in the network device, and one or more message replication table entries (hereinafter referred to as table entries) may be established in each linked list. In other words, one or more table entries may be stored in the form of linked lists.

[0026] refer to Figure 2A A schematic diagram of the structure of a message replication linked list shown in FIG. Figure 2B A schematic diagram of the structure of a message duplication table entry is shown in FIG. Figure 2AAs shown, linked list A, linked list B ... linked list E are multiple message replication linked lists, each of which contains multiple entries, such as entry 1, entry 2, entry 3 ... entry 100 in linked list A. Figure 2B As shown, each table entry may include table entry information such as a packet replication port VSI (hereinafter referred to as VSI port), a table entry pointer (next_ptr), and a flag bit (last flag).

[0027] The VSI port is used to indicate to which VSI port the network device copies the message to be processed. If the value of the VSI port is 1, it means that the message to be processed is copied to VSI port 1.

[0028] The entry pointer is a pointer pointing to the next entry, and is used to indicate the next entry to be traversed when traversing the entries in the linked list.

[0029] Among them, the flag bit is used to indicate whether each table item in the linked list is the last table item, and is used to indicate whether to continue to traverse the next table item when traversing the table items in the linked list. For example, the value of the flag bit can be 0 or 1; when the value of the flag bit in the table item is 0, it indicates that the table item is not the last table item in the linked list, and instructs the network device to continue to traverse the next table item pointed to by the table item pointer; when the value of the flag bit in the table item is 1, it indicates that the table item is the last table item in the linked list, and instructs the network device to stop traversing the table items in the linked list.

[0030] In some embodiments, after determining the key field corresponding to the message to be processed, the network device may determine at least one target linked list corresponding to the message to be processed in at least one linked list based on the key field. For example, at least one target linked list may include Figure 2A The linked lists A, B, and C are shown.

[0031] Figure 3 A flowchart of another message duplication method provided in some embodiments of the present application. Figure 3 As shown, the above step 120 may include steps 310 to 330 .

[0032] Step 310: Determine the message description information corresponding to the message to be processed based on the key field.

[0033] In some embodiments, when determining at least one target linked list corresponding to a message to be processed, the network device may first determine the message description information (or called message descriptor, data packet descriptor, etc., Packet Descriptor, PD) corresponding to the message to be processed based on the key fields extracted above.

[0034] Exemplarily, if the key fields corresponding to the extracted message to be processed include: SMAC is 00:11:22:33:44:55, DMAC is 66:77:88:99:AA:BB, and VLAN is 10, then the message description information PD can be: {SMAC:"00:11:22:33:44:55",DMAC:"66:77:88:99:AA:BB",VLAN:10}.

[0035] Step 320: Based on the message description information, determine at least one target header pointer corresponding to the message description information in a lookup table.

[0036] In some embodiments, in addition to pre-establishing the above one or more linked lists in the network device, a lookup table of the mapping relationship between each linked list and the description information to be matched can also be pre-established. For example, a lookup table of the mapping relationship between the linked list head pointer corresponding to each linked list and the description information to be matched can be established. In the lookup table, each description information to be matched can correspond to one or more linked list head pointers, and each linked list head pointer can also correspond to one or more description information to be matched.

[0037] The lookup table may be a data structure such as a hash table that can store mapping relationships between data. The specific type of the lookup table is not limited in the embodiments of the present application.

[0038] For example, a lookup table of the mapping relationship between the link list head pointers corresponding to each link list and the description information to be matched may refer to Table 1: Table 1

[0039] As shown in Table 1, the lookup table may include multiple description information to be matched and at least one linked list head pointer corresponding to each description information to be matched. For example, description information to be matched A corresponds to linked list head pointer A, description information to be matched B corresponds to linked list head pointer B and linked list head pointer C, and description information to be matched C corresponds to linked list head pointer A, linked list head pointer D, and linked list head pointer E.

[0040] In some embodiments, the above step 320 may include: based on multiple description information to be matched in the lookup table, determining the matching description information that matches the message description information among the multiple description information to be matched; based on at least one linked list head pointer corresponding to each description information to be matched, determining at least one matching head pointer corresponding to the matching description information, and determining at least one matching head pointer as at least one target head pointer.

[0041] Exemplarily, the network device may search for matching description information that matches the message description information in a plurality of description information to be matched in a lookup table based on the message description information corresponding to the message to be processed. Based on the mapping relationship between each description information to be matched in the lookup table and at least one linked list head pointer, at least one matching head pointer corresponding to the matching description information is determined, and the at least one matching head pointer is determined as at least one target head pointer.

[0042] The message description information matches the matching description information in that: each key field in the message description information is identical to the corresponding key field in the matching description information.

[0043] In some examples, the lookup table shown in Table 1 is taken as an example. If the message description information corresponding to the message to be processed matches the description information to be matched B in the lookup table, the matching head pointer B corresponding to the matching description information B can be determined as the target head pointer B corresponding to the message to be processed, and the matching head pointer C corresponding to the matching description information B can be determined as the target head pointer C corresponding to the message to be processed.

[0044] In some embodiments, if the description information to be matched that matches the message description information corresponding to the message to be processed is not found in the lookup table, it means that the network device does not need to copy the message to be processed.

[0045] Step 330: Determine at least one target linked list in at least one message copy linked list based on at least one target head pointer.

[0046] In some embodiments, after determining at least one target header pointer corresponding to the message to be processed, each target linked list corresponding to each target header pointer may be determined in at least one message replication linked list.

[0047] In some examples, the lookup table shown in Table 1 is taken as an example. Figure 2A As shown, if the target header pointers corresponding to the to-be-processed message are target header pointer B and target header pointer C, the linked list B pointed to by the target header pointer B can be determined as the target linked list B, and the linked list C pointed to by the target header pointer C can be determined as the target linked list C.

[0048] Step 130: Based on each target linked list, the message to be processed is copied to the target port corresponding to each target table entry in each target linked list.

[0049] In some embodiments, after determining at least one target linked list, the network device may copy the message to be processed to the target port corresponding to each target table entry in each target linked list, thereby completing the copying of the message to be copied. Figure 2AAs shown, taking at least one target linked list as target linked list B and target linked list C as an example, the network device can copy the message to be copied to the target port corresponding to each target table entry in target linked list B (such as target table entry 1, target table entry 2...target table entry 200), and copy the message to be copied to the target port corresponding to each target table entry in target linked list C (such as target table entry 1, target table entry 2...target table entry 500).

[0050] The following is an exemplary description of the specific process of copying the to-be-processed message to the target port corresponding to each target table entry in each target linked list.

[0051] Figure 4 A flowchart of another message duplication method provided in some embodiments of the present application. Figure 4 As shown, the above step 130 may include steps 410 to 420 / 420'.

[0052] Step 410: traverse at least one target entry in the first linked list, and copy the message to be processed to the first port corresponding to the first entry currently traversed.

[0053] In some embodiments, the network device may first traverse at least one target table item in any linked list (such as the first linked list) in the target linked list from beginning to end. During the traversal process, the message to be processed is first copied to the first port corresponding to the first table item currently traversed. Among them, at least one target table item in the target linked list includes the first table item, and the target port includes the first port.

[0054] refer to Figure 5 A schematic diagram of a target linked list is shown in FIG. Figure 5 As shown, taking link list B as the first link list in the target link list as an example, the first link list B includes multiple target table items (such as target table item 1, target table item 2...target table item 200). The network device traverses the multiple target table items in the first link list B from target table item 1 to target table item 200 in sequence. If the first table item currently traversed is the first table item 1, the message to be processed is copied to the VSI port (such as VSI 1) corresponding to the first table item 1.

[0055] Step 420, when the value of the first flag bit corresponding to the first entry is the first value, determine the second entry pointed to by the first entry pointer corresponding to the first entry, and copy the message to be processed to the second port corresponding to the second entry.

[0056] In some embodiments, after the network device copies the message to be processed to the first port corresponding to the first table entry, it can determine whether it is necessary to continue traversing the next table entry according to the value of the first flag bit corresponding to the first table entry. The value of the first flag bit can be the first value or the second value, and the value of the first value is different from the value of the second value. In this embodiment, the specific values ​​of the first value and the second value are not limited.

[0057] Among them, the first value is used to indicate that the target table entry is not the last table entry of the linked list, and is used to instruct the network device to continue traversing the next table entry pointed to by the table entry pointer; the second value is used to indicate that the target table entry is the last table entry of the linked list, and is used to instruct the network device to stop traversing the table entries in the linked list.

[0058] In some embodiments, when the value of the first flag bit corresponding to the first table item is the first value, the network device can determine the second table item pointed to by the first table item pointer corresponding to the first table item, and copy the message to be processed to the second port corresponding to the second table item. Among them, at least one target table item in the target linked list includes the second table item, the target flag bit includes the first flag bit, the target table item pointer includes the first table item pointer, and the target port includes the second port. The value of the first value can be 0 or other possible values, which is not limited in this embodiment.

[0059] like Figure 5 As shown, the above embodiment is used. For example, after the network device copies the message to be processed to the VSI 1 port corresponding to the first table entry 1, the value of the first flag bit corresponding to the first table entry 1 can be determined first. When the value of the first flag bit is the first value (such as the first flag bit is 0), the target table entry pointed to by the first table entry pointer corresponding to the first table entry 1 is determined. When the target table entry pointed to by the first table entry pointer is the second table entry 2, the network device continues to traverse the second table entry 2 and copies the message to be processed to the second port (such as VSI 2) corresponding to the second table entry 2.

[0060] For another example, after the network device copies the message to be processed to the VSI 2 port corresponding to the first table entry 2, the value of the first flag bit corresponding to the first table entry 2 can be determined first. When the value of the first flag bit is the first value (such as the first flag bit is 0), the target table entry pointed to by the first table entry pointer corresponding to the first table entry 2 is determined. When the target table entry pointed to by the first table entry pointer is the second table entry 3, the network device continues to traverse the second table entry 3 and copies the message to be processed to the second port corresponding to the second table entry 3 (such as VSI 3).

[0061] Step 420', when the value of the first flag bit corresponding to the first entry is the second value, end the traversal of at least one target entry in the first linked list.

[0062] In some embodiments, when the value of the first flag bit corresponding to the first table item is the second value, it indicates that the traversal of each target table item in the first linked list has been completed, so that the network device can stop traversing the target linked list in the first linked list. The value of the second value can be 1 or other possible values, which is not limited in this embodiment.

[0063] like Figure 5 As shown, following the above embodiment, if the first table item currently traversed is the first table item 200, the network device may first determine the value of the first flag bit corresponding to the first table item 200 after copying the message to be processed to the VSI 200 port corresponding to the first table item 200. When the value of the first flag bit is the second value (such as the first flag bit is 1), it indicates that the first table item 200 is the last table item of the first linked list B, that is, it indicates that the network device has completed traversing each target table item in the first linked list B, and the network device may stop traversing the target linked list in the first linked list B.

[0064] Figure 6 A flowchart of another message duplication method provided in some embodiments of the present application. Figure 6 As shown, the above step 130 may include steps 610 to 630 / 630'.

[0065] Step 610: traverse at least one target entry in the first linked list, and copy the message to be processed to the target port corresponding to each target entry in the first linked list.

[0066] In some embodiments, the implementation manner in which the network device copies the to-be-processed message to the target port corresponding to each target table entry in the first linked list can refer to the relevant descriptions of steps 410 to 420 / 420', which will not be repeated here.

[0067] Step 620, determine whether there is an untraversed second linked list in the target linked list.

[0068] In some embodiments, after the network device finishes traversing the first linked list in the target linked list, it is necessary to determine whether there is a second linked list in the target linked list that has not been traversed. For example, if the target linked list includes a target linked list B and a target linked list C, after the network device finishes traversing the first linked list B, there is still a second linked list C in the target linked list that has not been traversed.

[0069] Exemplarily, the network device may determine whether there is an untraversed second linked list in the target linked list by storing at least one target head pointer corresponding to the determined message to be processed in the head pointer list. The network device takes out any target head pointer from the head pointer list (the target head pointer is removed from the head pointer list after being taken out), and traverses the target linked list (such as the first linked list) corresponding to the target head pointer. After the traversal of the first linked list is completed, it is determined whether there are other target head pointers in the head pointer list. If there are other target head pointers, it means that there is an untraversed second linked list; if there are no other target head pointers, it means that the traversal of all target linked lists has been completed.

[0070] It should be noted that the above method of determining whether there is an untraversed second linked list in the target linked list is only an example and is not limited to this in the embodiments of the present application.

[0071] Step 630: If the second linked list exists, at least one target entry in the second linked list is traversed, and the message to be processed is copied to the target port corresponding to each target entry in the second linked list.

[0072] In some embodiments, if there is a second linked list, the network device may traverse at least one target entry in the second linked list, and copy the message to be processed to the target port corresponding to each target entry in the second linked list. The method of copying the message to be processed to the target port corresponding to each target entry in the second linked list can refer to the relevant description of steps 410 to 420 / 420', which will not be repeated here.

[0073] Step 630': if the second linked list does not exist, then the copying of the message to be processed is terminated.

[0074] In some embodiments, if the second linked list does not exist, it means that the network device has completed the traversal of all target linked lists, and the copying of the message to be processed can be ended at this time.

[0075] By applying the message replication method provided by the present application, the VSI ports can be stored and managed in the form of linked lists and table entries, which can reduce the space resources required for storing VSI ports, so that even when the number of VSI ports is large, storage space will not be wasted; and when it is necessary to add or delete a VSI port, it is only necessary to insert and delete table entries in the linked list by modifying the table entry pointer, without reallocating and adjusting the VSI bitmap, thereby improving the convenience and efficiency of managing the VSI port. In addition, when different to-be-processed messages correspond to the same VSI port, these to-be-processed messages can share the same linked list resources without the need to establish a corresponding VSI bitmap for each to-be-processed message, thereby further reducing the space resources required for storing the VSI port.

[0076] Figure 7 A schematic diagram of a message copying device provided in some embodiments of the present application. Figure 7 As shown, the message copying device 700 includes a first determining module 710 , a second determining module 720 and a message copying module 730 .

[0077] The first determination module 710 is configured to obtain a message to be processed and determine a key field corresponding to the message to be processed.

[0078] The second determination module 720 is configured to determine at least one target linked list corresponding to the to-be-processed message in at least one message copy linked list based on the key field.

[0079] The target linked list includes at least one target table entry and target table entry information corresponding to each target table entry, and the target table entry information includes a target port.

[0080] The message copy module 730 is configured to copy the message to be processed to the target port corresponding to each target table entry in each target linked list based on each target linked list.

[0081] In some embodiments, the second determination module 720 is specifically configured to: determine the message description information corresponding to the message to be processed based on the key field; based on the message description information, determine at least one target header pointer corresponding to the message description information in the lookup table; wherein the lookup table includes multiple description information to be matched and at least one linked list header pointer corresponding to each description information to be matched; based on at least one target header pointer, determine at least one target linked list in at least one message copy linked list.

[0082] In some embodiments, the second determination module 720 is specifically configured to: determine the matching description information that matches the message description information among the multiple description information to be matched based on the multiple description information to be matched in the lookup table; determine at least one matching head pointer corresponding to the matching description information based on at least one linked list head pointer corresponding to each description information to be matched, and determine the at least one matching head pointer as at least one target head pointer.

[0083] In some embodiments, the target table entry information also includes a target table entry pointer and a target flag bit, and the message copy module 730 is specifically configured to: traverse at least one target table entry in the first linked list, and copy the message to be processed to the first port corresponding to the first table entry currently traversed; wherein, the target linked list includes the first linked list, and at least one target table entry in the target linked list includes the first table entry, and the target port includes the first port; when the value of the first flag bit corresponding to the first table entry is the first value, determine the second table entry pointed to by the first table entry pointer corresponding to the first table entry, and copy the message to be processed to the second port corresponding to the second table entry; wherein, at least one target table entry in the target linked list includes the second table entry, the target flag bit includes the first flag bit, the target table entry pointer includes the first table entry pointer, and the target port includes the second port.

[0084] In some embodiments, the message copy module 730 is further configured to: when the value of the first flag bit corresponding to the first entry is the second value, end the traversal of at least one target entry in the first linked list.

[0085] In some embodiments, the message copy module 730 is specifically configured to: traverse at least one target table item in the first linked list, and copy the message to be processed to the target port corresponding to each target table item in the first linked list; wherein the target linked list includes the first linked list; determine whether there is a second linked list that has not been traversed in the target linked list; if there is a second linked list, traverse at least one target table item in the second linked list, and copy the message to be processed to the target port corresponding to each target table item in the second linked list; if there is no second linked list, end the copying of the message to be processed.

[0086] In some embodiments, the message copy module 730 is further configured to: if at least one target linked list corresponding to the message to be processed is not determined in at least one message copy linked list, then the message to be processed is not copied.

[0087] Figure 8 A schematic diagram of an electronic device provided for some embodiments of the present application. In some embodiments, the electronic device includes one or more processors and a memory. The memory is configured to store one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the message replication method in the above embodiment.

[0088] like Figure 8 As shown, the electronic device 800 includes: a processor (processor) 801 and a memory 802. Exemplarily, the electronic device 800 may also include: a communication interface (Communications Interface) 803 and a communication bus 804.

[0089] The processor 801, the memory 802 and the communication interface 803 communicate with each other via a communication bus 804. The communication interface 803 is used to communicate with other devices such as a client or a network element of another server.

[0090] In some embodiments, the processor 801 is used to execute the program 805, and specifically can execute the relevant steps in the above-mentioned message replication method embodiment. Specifically, the program 805 can include program code, and the program code includes computer executable instructions.

[0091] Exemplarily, the processor 801 may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement some embodiments of the present application. The electronic device 800 may include one or more processors, which may be processors of the same type, such as one or more CPUs; or processors of different types, such as one or more CPUs and one or more ASICs.

[0092] In some embodiments, the memory 802 is used to store the program 805. The memory 802 may include a high-speed RAM memory, and may also include a non-volatile memory (NVM), such as at least one disk memory.

[0093] Program 805 can be specifically called by processor 801 to enable electronic device 800 to execute the message copying method operation.

[0094] Some embodiments of the present application provide a computer-readable storage medium, which stores at least one executable instruction. When the executable instruction is executed on the electronic device 800, the electronic device 800 executes the message copying method in the above embodiment.

[0095] The executable instructions can be specifically used to enable the electronic device 800 to perform the message copying method operation.

[0096] For example, the computer readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a compact disc (CD-ROM), a magnetic tape, a floppy disk, an optical data storage device, etc.

[0097] The beneficial effects that can be achieved by the readable storage medium provided in some embodiments of the present application can be referred to the beneficial effects in the corresponding message copying method provided above, and will not be repeated here.

[0098] It should be noted that, in the application, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "including a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0099] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0100] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, which can be embodied in any computer-readable medium for use by an instruction execution system, apparatus or device (such as a computer-based system, a system including a processor or other system that can fetch instructions from an instruction execution system, apparatus or device and execute instructions), or used in combination with these instruction execution systems, apparatuses or devices.

[0101] For the purposes of this specification, a "computer-readable medium" can be any apparatus that can contain, store, communicate, propagate, or transport the program for use by an instruction execution system, apparatus, or device or in conjunction with such instruction execution system, apparatus, or device.

[0102] More specific examples (a non-exhaustive list) of computer readable media include the following: an electrical connection having one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM).

[0103] In addition, the computer readable medium can even be a paper or other suitable medium on which the program can be printed, because the program can be obtained electronically, for example, by optically scanning the paper or other medium, and then editing, interpreting or processing in other suitable ways as necessary, and then storing it in the computer memory. It should be understood that various parts of the present application can be implemented in hardware, software, firmware or a combination thereof.

[0104] In the above embodiments, multiple steps or methods may be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it may be implemented by any one of the following technologies known in the art or a combination thereof: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0105] The above-described embodiments of the present application do not constitute a limitation on the protection scope of the present application.

Claims

1. A message duplication method, characterized in that: include: Obtaining a message to be processed, and determining a key field corresponding to the message to be processed; Based on the key field, determining at least one target linked list corresponding to the to-be-processed message in at least one message replication linked list; wherein the target linked list includes at least one target table entry and target table entry information corresponding to each of the target table entries, and the target table entry information includes a target port; Based on each of the target linked lists, the to-be-processed message is copied to the target port corresponding to each of the target table entries in each of the target linked lists.

2. The method according to claim 1, characterized in that The determining, based on the key field, at least one target linked list corresponding to the to-be-processed message in at least one message copy linked list comprises: Determine the message description information corresponding to the message to be processed based on the key field; Based on the message description information, determining at least one target header pointer corresponding to the message description information in a lookup table; wherein the lookup table includes a plurality of description information to be matched and at least one linked list header pointer corresponding to each of the description information to be matched; Based on the at least one target head pointer, the at least one target linked list is determined in the at least one message copy linked list.

3. The method according to claim 2, characterized in that The determining, based on the message description information, in a lookup table, at least one target header pointer corresponding to the message description information comprises: Based on the multiple description information to be matched in the lookup table, determining matching description information that matches the message description information among the multiple description information to be matched; Based on the at least one linked list head pointer corresponding to each of the description information to be matched, at least one matching head pointer corresponding to the matching description information is determined, and the at least one matching head pointer is determined as the at least one target head pointer.

4. The method according to any one of claims 1 to 3, characterized in that The target table entry information also includes a target table entry pointer and a target flag bit. Based on each of the target linked lists, copying the to-be-processed message to the target port corresponding to each of the target table entries in each of the target linked lists includes: Traversing the at least one target table entry in the first linked list, and copying the to-be-processed message to the first port corresponding to the first table entry currently traversed; wherein the target linked list includes the first linked list, the at least one target table entry in the target linked list includes the first table entry, and the target port includes the first port; When the value of the first flag bit corresponding to the first table entry is a first value, determine the second table entry pointed to by the first table entry pointer corresponding to the first table entry, and copy the message to be processed to the second port corresponding to the second table entry; wherein, the at least one target table entry in the target linked list includes the second table entry, the target flag bit includes the first flag bit, the target table entry pointer includes the first table entry pointer, and the target port includes the second port.

5. The method according to claim 4, characterized in that The method further comprises: When the value of the first flag bit corresponding to the first table entry is the second value, the traversal of the at least one target table entry in the first linked list is terminated.

6. The method according to any one of claims 1 to 3, characterized in that The step of copying the to-be-processed message to the target port corresponding to each target entry in each target linked list based on each target linked list includes: Traversing the at least one target table entry in the first linked list, and copying the to-be-processed message to the target port corresponding to each target table entry in the first linked list; wherein the target linked list includes the first linked list; Determine whether there is a second linked list that has not been traversed in the target linked list; If the second linked list exists, traverse the at least one target table entry in the second linked list, and copy the to-be-processed message to the target port corresponding to each target table entry in the second linked list; If the second linked list does not exist, the copying of the to-be-processed message ends.

7. The method according to any one of claims 1 to 3, characterized in that The method further comprises: If the at least one target linked list corresponding to the message to be processed is not determined in the at least one message copy linked list, the message to be processed is not copied.

8. A message copying device, characterized in that: include: A first determination module is configured to obtain a message to be processed and determine a key field corresponding to the message to be processed; A second determination module is configured to determine, based on the key field, at least one target linked list corresponding to the to-be-processed message in at least one message replication linked list; wherein the target linked list includes at least one target table entry and target table entry information corresponding to each of the target table entries, and the target table entry information includes a target port; The message copying module is configured to copy the to-be-processed message to the target port corresponding to each target table entry in each target linked list based on each target linked list.

9. An electronic device, characterized in that: include: one or more processors; and A memory configured to: store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the message replication method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a processor, the message replication method according to any one of claims 1 to 7 is implemented.