Data processing method, system, device and medium of switch

By dynamically adapting data volume information, the switch uses direct indexing or slice address chain indexing, which solves the problem of low processing efficiency of traditional switches and improves cache utilization and data exchange efficiency.

CN120881033BActive Publication Date: 2025-12-05SHANGHAI KUAN YU IND NETWORK EQUIP CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511403599.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-29
Publication Date
2025-12-05
Estimated Expiration
2045-09-29

AI Technical Summary

Technical Problem

Traditional switches employ fixed processing strategies when handling data packets, resulting in low processing efficiency, low utilization of buffer resources, and large data exchange latency, making them unable to adapt to the diverse data packet sizes and transmission requirements.

Method used

By obtaining the data volume information of the data packets to be processed, the data index path of the storage guidance information is dynamically determined. Direct indexing or slice address chain indexing is adopted and adapted according to the data volume to improve cache utilization and data exchange efficiency.

Benefits of technology

It improves the processing speed of small data packets, optimizes the utilization of cache resources, reduces the impact of failures, speeds up the processing speed of large data packets, and simplifies troubleshooting.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120881033B_ABST
    Figure CN120881033B_ABST
Patent Text Reader

Abstract

The application provides a data processing method, system, device and medium of a switch, the method comprises the following steps: acquiring data amount information in feature information of a to-be-processed data packet; and determining a data index path for storing guide information according to the data amount information and a data amount threshold. The data index path for storing guide information can be dynamically determined, so that the adaptation of the cache requirement of the to-be-processed data packet with different information amounts to data indexing is realized, and the overall utilization of the cache and the data exchange efficiency of the switch are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to data processing technology, and more particularly to a data processing method, system, device and medium for a switch. Background Technology

[0002] In the field of modern network communication, with the explosive growth of data traffic and the increasing complexity of network applications, the data processing capability and efficiency of switches, as one of the core network devices, have become key factors restricting network performance. Switches need to process data packets from different sources, destinations, and sizes, and ensure that these packets can be transmitted to the target node efficiently and accurately. However, traditional switch data processing methods often exhibit problems such as low processing efficiency, low utilization of buffer resources, and large data exchange latency when faced with massive amounts of data and complex network environments.

[0003] Specifically, traditional switches typically employ a fixed processing strategy when handling data packets, using the same processing flow and storage method regardless of packet size. However, with the increasing diversification of network applications, the size of data packets and transmission requirements are becoming increasingly varied, making it difficult for traditional fixed processing strategies to meet these diverse needs. Summary of the Invention

[0004] This application provides a data processing method, system, device, and medium for a switch, which adapts the cache requirements for data packets with different amounts of information to be processed during data indexing, thereby improving the overall cache utilization and the data exchange efficiency of the switch.

[0005] Firstly, this application provides a data processing method for a switch, including:

[0006] Obtain the data volume information from the feature information of the data packet to be processed, wherein the data volume information is used to indicate the length of the data to be processed;

[0007] The data index path of the storage guidance information is determined based on the data volume information and the data volume threshold, wherein the storage guidance information is used to index to the storage address of at least part of the data corresponding to the data packet to be processed.

[0008] In the above scheme, the data volume information of the data packets to be processed is first obtained. Then, based on the comparison result between the data volume information and the data volume threshold, the data index path of the storage guidance information is dynamically determined so as to adapt the cache requirements of data packets with different information volumes when performing data indexing, thereby improving the overall cache utilization and the data exchange efficiency of the switch.

[0009] Optionally, determining the data index path for the storage guidance information based on the data volume information and the data volume threshold includes:

[0010] If the data volume corresponding to the data volume information is less than the data volume threshold, then the first storage guidance information corresponding to the data packet to be processed is stored in the packet description information of the data packet to be processed. The first storage guidance information is used to directly index to the storage address corresponding to the data packet to be processed.

[0011] In the above scheme, for small data packets with a data size less than the threshold, the switch can directly index to the data storage address by storing the first storage guidance information directly in the packet description information. This direct indexing mechanism avoids additional lookup steps and significantly improves the processing speed of small data packets. Since the processing of small data packets no longer requires a complex indexing process, the switch can locate the storage location of the data packet more quickly, thereby reducing data processing latency and improving overall network performance. Furthermore, by directly storing the first storage guidance information, the switch can allocate cache resources more accurately, avoiding allocating excessive cache space for small data packets while ensuring that large data packets have sufficient cache resources when needed. In addition, because the processing of small data packets is more efficient, it reduces fragmentation in the cache caused by frequent allocation and release of small spaces, thus improving the overall utilization and stability of the cache. More importantly, in the event of a fault, because the processing flow of small data packets is relatively simple, the switch can locate the problem and recover more quickly, thereby reducing the impact of the fault on network performance.

