Data interaction method and device, equipment and medium
By segmenting the boot image file and storing it in batches according to the spatial mapping relationship of the PCIE interface, the problem of address range mismatch when PCIE starts the chip is solved, and flexible storage of boot image files and improved chip startup success rate is achieved.
Patent Information
- Application Number
- CN202310640479.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-31
- Publication Date
- 2024-12-03
AI Technical Summary
When PCIE starts the chip, since the accessibility address range of the sending end does not match the address range of the receiving end, the boot image file storage address is limited, which affects the chip's successful startup.
By segmenting the boot image file and grouping packet processing, a spatial mapping relationship with the data receiving end of the PCIE interface is established, the first mapping space, the second mapping space and the third mapping space are determined, and according to the status fields of these spaces, the The sending packet is stored in batches to the startup program storage space of the receiving end.
It realizes flexible storage of boot image files, reduces the probability of chip startup failure, and ensures that boot image files are not restricted by storage address.
Smart Images

Figure CN119066006A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of PCIE data interaction technology, and in particular to a data interaction method, device, equipment and medium. Background Art
[0002] Before downloading data through the PCIE (Peripheral Component Interconnect Express, a high-speed serial computer expansion bus standard) interface, the boot image file required for the startup chip is stored on the PCIE host computer. In the data download phase, the main task is to transmit the boot image file from the sender to the receiver. The receiver needs to correctly parse and process the received boot image to run the bootloader.
[0003] When there is a mismatch between the sender and receiver addresses, the sender can only access part of the receiver's memory address and cannot access the full range of the receiver's memory address, so that PCIE startup is limited to the address range that the sender can access. Figure 1 It shows a situation where the accessible space range of the transmitter and the actual space of the receiver are mismatched, such as Figure 1 As shown in the figure, the address range that the sender can access is as large as the address space range of the receiver, but because of the address mismatch, the sender can only access part of the address of the receiver's memory. At this time, the sender may not be able to correctly send the boot image to the receiver. Figure 2 It shows another situation where the address range of the sender does not match the actual space of the receiver. The address range that the sender can access is smaller than the actual address space range of the receiver. The sender can only access part of the address of the receiver's memory. At this time, it is also possible that the sender cannot correctly send the bootimage to the receiver. Summary of the invention
[0004] The present invention provides a data interaction method, device, equipment and medium to solve the problem that when a chip is started based on PCIE, the storage address of the boot image file is limited due to the mismatch between the address range accessible by the sending end and the address range of the receiving end, and the problem of affecting the successful startup of the chip.
[0005] According to one aspect of the present invention, a data interaction method is provided, which is executed by a data sending end of a PCIE interface, and includes:
[0006] The boot image file is segmented and packaged to obtain multiple data packets to be sent;
[0007] Establishing a space mapping relationship with a data receiving end of a PCIE interface, and determining a first mapping space, a second mapping space, and a third mapping space in the data receiving end of the PCIE interface;
[0008] According to the first status field in the third mapping space and the second status field in the second mapping space, multiple data packets to be sent are stored in the first mapping space in batches, so that the data receiving end of the PCIE interface transfers the target data packets to be sent in the data packets to be sent stored in the first mapping space in turn to the startup program storage space that has no spatial mapping relationship with the data receiving end of the PCIE interface.
[0009] According to another aspect of the present invention, a data interaction method is provided, which is executed by a data receiving end of a PCIE interface, comprising:
[0010] Establishing a space mapping relationship with the data transmitting end of the PCIE interface, and determining a first mapping space, a second mapping space, and a third mapping space;
[0011] According to the first status field in the third mapping space and the second status field in the second mapping space, the target data packets to be sent in each of the data packets to be sent stored in the first mapping space are transferred in sequence to the startup program storage space that has no spatial mapping relationship with the data receiving end of the PCIE interface.
[0012] According to another aspect of the present invention, there is provided a data interaction device, which is configured at a data transmitting end of a PCIE interface and includes:
[0013] The module for acquiring data packets to be sent is used for segmenting and assembling the boot image file to obtain multiple data packets to be sent;
[0014] A first mapping space determination module, used to establish a space mapping relationship with a data receiving end of the PCIE interface, and determine a first mapping space, a second mapping space, and a third mapping space in the data receiving end of the PCIE interface;
[0015] The data batch storage module is used to store multiple data packets to be sent in batches to the first mapping space according to the first status field in the third mapping space and the second status field in the second mapping space, so that the data receiving end of the PCIE interface transfers the target data packets to be sent in the data packets to be sent stored in the first mapping space in turn to the startup program storage space that has no space mapping relationship with the data receiving end of the PCIE interface.
[0016] According to another aspect of the present invention, there is provided a data interaction device, which is configured at a data receiving end of a PCIE interface and includes:
[0017] A second mapping space determination module, used to establish a space mapping relationship with the data sending end of the PCIE interface, and determine the first mapping space, the second mapping space and the third mapping space;
[0018] The data transfer module is used to transfer the target data packets to be sent in the data packets to be sent stored in the first mapping space one by one according to the first status field in the third mapping space and the second status field in the second mapping space, and to the startup program storage space which has no space mapping relationship with the data receiving end of the PCIE interface.
[0019] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0020] at least one processor; and
[0021] a memory communicatively connected to the at least one processor; wherein,
[0022] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the data interaction method performed by the data sending end of the PCIE interface or the data interaction method performed by the data receiving end of the PCIE interface described in any embodiment of the present invention.
[0023] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the data interaction method performed by a data sending end of a PCIE interface, or the data interaction method performed by a data receiving end of a PCIE interface, as described in any embodiment of the present invention when executed.
[0024] The technical solution of the embodiment of the present invention is to obtain multiple data packets to be sent by dividing and grouping the boot image file, thereby establishing a spatial mapping relationship with the data receiving end of the PCIE interface, determining the first mapping space, the second mapping space and the third mapping space in the data receiving end of the PCIE interface, and then storing the multiple data packets to be sent in the first mapping space in batches according to the first status field in the third mapping space and the second status field in the second mapping space, so that the data receiving end of the PCIE interface transfers the target data packets to be sent in the data packets to be sent stored in the first mapping space in turn to the boot program storage space that does not have a spatial mapping relationship with the data receiving end of the PCIE interface. The data receiving end of the PCIE interface of this solution determines the data interaction state of the opposite end by accessing the first mapping space, the second mapping space and the third mapping space, and transfers the multiple data packets to be sent to the inaccessible boot program storage space, which solves the problem that the boot image file storage address is limited and the chip is successfully started due to the mismatch between the address range accessible to the sending end and the address range of the receiving end when starting the chip based on PCIE, and enables the boot image file to be free from the storage address restriction, realize flexible storage, and reduce the probability of chip startup failure.
[0025] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0027] Figure 1 It is a schematic diagram of a mismatch between a sending end address range and a receiving end actual space provided in the background technology of the present invention;
[0028] Figure 2 It is a schematic diagram of another mismatch between the address range of the sending end and the actual space of the receiving end provided in the background technology of the present invention;
[0029] Figure 3 A flowchart of a data interaction method performed by a data transmitting end of a PCIE interface provided in Embodiment 1 of the present invention;
[0030] Figure 4A flowchart of a data interaction method performed by a data transmitting end of a PCIE interface provided in Embodiment 2 of the present invention;
[0031] Figure 5 A flowchart of a data interaction method performed by a data receiving end of a PCIE interface provided in Embodiment 3 of the present invention;
[0032] Figure 6 A schematic diagram of the interaction process between a transmitting end of a PCIE interface and a receiving end of a PCIE interface when transmitting a round of data packets provided in a fourth embodiment of the present invention;
[0033] Figure 7 The fourth embodiment of the present invention provides a PCIE interface transmitting end and a PCIE interface receiving end, respectively, executing the process;
[0034] Figure 8 A schematic diagram of a boot image file segmentation result provided in the fourth embodiment of the present invention;
[0035] Fig. 9 A schematic diagram of another boot image file segmentation result provided in the fourth embodiment of the present invention;
[0036] Fig.10 A schematic diagram of another boot image file segmentation result provided in the fourth embodiment of the present invention;
[0037] Fig.11 A schematic diagram of another boot image file segmentation result provided in the fourth embodiment of the present invention;
[0038] Fig.12 A structural schematic diagram of a data interaction device configured at a data transmitting end of a PCIE interface provided in a fifth embodiment of the present invention;
[0039] Fig.13 A structural schematic diagram of a data interaction device configured at a data receiving end of a PCIE interface provided in a sixth embodiment of the present invention;
[0040] Fig.14 A schematic diagram of the structure of an electronic device that can be used to implement an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0041] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0042] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0043] Embodiment 1
[0044] Figure 3 The flowchart of a data interaction method performed by a data transmitting end of a PCIE interface is provided in the first embodiment of the present invention. This embodiment is applicable to the case where a data transmitting end of a PCIE interface starts downloading a SOC program. The method can be performed by a data interaction device, which can be implemented in the form of hardware and / or software, and can be integrated in an electronic device. Figure 3 As shown, the method includes:
[0045] Step 110: Segment and package the boot image file to obtain multiple data packets to be sent.
[0046] The boot image file may be a file for installing a boot boot. The segmentation and packetization process may be used to segment data into data blocks. The data packet to be sent may be a data packet obtained after segmenting and packetizing the boot image file, and needs to be sent to the data receiving end of the PCIE interface so that the data receiving end of the PCIE interface starts the SOC.
[0047] In the embodiment of the present invention, after power-on initialization, the data sending end of the PCIE interface can obtain the boot image file, and segment and group the boot image file to obtain multiple data packets to be sent, and the number of bytes of different data packets to be sent can be different.
[0048] Step 120: Establish a space mapping relationship with the data receiving end of the PCIE interface, and determine a first mapping space, a second mapping space, and a third mapping space in the data receiving end of the PCIE interface.
[0049] Among them, the data receiving end of the PCIE interface can be the opposite end that interacts with the data sending end of the PCIE interface. The first mapping space can be the space for storing the data packet to be sent in the data receiving end of the PCIE interface. The second mapping space can be the space for storing the packet end identifier in the data receiving end of the PCIE interface. The third mapping space can be the space for storing the reception identification field in the data receiving end of the PCIE interface. The reception identification field can be a field written into the third mapping space when the data receiving end of the PCIE interface needs to obtain the data of the data sending end of the PCIE interface, and is used to notify the data sending end of the PCIE interface that the data packet to be sent can be written into the first mapping space.
[0050] In an embodiment of the present invention, after obtaining multiple data packets to be sent, the data sending end of the PCIE interface can further establish a space mapping relationship with the data receiving end of the PCIE interface, and determine the first mapping space, the second mapping space, and the third mapping space with access rights in the data receiving end of the PCIE interface.
[0051] Step 130: According to the first status field in the third mapping space and the second status field in the second mapping space, multiple data packets to be sent are stored in the first mapping space in batches, so that the data receiving end of the PCIE interface transfers the target data packets to be sent in the data packets to be sent stored in the first mapping space in turn to the startup program storage space that has no space mapping relationship with the data receiving end of the PCIE interface.
[0052] The first status field may be a field written by the data receiving end of the PCIE interface, indicating that the data transmitting end of the PCIE interface performs a write operation, and the data transmitting end of the PCIE interface may be updated. The second status field may be a field indicating whether the data receiving end of the PCIE interface has completed reading the data packet to be sent. The target data packet to be sent may be a data packet in the data packet to be sent except for the header file of the boot image file. The boot program storage space may be a space in the data receiving end of the PCIE interface for storing the target data packet to be sent.
[0053] In an embodiment of the present invention, the data transmitting end of the PCIE interface can determine the data reading requirements of the data receiving end of the PCIE interface according to the first status field in the third mapping space, that is, whether it is necessary to read the current data packet to be sent written by the data transmitting end of the PCIE interface in the first mapping space, and can also determine the completion of the data reading by the data receiving end of the PCIE interface according to the second status field in the second mapping space, that is, whether the data receiving end of the PCIE interface has completed the reading of the current data packet to be sent written by the data transmitting end of the PCIE interface in the first mapping space. Therefore, the data transmitting end of the PCIE interface can determine the data interaction status of the data receiving end of the PCIE interface based on the first status field in the third mapping space and the second status field in the second mapping space, so that when the new data packet to be sent is written, multiple data packets to be sent can be stored in the first mapping space in batches in accordance with the segmentation order of the data packets to be sent, one data packet to be sent at a time.
[0054] The data receiving end of the PCIE interface can transfer the target data packet to be sent in the data packet to be sent stored by the data sending end of the PCIE interface in the first mapping space each time, in accordance with the writing order of the data packets in the first mapping space by the data sending end of the PCIE interface, to the startup program storage space that has no spatial mapping relationship with the data receiving end of the PCIE interface (i.e., the space that is inaccessible to the data sending end of the PCIE interface), or, the startup program storage space that has a spatial mapping relationship with the data receiving end of the PCIE interface (i.e., the space that is accessible to the data sending end of the PCIE interface), where there is no space for storing the target data packet to be sent by the data receiving end of the PCIE interface, and the data sending end of the PCIE interface cannot access it, resulting in the problem of program startup failure.
[0055] The technical solution of the embodiment of the present invention is to obtain multiple data packets to be sent by dividing and grouping the boot image file, thereby establishing a spatial mapping relationship with the data receiving end of the PCIE interface, determining the first mapping space, the second mapping space and the third mapping space in the data receiving end of the PCIE interface, and then storing the multiple data packets to be sent in the first mapping space in batches according to the first status field in the third mapping space and the second status field in the second mapping space, so that the data receiving end of the PCIE interface transfers the target data packets to be sent in the data packets to be sent stored in the first mapping space in turn to the boot program storage space that does not have a spatial mapping relationship with the data receiving end of the PCIE interface. The data receiving end of the PCIE interface of this solution determines the data interaction state of the opposite end by accessing the first mapping space, the second mapping space and the third mapping space, and transfers the multiple data packets to be sent to the inaccessible boot program storage space, which solves the problem that the boot image file storage address is limited and the chip is successfully started due to the mismatch between the address range accessible to the sending end and the address range of the receiving end when starting the chip based on PCIE, and enables the boot image file to be free from the storage address restriction, realize flexible storage, and reduce the probability of chip startup failure.
[0056] Embodiment 2
[0057] Figure 4 The flowchart of a data interaction method performed by a data transmitting end of a PCIE interface provided in the second embodiment of the present invention is a specific embodiment based on the above embodiment, and provides a specific optional implementation method of segmenting and grouping a boot image file to obtain multiple data packets to be sent. Figure 4 As shown, the method includes:
[0058] Step 210: Obtain the number of bytes of the header file of the boot image file.
[0059] The number of bytes of the header file may be the number of bytes of the header file of the boot image file.
[0060] In the embodiment of the present invention, the data sending end of the PCIE interface can parse the boot image file to determine the number of header file bytes of the header file in the boot image file.
[0061] Step 220 : According to the number of bytes of the header file of the boot image file, starting with the header file of the boot image file, the boot image file is segmented and packaged to obtain a plurality of data packets to be sent.
[0062] In an embodiment of the present invention, the data transmitting end of the PCIE interface can use the header file of the boot image file as the starting segmentation position for segmentation and packet assembly processing, thereby dividing the boot image file into blocks according to the number of bytes in the header file to obtain multiple data packets to be sent.
[0063] In an optional embodiment of the present invention, the boot image file is divided and packaged according to the number of bytes of the header file of the boot image file and starting with the header file of the boot image file to obtain multiple data packets to be sent, which may include: according to the number of bytes of the header file of the boot image file and starting with the header file of the boot image file, the boot image file is divided and packaged; when the total number of bytes of the boot image file is an integer multiple of the number of bytes of the header file, multiple data packets to be sent whose byte number is the number of bytes of the header file are obtained; when the total number of bytes of the boot image file is not an integer multiple of the number of bytes of the header file, multiple preceding data packets to be sent whose byte number is the number of bytes of the header file and a target data to be processed whose byte number is less than the number of bytes of the header file are obtained, and multiple data packets to be sent are determined according to the multiple preceding data packets to be sent and the target data to be processed.
[0064] The preceding data packet to be sent may be a data packet to be sent having a byte number equal to the byte number of the header file obtained after segmentation and packet assembly when the total byte number of the boot image file is not an integer multiple of the byte number of the header file. The target data to be processed may be the remaining data in the boot image file except for all the first data packets to be sent when the total byte number of the boot image file is not an integer multiple of the byte number of the header file.
[0065] In an embodiment of the present invention, when the boot image file is segmented and packaged according to the header file byte number from the header file of the boot image file, if the total byte number of the boot image file is an integer multiple of the header file byte number, the byte number of the data block obtained by the segmentation and package processing is the header file byte number, and the obtained data packet is used as the data packet to be sent, thereby obtaining multiple data packets to be sent. If the total byte number of the boot image file is not an integer multiple of the header file byte number, the data packet whose byte number is the header file byte number obtained by the segmentation and package processing is the preceding data packet to be sent, and the number of bytes of the remaining target data to be processed is less than the header file byte number, the target data to be processed can be padded according to the header file byte number as the last data packet to be sent, or the target data to be processed can be directly used as the last data packet to be sent, and the preceding data packet to be sent and the data packet to be sent determined according to the target data to be processed are further used to form all the data packets to be sent.
[0066] Step 230: Establish a space mapping relationship with the data receiving end of the PCIE interface, and determine a first mapping space, a second mapping space, and a third mapping space in the data receiving end of the PCIE interface.
[0067] Step 240, according to the first status field in the third mapping space and the second status field in the second mapping space, multiple data packets to be sent are stored in the first mapping space in batches, so that the data receiving end of the PCIE interface transfers the target data packets to be sent in the data packets to be sent stored in the first mapping space in turn to the startup program storage space that has no space mapping relationship with the data receiving end of the PCIE interface.
[0068] In an optional embodiment of the present invention, according to the first status field in the third mapping space and the second status field in the second mapping space, multiple data packets to be sent are stored in the first mapping space in batches, which can include: when the first status field in the third mapping space is read as a receiving identification field, the first status field in the third mapping space is updated to a non-receiving identification field, and the current data packet to be sent is written into the first mapping space; the packet end identification is written into the second mapping space; when the second status field in the second mapping space is read and updated to a non-packet end identification field, and the first status field in the third mapping space is updated to a receiving identification field, the current data packet to be sent is updated; return to execute the operation of updating the first status field in the third mapping space to a non-receiving identification field and writing the current data packet to be sent into the first mapping space when the first status field in the third mapping space is read as a receiving identification field, until all data packets to be sent have been written into the first mapping space.
[0069] Among them, the receiving identification field can be a field that indicates that the data sending end of the PCIE interface performs a write operation. The non-receiving identification field can be a field written to the third mapping space after the data sending end of the PCIE interface reads the receiving identification field, which is used to update the first status field. The packet end identification can be a field written to the second mapping space by the data sending end of the PCIE interface, that is, the second status field is the packet end identification at this time. The non-packet end identification can be a field written to the second mapping space after the data receiving end of the PCIE interface reads the current data packet to be sent written by the data sending end of the PCIE interface in the first mapping space, which is used to update the second status field, indicating that the data receiving end of the PCIE interface has completed reading the current data packet to be sent.
[0070] In an embodiment of the present invention, when the data sending end of the PCIE interface reads the first status field of the third mapping space as a receiving identification field, the first status field in the third mapping space can be updated to a non-receiving identification field, indicating that a message that the data receiving end of the PCIE interface has successfully received the data read, thereby determining the current data packet to be sent, thereby writing the current data packet to be sent into the first mapping space, and writing the packet end identifier into the second mapping space.
[0071] The data receiving end of the PCIE interface reads the packet end identifier stored in the second mapping space, determines that the data sending end of the PCIE interface has completed writing the current data packet to be sent, and updates the second status field in the second mapping space to a non-packet end identifier, and transfers it to the startup program storage space, and then further updates the first status field of the third mapping space to a reception identification field. When the data sending end of the PCIE interface reads that the second status field in the second mapping space is updated to a non-packet end identifier, and the first status field of the third mapping space is updated to a reception identification field, the current data packet to be sent is updated, and returns to execute the operation of updating the first status field in the third mapping space to a non-reception identification field and writing the current data packet to be sent into the first mapping space when the first status field of the third mapping space is read as a reception identification field, until all the data packets to be sent have been written into the first mapping space.
[0072] The technical solution of the embodiment of the present invention obtains the number of bytes of the header file of the boot image file, and then divides and packages the boot image file according to the number of bytes of the header file of the boot image file, starting with the header file of the boot image file, to obtain multiple data packets to be sent, and then establishes a space mapping relationship with the data receiving end of the PCIE interface, determines the first mapping space, the second mapping space and the third mapping space in the data receiving end of the PCIE interface, and further stores the multiple data packets to be sent in the first mapping space in batches according to the first status field in the third mapping space and the second status field in the second mapping space, so that the data receiving end of the PCIE interface sequentially transfers the target data packets to be sent in the data packets to be sent stored in the first mapping space each time to the startup program storage space that does not have a space mapping relationship with the data receiving end of the PCIE interface.
[0073] The data receiving end of the PCIE interface of the present solution determines the data interaction status of the other end by accessing the first mapping space, the second mapping space and the third mapping space, and transfers multiple data packets to be sent to the inaccessible startup program storage space, thereby solving the problem that when starting a chip based on PCIE, the storage address of the boot image file is limited due to the mismatch between the address range accessible to the sending end and the address range of the receiving end, and the problem that the successful startup of the chip is affected. The boot image file is not restricted by the storage address, and flexible storage is achieved, thereby reducing the probability of chip startup failure.
[0074] Embodiment 3
[0075] Figure 5The flowchart of a data interaction method performed by a data receiving end of a PCIE interface is provided in the third embodiment of the present invention. This embodiment is applicable to the case where a data receiving end of a PCIE interface starts downloading a SOC program. The method can be performed by a data interaction device, which can be implemented in the form of hardware and / or software, and the data interaction device can be integrated in an electronic device. Figure 5 As shown, the method includes:
[0076] Step 310: Establish a space mapping relationship with the data sending end of the PCIE interface, and determine a first mapping space, a second mapping space, and a third mapping space.
[0077] In an embodiment of the present invention, after power-on initialization, the data receiving end of the PCIE interface can establish a space mapping relationship with the data sending end of the PCIE interface, and determine the first mapping space, the second mapping space and the third mapping space that the data sending end of the PCIE interface can access.
[0078] Step 320: According to the first status field in the third mapping space and the second status field in the second mapping space, the target data packets to be sent in the data packets to be sent stored in the first mapping space are transferred in sequence to the startup program storage space that has no spatial mapping relationship with the data receiving end of the PCIE interface.
[0079] In an embodiment of the present invention, the data receiving end of the PCIE interface can send a data read request to the data sending end of the PCIE interface according to the first status field in the third mapping space, and determine whether the data sending end of the PCIE interface has received the data read request, and can also determine the reading status of a data packet to be sent according to the second status field in the second mapping space. Therefore, the data receiving end of the PCIE interface can determine the data interaction status with the data sending end of the PCIE interface based on the first status field in the third mapping space and the second status field in the second mapping space, so that according to the order in which the data sending end of the PCIE interface writes the data packets to be sent in the first mapping space, the target data packets to be sent in the data packets to be sent stored in the first mapping space for each time are sequentially transferred to the startup program storage space that has no space mapping relationship with the data receiving end of the PCIE interface.
[0080] In an optional embodiment of the present invention, according to the first status field in the third mapping space and the second status field in the second mapping space, the target data packets to be sent in the data packets to be sent stored in the first mapping space for each time are sequentially transferred to the startup program storage space that has no spatial mapping relationship with the data receiving end of the PCIE interface, which can include: writing the receiving identification field into the third mapping space to make the first status field a receiving identification field; updating the first status field to a non-receiving identification field at the data sending end of the PCIE interface, and writing the current data packet to be sent into the first mapping space, and after writing the packet end identification into the second mapping space, reading the current data packet to be sent; if the current data packet to be sent is the target data packet to be sent, transferring the current data packet to be sent to the startup program storage space, and returning to execute the operation of writing the receiving identification field into the third mapping space until the storage of each target data packet to be sent is completed.
[0081] In an embodiment of the present invention, when there is a data reading demand at the data receiving end of the PCIE interface, the receiving identification field can be written into the third mapping space, so that the first state field is the receiving identification field. After the data sending end of the PCIE interface reads that the first state field in the third mapping space is the receiving identification field, the first state field is updated to a non-receiving identification field, and the current data packet to be sent is written into the first mapping space, and the packet end mark is written into the second mapping space, the data receiving end of the PCIE interface can read the current data packet to be sent in the first mapping space, and then read the packet end mark in the second mapping space, and update the second state field in the second mapping space to a non-packet end mark. If the current data packet to be sent is the target data packet to be sent, the data packet to be sent is transferred to the startup program storage space, and the operation of writing the receiving identification field into the third mapping space is returned to execute until the storage of each target data packet to be sent is completed.
[0082] In an optional embodiment of the present invention, before the target data packet to be sent in each data packet to be sent stored in the first mapping space is sequentially transferred to the startup program storage space that has no spatial mapping relationship with the data receiving end of the PCIE interface, it can also include: when the current data packet to be sent stored in the first mapping space is a header file, determining that the current data packet to be sent is a non-target data packet to be sent; parsing the header file to determine the startup program storage space.
[0083] The non-target data packet to be sent may be a data block that does not need to be stored in the boot program storage space, that is, a header file in the boot image file.
[0084] In an embodiment of the present invention, when the data receiving end of the PCIE interface writes the receiving identification field into the third mapping space for the first time, so that the first state field is the receiving identification field, the data sending end of the PCIE interface reads that the first state field is the receiving identification field, and then updates the first state field to the non-receiving identification field, and then writes the header file of the boot image file as the current data packet to be sent into the first mapping space, and writes the packet end mark into the second mapping space. When the data receiving end of the PCIE interface reads the current data packet to be sent, and reads the packet end mark, it proves that the data sending end of the PCIE interface has successfully written the header file, and can parse the header file to determine the startup program storage space and the total number of data packets to be sent (it can be determined whether the storage of each target data packet to be sent is completed) and other parameters, and can also write the non-packet end mark into the second state field, and further return to the operation of writing the receiving identification field into the third mapping space.
[0085] The technical solution of the embodiment of the present invention determines the first mapping space, the second mapping space and the third mapping space by establishing a spatial mapping relationship with the data sending end of the PCIE interface, and then according to the first status field in the third mapping space and the second status field in the second mapping space, the target data packets to be sent in the data packets to be sent stored in the first mapping space are sequentially transferred to the boot program storage space that does not have a spatial mapping relationship with the data receiving end of the PCIE interface. The data receiving end of the PCIE interface of this solution determines the data interaction state of the other end by accessing the first mapping space, the second mapping space and the third mapping space, and transfers multiple data packets to be sent to the inaccessible boot program storage space, which solves the problem that the boot image file storage address is limited and the chip is affected when the chip is started based on PCIE due to the mismatch between the address range accessible to the sending end and the address range of the receiving end, and the problem that the boot image file is not limited by the storage address, and the probability of chip startup failure is reduced.
[0086] Embodiment 4
[0087] Embodiment 4 of the present invention provides a specific embodiment of a data interaction method, and its specific implementation method can refer to the following embodiments. Among them, technical terms that are the same as or corresponding to the above embodiments are not repeated here.
[0088] In this embodiment, the first mapping space is abbreviated as spaceA, the second mapping space is abbreviated as spaceB, the third mapping space is abbreviated as spaceC, and the startup program storage space is abbreviated as spaceD.
[0089] The properties of spaceA, spaceB, spaceC, and spaceD memory spaces are as follows: 1) Due to the spatial mapping configuration of PCIE, spaceA / spaceB / spaceC are the mapping spaces of the PCIE interface transmitter and the PCIE interface receiver, and both the PCIE interface transmitter and the PCIE interface receiver can read and write; 2) The size of spaceA+spaceB is equal to the size of a bootimage data packet (data packet to be sent), and both the PCIE interface transmitter and the PCIE interface receiver can read and write. According to actual applications, the PCIE interface transmitter only writes to spaceA / spaceB but does not read, and the PCIE interface receiver only reads spaceA but does not write, and reads and writes spaceB; 3) Whether spaceA / spaceB is a continuous address depends on the application solution, whether the data packet to be sent and the packet end mark are written to the PCIE interface receiver as a data packet at one time. If it is written to the PCIE interface receiver at one time, spaceA / spaceB must be a continuous address. If the data packet to be sent and the packet end mark are written to the receiver twice in succession, there is no requirement for whether the addresses of spaceA / spaceB are continuous; 4) The size of spaceC can be customized. According to the actual application, the sending end of the PCIE interface can both read and write spaceC, and the receiving end of the PCIE interface can only write but not read spaceC; 5) spaceD may not be the mapping space of PCIE, and is used for reading and writing at the receiving end of the PCIE interface in actual applications; 6) The mapping range of the sending end and the receiving end of the PCIE interface is greater than spaceA+spaceB+spaceC. It is necessary to ensure that spaceA / spaceB / spaceC are all within the mapping range.
[0090] The functions of spaceA, spaceB, spaceC, and spaceD memory spaces: 1) spaceA: used to store the bootloader part in each data packet. After the sending end of the PCIE interface completes writing, it is read out by the receiving end of the PCIE interface; 2) spaceB: used to store the packet end identifier part in each data packet, and the receiving end of the PCIE interface determines whether the reception of the current data packet to be sent has been completed. 3) spaceC: used for status information interaction between the sending end of the PCIE interface and the receiving end of the PCIE interface, and stores the receiving identification field of the receiving end of the PCIE interface. 4) spaceD: The receiving end of the PCIE interface stores the destination address of the bootloader. a) spaceD is also the execution address of the bootloader code; b) The starting address of spaceD depends on the bootloader startup address parameter extracted from the header file; c) The starting address of spaceD will change with the bootloader startup address parameter extracted from the header file.
[0091] The interaction process between the PCIE interface transmitter and the PCIE interface receiver when transmitting a round of data packets is as follows: Figure 6 As shown (in Figure 6The sending end of the PCIE interface is referred to as the sending end, and the receiving end of the PCIE interface is referred to as the receiving end), as follows: step 1: The receiving end of the PCIE interface writes the receiving identification field to spaceC. step 2: The receiving end of the PCIE interface cyclically reads the spaceB space until the packet end mark is read out. step 3: The sending end of the PCIE interface reads spaceC until the receiving identification field is obtained. step 4: The sending end of the PCIE interface writes the non-receiving identification field to spaceC to clear the receiving identification field of spaceC. step 5: The sending end of the PCIE interface writes the data packet to be sent to spaceA / spaceB (depending on the agreed data packetization scheme and whether spaceA / spaceB is a continuous address space, it is determined whether the sending end of the PCIE interface writes the data packet to be sent and the packet end mark to the receiving end spaceA / spaceB area at one time, or writes them into the spaceA and spaceB areas twice respectively), and returns to execute step 3. step6: The receiving end of the PCIE interface reads the packet end marker in spaceB to confirm that the data packet to be sent transmitted by the sending end of the PCIE interface (i.e., boot imageX in the figure) has been received, and then writes a non-packet end marker to spaceB to clear the packet end marker. a) step6-a: If the data in spaceA is a header file, the receiving end of the PCIE interface parses the data and extracts the parameters in the header file. b) step6-b: If the data in spaceA is the target data to be sent, the target data packet to be sent is moved to spaceD in sequence according to the header file, and then returns to step1.
[0092] Before data transmission is completed, the execution process of the PCIE interface transmitter and the PCIE interface receiver is as follows: Figure 7 As shown, in Figure 7 The sending end of the PCIE interface is referred to as the sending end, and the receiving end of the PCIE interface is referred to as the receiving end.
[0093] The workflow of the sending end of the PCIE interface: the sending end is powered on and initialized, and the identification and mapping with the other end are completed; the sending end cyclically reads the spaceC area until the receiving identification field is read, indicating that the receiving end of the PCIE interface is ready to receive data; the sending end of the PCIE interface writes a non-receiving identification field to spaceC to clear the receiving identification field; the sending end of the PCIE interface writes data to the spaceA and spaceB areas (depending on the different agreed data packet assembly schemes, whether spaceA and spaceB are continuous address spaces, to determine whether the sending end of the PCIE interface writes the data packet to be sent and the packet end flag to the receiving end spaceA and spaceB areas of the PCIE interface at one time, or writes them to the spaceA and spaceB areas twice respectively); determine whether all the data packets to be sent have been sent; if the data packets to be sent have not been sent, jump back to the step of cyclically reading the spaceC area at the sending end of the PCIE interface, and continue to read spaceC; if the data packet to be sent has been sent, the sending end of the PCIE interface cyclically reads the spaceC area until the receiving identification field is read, indicating that the receiving end has correctly received the last data packet and the process ends.
[0094] The receiving end workflow of the PCIE interface: the receiving end is powered on and initialized, and the identification and mapping with the other end are completed; the receiving end is ready to receive data, and writes the receiving identification field to the spaceC area, indicating to the sending end of the PCIE interface that the receiving end of the PCIE interface is ready to receive data; the receiving end of the PCIE interface reads the spaceB area cyclically until the packet end mark is read, indicating that the sending end of the PCIE interface has completed the writing of a data packet to be sent. (Depending on the agreed data packetization scheme and whether spaceA and spaceB are continuous address spaces, it is determined whether the sending end writes the data packet to be sent and the packet end mark to the receiving end spaceA and spaceB areas at one time, or writes them to spaceA and spaceB areas twice respectively); the receiving end of the PCIE interface writes a non-packet end mark to the spaceB area to clear the packet end mark in the spaceB area; the receiving end of the PCIE interface determines whether the received data packet to be sent is a header file. If it is a header file, the received header file is parsed to obtain key parameters such as the bootloader size and the bootloader execution address; if it is not a header file, it is bootloader data, and the received data packet to be sent is moved to spaceD. Multiple data packets are arranged in the order in which they are received; the receiving identification field is written to spaceC, indicating to the sending end of the PCIE interface that the receiving end of the PCIE interface is ready to receive data, and also indicating that the previous data packet has been transferred; the receiving end of the PCIE interface determines whether the data reception has been completed based on the parameters in the header file and the amount of data received. If not, jump to the receiving end of the PCIE interface to loop read the operation of the spaceB area. If it has been completed, end the data receiving process.
[0095] The logic of segmentation and packet grouping is to segment the bootimage data into multiple small data packets, add the end symbol packet_end_flag, and pack them into multiple small data packets. The size of the data packet is 2 times the size of the header. N Times (N is an integer), for example, equal to the header length, 2 times, 1 / 2, 1 / 4, etc., so that the receiving end of the PCIE interface can first receive the header file data. An end symbol packet end marker is added to the end of each data packet to form a data packet to be sent. The size and content of the packet end marker can be customized. The size of the data block segmentation depends on the convenience of use on the one hand, and on the mapping range of the sending end and the receiving end of the PCIE interface on the other hand. The size of the data packet should be smaller than the mapping range of the sending end and the receiving end of the PCIE interface.
[0096] The following takes the example of dividing the boot image file into L-sized data packets. For example: Assume that the bootimage is divided into L-sized data packets.
[0097] When the bootimage size is an integer multiple of L, such as Figure 8 In the example, the bootimage is divided into multiple data blocks with L as the size unit, where L is the length of the header file. Figure 8 As can be seen, the first data packet sent by the sender of the PCIE interface (bootimage data packet 0 in the figure) will be the header file + packet end flag (packet_end_flag). The second data packet sent by the sender of the PCIE interface (bootimage data packet 1 in the figure) will be the first L data of the bootloader + packet end flag. And so on, until the last data packet.
[0098] When the size of the bootimage data is not an integer multiple of L, the last data packet is less than L. There are three different packet assembly methods. The three different segmentation methods correspond to different interaction processes between the sender of the PCIE interface and the receiver of the PCIE interface.
[0099] Packetization scheme 1: Add invalid padding data after the last group of data blocks to make the data packet reach L+packet end mark, such as Fig. 9 shown.
[0100] Packetization scheme 2: The last group of data blocks does not have padding data and the packet end marker is placed immediately after the data. The data block is smaller than the size of L + the packet end marker, such as Fig.10 shown.
[0101] Packetization scheme 3: The last group of data blocks does not add padding data and the packet end marker is placed separately, and is sent separately as two groups of data, such as Fig.11 shown.
[0102] The existing PCIE download startup process is as follows: both the sending end and the receiving end are ready for data transmission; the PCIE signals of the sending end and the receiving end complete the interface link; the receiving end notifies the sending end of a data reception preparation message through a message; the sending end sends a bootimage; the receiving end extracts key information through the received header file; the receiving end determines whether the bootimage has been received through the above information; after the receiving end completes the bootimage reception, it sends a completion message to notify the sending end; the sending end receives the reception completion message and ends the data transmission process; the receiving end starts the SOC (System on Chip) through the header file information and the bootloader code.
[0103] This solution implements the communication of the sending and receiving ends of the PCIE interface by only using the memory read-write mode, simplifies the PCIE download startup configuration process, omits the message configuration and debugging of PCIE in the existing solution, that is, omits the sending of data reception preparation message and reception completion message by the data receiving end of the PCIE interface to the data sending end of the PCIE interface, and the sending end of the PCIE interface sends the boot image to the data receiving end of the PCIE interface in the form of a message, realizes the flexible configuration of the bootloader storage address, avoids the bootloader being stored in a non-executable address and causing errors, and also solves the PCIE download startup problem when the mapping range of the read-write space between the opposite ends is smaller than the bootimage. Small mapping space can also complete data transmission and SOC startup, solves the problem that the data sending end of the PCIE interface can only read and write part of the memory space of the data receiving end of the PCIE interface, but the bootloader startup address is in the address space that the sending and receiving end of the PCIE interface cannot read and write, and the startup fails. The scope of application is wider. It is applicable to the case where the data sending end of the PCIE interface is RC and the data receiving end of the PCIE interface is EP, and it is also applicable to the case where both the data sending end of the PCIE interface and the data receiving end of the PCIE interface are EP.
[0104] Embodiment 5
[0105] Fig.12 The structure diagram of a data interaction device configured at a data transmitting end of a PCIE interface provided by Embodiment 5 of the present invention is shown in FIG. Fig.12 As shown, the device includes: a to-be-sent data packet acquisition module 410, a first mapping space determination module 420, and a data sub-storage module 430, wherein:
[0106] The module 410 for acquiring data packets to be sent is used to segment and group the boot image file to obtain a plurality of data packets to be sent;
[0107] A first mapping space determination module 420, configured to establish a space mapping relationship with a data receiving end of the PCIE interface, and determine a first mapping space, a second mapping space, and a third mapping space in the data receiving end of the PCIE interface;
[0108] The data batch storage module 430 is used to store multiple data packets to be sent in batches to the first mapping space according to the first status field in the third mapping space and the second status field in the second mapping space, so that the data receiving end of the PCIE interface can transfer the target data packets to be sent in the data packets to be sent stored in the first mapping space in turn to the startup program storage space that has no space mapping relationship with the data receiving end of the PCIE interface.
[0109] The technical solution of the embodiment of the present invention is to obtain multiple data packets to be sent by dividing and grouping the boot image file, thereby establishing a spatial mapping relationship with the data receiving end of the PCIE interface, determining the first mapping space, the second mapping space and the third mapping space in the data receiving end of the PCIE interface, and then storing the multiple data packets to be sent in the first mapping space in batches according to the first status field in the third mapping space and the second status field in the second mapping space, so that the data receiving end of the PCIE interface transfers the target data packets to be sent in the data packets to be sent stored in the first mapping space in turn to the boot program storage space that does not have a spatial mapping relationship with the data receiving end of the PCIE interface. The data receiving end of the PCIE interface of this solution determines the data interaction state of the opposite end by accessing the first mapping space, the second mapping space and the third mapping space, and transfers the multiple data packets to be sent to the inaccessible boot program storage space, which solves the problem that the boot image file storage address is limited and the chip is successfully started due to the mismatch between the address range accessible to the sending end and the address range of the receiving end when starting the chip based on PCIE, and enables the boot image file to be free from the storage address restriction, realize flexible storage, and reduce the probability of chip startup failure.
[0110] Optionally, the module for acquiring data packets to be sent 410 includes a header file byte number acquisition unit and a data packet to be sent acquisition unit, wherein the file byte number acquisition unit is used to acquire the header file byte number of the boot image file. The data packet to be sent acquisition unit is used to segment and group the boot image file according to the header file byte number of the boot image file and starting with the header file of the boot image file to obtain a plurality of data packets to be sent.
[0111] Optionally, a unit for acquiring data packets to be sent is used to split and group the boot image file according to the number of bytes of the header file of the boot image file and starting from the header file of the boot image file; when the total number of bytes of the boot image file is an integer multiple of the number of bytes of the header file, obtain a plurality of data packets to be sent whose byte number is the number of bytes of the header file; when the total number of bytes of the boot image file is not an integer multiple of the number of bytes of the header file, obtain a plurality of preceding data packets to be sent whose byte number is the number of bytes of the header file and a target data to be processed whose byte number is less than the number of bytes of the header file, and determine a plurality of data packets to be sent based on the plurality of preceding data packets to be sent and the target data to be processed.
[0112] Optionally, the data batch storage module 430 is specifically used to update the first status field in the third mapping space to a non-receiving identification field and write the current data packet to be sent into the first mapping space when the first status field of the third mapping space is read as a receiving identification field; write the packet end identification into the second mapping space; update the current data packet to be sent when the second status field in the second mapping space is read as a non-packet end identification and the first status field of the third mapping space is updated as a receiving identification field; return to execute the operation of updating the first status field in the third mapping space to a non-receiving identification field and writing the current data packet to be sent into the first mapping space when the first status field of the third mapping space is read as a receiving identification field, until all the data packets to be sent have been written into the first mapping space.
[0113] The data interaction device configured at the data sending end of the PCIE interface provided in the embodiment of the present invention can execute the data interaction method performed by the data sending end of the PCIE interface provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0114] Embodiment 6
[0115] Fig.13 This is a structural diagram of a data interaction device configured at a data receiving end of a PCIE interface provided by Embodiment 6 of the present invention. Fig.13 As shown, the device comprises:
[0116] The second mapping space determination module 510 is used to establish a space mapping relationship with the data transmitting end of the PCIE interface, and determine the first mapping space, the second mapping space and the third mapping space;
[0117] The data transfer module 520 is used to transfer the target data packets to be sent in the data packets to be sent stored in the first mapping space in turn to the startup program storage space that has no spatial mapping relationship with the data receiving end of the PCIE interface according to the first status field in the third mapping space and the second status field in the second mapping space.
[0118] The technical solution of the embodiment of the present invention determines the first mapping space, the second mapping space and the third mapping space by establishing a spatial mapping relationship with the data sending end of the PCIE interface, and then according to the first status field in the third mapping space and the second status field in the second mapping space, the target data packets to be sent in the data packets to be sent stored in the first mapping space are sequentially transferred to the boot program storage space that does not have a spatial mapping relationship with the data receiving end of the PCIE interface. The data receiving end of the PCIE interface of this solution determines the data interaction state of the other end by accessing the first mapping space, the second mapping space and the third mapping space, and transfers multiple data packets to be sent to the inaccessible boot program storage space, which solves the problem that the boot image file storage address is limited due to the address range accessible to the sending end being different from the address range of the receiving end when starting the chip based on PCIE, and affects the successful startup of the chip, and enables the boot image file to be free from the storage address restriction, realizes flexible storage, and reduces the probability of chip startup failure.
[0119] Optionally, the data transfer module 520 is used to update the first status field to a non-receiving identification field at the data sending end of the PCIE interface, and write the current data packet to be sent into the first mapping space, write the packet end identification into the second mapping space, and then read the current data packet to be sent; if the current data packet to be sent is a target data packet to be sent, then the current data packet to be sent is transferred to the startup program storage space, and the operation of writing the receiving identification field into the third mapping space is returned to execute until the storage of each of the target data packets to be sent is completed.
[0120] Optionally, the data interaction device also includes a startup program storage space determination module, which is used to determine that the current data packet to be sent is a non-target data packet to be sent when the current data packet to be sent stored in the first mapping space is a header file; and parse the header file to determine the startup program storage space.
[0121] The data interaction device configured at the data receiving end of the PCIE interface provided in the embodiment of the present invention can execute the data interaction method performed by the data receiving end of the PCIE interface provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0122] Embodiment 7
[0123] Fig.14A schematic diagram of an electronic device that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0124] like Fig.14 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0125] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0126] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The processor 11 executes the various methods and processes described above, such as a data interaction method performed by a data transmitting end of a PCIE interface, or a data interaction method performed by a data receiving end of a PCIE interface.
[0127] In some embodiments, the data interaction method performed by the data transmitting end of the PCIE interface, or the data interaction method performed by the data receiving end of the PCIE interface, can be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, the data interaction method performed by the data transmitting end of the PCIE interface, or one or more steps of the data interaction method performed by the data receiving end of the PCIE interface described above can be executed. Alternatively, in other embodiments, the processor 11 can be configured to execute the data interaction method performed by the data transmitting end of the PCIE interface, or the data interaction method performed by the data receiving end of the PCIE interface, by any other appropriate means (for example, by means of firmware).
[0128] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0129] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0130] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0131] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0132] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0133] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0134] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0135] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A data interaction method, characterized in that: Executed by the data sending end of the PCIE interface, including: The boot image file is segmented and packaged to obtain multiple data packets to be sent; Establishing a space mapping relationship with a data receiving end of a PCIE interface, and determining a first mapping space, a second mapping space, and a third mapping space in the data receiving end of the PCIE interface; According to the first status field in the third mapping space and the second status field in the second mapping space, multiple data packets to be sent are stored in the first mapping space in batches, so that the data receiving end of the PCIE interface transfers the target data packets to be sent in the data packets to be sent stored in the first mapping space each time in sequence to the startup program storage space that has no spatial mapping relationship with the data receiving end of the PCIE interface.
2. The method according to claim 1, characterized in that The boot image file is segmented and packaged to obtain multiple data packets to be sent, including: Obtain the number of bytes of the header file of the boot image file; According to the number of bytes of the header file of the boot image file, the boot image file is segmented and packaged starting from the header file of the boot image file to obtain a plurality of data packets to be sent.
3. The method according to claim 2, characterized in that The method of dividing and packaging the boot image file according to the number of bytes of the header file of the boot image file and starting with the header file of the boot image file to obtain a plurality of data packets to be sent includes: According to the number of bytes of the header file of the boot image file, starting with the header file of the boot image file, the boot image file is segmented and packaged; When the total number of bytes of the boot image file is an integer multiple of the number of bytes of the header file, a plurality of data packets to be sent are obtained, the number of bytes of which is the same as the number of bytes of the header file; When the total number of bytes of the boot image file is not an integer multiple of the number of bytes of the header file, a plurality of preceding data packets to be sent whose number of bytes is the same as the number of bytes of the header file and a target data to be processed whose number of bytes is less than the number of bytes of the header file are obtained, and a plurality of the data packets to be sent are determined based on the plurality of preceding data packets to be sent and the target data to be processed.
4. The method according to claim 1, characterized in that: According to the first status field in the third mapping space and the second status field in the second mapping space, storing multiple data packets to be sent in the first mapping space in batches includes: When it is read that the first status field of the third mapping space is a receiving identification field, the first status field in the third mapping space is updated to a non-receiving identification field, and the current data packet to be sent is written into the first mapping space; Writing a packet end marker into the second mapping space; When the second status field in the second mapping space is updated to a non-packet end identifier and the first status field in the third mapping space is updated to a receiving identifier field, the current data packet to be sent is updated; Return to execute the operation of updating the first status field in the third mapping space to a non-receiving identification field when the first status field of the third mapping space is read as a receiving identification field, and writing the current data packet to be sent into the first mapping space until all the data packets to be sent have been written into the first mapping space.
5. A data interaction method, characterized in that: Executed by the data receiving end of the PCIE interface, including: Establishing a space mapping relationship with the data transmitting end of the PCIE interface, and determining a first mapping space, a second mapping space, and a third mapping space; According to the first status field in the third mapping space and the second status field in the second mapping space, the target data packets to be sent in the data packets to be sent stored in the first mapping space are transferred in sequence to the startup program storage space that has no spatial mapping relationship with the data receiving end of the PCIE interface.
6. The method according to claim 5, characterized in that The method of sequentially transferring, according to the first status field in the third mapping space and the second status field in the second mapping space, the target data packets to be sent in the data packets to be sent stored in the first mapping space for each time to the boot program storage space that has no space mapping relationship with the data receiving end of the PCIE interface includes: Writing a receiving identification field into the third mapping space so that the first status field is the receiving identification field; At the data transmitting end of the PCIE interface, the first status field is updated to a non-receiving identification field, and the current data packet to be sent is written into the first mapping space, and the packet end identification is written into the second mapping space, and then the current data packet to be sent is read; If the current data packet to be sent is the target data packet to be sent, the current data packet to be sent is transferred to the startup program storage space, and the operation of writing the receiving identification field to the third mapping space is returned to execute until the storage of each target data packet to be sent is completed.
7. The method according to claim 6, characterized in that Before sequentially transferring the target data packets to be sent among the data packets to be sent stored in the first mapping space to the boot program storage space that has no space mapping relationship with the data receiving end of the PCIE interface, the method further includes: When the current data packet to be sent stored in the first mapping space is a header file, determining that the current data packet to be sent is a non-target data packet to be sent; The header file is parsed to determine the startup program storage space.
8. A data interaction device, characterized in that: The data transmitting end configured on the PCIE interface includes: The module for acquiring data packets to be sent is used for segmenting and assembling the boot image file to obtain multiple data packets to be sent; A first mapping space determination module, used to establish a space mapping relationship with a data receiving end of a PCIE interface, and determine a first mapping space, a second mapping space, and a third mapping space in the data receiving end of the PCIE interface; The data batch storage module is used to store multiple data packets to be sent in batches to the first mapping space according to the first status field in the third mapping space and the second status field in the second mapping space, so that the data receiving end of the PCIE interface transfers the target data packets to be sent in the data packets to be sent stored in the first mapping space in turn to the startup program storage space that has no space mapping relationship with the data receiving end of the PCIE interface.
9. A data interaction device, characterized in that: The data receiving end configured at the PCIE interface includes: A second mapping space determination module, used to establish a space mapping relationship with the data sending end of the PCIE interface, and determine the first mapping space, the second mapping space and the third mapping space; A data transfer module is used to transfer the target data packets to be sent in the data packets to be sent stored in the first mapping space each time to the startup program storage space that has no space mapping relationship with the data receiving end of the PCIE interface according to the first status field in the third mapping space and the second status field in the second mapping space.
10. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the data interaction method performed by the data sending end of the PCIE interface as described in any one of claims 1-4, or the data interaction method performed by the data receiving end of the PCIE interface as described in any one of claims 5-7.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the processor to implement the data interaction method performed by the data sending end of the PCIE interface as described in any one of claims 1-4, or the data interaction method performed by the data receiving end of the PCIE interface as described in any one of claims 5-7.
