Address port self-learning method and device, electronic equipment and storage medium

The address port self-learning method automates the updating of data exchange device connections, addressing the inefficiencies of manual resetting by using data frame parsing and feedback to optimize terminal device connections.

CN119211201APending Publication Date: 2024-12-27TIANJIN JINHANG COMP TECH RES INST
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411384785.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-30
Publication Date
2024-12-27

AI Technical Summary

Technical Problem

The connection relationship between data ports of data exchange devices and data interfaces of terminal devices is fixed, requiring time-consuming and labor-intensive manual resetting when terminal devices are replaced.

Method used

An address port self-learning method that automatically updates the connection relationship by parsing service data frames, comparing addresses and port numbers, and using feedback information to update mapping tables, enabling efficient and automated adjustments.

Benefits of technology

The method saves time and manpower by automatically updating mapping tables, improving the efficiency of data transmission paths without manual intervention.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119211201A_ABST
    Figure CN119211201A_ABST
Patent Text Reader

Abstract

The invention provides an address port self-learning method. The method comprises the following steps: data exchange equipment receives service data sent by first terminal equipment; the data exchange equipment analyzes the service data to obtain a service data frame; if the historical address which is the same as the destination address does not exist in the mapping table, comparing the first mapping relation with the second mapping relation; if the first mapping relation is different from the second mapping relation, updating the source address and the data port number corresponding to the source address into a mapping table; packaging the service data frame to obtain service data, and broadcasting the service data to the first terminal device and the second terminal device; receiving feedback information returned by a second terminal device corresponding to the destination address; and updating the number of the data port connected with the second terminal device and the address of the second terminal device corresponding to the destination address to the mapping table according to the feedback information. According to the method, time and manpower are saved, and the updating efficiency of the transmission path of the service data is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of address port self-learning technology, and in particular to an address port self-learning method, device, electronic device and storage medium. Background Art

[0002] Common communication systems generally include terminal devices and data exchange devices. Terminal devices are nodes that generate and receive data with a single data interface; data exchange devices are data transceiver nodes with multiple data ports, and the data ports of the data exchange devices are respectively connected to the data interfaces of the terminal devices. Each terminal device can communicate with each other based on the data exchange device.

[0003] In the prior art, the connection relationship between the data interface of the terminal device and the various data ports of the data forwarding device is fixed. If the terminal device is replaced, the data forwarding device needs to reset the connection relationship between the data ports of each data exchange device and the data interface of the terminal device in order to determine which terminal device sends the data to the data exchange device through which interface. The above setting process is time-consuming and labor-intensive.

[0004] Therefore, resetting the connection relationship between the data port of each data exchange device and the data interface of the terminal device is time-consuming and labor-intensive, which is an existing problem.

[0005] Application Contents In view of this, the purpose of the present application is to provide an address port self-learning method, device, electronic device and storage medium to solve the above problems, realize automatic updating of the connection relationship between the data port of each data exchange device and the data interface of the terminal device, and save time and manpower.

[0006] In a first aspect, an embodiment of the present application provides an address port self-learning method, which is applied to a data switching device, and the method includes: The data exchange device receives the service data sent by the first terminal device; The data exchange device parses the service data to obtain a service data frame; wherein the service data frame includes: a source address, a destination address and a data port number corresponding to the source address; The data exchange device compares the destination address with each historical address recorded in the mapping table to obtain a first comparison result; If the first comparison result indicates that there is no historical address identical to the destination address in the mapping table, the data exchange device compares the first mapping relationship and the second mapping relationship to obtain a second comparison result; wherein the first mapping relationship is a mapping relationship between the source address and the data port number, and the second mapping relationship is a mapping relationship between each historical address recorded in the mapping table and a historical data port number corresponding to each historical address; If the second comparison result indicates that the first mapping relationship and the second mapping relationship are different, the data exchange device updates the source address and the data port number corresponding to the source address into the mapping table; The data exchange device encapsulates the service data frame to obtain the service data, and broadcasts the service data to the first terminal device and the second terminal device; The data exchange device receives feedback information returned by the second terminal device corresponding to the destination address; wherein the feedback information includes the data port number to which the second terminal device corresponding to the destination address is connected and the address of the second terminal device corresponding to the destination address; The data exchange device updates the data port number of the second terminal device corresponding to the destination address and the address of the second terminal device corresponding to the destination address into the mapping table according to the feedback information.