[0012] Optionally, the ratio of the data volume threshold to the data volume per unit slice is less than the feature threshold.

[0013] In the above scheme, by setting the ratio of the data volume threshold to the unit slice data volume to be less than a characteristic threshold, the switch can accurately trigger the storage guidance information storage mechanism, which stores the first storage guidance information into the packet description information of the data packet to be processed. Through the precise triggering of this storage mechanism, the short slice address chain is directly inlined and stored in the packet descriptor, instead of being stored separately in the cache. This avoids allocating additional cache space for short address chains, effectively improving cache utilization. Therefore, this characteristic threshold needs to be set; when the address chain length exceeds this threshold, external storage is then used.

[0014] Optionally, determining the data index path for the storage guidance information based on the data volume information and the data volume threshold further includes:

[0015] If the data volume corresponding to the data volume information is greater than or equal to the data volume threshold, then the second storage guidance information corresponding to the data packet to be processed is stored in the packet description information of the data packet to be processed. The second storage guidance information is used to index the slice address chain in the cache, and the slice address chain is used to index the storage address of at least one data slice corresponding to the data packet to be processed.

[0016] In the above scheme, when the data volume of the data packet to be processed is large (i.e., greater than or equal to the data volume threshold), by storing the second storage guidance information in the packet description information of the data packet, the switch can use this guidance information to quickly index the slice address chain in the cache. This mechanism ensures that the switch can efficiently locate the storage address of the data slice when processing large data packets, thereby speeding up the data packet processing speed. By using the slice address chain method, the switch can divide large data packets into multiple data slices for storage, each slice having an independent storage address. Then, the second storage guidance information serves as an index, pointing to the specific location of these slices in the cache. This approach avoids allocating contiguous and large cache space for the entire large data packet, but instead flexibly allocates it according to the actual size of the data slice, thereby optimizing the utilization of cache resources and improving the overall data exchange efficiency.

[0017] Optionally, the first storage guidance information is different from the guidance identifier of the second storage guidance information, wherein the switch identifies the data exchange object by recognizing the guidance identifier.

[0018] In the above scheme, by setting different boot identifiers for the first and second storage guidance information, the switch can clearly distinguish between these two different types of storage guidance information. The different settings of the boot identifiers allow the switch to quickly determine the required data exchange method when parsing data packets. For small data packets, the switch directly indexes to the data storage address by recognizing the boot identifier of the first storage guidance information, reducing unnecessary lookup steps; while for large data packets, the switch indexes to the slice address chain in the cache by recognizing the boot identifier of the second storage guidance information, thereby obtaining the data slice.

[0019] Furthermore, during data exchange, if a fault or error occurs, the switch can quickly locate the problem by identifying the boot identifier. Because the first and second stored boot information have different boot identifiers, the switch can clearly distinguish whether the fault occurred during small packet processing or large packet processing, thus simplifying the troubleshooting and maintenance process.

[0020] Optionally, if the guiding identifier is used to characterize the first storage guidance information, then the data exchange object performed by the switch is the data in the storage address directly indexed by the first storage guidance information;

[0021] If the bootstrap identifier is used to characterize the second storage guidance information, then the data exchange object performed by the switch is the data obtained by the slice address chain indexed by the second storage guidance information.

[0022] In the above scheme, by differentiating the bootstrap identifiers, the switch can effectively identify the type of data exchange object that needs to be processed. When the bootstrap identifier represents the first storage guidance information, the switch directly locates the data in the storage address indexed by this guidance information, ensuring that small data packets can be processed quickly and accurately. When the bootstrap identifier represents the second storage guidance information, the switch locates and obtains the data slice of the large data packet through the slice address chain, achieving efficient processing of large data packets. The clear correspondence between the bootstrap identifier and the data exchange object simplifies the system maintenance and management process of the switch. Furthermore, in the event of a fault or abnormal situation, the system administrator can quickly locate the problem by checking the bootstrap identifier and take corresponding solutions.

[0023] Secondly, this application provides a data management system for a switch, comprising:

[0024] The acquisition module is used to acquire the data volume information in the feature information of the data packet to be processed, and the data volume information is used to indicate the length of the data to be processed;

[0025] The processing module is used to determine the data index path of the storage guidance information based on the data volume information and the data volume threshold, wherein the storage guidance information is used to index to the storage address of at least part of the data corresponding to the data packet to be processed.

