Double-loop network redundancy processing method and device based on progressive hash table

By adopting a dual-ring network redundancy processing method based on a progressive hash table in an industrial switch cabinet, the problem that the redundancy discarding algorithm in the existing technology is not suitable for multiple parallel networks is solved, and efficient redundancy management and stability are achieved. promote.

CN119316386APending Publication Date: 2025-01-14QINGDIAN SILICON IND CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411384470.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-30
Publication Date
2025-01-14

AI Technical Summary

Technical Problem

Existing industrial switch cabinets have shortcomings in thermal dissipation, protection and redundancy management, resulting in instability in application in harsh environments and increasing the risk of network failure.

Method used

The dual-ring network redundancy processing method based on the progressive hash table is adopted. By receiving the data packet and matching the sequence number in the hash table, it decides whether to discard the data packet. This simplifies the redundancy discarding algorithm and is suitable for three or more parallel devices. network.

Benefits of technology

This method simplifies the redundancy discarding algorithm, improves data processing efficiency, reduces the complexity and cost of redundancy management, and enhances the stability and reliability of industrial switch cabinets.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119316386A_ABST
    Figure CN119316386A_ABST
Patent Text Reader

Abstract

The invention discloses a double-loop network redundancy processing method and device based on a progressive hash table. The method comprises the following steps: receiving a current data packet sent by any one of a plurality of sending ends; under the condition that the serial number of the current data packet is not matched with the elements in the first hash table, the current data packet serves as an element to be stored in the hash table according to the serial number of the current data packet, and the hash table is used for storing the data packets sent by the multiple sending ends; and under the condition that the serial number of the current data packet is matched with any element in the first hash table, processing the current data packet according to the validity period of any element. The technical problem that a redundancy discarding algorithm of an industrial switch is not suitable for three or more parallel networks in the prior art is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of switches, and in particular to a method and device for redundancy processing of a dual-ring network based on a progressive hash table. Background Art

[0002] This section is intended to provide a background or context to what is stated in the claims or specification, and no admission is made that what is described herein is prior art by inclusion in this section.

[0003] With the continuous improvement of industrial automation and informatization, the performance stability and reliability of industrial switch cabinets, as the core equipment of industrial networks, directly affect the normal operation of industrial production. However, the existing industrial switch cabinets still have many deficiencies in heat dissipation, protection and redundancy management, such as low heat dissipation efficiency, insufficient protection level, and long redundant switching time. These problems limit the application of industrial switch cabinets in harsh environments and increase the risk of network failures.

[0004] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention

[0005] The embodiments of the present application provide a dual-ring network redundancy processing method and device based on a progressive hash table, so as to at least solve the technical problem in the related art that the redundancy discarding algorithm of the industrial switch is not applicable to three or more parallel networks.

[0006] According to one aspect of an embodiment of the present application, a dual-ring network redundancy processing method based on a progressive hash table is provided, including: receiving a current data packet sent by any one of a plurality of sending ends; when the sequence number of the current data packet does not match any element in a first hash table, saving the current data packet as an element in a hash table according to the sequence number of the current data packet, wherein the hash table is used to save the data packets sent by the plurality of sending ends; when the sequence number of the current data packet matches any element in the first hash table, processing the current data packet according to the validity period of any element.

[0007] Optionally, determining whether the serial number of the current data packet matches an element in the first hash table includes: processing the serial number of the current data packet using a first hash function to obtain a first hash value, wherein the first hash function is a hash function that matches the first hash table; searching whether there is an element indexed by the first hash value in the first hash table; determining that the serial number of the current data packet matches an element in the first hash table if any element indexed by the first hash value exists in the first hash table; and determining that the serial number of the current data packet does not match any element in the first hash table if no element indexed by the first hash value does not exist in the first hash table.

[0008] Optionally, when the serial number of the current data packet does not match any element in the first hash table, the current data packet is saved as an element in the hash table according to the serial number of the current data packet, including: when the serial number of the current data packet does not match any element in the first hash table, the current data packet is saved as an element indexed by the first hash value in the first hash table according to the serial number of the current data packet.

[0009] Optionally, determining whether the serial number of the current data packet matches an element in the first hash table includes: using a second hash function to process the first segment of the serial number of the current data packet to obtain a second hash value, wherein the second hash function is a hash function that matches the first hash table; searching the first hash table for an element indexed by the second hash value; if there is no element indexed by the second hash value in the first hash table, determining that the serial number of the current data packet does not match any element in the first hash table; if there is any element indexed by the second hash value in the first hash table, determining that the serial number of the current data packet does not match any element in the first hash table. a second hash table pointed to by an element indexed by the hash value; using a third hash function to process the second segment of the serial number of the current data packet to obtain a third hash value, wherein the third hash function is a hash function that matches the second hash table; searching whether there is an element indexed by the third hash value in the second hash table; if there is any element indexed by the third hash value in the second hash table, determining that the serial number of the current data packet matches an element in the first hash table; if there is no element indexed by the third hash value in the second hash table, determining that the serial number of the current data packet does not match any element in the first hash table.

[0010] Optionally, when the serial number of the current data packet does not match any of the elements in the first hash table, the current data packet is saved as an element in the hash table according to the serial number of the current data packet, including: when the serial number of the current data packet does not match any of the data packets in the elements in the first hash table, the current data packet is saved as an element indexed by the second hash value in the first hash table according to the serial number of the current data packet; when there is no element indexed by the third hash value in the second hash table, the current data packet is saved as an element in the second hash table according to the serial number of the current data packet.

