CN114448869A - Data table synchronization method and device, data exchange equipment and storage medium - Google Patents

Data table synchronization method and device, data exchange equipment and storage medium Download PDF

Info

Publication number
CN114448869A
CN114448869A CN202011118162.7A CN202011118162A CN114448869A CN 114448869 A CN114448869 A CN 114448869A CN 202011118162 A CN202011118162 A CN 202011118162A CN 114448869 A CN114448869 A CN 114448869A
Authority
CN
China
Prior art keywords
data table
data
entry
entries
synchronization
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Withdrawn
Application number
CN202011118162.7A
Other languages
Chinese (zh)
Inventor
田国凤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nanjing ZTE New Software Co Ltd
Original Assignee
Nanjing ZTE New Software Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nanjing ZTE New Software Co Ltd filed Critical Nanjing ZTE New Software Co Ltd
Priority to CN202011118162.7A priority Critical patent/CN114448869A/en
Priority to PCT/CN2021/114105 priority patent/WO2022083266A1/en
Publication of CN114448869A publication Critical patent/CN114448869A/en
Withdrawn legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/02Topology update or discovery
    • H04L45/021Ensuring consistency of routing table updates, e.g. by using epoch numbers
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • H04L45/742Route cache; Operation thereof
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/66Layer 2 routing, e.g. in Ethernet based MAN's

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computing Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides a data table synchronization method and device, data exchange equipment and a storage medium. The data table synchronization method is applied to electronic equipment and comprises the following steps: acquiring a first data table item from a first data table, wherein the first data table is stored in a database, and the first data table item comprises first key information; matching in a second data table according to the first key information to obtain a matching result, wherein the second data table is stored in a memory, and the first data table is obtained according to the second data table; and carrying out corresponding synchronous operation on the first data table and a third data table according to the matching result, wherein the third data table is consistent with the first data table, and the third data table is stored in the software platform. According to the scheme provided by the embodiment of the invention, the success rate of synchronization between the hardware table (namely, the second data table) in the switch and the software table (namely, the third data table) in the software platform can be improved, so that the probability of management disorder of the switch can be reduced.

Description

