Method, apparatus, medium and electronic device for accessing data table

By indirectly accessing the Layer 2 forwarding table through cooperative registers and signal state machines, the problem of low confidentiality in Layer 2 Ethernet switches is solved, and higher data access security is achieved.

CN118301109BActive Publication Date: 2025-10-24NANJING JINZHEN MICROELECTRONICS TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410539531.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-30
Publication Date
2025-10-24
Estimated Expiration
2044-04-30

AI Technical Summary

Technical Problem

In existing technologies, the methods for accessing data tables by Layer 2 Ethernet switches have issues with low confidentiality.

Method used

Indirect access to the Layer 2 forwarding table is achieved through the collaboration of the software status register, entry information configuration register, mode control register, entry read/write control signal state machine, and result return register, thus avoiding the exposure of the switch's internal hash algorithm.

Benefits of technology

The confidentiality of accessing the second-level forwarding table has been improved, ensuring that data access is not illegally cracked.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118301109B_ABST
    Figure CN118301109B_ABST
Patent Text Reader

Abstract

The application provides a method, device, medium and electronic equipment for accessing a data table. The method for accessing the data table comprises: obtaining table item information, mode control information and a storage value of a software state register; based on the storage value, writing the table item information into a table item information configuration register and writing the mode control information into a mode control register, and updating the storage value after the table item information and the mode control information are written; processing the table item information stored in the table item information configuration register and the mode control information stored in the mode control register to obtain table item control signals; processing a two-layer forwarding table based on the table item control signals, the table item information and a hash value associated with the table item information to obtain table item return data; and writing the table item return data into a result return register. The method can improve the confidentiality of the process of accessing the two-layer forwarding table.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the field of switch chips, and relates to a method for accessing a data table, in particular to a method for accessing a data table, an apparatus, a medium and an electronic device. BACKGROUND

[0002] In a two-layer Ethernet network, a switch performs two-layer lookup forwarding services according to a MAC table containing a source MAC address, a source port and a VLAN domain of a received Ethernet message. Generally, a switch internally compresses the source MAC address by using a hash algorithm as an index of a MAC table item to perform subsequent learning, forwarding, aging and the like. Current access to a two-layer forwarding table needs to open the hash algorithm when software is accessed, which results in low confidentiality of the access process. Therefore, the current method for accessing a data table has the problem of low confidentiality. SUMMARY

[0003] The application aims to provide a method for accessing a data table, an apparatus, a medium and an electronic device, and solve the problem of low confidentiality of the current method for accessing a data table.

[0004] In a first aspect, the application provides a method for accessing a data table, comprising: obtaining table item information, mode control information and a storage value of a software state register; based on the storage value, writing the table item information into a table item information configuration register and the mode control information into a mode control register until the table item information and the mode control information are written completely and the storage value is updated; processing the table item information stored in the table item information configuration register and the mode control information stored in the mode control register to obtain table item control signals; based on the table item control signals, the table item information and a hash value associated with the table item information, processing a two-layer forwarding table to obtain table item return data; and writing the table item return data into a result return register until the table item return data is written completely and the storage value is updated.

[0005] In the method for accessing a data table, the two-layer forwarding table is indirectly accessed through cooperation between the software state register, the table item information configuration register, the mode control register, a table item read-write control signal state machine and the result return register, which can complete the access to the two-layer forwarding table without opening the hash algorithm of the switch internally, thereby improving the confidentiality of the process of accessing the two-layer forwarding table.

[0006] In an embodiment of the present application, the storage value is an access path busy value or an access path idle value, and the method for writing table item information into a table item information configuration register and writing mode control information into a mode control register based on the storage value comprises: when the storage value is the access path idle value, writing the table item information into the table item information configuration register and writing the mode control information into the mode control register until the writing of the table item information and the mode control information is completed, and then updating the storage value to the access path busy value; when the storage value is the access path busy value, writing the table item information into the table item information configuration register and writing the mode control information into the mode control register until the storage value is updated to the access path idle value.

[0007] In an embodiment of the present application, the method for processing the table item information stored in the table item information configuration register and the mode control information stored in the mode control register to obtain a table item control signal comprises: the table item control signal is a table item read control signal or a table item write control signal, and the mode control information is read mode control information or write mode control information; when the mode control information is the read mode control information, the table item control signal is the table item read control signal, and when the mode control information is the write mode control information, the table item control signal is the table item write control signal.