[0011] Optionally, when the serial number of the current data packet does not match any element in the first hash table, while or after saving the current data packet as an element in the hash table according to the serial number of the current data packet, the method further includes: using the current time plus the aging period as the validity period of the current data packet.

[0012] Optionally, when the serial number of the current data packet matches any element in the first hash table, the current data packet is processed according to the validity period of any element, including: when the validity period of any element has not expired, discarding the current data packet; when the validity period of any element has expired, saving the current data packet as an element in the hash table according to the serial number of the current data packet, and taking the current time plus the aging period as the validity period of the current data packet.

[0013] According to another aspect of an embodiment of the present application, a dual-ring network redundant processing device based on a progressive hash table is also provided, including: a receiving unit, used to receive a current data packet sent by any one of a plurality of sending ends; a storage unit, used to save the current data packet as an element to a hash table according to the sequence number of the current data packet when the sequence number of the current data packet does not match any element in a first hash table, wherein the hash table is used to save the data packets sent by the plurality of sending ends; a processing unit, used to process the current data packet according to the validity period of any element when the sequence number of the current data packet matches any element in the first hash table.

[0014] According to another aspect of an embodiment of the present application, a computer-readable storage medium (such as a CD, a USB flash drive, an SSD, etc.) is also provided, and the storage medium includes a stored program, and the above method is executed when the program is run.

[0015] According to another aspect of an embodiment of the present application, an electronic device is further provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the above method through the computer program.

[0016] According to one aspect of the present application, a computer program product or a computer program is provided, the computer program product or the computer program comprising computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the steps of any one of the embodiments of the above method.

[0017] In an embodiment of the present application, a current data packet sent by any one of multiple senders is received; when the serial number of the current data packet does not match any element in the first hash table, the current data packet is saved as an element in the hash table according to the serial number of the current data packet, and the hash table is used to save the data packets sent by the multiple senders; when the serial number of the current data packet matches any element in the first hash table, the current data packet is processed according to the validity period of any element. The redundant discard algorithm provided by this scheme is concise and clear, and is not limited by the number of parallel networks. Whether to discard can be determined only by the hash value, which can solve the technical problem that the redundant discard algorithm of the industrial switch in the related technology is not applicable to three or more parallel networks. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0019] Figure 1 It is a flowchart of an optional dual-ring network redundancy processing method based on a progressive hash table according to an embodiment of the present application;

[0020] Figure 2 It is a schematic diagram of an optional dual-ring network redundancy processing solution based on a progressive hash table according to an embodiment of the present application;

[0021] Figure 3 is a schematic diagram of an optional dual-ring network redundancy processing device based on a progressive hash table according to an embodiment of the present application; and,

[0022] Figure 4 It is a structural block diagram of a terminal according to an embodiment of the present application. DETAILED DESCRIPTION

[0023] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only 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 should fall within the scope of protection of the present application.

[0024] 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.

[0025] In industrial switches, a redundant discard algorithm can be used, such as using a double sliding window to determine whether to receive data, which avoids the time-consuming problem caused by data table aging and has the ability to flexibly process data. However, its algorithm steps are complex, the repetition rate is high when receiving messages out of order, and it cannot be applied to three or more parallel networks.

[0026] The double sliding window discard algorithm here is an improved algorithm designed to solve the data table aging problem in the redundant discard algorithm (such as the BPDU discard mechanism in the spanning tree protocol STP). Its operation process is as follows:

[0027] 1) Initialization, define windows: set two sliding windows, each with a send window and a receive window; sequence number initialization: assign an initial sequence number to each window to identify the data frame to be sent; window size: set the size of each window, which depends on the cache capacity of the switch and the expected data transmission rate.

[0028] 2) Data sending, sending data: the sender sends the data frame to the network and assigns a sequence number to each data frame; window update: whenever a data frame is sent, the sender records the sequence number of the data frame and updates the position of the sending window according to the confirmation information of the receiver.

[0029] 3) Data reception, receiving data: After receiving the data frame, the receiver checks the sequence number of the data frame to determine whether the data frame belongs to the currently valid receiving window; Confirmation mechanism: The receiver will send a confirmation message to the sender to inform which data frames with sequence numbers have been successfully received; Out-of-order processing: When out-of-order data frames are received, the receiver will temporarily cache these data frames until the missing data frames arrive, and then process them in order.

[0030] 4) Window adjustment, window movement: When the receiver confirms all data frames in a window, the sender can move the window forward and start sending new data frames; Window size adjustment: Dynamically adjust the window size according to network conditions to adapt to different network loads and delays.

[0031] 5) Exception handling, timeout retransmission: If the sender does not receive the confirmation message from the receiver within a certain period of time, the unconfirmed data frame will be retransmitted; Conflict handling: When a data frame conflict occurs, the affected data frame will be resent according to the conflict detection mechanism.

[0032] 6) Avoid data table aging, aging processing: Avoid data table aging by regularly updating the entries in the data table, rather than relying on automatic deletion of entries that have not been used for a long time; Flexible processing: The dual sliding window algorithm can process data flexibly to a certain extent, and can maintain good performance even when the network conditions are unstable.