[0026] Optionally, the processing module is specifically used for:

[0027] If the data volume corresponding to the data volume information is less than the data volume threshold, then the first storage guidance information corresponding to the data packet to be processed is stored in the packet description information of the data packet to be processed. The first storage guidance information is used to directly index to the storage address corresponding to the data packet to be processed.

[0028] Optionally, the ratio of the data volume threshold to the data volume per unit slice is less than the feature threshold.

[0029] Optionally, the processing module is further specifically used for:

[0030] If the data volume corresponding to the data volume information is greater than or equal to the data volume threshold, then the second storage guidance information corresponding to the data packet to be processed is stored in the packet description information of the data packet to be processed. The second storage guidance information is used to index the slice address chain in the cache, and the slice address chain is used to index the storage address of at least one data slice corresponding to the data packet to be processed.

[0031] Optionally, the first storage guidance information is different from the guidance identifier of the second storage guidance information, wherein the switch identifies the data exchange object by recognizing the guidance identifier.

[0032] Optionally, if the guiding identifier is used to characterize the first storage guidance information, then the data exchange object performed by the switch is the data in the storage address directly indexed by the first storage guidance information;

[0033] If the bootstrap identifier is used to characterize the second storage guidance information, then the data exchange object performed by the switch is the data obtained by the slice address chain indexed by the second storage guidance information.

[0034] Thirdly, this application provides an electronic device, comprising:

[0035] Processor; and,

[0036] Memory for storing the executable instructions of the processor;

[0037] The processor is configured to perform any of the possible methods described in the first aspect by executing the executable instructions.

[0038] Fourthly, this application provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement any of the possible methods described in the first aspect.

[0039] The data processing method, system, device, and medium for switches provided in this application obtain data volume information from the feature information of the data packets to be processed, and then determine the data index path of the storage guidance information based on the data volume information and the data volume threshold. This allows for dynamic determination of the data index path of the storage guidance information, enabling adaptation to cache requirements when data indexing data packets with different amounts of information, thereby improving the overall cache utilization and the data exchange efficiency of the switch. Attached Figure Description

[0040] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0041] Figure 1 This is a schematic flowchart illustrating a data processing method for a switch according to an exemplary embodiment of this application;

[0042] Figure 2 This is a schematic flowchart illustrating a data processing method for a switch according to another example embodiment of this application;

[0043] Figure 3 This is a schematic diagram of the structure of a data processing system for a switch according to an example embodiment of this application;

[0044] Figure 4 This is a schematic diagram of the structure of an electronic device according to an example embodiment of this application.

[0045] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation

[0046] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0047] With the explosive growth of data traffic and the increasing complexity of network applications, the data processing capabilities and efficiency of switches, as one of the core network devices, have become key factors restricting network performance. Traditional switches often employ fixed processing strategies when handling data packets, failing to flexibly adjust according to packet size and transmission requirements. This results in problems such as low processing efficiency, low utilization of buffer resources, and significant data exchange latency.

[0048] To address the aforementioned issues, the core concept of this application is to provide a switch data processing method that dynamically adapts to data packets with different amounts of information. By acquiring the data volume information from the feature information of the data packets to be processed, and dynamically determining the data index path for storing guidance information based on the data volume information and a preset data volume threshold, the method enables the adaptation of data packets with different amounts of information to cache requirements during data indexing, thereby improving the overall cache utilization and the data exchange efficiency of the switch.

[0049] First, the switch accurately senses the size of the data packet by acquiring the data volume information from the characteristic information of the data packet to be processed. Next, it compares the data volume information with a preset data volume threshold, which can be flexibly adjusted according to the network environment and application requirements.

[0050] Based on the comparison results, the data index path for storing guidance information is dynamically selected. If the data volume is less than the threshold, a direct index path is selected; if the data volume is greater than or equal to the threshold, an indirect index path (such as a slice address chain) is selected.

[0051] For small data packets, direct indexing to the storage address avoids additional lookup steps, significantly improving processing speed and accurately allocating cache resources to prevent fragmentation. For large data packets, a sliced ​​storage method is used, with the storage address of each data slice indexed through a slice address chain, optimizing the utilization of cache resources and improving overall data exchange efficiency.

[0052] Furthermore, different boot identifiers are set for the first and second storage guidance information. The switch identifies the data exchange object by recognizing these identifiers. This differentiation of boot identifiers simplifies the switch's processing flow, enabling it to quickly determine the required data exchange method and improving processing efficiency.