[0008] In an embodiment of the present application, the method for processing the table item information stored in the table item information configuration register and the read mode control information stored in the mode control register to obtain the table item read control signal comprises: the read mode control information is single lookup control information or keyword search control information, and the table item read control signal is table item single lookup control signal or table item keyword search control signal; when the read mode control information is the single lookup control information, the table item read control signal is the table item single lookup control signal, and when the read mode control information is the keyword search control information, the table item read control signal is the table item keyword search control signal.

[0009] In an embodiment of the present application, the method for processing the table item information stored in the table item information configuration register and the write mode control information stored in the mode control register to obtain the table item write control signal includes: the write mode control information is learning control information, aging control information or batch deletion control information, and the table item write control signal is table item learning control signal, table item aging control signal or table item batch deletion control signal; when the write mode control information is the learning control information, the table item write control signal is the table item learning control signal; when the write mode control information is the aging control information, the table item write control signal is the table item aging control signal; and when the write mode control information is the batch deletion control information, the table item write control signal is the table item batch deletion control signal.

[0010] In an embodiment of the present application, the method for processing the table item based on the table item control signal and the table item information to obtain the table item return data includes: the table item return data is single lookup data, keyword search data, table item learning data, table item aging data or table item batch deletion data; when the table item control signal is the table item single lookup control signal, the method includes: processing the table item based on the table item single lookup control signal, the table item information and the hash value associated with the table item information to obtain the single lookup data; when the table item control signal is the table item keyword search control signal, the method includes: processing the table item based on the table item keyword search control signal, the table item information and the hash value associated with the table item information to obtain the keyword search data; when the table item control signal is the table item learning control signal, the method includes: processing the table item based on the table item learning control signal, the table item information and the hash value associated with the table item information to obtain the table item learning data; when the table item control signal is the table item aging control signal, the method includes: processing the table item based on the table item aging control signal, the table item information and the hash value associated with the table item information to obtain the table item aging data; and when the table item control signal is the table item batch deletion signal, the method includes: processing the table item based on the table item batch deletion signal, the table item information and the hash value associated with the table item information to obtain the table item batch deletion data.

[0011] In an embodiment of the present application, the method for writing the table item return data into the result return register includes: comparing the table item return data and the table item information to obtain a comparison result; generating a result register read-write control signal based on the comparison result; and writing the table item return data into the result return register based on the result register read-write control signal.

[0012] In a second aspect, the present application provides an apparatus for accessing a data table, a state reading module configured to obtain table item information, mode control information, and a storage value of a software state register; an information writing module configured to write the table item information into a table item information configuration register and write the mode control information into a mode control register based on the storage value, until the storage value is updated after the table item information and the mode control information are written; a signal obtaining module configured to process the table item information stored in the table item information configuration register and the mode control information stored in the mode control register to obtain a table item control signal; a data returning module configured to process a two-layer forwarding table based on the table item control signal, the table item information, and a hash value associated with the table item information to obtain table item return data; and a data writing module configured to write the table item return data into a result return register, until the storage value is updated after the table item return data is written.

[0013] In a third aspect, the present application provides a computer readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method for accessing a data table according to any one of the first aspect of the present application.

[0014] In a fourth aspect, the present application provides an electronic device, which includes a memory storing a computer program, and a processor communicatively connected to the memory and configured to execute the method for accessing a data table according to any one of the first aspect of the present application when the computer program is invoked.

[0015] As described above, the method, apparatus, medium, and electronic device for accessing a data table according to the present application have the following beneficial effects: in the method for accessing a data table, the two-layer forwarding table is indirectly accessed through cooperation between the software state register, the table item information configuration register, the mode control register, the table item read-write control signal state machine, and the result return register, so that the internal hash algorithm of the switch is not opened, and the access to the two-layer forwarding table is completed, thereby improving the confidentiality of the process of accessing the two-layer forwarding table. BRIEF DESCRIPTION OF DRAWINGS

[0016] Figure 1 A structural schematic diagram of a system for accessing a data table according to an embodiment of the present application is shown.

[0017] Figure 2 A flowchart of a method for accessing a data table according to an embodiment of the present application is shown.

[0018] Figure 3 A state jumping process according to an embodiment of the present application is shown.

[0019] Figure 4A flow chart showing an implementation method of the present application for writing table item information into a table item information configuration register and writing mode control information into a mode control register based on the stored value.