Data table synchronization method and device, data exchange equipment and storage medium
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a data table synchronization method and apparatus, a data exchange device, and a computer-readable storage medium.
Background
In order to facilitate management of the devices, each device maintains a related data table, which is stored in a memory hardware of the device, and in order to facilitate management of the devices by users, another data table containing the same data table entry is often adopted in a corresponding software platform for users to view and perform related operations. The data table stored in the hardware of the equipment is called a hardware data table, which is called a hardware table for short; the data table stored in the software platform is called a software data table, and is simply called a software table.
For example, a Media Access Control (MAC) address table is stored in the switch, and since the MAC address table (i.e., a hardware table) stored in the switch is continuously learned and aged automatically, the MAC address table (i.e., a software table) stored in the corresponding software platform needs to be updated to ensure that the hardware table and the software table are consistent. However, when the switch processes the data entry, and when packet loss or drift occurs in information transmission and the information transceiving ports are inconsistent, the hardware table in the switch and the software table in the software platform are inconsistent, which may cause the hardware table in the switch and the software table in the software platform to be asynchronous, thereby causing management confusion of the switch.
Disclosure of Invention
The following is a summary of the subject matter described in detail herein. This summary is not intended to limit the scope of the claims.
The embodiment of the invention provides a data table synchronization method and device, data exchange equipment and a computer readable storage medium, which can improve the synchronization success rate of a hardware table in a switch and a software table in a software platform, thereby reducing the probability of management confusion of the switch.
In a first aspect, an embodiment of the present invention provides a data table synchronization method, including:
obtaining a first data table entry from a first data table, wherein the first data table is stored in a database, and the first data table entry comprises first key information;
matching in a second data table according to the first key information to obtain a matching result, wherein the second data table is stored in a memory, and the first data table is obtained according to the second data table;
and carrying out corresponding synchronous operation on the first data table and a third data table according to the matching result, wherein the third data table is consistent with the first data table, and the third data table is stored in a software platform.
In a second aspect, an embodiment of the present invention further provides a device for synchronizing data tables, including: a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the data table synchronization method as described above in the first aspect when executing the computer program.
In a third aspect, an embodiment of the present invention further provides a data switching device, including the data table synchronizing apparatus according to the second aspect.
In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium storing computer-executable instructions, where the computer-executable instructions are configured to perform the data table synchronization method according to the first aspect.
The embodiment of the invention comprises the following steps: acquiring a first data table item from a first data table, wherein the first data table is stored in a database, and the first data table item comprises first key information; matching in a second data table according to the first key information to obtain a matching result, wherein the second data table is stored in a memory, and the first data table is obtained according to the second data table; and carrying out corresponding synchronous operation on the first data table and a third data table according to the matching result, wherein the third data table is consistent with the first data table, and the third data table is stored in the software platform. According to the scheme provided by the embodiment of the present invention, since the first data table is a data table created according to the second data table, after the first data table stored in the database and including the first key information is obtained, the first data table may be matched in the second data table stored in the memory according to the first key information in the first data table, and according to a matching result, the corresponding synchronization processing operation may be performed on the first data table and the third data table stored in the software platform. Because the first data table stored in the database has better flexibility than the second data table stored in the memory, the second data table and the third data table stored in the software platform are synchronously processed through the first data table, the synchronization success rate of the hardware table in the switch and the software table in the software platform can be improved, and the probability of management disorder of the switch can be reduced.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
Drawings
The accompanying drawings are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the example serve to explain the principles of the invention and not to limit the invention.
FIG. 1 is a diagram of a system architecture for performing a data table synchronization method according to an embodiment of the present invention;
FIG. 2 is a flow chart of a method for data table synchronization provided by an embodiment of the present invention;
fig. 3 is a flowchart illustrating specific steps of acquiring a first data table entry in a data table synchronization method according to another embodiment of the present invention;
fig. 4 is a flowchart illustrating a specific step of periodically acquiring a first data table entry in a data table synchronization method according to another embodiment of the present invention;
FIG. 5 is a flowchart illustrating specific steps of performing a synchronization operation on a first data table and a third data table in a data table synchronization method according to another embodiment of the present invention;
FIG. 6 is a flowchart illustrating specific steps of performing a synchronization operation on a first data table and a third data table in a data table synchronization method according to another embodiment of the present invention;
fig. 7 is a flowchart illustrating specific steps of performing a first processing operation on a first data table and a third data table in a data table synchronization method according to another embodiment of the present invention;
fig. 8 is a flowchart illustrating specific steps of performing a first processing operation on a first data table and a third data table in a data table synchronization method according to another embodiment of the present invention;
FIG. 9 is a flow chart of limiting the number of table entries in a method for data table synchronization provided by another embodiment of the present invention;
FIG. 10 is a flowchart illustrating specific steps of performing a second processing operation on a data table in a data table synchronization method according to another embodiment of the present invention;
FIG. 11 is a flowchart illustrating specific steps of performing a second processing operation on a data table in a data table synchronization method according to another embodiment of the present invention;
FIG. 12 is a flowchart illustrating the periodic MAC address table synchronization detection and operation according to an exemplary embodiment of the present invention;
FIG. 13 is a flow chart of limiting the maximum number of entries in a data table of a MAC address table according to another embodiment of the present invention;
fig. 14 is a flow chart of MAC address table data traffic triggered learning according to another specific example of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
It should be noted that although functional blocks are partitioned in a schematic diagram of an apparatus and a logical order is shown in a flowchart, in some cases, the steps shown or described may be performed in a different order than the partitioning of blocks in the apparatus or the order in the flowchart. The terms first, second and the like in the description and in the claims, and the drawings described above, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order.
The invention provides a data table synchronization method and a device thereof, data exchange equipment and a computer readable storage medium, wherein a first data table item is obtained from a first data table of a database, wherein the first data table item contains first key information, and because the first data table is a data table manufactured according to a second data table, when the first data table item is obtained, matching comparison can be carried out in the second data table in a memory aiming at the first key information so as to obtain a matching result, and corresponding synchronization operation is carried out on the first data table and a third data table according to different matching results, wherein the third data table is stored in a software platform, and the third data table is consistent with the first data table. Because the first data table stored in the database has better flexibility than the second data table stored in the memory, the second data table and the third data table are synchronously processed through the first data table, the success rate of synchronization of a hardware table in the switch and a software table in a software platform can be improved, and the probability of management disorder of the switch can be reduced.
The embodiments of the present invention will be further explained with reference to the drawings.
As shown in fig. 1, fig. 1 is a schematic diagram of a system architecture for executing a data table synchronization method according to an embodiment of the present invention. In the example of FIG. 1, the system architecture 100 includes an entry acquisition module 110, an information detection module 120, an entry processing module 130, and a timing module 140.
The system architecture 100 may be applied to electronic devices such as switches, computers, servers, etc., and these electronic devices may implement the data table synchronization method through the mutual cooperation of the table entry obtaining module 110, the information detecting module 120, the table entry processing module 130, and the timing module 140 in the system architecture 100.
The entry obtaining module 110 is configured to obtain a data entry in a data table, for example, if the data table is stored in a database, a memory, or a software platform, the entry obtaining module 110 may obtain the data entry in the corresponding data table from the database, the memory, or the software platform, so as to obtain key information in the data entry. The information detection module 120 is configured to perform matching comparison on each data entry in the data table, for example, the information detection module 120 may perform matching comparison on the data table stored in the memory according to the key information of the relevant data entry in the data table stored in the database, and search the data table stored in the memory for the data entry containing the same key information as the key information. The table entry processing module 130 is configured to perform operation processing on each data table entry in the data table, for example, the table entry processing module 130 may perform deletion operation on each data table entry in the data table obtained by the table entry obtaining module, and may also perform write operation on each data table entry in the data table. The timing module 140 is used to calculate the running time and set the time interval, for example, the timing module 140 may calculate the system running time, and when the calculated system running time reaches the set time, the timing module 140 sends a trigger signal to trigger the entry obtaining module 110 to obtain the data entries in the corresponding data table from the database.
The system architecture and the application scenario described in the embodiment of the present invention are for more clearly illustrating the technical solution of the embodiment of the present invention, and do not form a limitation on the technical solution provided in the embodiment of the present invention, and it is known to those skilled in the art that the technical solution provided in the embodiment of the present invention is also applicable to similar technical problems with the evolution of the system architecture and the occurrence of new application scenarios.
Those skilled in the art will appreciate that the architecture of the system architecture 100 shown in FIG. 1 is not intended to be limiting of embodiments of the present invention and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
Based on the structure of the system architecture, various embodiments of the data table synchronization method of the present invention are provided.
Fig. 2 is a flow chart of a data table synchronization method provided by an embodiment of the present invention, for example, the data table synchronization method can be applied to a data exchange device, and the data table synchronization method includes, but is not limited to, step S100, step S200, and step S300.
Step S100, a first data table entry from a first data table is obtained, where the first data table is stored in a database, and the first data table entry includes first key information.
In one embodiment, since the first data table is stored in the database, and the database belongs to a software-level technology, obtaining the first data table from the database can have a better processing speed; in addition, because the operation of the database (such as the operation of creating a new data table or backing up a data table) is more flexible, the efficiency and the success rate of the data table synchronization by using the first data table in the subsequent steps can be improved.
In an embodiment, the first data table may be a student achievement registration table, a staff management table, or a MAC address table, which is not limited in this embodiment. For example, when the first data table is a MAC address table, the obtaining of the first data table entry from the first data table may specifically be obtaining the first MAC address table entry from a MAC address table of a database, where the first MAC address table entry may include MAC information or Virtual Local Area Network (VLAN) information, or include Virtual forwarding Instance (VSI) information, or include MAC information and VLAN information.
In an embodiment, the first key information may include one or more keywords, which is not limited in this embodiment. For example, the first key information in the first data entry may be a name of a worker, may be a work number, and may further include the name of the worker and the work number; for another example, the first key information in the first data entry may be MAC information, may be VLAN information, and may also include MAC information and VLAN information.
In an embodiment, the obtaining of the first data table entry from the first data table may be periodic obtaining or triggered according to a signal, which is not specifically limited in this embodiment. For example, a time interval for acquiring the first data table entry is set, and the first data table entry of the first data table is acquired from the database once every time the system running time reaches the set time interval; for another example, when a trigger signal for acquiring the first data table entry is received, the first data table entry of the first data table is acquired one time in response to the trigger signal.
And step S200, matching in a second data table according to the first key information to obtain a matching result, wherein the second data table is stored in a memory, and the first data table is obtained according to the second data table.
In an embodiment, after obtaining the first data entry, scanning a second data table stored in the memory by using first key information carried by the first data entry as an index, performing matching on the first key information in the second data table, searching a data entry containing key information identical to the first key information in the second data table, and obtaining a matching result according to the data entry. For example, when the data table entry containing the key information identical to the first key information is not found in the second data table, the matching result is a failure; and when the data table item containing the key information which is the same as the first key information is found in the second data table, the matching result is successful.
It is noted that the first data table is a mapping data table of the second data table, i.e. the first data table is based on the second data table.
And step S300, carrying out corresponding synchronous operation on the first data table and a third data table according to the matching result, wherein the third data table is consistent with the first data table, and the third data table is stored in the software platform.
In an embodiment, according to a matching result obtained by matching the first key information in the second data table, a processing operation corresponding to the matching result is performed on the first data table and the third data table, when the matching result is successful, that is, a data entry of the key information that is the same as the first key information can be found in the second data table, and because the third data table is consistent with the first data table, for the current data entry, it can be considered that the first data table, the second data table, and the third data table are synchronized, so that the content of the current data entry of the first data table and the content of the current data entry of the third data table can be maintained. When the matching result is unsuccessful, that is, the data table entry of the key information which is the same as the first key information cannot be searched in the second data table, therefore, the content of the current data table entry of the first data table can be updated and synchronized according to the second data table, and because the third data table is consistent with the first data table, the content of the current data table entry of the third data table can be updated and synchronized while the content of the current data table entry of the first data table is updated and synchronized according to the second data table.
In an embodiment, by using the data table synchronization method including the above steps S100, S200, and S300, a first data table entry including first key information is obtained from a first data table of a database, since the first data table is a data table created according to a second data table, a matching comparison is performed in the second data table of a memory for the first key information in the first data table entry, so as to obtain a matching result, and according to the matching result, a corresponding synchronization processing operation is performed on the first data table and a third data table stored in a software platform, since the third data table is consistent with the first data table and the first data table stored in the database has better flexibility than the second data table stored in the memory, the second data table and the third data table stored in the software platform are synchronized by the first data table, the method can improve the synchronization success rate of the hardware table in the switch and the software table in the software platform, thereby reducing the probability of management confusion of the switch.
In addition, in an embodiment, referring to fig. 3, the step S100 of obtaining the first data entry from the first data table may include, but is not limited to, the following steps:
step S110, periodically obtain a first data entry from the first data table.
In an embodiment, the obtaining of the first data table entry of the first data table may be periodic, and the first data table entry in the first data table may be obtained once by setting a time interval for obtaining the first data table entry whenever the system running time reaches a preset time interval, so that the first data table entry of the first data table is periodically obtained, and thus, the synchronization of the second data table and the third data table may be periodically performed in subsequent steps.
In addition, in an embodiment, referring to fig. 4, the step S110 of periodically acquiring the first data table entry from the first data table may include, but is not limited to, the following steps:
step S410, determining a utilization rate of the processor at intervals of a preset time, and obtaining a first data entry from the first data table according to the utilization rate.
In one embodiment, a first data table entry from a first data table may be obtained based on a utilization of a processor. For example, a preset time may be set, the utilization rate of the processor is determined every preset time, and in the current time interval, if the current utilization rate of the processor is smaller than the utilization rate threshold, it is stated that the processor is currently in an idle state, so that the first data entry from the first data table can be obtained and the subsequent synchronization processing can be performed by using the first data entry without affecting other processes. In addition, if the current utilization rate of the processor reaches or exceeds the utilization rate threshold, that is, the processor is currently in a busy state, if the first data table entry from the first data table is obtained and the first data table entry is utilized to perform subsequent synchronization processing, normal operation of other program services may be affected, and therefore, the obtaining operation of the first data table entry is not performed.
In addition, in an embodiment, referring to fig. 5, the synchronizing operation performed on the first data table and the third data table according to the matching result in step S300 may include, but is not limited to, the following steps:
in step S510, when the matching result is failure, the first data entry in the first data table and the first data entry in the third data table are deleted.
In an embodiment, when the matching result is a failure, that is, the second data table does not find a data entry containing the same key information as the first key information, and the first data table and the third data table are data tables created according to the second data table, that is, the first data table and the third data table are based on the second data table, the content of the current data entry of the first data table can be updated and synchronized according to the second data table, that is, the first data entry in the first data table is deleted, and the third data table is consistent with the first data table, so that the first data entry in the third data table is deleted while the first data entry in the first data table is deleted.
In addition, in an embodiment, referring to fig. 6, the synchronizing operation performed on the first data table and the third data table according to the matching result in step S300 may further include, but is not limited to, the following steps:
step S610, when the matching result is successful, perform a first processing operation on the first data table and the third data table.
It should be noted that step S610 in the present embodiment and step S510 in the embodiment shown in fig. 5 are parallel to each other.
In an embodiment, when the matching result is successful, that is, the data table entry including the key information that is the same as the first key information is found in the second data table, and the first data table and the third data table are data tables that are manufactured according to the second data table, that is, the first data table and the third data table are based on the second data table, therefore, the content of the current data table entry of the first data table can be updated and synchronized according to the second data table, that is, the first processing operation is performed on the first data table, and since the third data table is consistent with the first data table, the first processing operation is performed on the third data table while the first processing operation is performed on the first data table.
In an embodiment, the first processing operation is to perform an update synchronization operation on the data table in order to improve a synchronization success rate of the hardware table in the switch and the software table in the software platform, and the first processing operation may include multiple ways, which is not limited in this embodiment. For example, the first processing operation may be to maintain a data table entry of the data table, or may be to delete a data table entry of the data table; for another example, the first processing operation may be to perform matching comparison in the data table according to the key information to obtain a comparison result, and perform update synchronization operation on the data table according to the comparison result.
In addition, in an embodiment, referring to fig. 7, the performing the first processing operation on the first data table and the third data table in step S610 may include, but is not limited to, the following steps:
step S710, when the port information corresponding to the first data entry in the first data table is inconsistent with the port information corresponding to the first data entry in the second data table, deleting the first data entry in the first data table and the first data entry in the third data table.
In an embodiment, the first data table, the second data table, and the third data table are all MAC address tables, and the first data table entry includes port information, and when the matching result is successful, that is, when a data table entry including key information that is the same as the first key information is found in the second data table, the port information corresponding to the first data table entry in the first data table is compared with the port information corresponding to the first data table entry in the second data table. When the port information corresponding to the first data table entry in the two data tables is inconsistent, for the current data table entry, the first data table and the second data table are considered to be asynchronous, and the first data table needs to be updated and synchronized, that is, the first data table entry in the first data table is deleted.
In addition, in an embodiment, referring to fig. 8, the performing the first processing operation on the first data table and the third data table in step S610 may include, but is not limited to, the following steps:
step S810, when the port information corresponding to the first data entry in the first data table is consistent with the port information corresponding to the first data entry in the second data table, maintaining the first data table and the third data table.
It should be noted that step S810 in this embodiment is parallel to step S710 in the embodiment shown in fig. 7.
In an embodiment, the first data table, the second data table, and the third data table are all MAC address tables, and the first data table entry includes port information, and when the matching result is successful, that is, when a data table entry including key information that is the same as the first key information is found in the second data table, the port information corresponding to the first data table entry in the first data table is compared with the port information corresponding to the first data table entry in the second data table. When the port information of the first data table entry in the two data tables is consistent, the third data table is consistent with the first data table, so that the current data table entry can be considered to be synchronized with the first data table, and the content of the current data table entry of the first data table and the content of the current data table entry of the third data table can be maintained.
In addition, in an embodiment, referring to fig. 9, the data table synchronization method may further include, but is not limited to, step S910, step S920, and step S930.
In step S910, a recording limit threshold is acquired.
In one embodiment, obtaining a limit logging threshold for limiting the number of data table entries, wherein the limit logging threshold for limiting the number of data table entries recorded by the switch, may be obtained from a plurality of aspects. For example, the limit record threshold may be obtained after the platform issues the limit record threshold, or may be obtained from data table capacity data preset by the machine device. The record limit threshold may be a limit for the number of all entries of the data table in the memory, or a limit for the number of corresponding entries in the memory, for example, when the data table is a staff management table, the data table entry includes the following key information: department and gender, the record limiting threshold may be used to limit the number of all entries in the staff management table, or may be used to limit the number of entries in the staff management table containing key information that gender is male. By limiting the data table entry recording threshold of the data table, the synchronization success rate of a hardware table in the switch and a software table in the software platform can be improved, and therefore the probability of management confusion of the switch can be reduced.
Step S920, acquiring the number of entries recorded in the first data table.
In an embodiment, in the process of limiting the number of data entries, when a data entry including key information that is the same as the first key information is found in the second data table, and port information of the first data entry in the first data table is consistent with port information of the first data entry in the second data table, it is considered that the software table in the switch is synchronized with the hardware table, and the first data table stored in the software database has better flexibility than the second data table stored in the memory. And acquiring a first data table from the database according to the record limiting threshold value, and calculating the number of corresponding table entries recorded in the first data table. When the data table is an MAC address table, judging data table item information in the first data table, judging whether a static flag bit in the data table item is 0, and when the first data table contains the data table item with the static flag bit being 1, namely the first data table contains a static MAC address, not operating the first data table; when the first data table does not contain the data table item with the static flag bit of 1, that is, when the first data table only contains the dynamic MAC address, the number of the MAC addresses which are learned and recorded by the switch is limited.
In an embodiment, when the data table is a MAC address table, the number of entries of the data table may be counted based on port, VLAN or device-based data table entry number limitation. When the MAC address is limited based on the port, namely the MAC address in one port is limited, the number of data table items containing the port information in the data table is calculated; when the MAC address is limited based on the VLAN, namely the MAC address in a virtual local area network is limited, the number of data table items containing the VLAN information in a data table is calculated; when the MAC address is limited based on the equipment, namely the number of the MAC addresses stored in the whole equipment is limited, the number of the MAC addresses in the current equipment is calculated.
Step S930, performing a second processing operation on the first data table, the second data table, and the third data table according to the number of entries and the recording limit threshold.
In an embodiment, after the recording-limiting threshold and the number of entries recorded by the first data table are obtained, the recording-limiting threshold is compared with the number of entries to obtain different comparison results. And performing corresponding second processing operation on the first data table stored in the database, the second data table stored in the memory and the third data table stored in the software platform according to different obtained results. When a data table item containing key information which is the same as the first key information is found in the second data table, and the port information of the first data table item corresponding to the first data table item in the first data table is consistent with the port information of the first data table item corresponding to the second data table, the software data table and the hardware data table of the switch are considered to be synchronous, and the first data table stored in the software database has better flexibility than the second data table stored in the memory.
In addition, in an embodiment, referring to fig. 10, the second processing operation performed on the first data table, the second data table, and the third data table according to the number of entries and the limit record threshold in step S930 may include, but is not limited to, the following steps:
step S101: and when the number of the table entries is less than or equal to the limit recording threshold value, maintaining the first data table, the second data table and the third data table.
In an embodiment, the number of entries is compared with the recording limit threshold to obtain a comparison result, when the number of entries is less than or equal to the recording limit threshold, it is indicated that the number of data entries of the first data table does not exceed the recording limit threshold, recording and saving can be continued in the first data table, because the first data table is a data table created according to the second data table, and the third data table is consistent with the first data table, the first data table and the third data table are based on the second data table, it can be considered that the number of data entries corresponding to the first data table, the second data table, and the third data table does not exceed the recording limit threshold, recording and saving can be continued, and the first data table, the second data table, and the third data table can be maintained.
In an embodiment, when the number of entries is less than or equal to the limit record threshold, a second processing operation is performed on the first data table, the second data table, and the third data table, and the second processing operation may also be to maintain the first data table, the second data table, and the third data table, and limit the maximum number of entries of the first data table, the maximum number of entries of the second data table, and the maximum number of entries of the third data table to the limit record threshold, so that the maximum number of entries of each of the first data table, the second data table, and the third data table can be limited, the synchronization success rate of the hardware table in the switch and the software table in the software platform is improved, and the probability of management confusion of the switch can be reduced.
In addition, in an embodiment, referring to fig. 11, the second processing operation performed on the first data table, the second data table, and the third data table according to the number of entries and the limit record threshold in step S930 may include, but is not limited to, the following steps:
step S111: and when the number of the entries is greater than the record limiting threshold value, deleting the entries in the first data table, the entries in the second data table and the entries in the third data table, and limiting the maximum number of the entries in the first data table, the maximum number of the entries in the second data table and the maximum number of the entries in the third data table to be the record limiting threshold value.
It should be noted that step S111 in this embodiment is parallel to step S101 in the embodiment shown in fig. 10.
In an embodiment, the number of entries is compared with the recording limit threshold to obtain a comparison result, and when the number of entries is greater than the recording limit threshold, which indicates that the number of entries of the first data table exceeds the recording limit threshold, a limiting operation needs to be performed on the data table so that the number of entries of the first data table is limited within a range that does not exceed the recording limit threshold. Since the first data table is a data table created according to the second data table, and the third data table is consistent with the first data table, the first data table and the third data table are based on the second data table, therefore, the number of entries of the first data table exceeds the limit record threshold, that is, the number of entries of the second data table and the number of entries of the third data table both exceed the limit record threshold, deletion of entries of the first data table, entries of the second data table and entries of the third data table is required, and the maximum number of entries of the first data table, the maximum number of entries of the second data table and the maximum number of entries of the third data table are limited to the limit record threshold, so that the number of entries of the first data table, the number of entries of the second data table and the number of entries of the third data table do not exceed the limit record threshold during record storage of the first data table, the second data table and the third data table, the method can improve the synchronization success rate of the hardware table in the switch and the software table in the software platform, thereby reducing the probability of management confusion of the switch.
In an embodiment, the data table is a MAC address table, the number of entries is a MAC address number, the limit recording threshold is a maximum learning number, the limit recording threshold is used to limit the number of MAC addresses of a port or a VLAN or the number of MAC addresses stored in the switch device, the number of MAC addresses of corresponding ports in the MAC address table of the database or the number of MAC addresses of corresponding VLANs or the number of MAC addresses in the current switch device is calculated, and the maximum learning number is compared. When the number of the table entries is larger than the record limiting threshold value, namely the number of the MAC addresses exceeds the maximum learning number, all the current MAC address table entries in the switch equipment are deleted, and the maximum number of the entries of the first data table, the maximum number of the entries of the second data table and the maximum number of the entries of the third data table are limited to be the record limiting threshold value, namely the maximum value of a bottom MAC address learning register in the switch is modified to be the record limiting threshold value. Therefore, when a data table item containing the key information which is the same as the first key information is found in the MAC address table stored in the memory, and the port information corresponding to the MAC address table item in the MAC address table stored in the database is consistent with the port information corresponding to the MAC address table item in the MAC address table stored in the memory, the software MAC address table and the hardware MAC address table of the switch are considered to be synchronous, the MAC address table stored in the memory and the MAC address table stored in the software platform are subjected to table item limiting operation through the MAC address table in the software database, rapid convergence can be realized in the process of limiting the number of MAC addresses stored by the switch equipment, the synchronization success rate of the hardware table in the switch and the software table in the software platform is improved, and the probability of management confusion of the switch can be reduced.
In some embodiments, after the current MAC address table entry in the switch device is completely deleted, data traffic triggers and learns the MAC address table entry, the learned MAC address table entry is stored in the MAC address table of the hardware memory, and the learned MAC address table entry is reported to the platform. Before reporting to the platform, the MAC address table item is stored in a software MAC address cache table, a feedback is obtained after reporting to the platform, when the feedback is reported successfully, the MAC address table item in the software MAC address cache table is deleted, and the MAC address table is stored in an MAC address table of a database and an MAC address table of the software platform; and when the report feedback fails, deleting the MAC address table entry in the MAC address table of the hardware memory by using the MAC address and the VSI of the MAC address table entry in the software MAC address cache table as indexes. Therefore, the success rate of synchronization of the hardware table in the switch and the software table in the software platform is improved. When the number of the MAC address table entries exceeds the maximum learning number again, the MAC address bottom learning is closed, the maximum learning number of the platform is utilized, the MAC address cache table is fed back to the software MAC address, the new MAC address recorded in the platform fails, the corresponding MAC address in the MAC address table of the hardware memory is deleted, and the learning of the MAC address cannot be triggered, so that the synchronization success rate of the hardware table in the switch and the software table in the software platform is improved, and the probability of management confusion of the switch can be reduced.
In order to more clearly describe the specific step flow of the network slice connection method in the above embodiments, a specific example is described below.
Example one:
as shown in fig. 12, fig. 12 is a flowchart of periodically performing MAC address table data table synchronization detection and operation according to an embodiment of the present invention, where the flowchart may be executed by a switch, and the flowchart specifically includes:
step S201, the running time exceeds a preset time interval;
step S202, determining the current utilization rate of the processor;
c201, is the current utilization rate of the processor not exceeding a set threshold? If yes, go to step S203; if not, go to step S206;
step S203, a first data table entry from the first data table is obtained, wherein the first data table entry comprises MAC information and VLAN information;
step S204, taking the MAC information and the VLAN information as indexes, and scanning the MAC address table item corresponding to a second data table in the hardware;
c202, is the corresponding MAC address table entry scanned? If yes, executing judgment C203; if not, go to step S205;
c203, is the port information of the MAC address entry in the first data table and the second data table consistent? If yes, go to step S206; if not, go to step S205;
step 205, deleting corresponding MAC address table entries in the first data table and the third data table;
and step 206, ending the synchronization process.
Example two:
as shown in fig. 13, fig. 13 is a flowchart for limiting the maximum number of entries in the MAC address table data table according to a specific example of the present invention, where the flowchart may be executed by a switch, and the flowchart specifically includes:
step S301, acquiring a recording limiting threshold;
step S302, a first data table in a database is obtained;
c301, is all the static flag bits in the MAC address table entry of the first data table 0? If yes, go to step S303; if not, executing step S307;
step S303, calculating the number of table entries in the first data table;
c302, is the number of entries above the limit record threshold? If yes, go to step S304; if not, executing step S306;
step S304, deleting the table entries in the first data table, the second data table and the third data table;
step S305, limiting the maximum number of entries of the first data table, the maximum number of entries of the second data table and the maximum number of entries of the third data table to a limit recording threshold value, and executing step S307;
step S306, maintaining a first data table, a second data table and a third data table;
in step S307, the present synchronization process is ended.
Example three:
as shown in fig. 14, fig. 14 is a flowchart of MAC address table data traffic triggered learning according to a specific example of the present invention, where the flowchart may be executed by a switch, and the flowchart specifically includes:
step S401, adding MAC address table items learned by data flow into a second hardware data table;
step S402, adding the MAC address table item into a software cache table and reporting to a platform;
step S403, adding the MAC address table entry received by the platform into a third software data table;
c401 is determined, is the MAC address table entry successfully added to the third data table of the software? If yes, go to step S404; if not, go to step S405;
step S404, adding the MAC address table item into a first data table of a database, deleting the MAC address table item in a software cache table, and executing step S406;
step S405, deleting the MAC address table entry in the second hardware data table by using the MAC address table entry in the cache table, and deleting the MAC address table entry in the software cache table;
in step S406, the present synchronization process is ended.
In addition, an embodiment of the present invention further provides a data table synchronization apparatus, including: memory, a processor, and a computer program stored on the memory and executable on the processor.
The processor and memory may be connected by a bus or other means.
The memory, which is a non-transitory computer readable storage medium, may be used to store non-transitory software programs as well as non-transitory computer executable programs. Further, the memory may include high speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, the memory optionally includes memory located remotely from the processor, and these remote memories may be connected to the processor through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
It should be noted that the data table synchronization apparatus in this embodiment may include a system architecture as in the embodiment shown in fig. 1, and the data table synchronization apparatus in this embodiment and the system architecture as in the embodiment shown in fig. 1 belong to the same inventive concept, so these embodiments have the same implementation principle and technical effect, and are not described in detail here.
The non-transitory software programs and instructions required to implement the data table synchronization method of the above-described embodiment are stored in the memory, and when executed by the processor, perform the data table synchronization method of the above-described embodiment, for example, perform the method steps S100 to S300 in fig. 2, the method step S110 in fig. 3, the method step S410 in fig. 4, the method step S510 in fig. 5, the method step S610 in fig. 6, the method step S710 in fig. 7, the method step S810 in fig. 8, the method steps S910 to S930 in fig. 9, the method step S101 in fig. 10, and the method step S111 in fig. 11 described above.
In addition, an embodiment of the present invention further provides a data switching device, which includes the data table synchronizing apparatus of the foregoing embodiment.
Since the data exchange device in this embodiment has the data table synchronization apparatus in the foregoing embodiment, the data exchange device in this embodiment has a hardware structure of the data table synchronization apparatus in the foregoing embodiment, and can enable a processor in the data table synchronization apparatus to call a program of the data table synchronization method stored in a memory, so as to implement the data table synchronization method for the data exchange device.
The above described embodiments of the apparatus are merely illustrative, wherein the units illustrated as separate components may or may not be physically separate, may be located in one place, or may be distributed over a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
Furthermore, an embodiment of the present invention further provides a computer-readable storage medium, which stores computer-executable instructions, which are executed by a processor or a controller, for example, by a processor in the above-mentioned data table synchronization apparatus embodiment, and can enable the processor to execute the network slice connection method in the above-mentioned embodiment, for example, execute the above-mentioned method steps S100 to S300 in fig. 2, the method step S110 in fig. 3, the method step S410 in fig. 4, the method step S510 in fig. 5, the method step S610 in fig. 6, the method step S710 in fig. 7, the method step S810 in fig. 8, the method steps S910 to S930 in fig. 9, the method step S101 in fig. 10, and the method step S111 in fig. 11.
One of ordinary skill in the art will appreciate that all or some of the steps, systems, and methods disclosed above may be implemented as software, firmware, hardware, and suitable combinations thereof. Some or all of the physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on computer readable media, which may include computer storage media (or non-transitory media) and communication media (or transitory media). The term computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data, as is well known to those skilled in the art. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, Digital Versatile Disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can accessed by a computer. In addition, communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media as known to those skilled in the art.
While the preferred embodiments of the present invention have been described in detail, it will be understood by those skilled in the art that the foregoing and various other changes, omissions and deviations in the form and detail thereof may be made without departing from the scope of this invention.