[0053] Figure 1 This is a schematic flowchart illustrating a data processing method for a switch according to an example embodiment of this application. Figure 1 As shown, the method provided in this embodiment includes:

[0054] S101. Obtain the data volume information from the feature information of the data packet to be processed.

[0055] In this step, the data volume information in the feature information of the data packet to be processed is obtained, whereby the data volume information is used to indicate the length of the data to be processed.

[0056] Specifically, when a switch receives a data packet to be processed, it first performs preliminary parsing of the packet using its built-in packet parsing module to extract the packet's characteristic information. This characteristic information includes, but is not limited to, the source IP address, destination IP address, protocol type, and the data volume information, which is of particular interest in this step. The data volume information specifically indicates the length of the data packet to be processed, usually expressed in bytes or other appropriate data units.

[0057] S102. Determine the data index path for storing guidance information based on data volume information and data volume threshold.

[0058] In this step, the data index path of the storage guidance information can be determined based on the data volume information and the data volume threshold. The storage guidance information is used to index to the storage address of at least part of the data corresponding to the data packet to be processed.

[0059] Specifically, after obtaining the data volume information of the data packet to be processed, the switch will compare this information with a preset data volume threshold to determine the data index path for the storage guidance information. The storage guidance information is used to index to the storage address of at least part of the data corresponding to the data packet to be processed. It is worth noting that the above-mentioned data index path can be a direct index or an indirect index, and the rationality of its storage location directly affects the data packet processing efficiency and the utilization rate of cache resources.

[0060] In this embodiment, by obtaining the data volume information from the feature information of the data packet to be processed, and then determining the data index path of the storage guidance information based on the data volume information and the data volume threshold, the data index path of the storage guidance information can be dynamically determined to adapt to the cache requirements when the data packet to be processed has different amounts of information, thereby improving the overall cache utilization and the data exchange efficiency of the switch.

[0061] Figure 2 This is a schematic flowchart illustrating a data processing method for a switch according to another example embodiment of this application. Figure 2 As shown, the data processing method for the switch provided in this embodiment includes:

[0062] S201. Obtain the data volume information from the feature information of the data packet to be processed.

[0063] In this step, the data volume information in the feature information of the data packet to be processed is obtained, whereby the data volume information is used to indicate the length of the data to be processed.

[0064] Specifically, when a switch receives a data packet to be processed, it first performs preliminary parsing of the packet using its built-in packet parsing module to extract the packet's characteristic information. This characteristic information includes, but is not limited to, the source IP address, destination IP address, protocol type, and the data volume information, which is of particular interest in this step. The data volume information specifically indicates the length of the data packet to be processed, usually expressed in bytes or other appropriate data units.

[0065] S202. If the data volume corresponding to the data volume information is less than the data volume threshold, the storage address corresponding to the data packet to be processed is directly indexed through the storage guidance information.

[0066] In this step, if the data volume corresponding to the data volume information is less than the data volume threshold, the first storage guidance information corresponding to the data packet to be processed is stored in the packet description information of the data packet to be processed. The first storage guidance information is used to directly index to the storage address corresponding to the data packet to be processed.

[0067] Specifically, if the switch determines that the data packet is a small data packet based on the comparison result, the switch will store the first storage guide information corresponding to the data packet to be processed into the packet description information of the data packet to be processed. It is worth noting that the packet description information is an important component of the data packet, used to store various information related to data packet processing, including but not limited to source IP address, destination IP address, protocol type, and storage guide information.

[0068] Furthermore, the first storage guidance information is used to directly index the storage address corresponding to the data packet to be processed. This means that when the switch needs to process or forward the small data packet, it can directly find the storage location of the data packet through the first storage guidance information without performing additional search or parsing steps, thereby significantly improving the speed and efficiency of data processing.

[0069] Subsequently, upon receiving an instruction to forward the small data packet, the switch first reads the packet description information and extracts the first storage guidance information. Based on the first storage guidance information, the switch directly locates the specific storage location of the data packet in the cache or storage medium. The switch reads the data packet from that storage location and performs subsequent processing or forwarding operations.

[0070] Furthermore, in the data processing system of a switch, it is first necessary to define a "unit slice data size". This unit slice data size is the basic unit by which the switch divides large data packets into multiple data slices for storage and transmission. Its size can be set according to factors such as the switch's hardware performance, buffer capacity, and network transmission requirements.