[0033] It has the following advantages: high efficiency: through the dual sliding window mechanism, the sending and receiving of data frames can be managed more effectively to reduce data loss; flexibility: it can handle data frames received out of order and improve the reliability of data transmission; avoid aging: by regularly updating data table entries, the problems caused by data table aging are avoided. At the same time, it also brings the following disadvantages: complexity: the algorithm is more complex to implement, and two sliding windows need to be maintained, which increases the difficulty of implementation; disorder problem: when processing data frames received out of order, it may cause a higher repetition rate; scalability limitation: this algorithm is mainly applicable to two parallel networks and is difficult to expand to scenarios with three or more parallel networks.

[0034] The reason why the above scheme is mainly applicable to two parallel networks is that this algorithm is designed to consider the case of data transmission between two endpoints. In this case, the connection between the two endpoints is considered to be equal, and a simple handshake protocol (such as TCP's three-way handshake) can be used to establish the connection, and the sequence number and confirmation mechanism are used to ensure the reliable transmission of data. However, when it is expanded to three or more parallel networks, the problem becomes complicated:

[0035] 1) Sequence number conflicts: In a network with more than two nodes, if each node uses an independent sequence number space, sequence number conflicts may occur. Especially in a ring network or when there are multiple paths to the same destination, sequence numbers on different paths may be repeated, causing data packets to be erroneously discarded or received repeatedly.

[0036] 2) Confirmation message complexity: In a multi-node environment, the delivery of confirmation messages becomes more complicated. Each node not only has to confirm the data it receives from other nodes, but is also responsible for forwarding or coordinating confirmation information between other nodes. This may lead to increased latency in confirmation messages, which in turn affects overall performance.

[0037] 3) Out-of-order processing: When there are multiple parallel paths, packets may reach the destination through different paths, resulting in more out-of-order phenomena. The dual sliding window algorithm requires more complex logic to handle out-of-order packets in this case, and in some cases may not be able to effectively distinguish which packets are truly out-of-order and which are caused by changes in network topology.

[0038] 4) Difficulty in synchronization: In three or more parallel networks, it becomes more difficult to maintain synchronization between all nodes. Each node may have a different state, which requires the algorithm to handle asynchronous operations well and be able to recover or resynchronize the state when necessary.

[0039] 5) Resource consumption: Multiple parallel networks may require larger buffers to store packets that arrive out of order until all expected packets arrive, which is a challenge for devices with limited resources.

[0040] In summary, the double sliding window discard algorithm can improve the efficiency and reliability of data transmission to a certain extent by introducing two sliding windows to manage the sending and receiving of data frames. However, the double sliding window discard algorithm was not designed with the complexity of multi-node environment in mind. Therefore, when applied to three or more parallel networks, it is necessary to make major modifications to the original algorithm or introduce additional mechanisms to solve the above problems, which makes it impractical to directly apply the double sliding window algorithm unless it is properly adjusted and enhanced.

[0041] Based on the above problems, according to one aspect of an embodiment of the present application, a method embodiment of a dual-ring network redundancy processing method based on a progressive hash table is provided. Figure 1 is a flowchart of an optional dual-ring network redundancy processing method based on a progressive hash table according to an embodiment of the present application, such as Figure 1 As shown, the method may include the following steps:

[0042] Step S1, receiving a current data packet sent by any one of multiple sending ends;

[0043] Step S2, when the sequence number of the current data packet does not match any element in the first hash table, the current data packet is saved as an element in the hash table according to the sequence number of the current data packet, and the hash table is used to save data packets sent by multiple senders;

[0044] Step S3: When the serial number of the current data packet matches any element in the first hash table, the current data packet is processed according to the validity period of any element.

[0045] Through the above steps, a current data packet sent by any one of the multiple senders is received; when the serial number of the current data packet does not match any element in the first hash table, the current data packet is saved as an element in the hash table according to the serial number of the current data packet, and the hash table is used to save the data packets sent by the multiple senders; when the serial number of the current data packet matches any element in the first hash table, the current data packet is processed according to the validity period of any element. The redundant discard algorithm provided by this solution is concise and clear, and is not limited by the number of parallel networks. Whether to discard can be determined only by the hash value, which can solve the technical problem that the redundant discard algorithm of the industrial switch in the related technology is not applicable to three or more parallel networks.

[0046] The technical solution of the present application is further described below in conjunction with specific implementation methods:

[0047] 1) Perform initialization, including LRE initialization, building data tables, setting data table aging cycles, etc.

[0048] 2) The destination node receives data sent from the terminal devices (ie, the sending end) of each network, including: the port uploads the received data packet to the LRE module, and the LRE takes out the data sequence number C.

[0049] 3) Determine whether the sequence number of the current data packet matches an element in the first hash table.

[0050] Each hash table corresponds to a hash function, which is used to process the data and store it in the hash table (the content of the stored element can be an index and a corresponding data packet or the address of another hash table).

[0051] The above scheme includes two implementation methods, one of which is: first use the first hash function that matches the first hash table to process the serial number of the current data packet to obtain a first hash value; search whether there is an element indexed by the first hash value in the first hash table; if there is any element indexed by the first hash value in the first hash table, determine that the serial number of the current data packet matches the element in the first hash table; if there is no element indexed by the first hash value in the first hash table, determine that the serial number of the current data packet does not match any element in the first hash table.