[0020] Figure 5 A flow chart showing an implementation method of the present application for processing a two-layer forwarding table based on the table item control signal, the table item information and the hash value associated with the table item information to obtain table item return data.

[0021] Figure 6 A flow chart showing an implementation method of the present application for writing the table item return data into a result return register.

[0022] Figure 7 A structural schematic diagram of a device for accessing a data table according to an embodiment of the present application.

[0023] Element number explanation

[0024] 100 Device for accessing a data table

[0025] 110 State obtaining module

[0026] 120 Information writing module

[0027] 130 Signal obtaining module

[0028] 140 Data return module

[0029] 150 Data writing module

[0030] S11-S15 Steps

[0031] S21-S22 Steps

[0032] S31-S35 Steps

[0033] S41-S43 Steps DETAILED DESCRIPTION

[0034] The present application will be described in detail below with specific reference being made to certain embodiments thereof. However, it should be understood that the present application can be practiced with modifications and changes within the scope and spirit of the present application, which are apparent to those skilled in the art, from the detailed description contained herein. The following detailed description is, therefore, not to be taken in a limiting sense, and the scope of the present application is defined by the appended claims.

[0035] It should be noted that the diagrams provided in the following embodiments only schematically illustrate the basic concepts of the present application, and only the components related to the present application are shown in the diagrams, rather than the number, shape and size of the components when actually implemented. The shapes, number and proportions of the components when actually implemented can be arbitrarily changed, and the layout of the components can be more complex.

[0036] The technical solutions in the embodiments of the present application will be described in detail below with reference to the drawings in the embodiments of the present application.

[0037] For example, Figure 1 For example, Figure 1 is a schematic diagram of a system structure for accessing a data table. The system for accessing the data table can include: a table entry configuration register group, a read-write control generation module, a two-layer forwarding table, and a return result processing unit. The table entry configuration register group can include: a table entry information configuration register, a mode control register, a software state register, and a result return register. The read-write control generation module can include a table entry read-write control signal generation state machine. The return result processing unit can be used to analyze and compare the data returned by reading and writing the two-layer forwarding table, and feed back the result to the result return register.

[0038] As shown in Figure 2 The present embodiment provides a method for accessing a data table, including:

[0039] S11, obtaining storage values of table entry information, mode control information, and a software state register.

[0040] Optionally, the storage domain of the software state register can be as shown in Table 1 below:

[0041] No. Filed Width 1 REQ 1

[0042] Wherein, REQ can represent an access path state. For example, when the value of REQ is 1, it represents that the software access path is busy, and when the value of REQ is 0, it represents that the software access path is idle.

[0043] S12, based on the storage values, writing the table entry information into the table entry information configuration register and writing the mode control information into the mode control register, and updating the storage values after the table entry information and the mode control information are written.

[0044] Optionally, the storage domain of the table entry information configuration register can be as shown in Table 2 below:

[0045] No. Filed Width 1 GID 12 2 MAC_ADDR 48 3 UC_ENTRY_NO_USED 4 4 DEST_PORT 4 5 DA_BLOCK 1 6 SA_BLOCK 1 7 AUTHEN 1 8 SCAN_CNT 2 9 UC 1 10 ENTRY_STATIC 1 11 VALID 1

[0046] Wherein, GID represents global ID number, which can be regarded as a kind of mapping of VLAN, MAC_ADDR represents MAC address, UC_ENTRY_NO_USED represents that unicast address is not used, DEST_PORT represents destination port, DA_BLOCK represents destination address module, SA_BLOCK represents source address module, AUTHEN represents authentication flag bit, SCAN_CNT represents scan count, UC represents unicast, ENTRY_STATIC represents that the entry is static entry, and VALID represents valid flag bit.

[0047] Optionally, the storage domain of the mode control register can be as shown in Table 3:

[0048] No. Filed Width 1 KEY_MODE 2 2 OP_TYPE 1 3 OP_MODE 2

[0049] Wherein, KEY_MODE represents keyword mode, OP_TYPE represents operation type, and OP_MODE represents operation mode.

[0050] Optionally, since the storage value represents access path state, after the table entry information and the mode control information are written, the storage value needs to be updated to make the storage value represent that software access path is busy, for example, the storage value is updated from 0 to 1.

[0051] Optionally, the table entry information can be composed of the value of the storage domain in the table entry information configuration register, and the mode control information can be composed of the value of the storage domain in the mode control register.