[0007] Preferably, the method further comprises: If the first comparison result indicates that there is a historical address identical to the destination address in the mapping table, the data exchange device encapsulates the service data frame to obtain the service data, and sends the service data to a second terminal device corresponding to the destination address.

[0008] Preferably, the step of sending the service data to the second terminal device corresponding to the destination address includes: The data exchange device extracts information from the service data frame to obtain a mapping relationship between the destination address and the data port number; The data exchange device sends the service data to the second terminal device according to the mapping relationship between the destination address and the data port number.

[0009] Preferably, the data exchange device comprises: a storage module and an address port self-learning module; the method further comprises: The address port self-learning module sends a table lookup instruction to the storage module; The storage module sends the mapping table to the address port self-learning module according to the table lookup instruction; The address port self-learning module reads the mapping table to obtain the second mapping relationship.

[0010] Preferably, the storage module comprises: a RAM, a first RAM interface and a table lookup instruction parsing module; the step of the storage module sending the mapping table to the address port self-learning module according to the table lookup instruction comprises: The table lookup instruction module parses the table lookup instruction to obtain a read instruction; The RAM sends the mapping table to the address port self-learning module through the first RAM interface according to the read instruction.

[0011] Preferably, the method further comprises: The address port self-learning module sends an update instruction to the storage module; The storage module stores the mapping table according to the update instruction.

[0012] Preferably, the storage module further includes a second RAM interface and an update instruction parsing module; The step of storing the mapping table by the storage module according to the update instruction comprises: The update instruction parsing module parses the update instruction to obtain a write instruction; The RAM stores the mapping table through the second RAM interface based on the write instruction.

[0013] The address port self-learning method provided in this application brings the following beneficial effects: The present application provides an address port self-learning method, in which if the first mapping relationship and the second mapping relationship are not the same, the data exchange device updates the source address and the data port number corresponding to the source address into the mapping table, and if the first mapping relationship and the second mapping relationship are not the same, the data port number of the second terminal device connected to the destination address and the address of the second terminal device corresponding to the destination address are updated into the mapping table according to feedback information. The method can automatically update the mapping table, save time and manpower, and improve the update efficiency of the transmission path of the service data.

[0014] In a second aspect, the present application further provides an address port self-learning device, the device comprising: An acquisition module, used for receiving the service data sent by the first terminal device; A data processing module, used to parse the service data to obtain a service data frame; wherein the service data frame includes: a source address, a destination address and a data port number corresponding to the source address; The data processing module is further used to compare the destination address with each historical address recorded in the mapping table to obtain a first comparison result; The data processing module is further configured to compare the first mapping relationship and the second mapping relationship to obtain a second comparison result if the first comparison result indicates that there is no historical address identical to the destination address in the mapping table; wherein the first mapping relationship is a mapping relationship between the source address and the data port number, and the second mapping relationship is a mapping relationship between each historical address recorded in the mapping table and a historical data port number corresponding to each historical address; The data processing module is further configured to update the source address and the data port number corresponding to the source address into the mapping table if the second comparison result indicates that the first mapping relationship and the second mapping relationship are different; The data processing module is further used to encapsulate the service data frame to obtain the service data, and broadcast the service data to the first terminal device and the second terminal device; The acquisition module is further used to receive feedback information returned by the second terminal device corresponding to the destination address; wherein the feedback information includes the data port number to which the second terminal device corresponding to the destination address is connected and the address of the second terminal device corresponding to the destination address; The data processing module is further used to update the data port number of the second terminal device corresponding to the destination address and the address of the second terminal device corresponding to the destination address into the mapping table according to the feedback information.

[0015] An address port self-learning device provided in an embodiment of the present application has the same technical features as the address port self-learning provided in the above embodiment, so it can also solve the same technical problems and achieve the same technical effects.

[0016] In a third aspect, the present application also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the beneficial effects of any of the methods described above are achieved, which will not be repeated here.

[0017] In a fourth aspect, the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the beneficial effects of any of the methods described above are achieved, which will not be repeated here.

[0018] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or understood by practicing the present application. The purpose and other advantages of the present application are realized and obtained by the structures particularly pointed out in the description and the drawings.