[0052] The second is: first use a second hash function that matches the first hash table (the second hash function may be the same as or different from the first hash function) to process the first segment of the serial number of the current data packet, the second hash function being a hash function that matches the first hash table; find out whether there is an element indexed by the second hash value in the first hash table; if there is no element indexed by the second hash value in the first hash table, determine that the serial number of the current data packet does not match any element in the first hash table; if there is any element indexed by the second hash value in the first hash table, determine the second hash table pointed to by the element indexed by the second hash value; use a third hash function to process the second segment of the serial number of the current data packet to obtain a third hash value, the third hash function being a hash function that matches the second hash table; find out whether there is an element indexed by the third hash value in the second hash table; if there is any element indexed by the third hash value in the second hash table, determine that the serial number of the current data packet matches the element in the first hash table; if there is no element indexed by the third hash value in the second hash table, determine that the serial number of the current data packet does not match any element in the first hash table.

[0053] 4) When the serial number of the current data packet does not match any element in the first hash table, the current data packet is saved as an element in the hash table according to the serial number of the current data packet, and the hash table is used to save the data packets sent by the multiple senders.

[0054] When the serial number of the current data packet does not match any data packet in the elements in the first hash table, the current data packet is saved in the first hash table as an element indexed by the second hash value according to the serial number of the current data packet; when there is no element indexed by the third hash value in the second hash table, the current data packet is saved in the second hash table as an element indexed by the third hash value according to the serial number of the current data packet.

[0055] When the serial number of the current data packet does not match any element in the first hash table, while or after the current data packet is saved as an element in the hash table according to the serial number of the current data packet, the current time plus the aging period is used as the validity period of the current data packet.

[0056] 5) When the serial number of the current data packet matches any element in the first hash table, the current data packet is processed according to the validity period of any element.

[0057] If the validity period of any element has not expired, the current data packet is discarded; if the validity period of any element has expired, the current data packet is saved as an element in the hash table according to the serial number of the current data packet, and the current time plus the aging period is used as the validity period of the current data packet.

[0058] The shortcomings of the prior art are mainly reflected in poor heat dissipation, high redundancy management costs, and complex maintenance. In view of these shortcomings, the purpose of the present invention is to provide an industrial switch cabinet with efficient heat dissipation and intelligent redundancy management to improve the stability and reliability of the equipment and reduce maintenance costs. As an optional implementation, the present invention provides an industrial switch cabinet with efficient heat dissipation and intelligent redundancy management, which improves the performance stability and reliability of the industrial switch cabinet by optimizing the heat dissipation structure, improving the protection level, and realizing intelligent redundancy management.

[0059] Efficient heat dissipation structure design: The present invention adopts a multi-layer heat dissipation structure design, including a heat dissipation fan, heat dissipation fins and heat pipes. The heat dissipation fan realizes efficient air circulation in the cabinet through reasonable layout and speed control; the heat dissipation fins are made of high thermal conductivity materials to increase the heat dissipation area and improve the heat dissipation efficiency; the heat pipe quickly transfers heat to the heat dissipation fins through the principle of heat conduction to achieve rapid heat dissipation. In addition, the present invention also optimizes the cabinet structure to reduce thermal resistance and improve the overall heat dissipation effect.

[0060] High protection level design: The present invention adopts a fully enclosed design, and the cabinet is made of high-strength, corrosion-resistant materials, with excellent waterproof and dustproof performance. At the same time, the cabinet adopts a modular design, and each module is connected through a sealed interface to ensure that the electrical connection between the modules is safe and reliable. In addition, the present invention is also equipped with protection measures such as lightning protection and electromagnetic interference protection to improve the operating stability of the equipment in harsh environments.

[0061] Intelligent redundant discard algorithm design: In view of the above-mentioned problems, the present invention proposes a redundant discard algorithm based on a progressive HASH table. Figure 2Shown:

[0062] Step 1: Initialize LRE, build data table, and set data table aging period.

[0063] LRE initialization: LRE (Last Received Entry) module initialization, which is a component used to record the most recently received data information.

[0064] Build a data table: Create a HASH table to store the received data sequence number and related information. Each entry in the HASH table contains information such as sequence number, receiving timestamp, and whether it has timed out.

[0065] Set the data table aging period: Define an aging period, for example, 256 milliseconds. Data that has not been confirmed after this time will be considered expired.

[0066] Step 2: The destination node receives data transmitted from various networks, and the port uploads the received data to the LRE module, and the LRE takes out the data sequence number C.

[0067] Receiving data: The destination node receives data frames from different network paths through the network port.

[0068] Upload to LRE module: The port passes the received data frame to the LRE module for processing.

[0069] Extract sequence number: The LRE module extracts the sequence number C from the data frame (assuming that in a distributed network system, data is transmitted from multiple network paths to a central node. The data packets sent on each path need to be correctly processed by the central node. To this end, each data packet is assigned a unique sequence number when it is sent). For example, assume that the port receives a data frame with a sequence number of C=100.

[0070] Step 3, check whether the currently received sequence number C exists in the data table, if so, execute step 4, otherwise execute step 5.

