Data processing method and device, computer equipment and storage medium
Through the method of using the buffer zone in multi -channel data transmission, the method of storing and optimizing the transmission rules of the transmission rules is used to solve the problem of low transmission efficiency caused by data interwoven and system cards, and realized efficient data transmission.
Patent Information
- Application Number
- CN202411303009.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-18
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2044-09-18
AI Technical Summary
In multi-channel data transmission, data interleaving leads to inefficient transmission and may cause the entire system to get stuck.
By receiving interweaving data returned from the device, the pre -divided buffer is used for group storage, and the data is transmitted to the main device based on the preset priority transmission rules.
It improves the transmission efficiency of interweaving data, avoids the problem of system card caused by data interwoven, and ensures that the data meets the transmission protocol specifications.
Smart Images

Figure CN119363292A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a data processing method, device, computer equipment and storage medium. Background Art
[0002] Devices that transmit commands and data based on the Advanced eXtensible Interface (AXI) protocol may have multi-channel transmission between one master device and multiple slave devices or between multiple master devices and multiple slave devices. In this case, in order to ensure the performance indicators of data transmission, in most cases, multi-channel data is transmitted in parallel. This will cause the problem of multi-channel data arriving at one output port at the same time, that is, data interleaving.
[0003] There is uncertainty about whether the functional modules used in a system are compatible with data interleaving. When a module compatible with data interleaving is connected downstream or upstream to a module incompatible with data interleaving, interleaved data will cause the entire system to freeze. To address this issue, the device and slave device ports usually use the single slave mode, that is, after the master device sends a command, the master device will send the next command to the next slave device after all responses to the command are completed, to avoid data interleaving. However, this method will result in low transmission efficiency of interleaved data, and when a command is executed abnormally, data transmission will fail. Summary of the invention
[0004] In view of this, the present invention provides a data processing method, apparatus, computer device and storage medium to solve the problem of low transmission efficiency of interleaved data and avoid the problem of data interleaving causing the entire system to freeze.
[0005] In a first aspect, the present invention provides a data processing method, which includes: receiving M interleaved data returned by N slave devices, the M interleaved data including M read data and corresponding M data identifiers, each read data and data identifier is generated and fed back by any slave device based on a read command issued by a master device, M≥N>1; obtaining L buffers pre-divided in a storage resource pool, each buffer corresponding to a data identifier, N≤L≤M; according to the M data identifiers, storing the interleaved data belonging to the same data identifier in the buffer corresponding to the same data identifier; based on a preset priority transmission rule, transmitting the interleaved data stored in the L buffers to the master device.
[0006] Based on the method of the first aspect above, based on the M data identifiers contained in the received M interleaved data, the M interleaved data are stored in the buffer corresponding to each data identifier, that is, all the interleaved data belonging to the same data identifier in the M interleaved data are stored in one buffer, so as to realize the group storage of the M interleaved data; after the interleaved data is partially or completely stored in the L buffers, based on the preset priority transmission rule, the interleaved data stored in the L buffers are transmitted to the main device, so that the main device can receive the interleaved data stored in each buffer according to the transmission rule. Furthermore, after receiving the interleaved data with the same data identifier, the main device can transmit the interleaved data with the same data identifier to the upstream module or downstream module of the main device, so that the interleaved data with the same data identifier can be recognized by the upstream module or downstream module, so as to overcome the problem that the upstream module or downstream module cannot transmit the interleaved data when the interleaved data is incompatible, and ensure that the interleaved data complies with the transmission protocol specification, and maximizes the transmission efficiency of the interleaved data, and avoids the problem that the entire system is stuck due to data interleaving.
[0007] In an optional implementation, M interleaved data include the i-th interleaved data, i≤M, and the i-th interleaved data includes the i-th data identifier; the storage resource pool is also pre-divided into L candidate buffers, and the L candidate buffers correspond one-to-one to the L buffers; according to the M data identifiers, the interleaved data belonging to the same data identifier are stored in the buffer corresponding to the same data identifier, including: according to the i-th data identifier included in the i-th interleaved data, the i-th interleaved data is stored in the buffer corresponding to the i-th data identifier, i≤M.
[0008] Among them, according to the i-th data identifier included in the i-th interleaved data, the i-th interleaved data is stored in the buffer corresponding to the i-th data identifier, including: judging whether there is a target candidate buffer in the L candidate buffers, and the target candidate buffer stores the interleaved data including the i-th data identifier.
[0009] If a target candidate buffer exists, the i-th interleaved data is stored in the target candidate buffer, and when the state of the buffer corresponding to the target candidate buffer is not full, the interleaved data stored in the target candidate buffer is stored in the buffer corresponding to the target candidate buffer.
[0010] If there is no target candidate buffer, it is determined whether there is a target buffer in the L buffers, and the target buffer stores interleaved data including the i-th data identifier.
[0011] If the target buffer does not exist, the i-th interleaved data is stored in any empty buffer among the L buffers.
[0012] If the target buffer exists, it is determined whether the target buffer is full.
[0013] If yes, the i-th interleaved data is stored in the candidate buffer corresponding to the target buffer, and when the target buffer is not full, the interleaved data stored in the candidate buffer corresponding to the target buffer is stored in the target buffer.
[0014] If not, the i-th interleaved data is stored in the target buffer.
[0015] Based on the above method, L candidate buffers can be pre-divided to avoid premature stopping of data reception when the buffer is full of interleaved data, thereby increasing the amount of interleaved data that can be handled by the L buffers. After the buffer space is released and is not full, the data in the corresponding candidate buffer is written to the buffer, thereby improving the data transmission efficiency.
[0016] In an optional implementation, when one of the L candidate buffers is in a full state, reception of the interleaved data returned by the N slave devices is stopped.
[0017] Based on the above method, when there is a candidate buffer in the L candidate buffers that is full, it indicates that at the current moment there is a full buffer in the L candidate areas that stores interleaved data that has not been transmitted to the master device and cannot receive new interleaved data. Therefore, the reception of interleaved data returned by N slave devices is stopped to avoid deadlock problems.
[0018] In an optional implementation, each interleaved data also includes a read status bit and a read flag bit, the read status bit is used to indicate whether the read data is successfully read; the read flag bit is used to indicate whether the interleaved data with the same data identifier has been completely stored in the L buffers.
[0019] Based on the above method, it is possible to determine whether the read data is successfully read based on the read status bit, and to determine whether the interleaved data with the same data identifier has been fully stored in L buffers based on the read flag bit, so as to facilitate the subsequent determination of the order of transmitting the interleaved data stored in the L buffers.
[0020] In an optional embodiment, when interleaved data is stored in L buffers, the interleaved data stored in the L buffers are transmitted to the main device based on a preset priority transmission rule, including: when there is one buffer storing interleaved data among the L buffers, based on the preset priority transmission rule, the interleaved data stored in one buffer is transmitted to the main device; or, when there are multiple buffers storing interleaved data among the L buffers, based on the preset priority transmission rule, the interleaved data stored in the buffer storing the first interleaved data corresponding to different data identifiers is transmitted to the main device in the order of the storage time of the first interleaved data corresponding to different data identifiers; when there is no buffer storing the first interleaved data among the multiple buffers, the interleaved data stored in the buffer storing the interleaved data including a target read flag is transmitted to the main device in the order of the storage time of the interleaved data including a target read flag, and the target read flag is used to indicate that the interleaved data with the same data identifier has all been stored in the L buffers.
[0021] Based on the above method, when there is one buffer storing interleaved data among L buffers, the interleaved data stored in one buffer can be transmitted to the main device; or, when there are multiple buffers storing interleaved data among L buffers, the interleaved data stored in the buffer storing the first interleaved data corresponding to different data identifiers is preferentially transmitted to the main device, and then the interleaved data stored in the buffer storing the interleaved data including the target read flag is transmitted to the main device, thereby ensuring that after the interleaved data including one data identifier is transmitted, the interleaved data including the next data identifier is transmitted, so that M interleaved data can be transmitted sequentially.
[0022] In an optional embodiment, a buffer storing interleaved data including a target read flag includes a first buffer and a second buffer, the storage time of the interleaved data storing the target read flag in the first buffer is a first storage time, and the storage time of the interleaved data storing the target read flag in the second buffer is a second storage time, and the interleaved data stored in the buffer storing the interleaved data including the target read flag is transmitted to the main device, including: if the first storage time is earlier than the second storage time, transmitting the interleaved data stored in the first buffer to the main device; when it is detected that the state of the first buffer is empty and the first buffer has sent the interleaved data including the target read flag, transmitting the interleaved data stored in the second buffer to the main device.
[0023] Based on the above method, when the state of the first buffer is empty and the first buffer has sent interleaved data including the target read flag, the interleaved data stored in the second buffer can be transmitted to the main device to ensure that after the transmission of the interleaved data stored in one buffer is completed, the interleaved data stored in the next buffer is transmitted.
[0024] In an optional embodiment, before obtaining L buffers pre-divided in the storage resource pool, the method also includes: obtaining the maximum number of the largest number of interleaved data among the M interleaved data; determining the depth of each buffer based on the maximum number; and determining the number L of buffers pre-divided in the storage resource pool based on the total amount of data and the depth of the M interleaved data.
[0025] Based on the above method, the number of pre-divided buffers can be accurately determined based on the actual demand for interleaved data to be transmitted as needed, thereby avoiding excessive occupation of resources in the storage resource pool.
[0026] In a second aspect, the present invention provides a data processing device, which includes: an acquisition module for receiving M interleaved data returned by N slave devices, each interleaved data including read data and a data identifier returned by each slave device in response to a read command issued by a master device, M≥N>1; an acquisition module for acquiring L buffers pre-divided in a storage resource pool, each buffer corresponding to a data identifier, N≤L≤M; a processing module for storing each interleaved data in a buffer corresponding to the data identifier included in each interleaved data according to the M data identifiers included in the M interleaved data; the processing module is also used to transmit the interleaved data stored in the L buffers to the master device based on a preset priority transmission rule when interleaved data is stored in the L buffers.
[0027] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the data processing method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0028] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the data processing method of the first aspect or any corresponding embodiment thereof.
[0029] In a fifth aspect, the present invention provides a computer program product, comprising computer instructions for causing a computer to execute the data processing method of the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0031] Figure 1 is a topological diagram of a data processing system according to an embodiment of the present invention;
[0032] Figure 2 is a flow chart of a data processing method according to an embodiment of the present invention;
[0033] Figure 3 is a schematic diagram of an ID_Buffer according to an embodiment of the present invention;
[0034] Figure 4 is a schematic diagram of a flow chart of storing the i-th interleaved data in the buffer among the M interleaved data in an embodiment of the present invention;
[0035] Figure 5 is a structural block diagram of a data processing device according to an embodiment of the present invention;
[0036] Figure 6 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0037] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0038] The technical solution provided by the embodiment of the present invention is applied to a scenario in which data is transmitted based on the Advanced Extensible Interface (AXI) protocol. In this scenario, data interleaving transmission may occur when data is transmitted based on the AXI protocol.
[0039] Data interleaving transmission refers to the interleaving of data between multiple data requests to improve the efficiency and throughput of bus communication. This method allows multiple data requests to be processed within one clock cycle and the data to be returned in an interleaved manner, thereby reducing response time and improving performance. Data interleaving transmission is an important mechanism in the AXI protocol, which improves the efficiency and performance of bus communication by processing multiple data requests simultaneously, interleaving returned data, out-of-order execution, and burst transmission. This transmission method helps to optimize data interaction in the system, reduce waiting time, and increase data throughput, thereby improving the overall performance of the system.
[0040] The AXI protocol may be an AXI3 protocol or an AXI4 protocol. The AXI3 protocol and the AXI4 protocol may have read data interleaved transmission, and the AXI3 protocol may also have write data interleaved transmission.
[0041] Read data interleaving transmission is one of the implementation forms of out-of-order read data output. In burst mode, multiple slave ports of the read data device return data at the same time. The continuous read data on the master port of the master device does not come from the same slave port. The read identifier can be used to distinguish the slave port to which each interleaved data belongs.
[0042] During the interleaved transmission of write data, write data with different identifiers can be transmitted interleaved, but the order of write data with the same identifier needs to be preserved.
[0043] Based on the current data interleaving transmission process, when the single slave mode is used for interleaving data transmission, the transmission efficiency of the interleaved data is low, and when a certain command is executed abnormally, the data transmission fails.
[0044] In order to solve the above technical problems, an embodiment of the present invention provides a data processing method, which stores each interleaved data in a buffer corresponding to the data identifier included in each interleaved data, and groups and sorts the data, so as to solve the low transmission efficiency of the interleaved data and avoid the problem of the entire system being stuck due to data interleaving.
[0045] Below Figure 1 The method provided by the embodiment of the present invention is described by taking the data processing system 10 as an example. Figure 1 It is only a schematic diagram and does not constitute a limitation on the applicable scenarios of the technical solution provided in this application.
[0046] like Figure 1 As shown, Figure 1 is a topological diagram of a data processing system according to an embodiment of the present invention. Figure 1 In the embodiment, the data processing system 10 may include a data processing apparatus 101 , a master device 102 , a first slave device 103 , a second slave device 104 , and a storage resource pool 105 .
[0047] The data processing device 101 may be any device having a communication function and managing a storage resource pool, for example, the data processing device may be a storage controller.
[0048] The master device 102 may be any device having communication and computing functions. The master device 102 is used to send a read command to the first slave device 103 or the second slave device 104 , and receive read data returned by the data processing apparatus 101 .
[0049] The first slave device 103 or the second slave device 104 may be any device having communication function and computing function. The first slave device 103 or the second slave device 104 is used to return the read data to the storage resource pool 105 .
[0050] The storage resource pool 105 may be any device with storage function, for example, a physical storage device such as a hard disk.
[0051] Figure 1 The data processing system 10 shown is only used as an example and is not used to limit the technical solution of the present application. Those skilled in the art should understand that in the specific implementation process, the data processing system 10 may also include other master devices or slave devices, and the number of master devices and slave devices may also be determined according to specific needs without limitation.
[0052] According to an embodiment of the present invention, a data processing method embodiment is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0053] In this embodiment, a data processing method is provided, which can be used in the above-mentioned data processing device 101. Figure 2 is a flow chart of a data processing method according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps:
[0054] S201: Receive M pieces of interleaved data returned by N slave devices.
[0055] Among them, M interleaved data include M read data and corresponding M data identifiers, each read data and data identifier is generated and fed back by any slave device based on the read command issued by the master device, M≥N>1. Each interleaved data includes a read data and a data identifier. Furthermore, each interleaved data also includes a read status bit and a read flag bit.
[0056] In one example, before S201, the method further includes: the master device sends a read command to at least one slave device. Each slave device receives the read command, generates interleaved data, and sends the interleaved data to the data processing apparatus.
[0057] The read command is an AXI protocol command, and the read command is used to read data from at least one slave device.
[0058] The read data may be rdata data in the R channel of the AXI protocol.
[0059] The data identifier is used to identify each interleaved data. The data identifier may be the rid identifier in the R channel of the AXI protocol.
[0060] The read status bit is used to indicate whether the master device successfully reads the data in the slave device. The read status bit can be the rresp signal bit in the R channel of the AXI protocol.
[0061] The read flag bit is used to indicate whether the interleaved data of the same data identifier has been stored in all L buffers. The read flag bit may be the rlast signal bit in the R channel of the AXI protocol.
[0062] S202: Acquire L buffers pre-divided in the storage resource pool.
[0063] Each buffer corresponds to a data identifier, N≤L≤M. The buffer can also be called ID_Buffer.
[0064] In the embodiment of the present invention, the storage resource pool is pre-divided into L candidate buffers, and the L candidate buffers correspond one-to-one to the L buffers. The candidate buffer may also be referred to as Reserved_Buffer.
[0065] In some optional embodiments, before obtaining L buffers pre-divided in the storage resource pool, the data processing device obtains the maximum number of the largest number of interleaved data among the M interleaved data; determines the depth of each buffer based on the maximum number; and determines the number L of buffers pre-divided in the storage resource pool based on the total amount of data and the depth of the M interleaved data.
[0066] It can be understood that the amount of interleaved data that can be stored in the buffer is greater than the amount of each interleaved data.
[0067] Optionally, the number of buffers does not necessarily need to be consistent with the maximum value of the data identifier, and the data processing device may also adjust the number of buffers according to the usage frequency of the data identifier.
[0068] S203: According to the M data identifiers, the interleaved data belonging to the same data identifier is stored in the buffer corresponding to the same data identifier.
[0069] In some optional embodiments, before storing each interleaved data in a buffer corresponding to the data identifier included in each interleaved data, the data processing device combines the rdata data, rid identifier, rlast signal bit, and rresp signal bit in the R channel into a multi-bit data, and names the multi-bit data port_m_data.
[0070] Among them, the bit width of port_m_data = rdata bit width + rid bit width + rlast bit width + rresp bit width. For example, Figure 3 As shown, Figure 3 It is a schematic diagram of an ID_Buffer according to an embodiment of the present invention; the ID_Buffer includes a plurality of buffer groups inside, and each buffer group can store port_m_data.
[0071] like Figure 4 As shown, Figure 4 FIG. 1 is a flow chart of storing the i-th interleaved data in the buffer among M interleaved data in an embodiment of the present invention, where i≤M. Figure 4 In the embodiment, the data processing device stores the i-th interleaved data in a buffer corresponding to the i-th data identifier according to the i-th data identifier included in the i-th interleaved data, and the data processing device performs the following steps:
[0072] S401: Determine whether there is a target candidate buffer zone among the L candidate buffer zones.
[0073] S402: if there is a target candidate buffer, storing the i-th interleaved data into the target candidate buffer, and when the state of the buffer corresponding to the target candidate buffer is not full, storing the interleaved data stored in the target candidate buffer into the buffer corresponding to the target candidate buffer;
[0074] S403: If there is no target candidate buffer, determine whether there is a target buffer in the L buffers;
[0075] S404: if the target buffer does not exist, storing the i-th interleaved data into any empty buffer among the L buffers;
[0076] S405: If the target buffer exists, determine whether the target buffer is full;
[0077] S406: If yes, then store the i-th interleaved data into the candidate buffer corresponding to the target buffer, and when the target buffer is not full, store the interleaved data stored in the candidate buffer corresponding to the target buffer into the target buffer;
[0078] S407: If not, storing the i-th interleaved data into the target buffer.
[0079] The target candidate buffer stores interleaved data including the i-th data identifier.
[0080] In the embodiment of the present invention, the target buffer stores interleaved data including the i-th data identifier.
[0081] In the embodiment of the present invention, the data processing device can monitor the state of the current buffer or candidate buffer at each clock cycle (clk). The state can be a full state or an empty state. The full state is a full state, and the empty state is an empty state.
[0082] Optionally, when a candidate buffer among the L candidate buffers is in a full state, the data processing apparatus stops receiving interleaved data returned from the N slave devices.
[0083] The data processing device stops receiving the interleaved data returned by the N slave devices, and may prohibit returning the read interleaved data by requiring the RREADY signal to be pulled low.
[0084] S204: Based on a preset priority transmission rule, transmit the interleaved data stored in the L buffers to the master device.
[0085] Among them, the preset priority transmission rule can be set according to actual needs.
[0086] In some optional implementations, when there is one buffer among the L buffers storing interleaved data, the data processing apparatus transmits the interleaved data stored in the one buffer to the master device based on a preset priority transmission rule.
[0087] In some optional embodiments, when there are multiple buffers among L buffers storing interleaved data, based on a preset priority transmission rule, the interleaved data stored in the buffers storing the first interleaved data corresponding to different data identifiers are transmitted to the main device in the order of the storage time of the first interleaved data corresponding to different data identifiers; when there is no buffer storing the first interleaved data among the multiple buffers, the interleaved data stored in the buffers storing the interleaved data including a target read flag are transmitted to the main device in the order of the storage time of the interleaved data including a target read flag, and the target read flag is used to indicate that the interleaved data with the same data identifier has all been stored in the L buffers.
[0088] In an example, taking a buffer storing interleaved data including a target read flag as comprising a first buffer and a second buffer, the storage time of the interleaved data storing the target read flag in the first buffer as a first storage time, and the storage time of the interleaved data storing the target read flag in the second buffer as a second storage time, the data processing device can transmit the interleaved data stored in the first buffer to the main device; when it is detected that the state of the first buffer is empty and the first buffer has sent the interleaved data including the target read flag, the interleaved data stored in the second buffer is transmitted to the main device.
[0089] Specifically, when the data processing device stores interleaved data into the ID_Buffer, the data processing device sets the IDNUM state machine. When it is detected that no interleaved data is stored in the L ID_Buffers, the IDNUM state machine is turned on to the IDLE state. When it is detected that the L ID_Buffers start to store interleaved data, the IDNUM state machine is used to point the pointer to the ID_Buffer storing the interleaved data.
[0090] It can be understood that the ID_Buffer pointed to by the pointer is the buffer for transmitting interleaved data at the current moment.
[0091] For example, when there is one buffer among the L buffers storing interleaved data, the data processing apparatus makes the pointer point to the ID_Buffer through the IDNUM state machine, and transmits the interleaved data stored in the ID_Buffer to the host device.
[0092] In one example, the data processing device may further set a special register to record the order of arrival of the interleaved data including the target read flag in the L buffers, and write the data identifiers of the interleaved data including the target read flag into the register in sequence.
[0093] Among them, the same data identifier is allowed to be written continuously in the register, as shown in the following table, in which "2" is the identifier of the first interleaved data including the target read flag in the L buffers, "1" is the identifier of the second interleaved data including the target read flag in the L buffers, the first "3" is the identifier of the third interleaved data including the target read flag in the L buffers, and the second "3" is the identifier of the fourth interleaved data including the target read flag in the L buffers.
[0094]
[0095] It is understandable that the pointer switching only occurs when the data with the target read flag is read, and no switching is performed at other times to avoid data interleaving when a set of complete data is not transmitted and the next data with a different data flag is transmitted. When the data processing device detects that the interleaved data enters the buffer, if the state of the previous buffer pointed to by the pointer is already empty, and data with the target read flag has been sent and is in a state of waiting for switching, and the states of other buffers are all empty, the pointer switches to the current buffer to start transmitting data.
[0096] Based on the above methods S201 to S204, the data processing device can receive M interleaved data returned by N slave devices, obtain L buffers pre-divided in the storage resource pool, and store each interleaved data in the buffer corresponding to the data identifier included in each interleaved data according to the M data identifiers included in the M interleaved data. When interleaved data is stored in the L buffers, the interleaved data stored in the L buffers is transmitted to the master device based on a preset priority transmission rule.
[0097] Since each interleaved data in the M interleaved data can be stored in the buffer corresponding to the data identifier included in each interleaved data according to M data identifiers, that is, the interleaved data with the same data identifier in the M interleaved data are stored in one buffer, and the M interleaved data are grouped; at the same time, based on the preset priority transmission rule, the interleaved data stored in the L buffers are transmitted to the main device, that is, the M interleaved data are sorted and then transmitted to the main device. Therefore, the M interleaved data read by the main device can be recognized by the module that is incompatible with the interleaved data, and the interleaved data is guaranteed to comply with the protocol specification, so as to maximize the optimal transmission efficiency of the interleaved data and avoid the problem of the entire system being stuck due to data interleaving.
[0098] In the present embodiment, a data processing device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceived.
[0099] This embodiment provides a data processing device, such as Figure 5 As shown, Figure 5 1 is a structural block diagram of a data processing device according to an embodiment of the present invention; the device comprises:
[0100] The acquisition module 501 is used to receive M interleaved data returned by N slave devices, where the M interleaved data include M read data and corresponding M data identifiers. Each read data and data identifier is generated and fed back by any slave device based on the read command issued by the master device, and M≥N>1.
[0101] The acquisition module 501 is used to acquire L buffers pre-divided in the storage resource pool, each buffer corresponds to a data identifier, and N≤L≤M.
[0102] The processing module 502 is used to store the interleaved data belonging to the same data identifier in a buffer corresponding to the same data identifier according to the M data identifiers.
[0103] The processing module 502 is further configured to transmit the interleaved data stored in the L buffers to the master device based on a preset priority transmission rule.
[0104] In some optional implementations, the M interleaved data include the i-th interleaved data, i≤M, and the i-th interleaved data include the i-th data identifier; the storage resource pool is also pre-divided into L candidate buffers, and the L candidate buffers correspond one-to-one to the L buffers; the processing module 502 is specifically used to store the i-th interleaved data in the buffer corresponding to the i-th data identifier according to the i-th data identifier included in the i-th interleaved data, i≤M.
[0105] The processing module 502 is further specifically configured to store the i-th interleaved data in a buffer corresponding to the i-th data identifier according to the i-th data identifier included in the i-th interleaved data, including:
[0106] The processing module 502 is further specifically configured to determine whether there is a target candidate buffer in the L candidate buffers, and the target candidate buffer stores interleaved data including the i-th data identifier.
[0107] The processing module 502 is further specifically configured to store the i-th interleaved data into the target candidate buffer if there is a target candidate buffer, and store the interleaved data stored in the target candidate buffer into the buffer corresponding to the target candidate buffer when the buffer corresponding to the target candidate buffer is not full.
[0108] The processing module 502 is further specifically configured to determine whether there is a target buffer in the L buffers if there is no target candidate buffer, and the target buffer stores interleaved data including the i-th data identifier;
[0109] The processing module 502 is further specifically configured to store the i-th interleaved data into any empty buffer among the L buffers if the target buffer does not exist.
[0110] The processing module 502 is further specifically configured to determine whether the target buffer is full if the target buffer exists.
[0111] The processing module 502 is further specifically configured to store the i-th interleaved data into a candidate buffer corresponding to the target buffer, and when the target buffer is not full, store the interleaved data stored in the candidate buffer corresponding to the target buffer into the target buffer.
[0112] The processing module 502 is further specifically configured to store the i-th interleaved data into a target buffer if no.
[0113] In some optional implementations, the processing module 502 is further configured to stop receiving the interleaved data returned by the N slave devices when a candidate buffer among the L candidate buffers is in a full state.
[0114] In some optional implementations, each interleaved data also includes a read status bit and a read flag bit, the read status bit is used to indicate whether the read data is read successfully; the read flag bit is used to indicate whether the interleaved data with the same data identifier has been completely stored in the L buffers.
[0115] In some optional implementations, the processing module 502 is further specifically configured to transmit the interleaved data stored in a buffer to the master device based on a preset priority transmission rule when there is one buffer among the L buffers storing interleaved data.
[0116] Alternatively, the processing module 502 is also specifically used to transmit the interleaved data stored in the buffers storing the first interleaved data corresponding to different data identifiers to the main device based on a preset priority transmission rule and in the order of storage time of the first interleaved data corresponding to different data identifiers when there are multiple buffers storing interleaved data among the L buffers.
[0117] The processing module 502 is also specifically used to transmit the interleaved data stored in the buffer storing the interleaved data including the target read flag to the main device in accordance with the storage time sequence of the interleaved data including the target read flag when there is no buffer storing the first interleaved data in the multiple buffers, and the target read flag is used to indicate that the interleaved data with the same data identifier have all been stored in L buffers.
[0118] In some optional embodiments, the buffer storing interleaved data including a target read flag includes a first buffer and a second buffer, the storage time of the interleaved data storing the target read flag in the first buffer is a first storage time, and the storage time of the interleaved data storing the target read flag in the second buffer is a second storage time; the processing module 502 is also specifically used to transmit the interleaved data stored in the first buffer to the main device if the first storage time is earlier than the second storage time; the processing module 502 is also specifically used to transmit the interleaved data stored in the second buffer to the main device when it is detected that the state of the first buffer is empty and the first buffer has sent the interleaved data including the target read flag.
[0119] In some optional embodiments, before obtaining L buffers pre-divided in the storage resource pool, the acquisition module 501 is also used to obtain the maximum number of the largest number of interleaved data among the M interleaved data; the processing module 502 is also used to determine the depth of each buffer based on the maximum number; the processing module 502 is also used to determine the number L of buffers pre-divided in the storage resource pool based on the total amount of data and the depth of the M interleaved data.
[0120] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0121] The data processing device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0122] The embodiment of the present invention also provides a computer device having the above Figure 5 The data processing device shown.
[0123] See also Figure 6 , Figure 6 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 6As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 6 A processor 10 is taken as an example.
[0124] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0125] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.
[0126] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0127] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0128] The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.
[0129] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0130] Part of the present application may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present application through the operation of the computer. Those skilled in the art should understand that the existence of computer program instructions in computer-readable media includes but is not limited to source files, executable files, installation package files, etc., and accordingly, the way in which computer program instructions are executed by a computer includes but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to the computer.
[0131] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A data processing method, characterized in that: The method comprises: Receive M interleaved data returned by N slave devices, where the M interleaved data include M read data and corresponding M data identifiers, each of the read data and the data identifier is generated and fed back by any slave device based on a read command issued by a master device, and M≥N>1; Obtain L buffers pre-divided in the storage resource pool, each of the buffers corresponds to a data identifier, N≤L<M; According to the M data identifiers, storing the interleaved data belonging to the same data identifier in the buffer corresponding to the same data identifier; Based on a preset priority transmission rule, the interleaved data stored in the L buffers are transmitted to the master device.
2. The method according to claim 1, characterized in that The M interleaved data include an i-th interleaved data, i≤M, and the i-th interleaved data include an i-th data identifier; the storage resource pool also includes L candidate buffers, and the L candidate buffers correspond to the L buffers one by one; According to the M data identifiers, storing the interleaved data belonging to the same data identifier in the buffer corresponding to the same data identifier includes: According to the i-th data identifier, storing the i-th interleaved data in a buffer corresponding to the i-th data identifier, i≤M; According to the i-th data identifier, storing the i-th interleaved data in a buffer corresponding to the i-th data identifier includes: Determine whether there is a target candidate buffer in the L candidate buffers, the target candidate buffer storing interleaved data including the i-th data identifier; If the target candidate buffer exists, the i-th interleaved data is stored in the target candidate buffer, and when the state of the buffer corresponding to the target candidate buffer is not full, the interleaved data stored in the target candidate buffer is stored in the buffer corresponding to the target candidate buffer; If the target candidate buffer does not exist, determining whether there is a target buffer in the L buffers, the target buffer storing interleaved data including the i-th data identifier; If the target buffer does not exist, storing the i-th interleaved data into any empty buffer among the L buffers; If the target buffer exists, determining whether the target buffer is full; If yes, the i-th interleaved data is stored in the candidate buffer corresponding to the target buffer, and when the target buffer is not full, the interleaved data stored in the candidate buffer corresponding to the target buffer is stored in the target buffer; If not, the i-th interleaved data is stored in the target buffer.
3. The method according to claim 2, characterized in that The method further comprises: When a candidate buffer among the L candidate buffers is in a full state, reception of the interleaved data returned by the N slave devices is stopped.
4. The method according to claim 3, characterized in that Each interleaved data also includes a read status bit and a read flag bit, wherein the read status bit is used to indicate whether the read data is read successfully; and the read flag bit is used to indicate whether the interleaved data with the same data identifier has been completely stored in the L buffers.
5. The method according to claim 1, characterized in that In the case where interleaved data is stored in the L buffers, transmitting the interleaved data stored in the L buffers to the master device based on a preset priority transmission rule includes: In a case where one of the L buffers stores interleaved data, transmitting the interleaved data stored in the one buffer to the master device based on the preset priority transmission rule; Alternatively, in the case where there are multiple buffers storing interleaved data among the L buffers, based on the preset priority transmission rule, the interleaved data stored in the buffers storing the first interleaved data corresponding to the different data identifiers are transmitted to the master device in the order of the storage time of the first interleaved data corresponding to the different data identifiers; In the case that there is no buffer storing the first interleaved data in the multiple buffers, the interleaved data stored in the buffer storing the interleaved data including the target read flag is transmitted to the master device in the order of the storage time of the interleaved data including the target read flag, and the target read flag is used to indicate that the interleaved data with the same data identifier has all been stored in the L buffers.
6. The method according to claim 5, characterized in that The buffer storing the interleaved data including the target read flag bit includes a first buffer and a second buffer, the storage time of the interleaved data storing the target read flag bit in the first buffer is a first storage time, and the storage time of the interleaved data storing the target read flag bit in the second buffer is a second storage time; The transmitting the interleaved data stored in the buffer storing the interleaved data including the target read flag bit to the master device comprises: If the first storage time is earlier than the second storage time, transmitting the interleaved data stored in the first buffer to the master device; When it is detected that the state of the first buffer is empty and the first buffer has sent interleaved data including the target read flag, the interleaved data stored in the second buffer is transmitted to the master device.
7. The method according to claim 1, characterized in that Before acquiring the L buffers pre-divided in the storage resource pool, the method further includes: Obtaining the maximum number of the largest interleaved data among the M interleaved data; Determining the depth of each buffer zone according to the maximum number; The number L of buffer zones pre-divided in the storage resource pool is determined according to the total amount of the M interleaved data and the depth.
8. A data processing device, characterized in that: The device comprises: An acquisition module is used to receive M interleaved data returned by N slave devices, where the M interleaved data include M read data and corresponding M data identifiers, each of the read data and the data identifier is generated and fed back by any slave device based on a read command issued by a master device, and M≥N>1; The acquisition module is used to acquire L buffers pre-divided in the storage resource pool, each of the buffers corresponds to a data identifier, N≤L≤M; A processing module, configured to store, according to the M data identifiers, interleaved data belonging to the same data identifier in a buffer corresponding to the same data identifier; The processing module is further configured to transmit the interleaved data stored in the L buffers to the master device based on a preset priority transmission rule.
9. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the data processing method according to any one of claims 1 to 7 by executing the computer instructions.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the data processing method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Data processing method and device
CN102377516A
Data caching device and control method, data processing chip, data processing system
CN108496161A
Data processing method, device and equipment based on memory access engine
CN116974463A
Interleaved data processing method and device, storage medium and electronic device
CN118074853A
Sending and receiving method of non-conformation mode protocol data unit in radio link layer
CN1913530A