[0019] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the specific implementation methods of the present application or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0021] Figure 1 A flowchart of an address port self-learning method provided in an embodiment of the present application; Figure 2 A schematic diagram of a connection method between a data exchange device provided in an embodiment of the present application and a first terminal device and a second terminal device; Figure 3 A schematic diagram of the structure of a data exchange device provided in an embodiment of the present application; Figure 4 A schematic diagram of the storage module structure provided in an embodiment of the present application; Figure 5 A schematic diagram of the structure of an address port self-learning device provided in an embodiment of the present application; Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.

[0022] Reference numerals DETAILED DESCRIPTION In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution of the present application will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present application.

[0023] To facilitate understanding of this embodiment, the embodiments of the present application are described in detail below.

[0024] The present application embodiment provides an address port self-learning method, which is applied to a data exchange device, such as Figure 1 As shown, Figure 1 A flowchart of an address port self-learning method provided in an embodiment of the present application. The method comprises the following steps: S101, the data exchange device 200 receives service data sent by a first terminal device. Specifically, Figure 2 As shown, Figure 2 A schematic diagram of a connection method between a data exchange device 200 provided in an embodiment of the present application and a first terminal device and a second terminal device. The type of the first terminal device includes at least one of the following: a first serial port device 300, a first network device 400, and a first optical fiber device 500. If the first terminal device is the first serial port device 300, the service data is serial port service data; if the first terminal device is the first network device 400, the service data is network service data; if the first terminal device is the first optical fiber device 500, the service data is optical fiber service data. The data exchange device 200 can support the connection of different types of first terminal devices, and support receiving different types of service data and processing different types of service data.

[0025] S102: The data exchange device parses the service data to obtain a service data frame.

[0026] The service data frame includes: a source address, a destination address and a data port number corresponding to the source address.

[0027] Specifically, the data exchange device 200 parses the service data into service data frames so as to forward the service data according to the service data frames. Take the first terminal device (first serial port device 300) as an example for introduction. The address of the first terminal device (first serial port device 300) is 0001, the port number of the data exchange device 200 to which the first terminal device (first serial port device 300) is connected is 01, the first terminal device (first serial port device 300) wants to send service data to the second terminal device (second serial port device 301), and the address of the second terminal device (second serial port device 301) is 0010. After receiving the serial port service data, the data exchange device 200 parses the serial port service data to obtain a serial port service data frame. The serial port service data frame includes a source address 0001 and a destination address 0010. The data port number corresponding to the source address 0001 is 01. Among them, the second terminal device also includes a second optical fiber device 501 and a second network device 401, which will not be repeated here.

[0028] S103, the data exchange device determines whether there is a historical address identical to the destination address in the mapping table, if so, execute step S109, if not, execute step S104.

[0029] Specifically, a mapping table is stored in the data exchange device 200, and a plurality of historical addresses are stored in the mapping table. The network service data mapping table is taken as an example for introduction. As shown in Table 1, Table 1 is a network service data mapping table.

[0030] Table 1: Table address Flag bit (1 bit) Historical address (48 bits) Data port number (8 bits) 0 1 123456781111 01 1 1 123456782222 02 2 0 000000000000 00 The table entry address in the network service data mapping table is used to characterize the order in which the historical addresses are stored in the network service data mapping table. The data exchange device 200 parses the network service data sent by the first network device 400 to obtain a network service data frame. If the destination address in the network service data frame is 123456781111 or 123456782222, it means that there is a historical address in the network service data mapping table that is the same as the destination address in the network service data frame. At this time, step S109 will be executed, that is, the data exchange device 200 encapsulates the network service data frame to obtain network service data, and sends the network service data to the second terminal device (second network device 401) corresponding to the destination address (123456781111 or 123456782222).

[0031] If the destination address in the network service data frame is different from 123456781111 and 123456782222, it means that there is no historical address in the network service data mapping table that is the same as the destination address in the network service data frame. In this case, step S104 is executed.

[0032] As can be seen from the above, the data exchange device 200 can accurately determine the second terminal device to which the service data needs to be sent according to the mapping table.

[0033] S104, the data exchange device determines whether the first mapping relationship and the second mapping relationship are the same, if so, execute step S106, if not, execute step S105.