[0052] S13, the table entry information stored in the table entry information configuration register and the mode control information stored in the mode control register are processed to obtain table entry control signal.

[0053] Optionally, the implementation method of processing the table entry information stored in the table entry information configuration register and the mode control information stored in the mode control register to obtain table entry control signal includes: processing the table entry information stored in the table entry information configuration register and the mode control information stored in the mode control register by a table entry read-write control signal generation state machine to obtain table entry control signal. The table entry read-write control signal generation state machine can be flexibly designed according to actual situation, and the embodiment does not limit it. Please refer to Figure 3 , Figure 3The state transition process of the table entry read-write control signal generation state machine is shown, where muti_rd_noninc_en represents multi-read non-increment entry, muti_rd_inc_en represents multi-read increment entry, muti_wr_en represents multi-write entry, muti_rd_noninc_chg represents multi-read non-increment change, addr represents address, hit represents hit, hit_vld represents hit valid, muti_rd_inc_chg represents multi-read increment change, muti_wr_chg represents multi-write change, cpu_rd_req represents cpu read request, IDLE represents idle state, MUTI_NONINC represents multi-non-increment, MUTI_INC represents multi-increment, NONINC_ADD represents non-increment operation, INC_ADD represents increment operation, NONINC_LOCK represents non-increment lock, INC_LOCK represents increment lock, MUTI_WRITE represents multi-write, WRITE_LOCK represents write lock, and WRITE_ADD represents write increment.

[0054] Optionally, the table entry control signal, i.e., the table entry read-write control signal generation state machine, outputs a control signal according to the table entry information and the mode control information stored in the mode control register. The table entry control signal is associated with the table entry information and the mode control information.

[0055] S14, processing the two-layer forwarding table based on the table entry control signal, the table entry information and the hash value associated with the table entry information to obtain table entry return data.

[0056] Optionally, the table entry return data can refer to the data returned in the two-layer forwarding table after processing the two-layer forwarding table based on the table entry control signal. The table entry return data can be data that is not encrypted by a hash algorithm.

[0057] Optionally, the two-layer forwarding table is a two-layer forwarding table processed by a hash algorithm, and the hash value associated with the table entry information is used for locating and searching the table entry information in the two-layer forwarding table.

[0058] S15, writing the table entry return data into a result return register until the storage value is updated after the writing of the table entry return data is completed.

[0059] Optionally, the storage domain of the result return register can be shown in Table 4:

[0060] No. Filed Width 1 GID 12 2 MAC_ADDR 48 3 UC_ENTRY_NO_USED 4 4 DEST_PORT 4 5 DA_BLOCK 1 6 SA_BLOCK 1 7 AUTHEN 1 8 SCAN_CNT 2 9 UC 1 10 ENTRY_STATIC 1 11 VALID 1

[0061] The meaning of the storage domain of the result return register is consistent with the meaning of the storage domain of the table entry information configuration register, which will not be described here again.

[0062] According to the above description, the method for accessing the data table provided in the embodiment includes: obtaining table item information, mode control information and a storage value of a software state register; writing the table item information into a table item information configuration register and the mode control information into a mode control register based on the storage value, until the table item information and the mode control information are written completely and the storage value is updated; processing the table item information stored in the table item information configuration register and the mode control information stored in the mode control register to obtain table item control signals; processing a two-layer forwarding table based on the table item control signals, the table item information and a hash value associated with the table item information to obtain table item return data; and writing the table item return data into a result return register, until the table item return data is written completely and the storage value is updated.

[0063] In the method for accessing the data table, the two-layer forwarding table is indirectly accessed through cooperation between the software state register, the table item information configuration register, the mode control register, a table item read-write control signal state machine and the result return register, so that the two-layer forwarding table can be accessed without opening the hash algorithm inside the switch, thereby improving the confidentiality of the process of accessing the two-layer forwarding table.

[0064] As shown in Figure 4 The implementation method provided in the embodiment for writing the table item information into the table item information configuration register and the mode control information into the mode control register based on the storage value includes:

[0065] S21, when the storage value is the access path idle value, the table item information is written into the table item information configuration register and the mode control information is written into the mode control register, until the table item information and the mode control information are written completely and the storage value is updated as the access path busy value.

[0066] S22, when the storage value is the access path busy value, the table item information is written into the table item information configuration register and the mode control information is written into the mode control register until the storage value is updated as the access path idle value.

