Data transmission method and device, electronic equipment and medium

Under the instruction of the host system, the terminal device adopts DMA active download or non-DMA passive reception to dynamically adjust the data transmission method, which solves the problem of firmware download failure of PCIe devices when there is no DMA controller, improves the download success rate and reduces the risk.

CN120743828AActive Publication Date: 2025-10-03BEIJING X RING TECHNOLOGY CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202511234518.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-29
Publication Date
2025-10-03
Estimated Expiration
2045-08-29

AI Technical Summary

Technical Problem

In the prior art, when a PCIe device lacks a DMA controller, the risk of firmware download failure is high, resulting in a single download method and a low success rate.

Method used

Under the instruction of the host system, the terminal device adopts DMA active download or non-DMA passive reception to dynamically adjust the data transmission method to ensure the success rate of firmware download.

Benefits of technology

It improves the success rate of firmware downloads, expands the scope of application, is compatible with PCIe devices with and without DMA controllers, and reduces tape-out risks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120743828A_ABST
    Figure CN120743828A_ABST
Patent Text Reader

Abstract

The invention provides a data transmission method and device, electronic equipment and a medium, and relates to the technical field of chips. Comprises: a terminal device receives first information, the first information being used for indicating a data transmission mode of the terminal device, the first information comprising a first identifier and parameter information corresponding to the first identifier, and the data transmission mode comprising a batch transmission mode and a distributed transmission mode; and obtaining the target data from the host system based on the first information. According to the data transmission method provided by the invention, the terminal equipment can acquire the target data from the host system according to the data transmission mode indicated by the host system, and the host system can perform selection indication in the two data transmission modes, so that the success rate of acquiring the target data by the terminal equipment is improved, the potential tape-out risk is avoided, and the data transmission efficiency is improved. The application range of the data transmission mode is expanded, and the method can be applied to terminal equipment with a direct memory access (DMA) controller and can also be applied to terminal equipment without a DMA controller.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of chip technology, and in particular to a data transmission method and device, an electronic device, and a medium. Background Art

[0002] With the increase in communication data bandwidth, PCIe (Peripheral Component Interconnect Express) has become the communication interface between devices. The operation of PCIe devices must rely on specific firmware. To reduce the hardware cost of PCIe devices, the firmware can be stored in the host system, which saves costs and facilitates updates. Summary of the Invention

[0003] The present disclosure provides a data transmission method and apparatus, an electronic device, and a medium, and provides a solution for a terminal device to download firmware by issuing commands through a host system.

[0004] The first aspect embodiment of the present disclosure proposes a data transmission method, including: receiving first information, the first information is used to indicate the data transmission mode of the terminal device, the first information includes a first identifier and parameter information corresponding to the first identifier, and the data transmission mode includes a batch transmission mode and a distributed transmission mode; based on the first information, obtaining target data from the host system.

[0005] In some embodiments of the present disclosure, receiving the first information includes: determining a mapping relationship between a device exchange memory of the terminal device and a host processing unit of the host system based on a data transmission connection between the terminal device and the host system; based on the mapping relationship, detecting the device exchange memory according to a preset period to determine a first storage position of the first identifier in the device exchange memory and a second storage position of parameter information corresponding to the first identifier; reading the first identifier from the first storage position, and reading the parameter information corresponding to the first identifier from the second storage position.

[0006] In some embodiments of the present disclosure, target data is obtained from a host system based on first information, including: determining a target data transmission mode corresponding to the first identifier based on a preset association relationship, the target data transmission mode being a batch transmission mode or a distributed transmission mode; determining parameter information corresponding to the target data transmission mode stored in a device exchange memory of the terminal device, the parameter information including at least one of a starting address, a destination address, a data size, and verification information; and obtaining the target data from the host system through the target data transmission mode based on the parameter information.

[0007] In some embodiments of the present disclosure, the target data transmission mode is a batch transmission mode, and based on parameter information, the target data is obtained from the host system through the target data transmission mode, including: initializing the batch transmission channel, writing the starting address and the destination address into the source address register in the direct memory access DMA; through DMA, obtaining the target data from the storage location corresponding to the starting address in the host memory of the host system, and writing the target data into the storage location corresponding to the destination address in the device memory of the terminal device.

[0008] In some embodiments of the present disclosure, the target data transmission mode is a distributed transmission mode, and based on parameter information, the target data is obtained from the host system through the target data transmission mode, including: establishing an address mapping relationship between the local address area of ​​the device and the PCI bus address space; in response to the completion of the address mapping relationship, obtaining a target data packet from the host system, the target data packet including the PCI bus address and target data.

[0009] In some embodiments of the present disclosure, the method further includes: determining a device local address corresponding to the PCI bus address based on an address mapping relationship; and writing the target data into a storage space corresponding to the device local address.

[0010] In some embodiments of the present disclosure, the method also includes: receiving second information, the second information is used to indicate the transmission result of the target data; detecting the device exchange memory according to a preset period, and in response to detecting that the second information indicates that the target data transmission is completed, performing an integrity check on the target data based on the verification information; in response to the integrity check of the target data being successful, writing the target data to a persistent storage medium, and switching the state of the terminal device to a state of running the target data.

[0011] In some embodiments of the present disclosure, the method further includes: sending third information, the third information being used to indicate the result of the integrity check; in response to the failure of the integrity check of the target data, receiving fourth information, the fourth information being used to update the data transmission method, the fourth information including the second identifier and parameter information corresponding to the second identifier.

[0012] In the above embodiment, the terminal device can obtain target data from the host system according to the data transmission method indicated by the host system, and the host system can dynamically update the indicated data transmission method, thereby improving the success rate of the terminal device in obtaining the target data, avoiding potential tape-out risks, and expanding the application scope of the data transmission method. It can be applied to terminal devices with a DMA controller and terminal devices without a DMA controller.

[0013] The second aspect embodiment of the present disclosure proposes a data transmission method, including: sending first information, the first information is used to indicate the data transmission mode of the terminal device, the first information includes a first identifier and parameter information corresponding to the first identifier, the data transmission mode includes a batch transmission mode and a distributed transmission mode, and the first information is used by the terminal device to obtain target data from the host system.

[0014] In some embodiments of the present disclosure, the method further includes: determining a mapping relationship between a host processing unit of the host system and a device exchange memory of the terminal device according to a data transmission connection between the host system and the terminal device.

[0015] In some embodiments of the present disclosure, sending the first information includes: migrating target data from a file system to a host processing unit; determining a first identifier corresponding to a target data transmission method based on a preset association relationship, where the target data transmission method is a batch transmission method or a distributed transmission method; in response to completion of the target data migration, sending the first information to a device exchange memory of the terminal device based on a mapping relationship.

[0016] In some embodiments of the present disclosure, the target data transmission mode is a distributed transmission mode, and the method further includes: in response to the terminal device completing the establishment of the address mapping relationship, sending the target data to the terminal device, and the address mapping relationship represents the relationship between the device local address area of ​​the terminal device and the PCI bus address space.

[0017] In some embodiments of the present disclosure, sending target data to a terminal device includes: sending a target data packet to the terminal device, the target data packet including a PCI bus address and target data, the target data packet being used by the terminal device to write the target data into a storage space of a device local address corresponding to the PCI bus address based on an address mapping relationship.

[0018] In some embodiments of the present disclosure, the method further includes: in response to completion of the target data transmission, sending second information, where the second information is used to indicate a transmission result of the target data.

