Message information synchronization method and device, storage medium and electronic device
By finding and parsing the port information list of target device information in the stacking system and synchronizing the message information, the problem of excessive resource consumption of the message information synchronization process in the stacking system is solved, and system stability and CPU utilization are improved.
Patent Information
- Application Number
- CN202210654619.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-10
- Publication Date
- 2024-12-24
- Estimated Expiration
- 2042-06-10
AI Technical Summary
When the stacking system receives a large number of messages from the same source MAC address in a short time, a large number of synchronization messages will be generated, resulting in excessive CPU resource consumption and affecting system stability.
By obtaining the target message information received by the target device, searching for corresponding table entries in the port information list, and synchronizing the message information when the device type is the target device type, reducing the synchronization process of message information in the stacking system Consumption of system resources.
It effectively reduces the consumption ratio of the message information synchronization process on system resources in the stacking system, improves system stability, reduces CPU burden, and avoids the impact of cross-device MAC drift on CPU.
Smart Images

Figure CN115499451B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of Internet technology, and in particular to a method and device for synchronizing message information, a storage medium, and an electronic device. Background Art
[0002] With the development of Internet technology, the network has an increasing requirement for the reliability of data transmission, especially for the core network of the data center. Reliability is an important factor in measuring whether the network is stable. In the existing technology, the gateway usually needs to use a stacking system to reduce the impact of "single point failure" on the network. The stacking system usually includes a variety of different types of stacking devices. When the stacking device receives a message, it will learn the MAC (Media Access Control Address, physical address) address table entry of the message, and at the same time send a synchronization message on the stacking link between the stack members to synchronize the table entries.
[0003] Due to the above mechanism, stacking technology has many advantages, but it has limitations in some scenarios. For example, when the stacking system receives a large number of packets with the same source MAC address in a short period of time, the stacking system will generate a large number of synchronization messages, thereby consuming too much CPU (Central Processing Unit) resources and causing the system to fail to work properly.
[0004] In the related art, there is no effective solution to the problem that the synchronization process of message information in the stacking system consumes too much system resources. Summary of the invention
[0005] The embodiments of the present application provide a message information synchronization method and device, a storage medium and an electronic device to at least solve the problem in the related art that the synchronization process of message information in a stacking system consumes too much system resources.
[0006] According to an embodiment of the present application, a method for synchronizing message information is provided, characterized in that it includes:
[0007] Acquire target device information corresponding to the target message received by the target device, wherein the target device information is used to indicate the device that sends the target message, and the target device is a device in the stacking system;
[0008] Searching for an entry corresponding to the target device information from a port information list, wherein the port information list is used to record corresponding device information and port information obtained by synchronizing messages received in the stacking system;
[0009] When the reference table entry corresponding to the target device information is found and the resolution device type of the resolution device is the target resolution device type corresponding to the target device, the target message information of the target message is synchronized, wherein the resolution device is the device that synchronizes the reference table entry to the port information list.
[0010] Optionally, the target message information of the synchronized target message includes:
[0011] storing the corresponding target device information and target port information as target table items in the port information list;
[0012] The target entry is synchronized to the stacking system.
[0013] Optionally, storing the target device information and the target port information having a corresponding relationship as a target table entry in the port information list includes:
[0014] Acquire the target port information from the target message, and obtain the target device information and the target port information having a corresponding relationship as a target table entry;
[0015] The reference entry in the port information list is replaced by the target entry.
[0016] Optionally, before synchronizing the target message information of the target message, the method further includes:
[0017] Determining a first trust level of a target device type of the target device and a second trust level of the parsed device type, wherein the trust level of the device type is used to indicate the trust of the table items synchronized by the devices belonging to the device type;
[0018] In a case where the first trust level is not lower than the second trust level, the parsing device type is determined to be the target parsing device type.
[0019] Optionally, the stacking system includes: a master device type, a backup device type and a slave device type, wherein before synchronizing the target message information of the target message, the method further includes:
[0020] In the case where the target device belongs to the backup device type, determining the backup device type and the slave device type as the target parsed device type;
[0021] In a case where the target device belongs to the slave device type, the slave device type is determined as the target resolution device type.
[0022] Optionally, before synchronizing the target message information of the target message, the method also includes one of the following: searching for a resolution device identifier corresponding to the target device information from the port information list to obtain the resolution device; obtaining the target port information from the reference table item; determining the resolution device to which the target port information belongs.
[0023] Optionally, after searching the port information list for an entry corresponding to the target device information, the method further includes at least one of the following:
[0024] When the reference table entry is found but the parsing device type is not the target parsing device type, ignoring the target message;
[0025] When the table entry corresponding to the target device information is not found, the target device information and the target port information having a corresponding relationship are stored as a target table entry in the port information list, and the target table entry is synchronized to the stacking system.
[0026] According to another embodiment of the embodiment of the present application, a message information synchronization device is also provided, including:
[0027] An acquisition module, used for acquiring target device information corresponding to a target message received by a target device, wherein the target device information is used for indicating a device sending the target message, and the target device is a device in a stacking system;
[0028] A first search module, used to search for a table entry corresponding to the target device information from a port information list, wherein the port information list is used to record the device information and port information having a corresponding relationship obtained by synchronizing the messages received in the stacking system;
[0029] A synchronization module is used to synchronize the target message information of the target message when a reference table entry corresponding to the target device information is found and the resolution device type of the resolution device is the target resolution device type corresponding to the target device, wherein the resolution device is a device that synchronizes the reference table entry to the port information list.
[0030] According to another aspect of the embodiments of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned message information synchronization method when running.
[0031] According to another aspect of an embodiment of the present application, there is also provided an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the message information synchronization method through the computer program.
[0032] In an embodiment of the present application, target device information corresponding to a target message received by a target device is obtained, wherein the target device information is used to indicate a device that sends a target message, and the target device is a device in a stacking system; a table item corresponding to the target device information is searched from a port information list, wherein the port information list is used to record device information and port information having a corresponding relationship obtained by synchronizing messages received in the stacking system; when a reference table item corresponding to the target device information is found, and the parsing device type of the parsing device is the target parsing device type corresponding to the target device, the target message information of the target message is synchronized, wherein the parsing device is a device that has synchronized the reference table item to the port information list, that is, in the stacking system. When the target device in the system receives the target device information corresponding to the target message, it first searches the port information list to see whether there is a table entry corresponding to the target device information. The port information list records the device information and port information with corresponding relationships obtained by synchronizing the received message in the stacking system. When the reference table entry corresponding to the target device information is found, and the parsing device type of the parsing device is the target parsing device type corresponding to the target device, that is, the target device information has been parsed and recorded in the port information list, and the parsing device type of the parsing device parsing the target device information is the target parsing device type corresponding to the target device, the target message information of the target message is synchronized. The above technical solution solves the problem that the synchronization process of message information in the stacking system consumes too much system resources in the related technology, and achieves the technical effect of reducing the consumption ratio of system resources in the synchronization process of message information in the stacking system. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0034] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0035] Figure 1 It is a hardware environment schematic diagram of a message information synchronization method according to an embodiment of the present application;
[0036] Figure 2 is a flow chart of a method for synchronizing message information according to an embodiment of the present application;
[0037] Figure 3is a schematic diagram of a target message according to an embodiment of the present application;
[0038] Figure 4 is a schematic diagram of a port information list according to an embodiment of the present application;
[0039] Figure 5 is a schematic diagram of synchronization target message information according to an embodiment of the present application;
[0040] Figure 6 is a schematic diagram of a method for synchronizing message information according to an embodiment of the present application;
[0041] Figure 7 It is a structural block diagram of a message information synchronization device according to an embodiment of the present application. DETAILED DESCRIPTION
[0042] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0043] The method embodiments provided in the embodiments of the present application can be executed in a computer terminal, a device terminal or a similar computing device. Taking running on a computer terminal as an example, Figure 1 Schematic diagram of the hardware environment of a message information synchronization method according to an embodiment of the present application. Figure 1 As shown, the computer terminal may include one or more ( Figure 1 Only one is shown in the figure) processor 102 (processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data. In an exemplary embodiment, the computer terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above-mentioned computer terminal. Figure 1 More or fewer components as shown, or with Figure 1 Equivalent functions or comparisons shown Figure 1A different configuration with more features is shown.
[0044] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the method for sending message push in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the computer terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0045] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of a computer terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0046] In this embodiment, a message information synchronization method is provided, which is applied to the above-mentioned device terminal. Figure 2 1 is a flow chart of a method for synchronizing message information according to an embodiment of the present application, the process comprising the following steps:
[0047] Step S202, obtaining target device information corresponding to the target message received by the target device, wherein the target device information is used to indicate the device that sends the target message, and the target device is a device in the stacking system;
[0048] Step S204, searching for an entry corresponding to the target device information from a port information list, wherein the port information list is used to record corresponding device information and port information obtained by synchronizing messages received in the stacking system;
[0049] Step S206, when the reference table entry corresponding to the target device information is found and the resolution device type of the resolution device is the target resolution device type corresponding to the target device, synchronize the target message information of the target message, wherein the resolution device is the device that synchronizes the reference table entry to the port information list.
[0050] Through the above steps, when the target device in the stacking system receives the target device information corresponding to the target message, it first searches the port information list to see whether there is a table entry corresponding to the target device information. The port information list records the device information and port information with corresponding relationships obtained by synchronizing the received message in the stacking system. When the reference table entry corresponding to the target device information is found, and the parsing device type of the parsing device is the target parsing device type corresponding to the target device, that is, the target device information has been parsed and recorded in the port information list, and the parsing device type of the parsing device that parses the target device information is the target parsing device type corresponding to the target device, the target message information of the target message is synchronized. The above technical solution solves the problem that the synchronization process of message information in the stacking system consumes too much system resources in the related technology, and achieves the technical effect of reducing the consumption ratio of system resources in the synchronization process of message information in the stacking system.
[0051] In the technical solution provided in the above step S202, the stacking system can be but is not limited to being composed of multiple member devices, and the multiple devices are connected through dedicated stacking ports, wherein all single switches in the stacking system are called member switches, and can be divided into three roles according to different functions: the master switch (Master) corresponds to the above master device type: the master switch is responsible for managing the entire stack. There is only one master switch in the stacking system. The standby switch (Standby) corresponds to the above standby device type: the standby switch is the backup switch of the master switch. There is only one standby switch in the stacking system. When the master switch fails, the standby switch will take over all the services of the original master switch. The slave switch (Slave) corresponds to the above slave device type: the slave switch is used for service forwarding, and there can be multiple slave switches in the stacking system. The more slave switches there are, the greater the forwarding bandwidth of the stacking system. Except for the master switch and the standby switch, all other member switches in the stack are slave switches. When the standby switch is unavailable, the slave switch assumes the role of the standby switch.
[0052] Optionally, in this embodiment, the target message may include, but is not limited to, an attack message, wherein the attack message may have the following characteristics: a short time of entering the stack system, a large number of incoming messages, and the source MAC of the attack messages are consistent. Figure 3 is a schematic diagram of a target message according to an embodiment of the present application, such as Figure 3As shown in the figure, attack messages with the above three characteristics flood into the stack system. The stack system includes three roles: Master, Standby, and Slave. The source MAC of these attack messages (message 1, ..., message n-1, message n) are all the same, which will cause the MAC address table entries to be repeatedly learned and refreshed on different members to form MAC drift. When any member in the stack learns a MAC table entry, a stack synchronization message must be sent to other members to synchronize the MAC table entries. If the MAC is repeatedly learned between different members in a short period of time, a large number of synchronization messages will be transmitted on the stack link. The stack synchronization message needs to be sent to the CPU for processing, which will consume a lot of CPU resources.
[0053] Optionally, in this embodiment, the target device information may be but is not limited to a source MAC, which is used to indicate the MAC address of the device sending the target message, wherein the MAC address, also known as the network card address, is a unique network identifier for each device in the network and is written inside the hardware by the network equipment manufacturer during production.
[0054] In the technical solution provided in the above step S204, the target device information corresponding to the acquired target message is described as: MAC (08:00:20:0A:8C:6D). Figure 4 is a schematic diagram of a port information list according to an embodiment of the present application, such as Figure 4 As shown, you can search for "MAC (08:00:20:0A:8C:6D)" in the "Device Information Column" in the port information list, and you can query the corresponding table entry to find out that the port information corresponding to the device information (08:00:20:0A:8C:6D) is Port2.
[0055] In an exemplary embodiment, after searching the table entry corresponding to the target device information in the port information list, at least one of the following may be included but is not limited to:
[0056] When the reference table entry is found but the parsing device type is not the target parsing device type, ignoring the target message;
[0057] When the table entry corresponding to the target device information is not found, the target device information and the target port information having a corresponding relationship are stored as a target table entry in the port information list, and the target table entry is synchronized to the stacking system.
[0058] Optionally, in this embodiment, the resolution device type can be but is not limited to being set according to actual needs. In this embodiment, the basic idea is that when different members in the stacking system simultaneously receive the same source MAC address message, the MAC address is learned on which port according to a certain priority order, thereby reducing the interaction of stack synchronization messages and reducing the CPU burden. Therefore, the resolution device type also needs to be set based on this idea. For example, when the target device is a Standby device, the corresponding resolution device type can be a Standby device type and a Slave device type. When the target device is a Slave device, the corresponding resolution device type can be a Slave device type.
[0059] Optionally, in this embodiment, when the reference table entry is found but the resolved device type is not the target resolved device type, it can be regarded as that the target device information is learned and recorded in the stacking system, and the resolved device has a higher trust level than the target device in the stacking system. Therefore, there is no need to repeat the learning of the target device information and the target port information, and the target message can be directly ignored.
[0060] Optionally, in this embodiment, if the table entry corresponding to the target device information is not found, it can be regarded as the target device information has not been learned and recorded in the stacking system, and can be regarded as a new message. The target device information and target port information are learned and synchronized to the port information list.
[0061] In the technical solution provided in the above step S206, the method of constructing the port information list can be but is not limited to that after the A device in the stacking system receives the message S, the message information of the message S is parsed, associated with the interface information of the A device itself, and synchronized to the table to obtain the port information list. In other words, the reference table entry about the message S is parsed and synchronized by the A device. Therefore, the parsing device corresponding to the reference table entry of the message S recorded in the port information list is the A device.
[0062] When the reference table entry corresponding to the target device information is found, and the resolution device type of the resolution device is the target resolution device type corresponding to the target device, it can be regarded that the target device information has been resolved and synchronized by the device in the stacking system, and the trust level of the resolution device in the stacking system is not higher than that of the target device. Therefore, it is necessary to learn the target device information and target port information, and synchronize the target message information of the target message.
[0063] In an exemplary embodiment, the target message information of the target message may be synchronized in the following manner but is not limited to: storing corresponding target device information and target port information as target entries in the port information list; and synchronizing the target entry to the stacking system.
[0064] Optionally, in this embodiment, Figure 5 is a schematic diagram of synchronization target message information according to an embodiment of the present application, such as Figure 5 As shown, the target device includes multiple interfaces (Port1 to Port n ), the target message is received by Port3 of the target device, and the target message information is parsed as MAC1. The target device information (MAC1) and the target port information (Port3) can be associated and synchronized to the stacking system. It should be noted that the above synchronization method is to store the associated target device information and target port information with a corresponding relationship into the port information list. In other words, the port information list can be but is not limited to the reference table entries of the existing MAC1 and other interfaces, and it is not required to replace the historical records.
[0065] In an exemplary embodiment, target device information and target port information with corresponding relationships can be stored as target table items in the port information list in the following manner, but is not limited to: obtaining the target port information from the target message to obtain target device information and target port information with corresponding relationships as target table items; and using the target table items to replace the reference table items in the port information list.
[0066] Optionally, in this embodiment, using the target entry to replace the reference entry in the port information list may be based on but is not limited to the above Figure 5 The corresponding method further replaces the reference entries of MAC1 and other interfaces existing in the port information list with new corresponding relationships.
[0067] In an exemplary embodiment, before synchronizing the target message information of the target message, it may also include, but is not limited to: determining a first trust level of the target device type of the target device and a second trust level of the resolution device type, wherein the trust level of the device type is used to indicate the trust of the table items synchronized by the devices belonging to the device type; and when the first trust level is not lower than the second trust level, determining the resolution device type to be the target resolution device type.
[0068] Optionally, in this embodiment, the trust levels may be, but are not limited to, pre-divided. In the stacking system, the trust level of the Master device may be, but is not limited to, set to the highest, the trust level of the Standby device to the middle, and the trust level of the Slave device to the lowest.
[0069] Optionally, in this embodiment, when the first trust level is not lower than the second trust level, the resolution device type is determined to be the target resolution device type, that is, based on the target device, for example, when the target device type of the target device is a Standby device type and the resolution device type is a Master device type, the second trust level is higher than the first trust level, and therefore the Master device type does not belong to the target resolution device type; however, when the resolution device type is a Slave device type or a Standby device type, the second trust level is not higher than the first trust level, and therefore the Slave device type and the Standby device type belong to the target resolution device type.
[0070] In an exemplary embodiment, the stacking system includes: a master device type, a backup device type and a slave device type. Before synchronizing the target message information of the target message, it may, but is not limited to, also include: when the target device belongs to the backup device type, determining the backup device type and the slave device type as the target resolution device type; when the target device belongs to the slave device type, determining the slave device type as the target resolution device type.
[0071] Optionally, in this embodiment, the standby device type may be but is not limited to a Standby device type, and the slave device type may be but is not limited to a Slave device type. That is to say, when the target device belongs to the Standby device type, the Standby device type and the Slave device type are determined as the target resolution device type; when the target device belongs to the Slave device type, the Slave device type is determined as the target resolution device type.
[0072] In an exemplary embodiment, before synchronizing the target message information of the target message, it may include but is not limited to one of the following: searching for a parsing device identifier corresponding to the target device information from the port information list to obtain the parsing device; obtaining the target port information from the reference table item; determining the parsing device to which the target port information belongs.
[0073] Optionally, in this embodiment, the resolution device is obtained by searching the port information list for a resolution device identifier corresponding to the target device information. The above method may be, but is not limited to, that the port information list not only records the target device information and the target port information, but also records the correspondence between the target device information and the resolution device identifier. Then, the corresponding resolution device can be directly obtained through the target device information. When the port information list does not record the correspondence between the target device information and the resolution device identifier, it is necessary to first obtain the target port information through the target device information, and then obtain the resolution device identifier corresponding to the target port information from the port information and device identifier with a corresponding relationship.
[0074] In order to better understand the synchronization process of the above-mentioned message information, the synchronization process of the above-mentioned message information is described below in combination with an optional embodiment, but it is not used to limit the technical solution of the embodiment of the present application.
[0075] In this embodiment, a method for synchronizing message information is provided. Figure 6 is a schematic diagram of a message information synchronization method according to an embodiment of the present application, such as Figure 6 As shown, it mainly includes the following steps:
[0076] Step S601: When the Master device receives the message, the Master device unconditionally learns the MAC address and sends a stack synchronization message to synchronize the table entries to other members;
[0077] Step S602: When the Standby device receives the message, the Standby device first determines whether the source MAC of the message already exists in the MAC address table (equivalent to the above-mentioned port information list). If not, the source MAC address is learned and reported to the main board, and the main board synchronizes it to other members through a stack synchronization message. If it is in the table, first determine whether the table entry is learned on the Master device through the port in the table entry. If so, the Standby device does not learn the source MAC address. If not, the source MAC address is learned and reported to the main board, and the main board synchronizes it to other members through a stack synchronization message.
[0078] Step S603: When the Slave device receives the message, the Slave device first determines whether the entry has been learned on the Master device or the Standby device through the interface in the entry. If it has been learned, the Slave device does not learn the source MAC address. If it has not been learned, it learns the source MAC address and reports it to the main board, which then synchronizes it to other members through stack synchronization messages.
[0079] Through the above embodiment, in a stacking system, when multiple devices receive messages with the same source MAC address, by limiting the learning of MAC address entries by low-priority devices, the synchronization messages between stacking members are reduced, the burden on the CPU is reduced, and the cross-device MAC drift is avoided to have a large impact on the CPU and affect network stability. The stability of the stacking system can be improved and the possibility of CPU busyness can be reduced.
[0080] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of each embodiment of the present application.
[0081] Figure 7 is a structural block diagram of a message information synchronization device according to an embodiment of the present application; Figure 7 As shown, including:
[0082] An acquisition module 702 is used to acquire target device information corresponding to a target message received by a target device, wherein the target device information is used to indicate a device that sends the target message, and the target device is a device in a stacking system;
[0083] A first search module 704 is used to search for an entry corresponding to the target device information from a port information list, wherein the port information list is used to record corresponding device information and port information obtained by synchronizing messages received in the stacking system;
[0084] The synchronization module 706 is used to synchronize the target message information of the target message when the reference table item corresponding to the target device information is found and the resolution device type of the resolution device is the target resolution device type corresponding to the target device, wherein the resolution device is the device that synchronizes the reference table item to the port information list.
[0085] Through the above embodiment, when the target device in the stacking system receives the target device information corresponding to the target message, it first searches the port information list to see whether there is a table entry corresponding to the target device information. The port information list records the device information and port information with corresponding relationships obtained by synchronizing the received message in the stacking system. When the reference table entry corresponding to the target device information is found, and the parsing device type of the parsing device is the target parsing device type corresponding to the target device, that is, the target device information has been parsed and recorded in the port information list, and the parsing device type of the parsing device parsing the target device information is the target parsing device type corresponding to the target device, the target message information of the target message is synchronized. The above technical solution solves the problem that the synchronization process of message information in the stacking system consumes too much system resources in the related technology, and achieves the technical effect of reducing the consumption ratio of system resources in the synchronization process of message information in the stacking system.
[0086] In an exemplary embodiment, the synchronization module includes:
[0087] A storage unit, used for storing the target device information and the target port information having a corresponding relationship as a target table item in the port information list;
[0088] A synchronization unit is used to synchronize the target entry to the stacking system.
[0089] In an exemplary embodiment, the storage unit is further used for:
[0090] Acquire the target port information from the target message, and obtain the target device information and the target port information having a corresponding relationship as a target table entry;
[0091] The reference entry in the port information list is replaced by the target entry.
[0092] In an exemplary embodiment, the method further comprises:
[0093] A first determination module is used to determine a first trust level of a target device type of the target device and a second trust level of the parsed device type before synchronizing the target message information of the target message, wherein the trust level of the device type is used to indicate the trust of the table items synchronized by the device belonging to the device type;
[0094] The second determination module is configured to determine that the resolution device type is the target resolution device type when the first trust level is not lower than the second trust level.
[0095] In an exemplary embodiment, the stacking system includes: a master device type, a backup device type and a slave device type, wherein the method further includes:
[0096] A third determination module is used for determining the backup device type and the slave device type as the target parsing device type before synchronizing the target message information of the target message, if the target device belongs to the backup device type;
[0097] The fourth determination module is used to determine the slave device type as the target parsed device type when the target device belongs to the slave device type.
[0098] In an exemplary embodiment, the method further comprises one of the following:
[0099] A second search module is used to search for a parsing device identifier corresponding to the target device information from the port information list before synchronizing the target message information of the target message to obtain the parsing device;
[0100] The fifth determination module is used to obtain the target port information from the reference table entry; and determine the resolution device to which the target port information belongs.
[0101] In an exemplary embodiment, the method further comprises at least one of the following:
[0102] an ignoring module, configured to, after searching the table entry corresponding to the target device information in the port information list, ignore the target message if the reference table entry is found but the parsed device type is not the target parsed device type;
[0103] The storage module is used to store the corresponding target device information and target port information as target entries in the port information list when the entry corresponding to the target device information is not found, and synchronize the target entry to the stacking system.
[0104] An embodiment of the present application further provides a storage medium, which includes a stored program, wherein the program executes any of the above methods when it is run.
[0105] Optionally, in this embodiment, the storage medium may be configured to store program codes for executing the following steps:
[0106] S1, obtaining target device information corresponding to a target message received by a target device, wherein the target device information is used to indicate a device that sends the target message, and the target device is a device in a stacking system;
[0107] S2, searching for an entry corresponding to the target device information from a port information list, wherein the port information list is used to record corresponding device information and port information obtained by synchronizing messages received in the stacking system;
[0108] S3, when the reference table entry corresponding to the target device information is found and the resolution device type of the resolution device is the target resolution device type corresponding to the target device, synchronize the target message information of the target message, wherein the resolution device is the device that synchronizes the reference table entry to the port information list.
[0109] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0110] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0111] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0112] S1, obtaining target device information corresponding to a target message received by a target device, wherein the target device information is used to indicate a device that sends the target message, and the target device is a device in a stacking system;
[0113] S2, searching for an entry corresponding to the target device information from a port information list, wherein the port information list is used to record corresponding device information and port information obtained by synchronizing messages received in the stacking system;
[0114] S3, when the reference table entry corresponding to the target device information is found and the resolution device type of the resolution device is the target resolution device type corresponding to the target device, synchronize the target message information of the target message, wherein the resolution device is the device that synchronizes the reference table entry to the port information list.
[0115] Optionally, in this embodiment, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store program codes.
[0116] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.
[0117] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, and optionally, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.
[0118] The above is only a preferred embodiment of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A method for synchronizing message information, characterized in that: The device types of the multiple devices included in the stacking system include: a master device type, a standby device type and a slave device type. The method is applied to a target device in the stacking system. When the target device belongs to the standby device type, the standby device type and the slave device type are determined as the target parsed device type corresponding to the target device; when the target device belongs to the slave device type, the slave device type is determined as the target parsed device type corresponding to the target device. The method includes: Acquire target device information corresponding to the target message received by the target device, wherein the target device information is used to indicate a device that sends the target message, and the target device is a device in a stacking system; Searching for an entry corresponding to the target device information from a port information list, wherein the port information list is used to record corresponding device information and port information obtained by synchronizing messages received in the stacking system; In a case where the reference table item corresponding to the target device information is found, and the parsing device type of the parsing device in the stacking system used to parse the target message is the target parsing device type corresponding to the target device, the target device is controlled to synchronize the target message information of the target message to each device in the stacking system; in a case where the reference table item corresponding to the target device information is found, and the parsing device type of the parsing device in the stacking system used to parse the target message is not the target parsing device type corresponding to the target device, the target device is controlled not to synchronize the target message information of the target message to each device in the stacking system, wherein the parsing device is a device that synchronizes the reference table item to the port information list; Wherein, before controlling the target device to synchronize the target message information of the target message, the method further includes: determining a first trust level of the target device type of the target device and a second trust level of the resolution device type, wherein the trust level of the device type is used to indicate the trust of the table items synchronized by the devices belonging to the device type; and determining that the resolution device type is the target resolution device type when the first trust level is not lower than the second trust level.
2. The method according to claim 1, characterized in that The controlling the target device to synchronize the target message information of the target message to each device in the stacking system includes: storing the corresponding target device information and target port information as target table items in the port information list; The target entry is synchronized to the stacking system.
3. The method according to claim 2, characterized in that The storing the target device information and the target port information having a corresponding relationship as a target table entry in the port information list includes: Acquire the target port information from the target message, and obtain the target device information and the target port information having a corresponding relationship as a target table entry; The reference entry in the port information list is replaced by the target entry.
4. The method according to claim 1, characterized in that: Before controlling the target device to synchronize the target message information of the target message to each device in the stacking system, the method further includes one of the following: Searching for a parsing device identifier corresponding to the target device information from the port information list to obtain the parsing device; Acquire target port information from the reference table entry; Determine the parsing device to which the target port information belongs.
5. The method according to claim 1, characterized in that: After searching the table entry corresponding to the target device information in the port information list, the method further includes at least one of the following: When the reference table entry is found but the parsing device type is not the target parsing device type, ignoring the target message; When the table entry corresponding to the target device information is not found, the target device information and the target port information having a corresponding relationship are stored as a target table entry in the port information list, and the target table entry is synchronized to the stacking system.
6. A message information synchronization device, characterized in that: The device types of the multiple devices included in the stacking system include: a master device type, a standby device type and a slave device type. The apparatus is applied to a target device in the stacking system. When the target device belongs to the standby device type, the standby device type and the slave device type are determined as the target parsed device type corresponding to the target device; when the target device belongs to the slave device type, the slave device type is determined as the target parsed device type corresponding to the target device. The apparatus includes: An acquisition module, used for acquiring target device information corresponding to the target message received by the target device, wherein the target device information is used to indicate a device sending the target message, and the target device is a device in a stacking system; A first search module, used to search for a table entry corresponding to the target device information from a port information list, wherein the port information list is used to record the device information and port information having a corresponding relationship obtained by synchronizing the messages received in the stacking system; a synchronization module, configured to control the target device to synchronize the target message information of the target message to each device in the stacking system when a reference table item corresponding to the target device information is found and the parsing device type of the parsing device used for parsing the target message in the stacking system is the target parsing device type corresponding to the target device, and to control the target device not to synchronize the target message information of the target message to each device in the stacking system when a reference table item corresponding to the target device information is found and the parsing device type of the parsing device used for parsing the target message in the stacking system is not the target parsing device type corresponding to the target device, wherein the parsing device is a device that synchronizes the reference table item to the port information list; The device further includes: a first determination module, used to determine a first trust level of the target device type of the target device and a second trust level of the resolution device type before controlling the target device to synchronize the target message information of the target message to each device in the stacking system, wherein the trust level of the device type is used to indicate the trust of the table items synchronized by the devices belonging to the device type; and a second determination module, used to determine that the resolution device type is the target resolution device type when the first trust level is not lower than the second trust level.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein the program executes the method according to any one of claims 1 to 5 when executed.
8. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 5 through the computer program.