[0071] Optionally, the aforementioned feature threshold can be a preset value used to determine whether the ratio of the data volume threshold to the data volume per unit slice meets specific conditions. The size of this feature threshold needs to be comprehensively considered and set based on the actual performance of the switch, cache resources, and network transmission requirements.

[0072] When a switch processes a data packet, it first obtains the data volume information based on the packet's characteristics. Then, it calculates the ratio between a preset data volume threshold and a predefined unit slice data volume.

[0073] The calculated ratio of the data volume threshold to the data volume per unit slice is then compared with a preset feature threshold. If the ratio is less than the feature threshold, the condition is met, and the switch will employ a specific storage guidance information processing mechanism (such as storing the first storage guidance information in the packet description information of the data packet to be processed, for direct indexing to the storage address corresponding to the data packet to be processed).

[0074] When the ratio is less than a characteristic threshold, the switch stores the first storage guidance information corresponding to the data packet to be processed into its packet description information. The first storage guidance information is used to directly index the storage address corresponding to the data packet to be processed, thereby simplifying the data processing flow and improving the processing speed.

[0075] It's worth noting that in actual operation, the switch can dynamically adjust the unit slice data size, data volume threshold, and feature threshold based on factors such as cache resource utilization and changes in network transmission demands. By adjusting these parameters, the switch can further optimize its data processing mechanism, improve cache resource utilization, and increase data exchange efficiency.

[0076] Therefore, the feature threshold can be further configured to have a positive correlation with the current data storage occupancy ratio in the cache. This means that when the current data storage occupancy ratio in the cache increases, the feature threshold will also increase accordingly; conversely, when the current data storage occupancy ratio in the cache decreases, the feature threshold will also decrease accordingly. This positive correlation can be achieved through algorithms or rules, such as setting a linear relationship or piecewise function to calculate the feature threshold based on the current data storage occupancy ratio in the cache.

[0077] By setting a positive correlation between the feature threshold and the current data storage occupancy ratio in the cache, the switch can dynamically sense the cache load status and adaptively adjust the feature threshold accordingly. When the cache occupancy ratio is high, the feature threshold increases accordingly to reduce the external data indexing process that leads to further cache occupancy, thereby reducing cache pressure. Conversely, when the cache occupancy ratio is low, the feature threshold decreases, allowing more data packets to be indexed through external data indexing via slice storage, thus improving switching efficiency through slice transmission. Therefore, this adaptive adjustment mechanism ensures that cache resources are rationally allocated according to the current load status, avoiding both waste and over-occupancy of cache resources while improving overall data exchange efficiency.

[0078] In short, when the cache usage ratio is high, the feature threshold is increased accordingly to reduce the external data indexing process for storing guidance information and reduce cache pressure; conversely, the use of slice storage method is increased to improve exchange efficiency.

[0079] Specifically, in the data processing system of a switch, the first step is to define and monitor the "current data storage occupancy ratio in the cache". This ratio reflects the utilization of cache resources at the current moment, that is, the ratio of the amount of data already stored in the cache to the total cache capacity.

[0080] The switch can monitor and calculate this ratio in real time through its built-in cache management module, ensuring the system can promptly understand the utilization status of cache resources. During system initialization, an initial value for the characteristic threshold needs to be set. Simultaneously, based on the switch's hardware performance, cache capacity, and network transmission requirements, the adjustment range of the characteristic threshold should be set to ensure the system can flexibly adjust according to actual conditions.

[0081] Specifically, during switch operation, the cache management module monitors and calculates the current data storage occupancy rate in the cache in real time. Based on the established positive correlation, the switch will adjust the value of the characteristic threshold in real time to ensure that the system can flexibly adjust according to the actual utilization of cache resources.

[0082] When a switch processes a data packet, it compares the adjusted feature threshold with the ratio of the data volume threshold to the data volume per unit slice. If the ratio is less than the adjusted feature threshold, the switch employs a specific storage guidance information processing mechanism (e.g., storing the first storage guidance information in the packet description information of the data packet to be processed, used to directly index the storage address corresponding to the data packet). Conversely, if the ratio is greater than or equal to the adjusted feature threshold, the switch employs another storage guidance information processing mechanism (e.g., storing the second storage guidance information in the packet description information of the data packet to be processed, used to index the slice address chain in the cache).

[0083] S203. If the data volume corresponding to the data volume information is greater than or equal to the data volume threshold, then the storage address corresponding to the data packet to be processed is indirectly indexed through the storage guidance information.

[0084] In this step, if the data volume corresponding to the data volume information is greater than or equal to the data volume threshold, the second storage guidance information corresponding to the data packet to be processed is stored in the packet description information of the data packet to be processed. The second storage guidance information is used to index the slice address chain in the cache, and the slice address chain is used to index the storage address of at least one data slice corresponding to the data packet to be processed.

