Switch data transmission method and device, storage medium and electronic device
By generating and filtering target channel description information and dynamically adjusting stacking channel parameters, the problem of insufficient stacking channels in traditional switches is solved and data transmission efficiency is improved.
Patent Information
- Application Number
- CN202510236601.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-28
- Publication Date
- 2025-05-13
AI Technical Summary
The hash value of data ports in traditional switches is limited, resulting in insufficient optional paths of stacked channels under the high number of line cards, affecting data transmission efficiency.
By extracting the target data and target port information in the data port, the target channel description information is generated, the target channel parameters are determined from the candidate channel parameters according to the target time of the received target data, and the matching target stacking channels are filtered from the candidate stacking channels for data transmission.
The number of stacked channels for switch data transmission is increased, the data transmission efficiency is improved, and the problem of insufficient stacked channels in traditional technology is solved.
Smart Images

Figure CN119996351A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of switches, and in particular to a method and device for transmitting switch data, a storage medium, and an electronic device. Background Art
[0002] In the related art, the traditional stack channel implementation method relies on the hash value of the data port to select the data route. Specifically, each data port is configured with a specific hash value, and each hash value corresponds to a stack channel. However, the hash value of the data port is limited. For example, when there are only 15 hash values, at most 15 stack channels can be matched. If the number of line cards in the switch is too large, it will cause the problem of insufficient stack channels that can be selected, which will affect the data transmission efficiency.
[0003] With regard to the problems such as low transmission efficiency of switch data in related technologies, no effective solution has been proposed yet. Summary of the invention
[0004] The embodiments of the present application provide a method and device for transmitting switch data, a storage medium, and an electronic device, so as to at least solve the problem of low transmission efficiency of switch data in the related art.
[0005] According to an embodiment of the present application, a method for transmitting switch data is provided, wherein a processor, a data port and a candidate stacking channel are deployed on the switch, the data port is used to receive data to be transmitted by the switch, and the method is applied to the processor, and the method includes: extracting target data received by a target data port in the data port, and detecting target port information of the target data port; generating target channel description information according to the target port information, processor description information of the processor and target channel parameters, wherein the target channel parameters are determined from candidate channel parameters according to a target time when the target data is received; screening a target stacking channel that matches the target channel description information from the candidate stacking channels according to the target channel description information; and calling the target stacking channel to transmit the target data.
[0006] In an exemplary embodiment, generating the target channel description information based on the target port information, the processor description information of the processor, and the target channel parameters includes: filtering the target channel parameters corresponding to the target time from the candidate channel parameters; performing a target splicing operation on the target port information, the processor description information, and the target channel parameters to obtain the target channel description information.
[0007] In an exemplary embodiment, the step of filtering the target channel parameter corresponding to the target time from the candidate channel parameters includes: when the candidate channel parameters include N channel parameters, filtering the target channel parameter from the N channel parameters by performing the following steps, wherein N is a positive integer greater than or equal to 2: detecting a reference channel parameter corresponding to reference data received on the data port for transmission, wherein the reference data is data received by the data port at a reference time, the reference time is earlier than the target time, and the reference data is the previous data received by the data port before the target data; and determining a next channel parameter among the reference channel parameters among the N channel parameters as the target channel parameter.
[0008] In an exemplary embodiment, performing a target splicing operation on the target port information, the processor description information, and the target channel parameters to obtain the target channel description information includes: detecting a target splicing mode corresponding to the target time from candidate splicing modes; and performing the target splicing operation on the target port information, the processor description information, and the target channel parameters according to the target splicing mode to obtain the target channel description information.
[0009] In an exemplary embodiment, detecting the target splicing mode corresponding to the target time from candidate splicing modes includes: when the candidate splicing modes include M splicing modes, screening the target splicing mode from the M splicing modes by performing the following steps, wherein M is a positive integer greater than or equal to 2: detecting a reference splicing mode corresponding to a reference time at which reference data is received on the data port, wherein the reference time is earlier than the target time, and the previous data received by the data port before the target data is reference data; and determining the next splicing mode among the reference splicing modes among the M splicing modes as the target splicing mode.
[0010] In an exemplary embodiment, the target stacking channel that matches the target channel description information is screened from the candidate stacking channels based on the target channel description information, including: screening first channel description information including the target channel description information from the candidate channel description information corresponding to the candidate stacking channel; screening second channel description information spliced according to a target splicing method from the first channel description information, and determining the stacking channel corresponding to the second channel description information as the target stacking channel, wherein each information in the target channel description information is spliced according to the target splicing method.
[0011] In an exemplary embodiment, the filtering of the first channel description information including the target channel description information from the candidate channel description information corresponding to the candidate stacking channel includes: when the candidate stacking channel description information includes P description information corresponding to P stacking channels, filtering the first channel description information including the target channel description information from the P description information by performing the following steps, wherein the candidate stacking channel includes the P stacking channels, and P is a positive integer: filtering R description information including the target port information, the processor description information, and the target channel parameter from the P description information, wherein the target channel description information includes the target port information, the processor description information, and the target channel parameter. processor description information and the target channel parameter, the first channel description information includes the R description information, R is a positive integer less than or equal to P; the second channel description information spliced according to the target splicing mode is screened from the first channel description information, including: when the first channel description information includes the R description information, the second channel description information spliced according to the target splicing mode is screened from the R description information by performing the following steps: detecting R matching degrees between the R splicing modes corresponding to the R description information and the target splicing mode; and determining the channel description information corresponding to the matching degree greater than or equal to the matching degree threshold among the R matching degrees as the second channel description information.
[0012] According to another embodiment of the embodiment of the present application, a device for transmitting switch data is also provided, wherein a processor, a data port and a candidate stacking channel are deployed on the switch, the data port is used to receive data to be transmitted by the switch, and the device is applied to the processor, and the device includes: a processing module, used to extract the target data received by the target data port in the data port, and detect the target port information of the target data port; a generation module, used to generate target channel description information according to the target port information, the processor description information of the processor and the target channel parameters, wherein the target channel parameters are determined from the candidate channel parameters according to the target time of receiving the target data; a screening module, used to screen the target stacking channel that matches the target channel description information from the candidate stacking channels according to the target channel description information; and a transmission module, used to call the target stacking channel to transmit the target data.
[0013] According to another aspect of the embodiments of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the above switch data transmission method when running.
[0014] According to another aspect of an embodiment of the present application, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the switch data transmission method through the computer program.
[0015] According to another embodiment of the present application, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.
[0016] In the embodiment of the present application, the channel parameter used to generate the channel description information is selected from the candidate channel parameters according to the time when the data port receives the data. It is understandable that the selected channel parameter may change with the time when the data port receives the data. In this case, the stacking channel used to transmit the data received at different times on the same data port will also change. It is understandable that the number of stacking channels allowed to be used to transmit the data received on the same data port is increased. By selecting different channel parameters, the data received on the same data port can be transmitted through multiple stacking channels. The above technical solution solves the problem of low transmission efficiency of switch data in the related technology and achieves the technical effect of improving the transmission efficiency of switch data. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0018] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0019] Figure 1 It is a hardware environment schematic diagram of a switch data transmission method according to an embodiment of the present application;
[0020] Figure 2 is a flow chart of a method for transmitting switch data according to an embodiment of the present application;
[0021] Figure 3 is a schematic diagram of an optional stacking solution using a switch data transmission architecture according to an embodiment of the present application;
[0022] Figure 4 is a schematic diagram of an optional method for screening target channel parameters according to an embodiment of the present application;
[0023] Figure 5 is a schematic diagram of an optional splicing method according to an embodiment of the present application;
[0024] Figure 6 is a schematic diagram of an optional method for screening target splicing according to an embodiment of the present application;
[0025] Figure 7 is a schematic diagram of a screening stack channel under an optional multi-core architecture according to an embodiment of the present application;
[0026] Figure 8 It is a structural block diagram of a switch data transmission device according to an embodiment of the present application. DETAILED DESCRIPTION
[0027] 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.
[0028] 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.
[0029] The method embodiments provided in the embodiments of the present application can be executed in a computer terminal, a device terminal or a similar computing device. Taking running on a computer terminal as an example, Figure 1 FIG. 1 is a schematic diagram of a hardware environment of a method for transmitting switch data according to an embodiment of the present application. Figure 1 As shown, the computer terminal may include one or more ( Figure 1Only one is shown in the figure) processor 102 (processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data. In an exemplary embodiment, the computer terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above-mentioned computer terminal. Figure 1 More or fewer components as shown, or with Figure 1 Equivalent functions or comparisons shown Figure 1 A different configuration with more features is shown.
[0030] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as a computer program corresponding to a method for transmitting switch data in an embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the computer terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0031] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of a computer terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0032] In this embodiment, a method for transmitting switch data is provided, which is applied to the above-mentioned computer terminal. A processor, a data port and a candidate stacking channel are deployed on the switch. The data port is used to receive data to be transmitted by the switch. The method is applied to the processor. Figure 2 This is a flow chart of a method for transmitting switch data according to an embodiment of the present application, and the flow includes the following steps:
[0033] Step S202, extracting target data received by a target data port in the data port, and detecting target port information of the target data port;
[0034] Step S204, generating target channel description information according to the target port information, the processor description information of the processor and the target channel parameter, wherein the target channel parameter is determined from the candidate channel parameters according to the target time of receiving the target data;
[0035] Step S206, according to the target channel description information, selecting a target stacking channel that matches the target channel description information from the candidate stacking channels;
[0036] Step S208: calling the target stacking channel to transmit the target data.
[0037] Through the above steps, the channel parameters used to generate the channel description information are selected from the candidate channel parameters according to the time when the data port receives the data. It is understandable that the selected channel parameters may change with the time when the data port receives the data. In this case, the stacking channels used to transmit the data received at different times on the same data port will also change. It is understandable that the number of stacking channels allowed to transmit the data received on the same data port is increased. By selecting different channel parameters, the data received on the same data port can be transmitted through multiple stacking channels. The above technical solution solves the problem of low transmission efficiency of switch data in the related technology and achieves the technical effect of improving the transmission efficiency of switch data.
[0038] In the technical solution provided in the above step S202, the port information can be but is not limited to being used to represent different data ports. For example, the port information can be but is not limited to including a hash value of the data port or an identifier of the data port (for example, ID (Identification), etc.). The hash value of the data port can be but is not limited to being calculated based on key fields of the data, such as the source IP (Internet Protocol) address, the destination IP address, the data port number, the destination port number, etc.
[0039] Optionally, in this embodiment, the port information of the data ports corresponding to different processors may be, but is not limited to, the same or different. For example, the hash value of the data port corresponding to processor 1 and the hash value of the data port corresponding to processor 2 may be the same or different.
[0040] Optionally, in this embodiment, resources can be further expanded by, but not limited to, increasing the number of data ports. For example, when the port information of the data port includes a hash value, for the stacking scenario, the routing specifications can be expanded by, but not limited to, increasing the number of hash values. On the basis of expanding the number of hash values, resources can be further expanded.
[0041] Through the embodiments of the present application, the same hash value is reused through data ports corresponding to different processors. When the number of hash values of the data ports is limited, the hash values are reused, thereby improving the utilization rate of the data ports.
[0042] Figure 3 is a schematic diagram of an optional stacking solution using a switch data transmission architecture according to an embodiment of the present application, such as Figure 3 As shown, multiple pipelines are deployed inside the switch, for example, pipeline 1 to pipeline 4, and each pipeline represents a different processor. These pipelines exist in parallel in the switch, and each pipeline can call multiple stacking channels. For example, pipeline 1 can call 15 stacking channels, wherein each pipeline has independent stacking channels with the same channel description information. For example, the channel description information of the stacking channel that can be called by pipeline 1 can be, but is not limited to, the same as the channel description information of the stacking channel that can be called in pipelines 2 to 4. The switch is connected to multiple line cards through a backplane, and each stacking channel on the backplane is associated with a specific pipeline, ensuring that data can flow accurately from the data port to the target line card. When data enters from different data ports, they will be assigned to the corresponding pipeline for processing, and the processor will generate the corresponding channel description information based on the port information and processor description information of the data, combined with the corresponding channel parameters, so as to determine a more suitable stacking channel for transmission. For example, when data enters from a port with a hash value of 1 and is assigned to pipeline 4 for processing, the processor will generate channel description information based on the data's port information and processor description information, combined with channel parameters, and filter out stack channel 1 in pipeline 4 as the transmission channel to transmit data to line card 4.
[0043] Optionally, in this embodiment, a backplane and line cards may be deployed on the switch but are not limited to being deployed thereon, the stacking channel may include but is not limited to a physical channel for transmitting data between the backplane and the line card, and the pipeline may include but is not limited to cores in the switch, for example, multiple cores can process data received by multiple network cards in parallel.
[0044] Optionally, in this embodiment, each processor may, but is not limited to, have a corresponding data port and stacking channel, and the data port and stacking channel corresponding to each processor may, but are not limited to, be different. For example, processor 1 processes the data received on data port 1 by calling the stacking channels among stacking channels 1 to stacking channels 5, wherein stacking channels 1 to stacking channels 5 are the stacking channels allowed to be called by processor 1, and processor 2 processes the data received on data port 2 by calling the stacking channels among stacking channels 6 to stacking channels 10, wherein stacking channels 6 to stacking channels 10 are the stacking channels allowed to be called by processor 2.
[0045] Optionally, in this embodiment, it is possible but not limited to take the example that the processor includes a pipeline, the port information includes a hash value of the source port, and the channel description information includes a stack channel ID. Each pipeline has its own managed port resources, and the port of pipeline 1 can only be forwarded to the stack channel where pipeline 1 is located in pipeline forwarding. For example, in a stacking environment, the source port hash values on multiple pipelines are all 1, and there are stack channels with a routing hash value of 1 on pipeline 1 and pipeline 2, and the stack channel ID is 1. At this time, if the traffic comes in from the port of pipeline 1, then its traffic outlet will select the stack channel of pipeline 1; similarly, if the traffic comes in from the port of pipeline 2, then the stack channel of pipeline 2 will be selected to go out. Multiple inlet ports of the same pipeline can be configured with different hash values, and the data outlet port does not need to know which pipeline the data is processed through, and then selects the outlet according to the stack channel of the pipeline, so that the resource expansion of stack routing can be achieved.
[0046] In the technical solution provided in the above step S204, there may be but is not limited to a one-to-one correspondence between the processor and the processor description information, and different processors may but are not limited to corresponding to different processor description information. For example, the processor description information may be but is not limited to a processor identifier (for example, a processor ID), a processor name, a processor number, etc.
[0047] Optionally, in this embodiment, the channel description information may be but is not limited to being used to select different stacking channels, and the channel description information may be but is not limited to including different stacking channel configuration information, such as the ID of the stacking channel, the hash value of the stacking channel, and the like.
[0048] Optionally, in this embodiment, if two data are received at the same time, the channel parameters selected from the candidate channel parameters may be, but are not limited to, the same or different. In this case, the generated channel description information may be, but are not limited to, the same or different, and the corresponding selected stacking channels may also be, but are not limited to, the same or different.
[0049] In an exemplary embodiment, the target channel description information can be generated based on the target port information, the processor description information of the processor, and the target channel parameters in the following manner, but is not limited to: filtering the target channel parameters corresponding to the target time from the candidate channel parameters; performing a target splicing operation on the target port information, the processor description information, and the target channel parameters to obtain the target channel description information.
[0050] Optionally, in this embodiment, the target time may include, but is not limited to, the time when the target data is received by the data port on the switch, or the time when the target data received by the data port on the switch needs to be transmitted.
[0051] Optionally, in this embodiment, the channel description information may include a stacking channel ID, and the processor may include a pipeline as an example, but is not limited to the example. The ID of the stacking channel may be, but is not limited to, an important parameter for routing. In a multi-core chip (equivalent to a multi-processor) architecture, the stacking channel ID can exist separately on each pipeline. For example, a stacking channel with an ID of 1 can exist simultaneously on pipeline 1, pipeline 2, and pipeline 8. It should be noted that the stacking channels corresponding to the same stacking channel ID corresponding to different pipelines are different channels.
[0052] In an exemplary embodiment, the target channel parameter corresponding to the target time can be filtered from the candidate channel parameters in the following manner but is not limited to: when the candidate channel parameters include N channel parameters, the target channel parameter is filtered from the N channel parameters by performing the following steps, wherein N is a positive integer greater than or equal to 2: detecting a reference channel parameter corresponding to reference data received on the data port for transmission, wherein the reference data is data received by the data port at a reference time, the reference time is earlier than the target time, and the reference data is the previous data received by the data port before the target data; and determining the next channel parameter among the reference channel parameters among the N channel parameters as the target channel parameter.
[0053] Optionally, in this embodiment, the reference stacking channel used to transmit reference data can be, but is not limited to, determined based on the port information of the target data port, the processor description information of the processor, and the reference channel parameters corresponding to the reference time, wherein the reference channel parameters are determined from the candidate channel parameters based on the reference time when the reference data is received.
[0054] Optionally, in this embodiment, the reference channel parameter corresponding to the target data received by the processor transmission data port may be determined based on, but not limited to, the reference channel parameter corresponding to the reference data received on the processor transmission data port. Figure 4 is a schematic diagram of an optional method for screening target channel parameters according to an embodiment of the present application, such as Figure 4 As shown, it can be but not limited to taking the reference time as t0, the target time as t1, the reference channel parameter as channel parameter 2, the target channel parameter as channel parameter 3, and the candidate channel parameters including 5 channel parameters (for example, channel parameter 1 to channel parameter 5) as an example.
[0055] The data port receives the reference data at time t0 and receives the target data at target time t1. At time t0, the processor determines the more appropriate reference channel parameter 2. In this case, the processor needs to select a new channel parameter for the target data to be transmitted. At this time, the processor automatically determines the next parameter (for example, channel parameter 3) among the candidate channel parameters as the target channel parameter corresponding to the target time t1.
[0056] As an optional embodiment, if the candidate channel parameters are arranged in a certain sequence (for example, channel parameter 1 to channel parameter N), when the reference channel parameter is the kth parameter in the sequence, the target channel parameter can be determined as, but is not limited to, the k+1th parameter in the sequence.
[0057] Optionally, in this embodiment, the target channel parameter can be selected from other channel parameters in the candidate channel parameters except the reference channel parameter, but is not limited to it. For example, a channel parameter is randomly selected from other channel parameters in the candidate channel parameters except the reference channel parameter as the target channel parameter.
[0058] In an exemplary embodiment, the target channel description information can be obtained by performing a target splicing operation on the target port information, the processor description information and the target channel parameters in the following manner but not limited to: detecting the target splicing mode corresponding to the target time from candidate splicing modes; and performing the target splicing operation on the target port information, the processor description information and the target channel parameters according to the target splicing mode to obtain the target channel description information.
[0059] Optionally, in this embodiment, the splicing method may include but is not limited to the arrangement order between port information, processor description information and channel parameters. For example, the target channel description information may include but is not limited to port information-processor description information-channel parameters, or channel parameters-processor description information-port information, etc.
[0060] Figure 5 is a schematic diagram of an optional splicing method according to an embodiment of the present application, such as Figure 5As shown, the splicing method may include but is not limited to the arrangement order of port information, processor description information and channel parameters, and different arrangement orders may generate different target channel description information.
[0061] like Figure 5 As shown in (a), the positions of the target port information and the processor description information may be fixed first, but not limited to. In this case, the target channel parameters may be spliced to position 1, position 2 or position 3. In the case of splicing the target channel parameters to position 1, the spliced target channel description information may include but not limited to target channel parameters-target port information-processor description information; in the case of splicing the target channel parameters to position 2, the spliced target channel description information may include but not limited to target port information-target channel parameters-processor description information; in the case of splicing the target channel parameters to position 2, the spliced target channel description information may include but not limited to target port information-processor description information-target channel parameters.
[0062] like Figure 5 As shown in (b), the positions of the processor description information and the target channel parameters may be, but are not limited to, fixed. In this case, the target port information may be, but are not limited to, spliced to position 4 or position 5. When the target port information is spliced to position 4, the spliced target channel description information may include, but are not limited to, processor description information-target port information-target channel parameters; when the target port information is spliced to position 5, the spliced target channel description information may include, but are not limited to, processor description information-target channel parameters-target port information.
[0063] like Figure 5 As shown in (c), the positions of the target channel parameters and the target port information may be, but are not limited to, fixed. In this case, the processor description information may be, but are not limited to, spliced to position 6. In the case of splicing the processor description information to position 6, the spliced target channel description information may include, but are not limited to, target channel parameters-processor description information-target port information.
[0064] It should be noted that in Figure 5 In the embodiment, it is also possible but not limited to first fixing the target port information and the target channel parameters, and then splicing the processor description information to a position where splicing is allowed, or first fixing the position of the processor description information and the target channel parameters, and then splicing the target port information to a position where splicing is allowed. By generating non-repetitive channel description information, it is ensured that the channel description information obtained by each splicing method can correspond to a stacking channel.
[0065] Optionally, in this embodiment, the target channel description information may include, but is not limited to, the spliced target port information, processor description information, and target channel parameters. These information parameters may change in different data transmission requests or network environments. However, no matter how the parameters change, the generation of the channel description information will follow a set of fixed principles to ensure that the description information value finally generated can be within a predefined range, and each description information value is mapped to a specific stacking channel.
[0066] In an exemplary embodiment, the target splicing mode corresponding to the target time can be detected from the candidate splicing modes in the following manner but is not limited to: when the candidate splicing modes include M splicing modes, the target splicing mode is screened from the M splicing modes by performing the following steps, wherein M is a positive integer greater than or equal to 2: detecting a reference splicing mode corresponding to a reference time at which reference data is received on the data port, wherein the reference time is earlier than the target time and the previous data received by the data port before the target data is reference data; and determining the next splicing mode among the reference splicing modes among the M splicing modes as the target splicing mode.
[0067] Optionally, in this embodiment, the splicing mode corresponding to the target time at which the processor transmission data port receives the target data may be determined based on, but not limited to, the splicing mode corresponding to the reference time at which the processor transmission data port receives the reference data. Figure 6 is a schematic diagram of an optional screening target splicing method according to an embodiment of the present application, such as Figure 6 As shown, it can be but not limited to taking the reference time as t0, the target time as t1, the reference splicing method as splicing method 1, the target splicing method as splicing method 2, and the candidate splicing methods including 6 splicing methods (for example, splicing methods 1 to 6) as an example.
[0068] The data port receives the reference data at time t0 and receives the target data at time t1. At time t0, the processor determines a more appropriate splicing mode 1 based on the port information of the target port, the processor description information of the processor, and the reference channel parameters. In this case, the processor needs to determine the corresponding splicing mode for the target data to be transmitted. At this time, the processor automatically determines the next splicing mode (for example, splicing mode 2) among the candidate splicing modes as the target splicing mode corresponding to the target time t1.
[0069] As an optional example, if the candidate splicing methods are arranged in a certain sequence (for example, splicing method 1 to splicing method N), when the reference splicing method is the kth splicing method in the sequence, the target splicing method will be determined as the k+1th splicing method in the sequence.
[0070] Optionally, in this embodiment, the target stitching method can be selected from other stitching methods in the candidate stitching methods except the reference stitching method, but is not limited to it. For example, a stitching method is randomly selected from other stitching methods in the candidate stitching methods except the reference stitching method as the target stitching method.
[0071] By dynamically adjusting the splicing method, for switches with multi-processor architecture, the load of the stacking channels corresponding to the processors in the switch can be effectively balanced, avoiding high data transmission delays caused by overload of a single stacking channel, and improving the efficiency of data transmission on the switch.
[0072] In the technical solution provided in the above step S206, the target stacking channel matching the target channel description information can be screened from the candidate stacking channels in the following manner, but not limited to: the channel description information of each candidate stacking channel is compared with the generated target channel description information, and the objects of comparison can include, but not limited to, the content and splicing method of the channel description information. If the channel description information of a candidate stacking channel completely matches the channel description information of the target channel, it is considered that the match is successful.
[0073] In an exemplary embodiment, the target stacking channel that matches the target channel description information can be screened from the candidate stacking channels according to the target channel description information but is not limited to the following method: screening first channel description information including the target channel description information from the candidate channel description information corresponding to the candidate stacking channel; screening second channel description information spliced according to a target splicing method from the first channel description information, and determining the stacking channel corresponding to the second channel description information as the target stacking channel, wherein each information in the target channel description information is spliced according to the target splicing method.
[0074] Optionally, in this embodiment, the first channel description information may include, but is not limited to, the same content as the target channel description information, but the splicing method of the content included in the first channel description information may be different from or the same as the splicing method of the content included in the target channel description information.
[0075] Optionally, in this embodiment, the second channel description information may include, but is not limited to, the same content as the target channel description information, and a splicing method of the content included in the second channel description information is different from a splicing method of the content included in the target channel description information.
[0076] In an exemplary embodiment, the first channel description information including the target channel description information can be filtered out from the candidate channel description information corresponding to the candidate stacking channel in the following manner, but is not limited to: when the candidate stacking channel description information includes P description information corresponding to P stacking channels, the first channel description information including the target channel description information is filtered out from the P description information by performing the following steps, wherein the candidate stacking channel includes the P stacking channels, and P is a positive integer: filtering out R description information including the target port information, the processor description information, and the target channel parameters from the P description information, wherein the target channel description information includes the target port information, the processor description information and the target channel parameter, the first channel description information includes the R description information, R is a positive integer less than or equal to P; the second channel description information spliced according to the target splicing mode is screened from the first channel description information: when the first channel description information includes R description information, the second channel description information spliced according to the target splicing mode is screened from the R description information by performing the following steps: detecting R matching degrees between the R splicing modes corresponding to the R description information and the target splicing mode; and determining the channel description information corresponding to the matching degree greater than or equal to the matching degree threshold among the R matching degrees as the second channel description information.
[0077] Optionally, in this embodiment, the stacking channel whose channel description information among the candidate stacking channels has the highest matching degree with the target channel description information may be determined as the target stacking channel, but is not limited to it.
[0078] Optionally, in this embodiment, when the stacking channel corresponding to the second channel description information fails or is busy, other matching stacking channels may be selected from the candidate stacking channels or a delayed retry mechanism may be implemented, but is not limited to the case. Under the delayed retry mechanism, the processor records the time of the initial attempt failure and tries to call the target stacking channel again after a preset time interval.
[0079] Through the embodiments of the present application, by screening other matching stacking channels or implementing a delayed retry mechanism, the timeliness and continuity of data transmission are ensured, and the stability and efficiency of data transmission are effectively improved.
[0080] In the technical solution provided in the above step S208, before calling the target stacking channel to transmit the target data, the above method may also include but is not limited to: detecting the available status of the target stacking channel, and calling the target stacking channel to transmit the target data when the available status is used to indicate that the target stacking channel allows data transmission.
[0081] In order to better understand the transmission process of the switch data transmission method in the embodiment of the present application, the transmission process of the switch data transmission method in the embodiment of the present application is explained and illustrated below in combination with optional embodiments, which can be applicable to but not limited to the embodiment of the present application.
[0082] In the switch data transmission method, the stacking channel is expanded through a multi-core multi-pipeline architecture (equivalent to multiple processors) to make the stacking channel pipelined. Each pipeline (processor) has an independent stacking channel. Even if the stacking channel ID (equivalent to channel description information) is the same, they will not affect each other. Messages (equivalent to data) coming in from different pipeline ports will only select the stacking channel of the corresponding pipeline. In this way, the stacking channel can be expanded, and the expansion multiple is the number of pipelines.
[0083] Figure 7 is a schematic diagram of a screening stack channel under an optional multi-core architecture according to an embodiment of the present application, such as Figure 7 As shown, there are stacking channels 1 and 2 with the same ID in pipeline 1 and pipeline 2, but since they are on different pipelines, they will not affect each other. For example, the traffic of data port 5 selects stacking channel 1 according to the port hash value. Data port 5 is on pipeline 2, so the stacking channel of pipeline 2 will be selected. Different source ports (equivalent to data ports) can be configured with the same hash value and can be distributed on any pipeline. The stacking channels in the same pipeline cannot be configured with the same hash value to ensure the uniqueness of the hash selection through the source port, but the stacking channels with the same ID in different pipelines can be configured with the same hash value, which is the key to expanding stacking channel resources through a multi-core and multi-pipeline architecture.
[0084] Through the switch data transmission method, the characteristics of the multi-core multi-pipeline architecture are utilized to pipeline the management granularity of the stacking channel, effectively solving the problem of insufficient optional channel resources in the stacking scenario. Through the embodiments of the present application, the stacking channel resources can be increased to multiples of the number of pipelines. For example, after expansion, the stacking channel resources are increased by 4 to 8 times, which fully meets the needs of existing frame devices. By accurately selecting the stacking channel through the source entrance, the routing strategy becomes more flexible and free, significantly improving the efficiency and performance of network data transmission, achieving a substantial expansion of the stacking channel resources, while maintaining the flexibility of routing and improving data transmission efficiency.
[0085] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of each embodiment of the present application.
[0086] Figure 8 1 is a structural block diagram of a switch data transmission device according to an embodiment of the present application, wherein a processor, a data port and a candidate stacking channel are deployed on the switch, wherein the data port is used to receive data to be transmitted by the switch, and the device is applied to the processor, such as Figure 8 As shown, the device comprises:
[0087] The processing module 802 is used to extract the target data received by the target data port in the data port, and detect the target port information of the target data port;
[0088] A generating module 804, configured to generate target channel description information according to the target port information, the processor description information of the processor and the target channel parameter, wherein the target channel parameter is determined from the candidate channel parameters according to the target time of receiving the target data;
[0089] A screening module 806 is configured to screen, according to the target channel description information, a target stacking channel that matches the target channel description information from the candidate stacking channels;
[0090] The transmission module 808 is used to call the target stacking channel to transmit the target data.
[0091] Through the above device, the channel parameters used to generate channel description information are selected from candidate channel parameters according to the time when the data port receives data. It can be understood that the selected channel parameters may change with the time of the data received by the data port. In this case, the stacking channel used to transmit data received at different times on the same data port will also change. It can be understood that the number of stacking channels allowed to transmit data received on the same data port is increased. By selecting different channel parameters, the data received on the same data port can be transmitted through multiple stacking channels. The above technical solution solves the problem of low transmission efficiency of switch data in related technologies and achieves the technical effect of improving the transmission efficiency of switch data.
[0092] In an exemplary embodiment, the generating module includes:
[0093] A first screening unit, configured to screen the target channel parameter corresponding to the target time from the candidate channel parameters;
[0094] An execution unit is used to perform a target splicing operation on the target port information, the processor description information and the target channel parameter to obtain the target channel description information.
[0095] In an exemplary embodiment, the first screening unit is used to:
[0096] In the case where the candidate channel parameters include N channel parameters, the target channel parameters are screened from the N channel parameters by performing the following steps, where N is a positive integer greater than or equal to 2:
[0097] Detecting reference channel parameters corresponding to reference data received on the data port for transmission, wherein the reference data is data received by the data port at a reference time, the reference time is earlier than the target time, and the reference data is the previous data received by the data port before the target data;
[0098] A next channel parameter among the reference channel parameters among the N channel parameters is determined as the target channel parameter.
[0099] In an exemplary embodiment, the execution unit is configured to:
[0100] Detecting a target splicing mode corresponding to the target time from candidate splicing modes;
[0101] According to the target splicing mode, the target splicing operation is performed on the target port information, the processor description information and the target channel parameter to obtain the target channel description information.
[0102] In an exemplary embodiment, the execution unit is further configured to:
[0103] In the case where the candidate splicing modes include M splicing modes, the target splicing mode is selected from the M splicing modes by performing the following steps, wherein M is a positive integer greater than or equal to 2:
[0104] Detecting a reference splicing mode corresponding to a reference time of receiving reference data on the data port for transmission, wherein the reference time is earlier than the target time, and the previous data received by the data port before the target data includes reference data;
[0105] The next splicing mode among the reference splicing modes among the M splicing modes is determined as the target splicing mode.
[0106] In an exemplary embodiment, the screening module includes:
[0107] A second screening unit, configured to screen the first channel description information including the target channel description information from the candidate channel description information corresponding to the candidate stacking channel;
[0108] A processing unit is used to filter the second channel description information spliced according to the target splicing method from the first channel description information, and determine the stacking channel corresponding to the second channel description information as the target stacking channel, wherein each information in the target channel description information is spliced according to the target splicing method.
[0109] In an exemplary embodiment, the second screening unit is further used to: in a case where the candidate stacking channel description information includes P description information corresponding to P stacking channels, screen the first channel description information including the target channel description information from the P description information by performing the following steps, wherein the candidate stacking channels include the P stacking channels, and P is a positive integer: screening R description information including the target port information, the processor description information, and the target channel parameters from the P description information, wherein the target channel description information includes the target port information, the processor description information, and the target channel parameters, and the first channel description information includes the R description information, and R is a positive integer less than or equal to P;
[0110] The processing unit is further used for: when the first channel description information includes R description information, filtering the second channel description information spliced according to the target splicing method from the R description information by executing the following steps: detecting R matching degrees between the R splicing methods corresponding to the R description information and the target splicing method; and determining the channel description information corresponding to the matching degree greater than or equal to the matching degree threshold among the R matching degrees as the second channel description information.
[0111] An embodiment of the present application further provides a storage medium, which includes a stored program, wherein the program executes any of the above methods when it is run.
[0112] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0113] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0114] 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.
[0115] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in any one of the above method embodiments are implemented.
[0116] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.
[0117] An embodiment of the present application also provides a computer program, which includes computer instructions 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 in any one of the above method embodiments.
[0118] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.
[0119] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, and optionally, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.
[0120] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A method for transmitting switch data, characterized in that: A processor, a data port, and a candidate stacking channel are deployed on the switch, the data port is used to receive data to be transmitted by the switch, the method is applied to the processor, and the method includes: Extracting target data received by a target data port among the data ports, and detecting target port information of the target data port; generating target channel description information according to the target port information, the processor description information of the processor, and target channel parameters, wherein the target channel parameters are determined from candidate channel parameters according to a target time of receiving the target data; According to the target channel description information, selecting a target stacking channel matching the target channel description information from the candidate stacking channels; The target stack channel is called to transmit the target data.
2. The method according to claim 1, characterized in that: The generating target channel description information according to the target port information, the processor description information of the processor and the target channel parameter comprises: Filter the target channel parameter corresponding to the target time from the candidate channel parameters; A target splicing operation is performed on the target port information, the processor description information, and the target channel parameter to obtain the target channel description information.
3. The method according to claim 2, characterized in that The step of selecting the target channel parameter corresponding to the target time from the candidate channel parameters includes: In the case where the candidate channel parameters include N channel parameters, the target channel parameters are screened from the N channel parameters by performing the following steps, where N is a positive integer greater than or equal to 2: Detecting reference channel parameters corresponding to reference data received on the data port for transmission, wherein the reference data is data received by the data port at a reference time, the reference time is earlier than the target time, and the reference data is the previous data received by the data port before the target data; A next channel parameter among the reference channel parameters among the N channel parameters is determined as the target channel parameter.
4. The method according to claim 2, characterized in that: The performing a target splicing operation on the target port information, the processor description information and the target channel parameter to obtain the target channel description information includes: Detecting a target splicing mode corresponding to the target time from candidate splicing modes; According to the target splicing mode, the target splicing operation is performed on the target port information, the processor description information and the target channel parameter to obtain the target channel description information.
5. The method according to claim 4, characterized in that The detecting the target splicing mode corresponding to the target time from the candidate splicing modes includes: In the case where the candidate splicing modes include M splicing modes, the target splicing mode is selected from the M splicing modes by performing the following steps, wherein M is a positive integer greater than or equal to 2: Detecting a reference splicing mode corresponding to a reference time of receiving reference data on the data port for transmission, wherein the reference time is earlier than the target time, and the previous data received by the data port before the target data includes reference data; The next splicing mode among the reference splicing modes among the M splicing modes is determined as the target splicing mode.
6. The method according to claim 1, characterized in that The step of selecting, according to the target channel description information, a target stacking channel that matches the target channel description information from the candidate stacking channels includes: Filtering first channel description information including the target channel description information from the candidate channel description information corresponding to the candidate stacking channel; Second channel description information spliced in a target splicing manner is filtered from the first channel description information, and a stacking channel corresponding to the second channel description information is determined as the target stacking channel, wherein each information in the target channel description information is spliced in the target splicing manner.
7. The method according to claim 6, characterized in that The step of filtering the first channel description information including the target channel description information from the candidate channel description information corresponding to the candidate stacking channels comprises: when the candidate stacking channel description information comprises P description information corresponding to P stacking channels, filtering the first channel description information including the target channel description information from the P description information by performing the following steps, wherein the candidate stacking channels comprise the P stacking channels, and P is a positive integer: filtering R description information including the target port information, the processor description information, and the target channel parameters from the P description information, wherein the target channel description information comprises the target port information, the processor description information, and the target channel parameters, and the first channel description information comprises the R description information, and R is a positive integer less than or equal to P; The method of screening the second channel description information spliced according to the target splicing method from the first channel description information comprises: when the first channel description information includes R description information, screening the second channel description information spliced according to the target splicing method from the R description information by performing the following steps: detecting R matching degrees between the R splicing methods corresponding to the R description information and the target splicing method; and determining the channel description information corresponding to the matching degree greater than or equal to the matching degree threshold among the R matching degrees as the second channel description information.
8. A switch data transmission device, characterized in that: A processor, a data port and a candidate stacking channel are deployed on the switch, the data port is used to receive data to be transmitted by the switch, the device is applied to the processor, and the device includes: A processing module, used for extracting target data received by a target data port among the data ports, and detecting target port information of the target data port; A generating module, configured to generate target channel description information according to the target port information, the processor description information of the processor and the target channel parameter, wherein the target channel parameter is determined from the candidate channel parameters according to the target time of receiving the target data; A screening module, configured to screen, according to the target channel description information, a target stacking channel that matches the target channel description information from the candidate stacking channels; The transmission module is used to call the target stacking channel to transmit the target data.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein the program executes the method according to any one of claims 1 to 7 when executed.
10. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 7 through the computer program.