[0019] In some embodiments of the present disclosure, the method further includes: receiving third information, the third information being used to indicate a result of an integrity check of the terminal device; in response to a failure of the integrity check of the target data, sending fourth information, the fourth information being used to update a data transmission mode of the terminal device, the fourth information including the second identifier and parameter information corresponding to the second identifier.

[0020] In the above embodiment, the host system can instruct the terminal device to obtain the data transmission method of the target data by sending an indication message to the terminal device, and update the indicated data transmission method if the terminal device fails to obtain the target data, thereby improving the success rate of the terminal device in obtaining the target data and avoiding potential tape-out risks.

[0021] The third aspect embodiment of the present disclosure proposes a data transmission device, which includes a transceiver module and a processing module. The transceiver module is used to receive first information, and the first information is used to indicate the data transmission mode of the terminal device. The first information includes a first identifier and parameter information corresponding to the first identifier. The data transmission mode includes a batch transmission mode and a distributed transmission mode; the processing module is used to obtain target data from the host system based on the first information.

[0022] In some embodiments of the present disclosure, the transceiver module is used to: determine a mapping relationship between a device exchange memory of a terminal device and a host processing unit of the host system based on a data transmission connection between the terminal device and the host system; based on the mapping relationship, detect the device exchange memory according to a preset period to determine a first storage position of a first identifier in the device exchange memory and a second storage position of parameter information corresponding to the first identifier; read the first identifier from the first storage position, and read the parameter information corresponding to the first identifier from the second storage position.

[0023] In some embodiments of the present disclosure, the processing module is used to: determine the target data transmission mode corresponding to the first identifier based on a preset association relationship, the target data transmission mode being a batch transmission mode or a distributed transmission mode; determine the parameter information corresponding to the target data transmission mode stored in the device exchange memory of the terminal device, the parameter information including at least one of the starting address, the destination address, the data size, and the verification information; based on the parameter information, obtain the target data from the host system through the target data transmission mode.

[0024] In some embodiments of the present disclosure, the processing module is used to: initialize a batch transfer channel, write the starting address and the destination address into the address register in the direct memory access (DMA); obtain the target data from the storage location corresponding to the starting address in the host memory of the host system through the DMA, and write the target data into the storage location corresponding to the destination address in the device memory of the terminal device.

[0025] In some embodiments of the present disclosure, the processing module is used to: establish an address mapping relationship between the device local address area and the PCI bus address space; in response to the completion of the address mapping relationship, obtain a target data packet from the host system, the target data packet including the PCI bus address and target data.

[0026] The fourth aspect embodiment of the present disclosure proposes a data transmission device, which includes a transceiver module and a processing module. The transceiver module is used to send first information, and the first information is used to indicate the data transmission mode of the terminal device. The first information includes a first identifier and parameter information corresponding to the first identifier. The data transmission mode includes a batch transmission mode and a distributed transmission mode. The first information is used by the terminal device to obtain target data from the host system.

[0027] In some embodiments of the present disclosure, the processing module is used to determine a mapping relationship between a host processing unit of the host system and a device exchange memory of the terminal device according to a data transmission connection between the terminal device and the host system.

[0028] In some embodiments of the present disclosure, the processing module is used to: migrate target data from a file system to a host processing unit; determine a first identifier corresponding to a target data transmission mode based on a preset association relationship, where the target data transmission mode is a batch transmission mode or a distributed transmission mode; in response to completion of the target data migration, send the first information to a device exchange memory of the terminal device based on a mapping relationship.

[0029] In some embodiments of the present disclosure, the transceiver module is used to: in response to the completion of establishment of the address mapping relationship of the terminal device, send target data to the terminal device.

[0030] In some embodiments of the present disclosure, the transceiver module is used to: send a target data packet to a terminal device, the target data packet includes a PCI bus address and target data, and the target data packet is used by the terminal device to write the target data into the storage space of the device local address corresponding to the PCI bus address based on the address mapping relationship.

[0031] The fifth aspect embodiment of the present disclosure proposes an electronic device, comprising: a processor and a memory for storing a computer program that can be run on the processor, wherein when the processor is used to run the computer program, it executes the method described in any one of the embodiments of the first aspect or the second aspect of the present disclosure.

[0032] The sixth aspect embodiment of the present disclosure proposes a non-transitory computer-readable storage medium storing computer instructions, where the computer instructions are used to enable a computer to execute the method described in any one of the first or second aspects of the present disclosure.

[0033] The seventh aspect of the present disclosure provides a program product, including computer instructions, which are used to enable a computer to execute the method described in any one of the first or second aspects of the present disclosure.

[0034] The eighth embodiment of the present disclosure proposes a chip, comprising at least one processor and a communication interface; the communication interface is used to receive signals input into the chip or signals output from the chip, the processor communicates with the communication interface and implements any one of the methods in the first or second aspects of the present disclosure through logic circuits or execution code instructions.

[0035] In summary, the data transmission method and apparatus, electronic device, and medium proposed in the present disclosure include: a terminal device receives first information, the first information is used to indicate the data transmission mode of the terminal device, the first information includes a first identifier and parameter information corresponding to the first identifier, and the data transmission mode includes a batch transmission mode and a distributed transmission mode; based on the first information, the target data is obtained from the host system. With the data transmission method proposed in the present disclosure, the terminal device can obtain the target data from the host system according to the data transmission mode indicated by the host system, and the host system can dynamically update the indicated data transmission mode, thereby improving the success rate of the terminal device in obtaining the target data, avoiding potential tape-out risks, and expanding the application scope of the data transmission method. It can be applied to both terminal devices with a DMA controller and terminal devices without a DMA controller.

[0036] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] The accompanying drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute an improper limitation of the present disclosure.

[0038] Figure 1 This is an interactive diagram of the data transmission method proposed in an embodiment of the present disclosure; Figure 2 A schematic diagram of the process of the batch transmission method proposed in the embodiment of the present disclosure; Figure 3 A schematic diagram of the process of the distributed transmission method proposed in the embodiment of the present disclosure; Figure 4A This is a schematic diagram of the DMA method; Figure 4B This is a schematic diagram of non-DMA mode; Figure 4C A flowchart of a specific implementation of the data transmission method; Figure 5 A schematic structural diagram of a data transmission device proposed in an embodiment of the present disclosure; Figure 6 A schematic structural diagram of a data transmission device proposed in an embodiment of the present disclosure; Figure 7 A schematic diagram of the structure of an electronic device proposed in an embodiment of the present disclosure; Figure 8 FIG. 4 is a schematic structural diagram of a chip for implementing the above-mentioned data transmission method according to an exemplary embodiment. DETAILED DESCRIPTION

[0039] The following describes in detail embodiments of the present disclosure, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present disclosure, and should not be construed as limiting the present disclosure.

[0040] When the specific firmware that a PCIe device relies on is stored in the host system, the PCIe device may or may not have DMA (Direct Memory Access). Therefore, downloading the required firmware to the PCIe device through the PCIe channel is crucial. To ensure that the firmware can be downloaded to the PCIe device, there are two methods for firmware download: active and passive. However, the download method is relatively fixed, that is, the PCIe device can only use one method to download the firmware. If the active acquisition method is used without DMA, the download will fail.

[0041] To address the above-mentioned issues, the present disclosure proposes a data transmission method. By adding a backup solution for firmware downloading, the terminal device can download the firmware in an active manner using DMA or in a passive manner without DMA according to the instructions of the host system, thereby improving the download success rate and reducing potential tape-out risks. This solution is compatible with a variety of PCIe devices with or without DMA. In this application, firmware can be a type of update data transmitted via encrypted transmission. Firmware itself is a collection of program code that processes data through algorithms and is typically stored in a device's internal storage space as a binary file (e.g., .bin or .hex format). The data and target data involved in the embodiments of this application can be represented as a type of firmware.