Claims (12)

1. A data table synchronization method is applied to electronic equipment and comprises the following steps:
obtaining a first data table entry from a first data table, wherein the first data table is stored in a database, and the first data table entry comprises first key information;
matching in a second data table according to the first key information to obtain a matching result, wherein the second data table is stored in a memory, and the first data table is obtained according to the second data table;
and carrying out corresponding synchronous operation on the first data table and a third data table according to the matching result, wherein the third data table is consistent with the first data table, and the third data table is stored in a software platform.
2. The data table synchronization method of claim 1, wherein the obtaining a first data table entry from a first data table comprises:
and determining the utilization rate of the processor every interval preset time, and acquiring a first data table item from the first data table according to the utilization rate.
3. The data table synchronization method according to claim 1, wherein the performing corresponding synchronization operations on the first data table and the third data table according to the matching result includes:
and when the matching result is failure, deleting the first data table entry in the first data table and the first data table entry in the third data table.
4. The method for synchronizing the data tables according to claim 1, wherein the performing corresponding synchronization operations on the first data table and the third data table according to the matching result comprises:
and when the matching result is successful, performing a first processing operation on the first data table and the third data table.
5. The data table synchronization method according to claim 4, wherein the first data table, the second data table, and the third data table are all Media Access Control (MAC) address tables, and the first data table, the second data table, and the third data table further include port information;
the performing a first processing operation on the first data table and the third data table includes:
and when the port information corresponding to the first data table entry in the first data table is inconsistent with the port information corresponding to the first data table entry in the second data table, deleting the first data table entry in the first data table and the first data table entry in the third data table.
6. The data table synchronization method of claim 5, wherein performing the first processing operation on the first data table and the third data table further comprises:
and when the port information corresponding to the first data table entry in the first data table is consistent with the port information corresponding to the first data table entry in the second data table, maintaining the first data table and the third data table.
7. A method for data table synchronization according to claim 5 or 6 wherein said first key information comprises MAC information and virtual local area network, VLAN, information.
8. The method of data table synchronization of claim 1, further comprising:
acquiring a limit record threshold;
acquiring the number of table entries recorded by the first data table;
and performing second processing operation on the first data table, the second data table and the third data table according to the number of the entries and the limit record threshold.
9. The data table synchronization method of claim 8, wherein performing the second processing operation on the first data table, the second data table, and the third data table according to the number of entries and the limit record threshold comprises:
when the number of entries is less than or equal to the limit record threshold, maintaining the first data table, the second data table, and the third data table;
or,
and when the number of the entries is greater than the record limiting threshold, deleting the entries in the first data table, the entries in the second data table and the entries in the third data table, and limiting the maximum number of the entries in the first data table, the maximum number of the entries in the second data table and the maximum number of the entries in the third data table to be the record limiting threshold.
10. A data table synchronization apparatus comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the data table synchronization method according to any one of claims 1 to 9 when executing the computer program.
11. A data switching apparatus comprising the data table synchronizing device according to claim 10.
12. A computer-readable storage medium storing computer-executable instructions for causing a computer to perform the method of data table synchronization of any one of claims 1 to 9.
CN202011118162.7A 2020-10-19 2020-10-19 Data table synchronization method and device, data exchange equipment and storage medium Withdrawn CN114448869A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202011118162.7A CN114448869A (en) 2020-10-19 2020-10-19 Data table synchronization method and device, data exchange equipment and storage medium
PCT/CN2021/114105 WO2022083266A1 (en) 2020-10-19 2021-08-23 Data table synchronization method and apparatus, data exchange device, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011118162.7A CN114448869A (en) 2020-10-19 2020-10-19 Data table synchronization method and device, data exchange equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114448869A true CN114448869A (en) 2022-05-06