[0034] The first mapping relationship is a mapping relationship between a source address and a data port number, and the second mapping relationship is a mapping relationship between each historical address recorded in the mapping table and a historical data port number corresponding to each historical address.

[0035] Specifically, the mapping relationship between the source address and the data port number in the network service data frame is taken as an example for introduction. The data exchange device 200 parses the network service data sent by the first network device 400 to obtain a network service data frame. If the mapping relationship between the source address and the data port number in the network service data frame is 123456781111-01 or 123456782222-02, it means that the first mapping relationship is the same as the second mapping relationship. At this time, step S106 will be executed, that is, the data exchange device 200 encapsulates the network service data frame to obtain network service data, and broadcasts the network service data to the first terminal device (the first network device 400) and the second terminal device (the second network device 401).

[0036] S105: The data exchange device updates the source address and the data port number corresponding to the source address into a mapping table.

[0037] Specifically, the source address and the data port number corresponding to the source address are used as an example for introduction. If the mapping relationship between the source address and the data port number is 123456783333-03, it means that the first mapping relationship is different from the second mapping relationship, and 123456783333-03 will be recorded in the above Table 1.

[0038] With such a configuration, if the second terminal device (second network device 401) sends new network service data to the first terminal device (first network device 400), the source address 123456783333 is the destination address of the new network service data. Since the mapping relationship 123456783333-03 between the source address and the data port number has been updated in the network service data mapping table, the data exchange device 200 can directly send the new network service data to the first terminal device (first network device 400) according to the mapping relationship 123456783333-03 between the source address and the data port number, without repeatedly updating the second mapping relationship in the network service data mapping table.

[0039] S106: The data exchange device encapsulates the service data frame to obtain service data, and broadcasts the service data to the first terminal device and the second terminal device.

[0040] Specifically, if there is no historical address in the network service data mapping table that is the same as the destination address in the network service data frame, the data port number corresponding to the destination address cannot be determined, and thus the data exchange device 200 cannot forward the service data to the second terminal device connected to the data port number corresponding to the destination address. At this time, the data exchange device 200 will send the service data to both the first terminal device and the second terminal device. With this configuration, the second terminal device connected to the data port number corresponding to the destination address will definitely receive the service data so as to return feedback information to the data exchange device 200.

[0041] S107: The data exchange device receives feedback information returned by the second terminal device corresponding to the destination address.

[0042] The feedback information includes the data port number to which the second terminal device corresponding to the destination address is connected and the address of the second terminal device corresponding to the destination address.

[0043] Specifically, the broadcasting of network service data is taken as an example for introduction. The data exchange device 200 broadcasts the network service data to the first terminal device (first network device 400) and the second terminal device (second network device 401). When the second terminal device (second network device 401) receives the network service data, the data port number of the second terminal device connected corresponding to the destination address in the network service data and the address of the second terminal device corresponding to the destination address are fed back to the data exchange device 200, so that the data exchange device 200 updates the network service data mapping table according to the feedback information.

[0044] S108: The data exchange device updates the data port number to which the second terminal device corresponding to the destination address is connected and the address of the second terminal device corresponding to the destination address into the mapping table according to the feedback information.

[0045] Specifically, take network service data as an example. If the destination address of the network service data is 123456784444 and the corresponding data port number of the second terminal device is 04, the feedback information includes 123456784444-04. The data exchange device 200 stores 123456784444-04 in the network service data mapping table.

[0046] With such a configuration, if the first terminal device (first network device 400) sends new network service data to the second terminal device (second network device 401), since the data port number 04 to which the second terminal device (second network device 401) corresponding to the above-mentioned destination address 123456784444 is connected and the address 123456784444 of the second terminal device (second network device 401) corresponding to the destination address 123456784444 have been updated in the network service data mapping table, the data exchange device 200 can directly send the new network service data to the second terminal device (second network device 401) according to the mapping relationship 123456784444-04 between the destination address and the data port number, without the need to repeatedly update the network service data mapping table.

[0047] S109, the data exchange device encapsulates the service data frame to obtain service data, and sends the service data to the second terminal device corresponding to the destination address.

[0048] Specifically, since the data exchange device 200 determines that there is a historical address identical to the destination address in the mapping table, the data exchange device 200 can accurately determine the data port number to which the second terminal device corresponding to the destination address is connected, and can then accurately send service data to the second terminal device connected to the data port number.

