Data transmission method and apparatus based on secure digital input / output interface
By padding the data packets of the SDIO interface to make their length an integer multiple of the standard data block, and adopting a data block transmission method, the problem of low transmission rate of the SDIO interface is solved, and more efficient data transmission is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-07
- Publication Date
- 2026-04-03
AI Technical Summary
When reading and writing data between the SDIO interface and external devices, the transmission rate needs to be improved. In the existing technology, when the data packet length is not an integer multiple of the data block length, data block transmission plus byte transmission is required, which leads to a reduction in bus transmission rate.
By padding the data packets to be transmitted to make their length an integer multiple of the SDIO standard data block, and transmitting the data blocks on the SDIO bus, the addition of byte transmission to the data block transmission is avoided.
The transmission rate of the SDIO bus has been improved, the data read and write process between the SDIO interface and external devices has been optimized, ensuring that data packets are processed in a single transmission operation, thus improving overall transmission efficiency.
Smart Images

Figure CN116319629B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data communication technology, and in particular to a data transmission method and apparatus based on a secure digital input / output interface. Background Technology
[0002] The Secure Digital Input and Output (SDIO) protocol evolved from the Secure Digital Memory Card (SD card) protocol. It retains the SD card's read / write protocol while defining a peripheral interface, the SDIO interface, for connecting external devices such as modems, barcode scanners, location receivers, cameras, and wireless network communication cards (such as WiFi cards). Compared to the SD card, which only supports data storage, the SDIO interface overcomes this limitation, enabling read / write operations with external devices.
[0003] Currently, the SDIO interface's transmission rate needs improvement when reading and writing data with external devices. Summary of the Invention
[0004] In view of this, this application provides a data transmission method and apparatus based on a secure digital input / output interface, which optimizes the process of reading and writing data between the SDIO interface and external devices, ensures that the processing of a data packet is completed in one transmission operation on the SDIO bus, improves the SDIO bus transmission rate, and helps to improve the overall transmission efficiency of the SDIO interface.
[0005] This application mainly provides the following technical solutions:
[0006] The first aspect of this application provides a data transmission method based on a secure digital input / output interface, the method comprising:
[0007] The first SDIO device performs padding on the data packet to be transmitted to obtain a padded data packet, wherein the length of the padded data packet is an integer multiple of the length of the SDIO standard data block;
[0008] The first SDIO device sends the padded data packet to the second SDIO device.
[0009] In some modified embodiments of the first aspect of this application, the length of the SDIO standard data block is 512 bytes.
[0010] In some modified embodiments of the first aspect of this application, the first SDIO device performs padding processing on the data packet to be transmitted to obtain a padded data packet, including:
[0011] Get the length of the SDIO standard data block transmitted based on the SDIO protocol;
[0012] Obtain the length of the data packet to be transmitted;
[0013] Determine whether the length of the data packet to be transmitted is an integer multiple of the length of the SDIO standard data block;
[0014] If not, the data packet to be transmitted is padded until it reaches an integer multiple of the length of the SDIO standard data block.
[0015] In some modified embodiments of the first aspect of this application, the padding process for the data packet to be transmitted until it reaches an integer multiple of the length of the SDIO standard data block includes:
[0016] Configure the first ADMA module corresponding to the data packet to be transmitted, wherein the first ADMA module stores the address and length of the data packet to be transmitted;
[0017] Configure the second ADMA module corresponding to the data packet to be transmitted. The second ADMA module is used to store the number of bytes to be padded.
[0018] The second ADMA module is filled based on the minimum length difference between the length of the data packet to be transmitted and an integer multiple of the length of the SDIO standard data block;
[0019] The data packet to be transmitted is padded according to the data information stored in the first ADMA module and the second ADMA module respectively, so as to obtain the padded data packet.
[0020] In some modified embodiments of the first aspect of this application, the step of performing padding processing on the data packet to be transmitted based on the data information stored in the first ADMA module and the second ADMA module respectively, to obtain a padded data packet, includes:
[0021] Based on the address of the data packet to be transmitted stored in the first ADMA module, obtain the first byte information corresponding to the data packet to be transmitted;
[0022] Based on the number of bytes to be filled stored in the second ADMA module, the second byte information corresponding to the number of bytes to be filled is obtained by filling placeholder characters.
[0023] The second byte information is filled after the first byte information and packaged into a data packet to obtain the data packet corresponding to the data packet to be transmitted after filling.
[0024] In some modified embodiments of the first aspect of this application, before the first SDIO device performs padding processing on the data packet to be transmitted, the method further includes:
[0025] Obtain the data packet to be transmitted and cache it in the transmission queue;
[0026] Determine whether the number of data packets in the queue to be transmitted is greater than a preset threshold;
[0027] If so, then the data packets that are buffered by multiple adjacent packets and enter the transmission queue are aggregated in the transmission queue to obtain the aggregated data packets;
[0028] Based on the aggregated data packets, the data packets to be transmitted in the transmission queue are re-determined.
[0029] In some modified embodiments of the first aspect of this application, the step of aggregating multiple adjacent buffered data packets entering the transmission queue to obtain aggregated data packets includes:
[0030] The data packets in the queue to be transmitted are aggregated into a single aggregated data packet; or,
[0031] According to the order in which the data packets enter the queue to be transmitted, each data packet is traversed and adjacent data packets are aggregated based on a preset number to obtain multiple aggregated data packets.
[0032] A second aspect of this application provides a data transmission device based on a secure digital input / output interface, the device comprising:
[0033] A padding processing unit is used by the first SDIO device to pad the data packet to be transmitted to obtain a padded data packet, wherein the length of the padded data packet is an integer multiple of the length of the SDIO standard data block;
[0034] The sending unit is used for the first SDIO device to send the padded data packet to the second SDIO device.
[0035] In some modified embodiments of the second aspect of this application, the length of the SDIO standard data block is 512 bytes.
[0036] In some modified embodiments of the second aspect of this application, the filling processing unit includes:
[0037] The acquisition module is used to obtain the length of SDIO standard data blocks transmitted based on the SDIO protocol;
[0038] The acquisition module is also used to acquire the length of the data packet to be transmitted;
[0039] The judgment module is used to determine whether the length of the data packet to be transmitted is an integer multiple of the length of the SDIO standard data block;
[0040] The padding module is used to pad the data packet to be transmitted when it is determined that the length of the data packet to be transmitted is an integer multiple of the length of the SDIO standard data block, until the length of the data packet to be transmitted is an integer multiple of the length of the SDIO standard data block.
[0041] In some modified embodiments of the second aspect of this application, the filling processing module includes:
[0042] A configuration submodule is used to configure the first ADMA module corresponding to the data packet to be transmitted. The first ADMA module stores the address and length of the data packet to be transmitted.
[0043] The configuration submodule is also used to configure the second ADMA module corresponding to the data packet to be transmitted, and the second ADMA module is used to store the number of bytes to be padded.
[0044] A filling submodule is used to fill the second ADMA module according to the minimum length difference between the length of the data packet to be transmitted and an integer multiple of the length of the SDIO standard data block;
[0045] The processing submodule is used to perform padding processing on the data packet to be transmitted according to the data information stored in the first ADMA module and the second ADMA module respectively, so as to obtain the padded data packet.
[0046] In some modified embodiments of the second aspect of this application, the processing submodule is further specifically used for:
[0047] Based on the address of the data packet to be transmitted stored in the first ADMA module, obtain the first byte information corresponding to the data packet to be transmitted;
[0048] Based on the number of bytes to be filled stored in the second ADMA module, the second byte information corresponding to the number of bytes to be filled is obtained by filling placeholder characters.
[0049] The second byte information is filled after the first byte information and packaged into a data packet to obtain the data packet corresponding to the data packet to be transmitted after filling.
[0050] In some modified embodiments of the second aspect of this application, the apparatus further includes:
[0051] The acquisition unit is used to acquire the data packet to be transmitted and cache it into the transmission queue before the first SDIO device performs filling processing on the data packet to be transmitted;
[0052] The judgment unit is used to determine whether the number of data packets in the queue to be transmitted is greater than a preset threshold.
[0053] An aggregation processing unit is used to aggregate multiple adjacent buffered data packets that enter the queue to be transmitted when the number of data packets in the queue to be transmitted is greater than a preset threshold, so as to obtain aggregated data packets.
[0054] The determining unit is used to redetermine the data packets to be transmitted in the transmission queue based on the aggregated data packets.
[0055] In some modified embodiments of the second aspect of this application, the aggregation processing unit is further specifically used for:
[0056] The data packets in the queue to be transmitted are aggregated into a single aggregated data packet; or,
[0057] According to the order in which the data packets enter the queue to be transmitted, each data packet is traversed and adjacent data packets are aggregated based on a preset number to obtain multiple aggregated data packets.
[0058] A third aspect of this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the data transmission method based on a secure digital input / output interface as described above.
[0059] A fourth aspect of this application provides an electronic device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the data transmission method based on a secure digital input / output interface as described above.
[0060] By employing the above-described technical solution, the technical solution provided in this application has at least the following advantages:
[0061] This application provides a data transmission method and apparatus based on a secure digital input / output interface (SDIO). During the process of reading and writing data between an SDIO interface and an external device, this application can acquire data packets from and send data packets to the external device. In both cases, the SDIO bus is used to process the data packet transmission. Accordingly, for the data packet to be transmitted, this application first padded it to an integer multiple of the SDIO standard data block length before transmission. This ensures that the data packet transmission operation can be completed in a single transmission on the SDIO bus using a data block transmission method, effectively avoiding the need for both data block and byte transmission. Compared to existing technologies, this solves the technical problem of reduced SDIO bus transmission rate caused by using both data block and byte transmission methods, optimizes the data reading and writing process between the SDIO interface and external devices, ensures that the processing of a data packet is completed in a single transmission operation on the SDIO bus, improves the SDIO bus transmission rate, and helps to improve the overall transmission efficiency of the SDIO interface.
[0062] The above description is merely an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, specific embodiments of this application are given below. Attached Figure Description
[0063] Figure 1 A schematic diagram of a data transmission system based on a secure digital input / output interface provided in an embodiment of this application;
[0064] Figure 2 A flowchart illustrating a data transmission method based on a secure digital input / output interface, provided for embodiments of this application;
[0065] Figure 3 A flowchart illustrating another data transmission method based on a secure digital input / output interface provided in this application embodiment;
[0066] Figure 4 The experimental data illustrating the comparison between SDIO transmission loopback test rate and the length of a single transmitted data packet is provided in the embodiments of this application.
[0067] Figure 5 This is a schematic diagram illustrating an ADMA chain consisting of N ADMA modules, as exemplified in an embodiment of this application.
[0068] Figure 6 A block diagram illustrating the composition of a data transmission device based on a secure digital input / output interface, provided in an embodiment of this application;
[0069] Figure 7A block diagram of another data transmission device based on a secure digital input / output interface provided in this application embodiment. Detailed Implementation
[0070] Exemplary embodiments of this application will now be described in more detail with reference to the accompanying drawings.
[0071] The methods and apparatus provided in this application embodiment can be applied to, for example... Figure 1 The data transmission system shown is based on a secure digital input / output interface. For example... Figure 1 As shown, the system includes: a Secure Digital Input and Output (SDIO) interface, an SDIO master device, and an SDIO slave device. The SDIO master device is the terminal device that initiates read or write operations to external devices, and the corresponding external devices are SDIO slave devices.
[0072] When using the SDIO interface to read and write data with external devices, the SDIO interface's transmission efficiency is affected by the size of the data stored in the data packet to be transmitted. For example, when the size of the data to be transmitted by the SDIO interface is larger than a data block, but the data size is not an integer multiple of the data block length, at least one data block transmission operation and one byte transmission operation need to be performed on the SDIO bus to transmit the entire data. Thus, the SDIO bus transmission rate is low, meaning the SDIO interface's transmission efficiency is low.
[0073] Based on this, embodiments of this application provide a data transmission method based on a secure digital input / output interface, such as... Figure 2 As shown, the method provided in this application embodiment may include the following steps:
[0074] 101. The first SDIO device performs padding on the data packet to be transmitted to obtain a padded data packet, wherein the length of the padded data packet is an integer multiple of the length of the SDIO standard data block.
[0075] According to the SDIO protocol, based on the fact that the data packet to be transmitted contains bytes and / or data blocks, the SDIO interface will use three transmission methods: byte transmission, data block transmission, and data block transmission plus byte transmission.
[0076] Among these methods, block-based data transmission offers a higher transmission rate on the SDIO bus compared to byte-based transmission. With block-based transmission, data packets can be processed in a single transmission operation on the SDIO bus, a feat unattainable by combining block-based and byte-based transmission. Therefore, in this embodiment, transmitting each data packet in block format and completing the outward transmission in a single operation represents a superior approach to improving the transmission rate on the SDIO bus.
[0077] Therefore, if you want to process data packets using the data block transmission method, the length of the data packet to be transmitted must be an integer multiple of the length of the SDIO standard data block. The length of the SDIO standard data block specified by the SDIO protocol is usually 512 bytes.
[0078] Accordingly, in order to ensure that each data packet to be transmitted can be transmitted using the data block transmission method, the embodiments of this application first perform padding processing on the data packets to be transmitted to achieve an integer multiple of the length of the SDIO standard data block, and then use the SDIO bus to send the data packets.
[0079] Therefore, in this embodiment of the application, by padding the data packets to be transmitted, each data packet after padding can be transmitted using the data block transmission method, which effectively avoids the need for data block transmission plus byte transmission. For example, the explanation is as follows:
[0080] Example 1: If the data packet to be transmitted is 510 bytes, based on the SDIO protocol, it will be sent outwards via byte transmission on the SDIO bus. This embodiment of the application uses an optimized processing method: padding the data packet to an integer multiple of 512 bytes, so that the padded data packet is sent outwards via data block transmission. It should be noted that, considering that padding also incurs processing costs, the preferred implementation is to padded the data packet to a length of 512 bytes.
[0081] Example 2: If the data packet to be transmitted is 513 bytes, based on the SDIO protocol, the data packet will be divided into two parts: a 512-byte data block plus one byte. Therefore, on the SDIO bus, one data block transfer operation and one byte transfer operation are required to complete the transmission of this 513-byte data. This embodiment of the application uses an optimized processing method: padding the data packet to an integer multiple of 512 bytes, so that the padded data packet is transmitted outward in a data block transmission mode. It should be noted that considering that padding also incurs processing costs, the preferred implementation is to padded the data packet to a length of 1024 bytes.
[0082] 102. The first SDIO device sends a padded data packet to the second SDIO device.
[0083] In the embodiments of this application, such as Figure 1 As shown, based on the SDIO interface, it is possible to implement SDIO master device reading data from SDIO slave device, that is, SDIO slave device sending data packets to SDIO master device; it is also possible to implement SDIO master device writing data to SDIO slave device, that is, SDIO master device sending data packets to SDIO slave device.
[0084] Thus, in different application scenarios of reading and writing data, data packet transmission operations are required. Therefore, the "first SDIO device" mentioned in the embodiments of this application can be an SDIO master device or an SDIO slave device. Specifically, if the "first SDIO device" is an SDIO master device, then the "second SDIO device" is an SDIO slave device; otherwise, the "second SDIO device" is an SDIO master device.
[0085] Accordingly, in this embodiment of the application, the data transmission method is optimized by filling the data packets to be transmitted, which is applicable to bidirectional data packet transmission operations between SDIO master devices and SDIO slave devices.
[0086] This application provides a data transmission method based on a secure digital input / output interface (SDIO). During the reading and writing of data between the SDIO interface and external devices, this application can acquire data packets from and send data packets to external devices. In both cases, the SDIO bus is used to process the data packet transmission. Accordingly, for the data packet to be transmitted, this application first padded it to an integer multiple of the SDIO standard data block length before transmission. This ensures that data packet transmission can be completed in a single transmission on the SDIO bus using a data block transmission method, effectively avoiding the need for both data block and byte transmission. Compared to existing technologies, this solves the technical problem of reduced SDIO bus transmission rate caused by using both data block and byte transmission methods, optimizes the reading and writing process between the SDIO interface and external devices, ensures that a data packet is processed in a single transmission on the SDIO bus, improves the SDIO bus transmission rate, and helps to improve the overall transmission efficiency of the SDIO interface.
[0087] Furthermore, to provide a more detailed explanation, embodiments of this application also offer another data transmission method based on a Secure Digital Input / Output Interface, such as... Figure 3 As shown, the following specific steps are provided in this embodiment of the application:
[0088] 201. Obtain the data packet to be transmitted and cache it in the transmission queue.
[0089] This application implements a queue for buffering and managing multiple data packets to be transmitted. The queue is set up according to the first-in-first-out principle of data packets, thereby ensuring that data packets that are buffered and enter the queue first can be sent out first.
[0090] 202. Determine whether the number of data packets in the queue to be transmitted is greater than the preset threshold.
[0091] This application uses a preset threshold to determine whether too many data packets have been backed up in the transmission queue. That is, if it is determined that the number of data packets in the transmission queue is greater than the preset threshold, it is further determined that these data packets should be sent as soon as possible to free up space to cache the data packets to be transmitted that will be acquired soon.
[0092] 203a. If it is determined that the number of data packets in the queue to be transmitted is greater than a preset threshold, then the data packets that have entered the queue from multiple adjacent buffers are aggregated to obtain the aggregated data packets.
[0093] 203b. If it is determined that the number of data packets in the queue to be transmitted is not greater than the preset threshold, then it is not necessary to perform aggregation processing on the data packets to be transmitted in the queue.
[0094] In the embodiments of this application, such as Figure 4 The experimental data shown, “Comparison between SDIO transmission loopback test rate and the length of a single transmitted data packet,” indicates that the longer the length of a single transmitted data packet, that is, the larger the amount of data contained in a single data packet transmitted by the SDIO interface, the higher the SDIO bus transmission rate.
[0095] Accordingly, embodiments of this application can aggregate data packets in the transmission queue to obtain one or more data packets containing a larger amount of data, and then use the SDIO bus to send out such data packets, thereby improving the transmission rate on the SDIO bus and also achieving the goal of sending out the data packets in the transmission queue as soon as possible.
[0096] Specifically, embodiments of this application can provide the following method for aggregating data packets:
[0097] Example 1: One method is to aggregate the data packets in the queue to be transmitted into a single aggregated data packet. Specifically, but not limited to, the following implementation methods can be used:
[0098] This application embodiment employs upgraded Direct Memory Access (DMA), also known as Advanced DMA (ADMA), to configure the data information within the data packets to be transmitted to obtain corresponding ADMA modules. These ADMA modules contain the address and length of the data packets. Based on this, ADMA configuration processing is performed on each of the N data packets to be transmitted in the transmission queue, resulting in N ADMA modules and thus an ADMA chain. Figure 5 As shown, an ADMA chain consists of ADMA(1)-(N), where, taking ADMA(1) as an example, buf1 represents the address of data packet 1 and len1 represents the length of data packet 1.
[0099] For such an ADMA chain, based on the address of the data packet stored in each ADMA module, the byte information contained in the data packet corresponding to each ADMA module can be obtained. Then, by aggregating this byte information, the total byte information contained in the ADMA chain can be obtained. That is, the byte information contained in a larger data packet is obtained after aggregating these N data packets.
[0100] Furthermore, based on the length of the data packets stored by each ADMA module, corresponding aggregation processing is also performed to obtain the length of a larger data packet after the aggregation processing of these N data packets, that is, the length of the data packet is the sum of len1, len2...lenN.
[0101] Example 2: Another method is to traverse each data packet according to the order in which they enter the transmission queue and aggregate adjacent data packets based on a preset number to obtain multiple aggregated data packets.
[0102] For Example 2, this embodiment of the application fully considers various constraints such as the limitation on the amount of data transmitted on the SDIO bus. It can aggregate the data packets in the queue to be transmitted into multiple data packets based on a preset number, and the aggregation processing priority is based on the order in which the buffer enters the queue to be transmitted. For example, if the preset number is 3, then according to the order in which the buffer enters the queue to be transmitted, the 1st to 3rd data packets are aggregated, the 4th to 6th data packets are aggregated, and so on.
[0103] It should be noted that the preset number can be set to one or more. If the preset number is set to multiple, various aggregated data packet styles can be obtained. For example, if the preset number is three or four, three or four data packets can be aggregated into a larger data packet. This operation also avoids the situation where a data packet is left in the transmission queue and cannot be aggregated. For example, if 10 data packets are buffered in the transmission queue, but the preset number is set to three, the tenth data packet will be left unprocessed and cannot be aggregated. In this embodiment, the preset number is set to multiple, thus avoiding this situation.
[0104] In this embodiment of the application, the specific implementation method for aggregating a preset number of data packets is the same as the specific implementation method for aggregating data packets using the ADMA model in Example 1 above, and will not be repeated here.
[0105] 204a. Based on the aggregated data packets, redetermine the data packets to be transmitted in the transmission queue.
[0106] In this embodiment of the application, after aggregation processing, the data packets stored in the queue to be transmitted are no longer the original cached data packets. Therefore, the data packets currently stored in the queue to be transmitted (i.e., the data packets after aggregation processing) should be redefined as the data packets to be transmitted stored in the queue to be transmitted.
[0107] 205. The first SDIO device performs padding on the data packet to be transmitted to obtain a padded data packet, wherein the length of the padded data packet is an integer multiple of the length of the SDIO standard data block.
[0108] In this embodiment, in order for the data packet to be transmitted to be sent out using the data block transmission method, it should be ensured that the length of the data packet is an integer multiple of the length of the SDIO standard data block; otherwise, byte padding should be performed to meet this constraint. Therefore, this embodiment first determines whether padding is needed for the data packet to be transmitted. The specific implementation method is as follows:
[0109] Obtain the length of the SDIO standard data block transmitted based on the SDIO protocol. The length of the SDIO standard data block is typically 512 bytes. Also obtain the length of the data packet to be transmitted. Determine if the length of the data packet to be transmitted is an integer multiple of the length of the SDIO standard data block. If not, it is determined that the data packet to be transmitted needs to be padded. The specific implementation methods for padding can be, but are not limited to, the following:
[0110] First, configure the first ADMA module corresponding to the data packet to be transmitted, which stores the address and length of the data packet to be transmitted; and configure the second ADMA module corresponding to the data packet to be transmitted, which stores the number of padding bytes to be stored.
[0111] In this embodiment, ADMA is used to configure the data information in the data packet to be transmitted to obtain the corresponding first ADMA module. The first ADMA module contains the address and length of the data packet. Since it has been determined that the data packet to be transmitted needs to be padded, and considering where to padded the bytes, this embodiment configures a second ADMA module to load the padded bytes.
[0112] Secondly, the second ADMA module is filled based on the minimum length difference between the length of the data packet to be transmitted and an integer multiple of the length of the SDIO standard data block.
[0113] In this embodiment of the application, after configuring the second ADMA module, the minimum number of padding bytes required is calculated based on the length of the data packet to be transmitted and an integer multiple of the length of the SDIO standard data block. Then, based on this minimum number, the required number of padding bytes is filled into the second ADMA module.
[0114] Finally, based on the data information stored in the first ADMA module and the second ADMA module respectively, padding is performed on the data packet to be transmitted to obtain the padded data packet.
[0115] Specifically, this step can be further refined to include: obtaining the first byte information corresponding to the data packet to be transmitted based on the address of the data packet to be transmitted stored in the first ADMA module; obtaining the second byte information corresponding to the number of bytes to be filled based on the number of bytes to be filled stored in the second ADMA module by filling placeholder characters; filling the second byte information after the first byte information and packaging it into a data packet to obtain the data packet corresponding to the data packet to be transmitted after the filling process.
[0116] For example, if the length of the data packet to be transmitted is 511 bytes, then the number of bytes to be added to the second ADMA module is 1, based on the minimum value between 511 bytes and an integer multiple of 512 bytes (i.e., 1 byte).
[0117] Since the first ADMA module stores the address and length (i.e., 511 bytes) of the data packet to be transmitted, the byte information corresponding to the data packet (i.e., the first byte information corresponding to the original length of 511 bytes) is obtained according to the address; and according to the 1 byte stored in the second ADMA module, it is determined that 1 byte needs to be padded, in the form of a placeholder, such as using "0" to padded, to obtain the padded second byte information; the second byte information is padded after the first byte information and packaged into a data packet to obtain the padded data packet, the length of which is an integer multiple of 512 bytes.
[0118] 206. The first SDIO device sends a padded data packet to the second SDIO device.
[0119] In the embodiments of this application, for multiple data packets to be transmitted stored in the queue to be transmitted, each data packet to be transmitted can be filled in batches and then wait for the data packet to be sent; or, when a data packet is sent, the filling process is performed in real time before the sending is executed. According to the user's real-time needs, if the sending operation of a certain data packet is prohibited, the filling process does not need to be performed. The former solution tends to improve the processing cost and efficiency by batch processing, while the latter solution tends to meet the user's real-time data transmission needs.
[0120] In the embodiments of this application, if the data packet to be transmitted in the queue is an aggregated data packet, the aggregated data packet contains a larger amount of data compared to the original data packet to be transmitted. This not only facilitates the rapid transmission of the large amount of data accumulated in the queue, but also enables a larger amount of data to be transmitted at one time on the SDIO bus, thereby improving the transmission rate on the SDIO bus.
[0121] Furthermore, this embodiment of the application also prioritizes padding processing for the aggregated data packets, thereby ensuring that each data packet can be sent in one transmission operation by the SDIO bus using the data block transmission method. This is more conducive to improving the transmission rate of the SDIO bus, thereby improving the overall data transmission efficiency of the SDIO interface.
[0122] Furthermore, as a response to the above Figure 2 and Figure 3 The implementation of the method shown in this application provides a data transmission device based on a secure digital input / output interface. This device embodiment corresponds to the foregoing method embodiment. For ease of reading, this device embodiment will not repeat the details of the foregoing method embodiment, but it should be understood that the device in this embodiment can implement all the contents of the foregoing method embodiment. This device is used to improve the transmission efficiency of the SDIO interface, specifically as follows... Figure 6As shown, the device includes:
[0123] The padding processing unit 31 is used to pad the data packet to be transmitted by the first SDIO device to obtain the padded data packet, wherein the length of the padded data packet is an integer multiple of the length of the SDIO standard data block.
[0124] The sending unit 32 is used to send the padded data packet from the first SDIO device to the second SDIO device.
[0125] Furthermore, the length of the SDIO standard data block is 512 bytes.
[0126] Furthermore, such as Figure 7 As shown, the filling processing unit 31 includes:
[0127] The acquisition module 311 is used to acquire the length of the SDIO standard data block transmitted based on the SDIO protocol;
[0128] The acquisition module 311 is also used to acquire the length of the data packet to be transmitted;
[0129] The judgment module 312 is used to determine whether the length of the data packet to be transmitted is an integer multiple of the length of the SDIO standard data block;
[0130] The padding processing module 313 is used to pad the data packet to be transmitted when it is determined that the length of the data packet to be transmitted is an integer multiple of the length of the SDIO standard data block, until the length of the data packet to be transmitted is an integer multiple of the length of the SDIO standard data block.
[0131] Furthermore, such as Figure 7 As shown, the filling processing module 313 includes:
[0132] Configuration submodule 3131 is used to configure the first ADMA module corresponding to the data packet to be transmitted, wherein the first ADMA module stores the address and length of the data packet to be transmitted;
[0133] The configuration submodule 3131 is also used to configure the second ADMA module corresponding to the data packet to be transmitted, and the second ADMA module is used to store the number of bytes to be padded.
[0134] A filling submodule is used to fill the second ADMA module according to the minimum length difference between the length of the data packet to be transmitted and an integer multiple of the length of the SDIO standard data block;
[0135] The processing submodule 3132 is used to perform padding processing on the data packet to be transmitted according to the data information stored in the first ADMA module and the second ADMA module respectively, so as to obtain the padded data packet.
[0136] Furthermore, such as Figure 7 As shown, the processing submodule 3132 is further specifically used for:
[0137] Based on the address of the data packet to be transmitted stored in the first ADMA module, obtain the first byte information corresponding to the data packet to be transmitted;
[0138] Based on the number of bytes to be filled stored in the second ADMA module, the second byte information corresponding to the number of bytes to be filled is obtained by filling placeholder characters.
[0139] The second byte information is filled after the first byte information and packaged into a data packet to obtain the data packet corresponding to the data packet to be transmitted after filling.
[0140] Furthermore, such as Figure 7 As shown, the device further includes:
[0141] The acquisition unit 33 is used to acquire the data packet to be transmitted and cache it into the transmission queue before the first SDIO device performs filling processing on the data packet to be transmitted.
[0142] Judgment unit 34 is used to determine whether the number of data packets in the queue to be transmitted is greater than a preset threshold;
[0143] The aggregation processing unit 35 is used to aggregate multiple adjacent buffered data packets that enter the transmission queue when it is determined that the number of data packets in the transmission queue is greater than a preset threshold, so as to obtain the aggregated data packets.
[0144] The determining unit 36 is used to redetermine the data packets to be transmitted in the transmission queue based on the aggregated data packets.
[0145] Furthermore, such as Figure 7 As shown, the aggregation processing unit 35 is further specifically used for:
[0146] The data packets in the queue to be transmitted are aggregated into a single aggregated data packet; or,
[0147] According to the order in which the data packets enter the queue to be transmitted, each data packet is traversed and adjacent data packets are aggregated based on a preset number to obtain multiple aggregated data packets.
[0148] In summary, this application provides a data transmission method and apparatus based on a secure digital input / output interface. This application buffers data packets to be transmitted into a transmission queue, aggregates the data packets in the transmission queue to obtain data packets with larger data volumes, and then pads these data packets so that their length is an integer multiple of the length of an SDIO standard data block. This ensures that each padded data packet is sent out using the data block transmission method. Therefore, by increasing the data transmission volume and selecting the data block transmission method, the transmission rate on the SDIO bus is greatly improved, thus enhancing the overall data transmission efficiency of the SDIO interface.
[0149] The data transmission device based on a secure digital input / output interface provided in this application includes a processor and a memory. The aforementioned filling processing unit and sending unit are all stored in the memory as program units, and the processor executes the aforementioned program units stored in the memory to realize the corresponding functions.
[0150] The processor contains a kernel, which retrieves the corresponding program units from memory. One or more kernels can be configured. By adjusting kernel parameters, the process of reading and writing data between the SDIO interface and external devices is optimized. This ensures that a data packet is processed in a single transmission operation on the SDIO bus, improving the SDIO bus transmission rate and contributing to an overall increase in SDIO interface transmission efficiency.
[0151] This application provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the data transmission method based on a secure digital input / output interface as described above.
[0152] This application provides an electronic device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the data transmission method based on a secure digital input / output interface as described above.
[0153] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0154] In a typical configuration, the device includes one or more processors (CPUs), memory, and a bus. The device may also include input / output interfaces, network interfaces, etc.
[0155] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, like read-only memory (ROM) or flash RAM, and memory includes at least one memory chip. Memory is an example of computer-readable media.
[0156] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0157] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0158] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0159] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.
Claims
1. A data transmission method based on a secure digital input / output interface, characterized in that, The method includes: The first SDIO device performs padding on the data packet to be transmitted to obtain a padded data packet, wherein the length of the padded data packet is an integer multiple of the length of the SDIO standard data block; The first SDIO device performs padding processing on the data packet to be transmitted to obtain a padded data packet, including: obtaining the length of the SDIO standard data block transmitted based on the SDIO protocol; obtaining the length of the data packet to be transmitted; determining whether the length of the data packet to be transmitted is an integer multiple of the length of the SDIO standard data block; if not, padding processing is performed on the data packet to be transmitted until it reaches an integer multiple of the length of the SDIO standard data block. Each of the data packets to be transmitted is configured with an ADMA module. Each ADMA module contains the address and length of the corresponding data packet to be transmitted, and is used to construct an ADMA chain with N ADMA modules from N data packets to be transmitted. The padding process for the data packets to be transmitted, until reaching an integer multiple of the length of the SDIO standard data block, includes: Configure the first ADMA module corresponding to the data packet to be transmitted, wherein the first ADMA module stores the address and length of the data packet to be transmitted; Configure a second ADMA module corresponding to the data packet to be transmitted. The second ADMA module is used to store the number of bytes to be padded. Since each data packet to be transmitted corresponds to a unique ADMA module, the ADMA module includes the first ADMA module and the second ADMA module. The second ADMA module is filled based on the minimum length difference between the length of the data packet to be transmitted and an integer multiple of the length of the SDIO standard data block; The data packet to be transmitted is padded according to the data information stored in the first ADMA module and the second ADMA module respectively to obtain a padded data packet. The process includes: obtaining the first byte information corresponding to the data packet to be transmitted according to the address of the data packet to be transmitted stored in the first ADMA module; obtaining the second byte information corresponding to the number of bytes to be padded according to the number of bytes to be padded stored in the second ADMA module by filling in placeholder characters; filling the second byte information after the first byte information and packaging it into a data packet to obtain the padded data packet corresponding to the data packet to be transmitted. The first SDIO device sends the padded data packet to the second SDIO device, the data packet being characterized as an ADMA chain having N ADMA modules.
2. The method according to claim 1, characterized in that, The length of the SDIO standard data block is 512 bytes.
3. The method according to claim 1 or 2, characterized in that, Before the first SDIO device performs padding processing on the data packet to be transmitted, the method further includes: Obtain the data packet to be transmitted and cache it in the transmission queue; Determine whether the number of data packets in the queue to be transmitted is greater than a preset threshold; If so, then the data packets that are buffered by multiple adjacent packets and enter the transmission queue are aggregated in the transmission queue to obtain the aggregated data packets; Based on the aggregated data packets, the data packets to be transmitted in the transmission queue are re-determined.
4. The method according to claim 3, characterized in that, The step of aggregating multiple adjacent buffered data packets entering the transmission queue to obtain aggregated data packets includes: The data packets in the queue to be transmitted are aggregated into a single aggregated data packet; or, According to the order in which the data packets enter the queue to be transmitted, each data packet is traversed and adjacent data packets are aggregated based on a preset number to obtain multiple aggregated data packets.
5. A data transmission device based on a secure digital input / output interface, characterized in that, The device includes: A padding processing unit is used by the first SDIO device to pad the data packet to be transmitted to obtain a padded data packet, wherein the length of the padded data packet is an integer multiple of the length of the SDIO standard data block; The filling processing unit includes: The acquisition module is used to obtain the length of SDIO standard data blocks transmitted based on the SDIO protocol; The acquisition module is also used to acquire the length of the data packet to be transmitted; The judgment module is used to determine whether the length of the data packet to be transmitted is an integer multiple of the length of the SDIO standard data block; A padding module is used to pad the data packet to be transmitted when it is determined that the length of the data packet to be transmitted is an integer multiple of the length of the SDIO standard data block, until the length of the data packet to be transmitted is an integer multiple of the length of the SDIO standard data block; wherein, each data packet to be transmitted is configured as an ADMA module, and the ADMA module contains the address and length of the data packet to be transmitted, and is used to construct an ADMA chain with N ADMA modules from N data packets to be transmitted; The filling processing module includes: A configuration submodule is used to configure the first ADMA module corresponding to the data packet to be transmitted. The first ADMA module stores the address and length of the data packet to be transmitted. The configuration submodule is further configured to configure the second ADMA module corresponding to the data packet to be transmitted, wherein the second ADMA module is used to store the number of bytes to be padded; wherein, based on the fact that each data packet to be transmitted corresponds to a unique ADMA module, the ADMA module includes the first ADMA module and the second ADMA module; A filling submodule is used to fill the second ADMA module according to the minimum length difference between the length of the data packet to be transmitted and an integer multiple of the length of the SDIO standard data block; The processing submodule is used to perform padding processing on the data packet to be transmitted according to the data information stored in the first ADMA module and the second ADMA module respectively, so as to obtain the padded data packet; The sending unit is used to send the padded data packet from the first SDIO device to the second SDIO device, wherein the data packet is characterized as an ADMA chain having N ADMA modules.
6. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the data transmission method based on a secure digital input / output interface as described in any one of claims 1-4.
7. An electronic device, characterized in that, include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the data transmission method based on a secure digital input / output interface as described in any one of claims 1-4.
Citation Information
Patent Citations
Packet data transmission method, system and device for large-scale terminal and medium
CN114286386A
SDIO interface data transmission method and device and SDIO interface equipment
CN114338567A
Method, electronic device and computer program product for processing data
CN114817121A
Transmission device, reception device, transmission method, and reception method
JP2019149702A