[0042] The data transmission method provided in this application will be described in detail below with reference to the accompanying drawings.

[0043] The data transmission method proposed in the present disclosure can be applied to a communication system, which includes a terminal device and a host system, and data can be transmitted between the terminal device and the host system.

[0044] In some embodiments, the terminal device may be a device with a DMA controller or a device without a DMA controller.

[0045] Figure 1 This is an interactive diagram of a data transmission method proposed in an embodiment of the present disclosure, which is executed by a communication system. Figure 1As shown, the method includes the following steps: Step 101: The terminal device and the host system determine a mapping relationship.

[0046] In some embodiments, the host system determines a mapping relationship between a host processing unit of the host system and a device swap memory of the terminal device based on a data transmission connection between the host system and the terminal device. Specifically, the host system may establish an address space mapping relationship between the host processing unit and the device swap memory, that is, a mapping relationship between an address space in the host processing unit and an address space in the device swap memory.

[0047] In some embodiments, the terminal device determines a mapping relationship between the device exchange memory of the terminal device and the host processing unit of the host system based on the data transmission connection between the terminal device and the host system. Specifically, the terminal device can synchronize the mapping relationship established by the host system to the terminal device through synchronization.

[0048] In some embodiments, the data transmission connection between the host system and the terminal device may be a PCIe link. The terminal device establishes a PCIe data transmission connection with the host system by enabling the PCIe link and DMA functions. The terminal device may have a dedicated DMA controller that is functional, or may not have a DMA controller or the DMA controller may not be functional.

[0049] In some embodiments, the device exchange memory of the terminal device can be a SWAP area register, which can be a shared memory area for bidirectional communication between the host system and the terminal device. The host system writes commands or data, and the terminal device reads and executes them. Conversely, the terminal device writes data or feedback, and the host system reads and processes it, and so on.

[0050] In some embodiments, the host processing unit of the host system may be a CPU (Central Process Unit) of the host system.

[0051] In some embodiments, determining the mapping relationship between the device exchange memory and the host processing unit time can be used by the terminal device to determine the storage location of the command written by the host system in the device memory based on the mapping relationship, and by the host system to determine the storage location of the device memory of the terminal device where the command to be written will be stored based on the mapping relationship.

[0052] For example, Figure 4AAs shown in the schematic diagram, when a dedicated DMA controller is installed inside the PCIe device and the DMA controller is functioning normally, the PCIe link and DMA functions are enabled in the bootrom code of the PCIe device.

[0053] For example, Figure 4B As shown in the schematic diagram, when the PCIe device does not have a DMA controller or the DMA controller cannot work properly, the PCIe link and DMA functions are enabled in the bootrom code program of the PCIe device.

[0054] In some embodiments, the terminal device enters PCIe download mode after power-on, thereby establishing a data transmission connection with the host system.

[0055] In some embodiments, after the data transmission connection is established, the terminal device and the host system determine the mapping relationship between the device exchange memory and the host processing unit based on the data transmission connection, so that the two parties can communicate based on the mapping relationship.

[0056] For example, the PCIe device is powered on and enters the BootROM program, entering PCIe download mode; it successfully links up with the host system; and the mapping between the PCIe device's BAR (Base Address Register) and the address spaces of the doorbell and SWAP area registers is initialized. The BAR is used to map the PCIe device's registers or memory areas to the host system's physical address space (CPU). The host system establishes the mapping between the address spaces, perhaps between the CPU and the SWAP area registers. The doorbell is a specific offset within the BAR (e.g., BAR0 + 0x1000). The host system writes to this address to trigger device actions.

[0057] Step 102: The host system sends first information to the terminal device.

[0058] In some embodiments, the host system migrates the target data from the file system to the host processing unit; based on a preset association relationship, determines a first identifier corresponding to the target data transmission method, and the target data transmission method is a batch transmission method or a distributed transmission method; in response to the completion of the target data migration, based on the mapping relationship, sends the first information to the device exchange memory of the terminal device.

[0059] In some embodiments, the first information may be a download command for instructing the terminal device to download firmware.

[0060] In some embodiments, the first information is used to indicate a data transmission mode of the terminal device. The first information includes a first identifier and parameter information corresponding to the first identifier. The data transmission mode includes a batch transmission mode and a distributed transmission mode.

[0061] In some embodiments, the batch transfer mode can be a DMA method for actively downloading firmware, while the distributed transfer mode can be a non-DMA method for passively receiving firmware. Specifically, the terminal device can only execute the batch transfer mode if it has a DMA controller and the DMA controller is functioning properly. If the terminal device does not have a DMA controller or has a DMA controller that is not functioning properly, the terminal device cannot execute the batch transfer mode and must execute the distributed transfer mode to obtain data.

[0062] In some embodiments, the host system needs to migrate target data to be downloaded by the terminal device from the file system to the host processing unit, so as to transmit the target data to the terminal device through the data transmission connection.

[0063] In some embodiments, migrating the target data from the file system to the host processing unit may be reading the target data from the file system and writing it to a DDR (Double Data Rate) in the CPU of the host system, where the target data has a corresponding storage start address.

[0064] For example, the host system needs to read the firmware from the file system and write it to a certain starting address of the DDR (Double Data Rate) on the host system side. Assume that this address is SAR.

[0065] In some embodiments, the preset association relationship can be a correspondence between a data transmission method and an identifier. Based on the preset association relationship, the host system determines the first identifier corresponding to the target data transmission method indicated to the terminal device this time, and generates first information. The first information includes the first identifier corresponding to the target transmission method, and parameter information corresponding to the target transmission method, in other words, the parameter information corresponding to the first identifier.

[0066] In some embodiments, after the target data migration is completed, the host system writes the first information into the device exchange memory of the terminal device according to the mapping relationship.

[0067] For example, the host system waits for the CPU to move the firmware from the file system to the DDR on the host system; the host system sends a command to the PCIe device.

[0068] For example, the CPU on the host system side writes the boot cmd (download command) and the parameters required to execute the cmd to the SWAP area register on the PCIe device side through the PCI link; and writes the signal that triggers the execution of the boot cmd to the SWAP area register on the PCIe device side.

[0069] Step 103: The terminal device reads the first information.

[0070] In some embodiments, the terminal device detects the device exchange memory according to a preset period based on the mapping relationship to determine a first storage location of the first identifier in the device exchange memory and a second storage location of the parameter information corresponding to the first identifier.

[0071] In some embodiments, the preset period may be a pre-set polling period for the terminal device, which may be customized according to the scenario or requirements.

[0072] In some embodiments, the terminal device detects the device exchange memory according to a preset period to determine whether the host system has sent the first information, and determines the storage location corresponding to the first information sent by the host system based on the mapping relationship.

[0073] In some embodiments, the terminal device can detect the storage space of the device exchange memory according to a preset period. After detecting the first identifier, it can determine the first storage position of the first identifier sent by the host system in the device exchange memory, and then determine the second storage position of the parameter information corresponding to the first identifier in the device exchange memory.

[0074] For example, the CPU on the PCIe Device side polls the doorbell register and waits for the firmware download command.