[0071] In the related technology, the CPU is often used to implement data processing for reading and writing data. However, due to the small number of CPU threads, its processing efficiency still cannot meet the current big data processing requirements. Therefore, this application adopts GPU multi-threaded search technology. At the same time, in order to avoid data conflicts, all threads have read permissions for all stored data (that is, the data packets in the first hash table and the second hash table), and can write directly to unlocked elements (for any element, it is necessary to apply for locking when writing is required, and writing can be done after the locking is successful, and the lock is removed after the writing is successful), otherwise it cannot be done.

[0072] For example, thread 1 receives data packet 1 and calculates the hash value 1 corresponding to the gas sequence number. At this time, it searches for the element indexed by hash value 1 in the first hash table. If it does not exist, it directly applies for the address of a new element and applies to lock the element, then writes data packet 1 and releases the lock after the write is successful.

[0073] If it exists, check whether the element is a stored data packet or a hash table address. If it is the former, check whether the stored data packet 2 is expired. If it is expired, apply to lock the element, and then write data packet 1. If it is not expired, compare the serial number of the stored data packet 2 with the serial number of the data packet 1 to be stored. If they are the same, discard data packet 1 directly. If they are different, apply to lock the element, then create a second hash table, and write the address of the second hash table into the element storage, and then release the lock. When writing data packet 1 and data packet 2 in the second hash table, the hash value is calculated first, a new element is applied, the new element is locked, and the writing is successful. Release the lock.

[0074] If the element stores a hash table address, the corresponding second hash table is entered according to the address, and the hash value 2 of data packet 1 is recalculated using the second hash function corresponding to the second hash table. At this time, the element indexed by hash value 2 is searched in the second hash table. If it does not exist, the address of a new element is directly applied for, and the element is locked. After that, data packet 1 is written and the lock is released after the write is successful. If it exists, the above process is repeated (refer to the previous paragraph, which is equivalent to the hash table of this application can be multi-layer) until the write is successful or discarded.

[0075] The hash table algorithm can be used to find out whether the currently received sequence number C exists in the data table. The hash table is an efficient data structure that uses a hash function to map a key (here, the sequence number C) to a location in the table to access records, making search, insertion, and deletion operations very efficient, usually with an average time complexity close to O(1). Implementation process:

[0076] Step 3.1, initialize the progressive HASH table.

[0077] Determine the initial size: Initialize an array of appropriate size as the basic HASH table based on the expected number of serial numbers.

[0078] Choose a hash function: Choose a suitable hash function to calculate the hash value of the serial number. Usually choose a hash function with uniform distribution and few collisions.

[0079] Set conflict resolution strategy: Select a conflict resolution strategy, such as open addressing or chain addressing.

[0080] Step 3.2, insert the serial number.

[0081] Calculate hash value: Calculate the hash value of the serial number C using the selected hash function.

[0082] Handling conflicts: If the slot corresponding to the calculated hash value already has data, handle the conflict according to the conflict resolution strategy, such as using linear probing or linked list storage.

[0083] Insert data: store the sequence number C and its related information (such as receiving timestamp, whether it has timed out, etc.) into the corresponding slot or linked list.

[0084] Step 3.3, find the serial number.

[0085] Hash value: Calculate the hash value of serial number C using the same hash function.

[0086] Find data: Access the slot or linked list corresponding to the calculated hash value to find out whether there is data with serial number C. If it exists, check whether it has timed out or expired. If it does not exist, return not found.

[0087] Step 3.4, dynamic adjustment.

[0088] Monitor load factor: The progressive HASH table monitors the load factor (the ratio of used space to total space). When the load factor approaches the threshold (such as 70%), the expansion operation is triggered.

[0089] Automatic expansion: When the load factor reaches the threshold, the HASH table size is automatically adjusted and all elements are re-hashed into a new HASH table with a larger capacity to reduce the probability of conflict and improve search efficiency.

[0090] The above-mentioned original progressive HASH table can be recorded as the first hash table. When inserting a new element, if the hash value of the new element conflicts with the hash value of the existing element (i.e., the same), the element content of the element corresponding to the hash value (i.e., the data packet of the existing element) will be replaced by a new hash table (recorded as the address or pointer of the second hash table), so that the new hash function (i.e., the second hash function) is used to reprocess the two data packets (i.e., the new data packet that needs to be inserted into a certain position and the originally stored data packet, and the corresponding hash values ​​of these two data packets when processed by the first hash function are the same), and the obtained hash values ​​are different, which are then stored in the second hash table.

[0091] In the above scheme, the number of data packets in the first hash table (including data packets actually stored in the first hash table and data packets stored in all the second hash tables pointed to) is checked periodically. If it reaches a certain value (generally a percentage of the number of elements that the first hash table can store, such as 80%), the capacity is expanded. For example, the storage capacity of the first hash table is expanded from 100 to 200, and then the new first hash function is used (a hash function that can calculate hash values ​​of existing data packets without conflict) to calculate hash values ​​for the data packets actually stored in the first hash table and the data packets stored in the second hash table, and then stored in the new first hash table.

[0092] Step 3.5, handle timeout.

[0093] Scheduled scan: Periodically scan the entire HASH table to check whether any data has timed out (for example, exceeding the set aging period of 256ms).

[0094] Mark or delete: Mark the timed data as invalid or delete it directly from the table.

[0095] Specific example: Assume that a progressive HASH table is being used to process data packets in the network.