[0049] The embodiment of the present application provides an address port self-learning method, in which if the first mapping relationship and the second mapping relationship are not the same, the data exchange device 200 updates the source address and the data port number corresponding to the source address into the mapping table, and if the first mapping relationship and the second mapping relationship are not the same, the data port number of the second terminal device connected to the destination address and the address of the second terminal device corresponding to the destination address are updated into the mapping table according to the feedback information. In the prior art, the connection relationship between the first terminal device and the data port is fixed, and the connection relationship between the second terminal device and the data port is also fixed. When the first terminal device and / or the second terminal device is replaced, it is necessary to manually reset the connection relationship between each data port number in the mapping table and the first terminal device or the second terminal device in order to accurately determine the transmission path of the business data. Compared with the prior art, this method can automatically update the mapping table, save time and manpower, and improve the updating efficiency of the transmission path of the business data.

[0050] The following describes how the data exchange device 200 sends service data to the second terminal device corresponding to the destination address. The data exchange device 200 extracts information from the service data frame, obtains a mapping relationship between the destination address and the data port number, and sends the service data to the second terminal device according to the mapping relationship between the destination address and the data port number.

[0051] Specifically, the above-mentioned network service data is taken as an example for introduction. The network service data frame is obtained by parsing the network service data by the data exchange device 200. Information is extracted from the network service data frame, and the mapping relationship between the destination address and the data port number is 123456784444-04. It can be seen that the address (destination address) of the second terminal device (second network device 401) to which the network service data is to be sent is 123456784444, and the data port number to which the second terminal device (second network device 401) is connected is 04. Therefore, the data exchange device 200 sends the network service data to the second terminal device (second network device 401) with an address of 123456784444.

[0052] In this manner, the data exchange device 200 determines the transmission path of the service data according to the mapping relationship between the destination address of the service data and the data port number, thereby improving the transmission accuracy and efficiency of the service data.

[0053] In one embodiment, if Figure 3 As shown, Figure 3 The data exchange device 200 provided in the embodiment of the present application is a structural diagram. The data exchange device 200 includes: a storage module 201 and an address port self-learning module 202; the address port self-learning module 202 sends a table lookup instruction to the storage module 201, sends a mapping table to the address port self-learning module 202 according to the table lookup instruction, reads the mapping table, and obtains a second mapping relationship.

[0054] Specifically, the above mapping table is stored in the storage module 201, and the storage module 201 has a data reading function. When the storage module 201 reads the table lookup instruction, the mapping table is sent to the address port self-learning module 202 according to the table lookup instruction. The address port self-learning module 202 also has a data reading function. The address port self-learning module 202 reads the mapping table to obtain a second mapping relationship.

[0055] More specifically, Figure 3 As shown, Figure 3A schematic diagram of the structure of a data exchange device 200 provided in an embodiment of the present application. The above-mentioned data exchange device 200 preferably includes: a data exchange module 203 and 8 data transmission modules 204. Among them, each data transmission module 204 includes a data sending module 2041 and a data receiving module 2042, and each data transmission module 204 is provided with a data port (not shown in the figure), and the data sending module 2041 and the data receiving module 2042 are connected to a data port together. The data transmission module 204 and the data exchange module 203 exchange data through internal data frames, and the address port self-learning module 202 and the data exchange module also exchange data through internal data frames.

[0056] In this method, the address port self-learning module 202 retrieves the mapping table from the storage module 201 through a table lookup instruction, and reads the second mapping relationship in the mapping table to determine whether to store the first mapping relationship in the mapping table. The address port self-learning module 202 can automatically read the second mapping relationship in the mapping table so that the mapping table can be automatically updated later, thereby realizing the self-learning of the terminal device address and the data port number. The updating efficiency of the mapping table is improved.

[0057] The following describes how the storage module 201 sends the mapping table to the address port self-learning module 202 according to the table lookup instruction. Figure 4 As shown, Figure 4 A schematic diagram of the structure of the storage module 201 provided in the embodiment of the present application. The storage module 201 includes: a RAM (Random Access Memory), a first RAM interface 2011, and a table lookup instruction parsing module 2012; the table lookup instruction parsing module 2012 parses the table lookup instruction to obtain a read instruction; the RAM 2013 sends the mapping table to the address port self-learning module 202 through the first RAM interface 2011 according to the read instruction.