[0067] Optionally, the storage value is the access path busy value or the access path idle value. Invalid access is blocked through the value of the software state register, which can reduce power consumption to a certain extent.

[0068] Optionally, the table item control signal is a table item read control signal or a table item write control signal, and the mode control information is read mode control information or write mode control information. The method for processing the table item information stored in the table item information configuration register and the mode control information stored in the mode control register to obtain the table item control signal comprises: when the mode control information is the read mode control information, the table item control signal is the table item read control signal; and when the mode control information is the write mode control information, the table item control signal is the table item write control signal.

[0069] Optionally, the read mode control information is single lookup control information or keyword search control information, and the table item read control signal is table item single lookup control signal or table item keyword search control signal. The method for processing the table item information stored in the table item information configuration register and the read mode control information stored in the mode control register to obtain the table item read control signal comprises: when the read mode control information is single lookup control information, the table item read control signal is table item single lookup control signal; and when the read mode control information is the keyword search control information, the table item read control signal is the table item keyword search control signal.

[0070] Optionally, the write mode control information is learning control information, aging control information or batch deletion control information, and the table item write control signal is table item learning control signal, table item aging control signal or table item batch deletion control signal. The method for processing the table item information stored in the table item information configuration register and the write mode control information stored in the mode control register to obtain the table item write control signal comprises: when the write mode control information is the learning control information, the table item write control signal is the table item learning control signal; when the write mode control information is the aging control information, the table item write control signal is the table item aging control signal; and when the write mode control information is the batch deletion control information, the table item write control signal is the table item batch deletion control signal.

[0071] Optionally, the read mode control information is control information for reading a two-layer forwarding table mode, the write mode control information is control information for writing a two-layer forwarding table mode, the single lookup control information is control information for single lookup in a two-layer forwarding table, the keyword search control information is control information for keyword search in a two-layer forwarding table, the learning control information refers to control information for two-layer forwarding table learning, the aging control information refers to control information for two-layer forwarding table aging, and the batch deletion control information refers to control information for two-layer forwarding table batch deletion. The single lookup control information, the keyword search control information, the learning control information, the aging control information, and the batch deletion control information can be set one by one according to the value of the storage domain of the mode control register, and the embodiment will not be described here.

[0072] Optionally, the table item read control signal is a control signal for reading a two-layer forwarding table, the table item write control signal is a control signal for writing a two-layer forwarding table, the table item single lookup control signal is a control signal for single lookup in a two-layer forwarding table, the table item keyword search control signal is a control signal for keyword search in a two-layer forwarding table, the table item learning control signal refers to a control signal for two-layer forwarding table learning, the table item aging control signal refers to a control signal for two-layer forwarding table aging, and the table item batch deletion control signal refers to a control signal for two-layer forwarding table batch deletion.

[0073] As shown in Figure 5 The embodiment provides an implementation method for processing a two-layer forwarding table based on the table item control signal and the table item information to obtain table item return data, which comprises the following steps:

[0074] The table item return data is single lookup data, keyword search data, table item learning data, table item aging data, or table item batch deletion data.

[0075] S31, when the table item control signal is the table item single lookup control signal, single lookup processing is performed on the two-layer forwarding table based on the table item single lookup control signal, the table item information, and the hash value associated with the table item information, to obtain single lookup data.

[0076] Optionally, the hash value associated with the table item information can be a value obtained by hashing the vlan field and the MAC address in the table item information. For example, when performing a single lookup on table item information with vlan field 1 and MAC address 48'h0000_0000_1243, the port number of the table item information can be obtained according to the single lookup control signal, the table item information, and the hash value associated with the table item information. The single lookup data can be all entry data of the vlan field and the MAC address in the layer 2 forwarding table.

[0077] S32, when the table item control signal is the table item keyword search control signal, performing keyword search processing on the layer 2 forwarding table based on the table item keyword search control signal, the table item information, and the hash value associated with the table item information, to obtain keyword search data.

[0078] Optionally, the hash value associated with the table item information can be a value obtained by hashing the keyword in the table item information. When performing keyword search on table item information with VLAN field 3, the hash value associated with the table item information can be the hash value of the VLAN field 3. All entries matching the VLAN field 3 in the layer 2 forwarding table can be searched according to the table item keyword search control signal, the table item information, and the hash value associated with the table item information. The keyword search data can be all entries matching the VLAN field 3 in the layer 2 forwarding table. According to this mode, batch keyword search can be realized.

