Business table configuration method, device, network equipment and storage medium
By writing write table data to the cache queue in the network device and processing it by asynchronous threads, the problem of low efficiency in the generation of business tables in the existing technology is solved, and efficient business table configuration and communication efficiency are achieved.
Patent Information
- Application Number
- CN201911305153.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-12-17
- Publication Date
- 2025-04-11
- Estimated Expiration
- 2039-12-17
AI Technical Summary
In the prior art, the generation efficiency of service tables is low, which cannot meet the processing capabilities of network chips, resulting in a decrease in communication efficiency.
By writing write table data to the cache queue, and reading data from the cache queue by asynchronous threads, writing to memory through the chip bus, the separation of write operations and read operations is achieved, allowing different chip buses to work in parallel.
The configuration efficiency of service tables is improved, so that the configuration operations of service tables in each memory can be carried out simultaneously, significantly improving the processing capability and communication efficiency of network equipment.
Smart Images

Figure CN112995261B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a method, device, network equipment and storage medium for configuring a service table. Background Art
[0002] With the rapid growth of network traffic and the frequent emergence of new network services, network equipment is required to have faster and more flexible processing capabilities, which puts higher requirements on the performance of network equipment.
[0003] During the operation of network equipment, the control layer software will frequently interact with the network chip and write various service tables into the memory. In the prior art, various service tables in the memory are generated by receiving the service data transmitted by the upper platform through the forwarding table management unit (FTM), and then transmitting it to the forwarding chip management unit (FCM), and then writing it into the memory through the forwarding chip management unit.
[0004] In the process of implementing this application, the inventors found that the prior art has the following defects: the existing method of generating business tables has low generation efficiency. When interacting with the network chip, the generation speed of the business table cannot meet the processing capacity of the network chip, resulting in a significant reduction in the communication efficiency of the entire network. Summary of the invention
[0005] Embodiments of the present application provide a method, apparatus, device, and storage medium for configuring a business table to improve the configuration efficiency of the business table.
[0006] In a first aspect, an embodiment of the present application provides a method for configuring a service table, including:
[0007] After converting the acquired target data into a format, table writing data is obtained, and the table writing data is written into a cache queue;
[0008] The table writing data is read from the cache queue through an asynchronous thread, and written into a memory through a chip bus.
[0009] In a second aspect, an embodiment of the present application provides a device for configuring a service table, including:
[0010] A table writing data acquisition module is used to convert the acquired target data into a format to obtain table writing data, and write the table writing data into a cache queue;
[0011] The table writing data execution module is used to read the table writing data from the cache queue through an asynchronous thread and write the table writing data into the memory through a chip bus.
[0012] In a third aspect, an embodiment of the present application further provides a network device, the network device comprising:
[0013] one or more processors;
[0014] A storage device for storing one or more programs;
[0015] When the one or more programs are executed by the one or more processors, the one or more processors implement the method for configuring the service table described in any embodiment of the present application.
[0016] In a fourth aspect, an embodiment of the present application further provides a storage medium comprising computer executable instructions, which, when executed by a computer processor, implements the method for configuring the business table described in any embodiment of the present application.
[0017] The technical solution provided by the embodiment of the present application writes table write data into a cache queue, reads the table write data from the cache queue through an asynchronous thread, and then writes it into a memory, so that the write operation of the table write data is separated from the read operation. At the same time, different chip buses work in parallel and are written into corresponding memories respectively, so that the business table configuration operations in each memory can be performed simultaneously, which greatly improves the configuration efficiency of the business table. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1A A flowchart of a method for configuring a business table provided in Embodiment 1 of the present application;
[0019] Figure 1B A flowchart of a method for configuring a business table provided for a specific application scenario 1 of this application;
[0020] Figure 1C A data flow diagram of a business table provided for the specific application scenario 1 of this application;
[0021] Figure 2 A structural block diagram of a device for configuring a service table provided in Embodiment 2 of the present application;
[0022] Figure 3 A schematic diagram of the structure of a network device provided in Example 3 of the present application. DETAILED DESCRIPTION
[0023] In order to make the purpose, technical solution and advantages of the present application more clear, the embodiments of the present application will be described in detail below with reference to the accompanying drawings. It should be noted that the embodiments and features in the embodiments of the present application can be combined with each other arbitrarily without conflict.
[0024] Embodiment 1
[0025] Figure 1AThis is a flow chart of a method for configuring a service table provided in Embodiment 1 of the present application. This embodiment can be applied to configuring a service table in a memory. The method can be executed by a device for configuring a service table in an embodiment of the present application. The device can be implemented by software and / or hardware and can generally be integrated in a network device. The method specifically includes the following steps:
[0026] S110 , converting the format of the acquired target data to obtain table writing data, and writing the table writing data into a cache queue.
[0027] Network devices (e.g., switches, bridges, routers, and fiber optic transceivers) manage the operation of various network protocols through the control layer, such as the spanning tree protocol, VLAN (Virtual Local Area Network) protocol, ARP protocol (Address Resolution Protocol), routing protocol, and multicast protocol, so that network devices can understand the devices, links, and interaction protocols in the entire network environment, and also process and forward various types of data on different ports through the data forwarding layer; the control layer provides the data forwarding layer with various network information and service tables required for data forwarding; the service table is also the forwarding query table item (e.g., port table, medium access control (MAC) table, and routing table, etc.), the data layer sends data according to these forwarding query table items, and the control layer stores these forwarding query table items in various memories, such as static random access memory (SRAM), ternary content addressable memory (TCAM), and synchronous dynamic random access memory (SDRAM).
[0028] The acquired target data is integrated according to a preset format to obtain table writing data conforming to the preset format, so that the table writing data is suitable for the table writing operation.
[0029] The cache queue adopts a producer / consumer model to store table write data, and writes the table write data into the cache queue, that is, as a producer, it performs an enqueue operation, and the asynchronous table write thread acts as a consumer to perform a dequeue operation; optionally, in an embodiment of the present application, the cache queue can be a ring structure; the cache queue with a ring structure separates the enqueue operation and the dequeue operation of the table write data from each other and can be performed simultaneously, thereby improving data flow efficiency.
[0030] Optionally, in an embodiment of the present application, before the acquired target data is format-converted, it also includes: creating a cache queue set according to the memory type and / or the chip bus type; wherein the cache queue set includes at least one cache queue; since in a network device, different types of memories use different chip buses (for example, a PCI-E bus and a Local Bus bus), for example, a routing table exists in a ternary content-addressable memory and is written through the PCI-E bus; and a service table existing in a double data rate (DDR) memory is written through a network processor (NP) bus; therefore, one or more cache queues can be created according to the memory type and / or the chip bus type, and accordingly, the table write data is written into the cache queue, including: writing the table write data into a matching target cache queue in the cache queue set; specifically, the table write data can be written into a corresponding cache queue according to the data type of the table write data.
[0031] Optionally, in the embodiment of the present application, there is no specific limitation on the type of network device, the type of memory, the type of chip bus, and the type of service table.
[0032] S120, reading the table writing data from the cache queue through an asynchronous thread, and writing the table writing data into a memory through a chip bus.
[0033] The function of the asynchronous thread is to read the table write data from the cache queue; after reading the table write data through the asynchronous thread, the table write interface is mobilized and written into the memory through the chip bus.
[0034] Optionally, in an embodiment of the present application, after creating a cache queue set according to the memory type and / or chip bus type, it also includes: creating an asynchronous thread set according to the cache queue set; wherein the asynchronous thread set includes at least one asynchronous thread, and the asynchronous thread is matched one-to-one with the cache queue; accordingly, reading the write table data from the cache queue through the asynchronous thread includes: obtaining a target asynchronous thread matching the target cache queue in the asynchronous thread set, and reading the write table data from the target cache queue through the target asynchronous thread.
[0035] The table writing data includes all information for executing the business table operation; wherein, if the business table type is not preset, the table writing data includes a processing function and processing parameters; wherein, the processing function includes a table writing function or a table deletion function; accordingly, writing to the memory through the chip bus includes: performing an operation of adding or deleting the business table to the memory through the chip bus; if the business table type is not preset, then it is necessary to specify the processing function to be used in the table writing data, and by calling the processing function, add the business table to the memory or delete the business table. If the business table type has been preset, the table writing data includes an operation type and processing parameters; wherein, the operation type includes adding or deleting; accordingly, writing to the memory through the chip bus includes: performing an operation of adding or deleting the business table to the memory through the chip bus; if the business table type has been preset, then the corresponding processing function has been fixed, and at this time, the corresponding processing function does not need to be included in the table writing data, and it is only necessary to specify whether the operation type of the business table is adding or deleting, and the business table can be added or deleted in the memory according to the operation type.
[0036] The technical solution provided by the embodiment of the present application writes table write data into a cache queue, reads the table write data from the cache queue through an asynchronous thread, and then writes it into a memory, so that the write operation of the table write data is separated from the read operation. At the same time, different chip buses work in parallel and are written into corresponding memories respectively, so that the business table configuration operations in each memory can be performed simultaneously, which greatly improves the configuration efficiency of the business table.
[0037] Specific application scenario 1
[0038] Figure 1B This is a flowchart of a method for configuring a business table provided in a specific application scenario 1 of the present disclosure. The method is specifically as follows:
[0039] S210. The forwarding table management unit assembles the data transmitted by the upper platform into table writing data.
[0040] The upper-layer platform is a module in the network device used for sending and receiving network protocol messages and protocol calculation. When the network device is running, it obtains the business table data information transmitted by the upper-layer platform through the forwarding table management unit in the control layer and performs data integration.
[0041] S220: The forwarding table management unit performs an enqueue operation.
[0042] like Figure 1C As shown, the forwarding table management unit applies for memory space in the cache queue and stores the table writing data in the cache queue.
[0043] S230: The forwarding chip management unit performs a dequeue operation through an asynchronous thread.
[0044] like Figure 1C As shown, the forwarding chip management unit reads the table write data from the cache queue through an asynchronous thread and releases the memory space.
[0045] S240: The forwarding chip management unit writes the table writing data into the memory.
[0046] The technical solution provided for the specific application scenario of the present application is that the forwarding table management unit writes the table write data into the cache queue, and the forwarding chip management unit reads the table write data from the cache queue through an asynchronous thread, and then writes it into the memory, so that the writing operation of the table write data is separated from the reading operation, which greatly improves the configuration efficiency of the business table.
[0047] Embodiment 2
[0048] Figure 2 It is a structural block diagram of a business table configuration device provided in Embodiment 2 of the present application. The device specifically includes: a table writing data acquisition module 210 and a table writing data execution module 220.
[0049] The table writing data acquisition module 210 is used to convert the acquired target data into a format to obtain table writing data, and write the table writing data into a cache queue;
[0050] The table writing data execution module 220 is used to read the table writing data from the cache queue through an asynchronous thread and write the table writing data into the memory through a chip bus.
[0051] The technical solution provided by the embodiment of the present application writes table write data into a cache queue, reads the table write data from the cache queue through an asynchronous thread, and then writes it into a memory, so that the write operation of the table write data is separated from the read operation. At the same time, different chip buses work in parallel and are written into corresponding memories respectively, so that the business table configuration operations in each memory can be performed simultaneously, which greatly improves the configuration efficiency of the business table.
[0052] Optionally, based on the above technical solution, the table writing data execution module 220 includes:
[0053] The cache queue set creating unit is used to create a cache queue set according to the memory type and / or chip bus type; wherein the cache queue set includes at least one cache queue.
[0054] Optionally, based on the above technical solution, the table writing data acquisition module 210 is specifically used for:
[0055] The table write data is written into a matching target cache queue in the cache queue set.
[0056] Optionally, based on the above technical solution, the table writing data execution module 220 further includes:
[0057] The asynchronous thread set creating unit is used to create an asynchronous thread set according to the cache queue set; wherein the asynchronous thread set includes at least one asynchronous thread, and the asynchronous thread is matched one-to-one with the cache queue.
[0058] Optionally, based on the above technical solution, the table writing data execution module 220 is specifically used for:
[0059] A target asynchronous thread matching the target cache queue is obtained from the asynchronous thread set, and the table writing data is read from the target cache queue through the target asynchronous thread.
[0060] Optionally, based on the above technical solution, the table writing data acquisition module 210 is specifically used for:
[0061] The acquired target data is integrated according to a preset format to obtain table writing data that conforms to the preset format.
[0062] Optionally, based on the above technical solution, the cache queue is a ring structure.
[0063] Optionally, based on the above technical solution, if the business table type is not preset, the table writing data includes a processing function and processing parameters; wherein the processing function includes a table writing function or a table deleting function.
[0064] Optionally, based on the above technical solution, the table writing data execution module 220 is specifically used for:
[0065] The business table is added or deleted from the memory through the chip bus.
[0066] Optionally, based on the above technical solution, if the business table type has been preset, the table writing data includes an operation type and processing parameters; wherein the operation type includes adding or deleting.
[0067] Optionally, based on the above technical solution, the table writing data execution module 220 is specifically used for:
[0068] The business table is added or deleted from the memory through the chip bus.
[0069] The above device can execute the configuration method of the service table provided in any embodiment of the present application, and has the corresponding functional modules and beneficial effects of the execution method. For technical details not described in detail in this embodiment, please refer to the method provided in any embodiment of the present application.
[0070] Embodiment 3
[0071] Figure 3A schematic diagram of the structure of a network device provided in Example 3 of the present application. Figure 3 A block diagram of an exemplary device 12 suitable for implementing embodiments of the present application is shown. Figure 3 The device 12 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0072] like Figure 3 As shown, device 12 is in the form of a general purpose computing device. Components of device 12 may include, but are not limited to, one or more processors or processing units 16, system memory 28, and bus 18 that connects various system components (including system memory 28 and processing unit 16).
[0073] Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus architectures. By way of example, these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MAC) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.
[0074] Device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by device 12, including volatile and non-volatile media, removable and non-removable media.
[0075] System memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. Device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 34 may be used to read and write non-removable, non-volatile magnetic media ( Figure 3 not shown, usually called a "hard drive"). Although Figure 3 Not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, a DVD-ROM, or other optical medium) may be provided. In these cases, each drive may be connected to the bus 18 via one or more data medium interfaces. The system memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present application.
[0076] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in system memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. Program modules 42 generally perform the functions and / or methods of the embodiments described herein.
[0077] The device 12 may also communicate with one or more external devices 14 (e.g., keyboards, pointing devices, displays 24, etc.), may communicate with one or more devices that enable a user to interact with the device 12, and / or may communicate with any device that enables the device 12 to communicate with one or more other computing devices (e.g., network cards, modems, etc.). Such communication may be performed via an input / output (I / O) interface 22. Furthermore, the device 12 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 20. As shown, the network adapter 20 communicates with other modules of the device 12 via a bus 18. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the device 12, including, but not limited to, microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0078] The processing unit 16 executes various functional applications and data processing by running the program stored in the system memory 28, such as implementing the configuration method of the business table provided in the embodiment of the present application. That is: after the acquired target data is formatted, table writing data is obtained, and the table writing data is written into the cache queue; the table writing data is read from the cache queue through an asynchronous thread, and written into the memory through the chip bus.
[0079] Embodiment 4
[0080] Embodiment 4 of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, the method for configuring the business table as described in any embodiment of the present application is implemented; the method includes:
[0081] After converting the acquired target data into a format, table writing data is obtained, and the table writing data is written into a cache queue;
[0082] The table writing data is read from the cache queue through an asynchronous thread, and written into a memory through a chip bus.
[0083] The computer storage medium of the embodiment of the present application can adopt any combination of one or more computer-readable media. Computer-readable media can be computer-readable signal media or computer-readable storage media. Computer-readable storage media can be, for example, - but not limited to - electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or devices, or any combination of the above. More specific examples (non-exhaustive lists) of computer-readable storage media include: electrical connections with one or more wires, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the above. In this document, computer-readable storage media can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it.
[0084] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0085] Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0086] Computer program code for performing the operation of the present application can be written in one or more programming languages or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (e.g., using an Internet service provider to connect through the Internet).
[0087] Note that the above are only preferred embodiments of the present application and the technical principles used. Those skilled in the art will understand that the present application is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present application. Therefore, although the present application is described in more detail through the above embodiments, the present application is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present application, and the scope of the present application is determined by the scope of the appended claims.
Claims
1. A method for configuring a service table, applicable to a control layer in a network device, characterized in that: include: After converting the acquired target data into a format, table writing data is obtained, and the table writing data is written into a cache queue; Reading the table writing data from the cache queue through an asynchronous thread, and writing the table writing data into a memory through a chip bus; Before converting the format of the acquired target data, the method further includes: Creating a cache queue set according to the memory type and / or chip bus type; wherein the cache queue set includes at least one cache queue; and the cache queue is a ring structure; The control layer provides the data forwarding layer with various network information and service tables necessary for data forwarding.
2. The method according to claim 1, characterized in that Writing the table write data into the cache queue includes: The table write data is written into a matching target cache queue in the cache queue set.
3. The method according to claim 2, characterized in that After creating a cache queue set according to the memory type and / or chip bus type, it also includes: Creating an asynchronous thread set according to the cache queue set; wherein the asynchronous thread set includes at least one asynchronous thread, and the asynchronous thread is matched one-to-one with the cache queue; Correspondingly, reading the table writing data from the cache queue through an asynchronous thread includes: A target asynchronous thread matching the target cache queue is obtained from the asynchronous thread set, and the table writing data is read from the target cache queue through the target asynchronous thread.
4. The method according to claim 1, characterized in that: After the acquired target data is formatted, the table writing data is obtained, including: The acquired target data is integrated according to a preset format to obtain table writing data that conforms to the preset format.
5. The method according to claim 1, characterized in that If the business table type is not preset, the table writing data includes a processing function and processing parameters; wherein the processing function includes a table writing function or a table deleting function; Accordingly, writing to the memory via the chip bus includes: The business table is added or deleted from the memory through the chip bus.
6. The method according to claim 1, characterized in that If the business table type has been preset, the table writing data includes an operation type and processing parameters; wherein the operation type includes adding or deleting; Accordingly, writing to the memory via the chip bus includes: The business table is added or deleted from the memory through the chip bus.
7. A service table configuration device, applicable to the control layer in a network device, characterized in that: include: A table writing data acquisition module is used to convert the acquired target data into a format to obtain table writing data, and write the table writing data into a cache queue; A table writing data execution module, used for reading the table writing data from the cache queue through an asynchronous thread, and writing the table writing data into a memory through a chip bus; The table writing data execution module includes: A cache queue set creation unit, used to create a cache queue set according to a memory type and / or a chip bus type; wherein the cache queue set includes at least one cache queue; and the cache queue is a ring structure; The control layer provides the data forwarding layer with various network information and service tables necessary for data forwarding.
8. A network device, characterized in that: The device comprises: one or more processors; a storage device for storing 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 method for configuring the service table as described in any one of claims 1 to 6.
9. A storage medium comprising computer executable instructions, wherein the computer executable instructions are used to execute the method for configuring a business table according to any one of claims 1 to 6 when executed by a computer processor.
Citation Information
Patent Citations
Method of improving disk array data reconstruction efficiency
CN103186438A
Method and apparatus for recording web user behavior data, computer readable medium
CN107122457A