[0058] More specifically, the mapping table is stored in the RAM 2013 of the storage module 201. The RAM 2013 has a random access feature, and the address port self-learning module 202 can read the RAM 2013 at any time without following a certain order. The RAM 2013 can send the mapping table to the address port self-learning module 202 through the first RAM interface 2011 at any time.

[0059] In this manner, due to the random access characteristic of RAM 2013, the flexibility of the address port self-learning module 202 in retrieving the mapping table is improved, thereby improving the efficiency and flexibility of the address port self-learning module 202 in updating the mapping table.

[0060] In one implementation, the address port self-learning module 202 sends an update instruction to the storage module 201, and the storage module 201 stores the mapping table according to the update instruction.

[0061] Specifically, the storage module 201 has a data writing function. The storage module 201 can respond to the update instruction sent by the address port self-learning module 202 in a timely manner, and write (store) the mapping table according to the guidance of the update instruction. Among them, the mapping table has been updated by the address port self-learning module 202.

[0062] In this manner, the storage module 201 can automatically store the updated mapping table without manual intervention, thereby reducing the risk of data inconsistency or error caused by human error and improving the accuracy and efficiency of mapping table storage.

[0063] The following describes the manner in which the storage module 201 stores the mapping table according to the update instruction. The storage module 201 also includes a second RAM interface 2014 and an update instruction parsing module 2015; the update instruction parsing module 2015 parses the update instruction to obtain a write instruction, and the RAM 2013 stores the mapping table through the second RAM interface 2014 based on the write instruction.

[0064] More specifically, RAM 2013 has a data writing function. RAM 2013 writes (stores) the mapping table according to the instruction of the write instruction. RAM 2013 can write the mapping table at any time without following a certain order. Among them, the mapping table has been updated by the address port self-learning module 202.

[0065] In this mode, due to the access characteristics of RAM 2013 at any time, the storage at any time of the mapping table is supported, and the flexibility of the mapping table storage is improved. In addition, this mode does not need to think that intervention has reduced the error rate of the mapping table storage.

[0066] In this manner, the storage module 201 can automatically store the updated mapping table without manual intervention, thereby reducing the risk of data inconsistency or error caused by human error and improving the accuracy and efficiency of mapping table storage.

[0067] Based on the above method embodiment, the present application embodiment also provides an address port self-learning device. The device includes an acquisition module 51 and a data processing module 52; wherein the functions of each module are as follows: An acquisition module 51 is used to receive service data sent by a first terminal device; The data processing module 52 is used to parse the service data to obtain a service data frame; wherein the service data frame includes: a source address, a destination address and a data port number corresponding to the source address; The data processing module 52 is further used to compare the destination address with each historical address recorded in the mapping table to obtain a first comparison result; The data processing module 52 is further configured to compare the first mapping relationship and the second mapping relationship to obtain a second comparison result if the first comparison result indicates that there is no historical address identical to the destination address in the mapping table; wherein the first mapping relationship is a mapping relationship between the source address and the data port number, and the second mapping relationship is a mapping relationship between each historical address recorded in the mapping table and the historical data port number corresponding to each historical address; The data processing module 52 is further configured to update the source address and the data port number corresponding to the source address into the mapping table if the second comparison result indicates that the first mapping relationship and the second mapping relationship are different; The data processing module is further used to encapsulate the service data frame to obtain service data, and broadcast the service data to the first terminal device and the second terminal device; The acquisition module 51 is further used to receive feedback information returned by the second terminal device corresponding to the destination address; wherein the feedback information includes the data port number to which the second terminal device corresponding to the destination address is connected and the address of the second terminal device corresponding to the destination address; The data processing module 52 is further configured to update the data port number to which the second terminal device corresponding to the destination address is connected and the address of the second terminal device corresponding to the destination address into the mapping table according to the feedback information.

[0068] Preferably, the data processing module 52 is further configured to encapsulate the service data frame to obtain service data if the first comparison result indicates that there is a historical address identical to the destination address in the mapping table, and send the service data to a second terminal device corresponding to the destination address.