[0085] Specifically, if the data volume corresponding to the data volume information is greater than or equal to the data volume threshold, that is, if the switch determines that the data packet is a large data packet based on the comparison result, the switch will generate the second storage guidance information corresponding to the data packet to be processed. The second storage guidance information is a special identifier specifically used to index the storage address of large data packet slices.

[0086] The switch divides large data packets into multiple data slices. The size of each data slice can be set according to actual needs, but it is usually less than or equal to the data size of a single slice (the data size of a single slice is a preset fixed value used to guide the generation of data slices). The switch assigns an independent storage address to each data slice and records these storage addresses in the cache in a certain order (such as sequential storage or linked storage), forming a slice address chain.

[0087] The switch stores the generated second storage guide information into the packet description information of the data packet to be processed. Furthermore, the packet description information is a crucial component of the data packet, used to store various information related to packet processing. The second storage guide information is used to index the slice address chain in the cache. This means that when the switch needs to process or forward this large data packet, it can find the slice address chain through the second storage guide information, thereby locating the storage location of each data slice.

[0088] Upon receiving an instruction to process or forward a large data packet, the switch first reads the packet description information and extracts the second storage guide information. Based on the second storage guide information, the switch locates the slice address chain in the cache. The switch traverses the slice address chain, sequentially reading the storage address of each data slice and retrieving the data slice from these addresses. The switch reassembles the read data slices (if necessary) and performs subsequent processing or forwarding operations.

[0089] It's worth noting that simply configuring S203 in the switch can achieve storage indexing for all data, including both small and large packets. However, for small packets, especially those shorter than a unit slice, the storage address chain is very short. Continuing with the S203 storage indexing method would require allocating additional cache space for the storage address chain. This cache usage can lead to excessive cache usage during large-scale data forwarding, especially when a high proportion of the forwarded data consists of small packets, resulting in reduced forwarding efficiency. Therefore, it's advisable to store the short storage address chain directly inline in the packet descriptor instead of storing it separately in the cache, i.e., configuring S202. This avoids allocating additional cache space for short address chains, further improving cache utilization. Furthermore, by setting a data volume threshold, S202 and S203 can be efficiently switched. However, if only S202 is configured in the switch, that is, if the address chains of large data packets are all stored in the packet descriptor, the information in the packet descriptor will be too complex, which will affect the efficiency of data exchange and processing.

[0090] Furthermore, in order to enable the switch to accurately forward object data when exchanging data, the boot identifiers of the first storage guide information and the second storage guide information can be configured to be different. The switch identifies the data exchange object by recognizing the boot identifier.

[0091] Specifically, in the data processing system of a switch, in order to clearly distinguish between the first and second storage guidance information, different guidance identifiers can be designed for them. These guidance identifiers are codes with specific formats and meanings, used to uniquely identify the type of storage guidance information during data transmission and processing.

[0092] For example, we use binary encoding to define the boot identifier. The boot identifier for the first stored boot information is set to 0101; while the boot identifier for the second stored boot information is set to 1010. This binary encoding method is simple and efficient, facilitating rapid identification and processing by the switch at the hardware level.

[0093] After receiving a data packet containing storage guidance information, the switch will first parse the header of the storage guidance information to obtain the boot identifier.

[0094] At the hardware level of a switch, a dedicated data parsing module is typically designed. When a data packet arrives at the switch's input port, the data parsing module extracts the stored instructions (SIM) portion of the packet and analyzes it bit by bit. It first reads the first few bits of the SIM (determined by the number of bits in the boot identifier) ​​and compares them with a predefined boot identifier.

[0095] For example, in the example above, the boot identifier is a 4-bit binary number. The data parsing module reads the first 4 bits of the stored boot information and then compares them with FIRST_STORAGE_GUIDE (0101) and SECOND_STORAGE_GUIDE (1010).

[0096] Based on the identified boot identifier, the switch can determine the object to which data is exchanged. If the boot identifier is FIRST_STORAGE_GUIDE, the switch exchanges the data to the first storage area; if the boot identifier is SECOND_STORAGE_GUIDE, the switch exchanges the data to the second storage area.

[0097] In actual switch implementations, the first storage area and the second storage area can be different physical storage devices (such as different memory chips, hard drives, etc.), or they can be different logical partitions on the same physical storage device. The switch, through its internal storage management module, accurately stores or forwards data to the appropriate location based on the data exchange object determined by the boot identifier.