[0096] Initialize, set the initial size to 100. Select the hash function hash(C) = C mod 100. Use the chain address method to resolve conflicts, insert the sequence number. Assume that the sequence number to be inserted is C = 100, calculate the hash value hash(100) = 100 mod 100 = 0. If position 0 is empty, insert it; if there is a conflict, insert the data into the linked list.

[0097] To find the serial number, suppose you want to find out whether the serial number C=100 exists, calculate the hash value hash(100)=100mod100=0. Access position 0 or its linked list to find out whether C=100 exists.

[0098] Automatic expansion As the amount of data grows, if the load factor reaches 70%, the table size is automatically expanded to 200 and all elements are rehashed. Timeout processing Scan the table regularly to check whether there is timeout data. For example, if the sequence number C=100 has not been confirmed for more than 256ms, it is marked as invalid or deleted.

[0099] This solution can achieve: efficient search, the progressive HASH table quickly locates data through hash functions, and the average search time complexity is close to O(1); dynamic adjustment, which can dynamically adjust the table size according to actual conditions, reduce conflicts, and improve performance; reduce memory overhead, and effectively utilize memory space by optimizing storage structure and reducing conflicts; easy maintenance, supporting automatic processing of timeout data, simplifying maintenance work; through the progressive HASH table, it can effectively manage the storage and retrieval of large amounts of data, especially suitable for scenarios that require fast search and update. This method not only improves search efficiency, but also maintains good performance and scalability through a dynamic adjustment mechanism.

[0100] Step 4, determine whether the current received sequence number C in the data table has timed out and is invalid. If invalid, execute step 5; otherwise, execute step 6.

[0101] Step 5, save the current received data, set its expiration time to the current time plus the data table aging period of 256ms, and upload it to the application.

[0102] Save data: Save the currently received data and record its receiving time.

[0103] Set expiration time: Set the expiration time for this entry to the current time plus 256ms.

[0104] Upload to application: upload the data entry to the application layer for processing. For example, assuming the current time is T = 100ms, add the data entry with sequence number C = 100 to the data table and set the expiration time to T + 256ms = 356ms.

[0105] Step 6: determine that the current data is a duplicate frame and discard the current data.

[0106] Duplicate frame judgment: If an entry with the corresponding serial number already exists in the data table and has not timed out, the current data is considered to be a duplicate frame.

[0107] Discard data: Discard the duplicate frame without further processing.

[0108] Assume that a data frame with a sequence number of C=100 is received later. At this time, the data table is queried again to see whether C=100 exists. If the current time is still between 100ms and 356ms, it is considered to be a duplicate frame and is discarded.

[0109] In this way, the redundant discard algorithm based on the progressive HASH table can effectively handle the problem of duplicate data frames in multi-path networks. It tracks the received data by maintaining a data table and automatically cleans up expired entries by setting an aging cycle. This method can not only ensure the integrity of the data, but also reduce the network bandwidth occupied by duplicate data.

[0110] Compared with the prior art, the advantages of the present invention are mainly reflected in the following aspects:

[0111] 1) The combination of liquid cooling and intelligent fan control is adopted to significantly improve the heat dissipation efficiency and ensure that the switch cabinet can still operate stably in high temperature or closed environment. In terms of heat dissipation, heat pipe heat dissipation technology can also be used to utilize the efficient thermal conductivity of the heat pipe to quickly transfer the heat generated by the switch to the heat sink, and then dissipate the heat through the fan; 2) The redundant discard algorithm based on the progressive HASH table greatly simplifies the algorithm complexity, shortens the algorithm running time, and solves the problem of packet loss in the original algorithm when receiving data out of order; 3) The technical solution of the present invention has high practicality and innovation, and can meet the high requirements of equipment stability and reliability in the fields of industrial automation and intelligent manufacturing.

[0112] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0113] 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 this 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 described in each embodiment of the present application.

[0114] According to another aspect of the embodiments of the present application, a dual-ring network redundancy processing device based on a progressive hash table is provided for implementing the dual-ring network redundancy processing method based on a progressive hash table. Figure 3 is a schematic diagram of an optional dual-ring network redundancy processing device based on a progressive hash table according to an embodiment of the present application, such as Figure 3 As shown, the device may include:

[0115] The receiving unit 31 is used to receive a current data packet sent by any one of the multiple sending ends;

[0116] A storage unit 32, configured to save the current data packet as an element in a hash table according to the sequence number of the current data packet when the sequence number of the current data packet does not match any element in the first hash table, wherein the hash table is used to store the data packets sent by the multiple senders;

[0117] The processing unit 33 is used to process the current data packet according to the validity period of any element when the serial number of the current data packet matches any element in the first hash table.

[0118] Through the above module, a current data packet sent by any of the multiple senders is received; when the serial number of the current data packet does not match any element in the first hash table, the current data packet is saved as an element in the hash table according to the serial number of the current data packet, wherein the hash table is used to save the data packets sent by the multiple senders; when the serial number of the current data packet matches any element in the first hash table, the current data packet is processed according to the validity period of any element. The redundant discard algorithm provided by this solution is concise and clear, and is not limited by the number of parallel networks. Whether to discard can be determined only by the hash value, which can solve the technical problem that the redundant discard algorithm of the industrial switch in the related technology is not applicable to three or more parallel networks.

