Data frame transmission method, apparatus, computer equipment and storage medium
By using a delayed queue to process response frames during data frame transmission between the SAS controller and SAS devices, the problem of disordered data frame processing order caused by response frame buffering is solved, thus ensuring the integrity of data frame transmission.
Patent Information
- Application Number
- CN202211207624.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-30
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2042-09-30
AI Technical Summary
During data frame transmission between the SAS controller and the SAS device, the buffering of response frames in the transmission channel causes some data frames to be processed out of order, resulting in data frame transmission failure.
By polling each transmission channel, data frames are processed and response frames are added to a delay queue. Response frames are processed only after all data frames have been processed, and the delay queue ensures that data frames come first and response frames come last.
This ensures that no data frames are lost during data frame transmission, implements the processing order of data frames and response frames, and avoids data frame loss during transmission.
Smart Images

Figure CN115695326B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of storage technology, and in particular to a data frame transmission method, apparatus, computer equipment, storage medium, and computer program product. Background Technology
[0002] A SAS (Serial Attached SCSI, Small Computer System Interface) controller is a device that connects a server to SAS devices (SAS devices include SAS disks or SAS extenders). The function of the SAS controller is to control the execution of SAS commands.
[0003] During the execution of SAS commands, multiple frame-based interactions are required between the SAS controller and the SAS device. Specifically, based on the SAS transmission protocol requirements, the SAS controller sends a command frame to the SAS device. In response to the command encapsulated in the command frame, the SAS device first encapsulates the corresponding data into multiple data frames and sends them to the SAS controller. After all data frames have been sent, the SAS device then sends a response frame to the SAS controller to inform it of the result of the command's completion.
[0004] However, since the SAS controller contains multiple transmission channels, if the acknowledgment frame is buffered in the earliest transmission channel, the SAS controller will retrieve the acknowledgment frame first, causing some data frames to be processed after the acknowledgment frame. In effect, if the SAS controller processes the acknowledgment frame first, it will directly terminate the data frame transmission process, and data in subsequent unretrieved data frames will be lost, resulting in data frame transmission failure. Therefore, to ensure the processing order between data frames and acknowledgment frames, a method for order-preserving data frame transmission between the SAS controller and the SAS device is urgently needed. Summary of the Invention
[0005] Therefore, it is necessary to provide a data frame transmission method, apparatus, computer equipment, computer-readable storage medium, and computer program product to address the aforementioned technical problems.
[0006] Firstly, this application provides a data frame transmission method. The method includes:
[0007] The controller polls each transmission channel between itself and the SAS serial connection device, and processes the data frames in each transmission channel found during the polling process to obtain the target data.
[0008] If an acknowledgment frame exists in the transmission channel, the acknowledgment frame is added to a preset delay queue.
[0009] After all the transmission channels have been polled in this round, the response frames in the delay queue are processed to indicate the end of the data frame transmission task corresponding to the response frame.
[0010] This method uses a delay queue to buffer response frames in the transmission channel. During the polling of the transmission channel, all data frames in each transmission channel are processed before the response frames are processed, ensuring that the data frames come first and the response frames come last, thus avoiding data frame loss during data transmission.
[0011] In one embodiment, polling each transmission channel between the controller and the SAS serial connection device, and processing the data frames in each transmission channel during the polling process to obtain target data, includes:
[0012] According to the preset query order of each of the transmission channels, the receive frame buffer in each transmission channel of the controller and the SAS serial connection device is queried in sequence;
[0013] When the receive frame buffer of the transmission channel contains a data frame, the data frame in the receive frame buffer of the transmission channel is processed to obtain the target data.
[0014] In this embodiment, data frames in all transmission channels are processed based on a preset polling mechanism to obtain target data. This ensures that response frames are processed only after all data frames in all transmission channels have been processed, thus guaranteeing the processing order between data frames and response frames.
[0015] In one embodiment, adding the response frame to a preset delay queue includes:
[0016] According to the preset response frame extraction strategy, extract multiple target fields from the response frame;
[0017] Based on the multiple target fields, construct the command word structure;
[0018] The command word structure is stored in a preset delay queue.
[0019] In this embodiment, by extracting the target field from the response frame, a command word structure is constructed, and the command word structure is stored in the delay queue instead of the response frame. This retains the function of the response frame while reducing the consumption of storage resources in the delay queue.
[0020] In one embodiment, processing the acknowledgment frame in the delay queue to indicate the end of the data frame transmission task corresponding to the acknowledgment frame includes:
[0021] Obtain the response frame from the delay queue; the response frame carries a command number;
[0022] Based on the command number, the response frame is matched with the data frame to determine the data frame transmission task corresponding to the response frame;
[0023] The response frame is parsed, and based on the response information parsed from the response frame, the data frame transmission task is terminated.
[0024] In this embodiment, by processing the response frames in the delay queue, the data frame transmission task corresponding to the response frame is terminated, thus achieving complete data transmission.
[0025] In one embodiment, before polling each transmission channel between the controller and the SAS serial connection device, the method further includes:
[0026] Send a command frame to the SAS device, the command frame encapsulating a command for the target task;
[0027] The system receives multiple SAS frames sent by the SAS device in response to the command frame, and stores the multiple SAS frames into the receive frame buffer of multiple transmission channels according to a preset load strategy.
[0028] Secondly, this application also provides a data frame transmission apparatus. The apparatus is applied to a controller and includes:
[0029] The polling module is used to poll each transmission channel between the controller and the SAS serial connection device, and to process the data frames in each transmission channel found during the polling process to obtain the target data.
[0030] The first processing module is used to add the response frame to a preset delay queue if there is a response frame in the transmission channel.
[0031] The second processing module is used to process the response frames in the delay queue after all the transmission channels have been polled in this round, and to indicate the end of the data frame transmission task corresponding to the response frame.
[0032] By using this device, a delay queue is set up to buffer the response frames in the transmission channel. During the polling of the transmission channel, the response frames are processed only after all data frames in each transmission channel have been processed. This ensures that the data frames are processed first and the response frames are processed later, thus avoiding the loss of data frames during the transmission process.
[0033] Thirdly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to perform the following steps:
[0034] The controller polls each transmission channel between itself and the SAS serial connection device, and processes the data frames in each transmission channel found during the polling process to obtain the target data.
[0035] If an acknowledgment frame exists in the transmission channel, the acknowledgment frame is added to a preset delay queue.
[0036] After all the transmission channels have been polled in this round, the response frames in the delay queue are processed to indicate the end of the data frame transmission task corresponding to the response frame.
[0037] By setting up a delay queue, the response frames existing in the transmission channel are buffered in the delay queue. During the polling of the transmission channel, after all the data frames in each transmission channel have been processed, the response frames are processed, ensuring that the order of data frames first and response frames last, and avoiding data frame loss during data frame transmission.
[0038] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, performs the following steps:
[0039] The controller polls each transmission channel between itself and the SAS serial connection device, and processes the data frames in each transmission channel found during the polling process to obtain the target data.
[0040] If an acknowledgment frame exists in the transmission channel, the acknowledgment frame is added to a preset delay queue.
[0041] After all the transmission channels have been polled in this round, the response frames in the delay queue are processed to indicate the end of the data frame transmission task corresponding to the response frame.
[0042] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, performs the following steps:
[0043] The controller polls each transmission channel between itself and the SAS serial connection device, and processes the data frames in each transmission channel found during the polling process to obtain the target data.
[0044] If an acknowledgment frame exists in the transmission channel, the acknowledgment frame is added to a preset delay queue.
[0045] After all the transmission channels have been polled in this round, the response frames in the delay queue are processed to indicate the end of the data frame transmission task corresponding to the response frame.
[0046] The aforementioned data frame transmission method, apparatus, computer equipment, storage medium, and computer program product poll each transmission channel, process the data frames in each transmission channel during the polling process to obtain the target data; if an acknowledgment frame exists in the transmission channel, the acknowledgment frame is added to a preset delay queue; after polling all the transmission channels, the acknowledgment frames in the delay queue are processed to indicate the end of the data frame transmission task corresponding to the acknowledgment frame. By setting up a delay queue, acknowledgment frames existing in the transmission channels are cached in the delay queue. During the polling process of the transmission channels, all data frames in each transmission channel are processed before the acknowledgment frames are processed, ensuring the order of data frames first and acknowledgment frames last, and avoiding data frame loss during data frame transmission. Attached Figure Description
[0047] Figure 1 This is an application environment diagram of a data frame transmission method in one embodiment;
[0048] Figure 2 This is a flowchart illustrating a data frame transmission method in one embodiment;
[0049] Figure 3 This is a flowchart illustrating the data frame processing steps in one embodiment;
[0050] Figure 4 This is a flowchart illustrating the step of placing a response frame into a delay queue in one embodiment;
[0051] Figure 5 This is a schematic diagram of the structure of a response frame in one embodiment;
[0052] Figure 6 This is a flowchart illustrating the processing steps of a response frame in one embodiment;
[0053] Figure 7 This is a flowchart illustrating the step of triggering data frame transmission in one embodiment;
[0054] Figure 8 This is a flowchart illustrating an example of a data frame transmission method in one embodiment;
[0055] Figure 9 This is a structural block diagram of a data frame transmission device in one embodiment;
[0056] Figure 10This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0057] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0058] The data frame transmission method provided in this application embodiment can be applied to, for example... Figure 1 In the application environment shown, specifically Figure 1 In the application environment, the controller 102 can be a basic module of an HBA (Host Bus Adapter) or RAID (Redundant Array of Independent Disks) chip, which are integrated on the server motherboard. Therefore, the controller in the server communicates with the SAS (Serial Connected Small Computer System Interface) device (SAS device) 104 through multiple transmission channels. Specifically, in response to a command frame sent by the controller 102, the SAS device 104 sends a data frame to the controller 102. This data frame is sequentially buffered into multiple transmission channels between the controller 102 and the SAS device 104 according to the sending order. The controller 102 polls each transmission channel, processing the data frames found in each channel during the polling process to obtain the target data carried in the data frame. If an acknowledgment frame exists in the transmission channel, the controller 102 adds the acknowledgment frame to a preset delay queue. After polling all transmission channels is completed, all acknowledgment frames buffered in the delay queue are processed, and the information in the obtained acknowledgment frames indicates the end of the data frame transmission task corresponding to the acknowledgment frame. In this embodiment, the controller 102 may be, but is not limited to, a SAS controller, which is a controller that transmits message frames with the SAS device via the SAS protocol. The SAS device 104 may be, but is not limited to, a SAS disk device or a SAS extender; this embodiment does not impose any limitations on this.
[0059] In one embodiment, such as Figure 2 As shown, a data frame transmission method is provided, which is applied to... Figure 1 The following steps are used as an example of a controller (e.g., a SAS controller):
[0060] Step 202: Poll the transmission channels between the controller and the SAS serial connection small computer system interface device, process the data frames in each transmission channel during the polling process, and obtain the target data.
[0061] In implementation, multiple transmission channels exist between the controller and the SAS serial connection minicomputer system interface device (referred to as the SAS device). These transmission channels are the physical connections between the controller and the SAS device, and they are composed of multiple pairs of differential signal lines capable of transmitting and receiving signals. Each transmission channel can be considered as one pair of differential signal lines, enabling the transmission and reception of one data stream. When the controller needs to transmit data with the SAS device, it sends a data request command frame to the SAS device. The SAS device responds to this command frame by sending a data frame to the controller. This data frame carries the target data. Then, the multiple transmission channels connected to the SAS device in the controller sequentially receive and buffer the data frames. The controller then completes the transmission of the data frame by polling the data frames in each of the multiple transmission channels. Therefore, the controller polls multiple transmission channels, processing the data frames in each channel during the polling process to obtain the target data from the data frames.
[0062] Step 204: If an acknowledgment frame exists in the transmission channel, add the acknowledgment frame to the preset delay queue.
[0063] In practice, if a response frame is found in the current transmission channel during the polling process, in order to ensure that the receiving order of the frames in the data frame transmission task corresponding to the response frame is: data frame first, response frame last, the controller first caches the found response frame in a preset delay queue.
[0064] Step 206: After all transmission channels have been polled in this round, the response frames in the delay queue are processed to indicate the end of the data frame transmission task corresponding to the response frame.
[0065] In implementation, after polling all transmission channels, the controller processes the acknowledgment frames in the delay queue and, based on the acknowledgment information contained in the acknowledgment frame, controls the termination of the data frame transmission task corresponding to that acknowledgment frame. Specifically, since the data frame is sent first and the acknowledgment frame is sent last, the reason for the disordered reception order of data frames and acknowledgment frames is only due to the difference between the polling order of multiple transmission channels and the data frame reception order. Therefore, when all transmission channels have been polled, it indicates that there are no unprocessed data frames in the multiple transmission channels. Thus, processing the acknowledgment frames will ensure that the polling order of the acknowledgment frames is after the data frames, thereby resolving the problem of out-of-order acknowledgment frames and data frames.
[0066] In the above data frame transmission method, each transmission channel between the controller and the SAS serial connection device is polled. Data frames in each transmission channel polled during the polling process are processed to obtain the target data. If an acknowledgment frame exists in the transmission channel, it is added to a preset delay queue. After polling all transmission channels is completed, the acknowledgment frames in the delay queue are processed to indicate the end of the data frame transmission task corresponding to the acknowledgment frame. This method, by setting a delay queue to buffer acknowledgment frames in the transmission channels, ensures that the data frames are processed before the acknowledgment frames during transmission, thus preventing data frame loss during transmission. This is achieved by processing all data frames in each transmission channel before processing the acknowledgment frames during polling.
[0067] In one embodiment, such as Figure 3 As shown, the specific processing steps of step 102 include:
[0068] Step 302: According to the preset query order of each transmission channel, query the receive frame buffer in each transmission channel of the controller and SAS device in turn.
[0069] In implementation, multiple transmission channels have a preset query order. For example, for N transmission channels numbered from 0 to N-1, the preset query order can be based on the transmission channel numbers in ascending order (0 to N-1), sequentially querying each channel. Furthermore, each transmission channel has a preset receive frame buffer used to buffer received data frames or response frames. Thus, the controller, according to the preset query order for each transmission channel, sequentially queries the receive frame buffers in both the controller and the SAS device's transmission channels.
[0070] Step 304: When the receive frame buffer of the transmission channel contains a data frame, process the data frame in the receive frame buffer of the transmission channel to obtain the target data.
[0071] In implementation, when the receive frame buffer of a transmission channel contains data frames, the controller acquires the data frames, parses them, and obtains the target data encapsulated within them. For example, when querying transmission channel N-2, its receive frame buffer contains only data frames. The controller reads the data frames from this receive frame buffer, parses them to obtain the target data, and then continues querying the receive frame buffer of the next transmission channel.
[0072] In this embodiment, data frames in all transmission channels are processed based on a preset polling mechanism to obtain target data. This ensures that response frames are processed only after all data frames in all transmission channels have been processed, thus guaranteeing the processing order between data frames and response frames.
[0073] In one embodiment, to save storage space in the delay queue, when storing the response frame in the delay queue, the response frame can be processed to generate a command word structure corresponding to the response frame. Then, only the command word structure is stored in the delay queue. Specifically, as follows: Figure 4 As shown, the specific processing steps of step 104 include:
[0074] Step 402: Extract multiple target fields from the response frame according to the preset response frame extraction strategy.
[0075] In implementation, based on the structure defined by the preset transmission protocol, the response frame consists of multiple key and non-key fields. The controller extracts multiple target fields, i.e., key fields, from the response frame structure according to the preset response frame extraction strategy. Specifically, taking a response frame under the SAS protocol as an example, such as... Figure 5 As shown, Figure 5 This diagram illustrates the extraction of key fields from a response frame. The target fields included in the SAS response frame are: Status (status code), responseCode (response code), and dataPres (data appearance code).
[0076] Step 404: Construct the command word structure based on multiple target fields and the command number carried in the response frame.
[0077] In implementation, the controller constructs a command word structure (also called a command word) based on the extracted target fields and in a preset concatenation order. The number carried in the response frame (also called the command number) is then added to the command word structure as its header. This number is used to characterize the correspondence between the response frame and the data frame transmission task.
[0078] Step 406: Store the command word structure in a preset delay queue.
[0079] In practice, the controller stores the generated command word structure in a preset delay queue until the current transmission channel polling ends, and then processes the command word structure of the response frame in the delay queue.
[0080] In this embodiment, the delay queue serves to cache the command word structure of the response frame to ensure asynchronous delayed processing of the response frame. Therefore, it is sufficient to ensure that the object stored in the delay queue is a cacheable data structure that facilitates data retrieval. Thus, complex data structures and access algorithms are not required. Optionally, the command word structure corresponding to the response frame can be a software-based array, stack, linked list, or other structure, or it can be implemented using a dedicated hardware memory. This embodiment does not impose any limitations.
[0081] In this embodiment, by extracting the target field from the response frame, a command word structure is constructed, and the command word structure is stored in the delay queue instead of the response frame. This retains the function of the response frame while reducing the consumption of storage resources in the delay queue.
[0082] In one embodiment, after processing data frames from multiple transmission channels is complete, the acknowledgment frames or command word structures in the delay queue are then processed. Specifically, for example... Figure 6 As shown, the specific processing procedure of step 106 includes the following steps:
[0083] Step 602: Obtain the response frame in the delay queue.
[0084] The response frame carries the command number.
[0085] In implementation, when polling multiple transmission channels, since the data frame transmission tasks between the controller and the SAS device can be processed concurrently, the delay queue may already contain multiple response frames. Each response frame carries a command number to identify a data transmission task. The controller retrieves the response frames from the delay queue to process them.
[0086] Optionally, if the delay queue contains command word structures of response frames, the controller retrieves the command word structures from the delay queue.
[0087] Step 604: Match the response frame with the data frame according to the command number to determine the data frame transmission task corresponding to the response frame.
[0088] In implementation, when the SAS device sends data frames to the controller, it also adds a number to each data frame. However, since the controller and the SAS device are connected by a wire, the controller cannot directly determine whether the data frame has been completely received based on the number carried in the data frame. It can only passively receive data frames and then confirm the completion of the data frame transmission task through the acknowledgment frame. Therefore, for each data frame transmission task, both the data frame and the acknowledgment frame carry the same type of command number to identify the corresponding data frame transmission task. Based on the command number carried in the acknowledgment frame, the controller matches the acknowledgment frames with the data frames obtained by polling multiple transmission channels, that is, it identifies data frames and acknowledgment frames with the same type of command number as the same data frame transmission task.
[0089] Step 606: Parse the response frame and, based on the response information parsed from the response frame, control the termination of the data frame transmission task.
[0090] In practice, the controller parses the response frame and, based on the response information parsed from the response frame, controls the termination of the data frame transmission task.
[0091] In this embodiment, by asynchronously parsing the response frames in the delay queue, the processing order between data frames and response frames is guaranteed. Then, based on the response information parsed from the response frame, the data frame transmission task corresponding to the response frame is terminated.
[0092] In one embodiment, before the SAS device sends a data frame to the controller, the controller needs to initiate a data request to trigger the data frame transmission process. Specifically, as follows: Figure 7 As shown, prior to step 102, the data frame transmission method further includes:
[0093] Step 702: Send a command frame to the SAS device.
[0094] The command frame encapsulates commands specific to the target task.
[0095] In implementation, the controller sends a command frame to the SAS device. This command frame encapsulates the command instructions for the target task. Through these command instructions, the SAS device can be controlled to send a data frame containing the target data of the target task to the controller.
[0096] Step 704: Receive multiple SAS frames sent by the SAS device in response to the command frame, and store the multiple SAS frames into the receive frame buffer of multiple transmission channels according to a preset load strategy.
[0097] In implementation, the controller receives multiple SAS frames sent by the SAS device in response to a command frame. Each SAS frame contains a data frame and an acknowledgment frame. Then, according to a preset load balancing strategy, the controller sequentially stores the multiple SAS frames into the receive buffers of multiple transmission channels.
[0098] In this embodiment, the controller sends SAS frames to the SAS device. The SAS frames contain data frames and response frames, triggering the data frame transmission process between the controller and the SAS device. The controller receives the transmitted SAS frames through the transmission channel and then combines a delay queue to realize the asynchronous processing of the SAS frames.
[0099] In one embodiment, such as Figure 8 As shown, a specific example of data frame transmission is provided, which includes the following steps:
[0100] Step 801: Poll the receive frame buffer of each SAS transmission channel in the controller port in turn.
[0101] Step 802: If the received data frame is found in the transmission channel, the controller directly processes the received data frame.
[0102] Step 803: If the received data in the queried transmission channel is a response frame, the controller extracts the key fields from the response frame, constructs the command word structure, and writes the command word structure into the delay queue.
[0103] Step 804: If all transmission channels have been polled, then all command word structures are retrieved from the delay queue in sequence. The controller processes the response frame according to the information in the command word structure and ends the data frame transmission task corresponding to the response frame.
[0104] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0105] Based on the same inventive concept, this application also provides a data frame transmission apparatus for implementing the data frame transmission method described above. The solution provided by this apparatus is similar to the implementation described in the above method; therefore, the specific limitations in one or more data frame transmission apparatus embodiments provided below can be found in the limitations of the data frame transmission method described above, and will not be repeated here.
[0106] In one embodiment, such as Figure 9 As shown, a data frame transmission device 900 is provided, including: a polling module 910, a first processing module 920, and a second processing module 930, wherein:
[0107] The polling module 910 is used to poll each transmission channel between the controller and the SAS serial connection device, and to process the data frame in each transmission channel queried during the polling process to obtain the target data.
[0108] The first processing module 920 is used to add the response frame to a preset delay queue if there is a response frame in the transmission channel.
[0109] The second processing module 930 is used to process the response frames in the delay queue after all the transmission channels have been polled in this round, and to indicate the end of the data frame transmission task corresponding to the response frame.
[0110] In one embodiment, the polling module 910 is specifically used to sequentially query the receive frame buffer in each transmission channel of the controller and the SAS serial connection device according to the preset query order of each transmission channel;
[0111] When the receive frame buffer of the transmission channel contains a data frame, the data frame in the receive frame buffer of the transmission channel is processed to obtain the target data.
[0112] In one embodiment, the first processing module 920 is used to extract multiple target fields from the response frame according to a preset response frame extraction strategy;
[0113] Based on the multiple target fields, construct the command word structure;
[0114] The command word structure is stored in a preset delay queue.
[0115] In one embodiment, the second processing module 930 is specifically used to obtain the response frame in the delay queue; the response frame carries a command number;
[0116] Based on the command number, the response frame is matched with the data frame to determine the data frame transmission task corresponding to the response frame;
[0117] The response frame is parsed, and based on the response information parsed from the response frame, the data frame transmission task is terminated.
[0118] In one embodiment, the device 900 further includes:
[0119] The sending module is used to send command frames to the SAS device, wherein the command frames encapsulate commands for the target task;
[0120] The receiving module is used to receive multiple SAS frames sent by the SAS device in response to the command frame, and store the multiple SAS frames into the receive buffer of multiple transmission channels according to a preset load strategy.
[0121] Each module in the aforementioned data frame transmission device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.
[0122] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 10 As shown, the computer device includes a processor, memory, and a network interface connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The network interface is used to communicate with external terminals via a network connection. When the computer program is executed by the processor, it implements a data frame transmission method.
[0123] Those skilled in the art will understand that Figure 10 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0124] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:
[0125] The controller polls each transmission channel between itself and the SAS serial connection small computer system interface device, and processes the data frames in each transmission channel found during the polling process to obtain the target data.
[0126] If an acknowledgment frame exists in the transmission channel, the acknowledgment frame is added to a preset delay queue.
[0127] After all the transmission channels have been polled in this round, the response frames in the delay queue are processed to indicate the end of the data frame transmission task corresponding to the response frame.
[0128] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0129] According to the preset query order of each of the transmission channels, the receive frame buffer in each transmission channel of the controller and the SAS serial connection device is queried in sequence;
[0130] When the receive frame buffer of the transmission channel contains a data frame, the data frame in the receive frame buffer of the transmission channel is processed to obtain the target data.
[0131] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0132] According to the preset response frame extraction strategy, extract multiple target fields from the response frame;
[0133] Based on the multiple target fields, construct the command word structure;
[0134] The command word structure is stored in a preset delay queue.
[0135] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0136] Obtain the response frame from the delay queue; the response frame carries a command number;
[0137] Based on the command number, the response frame is matched with the data frame to determine the data frame transmission task corresponding to the response frame;
[0138] The response frame is parsed, and based on the response information parsed from the response frame, the data frame transmission task is terminated.
[0139] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0140] Send a command frame to the SAS device, the command frame encapsulating a command for the target task;
[0141] The system receives multiple SAS frames sent by the SAS device in response to the command frame, and stores the multiple SAS frames into the receive frame buffer of multiple transmission channels according to a preset load strategy.
[0142] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.
[0143] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.
[0144] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. 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). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0145] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0146] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A data frame transmission method, characterized in that, The method is applied to a controller, and the method includes: The controller polls each transmission channel between itself and the SAS serial connection small computer system interface device, and processes the data frames in each transmission channel found during the polling process to obtain the target data. If an acknowledgment frame exists in the transmission channel, the acknowledgment frame is added to a preset delay queue. After all the transmission channels have been polled in this round, the response frames in the delay queue are processed to indicate the end of the data frame transmission task corresponding to the response frame. The step of processing the acknowledgment frames in the delay queue and instructing the termination of the data frame transmission task corresponding to the acknowledgment frame includes: Obtain the response frame from the delay queue; the response frame carries a command number; Based on the command number, the response frame is matched with the data frame to determine the data frame transmission task corresponding to the response frame; The response frame is parsed, and based on the response information parsed from the response frame, the data frame transmission task is terminated.
2. The method according to claim 1, characterized in that, The process involves polling each transmission channel between the controller and the SAS serial connection minicomputer system interface device, processing the data frames in each transmission channel during the polling process to obtain the target data, including: According to the preset query order of each of the transmission channels, the receive frame buffer in each transmission channel of the controller and the SAS serial connection device is queried in sequence; When the receive frame buffer of the transmission channel contains a data frame, the data frame in the receive frame buffer of the transmission channel is processed to obtain the target data.
3. The method according to claim 1, characterized in that, Adding the response frame to a preset delay queue includes: According to the preset response frame extraction strategy, extract multiple target fields from the response frame; Based on the multiple target fields, construct the command word structure; The command word structure is stored in a preset delay queue.
4. The method according to claim 1, characterized in that, Before polling each transmission channel between the controller and the SAS serial connection device, the method further includes: Send a command frame to the SAS device, the command frame encapsulating a command for the target task; The system receives multiple SAS frames sent by the SAS device in response to the command frame, and stores the multiple SAS frames into the receive frame buffer of multiple transmission channels according to a preset load strategy.
5. A data frame transmission apparatus, characterized in that, The device is used in a controller, and the device includes: The polling module is used to poll each transmission channel between the controller and the SAS serial connection device, and to process the data frames in each transmission channel found during the polling process to obtain the target data. The first processing module is used to add the response frame to a preset delay queue if there is a response frame in the transmission channel. The second processing module is used to process the response frames in the delay queue after all the transmission channels have been polled in this round, and to indicate the end of the data frame transmission task corresponding to the response frame. The second processing module is specifically used to obtain the response frame in the delay queue; the response frame carries a command number; Based on the command number, the response frame is matched with the data frame to determine the data frame transmission task corresponding to the response frame; The response frame is parsed, and based on the response information parsed from the response frame, the data frame transmission task is terminated.
6. The apparatus according to claim 5, characterized in that, The first processing module is specifically used to extract multiple target fields from the response frame according to a preset response frame extraction strategy; Based on the multiple target fields, construct the command word structure; The command word structure is stored in a preset delay queue.
7. The apparatus according to claim 5, characterized in that, The polling module is specifically used to sequentially query the receive frame buffer in each transmission channel of the controller and the SAS serial connection device according to the preset query order of each transmission channel; When the receive frame buffer of the transmission channel contains a data frame, the data frame in the receive frame buffer of the transmission channel is processed to obtain the target data.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 4.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 4.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 4.
Citation Information
Patent Citations
FPGA-based SRIO multi-channel control method, device and system
CN114900588A