[0098] For example, if the first storage area is a cache used to store frequently accessed data to improve processing efficiency, and the second storage area is a large-capacity hard drive used to store data for long-term storage, the switch will preferentially store the data in the cache when it recognizes the boot identifier as FIRST_STORAGE_GUIDE; and store the data on the hard drive when it recognizes the boot identifier as SECOND_STORAGE_GUIDE.

[0099] Furthermore, if the boot identifier is used to represent the first storage guidance information, the data exchanged by the switch is the data in the storage address directly indexed by the first storage guidance information. If the boot identifier is used to represent the second storage guidance information, the data exchanged by the switch is the data obtained from the slice address chain indexed by the second storage guidance information.

[0100] Specifically, when the boot identifier is FIRST_STORAGE_GUIDE, the switch obtains the directAddress member from the addressInfo union that stores the boot information. This member is the storage address that is directly indexed.

[0101] Similarly, when the switch receives storage guide information, it first identifies the boot identifier. If the boot identifier is SECOND_STORAGE_GUIDE, it proceeds to process the second storage guide information.

[0102] The switch obtains the sliceAddressChain structure from the addressInfo union that stores the guidance information. This structure contains the base address baseAddress, the number of slices sliceCount, and a pointer to the slice offset array sliceOffsets.

[0103] The switch calculates the storage address corresponding to each slice in turn based on the base address and slice offset array, and combines the data in these slices as the final data exchange object.

[0104] It is worth noting that when a switch recognizes an unknown boot identifier, it will take corresponding measures, such as logging or dropping data packets.

[0105] Through the above specific implementation methods, the switch can accurately distinguish between the first storage guidance information and the second storage guidance information based on the boot identifier, and obtain data through direct index storage address and slice address chain respectively, thereby achieving efficient and accurate data exchange and processing.

[0106] Figure 3 This is a schematic diagram illustrating the structure of a data processing system for a switch according to an example embodiment of this application. Figure 3 As shown, the data processing system 300 for the switch provided in this embodiment includes:

[0107] The acquisition module 310 is used to acquire the data volume information in the feature information of the data packet to be processed, wherein the data volume information is used to indicate the length of the data to be processed;

[0108] The processing module 320 is used to determine the data index path of the storage guidance information based on the data volume information and the data volume threshold, wherein the storage guidance information is used to index to the storage address of at least part of the data corresponding to the data packet to be processed.

[0109] Optionally, the processing module 320 is specifically used for:

[0110] If the data volume corresponding to the data volume information is less than the data volume threshold, then the first storage guidance information corresponding to the data packet to be processed is stored in the packet description information of the data packet to be processed. The first storage guidance information is used to directly index to the storage address corresponding to the data packet to be processed.

[0111] Optionally, the ratio of the data volume threshold to the data volume per unit slice is less than the feature threshold.

[0112] Optionally, the processing module 320 is further specifically used for:

[0113] If the data volume corresponding to the data volume information is greater than or equal to the data volume threshold, then the second storage guidance information corresponding to the data packet to be processed is stored in the packet description information of the data packet to be processed. The second storage guidance information is used to index the slice address chain in the cache, and the slice address chain is used to index the storage address of at least one data slice corresponding to the data packet to be processed.

[0114] Optionally, the first storage guidance information is different from the guidance identifier of the second storage guidance information, wherein the switch identifies the data exchange object by recognizing the guidance identifier.

[0115] Optionally, if the guiding identifier is used to characterize the first storage guidance information, then the data exchange object performed by the switch is the data in the storage address directly indexed by the first storage guidance information;

[0116] If the bootstrap identifier is used to characterize the second storage guidance information, then the data exchange object performed by the switch is the data obtained by the slice address chain indexed by the second storage guidance information.

[0117] Figure 4 This is a schematic diagram of the structure of an electronic device according to an example embodiment of this application. For example... Figure 4 As shown, the electronic device 400 provided in this embodiment includes: a processor 401 and a memory 402; wherein:

[0118] Memory 402 is used to store computer programs, and the memory may also be flash memory.

[0119] Processor 401 is used to execute the execution instructions stored in the memory to implement the various steps in the above method. For details, please refer to the relevant descriptions in the preceding method embodiments.

[0120] Alternatively, the memory 402 can be either standalone or integrated with the processor 401.

[0121] When the memory 402 is a device independent of the processor 401, the electronic device 400 may further include:

[0122] Bus 403 is used to connect the memory 402 and the processor 401.