[0075] In some embodiments, the terminal device reads a first identifier from a first storage location in the device memory and reads parameter information corresponding to the first identifier from a second storage location, thereby determining the data transmission mode indicated by the host system, i.e., the target data transmission mode, and parameter information corresponding to the target data transmission mode. It is understood that the parameter information includes at least one of the starting address of the target data, the destination address, the data size, and checksum information. For different data transmission modes, as long as the target data is the same, the parameter information is the same.

[0076] Step 104: The terminal device obtains target data.

[0077] In some embodiments, the terminal device obtains target data from the host system based on the first information.

[0078] In some embodiments, the terminal device determines the target data transmission mode corresponding to the first identifier based on a preset association relationship; determines the parameter information corresponding to the target data transmission mode stored in the device exchange memory of the terminal device, the parameter information including at least one of the starting address, destination address, data size, and verification information; based on the parameter information, obtains the target data from the host system through the target data transmission mode.

[0079] In some embodiments, after reading the first identifier, the terminal device determines the target data transmission mode corresponding to the first identifier based on a preset association relationship, and further determines that the read parameter information is the parameter information corresponding to the target data transmission mode.

[0080] In some embodiments, the starting address may be the address where the target data is stored in the host processing unit, the destination address may be the address where the target data needs to be written to the terminal device, the data size may be the size of the target data, the target data may exist in the form of a file, the data size is the file size, and the verification information may be verification data or a verification value, which is related information for verifying whether an error or loss occurs in the target data during the transmission process.

[0081] For example, after the CPU on the PCIe Device side polls the values ​​agreed upon by both parties, it reads all boot cmd (firmware download command) parameters and starts executing the boot cmd (firmware download command).

[0082] In some embodiments, the terminal device obtains target data from the host system through a target data transmission method based on parameter information. When the host system instructs to use a batch transmission method, the terminal device actively downloads the target data from the host system through a batch transmission method; or, when the host system instructs to use a distributed transmission method, the terminal device passively receives the target data from the host system through a distributed transmission method, that is, the host system sends the target data to the terminal device, so that the terminal device obtains the target data.

[0083] In some embodiments, the terminal device obtains target data from the host system through batch transmission by running a DMA controller, and the DMA controller moves the target data of the host system from the memory of the host system to the storage space of the terminal device.

[0084] For example, the host system sends an active acquisition command to the PCIe device; the PCIe device uses the DMA controller to move the host-side firmware from the DDR on the host system side to the DDR / SRAM (static random access memory) on the PCIe device side.

[0085] In some embodiments, the terminal device obtains the target data from the host system through the distributed transmission method, and the host system may move the target data from the memory of the host system to the storage space of the terminal device.

[0086] For example, the host system sends a passive acquisition command to the PCIe device; the CPU on the host side moves the firmware from the DDR on the host system to the DDR / SRAM on the PCIe device.

[0087] Step 105: The host system sends second information to the terminal device.

[0088] In some embodiments, the second information is used to indicate a transmission result of the target data.

[0089] In some embodiments, the host system determines whether the target data has been completely transmitted to the terminal device, and sends a second message to the terminal device to inform the terminal device whether the data transmission has been completed.

[0090] In some embodiments, in batch transfer mode, when the terminal device has completed the target data transfer through the DMA controller, the host system can write the target data transfer completion result into the device exchange memory, so that the terminal device can determine that the target data has been transferred by polling the device exchange memory.

[0091] In some embodiments, under the distributed transmission mode, after the host system writes the target data to the storage space on the terminal device side, it can write the target data transmission completion into the device exchange memory, so that the terminal device can determine that the target data has been transmitted by polling the device exchange memory.

[0092] For example, in non-DMA mode, the CPU on the host system side writes all firmware to the PCIeDevice side and then writes the result to the register in the SWAP area.

[0093] In the above embodiment, if the terminal device does not receive the second information, it means that the host system has not completed the transmission of the target data. The terminal device cannot proceed to the next step and needs to wait for the host system to write the second information indicating the completion of the target data transmission into the device exchange memory before executing the subsequent steps.

[0094] Step 106: The terminal device performs integrity check on the target data.

[0095] In some embodiments, the terminal device detects the device exchange memory according to a preset period, and in response to detecting that the second information indicates that the target data transmission is completed, performs an integrity check on the target data based on the verification information.

[0096] In some embodiments, when the host system detects that the target data has been transmitted, it notifies the terminal device that the target data transmission is completed. The terminal device can perform integrity verification on the target data based on the verification information in the parameter information to determine whether the target data is complete and accurate.

[0097] In some embodiments, in response to a successful integrity check of the target data, the target data is written to a persistent storage medium, and the state of the terminal device is switched to a state of running the target data.

[0098] In some embodiments, switching the state of the terminal device to the state of running the target data may be executing a CPU jump program of the terminal device to execute a program corresponding to the target data.

[0099] For example, the CPU on the PCIe device side polls the result of downloading the firmware, and the CPU on the PCIe device side executes a verification program. If the verification is correct, the CPU jumps to start executing the firmware program.

[0100] Step 107: The terminal device sends third information to the host system.

[0101] In some embodiments, the third information is used to indicate a result of the integrity check.

[0102] In some embodiments, for the batch transmission mode and the distributed transmission mode, after performing the integrity check, the terminal device informs the host system of the result of the integrity check by writing it into the device exchange memory.

[0103] In some embodiments, the terminal device writes the third information into the device exchange memory to send the integrity check result to the host system.

[0104] For example, the CPU on the PCIe device side executes a verification program and writes the verification result into the SWAP area register. The host system obtains the integrity verification result by polling the SWAP area register.

[0105] In some embodiments, in a distributed transmission mode, the terminal device performs an integrity check, and after the integrity check succeeds, writes third information to the device exchange memory, the third information indicating that the integrity check succeeds, and disables the address mapping relationship to protect the data in the storage space.

[0106] Step 108: The host system sends fourth information to the terminal device.

[0107] In some embodiments, the host system sends fourth information to the terminal device in response to the third information indicating that the integrity check of the target data has failed.

[0108] In some embodiments, the fourth information is used to update the data transmission mode, and the fourth information includes the second identifier and parameter information corresponding to the second identifier.

[0109] In some embodiments, when the integrity check fails after the terminal device downloads the target data through the target data transmission method, the host system can switch the command, that is, update the data transmission method of the terminal device, so that the terminal device can obtain the target data through another data transmission method.

[0110] In the above embodiment, the host system can instruct the terminal device to obtain the data transmission method of the target data from the host system by sending an indication information to the terminal device, and when the terminal device fails to execute through one data transmission method, the indicated data transmission method is updated so that the terminal device can obtain the target data from the host system through another data transmission method, thereby improving the success rate of downloading the target data and avoiding potential tape-out risks. Furthermore, the data transmission method proposed in this application can be applied to PCIe devices with a DMA controller or PCIe devices without a DMA controller, expanding the scope of application and improving versatility.

[0111] Figure 2 This is a flow chart of the batch transmission method proposed in the embodiment of the present disclosure, based on Figure 1 The embodiment shown, such as 2 pairs Figure 1 Step 104 in the embodiment is further described as follows: Figure 2 As shown, the method includes the following steps: Step 201 : Initialize the batch transfer channel and write the start address and destination address into the address register in the direct memory access (DMA).

[0112] In some embodiments, the bulk transfer channel may be a DMA channel, and the bulk transfer channel is used for the terminal device to transfer target data stored in the host system to the terminal device through the channel.

[0113] In some embodiments, the starting address and the destination address are written into the address register in the DMA, which can be writing the starting address into the source address register in the DMA and writing the destination address into the destination address register in the DMA, so that the terminal device can obtain the target data according to the starting address and the destination address.