Family

ID=81291545

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011118162.7A Withdrawn CN114448869A (en) 2020-10-19 2020-10-19 Data table synchronization method and device, data exchange equipment and storage medium

Country Status (2)

Country Link
CN (1) CN114448869A (en)
WO (1) WO2022083266A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115952172B (en) * 2023-03-08 2023-05-26 畅捷通信息技术股份有限公司 Data matching method and device based on database temporary table

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101729410A (en) * 2009-11-10 2010-06-09 中兴通讯股份有限公司 Synchronization method and device of media access control (MAC) address table
CN103944826A (en) * 2013-01-22 2014-07-23 杭州华三通信技术有限公司 Entry aggregation method in SPBM (shortest path bridging MAC mode) network and equipment
US20170322894A1 (en) * 2016-05-09 2017-11-09 International Business Machines Corporation Synchronous input/output computer system including hardware invalidation of synchronous input/output context
CN109873768A (en) * 2017-12-01 2019-06-11 华为技术有限公司 Update method, hardware accelerator, OVS and the server of forwarding table
WO2020135666A1 (en) * 2018-12-29 2020-07-02 中兴通讯股份有限公司 Message processing method and device, and computer storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9755947B2 (en) * 2010-05-18 2017-09-05 Intel Corporation Hierarchical self-organizing classification processing in a network switch
CN101923566A (en) * 2010-06-24 2010-12-22 浙江协同数据系统有限公司 Data increment extraction method based on trigger
CN109634846B (en) * 2018-11-16 2021-10-19 武汉达梦数据库股份有限公司 ETL software testing method and device
CN109739936A (en) * 2019-01-23 2019-05-10 杭州数梦工场科技有限公司 Method of data synchronization, system, server and computer readable storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101729410A (en) * 2009-11-10 2010-06-09 中兴通讯股份有限公司 Synchronization method and device of media access control (MAC) address table
CN103944826A (en) * 2013-01-22 2014-07-23 杭州华三通信技术有限公司 Entry aggregation method in SPBM (shortest path bridging MAC mode) network and equipment
US20170322894A1 (en) * 2016-05-09 2017-11-09 International Business Machines Corporation Synchronous input/output computer system including hardware invalidation of synchronous input/output context
CN109873768A (en) * 2017-12-01 2019-06-11 华为技术有限公司 Update method, hardware accelerator, OVS and the server of forwarding table
WO2020135666A1 (en) * 2018-12-29 2020-07-02 中兴通讯股份有限公司 Message processing method and device, and computer storage medium