[0123] This embodiment also provides a readable storage medium storing a computer program, which, when executed by at least one processor of an electronic device, enables the electronic device to perform the methods provided in the various embodiments described above.

[0124] This embodiment also provides a program product including a computer program stored in a readable storage medium. At least one processor of an electronic device can read the computer program from the readable storage medium, and the at least one processor executes the computer program to cause the electronic device to perform the methods provided in the various embodiments described above.

[0125] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the claims.

[0126] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.

Claims

1. A data processing method of a switch, characterized by, include: Obtain the data volume information from the feature information of the data packet to be processed, wherein the data volume information is used to indicate the length of the data to be processed; The data index path of the storage guidance information is determined based on the data volume information and the data volume threshold, wherein the storage guidance information is used to index to the storage address of at least part of the data corresponding to the data packet to be processed; The step of determining the data index path for storage guidance information based on the data volume information and the data volume threshold includes: If the data volume corresponding to the data volume information is less than the data volume threshold, and the ratio of the data volume threshold to the unit slice data volume is less than the feature threshold, then the first storage guidance information corresponding to the data packet to be processed is stored in the packet description information of the data packet to be processed. The first storage guidance information is used to directly index to the storage address corresponding to the data packet to be processed. If the data volume corresponding to the data volume information is less than the data volume threshold, and the ratio of the data volume threshold to the unit slice data volume is greater than or equal to the feature threshold, then the second storage guidance information corresponding to the data packet to be processed is stored in the packet description information of the data packet to be processed. The second storage guidance information is used to index to the slice address chain in the cache. The slice address chain is used to index to the storage address of at least one data slice corresponding to the data packet to be processed. The step of determining the data index path for storage guidance information based on the data volume information and the data volume threshold also includes: If the data volume corresponding to the data volume information is greater than or equal to the data volume threshold, then the second storage guidance information corresponding to the data packet to be processed is stored in the packet description information of the data packet to be processed. The second storage guidance information is used to index the slice address chain in the cache, and the slice address chain is used to index the storage address of at least one data slice corresponding to the data packet to be processed.

2. The data processing method of a switch according to claim 1, wherein, The first storage guidance information has a different guidance identifier than the second storage guidance information, wherein the switch identifies the data exchange object by recognizing the guidance identifier.

3. The data processing method of a switch according to claim 2, wherein, If the guidance identifier is used to characterize the first storage guidance information, then the data exchange object performed by the switch is the data in the storage address directly indexed by the first storage guidance information.

4. The data processing method for a switch according to claim 2, characterized in that, If the bootstrap identifier is used to characterize the second storage guidance information, then the data exchange object performed by the switch is the data obtained by the slice address chain indexed by the second storage guidance information.

5. A data management system for a switch, characterized in that, include: The acquisition module is used to acquire the data volume information in the feature information of the data packet to be processed, and the data volume information is used to indicate the length of the data to be processed; The processing module is used to determine the data index path of the storage guidance information based on the data volume information and the data volume threshold, wherein the storage guidance information is used to index to the storage address of at least part of the data corresponding to the data packet to be processed; The processing module is specifically used for: If the data volume corresponding to the data volume information is less than the data volume threshold, and the ratio of the data volume threshold to the unit slice data volume is less than the feature threshold, then the first storage guidance information corresponding to the data packet to be processed is stored in the packet description information of the data packet to be processed. The first storage guidance information is used to directly index to the storage address corresponding to the data packet to be processed. If the data volume corresponding to the data volume information is less than the data volume threshold, and the ratio of the data volume threshold to the unit slice data volume is greater than or equal to the feature threshold, then the second storage guidance information corresponding to the data packet to be processed is stored in the packet description information of the data packet to be processed. The second storage guidance information is used to index to the slice address chain in the cache. The slice address chain is used to index to the storage address of at least one data slice corresponding to the data packet to be processed. If the data volume corresponding to the data volume information is greater than or equal to the data volume threshold, then the second storage guidance information corresponding to the data packet to be processed is stored in the packet description information of the data packet to be processed. The second storage guidance information is used to index the slice address chain in the cache, and the slice address chain is used to index the storage address of at least one data slice corresponding to the data packet to be processed.

6. An electronic device, characterized in that, include: processor; as well as, Memory for storing the executable instructions of the processor; The processor is configured to execute the method of any one of claims 1 to 4 by executing the executable instructions.

7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1 to 4.

Citation Information

Patent Citations

  • A packet buffer comprising a data section and a data description section

    CN102971997A

  • Shared linked list management method, device and equipment

    CN115757206A