[0114] For example, if the boot cmd parameter indicates that the firmware needs to be downloaded using DMA, the CPU on the PCIe device side starts to initialize the DMA channel and writes the firmware's SAR on the host system side and the firmware's destination address DAR into the DMA.

[0115] Step 202 : Obtain target data from a storage location corresponding to a start address in a host memory of a host system through DMA, and write the target data to a storage location corresponding to a destination address in a device memory of a terminal device.

[0116] In some embodiments, the terminal device reads the target data from the host memory through the DMA controller according to the starting address and the destination address, and writes the target data into the device memory, thereby actively obtaining the target data through batch data transmission.

[0117] For example, triggering the DMA controller to start transferring firmware; and polling the DMA controller for the result of the transfer.

[0118] In some embodiments, after the terminal device obtains the target data via DMA, it polls the device swap memory to obtain the result of the data transfer via DMA. Specifically, after the target data transfer is completed, the host system writes a data transfer completion message to the device swap memory, so that the terminal device receives the message and determines that the target data transfer is completed, thereby performing an integrity check on the target data. After the integrity check is successful, the target data is written to the persistent storage medium and the terminal device is switched to a state where the target data is running.

[0119] In the above embodiment, the terminal device actively obtains target data from the host system in a batch transmission manner according to the instruction of the host system, thereby downloading and updating the target data.

[0120] Figure 3 This is a flow chart of the distributed transmission method proposed in the embodiment of the present disclosure, based on Figure 1 The embodiment shown, such as 3 pairs Figure 1 Step 104 in the embodiment is further described as follows: Figure 3 As shown, the method includes the following steps: Step 301: Establish an address mapping relationship between the local address area of ​​the device and the PCI bus address space.

[0121] In some embodiments, when the host system instructs the terminal device to adopt a distributed transmission mode, an address mapping relationship between the device local address area and the PCI bus address space is established. This may be to establish a mapping relationship between the DAR on the terminal device side and the PCI bus address space, that is, a device local address in the device local address area and a PCI bus address in the PCI bus address space have a one-to-one correspondence.

[0122] In some embodiments, the device local address area may be a DAR address area, and the address mapping relationship may be a correspondence between DAR and DAR_PCI.

[0123] For example, if the boot cmd parameter indicates that the host system's CPU mode (non-DMA mode) needs to be selected for firmware download, the CPU on the PCIe device side starts to initialize the ATU and map the address DAR to the PCI address space domain.

[0124] In some embodiments, the terminal device establishes an address mapping relationship between the device local address area and the PCI bus address space, and after completing the address mapping, writes the completion message to the device exchange memory so that the host system can obtain the address mapping completion message by polling the device exchange memory.

[0125] In some embodiments, after writing the address mapping completion message into the device exchange memory, the terminal device may wait for the host system to write the data transmission completion message into the device exchange memory to determine whether to perform an integrity check.

[0126] For example, after the PCIe Device address mapping is completed, the mapping completion information is written into the register in the SWAP area; and polling of the register in the SWAP area is started, waiting for the result of the CPU on the host system side downloading the firmware.

[0127] Step 302: In response to the address mapping relationship being established, a target data packet is obtained from the host system.

[0128] In some embodiments, the target data packet includes a PCI bus address and target data.

[0129] In some embodiments, after the terminal device completes the establishment of the address mapping relationship, the host system determines that the terminal device has completed the establishment of the address mapping relationship by polling the device exchange memory, and then sends the target data packet to the terminal device.

[0130] In some embodiments, the method further includes: the terminal device determining a device local address corresponding to the PCI bus address based on an address mapping relationship; and writing the target data into a storage space corresponding to the device local address.

[0131] In some embodiments, the target data packet may be a MWr TLP, and the TLP includes a PCI bus address and target data, wherein the PCI bus address may be DAR_PCI.

[0132] In some embodiments, based on the address mapping relationship, the terminal device can determine the device local address corresponding to the PCI bus address in the target data packet, thereby writing the target data in the target data packet into the storage space corresponding to the device local address, thereby obtaining the target data in a distributed transmission manner.

[0133] For example, the CPU on the host system side obtains a message indicating that the address mapping is completed by polling the SWAP register; the CPU on the host system side reads data from the SAR on the host system side and writes the data to the destination address DAR_PCI of the firmware.

[0134] For example, after receiving the MWr TLP, the PCIe on the PCIe Device side performs address translation and writes the data with the address DAR_PCI in the TLP into the DAR; the MWr TLP includes the destination address DAR_PCI and the corresponding data to be written. The device side obtains the corresponding destination address DAR through address translation to write the data to be written into the DAR.

[0135] In the above embodiment, the terminal device obtains the target data from the host system in a distributed transmission manner based on the instructions of the host system, thereby successfully downloading the target data and completing the download and update of the firmware without a DMA controller or with a DMA controller that cannot operate normally.

[0136] In summary, the data transmission method proposed in the present disclosure is compatible with PCIe devices with and without DMA controllers, so that the host system can improve the success rate of the terminal device in obtaining the target data by updating the indicated data transmission method and avoid potential tape-out risks.

[0137] The following is a specific implementation of a data transmission method provided by the present disclosure: like Figure 4A As shown in the DMA mode diagram, when the PCIe device has a dedicated DMA controller and is functioning properly, the PCIe link and DMA functions are enabled in the PCIe device's bootrom code. The system waits for the host system's CPU to move the firmware from the file system to the host system's DDR (Double Data Rate) memory. The host system sends an active acquisition command to the PCIe device. The PCIe device uses the DMA controller to move the host-side firmware from the host system's DDR to the PCIe device's DDR / SRAM (Static Random Access Memory).

[0138] like Figure 4B The non-DMA mode is shown in the figure. When the PCIe device does not have a DMA controller or the DMA controller is not working properly, the PCIe link and DMA functions are enabled in the bootrom code of the PCIe device. The host system CPU is waiting to move the firmware from the file system to the DDR on the host system. The host system sends a passive acquisition command to the PCIe device. The CPU on the PCIe device sets up the PCIe controller, re-establishes the address mapping between the PCIe controller and the DDR, and notifies the host CPU if successful. The host CPU then waits for the host CPU to move the firmware from the DDR on the host system to the DDR / SRAM on the PCIe device.

[0139] like Figure 4C The flowchart of a specific implementation of the data transmission method shown includes the following steps: The host system must read the firmware from the file system and write it to a starting address in the host system's DDR (Double Data Rate) memory. This address is assumed to be the SAR. The PCIe device's firmware runs in SRAM or DDR on the PCIe device. During compilation, the firmware requires the link address. This link address and the starting address are assumed to be the DAR.

[0140] 1. Power on the PCIe device and enter the BootROM program. Enter PCIe download mode (default gen4) according to the strap pin. Successfully link up with the host system. Initialize the mapping between the PCIe device BAR (Base Address Register) and the address space of the doorbell and SWAP area registers. 2. The CPU on the PCIe Device side polls the doorbell register and waits for the firmware download command.

[0141] 3. The CPU on the host system side writes the boot cmd (download command) and the parameters required to execute the cmd (download) to the SWAP area register on the PCIe device side through the PCI link; and writes the signal that triggers the execution of the boot cmd to the SWAP area register on the PCIe device side.