[0079] S33, when the table item control signal is the table item learning control signal, performing table item learning processing on the layer 2 forwarding table based on the table item learning control signal, the table item information, and the hash value associated with the table item information, to obtain table item learning data.

[0080] Optionally, the hash value associated with the table item information can be a value obtained by hashing the vlan field and the MAC address in the table item information. The table item learning data can be entry data in which the table item information is newly learned in the layer 2 forwarding table. For example, when learning table item information with vlan field 1, MAC address 48'h0000_0000_1243, and port number 03, the table item learning data includes: vlan field 1, MAC address 48'h0000_0000_1243, and port number 03.

[0081] S34, when the table item control signal is the table item aging control signal, performing table item aging processing on the layer 2 forwarding table based on the table item aging control signal, the table item information, and the hash value associated with the table item information, to obtain table item aging data.

[0082] Optionally, the table item information associated hash value can be a hash value of the vlan field and MAC address in the table item information, for example, when the table item information is vlan field 1 and MAC address 48'h0000_0000_1243, the table item aging data can be obtained by aging the entry data of the table item information in the layer 2 forwarding table based on the single lookup control signal, the table item information and the table item information associated hash value.

[0083] S35, when the table item control signal is the table item batch deletion signal, performing table item batch deletion processing on the layer 2 forwarding table based on the table item batch deletion signal, the table item information and the table item information associated hash value to obtain table item batch deletion data.

[0084] Optionally, the table item information associated hash value can be a hash value of the table item information batch deletion keyword, for example, the entries of vlan field 3 in the layer 2 forwarding table need to be batch deleted, and the table item information associated hash value is the hash value of the vlan field 3. The table item batch deletion data can be all entry data in the layer 2 forwarding table batch deleted based on the table item batch deletion signal, the table item information and the table item information associated hash value.

[0085] Through the above various processing methods of the layer 2 forwarding table, the layer 2 forwarding table can be efficiently managed, thereby saving management time.

[0086] As shown in Figure 6 The embodiment provides an implementation method for writing the table item return data into the result return register, which comprises the following steps:

[0087] S41, comparing the table item return data and the table item information to obtain a comparison result.

[0088] Optionally, the comparison result can be comparison success or comparison failure. For example, the single lookup data is vlan field 1, MAC address 48'h0000_0000_1243 and port number 03, and the vlan field in the table item information is 1 and the MAC address is 48'h0000_0000_1243, so the comparison is successful. If the vlan field or MAC address of the single lookup data is different from the table item information, the comparison fails.

[0089] S42, generating a result register read-write control signal based on the comparison result.

[0090] Optionally, the implementation method of generating the result register read-write control signal based on the comparison result comprises: when the comparison result is a comparison success, generating the result register read-write control signal.

[0091] S43, based on the result register read-write control signal, writing the table entry return data into the result return register.

[0092] The protection scope of the method for accessing a data table provided in the embodiments of the present application is not limited to the execution sequence of the steps listed in the embodiments, and any scheme realized by adding, replacing or deleting steps of the prior art according to the principles of the present application is included in the protection scope of the present application.

[0093] As shown in Figure 7 The embodiment provides an apparatus 100 for accessing a data table, which comprises:

[0094] A state reading module 110 acquires table entry information, mode control information and a storage value of a software state register.

[0095] An information writing module 120 is configured to write the table entry information into a table entry information configuration register and write the mode control information into a mode control register based on the storage value, and update the storage value after the writing of the table entry information and the mode control information is completed.

[0096] A signal acquisition module 130 is configured to process the table entry information stored in the table entry information configuration register and the mode control information stored in the mode control register to acquire table entry control signals.

[0097] A data return module 140 is configured to process a two-layer forwarding table based on the table entry control signals, the table entry information and a hash value associated with the table entry information to acquire table entry return data.

[0098] A data writing module 150 is configured to write the table entry return data into a result return register, and update the storage value after the writing of the table entry return data is completed. Figure 2 The state reading module 110 corresponds to step S11 of the method for accessing a data table shown in Figure 2 The information writing module 120 corresponds to step S12 of the method for accessing a data table shown in Figure 2 The signal acquisition module 130 corresponds to step S13 of the method for accessing a data table shown in Figure 2 The data return module 140 corresponds to step S14 of the method for accessing a data table shown in Figure 2The step S15 of the method of accessing the data table corresponds to.