[0119] Optionally, determining whether the serial number of the current data packet matches an element in the first hash table includes: processing the serial number of the current data packet using a first hash function to obtain a first hash value, wherein the first hash function is a hash function that matches the first hash table; searching whether there is an element indexed by the first hash value in the first hash table; determining that the serial number of the current data packet matches an element in the first hash table if any element indexed by the first hash value exists in the first hash table; and determining that the serial number of the current data packet does not match any element in the first hash table if no element indexed by the first hash value does not exist in the first hash table.

[0120] Optionally, when the serial number of the current data packet does not match any element in the first hash table, the current data packet is saved as an element in the hash table according to the serial number of the current data packet, including: when the serial number of the current data packet does not match any element in the first hash table, the current data packet is saved as an element indexed by the first hash value in the first hash table according to the serial number of the current data packet.

[0121] Optionally, determining whether the serial number of the current data packet matches an element in the first hash table includes: using a second hash function to process the first segment of the serial number of the current data packet to obtain a second hash value, wherein the second hash function is a hash function that matches the first hash table; searching the first hash table for an element indexed by the second hash value; if there is no element indexed by the second hash value in the first hash table, determining that the serial number of the current data packet does not match any element in the first hash table; if there is any element indexed by the second hash value in the first hash table, determining that the serial number of the current data packet does not match any element in the first hash table. a second hash table pointed to by an element indexed by the hash value; using a third hash function to process the second segment of the serial number of the current data packet to obtain a third hash value, wherein the third hash function is a hash function that matches the second hash table; searching whether there is an element indexed by the third hash value in the second hash table; if there is any element indexed by the third hash value in the second hash table, determining that the serial number of the current data packet matches an element in the first hash table; if there is no element indexed by the third hash value in the second hash table, determining that the serial number of the current data packet does not match any element in the first hash table.

[0122] Optionally, when the serial number of the current data packet does not match any of the elements in the first hash table, the current data packet is saved as an element in the hash table according to the serial number of the current data packet, including: when the serial number of the current data packet does not match any of the data packets in the elements in the first hash table, the current data packet is saved as an element indexed by the second hash value in the first hash table according to the serial number of the current data packet; when there is no element indexed by the third hash value in the second hash table, the current data packet is saved as an element in the second hash table according to the serial number of the current data packet.

[0123] Optionally, when the serial number of the current data packet does not match any element in the first hash table, at the same time or after the current data packet is saved as an element in the hash table according to the serial number of the current data packet, the current time plus the aging period is used as the validity period of the current data packet.

[0124] Optionally, when the serial number of the current data packet matches any element in the first hash table, the current data packet is processed according to the validity period of any element, including: when the validity period of any element has not expired, discarding the current data packet; when the validity period of any element has expired, saving the current data packet as an element in the hash table according to the serial number of the current data packet, and taking the current time plus the aging period as the validity period of the current data packet.

[0125] It should be noted that the examples and application scenarios implemented by the above modules and corresponding steps are the same, but are not limited to the contents disclosed in the above embodiments. It should be noted that the above modules, as part of the device, can be run in a corresponding hardware environment, can be implemented by software, and can also be implemented by hardware, wherein the hardware environment includes a network environment.

[0126] According to another aspect of the embodiments of the present application, a server or terminal for implementing the above-mentioned dual-ring network redundancy processing method based on a progressive hash table is also provided.

[0127] Figure 4 is a structural block diagram of a terminal according to an embodiment of the present application, such as Figure 4 As shown, the terminal may include: one or more (only one is shown in the figure) processors 401, a memory 403, and a transmission device 405, such as Figure 4 As shown, the terminal may also include an input and output device 407.

[0128] Among them, the memory 403 can be used to store software programs and modules, such as the program instructions / modules corresponding to the dual-ring network redundancy processing method and device based on the progressive hash table in the embodiment of the present application. The processor 401 executes various functional applications and data processing by running the software programs and modules stored in the memory 403, that is, the dual-ring network redundancy processing method based on the progressive hash table is realized. The memory 403 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 instances, the memory 403 may further include a memory remotely arranged relative to the processor 401, and these remote memories can be connected to the 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.

[0129] The above-mentioned transmission device 405 is used to receive or send data via a network, and can also be used for data transmission between a processor and a memory. Specific examples of the above-mentioned network may include a wired network and a wireless network. In one example, the transmission device 405 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices and routers via a network cable so as to communicate with the Internet or a local area network. In one example, the transmission device 405 is a radio frequency (Radio Frequency, RF) module, which is used to communicate with the Internet wirelessly.

[0130] Specifically, the memory 403 is used to store application programs.

[0131] The processor 401 may call the application stored in the memory 403 through the transmission device 405 to perform the following steps:

[0132] Receive a current data packet sent by any of a plurality of senders; when the serial number of the current data packet does not match any element in a first hash table, save the current data packet as an element in a hash table according to the serial number of the current data packet, wherein the hash table is used to save the data packets sent by the plurality of senders; when the serial number of the current data packet matches any element in the first hash table, process the current data packet according to the validity period of any element.

[0133] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment will not be described in detail here.

[0134] It can be understood by those skilled in the art that Figure 4 The structure shown is for illustration only, and the terminal may be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a mobile Internet device (Mobile Internet Devices, MID), a PAD, or other terminal devices. Figure 4 It does not limit the structure of the above electronic device. For example, the terminal may also include Figure 4 More or fewer components (such as network interfaces, display devices, etc.) shown in, or having Figure 4 Different configurations are shown.