[0069] Preferably, the acquisition module 51 is specifically used to extract information from the service data frame to obtain a mapping relationship between the destination address and the data port number; The data processing module 52 is specifically configured to send the service data to the second terminal device according to the mapping relationship between the destination address and the data port number.

[0070] Preferably, the data exchange device 200 comprises: a storage module 201 and an address port self-learning module 202; The address port self-learning module 202 is used to send a table lookup instruction to the storage module 201; The storage module 201 is used to send a mapping table to the address port self-learning module 202 according to the table lookup instruction; The address port self-learning module 202 is further used to read the mapping table to obtain a second mapping relationship.

[0071] Preferably, the storage module 201 includes: a RAM, a first RAM interface 2011 and a table lookup instruction parsing module 2012; The table lookup instruction parsing module 2012 is used to parse the table lookup instruction to obtain a read instruction; RAM, used to send the mapping table to the address port self-learning module 202 through the first RAM interface 2011 according to the read instruction.

[0072] Preferably, the address port self-learning module 202 is also used to send an update instruction to the storage module 201; The storage module 201 is further used to store the mapping table according to the update instruction.

[0073] Preferably, the storage module 201 further includes a second RAM interface 2014 and an update instruction parsing module 2015; An update instruction parsing module 2015 is used to parse the update instruction to obtain a write instruction; The RAM is specifically used to store the mapping table through the second RAM interface 2014 based on the write instruction.

[0074] An address port self-learning device provided in an embodiment of the present application has the same technical features as the address port self-learning method provided in the above embodiment, so it can also solve the same technical problems and achieve the same technical effects.

[0075] An embodiment of the present application also provides an electronic device, including a processor and a memory, wherein the memory stores machine executable instructions that can be executed by the processor, and the processor executes the machine executable instructions to implement the above-mentioned address port self-learning method.

[0076] See also Figure 6 As shown, the electronic device includes a processor 100 and a memory 101, wherein the memory 101 stores machine executable instructions that can be executed by the processor 100, and the processor 100 executes the machine executable instructions to implement the above-mentioned address port self-learning method.

[0077] Further, Figure 6 The electronic device shown further includes a bus 102 and a communication interface 103 , and the processor 100 , the communication interface 103 and the memory 101 are connected via the bus 102 .