[0099] In several embodiments provided in the present application, it should be understood that the disclosed apparatus or method can be implemented by other means. For example, the apparatus embodiments described above are only illustrative, for example, the division of the modules / units is only a logical function division, and actual implementation can have another division manner, for example, a plurality of modules or units can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the displayed or discussed modules can be indirect coupling or communication connection between the modules or units through some interfaces, and can be electrical, mechanical or other forms.

[0100] The modules / units described as separate components can or can not be physically separated, and the components displayed as modules / units can or can not be physical modules, that is, can be located in one place, or can be distributed on a plurality of network units. Part or all of the modules / units can be selected according to actual needs to achieve the purpose of the embodiments of the present application. For example, the functional modules / units in each embodiment of the present application can be integrated in one processing module, or each module / unit can be physically separated, or two or more modules / units can be integrated in one module / unit.

[0101] Those of ordinary skill in the art should further realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be realized in electronic hardware, computer software or a combination of both. In order to clearly illustrate the interchangeability of hardware and software, the components and steps of the examples have been described in general terms in the above description. Whether the functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. A skilled person can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.

[0102] The present embodiment provides an electronic device, which comprises a memory storing a computer program, and a processor connected in communication with the memory, which invokes the computer program to execute Figure 2 The method of accessing the data table.

[0103] The embodiments of the present application further provide a computer readable storage medium. A person of ordinary skill in the art can understand that all or part of the steps of the methods described in the above embodiments can be completed by a processor instructed by a program, and the program can be stored in a computer readable storage medium. The storage medium is a non-transitory medium, for example, a random access memory, a read only memory, a flash memory, a hard disk, a solid state disk, a magnetic tape, a floppy disk, an optical disc, and any combination thereof. The storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, a data center, and the like, which includes one or more available medium sets. The available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a digital video disc (DVD)), or a semiconductor medium (for example, a solid state disk (SSD)), and the like.