[0135] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0136] The embodiment of the present application further provides a storage medium. Optionally, in this embodiment, the storage medium can be used to execute the program code of the dual-ring network redundancy processing method based on the progressive hash table.

[0137] Optionally, in this embodiment, the storage medium may be located on at least one network device among a plurality of network devices in the network shown in the above embodiment.

[0138] Optionally, in this embodiment, the storage medium is configured to store program codes for executing the following steps:

[0139] Receive a current data packet sent by any of a plurality of senders; when the serial number of the current data packet does not match any element in a first hash table, save the current data packet as an element in a hash table according to the serial number of the current data packet, wherein the hash table is used to save the data packets sent by the plurality of senders; when the serial number of the current data packet matches any element in the first hash table, process the current data packet according to the validity period of any element.

[0140] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment will not be described in detail here.

[0141] 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.

[0142] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0143] If the integrated units in the above embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in the above computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling one or more computer devices (which may be personal computers, servers, or network devices, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application.

[0144] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0145] In the several embodiments provided in the present application, it should be understood that the disclosed client can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0146] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0147] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0148] 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 dual-ring network redundancy processing method based on a progressive hash table, characterized in that: include: receiving a current data packet sent by any one of the multiple senders; When the sequence number of the current data packet does not match any element in the first hash table, the current data packet is saved as an element in the hash table according to the sequence number of the current data packet, wherein the hash table is used to save the data packets sent by the multiple senders; When the serial number of the current data packet matches any element in the first hash table, the current data packet is processed according to the validity period of any element.

2. The method according to claim 1, characterized in that Determining whether the sequence number of the current data packet matches an element in the first hash table includes: Using a first hash function to process the sequence number of the current data packet to obtain a first hash value, wherein the first hash function is a hash function that matches the first hash table; Searching the first hash table for an element indexed by the first hash value; If there is any element indexed by the first hash value in the first hash table, determining that the sequence number of the current data packet matches the element in the first hash table; When there is no element indexed by the first hash value in the first hash table, it is determined that the sequence number of the current data packet does not match any element in the first hash table.

3. The method according to claim 2, characterized in that When the sequence number of the current data packet does not match any element in the first hash table, saving the current data packet as an element in the hash table according to the sequence number of the current data packet includes: When the serial number of the current data packet does not match any element in the first hash table, the current data packet is saved in the first hash table as an element indexed by the first hash value according to the serial number of the current data packet.

4. The method according to claim 1, characterized in that: Determining whether the sequence number of the current data packet matches an element in the first hash table includes: Using a second hash function to process the first number segment of the sequence number of the current data packet to obtain a second hash value, wherein the second hash function is a hash function that matches the first hash table; Find whether there is an element indexed by the second hash value in the first hash table; If there is no element indexed by the second hash value in the first hash table, determining that the sequence number of the current data packet does not match any element in the first hash table; If there is any element indexed by the second hash value in the first hash table, determine a second hash table pointed to by the element indexed by the second hash value; Using a third hash function to process the second number segment of the sequence number of the current data packet to obtain a third hash value, wherein the third hash function is a hash function that matches the second hash table; Searching the second hash table for an element indexed by the third hash value; In the case that any element indexed by the third hash value exists in the second hash table, determining that the sequence number of the current data packet matches the element in the first hash table; When there is no element indexed by the third hash value in the second hash table, it is determined that the sequence number of the current data packet does not match any element in the first hash table.

5. The method according to claim 4, characterized in that When the sequence number of the current data packet does not match any element in the first hash table, saving the current data packet as an element in the hash table according to the sequence number of the current data packet includes: When the serial number of the current data packet does not match any data packet in the elements of the first hash table, saving the current data packet as an element indexed by the second hash value to the first hash table according to the serial number of the current data packet; When there is no element indexed by the third hash value in the second hash table, the current data packet is saved in the second hash table as an element indexed by the third hash value according to the sequence number of the current data packet.

6. The method according to any one of claims 1 to 6, characterized in that: In the case that the sequence number of the current data packet does not match any element in the first hash table, while or after saving the current data packet as an element in the hash table according to the sequence number of the current data packet, the method further includes: The current time plus the aging period is used as the validity period of the current data packet.

7. The method according to any one of claims 1 to 6, characterized in that: When the sequence number of the current data packet matches any element in the first hash table, the current data packet is processed according to the validity period of any element, including: If the validity period of any of the elements has not expired, discard the current data packet; In the case that the validity period of any element has expired, the current data packet is saved as an element in the hash table according to the sequence number of the current data packet, and the current time plus the aging period is used as the validity period of the current data packet.

8. A dual-ring network redundancy processing device based on a progressive hash table, characterized in that: include: A receiving unit, used for receiving a current data packet sent by any one of the multiple sending ends; a storage unit, configured to save the current data packet as an element in a hash table according to the sequence number of the current data packet when the sequence number of the current data packet does not match any element in the first hash table, wherein the hash table is used to store the data packets sent by the multiple senders; A processing unit is used to process the current data packet according to the validity period of any element when the serial number of the current data packet matches any element in the first hash table.

9. A computer-readable storage medium, characterized in that: The storage medium includes a stored program, wherein the program executes the method described in any one of claims 1 to 7 when executed.

10. 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 method described in any one of claims 1 to 7 through the computer program.