[0142] 4. After the CPU on the PCIe device side polls the agreed-upon value, it reads all boot cmd parameters and begins executing the boot cmd. 5. If the boot cmd parameter indicates that DMA is required for firmware download, the CPU on the PCIe device side begins to initialize the DMA channel and writes the firmware's SAR on the host system side and the firmware's destination address DAR to the DMA. It then triggers the DMA controller to start transferring the firmware and polls the DMA controller for the transfer results. 6. If the boot cmd parameter indicates that the host system's CPU mode (non-DMA mode) is required for firmware download, the CPU on the PCIe device side begins initializing the ATU and mapping the address DAR to the PCI address space. 7. After the address mapping is completed, the mapping information is written to the register in the SWAP area. The PCIe Device then starts polling the register in the SWAP area, waiting for the result of the firmware download from the CPU on the host system side. 8. The host system CPU polls the SWAP register to obtain a message indicating that the address mapping is complete. The host system CPU reads data from the SAR register and writes it to the firmware's destination address, DAR_PCI. 9. After receiving the MWr TLP, the PCIe device performs address translation and writes the data at the DAR_PCI address in the TLP into the DAR. The MWr TLP includes the destination address DAR_PCI and the corresponding data to be written. The device performs address translation to obtain the corresponding destination address DAR and writes the data to the DAR. 10. The CPU on the Host System side writes all the firmware to the PCIe Device side and then writes the result to the register in the SWAP area; 11. The CPU on the PCIe device side polls the firmware download result and disables the ATU mapping relationship to protect data. 12. The CPU on the PCIe Device side executes the verification program. If the verification is correct, the CPU jumps to the program and starts executing the firmware program.

[0143] In summary, this embodiment has the following beneficial effects: 1. Added a backup solution for downloading firmware to reduce potential tape-out risks; 2. Compatible with various PCIe devices with or without DMA; 3. Improved the success rate of firmware downloading.

[0144] Figure 5 FIG. 5 is a structural diagram of a data transmission device 500 according to an embodiment of the present disclosure. Figure 5 As shown, the device includes: a transceiver module 510 and a processing module 520.

[0145] The transceiver module 510 is used to receive the first information, which is used to indicate the data transmission mode of the terminal device. The first information includes a first identifier and parameter information corresponding to the first identifier. The data transmission mode includes a batch transmission mode and a distributed transmission mode; the processing module 520 is used to obtain target data from the host system based on the first information.

[0146] In some embodiments, the transceiver module is also used to determine the mapping relationship between the device exchange memory of the terminal device and the host processing unit of the host system based on the data transmission connection between the terminal device and the host system; based on the mapping relationship, detect the device exchange memory according to a preset period to determine the first storage position of the first identifier in the device exchange memory and the second storage position of the parameter information corresponding to the first identifier; read the first identifier from the first storage position, and read the parameter information corresponding to the first identifier from the second storage position.

[0147] In some embodiments, the processing module is also used to determine the target data transmission mode corresponding to the first identifier based on a preset association relationship, and the target data transmission mode is a batch transmission mode or a distributed transmission mode; determine the parameter information corresponding to the target data transmission mode stored in the device exchange memory of the terminal device, and the parameter information includes at least one of the starting address, destination address, data size, and verification information; based on the parameter information, obtain the target data from the host system through the target data transmission mode.

[0148] In some embodiments, the processing module is also used to initialize a batch transfer channel, write the starting address and the destination address into the source address register in the direct memory access DMA; through DMA, obtain the target data from the storage location corresponding to the starting address in the host memory of the host system, and write the target data into the storage location corresponding to the destination address in the device memory of the terminal device.

[0149] In some embodiments, the processing module is further used to establish an address mapping relationship between the device local address area and the PCI bus address space; in response to the completion of the address mapping relationship, a target data packet is obtained from the host system, the target data packet including the PCI bus address and target data.

[0150] In some embodiments, the processing module is further configured to determine a device local address corresponding to the PCI bus address based on the address mapping relationship; and write the target data into a storage space corresponding to the device local address.

[0151] In some embodiments, the transceiver module is used to: receive second information, where the second information is used to indicate the transmission result of the target data; the processing module is also used to detect the device exchange memory according to a preset period, and in response to detecting that the second information indicates that the target data transmission is completed, perform an integrity check on the target data based on the verification information; in response to the integrity check of the target data being successful, write the target data to the persistent storage medium, and switch the state of the terminal device to a state of running the target data.

[0152] In some embodiments, the transceiver module is also used to send third information, which is used to indicate the result of the integrity check; in response to the failure of the integrity check of the target data, fourth information is received, which is used to update the data transmission method, and the fourth information includes the second identifier and parameter information corresponding to the second identifier.

[0153] In the above embodiment, the terminal device can obtain target data from the host system according to the data transmission method indicated by the host system, and the host system can dynamically update the indicated data transmission method, thereby improving the success rate of the terminal device in obtaining the target data, avoiding potential tape-out risks, and expanding the application scope of the data transmission method. It can be applied to terminal devices with a DMA controller and terminal devices without a DMA controller.

[0154] Figure 6 FIG. 6 is a structural diagram of a data transmission device 600 according to an embodiment of the present disclosure. Figure 6 As shown, the device includes: a transceiver module 610 and a processing module 620, The transceiver module is used to send the first information, which is used to indicate the data transmission mode of the terminal device. The first information includes a first identifier and parameter information corresponding to the first identifier. The data transmission mode includes a batch transmission mode and a distributed transmission mode. The first information is used by the terminal device to obtain target data from the host system.

[0155] In some embodiments, the processing module is further configured to determine a mapping relationship between a host processing unit of the host system and a device exchange memory of the terminal device according to a data transmission connection between the host system and the terminal device.

[0156] In some embodiments, the transceiver module is also used to migrate target data from the file system to the host processing unit; based on a preset association relationship, determine a first identifier corresponding to the target data transmission method, and the target data transmission method is a batch transmission method or a distributed transmission method; in response to the completion of the target data migration, based on the mapping relationship, send the first information to the device exchange memory of the terminal device.

[0157] In some embodiments, the transceiver module is further configured to send target data to the terminal device in response to the terminal device completing establishment of an address mapping relationship, where the address mapping relationship represents a relationship between a local device address area of ​​the terminal device and a PCI bus address space.

[0158] In some embodiments, the transceiver module is also used to send a target data packet to a terminal device. The target data packet includes a PCI bus address and target data. The target data packet is used by the terminal device to write the target data into the storage space of the device local address corresponding to the PCI bus address based on the address mapping relationship.

[0159] In some embodiments, the transceiver module is further configured to send second information in response to completion of target data transmission, where the second information is configured to indicate a transmission result of the target data.

[0160] In some embodiments, the transceiver module is also used to receive third information, which is used to indicate the result of the integrity check of the terminal device; in response to the failure of the integrity check of the target data, fourth information is sent, which is used to update the data transmission method of the terminal device, and the fourth information includes the second identifier and parameter information corresponding to the second identifier.

[0161] In the above embodiment, the host system can instruct the terminal device to obtain the data transmission method of the target data by sending an indication message to the terminal device, and update the indicated data transmission method if the terminal device fails to obtain the target data, thereby improving the success rate of the terminal device in obtaining the target data and avoiding potential tape-out risks.

[0162] Figure 7 FIG. 7 is a structural diagram of an electronic device 700 for implementing the above-mentioned data transmission method according to an exemplary embodiment.

[0163] Reference Figure 7 The electronic device 700 may include one or more of the following components: a processing component 702 , a memory 704 , a power component 706 , a multimedia component 708 , an audio component 710 , an input / output (I / O) interface 712 , a sensor component 714 , and a communication component 716 .