[0104] The embodiments of the present application can further provide a computer program product including one or more computer instructions. When the computer instructions are loaded and executed on a computing device, all or part of the processes or functions described in the embodiments of the present application are generated. The computer instructions can be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, the computer instructions can be transmitted from one website, computer or data center to another website, computer or data center through a wired (for example, coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (for example, infrared, wireless, microwave, etc.) manner.

[0105] When the computer program product is executed by a computer, the computer executes the method described in the foregoing method embodiments. The computer program product can be a software installation package, and when the foregoing method needs to be used, the computer program product can be downloaded and executed on the computer.

[0106] The description of the processes or structures corresponding to the above respective figures has its own emphasis, and the parts not described in detail in a certain process or structure can be referred to the related description of other processes or structures.

[0107] The above embodiments are only illustrative of the principles and effects of the present application, and are not used to limit the present application. Any person skilled in the art can modify or change the above embodiments without departing from the spirit and scope of the present application. Therefore, all equivalent modifications or changes made by those skilled in the art without departing from the spirit and technical idea of the present application should be covered by the claims of the present application.

Claims

1. A method of accessing a data table, characterized by, The method comprises the following steps: acquiring table item information, mode control information and a storage value of a software state register; based on the storage value, writing the table item information into a table item information configuration register and writing the mode control information into a mode control register, and updating the storage value after the writing of the table item information and the mode control information is completed; processing the table item information stored in the table item information configuration register and the mode control information stored in the mode control register to obtain table item control signals; processing a two-layer forwarding table based on the table item control signals, the table item information and a hash value associated with the table item information to obtain table item return data; writing the table item return data into a result return register, and updating the storage value after the writing of the table item return data is completed; the storage value is an access channel busy value or an access channel idle value, and the method for writing the table item information into the table item information configuration register and the mode control information into the mode control register based on the storage value comprises the following steps: when the storage value is the access channel idle value, writing the table item information into the table item information configuration register and the mode control information into the mode control register, and updating the storage value to the access channel busy value after the writing of the table item information and the mode control information is completed; 2. The method of accessing a table of data according to claim 1, wherein, when the storage value is the access channel busy value, writing the table item information into the table item information configuration register and the mode control information into the mode control register after the storage value is updated to the access channel idle value. The method for processing the table item information stored in the table item information configuration register and the mode control information stored in the mode control register to obtain table item control signals comprises the following steps: the table item control signals are table item read control signals or table item write control signals, and the mode control information is read mode control information or write mode control information; when the mode control information is the read mode control information, the table item control signals are the table item read control signals; 3. The method of accessing a table of data according to claim 2, wherein, when the mode control information is the write mode control information, the table item control signals are the table item write control signals. The method for processing the table item information stored in the table item information configuration register and the read mode control information stored in the mode control register to obtain the table item read control signals comprises the following steps: the read mode control information is single lookup control information or keyword search control information, and the table item read control signals are table item single lookup control signals or table item keyword search control signals; when the read mode control information is the single lookup control information, the table item read control signals are the table item single lookup control signals; 4. The method of accessing a table of data according to claim 3, wherein, when the read mode control information is the keyword search control information, the table item read control signals are the table item keyword search control signals. The method for processing the table item information stored in the table item information configuration register and the write mode control information stored in the mode control register to obtain the table item write control signals comprises the following steps: The write mode control information is learning control information, aging control information or batch deletion control information, and the entry write control signal is entry learning control signal, entry aging control signal or entry batch deletion control signal. When the write mode control information is the learning control information, the entry write control signal is the entry learning control signal. When the write mode control information is the aging control information, the entry write control signal is the entry aging control signal. When the write mode control information is the batch deletion control information, the entry write control signal is the entry batch deletion control signal.

5. The method of accessing a table of data according to claim 4, wherein, The implementation method for processing the two-layer forwarding table based on the entry control signal and the entry information to obtain entry return data comprises: The entry return data is single lookup data, keyword search data, entry learning data, entry aging data or entry batch deletion data. When the entry control signal is the entry single lookup control signal, the two-layer forwarding table is processed based on the entry single lookup control signal, the entry information and the hash value associated with the entry information to obtain single lookup data. When the entry control signal is the entry keyword search control signal, the two-layer forwarding table is processed based on the entry keyword search control signal, the entry information and the hash value associated with the entry information to obtain keyword search data. When the entry control signal is the entry learning control signal, the two-layer forwarding table is processed based on the entry learning control signal, the entry information and the hash value associated with the entry information to obtain entry learning data. When the entry control signal is the entry aging control signal, the two-layer forwarding table is processed based on the entry aging control signal, the entry information and the hash value associated with the entry information to obtain entry aging data. When the entry control signal is the entry batch deletion signal, the two-layer forwarding table is processed based on the entry batch deletion signal, the entry information and the hash value associated with the entry information to obtain entry batch deletion data.

6. The method of accessing a table of data according to claim 5, wherein, The implementation method for writing the entry return data into a result return register comprises: The entry return data and the entry information are compared to obtain a comparison result; A result register read-write control signal is generated based on the comparison result; The entry return data is written into the result return register based on the result register read-write control signal.

7. An apparatus for accessing a data table, the apparatus comprising: It comprises: A state reading module is configured to obtain entry information, mode control information and a storage value of a software state register; An information writing module is configured to write entry information into an entry information configuration register and write mode control information into a mode control register based on the storage value, and update the storage value after the entry information and the mode control information are written. The signal obtaining module is configured to process the table item information stored in the table item information configuration register and the mode control information stored in the mode control register to obtain table item control signals. The data returning module is configured to process a two-layer forwarding table based on the table item control signals, the table item information, and a hash value associated with the table item information to obtain table item return data. The data writing module is configured to write the table item return data into a result return register until the table item return data is written completely, and then update the storage value. The storage value is an access path busy value or an access path idle value. Based on the storage value, a method for writing table item information into a table item information configuration register and writing mode control information into a mode control register includes: when the storage value is the access path idle value, writing the table item information into the table item information configuration register and writing the mode control information into the mode control register until the writing of the table item information and the mode control information is completed, and then updating the storage value to the access path busy value. When the storage value is the access path busy value, the table item information is written into the table item information configuration register and the mode control information is written into the mode control register until the storage value is updated to the access path idle value.

8. A computer-readable storage medium having stored thereon a computer program, characterized in that The computer program is executed by a processor to implement the method for accessing the data table according to any one of claims 1-6.

9. An electronic device, comprising: The electronic device includes: a memory storing a computer program; a processor connected to the memory in communication, and configured to execute the computer program to implement the method for accessing the data table according to any one of claims 1-6.

Citation Information

Patent Citations

  • Application identifier (AID) prioritization of security module applications

    CN105447692A

  • Method and device for accessing register, electronic equipment and readable medium

    CN111488297A