CN113259264B - Data transmission method and device, computer equipment and storage medium - Google Patents
Data transmission method and device, computer equipment and storage medium Download PDFInfo
- Publication number
- CN113259264B CN113259264B CN202110767500.8A CN202110767500A CN113259264B CN 113259264 B CN113259264 B CN 113259264B CN 202110767500 A CN202110767500 A CN 202110767500A CN 113259264 B CN113259264 B CN 113259264B
- Authority
- CN
- China
- Prior art keywords
- target
- storage area
- data
- address
- transmitted
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 53
- 230000005540 biological transmission Effects 0.000 title claims abstract description 39
- 238000013500 data storage Methods 0.000 claims abstract description 25
- 230000004044 response Effects 0.000 claims abstract description 18
- 238000004590 computer program Methods 0.000 claims description 25
- 238000001514 detection method Methods 0.000 claims description 4
- 238000012545 processing Methods 0.000 abstract description 6
- 230000002349 favourable effect Effects 0.000 abstract 1
- 238000010586 diagram Methods 0.000 description 7
- 239000000872 buffer Substances 0.000 description 6
- 238000004891 communication Methods 0.000 description 6
- 238000005516 engineering process Methods 0.000 description 5
- 239000011159 matrix material Substances 0.000 description 4
- 101000854862 Homo sapiens Vacuolar protein sorting-associated protein 35 Proteins 0.000 description 1
- 102100020822 Vacuolar protein sorting-associated protein 35 Human genes 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L49/00—Packet switching elements
- H04L49/90—Buffering arrangements
- H04L49/9047—Buffering arrangements including multiple buffers, e.g. buffer pools
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Memory System Of A Hierarchy Structure (AREA)
Abstract
The application relates to a data transmission method, a data transmission device, computer equipment and a storage medium. The method is applied to a forwarding querier of a switch, the forwarding querier is connected with a memory of the switch, the memory comprises a plurality of primary storage areas, and each primary storage area corresponds to at least one input port and all output ports of the switch; the method comprises the following steps: in response to a data storage request containing data to be transmitted, which is sent by a write manager of the switch, determining an identifier of an input port corresponding to the write manager; determining the address of a target primary storage area matched with the identification of the input port from a plurality of primary storage areas; and sending the address of the target first-level storage area to the write manager to indicate the write manager to cache the data to be transmitted to the target first-level storage area according to the address of the target first-level storage area. The method can be used for processing the data to be transmitted stored in different primary storage areas in parallel, and is favorable for accelerating the data transmission efficiency.
Description
Technical Field
The present application relates to the field of switch data processing technologies, and in particular, to a data transmission method and apparatus, a computer device, and a storage medium.
Background
With the development of switched network technology, switched network systems play an increasingly important role. The switch is an essential device for data exchange between nodes in the switched network system. The switching element in the switch belongs to the core unit and directly determines the performance index of the switch. The switching component is used for forwarding data to be transmitted from the input port to the output port according to a forwarding protocol.
In the conventional technology, a data transmission method of a switch element is to transmit data to be transmitted received by an input port to a memory, and then an output port reads and forwards the data to be transmitted from the memory according to a scheduling rule.
However, the conventional technology is adopted, the data storage mode is simple, and the data transmission efficiency is low when the data to be transmitted of the multi-input channel is input.
Disclosure of Invention
In view of the above, it is necessary to provide a data transmission method, an apparatus, a computer device and a storage medium capable of improving data transmission efficiency.
A data transmission method is applied to a forwarding querier of a switch, the forwarding querier is connected with a memory of the switch, the memory comprises a plurality of primary storage areas, and each primary storage area corresponds to at least one input port and all output ports of the switch; the method comprises the following steps:
in response to a data storage request containing data to be transmitted, which is sent by a write manager of the switch, determining an identifier of an input port corresponding to the write manager;
determining the address of a target primary storage area matched with the identification of the input port from the plurality of primary storage areas;
and sending the address of the target first-level storage area to the write manager to indicate the write manager to cache the data to be transmitted to the target first-level storage area according to the address of the target first-level storage area.
In one embodiment, each primary storage area comprises a plurality of secondary storage areas, each secondary storage area corresponds to at least one input port corresponding to the primary storage area, and each secondary storage area corresponds to at least one output port; the method further comprises the following steps:
determining the identifier of the output port according to the data to be transmitted in the data storage request;
according to the address of the target primary storage area, determining the address of the target secondary storage area matched with the identifier of the output port from a plurality of secondary storage areas in the target primary storage area;
the sending the address of the target first-level storage area to the write manager to instruct the write manager to cache the data to be transmitted into the target first-level storage area according to the address of the target first-level storage area includes:
and sending the address of the target secondary storage area in the target primary storage area to the write manager to indicate the write manager to cache the data to be transmitted to the target secondary storage area according to the address of the target secondary storage area.
In one embodiment, each of the secondary storage areas comprises a plurality of storage spaces corresponding to each of the output ports; the method further comprises the following steps:
acquiring the operating states of a plurality of storage spaces corresponding to the identifiers of the output ports in the target secondary storage area according to the address of the target secondary storage area;
the sending the address of the target secondary storage area in the target primary storage area to the write manager to instruct the write manager to cache the data to be transmitted into the target secondary storage area according to the address of the target secondary storage area includes:
if the storage space with the operating state being an idle state exists in the plurality of storage spaces, determining the storage space with the idle state in the target secondary storage area as a target storage space, and sending an address of the target storage space to the write manager so as to instruct the write manager to cache the data to be transmitted into the target storage space according to the address of the target storage space.
In one embodiment, the method further comprises:
and adjusting the running state of the target storage space to be an occupied state in response to the detection that part or all of the data to be transmitted is cached in the target storage space.
In one embodiment, the method further comprises:
and sending the identifier of the output port to the write manager to instruct the write manager to send the address of the target storage space to the read manager corresponding to the output port according to the identifier of the output port.
In one embodiment, the method further comprises:
responding to a data reading request which is sent by the reading manager and contains the target storage space, sending the running state of the target storage space to the reading manager so as to indicate the reading manager to read the data to be transmitted from the target storage space and send the data to an output port corresponding to the identifier of the output port when the running state is an occupied state.
In one embodiment, the method further comprises:
and adjusting the running state of the target storage space to be an idle state after the data to be transmitted cached in the target storage space is sent to the read manager.
A data transmission device is used for a forwarding querier of a switch, the forwarding querier is connected with a memory of the switch, the memory comprises a plurality of primary storage areas, and each primary storage area corresponds to at least one input port and all output ports of the switch; the device comprises:
the port determining module is used for responding to a data storage request containing data to be transmitted and sent by a write manager of the switch, and determining the identifier of an input port corresponding to the write manager;
the address determining module is used for determining the address of a target primary storage area matched with the identification of the input port from the plurality of primary storage areas;
and the address sending module is used for sending the address of the target primary storage area to the write manager so as to indicate the write manager to cache the data to be transmitted to the target primary storage area according to the address of the target primary storage area.
A computer device comprising a memory and a processor, the memory storing a computer program, the processor implementing the following steps when executing the computer program:
in response to a data storage request containing data to be transmitted, which is sent by a write manager of the switch, determining an identifier of an input port corresponding to the write manager;
determining the address of a target primary storage area matched with the identification of the input port from the plurality of primary storage areas;
and sending the address of the target first-level storage area to the write manager to indicate the write manager to cache the data to be transmitted to the target first-level storage area according to the address of the target first-level storage area.
A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, carries out the steps of:
in response to a data storage request containing data to be transmitted, which is sent by a write manager of the switch, determining an identifier of an input port corresponding to the write manager;
determining the address of a target primary storage area matched with the identification of the input port from the plurality of primary storage areas;
and sending the address of the target first-level storage area to the write manager to indicate the write manager to cache the data to be transmitted to the target first-level storage area according to the address of the target first-level storage area.
According to the data transmission method, the data transmission device, the computer equipment and the storage medium, the plurality of primary storage areas are arranged in the memory of the switch, and each primary storage area corresponds to at least one input port and all output ports of the switch, so that multiple input channels can be grouped and share the plurality of primary storage areas. When the data to be transmitted of the multiple input channels is input, the data to be transmitted stored in different first-level storage areas can be processed in parallel through matching of the identification of the input port and the first-level storage areas, and the data to be transmitted of the same first-level storage area can be accessed in a time-sharing manner, so that the data transmission efficiency is accelerated, and the matching of input and output bandwidths is easily met.
Drawings
FIG. 1 is a diagram of an exemplary data transmission method;
FIG. 2 is a flow diagram illustrating a method for data transmission according to one embodiment;
FIG. 3 is a flow chart illustrating a data transmission method according to another embodiment;
FIG. 4 is a diagram of an application environment of a data transmission method in another embodiment;
FIG. 5 is a block diagram showing the structure of a data transmission apparatus according to an embodiment;
FIG. 6 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The data transmission method provided by the application can be applied to the application environment shown in fig. 1. The switch includes, among other things, a forwarding querier 102, a memory 104, an input port 106, a write manager 108, an output port 110, and a read manager 112. The forwarding interrogator 102 is respectively connected to the memory 104, the write manager 108 and the read manager 112, the input port 106 is connected to the write manager 108 and further connected to the memory 104, and the output port 110 is connected to the read manager 112 and further connected to the memory 104. The memory 104 includes a plurality of primary storage areas, each primary storage area corresponding to at least one input port 106 and all output ports 110. Specifically, in response to a data storage request containing data to be transmitted, which is sent by the write manager 108 of the switch, the forwarding querier 102 determines an identifier of the input port 106 corresponding to the write manager 108, determines an address of a target primary storage area, which matches the identifier of the input port 106, from the plurality of primary storage areas, and sends the address of the target primary storage area to the write manager 108, so as to instruct the write manager to cache the data to be transmitted into the target primary storage area according to the address of the target primary storage area.
In one embodiment, as shown in fig. 2, a data transmission method is provided, which is described by taking the method as an example applied to the forwarding querier in fig. 1, and includes the following steps:
step S202, in response to a data storage request containing data to be transmitted sent by a write manager of the switch, determining an identification of an input port corresponding to the write manager.
Wherein the identification of the input port is used to distinguish the input port and uniquely identify the input port.
Specifically, in the switch, data to be transmitted is input through an input port in the form of a data frame, and the data to be transmitted is sent to a connected write manager after being subjected to protocol processing by an input port protocol processing module connected to the input port. Optionally, the number of the input ports is multiple, and the input ports, the input port protocol processing modules and the write managers correspond to one another. Then, the write manager generates a data storage request containing data to be transmitted and sends the data storage request to the forwarding querier. Then, the forwarding querier determines the identifier of the input port corresponding to the write manager, namely the identifier of the input port inputting the data to be transmitted, in response to the data storage request sent by the write manager.
In step S204, the address of the target primary storage area matching the identification of the input port is determined from the plurality of primary storage areas.
Wherein, a plurality of first-level storage areas in the memory respectively establish corresponding relations with the identification of the input port in advance.
Specifically, the forwarding querier matches the identifier of the input port with the primary storage areas from the plurality of primary storage areas based on the corresponding relationship according to the identifier of the input port, acquires the address of the target primary storage area matched with the identifier of the input port if the matching is successful, and ends the process of the method if the matching is failed.
Step S206, the address of the target first-level storage area is sent to the write manager to indicate the write manager to cache the data to be transmitted to the target first-level storage area according to the address of the target first-level storage area.
Specifically, the forwarding querier sends the address of the target primary storage area to the write manager. Then, the write manager caches the data to be transmitted to the target first-level storage area according to the address of the target first-level storage area, so that the subsequent output port can read the data to be transmitted from the target first-level storage area.
In the data transmission method, a plurality of primary storage areas are arranged in the memory of the switch, and each primary storage area corresponds to at least one input port and all output ports of the switch, so that multiple input channels can be grouped and share the plurality of primary storage areas. When the data to be transmitted of the multiple input channels is input, the data to be transmitted stored in different first-level storage areas can be processed in parallel through matching of the identification of the input port and the first-level storage areas, and the data to be transmitted of the same first-level storage area can be accessed in a time-sharing manner, so that the data transmission efficiency is accelerated, and the matching of input and output bandwidths is easily met.
In one embodiment, a plurality of independent secondary storage areas are opened in each primary storage area. Alternatively, the secondary storage area may be a Random Access Memory (RAM). Each secondary storage area corresponds to at least one input port corresponding to the primary storage area to which the secondary storage area belongs, and each secondary storage area corresponds to at least one output port. For example, suppose that the switch has 32 input ports (0 to 31) and 32 output ports (0 to 31), wherein the switch includes 4 primary storage areas, namely MEM0, MEM1, MEM2 and MEM 3. Each primary memory area comprises 4 secondary memory areas, namely the MEM0 comprises 4 secondary memory areas, namely the MEM00, the MEM01, the MEM02 and the MEM03, the MEM1 comprises 4 secondary memory areas, and the MEM10, the MEM11, the MEM12 and the MEM13 …, the MEM3 comprises 4 secondary memory areas, namely the MEM30, the MEM31, the MEM32 and the MEM 33. Assuming that the first-level memory area MEM0 is used to buffer data to be transmitted input by 8 input ports 0-7 and output data to be transmitted from 32 output ports 0-31, i.e. MEM0 corresponds to input ports 0-7 and output ports 0-31, the second-level memory areas MEM00, MEM01, MEM02 and MEM03 all correspond to input ports 0-7, i.e. all can buffer data to be transmitted input by 8 input ports 0-7. However, MEM00 may correspond to output ports 0-7, MEM01 may correspond to output ports 8-15, MEM02 may correspond to output ports 16-23, and MEM03 may correspond to output ports 24-32. It will be appreciated that the secondary memory blocks share the input ports of the primary memory blocks, but need to be grouped into output ports of the primary memory blocks. Similarly, the corresponding relationship between the other primary storage area and the secondary storage area is similar, and is not described herein again. Of course, the primary storage area and the secondary storage area in the above example may also adopt other sharing manners and grouping manners.
Based on this, as shown in fig. 3, after "in response to a data storage request containing data to be transmitted sent by a write manager of the switch" in step S202, the method further includes the steps of:
step S203, determining an identifier of the output port according to the data to be transmitted in the data storage request.
Specifically, the data to be transmitted includes data forwarding feature information, such as a destination MAC address in an ethernet protocol. The forwarding querier reads the data forwarding characteristic information from the data to be transmitted, and judges the destination port of the data forwarding, namely the identification of the output port, according to the data forwarding characteristic information and by looking up the table.
Further, the method comprises the following steps:
step S205, according to the address of the target primary storage area, the address of the target secondary storage area matched with the identification of the output port is determined from a plurality of secondary storage areas in the target primary storage area.
Wherein, a plurality of secondary storage areas in the primary storage area respectively establish corresponding relations with the identifiers of the output ports in advance.
Specifically, the forwarding querier determines a target primary storage area according to an address of the target primary storage area, matches the identifier of the output port with the secondary storage areas from a plurality of secondary storage areas in the target primary storage area based on the corresponding relationship according to the identifier of the output port, acquires the address of the target secondary storage area matched with the identifier of the output port if the matching is successful, and ends the process of the method if the matching is failed.
Further, step S206 "send the address of the target primary storage area to the write manager to instruct the write manager to cache the data to be transmitted into the target primary storage area according to the address of the target primary storage area" is involved in a possible implementation manner. On the basis of the above embodiment, step S206 includes the steps of:
step S2062, sending the address of the target secondary storage area in the target primary storage area to the write manager, so as to instruct the write manager to cache the data to be transmitted into the target secondary storage area according to the address of the target secondary storage area.
Specifically, the forwarding inquirer sends the address of the target secondary storage area in the target primary storage area to the write manager. Then, the write manager caches the data to be transmitted to the target secondary storage area according to the address of the target secondary storage area, so that the subsequent output port can read the data to be transmitted from the target secondary storage area.
In this embodiment, a plurality of secondary storage areas are provided in the primary storage area, each secondary storage area corresponds to at least one input port corresponding to the primary storage area to which it belongs, and each secondary storage area corresponds to at least one output port, so that multiple output channels can be grouped and correspond to the plurality of secondary storage areas. When the data to be transmitted of the multi-output channel is output, the data to be transmitted output from different secondary storage areas can be processed in parallel through the matching of the identification of the output port and the secondary storage areas, and the data transmission efficiency is accelerated.
In one embodiment, each secondary storage area includes a plurality of storage spaces corresponding to each output port. Taking the above-mentioned output ports 0-7 corresponding to the secondary memory area MEM00 as an example, 4 memory spaces are opened in the MEM00 for each output port, and each memory space can buffer 1 frame of data, so that each output port opens up 4 frame data buffers, that is, each output port can buffer 4 frames of data. The storage space may also be referred to as a memory block. Optionally, the plurality of memory spaces corresponding to each output port are used independently, that is, the memory spaces corresponding to different output ports are not shared.
Based on this, the method further comprises the steps of:
step S212, according to the address of the target secondary storage area, obtaining the operating states of a plurality of storage spaces corresponding to the identifiers of the output ports in the target secondary storage area.
Specifically, the forwarding querier determines a target secondary storage area according to an address of the target secondary storage area, and obtains the operation states of a plurality of storage spaces corresponding to the output ports, which are recorded in advance, according to the identifiers of the output ports. Optionally, the running state comprises an idle state and an occupied state.
Further, step S2062 "sending the address of the target secondary storage area in the target primary storage area to the write manager to instruct the write manager to cache the data to be transmitted into the target secondary storage area according to the address of the target secondary storage area" is involved in a possible implementation manner. On the basis of the above embodiment, step S2062 includes the steps of:
step S214, if a storage space with an operating state being an idle state exists in the plurality of storage spaces, determining the storage space with the idle state in the target secondary storage area as a target storage space, and sending an address of the target storage space to the write manager to instruct the write manager to cache the data to be transmitted into the target storage space according to the address of the target storage space.
Specifically, the forwarding querier queries that a storage space with an idle operating state exists in a plurality of storage spaces corresponding to the identifiers of the output ports in the target secondary storage area, and then takes the storage space with the idle operating state in the target secondary storage area as a target storage space and sends the address of the target storage space to the write manager. Then, the write manager caches the data to be transmitted to the free target storage space according to the address of the target storage space, so that the subsequent output port can read the data to be transmitted from the storage space.
Optionally, the forwarding querier adjusts the operating state of the target storage space from an idle state to an occupied state when detecting that part or all of the data to be transmitted is cached in the target storage space.
In this embodiment, a plurality of storage spaces are provided for each output port in the secondary storage area, so that more data to be transmitted can be cached in each output channel, which is beneficial to improving data transmission performance.
In one embodiment, the method further comprises the steps of:
step S222, sending the identifier of the output port to the write manager, so as to instruct the write manager to send the address of the target storage space to the read manager corresponding to the output port according to the identifier of the output port.
Further, in one embodiment, the method further comprises the steps of:
step S232, in response to the data reading request including the target storage space sent by the read manager, sending the operating state of the target storage space to the read manager, so as to instruct the read manager to read the data to be transmitted from the target storage space and send the data to the output port corresponding to the identifier of the output port when the operating state is the occupied state.
Specifically, the forwarding querier sends an identification of the output port to the write manager. And then, the write manager sends the address of the target storage space to the read manager corresponding to the output port according to the identification of the output port. Alternatively, as shown in fig. 4, the write manager sends the identification of the output port and the address of the target memory space to the switch header switch matrix module. The exchange information head exchange matrix module is a small-sized cross-switch matrix. And the exchange information head exchange matrix module judges whether to directly forward or store and forward according to the identifier of the output port and sends the address of the target storage space to the read manager corresponding to the output port. And then, the read manager generates a data read request according to the address of the target storage space and sends the data read request to the forwarding querier. And the forwarding querier sends the running state of the target storage space to the read manager according to the address of the target storage space. And if the running state is the occupied state, the read manager reads the data to be transmitted from the target storage space and sends the data to an output port corresponding to the identifier of the output port through the output port protocol processing module. And if the running state is the idle state, the read manager outputs prompt information of data storage errors.
Optionally, when the read manager reads data, the read manager determines according to the buffer status of the data to be transmitted, which may implement direct forwarding or store forwarding, and may be used in different data exchange scenarios. If the data to be transmitted is received and immediately sent after the storage position of the data in the memory is received, direct forwarding can be realized, and the requirement of smaller forwarding time delay is met. If the data to be transmitted is not sent immediately after the received storage position of the data in the memory, but is sent after the complete data (which can be one frame of data) is stored, the storage and the forwarding can be realized, the error data can be discarded after the judgment according to the data correctness, and the communication stability is improved.
In one embodiment, the method further comprises the steps of:
in step S242, in response to detecting that the data to be transmitted cached in the target storage space is completely sent to the read manager, the operating state of the target storage space is adjusted to an idle state.
Specifically, after the forwarding querier detects that the transmission of the to-be-transmitted data cached in the target storage space is completed, the operating state of the target storage space is adjusted from the occupied state to the idle state.
In this embodiment, after the data to be transmitted in the target storage space is released, the operating state of the target storage space is adjusted in time, so as to facilitate subsequent caching of other data to be transmitted.
It should be understood that although the various steps in the flow charts of fig. 2-4 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 2-4 may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed in turn or alternately with other steps or at least some of the other steps.
In one embodiment, as shown in fig. 5, a data transmission apparatus is provided, where the apparatus is used in a forwarding querier of a switch, the forwarding querier is connected to a memory of the switch, the memory includes a plurality of primary storage areas, and each primary storage area corresponds to at least one input port and all output ports of the switch, the apparatus includes: a port determination module 302, an address determination module 304, and an address transmission module 306, wherein:
a port determination module 302, configured to determine, in response to a data storage request containing data to be transmitted, sent by a write manager of the switch, an identification of an input port corresponding to the write manager.
An address determination module 304, configured to determine an address of a target primary storage area matching the identification of the input port from the plurality of primary storage areas.
The address sending module 306 is configured to send the address of the target first-level storage area to the write manager, so as to instruct the write manager to cache the data to be transmitted in the target first-level storage area according to the address of the target first-level storage area.
In the data transmission device, a plurality of primary storage areas are arranged in the memory of the switch, and each primary storage area corresponds to at least one input port and all output ports of the switch, so that multiple input channels can be grouped and share the plurality of primary storage areas. When the data to be transmitted of the multiple input channels is input, the data to be transmitted stored in different first-level storage areas can be processed in parallel through matching of the identification of the input port and the first-level storage areas, and the data to be transmitted of the same first-level storage area can be accessed in a time-sharing manner, so that the data transmission efficiency is accelerated, and the matching of input and output bandwidths is easily met.
In one embodiment, each primary storage area includes a plurality of secondary storage areas, each secondary storage area corresponds to at least one input port corresponding to the primary storage area to which it belongs, and each secondary storage area corresponds to at least one output port.
The port determining module 302 is further configured to determine an identifier of an output port according to the data to be transmitted in the data storage request.
The address determining module 304 is further configured to determine, from the plurality of secondary storage areas in the target primary storage area, an address of the target secondary storage area that matches the identification of the output port, based on the address of the target primary storage area.
The address sending module 306 is specifically configured to send an address of a target second-level storage area in the target first-level storage area to the write manager, so as to instruct the write manager to cache data to be transmitted in the target second-level storage area according to the address of the target second-level storage area.
In one embodiment, each secondary storage area comprises a plurality of storage spaces corresponding to each output port; the device also includes: a state acquisition module, wherein:
and the state acquisition module is used for acquiring the operating states of a plurality of storage spaces corresponding to the identifiers of the output ports in the target secondary storage area according to the address of the target secondary storage area.
The address sending module 306 is specifically configured to determine, if a storage space in which the operating state is an idle state exists in the multiple storage spaces, the storage space in the idle state in the target secondary storage area as a target storage space, and send an address of the target storage space to the write manager, so as to instruct the write manager to cache the data to be transmitted in the target storage space according to the address of the target storage space.
For specific limitations of the data transmission device, reference may be made to the above limitations of the data transmission method, which are not described herein again. The modules in the data transmission device can be wholly or partially implemented by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as shown in fig. 6. The computer device includes a processor, a memory, a communication interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The communication interface of the computer device is used for carrying out wired or wireless communication with an external terminal, and the wireless communication can be realized through WIFI, an operator network, NFC (near field communication) or other technologies. The computer program is executed by a processor to implement a data transmission method. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on the shell of the computer equipment, an external keyboard, a touch pad or a mouse and the like.
Those skilled in the art will appreciate that the architecture shown in fig. 6 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided, comprising a memory and a processor, the memory having a computer program stored therein, the processor implementing the following steps when executing the computer program:
in response to a data storage request containing data to be transmitted, which is sent by a write manager of the switch, determining an identifier of an input port corresponding to the write manager;
determining the address of a target primary storage area matched with the identification of the input port from a plurality of primary storage areas;
and sending the address of the target first-level storage area to the write manager to indicate the write manager to cache the data to be transmitted to the target first-level storage area according to the address of the target first-level storage area.
In the computer device, a plurality of primary storage areas are arranged in the memory of the switch, and each primary storage area corresponds to at least one input port and all output ports of the switch, so that multiple input channels can be grouped and share the plurality of primary storage areas. When the data to be transmitted of the multiple input channels is input, the data to be transmitted stored in different first-level storage areas can be processed in parallel through matching of the identification of the input port and the first-level storage areas, and the data to be transmitted of the same first-level storage area can be accessed in a time-sharing manner, so that the data transmission efficiency is accelerated, and the matching of input and output bandwidths is easily met.
In one embodiment, the processor, when executing the computer program, further performs the steps of: determining the identifier of an output port according to the data to be transmitted in the data storage request; according to the address of the target primary storage area, determining the address of the target secondary storage area matched with the identifier of the output port from a plurality of secondary storage areas in the target primary storage area; and sending the address of the target secondary storage area in the target primary storage area to the write manager to indicate the write manager to cache the data to be transmitted into the target secondary storage area according to the address of the target secondary storage area.
In one embodiment, the processor, when executing the computer program, further performs the steps of: acquiring the operating states of a plurality of storage spaces corresponding to the identifiers of the output ports in the target secondary storage area according to the address of the target secondary storage area; and if the storage space with the running state being the idle state exists in the plurality of storage spaces, determining the storage space with the idle state in the target secondary storage area as the target storage space, and sending the address of the target storage space to the write manager so as to instruct the write manager to cache the data to be transmitted into the target storage space according to the address of the target storage space.
In one embodiment, the processor, when executing the computer program, further performs the steps of: and adjusting the running state of the target storage space to be an occupied state in response to the detection that part or all of the data to be transmitted is cached in the target storage space.
In one embodiment, the processor, when executing the computer program, further performs the steps of: and sending the identifier of the output port to the write manager to instruct the write manager to send the address of the target storage space to the read manager corresponding to the output port according to the identifier of the output port.
In one embodiment, the processor, when executing the computer program, further performs the steps of: and responding to a data reading request containing the target storage space sent by the reading manager, sending the running state of the target storage space to the reading manager so as to indicate the reading manager to read the data to be transmitted from the target storage space and send the data to an output port corresponding to the identifier of the output port when the running state is the occupied state.
In one embodiment, the processor, when executing the computer program, further performs the steps of: and adjusting the running state of the target storage space to be an idle state after the data to be transmitted cached in the target storage space is sent to the read manager.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of:
in response to a data storage request containing data to be transmitted, which is sent by a write manager of the switch, determining an identifier of an input port corresponding to the write manager;
determining the address of a target primary storage area matched with the identification of the input port from a plurality of primary storage areas;
and sending the address of the target first-level storage area to the write manager to indicate the write manager to cache the data to be transmitted to the target first-level storage area according to the address of the target first-level storage area.
In the computer-readable storage medium, a plurality of primary storage areas are arranged in a memory of the switch, and each primary storage area corresponds to at least one input port and all output ports of the switch, so that multiple input channels can be grouped and share the plurality of primary storage areas. When the data to be transmitted of the multiple input channels is input, the data to be transmitted stored in different first-level storage areas can be processed in parallel through matching of the identification of the input port and the first-level storage areas, and the data to be transmitted of the same first-level storage area can be accessed in a time-sharing manner, so that the data transmission efficiency is accelerated, and the matching of input and output bandwidths is easily met.
In one embodiment, the computer program when executed by the processor further performs the steps of: determining the identifier of an output port according to the data to be transmitted in the data storage request; according to the address of the target primary storage area, determining the address of the target secondary storage area matched with the identifier of the output port from a plurality of secondary storage areas in the target primary storage area; and sending the address of the target secondary storage area in the target primary storage area to the write manager to indicate the write manager to cache the data to be transmitted into the target secondary storage area according to the address of the target secondary storage area.
In one embodiment, the computer program when executed by the processor further performs the steps of: acquiring the operating states of a plurality of storage spaces corresponding to the identifiers of the output ports in the target secondary storage area according to the address of the target secondary storage area; and if the storage space with the running state being the idle state exists in the plurality of storage spaces, determining the storage space with the idle state in the target secondary storage area as the target storage space, and sending the address of the target storage space to the write manager so as to instruct the write manager to cache the data to be transmitted into the target storage space according to the address of the target storage space.
In one embodiment, the computer program when executed by the processor further performs the steps of: and adjusting the running state of the target storage space to be an occupied state in response to the detection that part or all of the data to be transmitted is cached in the target storage space.
In one embodiment, the computer program when executed by the processor further performs the steps of: and sending the identifier of the output port to the write manager to instruct the write manager to send the address of the target storage space to the read manager corresponding to the output port according to the identifier of the output port.
In one embodiment, the computer program when executed by the processor further performs the steps of: and responding to a data reading request containing the target storage space sent by the reading manager, sending the running state of the target storage space to the reading manager so as to indicate the reading manager to read the data to be transmitted from the target storage space and send the data to an output port corresponding to the identifier of the output port when the running state is the occupied state.
In one embodiment, the computer program when executed by the processor further performs the steps of: and adjusting the running state of the target storage space to be an idle state after the data to be transmitted cached in the target storage space is sent to the read manager.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database or other medium used in the embodiments provided herein can include at least one of non-volatile and volatile memory. Non-volatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical storage, or the like. Volatile Memory can include Random Access Memory (RAM) or external cache Memory. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.
Claims (10)
1. A data transmission method is characterized in that the method is applied to a forwarding querier of a switch, the forwarding querier is connected with a memory of the switch, the memory comprises a plurality of primary storage areas, and each primary storage area corresponds to at least one input port and all output ports of the switch; each primary storage area comprises a plurality of secondary storage areas, each secondary storage area corresponds to at least one input port corresponding to the primary storage area, and each secondary storage area corresponds to at least one output port; the method comprises the following steps:
in response to a data storage request containing data to be transmitted, which is sent by a write manager of the switch, determining an identifier of an input port corresponding to the write manager;
determining the address of a target primary storage area matched with the identification of the input port from the plurality of primary storage areas;
determining the identifier of the output port according to the data to be transmitted in the data storage request;
according to the address of the target primary storage area, determining the address of the target secondary storage area matched with the identifier of the output port from a plurality of secondary storage areas in the target primary storage area;
and sending the address of the target secondary storage area in the target primary storage area to the write manager to indicate the write manager to cache the data to be transmitted to the target secondary storage area according to the address of the target secondary storage area.
2. The method of claim 1, wherein each of the secondary storage areas comprises a plurality of storage spaces corresponding to each of the output ports; the method further comprises the following steps:
acquiring the operating states of a plurality of storage spaces corresponding to the identifiers of the output ports in the target secondary storage area according to the address of the target secondary storage area;
the sending the address of the target secondary storage area in the target primary storage area to the write manager to instruct the write manager to cache the data to be transmitted into the target secondary storage area according to the address of the target secondary storage area includes:
if the storage space with the operating state being an idle state exists in the plurality of storage spaces, determining the storage space with the idle state in the target secondary storage area as a target storage space, and sending an address of the target storage space to the write manager so as to instruct the write manager to cache the data to be transmitted into the target storage space according to the address of the target storage space.
3. The method of claim 2, further comprising:
and adjusting the running state of the target storage space to be an occupied state in response to the detection that part or all of the data to be transmitted is cached in the target storage space.
4. The method of claim 2, further comprising:
and sending the identifier of the output port to the write manager to instruct the write manager to send the address of the target storage space to the read manager corresponding to the output port according to the identifier of the output port.
5. The method of claim 4, further comprising:
responding to a data reading request which is sent by the reading manager and contains the target storage space, sending the running state of the target storage space to the reading manager so as to indicate the reading manager to read the data to be transmitted from the target storage space and send the data to an output port corresponding to the identifier of the output port when the running state is an occupied state.
6. The method of claim 5, further comprising:
and adjusting the running state of the target storage space to be an idle state after the data to be transmitted cached in the target storage space is sent to the read manager.
7. A data transmission device is characterized in that the device is used for a forwarding querier of a switch, the forwarding querier is connected with a memory of the switch, the memory comprises a plurality of primary storage areas, and each primary storage area corresponds to at least one input port and all output ports of the switch; each primary storage area comprises a plurality of secondary storage areas, each secondary storage area corresponds to at least one input port corresponding to the primary storage area, and each secondary storage area corresponds to at least one output port; the device comprises:
the port determining module is used for responding to a data storage request containing data to be transmitted and sent by a write manager of the switch, and determining the identifier of an input port corresponding to the write manager;
the address determining module is used for determining the address of a target primary storage area matched with the identification of the input port from the plurality of primary storage areas;
the port determining module is further configured to determine an identifier of the output port according to the data to be transmitted in the data storage request;
the address determining module is further configured to determine, according to the address of the target primary storage area, an address of a target secondary storage area that matches the identifier of the output port from a plurality of secondary storage areas in the target primary storage area;
and the address sending module is used for sending the address of the target secondary storage area in the target primary storage area to the write manager so as to indicate the write manager to cache the data to be transmitted to the target secondary storage area according to the address of the target secondary storage area.
8. The apparatus of claim 7, wherein each of the secondary storage areas comprises a plurality of storage spaces corresponding to each of the output ports; the device further comprises:
a state obtaining module, configured to obtain, according to the address of the target secondary storage area, operating states of multiple storage spaces corresponding to the identifier of the output port in the target secondary storage area;
the address sending module is specifically configured to determine, if a storage space in which the operating state is an idle state exists in the plurality of storage spaces, the storage space in the idle state in the target secondary storage area as a target storage space, and send an address of the target storage space to the write manager, so as to instruct the write manager to cache the data to be transmitted in the target storage space according to the address of the target storage space.
9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the steps of the method of any of claims 1 to 6.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110767500.8A CN113259264B (en) | 2021-07-07 | 2021-07-07 | Data transmission method and device, computer equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110767500.8A CN113259264B (en) | 2021-07-07 | 2021-07-07 | Data transmission method and device, computer equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113259264A CN113259264A (en) | 2021-08-13 |
CN113259264B true CN113259264B (en) | 2021-11-09 |
Family
ID=77191040
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110767500.8A Active CN113259264B (en) | 2021-07-07 | 2021-07-07 | Data transmission method and device, computer equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113259264B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113533941B (en) * | 2021-09-15 | 2022-03-01 | 北京国科天迅科技有限公司 | Chip interface testing method and device, computer equipment and storage medium |
WO2024187353A1 (en) * | 2023-03-13 | 2024-09-19 | 华为技术有限公司 | Routing method, routing information configuration method and electronic device |
CN117097684B (en) * | 2023-10-17 | 2024-02-27 | 苏州元脑智能科技有限公司 | Data transmission method and device, storage medium and electronic equipment |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP5585219B2 (en) * | 2010-06-03 | 2014-09-10 | 富士通株式会社 | Switching device and virtual LAN construction method |
CN101917231B (en) * | 2010-08-27 | 2013-10-09 | 华为技术有限公司 | Data caching method of fibre channel switch |
CN102170401B (en) * | 2011-05-27 | 2014-04-09 | 浙江宇视科技有限公司 | Method and device of data processing |
CN103530066B (en) * | 2013-09-16 | 2016-05-18 | 华为技术有限公司 | A kind of date storage method, Apparatus and system |
CN108509172B (en) * | 2018-04-13 | 2024-05-24 | 北京神州数码云科信息技术有限公司 | Synchronous display data transmission method, device, system and computer storage medium |
CN111343109A (en) * | 2020-02-13 | 2020-06-26 | 苏州浪潮智能科技有限公司 | Data transmission method, device and related equipment |
-
2021
- 2021-07-07 CN CN202110767500.8A patent/CN113259264B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN113259264A (en) | 2021-08-13 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN113259264B (en) | Data transmission method and device, computer equipment and storage medium | |
CN101501660B (en) | Internet connection switch and internet connection system | |
CN110546620B (en) | Data processing method, storage system and switching equipment | |
US11777873B1 (en) | Method and apparatus for managing buffering of data packet of network card, terminal and storage medium | |
CN111190854B (en) | Communication data processing method, device, equipment, system and storage medium | |
CN111431757A (en) | Virtual network flow acquisition method and device | |
CN113014662A (en) | Data processing method and storage system based on NVMe-oF protocol | |
CN115914130B (en) | Data flow processing method and device of intelligent network card | |
CN115470156A (en) | RDMA-based memory use method, system, electronic device and storage medium | |
CN113641604A (en) | Data transmission method and system | |
CN113014510B (en) | Data caching method and device in distributed test of inertial navigation system | |
CN113259273B (en) | Switch control method, switch, computer device, and storage medium | |
CN109445988B (en) | Heterogeneous disaster recovery method, device, system, server and disaster recovery platform | |
CN112817516A (en) | Data read-write control method, device, equipment and storage medium | |
CN113808711B (en) | DICOM file processing method, DICOM file processing device, DICOM file processing computer equipment and DICOM file storage medium | |
CN116016313A (en) | Flow table aging control method, system, equipment and readable storage medium | |
US7990972B2 (en) | Network communication device and a packet routing method | |
US20110270970A1 (en) | Network device testing system and method | |
CN112395245B (en) | Access device and method of processor and computer equipment | |
CN113556331A (en) | TCP sticky package processing method, system and storage medium | |
CN112291212A (en) | Static rule management method and device, electronic equipment and storage medium | |
US6816924B2 (en) | System and method for tracing ATM cells and deriving trigger signals | |
CN111865794A (en) | Correlation method, system and equipment of logical port and data transmission system | |
CN116055455B (en) | MAC address aging processing method and device, LPU card and storage medium | |
CN108304214B (en) | Method and device for verifying integrity of immediate data |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CP03 | Change of name, title or address |
Address after: 701, 7th Floor, Building 6, Courtyard 8, Kegu 1st Street, Beijing Economic and Technological Development Zone, Daxing District, Beijing, 100176 Patentee after: Beijing Tasson Technology Ltd. Address before: Room 701, 7 / F, building 6, courtyard 8, KEGU 1st Street, Beijing Economic and Technological Development Zone, Daxing District, Beijing 100176 Patentee before: BEIJING TASSON TECHNOLOGY Ltd. |
|
CP03 | Change of name, title or address |