[0164] The processing component 702 generally controls the overall operation of the electronic device 700, such as operations associated with display, phone calls, data communications, camera operation, and recording operations. The processing component 702 may include one or more processors 720 to execute instructions to perform all or part of the steps of the above-described method. In addition, the processing component 702 may include one or more modules to facilitate interaction between the processing component 702 and other components. For example, the processing component 702 may include a multimedia module to facilitate interaction between the multimedia component 708 and the processing component 702.

[0165] The memory 704 is configured to store various types of data to support operations on the electronic device 700. Examples of such data include instructions for any application or method operating on the electronic device 700, contact data, phone book data, messages, pictures, videos, etc. The memory 704 can be implemented by any type of volatile or non-volatile storage device, or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk, or optical disk.

[0166] The power supply component 706 provides power to the various components of the electronic device 700. The power supply component 706 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 700.

[0167] The multimedia component 708 includes a screen that provides an output interface between the electronic device 700 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, it may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, slides, and gestures on the touch panel. The touch sensors can detect not only the boundaries of a touch or slide action, but also the duration and pressure associated with the touch or slide action. In some embodiments, the multimedia component 708 includes a front-facing camera and / or a rear-facing camera. When the electronic device 700 is in an operating mode, such as a capture mode or a video mode, the front-facing camera and / or the rear-facing camera can receive external multimedia data. Each front-facing camera and the rear-facing camera can have a fixed optical lens system or have a variable focal length and optical zoom capability.

[0168] The audio component 710 is configured to output and / or input audio signals. For example, the audio component 710 includes a microphone (MIC) that is configured to receive external audio signals when the electronic device 700 is in an operating mode, such as a call mode, a recording mode, or a voice recognition mode. The received audio signals may be further stored in the memory 704 or transmitted via the communication component 716. In some embodiments, the audio component 710 also includes a speaker for outputting audio signals.

[0169] I / O interface 712 provides an interface between processing component 702 and peripheral interface modules, such as a keyboard, click wheel, buttons, etc. These buttons may include but are not limited to: a home button, volume buttons, a start button, and a lock button.

[0170] The sensor assembly 714 includes one or more sensors for providing various aspects of status assessment for the electronic device 700. For example, the sensor assembly 714 can detect the open / closed state of the electronic device 700, the relative positioning of components, such as the display and keypad of the electronic device 700. The sensor assembly 714 can also detect changes in the position of the electronic device 700 or a component of the electronic device 700, the presence or absence of user contact with the electronic device 700, the orientation or acceleration / deceleration of the electronic device 700, and temperature changes of the electronic device 700. The sensor assembly 714 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 714 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 714 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0171] Communication component 716 is configured to facilitate wired or wireless communication between electronic device 700 and other devices. Electronic device 700 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, 4G LTE, 5G NR (New Radio), or a combination thereof. In one exemplary embodiment, communication component 716 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 716 also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.

[0172] In an exemplary embodiment, the electronic device 700 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above methods.

[0173] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 704 including instructions. The instructions can be executed by the processor 720 of the electronic device 700 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0174] The embodiments of the present disclosure further provide a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable a computer to execute the data transmission method described in the above embodiments of the present disclosure.

[0175] An embodiment of the present disclosure further provides a computer program product, including a computer program. The computer program is used by a processor to execute the data transmission method described in the above embodiment of the present disclosure.

[0176] Figure 8 FIG is a schematic structural diagram of a chip 800 for implementing the above-mentioned data transmission method according to an exemplary embodiment. Figure 8 The chip 800 includes at least one communication interface 801 and a processor 802. The communication interface 801 is used to receive signals input into the chip 800 or signals output from the above chip 800. The processor 802 communicates with the communication interface 801 and implements the data transmission method described in the above embodiments of the present disclosure through logic circuits or executing code instructions.

[0177] It should be noted that the terms "first," "second," and the like in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or precedence. It should be understood that the numbers used in this manner are interchangeable where appropriate so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices, systems, and methods consistent with certain aspects of the present disclosure as detailed in the appended claims.

[0178] Throughout this specification, reference to terms such as "one embodiment," "some embodiments," "illustrative embodiments," "examples," "specific examples," or "some examples" means that a specific feature, structure, material, or characteristic described in conjunction with an embodiment or example is included in at least one embodiment or example of the present disclosure. In this specification, the illustrative use of the above terms does not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.

[0179] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present disclosure includes additional implementations in which functions may be performed out of the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present disclosure belong.

[0180] The logic and / or steps represented in the flowcharts or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing the logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (e.g., a computer-based system, a system including a processing module, or other system that can fetch and execute instructions from an instruction execution system, apparatus, or device). For purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transport a program for use by, or in conjunction with, an instruction execution system, apparatus, or device. More specific examples (non-exhaustive list) of computer-readable media include the following: an electrical connection having one or more wires (control method), a portable computer disk cartridge (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and programmable read-only memory (EPROM or flash memory), fiber optic devices, and a portable compact disc read-only memory (CDROM). Furthermore, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or otherwise processing it in a suitable manner if necessary, and then storing it in a computer memory.

[0181] It should be understood that the various parts of the embodiments of the present disclosure can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented using hardware, as in another embodiment, any one of the following technologies known in the art or a combination thereof can be used to implement: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application-specific integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0182] Those skilled in the art will understand that all or part of the steps in the method of the above embodiment can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium. When the program is executed, it includes one or a combination of the steps of the method embodiment.

[0183] In addition, the functional units in the various embodiments of the present disclosure may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into a module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium. The above-mentioned storage medium may be a read-only memory, a magnetic disk, an optical disk, etc.

[0184] Although the embodiments of the present disclosure have been shown and described above, it is understood that the above embodiments are exemplary and are not to be construed as limitations on the present disclosure. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present disclosure.

Claims

1. A data transmission method, characterized in that: The method is executed by a terminal device, and includes: receiving first information, where the first information is used to indicate a data transmission mode of the terminal device, the first information including a first identifier and parameter information corresponding to the first identifier, and the data transmission mode including a batch transmission mode and a distributed transmission mode; The receiving the first information includes: determining a mapping relationship between a device exchange memory of the terminal device and a host processing unit of the host system according to a data transmission connection between the terminal device and the host system; Based on the mapping relationship, detecting the device exchange memory according to a preset period, and determining a first storage location of the first identifier in the device exchange memory and a second storage location of the parameter information corresponding to the first identifier; Reading the first identifier from the first storage location, and reading parameter information corresponding to the first identifier from the second storage location; Target data is acquired from the host system based on the first information.

2. The method according to claim 1, characterized in that The acquiring target data from the host system based on the first information includes: Determining, based on a preset association relationship, a target data transmission mode corresponding to the first identifier, the target data transmission mode being the batch transmission mode or the distributed transmission mode; Determining parameter information corresponding to the target data transmission mode stored in a device exchange memory of the terminal device, the parameter information including at least one of a start address, a destination address, a data size, and verification information; Based on the parameter information, the target data is obtained from the host system through the target data transmission method.

3. The method according to claim 2, characterized in that The target data transmission mode is the batch transmission mode, and obtaining the target data from the host system through the target data transmission mode based on the parameter information includes: Initialize a batch transfer channel and write the start address and the destination address into a source address register in a direct memory access (DMA); The target data is obtained from a storage location corresponding to the start address in the host memory of the host system through the DMA, and the target data is written to a storage location corresponding to the destination address in the device memory of the terminal device.