Also Published As

Publication number Publication date
WO2022083266A1 (en) 2022-04-28

Similar Documents

Publication Publication Date Title
EP3418877B1 (en) Data writing and reading method and apparatus, and cloud storage system
US10831612B2 (en) Primary node-standby node data transmission method, control node, and database system
US8391289B1 (en) Managing a forwarding table in a switch
CN107547243B (en) Message forwarding method and device
EP3451597B1 (en) Packet forwarding
CN105138571B (en) Distributed file system and method for storing massive small files
US20200328914A1 (en) Packet transmission
CN108011958B (en) Network device and MAC address table synchronization method
CN108762668B (en) Method and device for processing write conflict
CN109274592B (en) MAC address table item processing method and device and computer readable medium
CN112333099B (en) Routing method, device and storage medium of local multipath message
US20180039505A1 (en) Preventing flow interruption caused by migration of vm
CN106789859B (en) Message matching method and device
CN109218458B (en) Writing method and device of MAC address and computer readable storage medium
CN114448869A (en) Data table synchronization method and device, data exchange equipment and storage medium
CN114244810A (en) Virtual IP management method, device, electronic equipment and storage medium
CN112491722B (en) Address table maintenance method, device and equipment
CN105939203B (en) List item synchronous method and device
CN109347746B (en) MAC address learning method and device
CN111400248A (en) Method for writing data and recovering data and file system
CN112804276A (en) Virtualization broadband remote access server, control method thereof and communication system
CN108307001A (en) MAC address aging method, apparatus and electronic equipment
US20240244414A1 (en) Session binding relationship processing method and apparatus, electronic device, and readable medium
CN110049149B (en) MAC address learning method and device and distributed equipment
CN110765190B (en) Automatic database cluster capacity expansion method and device and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WW01 Invention patent application withdrawn after publication

Application publication date: 20220506

WW01 Invention patent application withdrawn after publication