[0078] Among them, the memory 101 may include a high-speed random access memory (RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk storage. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 103 (which can be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. can be used. The bus 102 can be an ISA (Industrial Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus or an EISA (Enhanced Industry Standard Architecture) bus, etc. The above-mentioned bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0079] The processor 100 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 100. The above processor 100 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application can be directly embodied as a hardware decoding processor for execution, or a combination of hardware and software modules in the decoding processor for execution. The software module may be located in a storage medium mature in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 101, and the processor 100 reads the information in the memory 101 and completes the steps of the method of the above embodiment in combination with its hardware.

[0080] This embodiment also provides a machine-readable storage medium, which stores machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor to implement the above-mentioned address port self-learning method.

[0081] The computer program product of the address port self-learning method, device and electronic device provided in the embodiments of the present application includes a computer-readable storage medium storing program code, and the instructions included in the program code can be used to execute the method described in the previous method embodiment. The specific implementation can refer to the method embodiment, which will not be repeated here. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process of the system and device described above can refer to the corresponding process in the previous method embodiment, which will not be repeated here.

[0082] In addition, in the description of the embodiments of the present application, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be directly connected, or indirectly connected through an intermediate medium, or it can be the internal connection of two components. For ordinary technicians in this field, the specific meanings of the above terms in this application can be understood according to specific circumstances. If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a non-volatile computer-readable storage medium that can be executed by a processor. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program codes.

[0083] In the description of the present application, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present application and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present application. In addition, the terms "first", "second", and "third" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance.

[0084] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present application, which are used to illustrate the technical solutions of the present application, rather than to limit them. The protection scope of the present application is not limited thereto. Although the present application is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed in the present application, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims

1. An address port self-learning method, characterized in that: Applied to data exchange equipment, the method comprises: The data exchange device receives the service data sent by the first terminal device; The data exchange device parses the service data to obtain a service data frame; wherein the service data frame includes: a source address, a destination address and a data port number corresponding to the source address; The data exchange device compares the destination address with each historical address recorded in the mapping table to obtain a first comparison result; If the first comparison result indicates that there is no historical address identical to the destination address in the mapping table, the data exchange device compares the first mapping relationship and the second mapping relationship to obtain a second comparison result; wherein the first mapping relationship is a mapping relationship between the source address and the data port number, and the second mapping relationship is a mapping relationship between each historical address recorded in the mapping table and a historical data port number corresponding to each historical address; If the second comparison result indicates that the first mapping relationship and the second mapping relationship are different, the data exchange device updates the source address and the data port number corresponding to the source address into the mapping table; The data exchange device encapsulates the service data frame to obtain the service data, and broadcasts the service data to the first terminal device and the second terminal device; The data exchange device receives feedback information returned by the second terminal device corresponding to the destination address; wherein the feedback information includes the data port number to which the second terminal device corresponding to the destination address is connected and the address of the second terminal device corresponding to the destination address; The data exchange device updates the data port number of the second terminal device corresponding to the destination address and the address of the second terminal device corresponding to the destination address into the mapping table according to the feedback information.

2. The address port self-learning method according to claim 1, characterized in that: The method further comprises: If the first comparison result indicates that there is a historical address identical to the destination address in the mapping table, the data exchange device encapsulates the service data frame to obtain the service data, and sends the service data to a second terminal device corresponding to the destination address.

3. The address port self-learning method according to claim 2, characterized in that: The step of sending the service data to a second terminal device corresponding to the destination address includes: The data exchange device extracts information from the service data frame to obtain a mapping relationship between the destination address and the data port number; The data exchange device sends the service data to the second terminal device according to the mapping relationship between the destination address and the data port number.

4. The address port self-learning method according to claim 1, characterized in that: The data exchange device comprises: a storage module and an address port self-learning module; the method further comprises: The address port self-learning module sends a table lookup instruction to the storage module; The storage module sends the mapping table to the address port self-learning module according to the table lookup instruction; The address port self-learning module reads the mapping table to obtain the second mapping relationship.

5. The address port self-learning method according to claim 4, characterized in that: The storage module includes: a RAM, a first RAM interface and a table lookup instruction parsing module; the step of the storage module sending the mapping table to the address port self-learning module according to the table lookup instruction includes: The table lookup instruction module parses the table lookup instruction to obtain a read instruction; The RAM sends the mapping table to the address port self-learning module through the first RAM interface according to the read instruction.

6. The address port self-learning method according to claim 7, characterized in that: The method further comprises: The address port self-learning module sends an update instruction to the storage module; The storage module stores the mapping table according to the update instruction.

7. The address port self-learning method according to claim 6, characterized in that: The storage module also includes a second RAM interface and an update instruction parsing module; The step of storing the mapping table by the storage module according to the update instruction comprises: The update instruction parsing module parses the update instruction to obtain a write instruction; The RAM stores the mapping table through the second RAM interface based on the write instruction.

8. An address port self-learning device, characterized in that: The device comprises: An acquisition module, used for receiving the service data sent by the first terminal device; A data processing module, used to parse the service data to obtain a service data frame; wherein the service data frame includes: a source address, a destination address and a data port number corresponding to the source address; The data processing module is further used to compare the destination address with each historical address recorded in the mapping table to obtain a first comparison result; The data processing module is further configured to compare the first mapping relationship and the second mapping relationship to obtain a second comparison result if the first comparison result indicates that there is no historical address identical to the destination address in the mapping table; wherein the first mapping relationship is a mapping relationship between the source address and the data port number, and the second mapping relationship is a mapping relationship between each historical address recorded in the mapping table and a historical data port number corresponding to each historical address; if the second comparison result indicates that the first mapping relationship and the second mapping relationship are different, update the source address and the data port number corresponding to the source address into the mapping table; encapsulate the service data frame to obtain the service data, and broadcast the service data to the first terminal device and the second terminal device; The acquisition module is further configured to receive feedback information returned by the second terminal device corresponding to the destination address; wherein the feedback information includes a data port number to which the second terminal device corresponding to the destination address is connected and an address of the second terminal device corresponding to the destination address; The data processing module is further used to update the data port number of the second terminal device corresponding to the destination address and the address of the second terminal device corresponding to the destination address into the mapping table according to the feedback information.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method described in any one of claims 1 to 7 are executed.