4. The method according to claim 2, characterized in that The target data transmission mode is the distributed transmission mode, and obtaining the target data from the host system through the target data transmission mode based on the parameter information includes: Establish the address mapping relationship between the device local address area and the PCI bus address space; In response to the address mapping relationship being established, a target data packet is obtained from the host system, where the target data packet includes a PCI bus address and the target data.

5. The method according to claim 4, characterized in that The method further comprises: Determine the local address of the device corresponding to the PCI bus address based on the address mapping relationship; The target data is written into the storage space corresponding to the local address of the device.

6. The method according to claim 3 or 5, characterized in that The method further comprises: receiving second information, where the second information is used to indicate a transmission result of the target data; detecting the device exchange memory according to the preset period, and in response to detecting that the second information indicates that the target data transmission is completed, performing an integrity check on the target data based on the verification information; In response to a success of the integrity check of the target data, the target data is written into a persistent storage medium, and the state of the terminal device is switched to a state of running the target data.

7. The method according to claim 6, characterized in that The method further comprises: Sending third information, where the third information is used to indicate a result of the integrity check; In response to the integrity check of the target data failing, fourth information is received, where the fourth information is used to update the data transmission mode, and the fourth information includes a second identifier and parameter information corresponding to the second identifier.

8. A data transmission method, characterized in that: The method is executed by a host system, and includes: Send first information, the first information is used to indicate the data transmission mode of the terminal device, the first information includes a first identifier and parameter information corresponding to the first identifier, the data transmission mode includes a batch transmission mode and a distributed transmission mode, and the first information is used by the terminal device to obtain target data from the host system.

9. The method according to claim 8, characterized in that The method further comprises: A mapping relationship between a host processing unit of the host system and a device exchange memory of the terminal device is determined according to a data transmission connection between the host system and the terminal device.

10. The method according to claim 9, characterized in that The sending of the first information includes: Migrating the target data from the file system to the host processing unit; Determining, based on a preset association relationship, the first identifier corresponding to a target data transmission mode, where the target data transmission mode is the batch transmission mode or the distributed transmission mode; In response to completion of the target data migration, the first information is sent to the device exchange memory of the terminal device based on the mapping relationship.

11. The method according to claim 10, characterized in that The target data transmission mode is the distributed transmission mode, and the method further includes: In response to the terminal device completing the establishment of the address mapping relationship, the target data is sent to the terminal device, where the address mapping relationship represents the relationship between the device local address area of ​​the terminal device and the PCI bus address space.

12. The method according to claim 11, characterized in that The sending the target data to the terminal device includes: A target data packet is sent to the terminal device, the target data packet including the PCI bus address and the target data, and the target data packet is used by the terminal device to write the target data into the storage space of the device local address corresponding to the PCI bus address based on the address mapping relationship.

13. The method according to claim 11, characterized in that The method further comprises: In response to the target data transmission being completed, second information is sent, where the second information is used to indicate a transmission result of the target data.

14. The method according to claim 8, characterized in that The method further comprises: receiving third information, where the third information is used to indicate a result of the integrity check of the terminal device; In response to the failure of the integrity check of the target data, fourth information is sent, where the fourth information is used to update the data transmission mode of the terminal device, and the fourth information includes the second identifier and parameter information corresponding to the second identifier.

15. A data transmission device, characterized in that: The device includes a transceiver module and a processing module. The transceiver module is used to receive first information, where the first information is used to indicate a data transmission mode of the terminal device, the first information includes a first identifier and parameter information corresponding to the first identifier, and the data transmission mode includes a batch transmission mode and a distributed transmission mode; The transceiver module is used to: determine a mapping relationship between a device exchange memory of the terminal device and a host processing unit of the host system according to a data transmission connection between the terminal device and the host system; Based on the mapping relationship, detecting the device exchange memory according to a preset period, and determining a first storage location of the first identifier in the device exchange memory and a second storage location of the parameter information corresponding to the first identifier; Reading the first identifier from the first storage location, and reading parameter information corresponding to the first identifier from the second storage location; The processing module is configured to obtain target data from the host system based on the first information.

16. The data transmission device according to claim 15, characterized in that The processing module is used for: Determining, based on a preset association relationship, a target data transmission mode corresponding to the first identifier, the target data transmission mode being the batch transmission mode or the distributed transmission mode; Determining parameter information corresponding to the target data transmission mode stored in a device exchange memory of the terminal device, the parameter information including at least one of a start address, a destination address, a data size, and verification information; Based on the parameter information, the target data is obtained from the host system through the target data transmission method.

17. The data transmission device according to claim 16, characterized in that The processing module is used for: Initialize a batch transfer channel and write the start address and the destination address into an address register in a direct memory access (DMA); The target data is obtained from a storage location corresponding to the start address in the host memory of the host system through the DMA, and the target data is written to a storage location corresponding to the destination address in the device memory of the terminal device.

18. The data transmission device according to claim 16, characterized in that The processing module is used for: Establish the address mapping relationship between the device local address area and the PCI bus address space; In response to the address mapping relationship being established, a target data packet is obtained from the host system, where the target data packet includes a PCI bus address and the target data.

19. A data transmission device, characterized in that: The device includes a transceiver module and a processing module. The transceiver module is used to send first information, which is used to indicate the data transmission mode of the terminal device. The first information includes a first identifier and parameter information corresponding to the first identifier. The data transmission mode includes a batch transmission mode and a distributed transmission mode. The first information is used by the terminal device to obtain target data from the host system.

20. The data transmission device according to claim 19, characterized in that The processing module is used for: A mapping relationship between a host processing unit of the host system and a device exchange memory of the terminal device is determined according to a data transmission connection between the terminal device and the host system.

21. The data transmission device according to claim 20, characterized in that The processing module is used for: Migrating the target data from the file system to the host processing unit; Determining, based on a preset association relationship, the first identifier corresponding to a target data transmission mode, where the target data transmission mode is the batch transmission mode or the distributed transmission mode; In response to completion of the target data migration, the first information is sent to the device exchange memory of the terminal device based on the mapping relationship.

22. The data transmission device according to claim 21, characterized in that The transceiver module is used for: In response to the address mapping relationship of the terminal device being established, the target data is sent to the terminal device.

23. The data transmission device according to claim 22, characterized in that The transceiver module is used for: A target data packet is sent to the terminal device, the target data packet including the PCI bus address and the target data, and the target data packet is used by the terminal device to write the target data into the storage space of the device local address corresponding to the PCI bus address based on the address mapping relationship.

24. An electronic device, characterized in that: include: A processor and a memory for storing a computer program that can be run on the processor, wherein the processor performs the method according to any one of claims 1 to 7 or 8 to 14 when running the computer program.

25. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 7 or 8 to 14.

26. A program product, characterized in that The method comprises computer instructions for causing a computer to execute the method of any one of claims 1 to 7 or 8 to 14.

27. A chip, characterized in that: The method comprises at least one processor and a communication interface; the communication interface is used to receive signals input into the chip or signals output from the chip, and the processor communicates with the communication interface and implements the method as described in any one of claims 1 to 7 or 8 to 14 through logic circuits or executing code instructions.

Citation Information

Patent Citations

  • PCIe-based DMA data transmission method and system

    CN106951388A

  • Data transmission method and device, network system and storage medium

    CN113297117A

  • Cross-PCIe domain data transmission method and device, equipment and medium

    CN120234267A

  • Methods and apparatus for DMA engine descriptors for high speed data systems

    US20210124706A1