Data processing method, device, equipment and storage medium
By directly receiving and filling transaction layer data into the data stream field when the PCIe device communicates with other components in the SoC, the cache consistency problem is solved, the data processing rate and system performance are improved, and the complete conversion of data between different bus protocols is achieved.
Patent Information
- Application Number
- CN202411996868.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2044-12-31
AI Technical Summary
When PCIe devices communicate with other components within the SoC, there are cache consistency issues, which lead to semantic loss due to multiple splits and semantic conversions during data transmission, reducing the data processing rate and system performance.
By receiving the transaction layer data sent by the second device and filling the data into the data stream field according to the preset correspondence between the transaction layer field and the data stream field, complex splitting and semantic conversion are avoided, ensuring the complete conversion of data between different bus protocols.
It improves the data processing rate and system performance, avoids the performance degradation caused by splitting and semantic conversion, and realizes the accurate conversion of data between different bus protocols.
Smart Images

Figure CN119396762B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a data processing method, device, electronic device, and computer-readable storage medium. Background Art
[0002] The PCIe (Peripheral Component Interconnect Express) bus protocol is a high-speed serial computer expansion bus standard used to connect various peripheral devices in a computer. The AXI (Advanced eXtensible Interface) bus protocol is an on-chip bus protocol that supports parallel data transfer between IP cores (Intellectual Property Cores) in a system-on-chip (SoC). The CHI (Coherent Hub Interface) bus protocol is a cache-coherent bus protocol for SoCs.
[0003] Currently, when a PCIe device communicates with other components within an SoC (such as a processor, memory, or other IP cores), the data transmission of the PCIe device may involve cache consistency issues in a multi-core system. For example, data written by a PCIe device may be cached by the processor core. The data written by the PCIe device needs to be converted into AXI transactions through a PCIe-AXI bridge and transmitted on the AXI bus. Then, it needs to be converted into CHI transactions through an AXI-CHI bridge to process cache consistency-related transactions on the CHI bus. In related technologies, since the PCIe-AXI bridge maps PCIe concepts to AXI transactions for splitting and semantic conversion, and the AXI-CHI bridge also splits and semantic conversions to convert AXI transactions into CHI transactions, these two splits and semantic conversions will cause semantic loss, making data control inflexible, reducing the overall data processing rate, and thus leading to performance degradation. Summary of the Invention
[0004] The embodiments of the present application provide a data processing method, device, electronic device, and computer-readable storage medium to solve problems in related technologies.
[0005] In a first aspect, an embodiment of the present application provides a data processing method, which is applied to a first device, wherein the first device uses a first bus protocol transmission mode and a second bus protocol transmission mode for data transmission, and the first bus protocol transmission mode and the second bus protocol transmission mode are different. The method includes:
[0006] receiving transaction layer data sent by a second device, where the transaction layer data includes a plurality of transaction layer fields;
[0007] Determine the data flow field corresponding to each transaction layer field in the transaction layer data according to a preset correspondence between the transaction layer field and the data flow field;
[0008] Filling the data of each transaction layer field in the transaction layer data into the data stream field according to the format of the corresponding data stream field, where the data stream field is a field that is transmitted using the first bus protocol transmission mode;
[0009] Data processing is performed on the data in the data stream field according to the first bus protocol transmission mode and the second bus protocol transmission mode.
[0010] In a second aspect, an embodiment of the present application provides a data processing apparatus, the apparatus being applied to a first device, wherein the first device adopts a first bus protocol transmission mode and a second bus protocol transmission mode for data transmission, the first bus protocol transmission mode and the second bus protocol transmission mode being different, the apparatus comprising:
[0011] a receiving module, configured to receive transaction layer data sent by a second device, wherein the transaction layer data includes multiple transaction layer fields;
[0012] a first determining module, configured to determine, according to a preset correspondence between transaction layer fields and data flow fields, a data flow field corresponding to each transaction layer field in the transaction layer data;
[0013] a first filling module, configured to fill the data of each transaction layer field in the transaction layer data into the data stream field according to the format of the corresponding data stream field, wherein the data stream field is a field transmitted in the first bus protocol transmission mode;
[0014] A processing module is used to process the data in the data stream field according to the first bus protocol transmission mode and the second bus protocol transmission mode.
[0015] In a third aspect, an embodiment of the present application further provides an electronic device, including a processor;
[0016] a memory for storing instructions executable by the processor;
[0017] The processor is configured to execute the instructions to implement the method of the first aspect.
[0018] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, which, when instructions in the computer-readable storage medium are executed by a processor of an electronic device, enables the electronic device to execute the method of the first aspect.
[0019] In an embodiment of the present application, transaction layer data sent by a second device is received, the transaction layer data including multiple transaction layer fields; a data flow field corresponding to each transaction layer field in the transaction layer data is determined according to a preset correspondence between the transaction layer fields and the data flow fields; data of each transaction layer field in the transaction layer data is filled into the data flow field according to the format of the corresponding data flow field, the data flow field being a field transmitted using the first bus protocol transmission mode; and data processing is performed on the data in the data flow field according to the first bus protocol transmission mode and the second bus protocol transmission mode. In this way, the transaction layer data sent by the second device can be directly received, and the data can be filled into the data flow field according to the preset correspondence between the transaction layer fields and the data flow fields, without the need for complex splitting and semantic conversion, thereby avoiding semantic loss caused by splitting and semantic conversion, allowing data to be converted more completely and accurately between different bus protocols, avoiding performance degradation caused by semantic loss, and thus improving the overall data processing rate and system performance.
[0020] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] 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.
[0022] Figure 1 This is a flow chart of a data processing method provided by an embodiment of the present application;
[0023] Figure 2 This is an architectural diagram of data conversion provided by an embodiment of the present application;
[0024] Figure 3 is a block diagram of a data processing device provided in an embodiment of the present application;
[0025] Figure 4is a block diagram of an electronic device provided by an embodiment of the present invention;
[0026] Figure 5 is a block diagram of another electronic device according to another embodiment of the present invention. DETAILED DESCRIPTION
[0027] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0028] The terms "first", "second", etc. in the specification and claims of this application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, the term "and / or" in the specification and claims is used to describe the association relationship of associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. In the embodiments of this application, the term "multiple" refers to two or more, and other quantifiers are similar.
[0029] Before introducing the data processing method, device, electronic device, and storage medium provided by the present disclosure, the application scenarios involved in each embodiment of the present disclosure are first introduced. The present disclosure can be applied to scenarios where the data transmission of PCIe devices involves cache consistency issues in multi-core systems. The data processing method provided by the embodiments of the present disclosure can be applied to a system on chip. The system on chip is a complete electronic system integrated on a single chip. The electronic system may include multiple functional modules, such as a processor, memory, various interfaces, analog circuits, and various digital logic units.
[0030] Currently, when a PCIe device communicates with other components within an SoC (such as a processor, memory, or other IP cores), the data transmission of the PCIe device may involve cache consistency issues in a multi-core system. For example, data written by a PCIe device may be cached by the processor core. The data written by the PCIe device needs to be converted into AXI transactions through a PCIe-AXI bridge and transmitted on the AXI bus. Then, it needs to be converted into CHI transactions through an AXI-CHI bridge to process cache consistency-related transactions on the CHI bus. In related technologies, since the PCIe-AXI bridge maps PCIe concepts to AXI transactions for splitting and semantic conversion, and the AXI-CHI bridge also splits and semantic conversions to convert AXI transactions into CHI transactions, these two splits and semantic conversions will cause semantic loss, making data control inflexible, reducing the overall data processing rate, and thus leading to performance degradation.
[0031] Among them, the PCIe (Peripheral Component Interconnect Express) bus protocol is a high-speed serial computer expansion bus standard used to connect various peripheral devices in a computer. The AXI (Advanced eXtensible Interface) bus protocol is an on-chip bus protocol that supports parallel data transmission between IP cores (Intellectual Property Cores) in a system-on-chip (SoC). The CHI (Coherent Hub Interface) bus protocol is a cache coherent bus protocol used between IP cores in a system-on-chip.
[0032] For example, taking the server's system on chip (SoC) as an example, a high-speed solid-state drive (SSD) connected through the PCIe interface can be used as a PCIe device. The SoC contains multiple processor cores, on-chip memory, and some IP cores for other functions. In addition, the SoC uses the AXI bus and CHI bus to achieve connection and communication between internal components to ensure data transmission and cache consistency and other functions.
[0033] When a high-speed solid-state drive (PCIe device) writes a batch of user data to on-chip memory, it encapsulates this data into individual TLPs (Transaction Layer Packets) according to the PCIe bus protocol and sends them. For example, to write a 10MB data file, the data is split into multiple TLPs and transmitted sequentially. First, the TLPs undergo protocol conversion via a PCIe-AXI bridge to enable transmission over the AXI bus. Information such as the data address and transmission attributes within the TLPs is then broken down and converted into transaction content, such as the write address channel and write data channel, as required by the AXI bus protocol. This process results in semantic loss. The converted AXI transactions are then transmitted over the AXI bus towards the on-chip memory. If the data transfer involves cache coherence in a multi-core system (for example, if the data may subsequently be used by a processor core cache), these AXI transactions require further conversion via the AXI-CHI bridge. Similarly, during this conversion process, some of the original semantic information in the AXI transaction will be lost and not fully retained when converted to a CHI transaction, which may lead to misunderstandings when processing cache consistency later.
[0034] This semantic loss caused by these two splits and semantic conversions results in less flexible data control and a reduction in overall data transfer rates. Each conversion requires time to parse, split, and reassemble data, adding additional processing steps that reduce the amount of data that can be successfully transferred to the on-chip memory per second, thus degrading overall system performance.
[0035] In order to solve the above problems, the present disclosure provides a data processing method, device, electronic device and computer-readable storage medium, which can directly receive transaction layer data sent by a second device, and fill the data into the data stream field through the correspondence between the preset transaction layer field and the data stream field. There is no need for complex splitting and semantic conversion, which can avoid the semantic loss caused by splitting and semantic conversion, so that data can be converted more completely and accurately between different bus protocols, and can avoid performance degradation caused by semantic loss, thereby improving the overall data processing rate and system performance.
[0036] The method provided in the embodiment of the present application is described in detail below through specific embodiments and their application scenarios in conjunction with the accompanying drawings.
[0037] Figure 1 This is a flow chart of a data processing method provided in an embodiment of the present application. Figure 1As shown, the method can be applied to a first device, in which a first bus protocol transmission mode and a second bus protocol transmission mode can be used for data transmission, and the first bus protocol transmission mode and the second bus protocol transmission mode are different.
[0038] For example, the first device may be a system on chip (SoC). The SoC is a complete electronic system integrated on a single chip, which may include multiple functional modules, such as a processor, memory, various interfaces, analog circuits, and various digital logic units. The first bus protocol may include an AXI-Stream (Advanced eXtensible Interface-Stream) bus protocol, which is a stream-based data transmission protocol, and the second bus protocol may include a CHI (Coherent Hub Interface) bus protocol, which is a cache coherent bus protocol for SoCs.
[0039] The method may include the following steps.
[0040] In step S101 , transaction layer data sent by a second device is received.
[0041] The transaction layer data includes multiple transaction layer fields.
[0042] This transaction layer data can include multiple TLPs (Transaction Layer Packets). TLPs are the basic unit of data transmission in the PCIe bus protocol and include various transaction layer fields. First, the TLP header field includes important fields such as the transaction type (indicating whether it is a read, write, or configuration transaction), address information (source or destination address, used to specify the source or destination of the data), data length (indicating the amount of data carried by the TLP), and tags (used to distinguish and track different transactions). In addition to the TLP header field, there is also a data payload field, which contains the actual valid data to be transmitted. For example, in a TLP of a PCIe write transaction, the transaction type field in the TLP header is marked as "write," the address field contains the specific memory address of the data to be written, the data length field specifies the number of bytes to be written, and the actual data in that number of bytes is followed as the payload.
[0043] In this embodiment, the first device can be a system-on-chip device that interacts with data through an AXI bus and a CHI bus. For example, the first device can be multiple components in a system-on-chip SoC, which can include a processor, a memory, or other IP cores, etc. The second device can be a PCIe device that interacts with data through a PCIe bus. For example, the PCIe device can include a PCIe graphics card, a solid-state drive (SSD) with a PCIe interface, and a PCIe network card and other devices.
[0044] In this step, to ensure accurate data reception, the transaction layer data sent by the second device can be received according to the third bus protocol transmission mode that matches the second device. For example, when a PCIe device (such as a PCIe graphics card) sends data to the first device via the PCIe bus, it encapsulates the data into TLPs according to the PCIe bus protocol. The format of these data packets, the transmission order, and the signal encoding are all dictated by the PCIe bus protocol. If the first device does not receive data according to the PCIe bus protocol transmission mode, it may not be able to correctly parse these data packets, resulting in data loss or errors.
[0045] In a possible implementation, the transaction layer data may be stored in the execution queue in a transmission order according to a third bus protocol transmission mode corresponding to the transaction layer data.
[0046] The execution queue is used to store the transaction layer data to be executed.
[0047] First, the bus protocol used by the second device can be determined. This can be accomplished through pre-configured information, device identification, or negotiation during the initial communication phase. For example, in a complex system-on-chip (SoC), devices may perform a handshake at startup to determine the bus protocol type used by each other.
[0048] The first device then adjusts its receiving mode based on the identified bus protocol. If the second device is a PCIe device, the first device must configure its interface to accommodate the parallel data transmission mode of the PCIe bus protocol. The PCIe bus protocol supports serial data transmission between PCIe devices and other components within the SoC (such as processors, memory, or other IP cores) via the PCIe interface IP core. When receiving transaction layer packets, the first device must prepare the corresponding serial data channel to receive the data.
[0049] Next, after correctly configuring the receive mode, the first device can begin receiving transaction layer data. This transaction layer data can include specific data and related control information. For example, in a video processing system, let's assume the second device is an external video capture card connected via a PCIe interface IP core, and the first device is the memory within the SoC. The video capture card encapsulates the captured video data into PCIe transaction layer packets and sends them to the memory. The memory receives these packets according to the PCIe bus protocol transmission mode.
[0050] In step S102, according to a preset correspondence between transaction layer fields and data flow fields, a data flow field corresponding to each transaction layer field in the transaction layer data is determined.
[0051] The data stream field is a field that is transmitted using the first bus protocol transmission mode.
[0052] In some embodiments, the transaction layer field may include a header field and a payload field; the data stream field may include a data field and a control field.
[0053] Optionally, when there is a correspondence between the load field and the data field, the data of the load field is filled into the data field; when there is a correspondence between the header field and the control field, according to the preset identifier correspondence, the preset identifier information that matches the data in the header field is selected from multiple preset identifier information, and the matching preset identifier information is used as the starting identifier of the data in the control field; the preset identifier correspondence includes the correspondence between the preset identifier and the data in the header field, and the preset identifier information is used to represent the identifier used when the data in the header field is transmitted using the third bus protocol transmission mode.
[0054] For example, the header field may include multiple specific bits, and different identifiers on each bit can represent the data content represented by different fields in the transaction layer data. For example, a specific bit (such as the highest bit) can be used to represent the transaction type. For example, the bit can be set to 0 to represent a read operation and to 1 to represent a write operation. Then, based on the preset identifier correspondence, 00 can be selected from multiple preset identifier information (such as 00, 01) as the starting identifier of the corresponding control field. "00" can represent the data transaction type when the AXI-Stream bus is used for data transmission. In addition, when "00" is detected in the data, the data after "00" can be used as data for indicating the transaction type in the AXI-Stream.
[0055] In this step, the various fields included in the transaction layer data can be determined first, and then the data flow field corresponding to each transaction layer field in the transaction layer data can be determined according to the preset correspondence between the transaction layer field and the data flow field.
[0056] Specifically, the transaction layer data may include a variety of fields such as a transaction type field, an address field, a load field, etc., and the data stream field may include a control field, a data field, etc.
[0057] Since the AXI-Stream bus protocol is a stream-based data transmission protocol, in the AXI-Stream bus protocol, although there is no field that is directly identical to the transaction layer field, it can be corresponded by customizing one or more control fields. For example, the control field can include multiple specific bits, and different identifiers on each bit can represent the data content represented by different fields in the transaction layer data. For example, a specific bit (such as the highest bit) can be used to represent the transaction type. If the bit is set to 0, it indicates a read operation, and if it is set to 1, it indicates a write operation. In this way, when converting the TLP into the AXI-Stream data stream, the bit used to indicate the transaction type in the AXI-Stream is set according to the value of the TLP transaction type field.
[0058] The data payload portion of the TLP is the actual valid data to be transmitted. When converting the TLP into an AXI-Stream data stream, the data payload field of the TLP can be directly mapped to the data field of the AXI-Stream.
[0059] Therefore, the transaction type field, address field, etc. in the transaction layer data used to characterize the control fields can be corresponded to the control fields in the data stream field, and the load field in the transaction layer data can be corresponded to the data field in the data stream field.
[0060] In step S103, the data of each transaction layer field in the transaction layer data is filled into the data stream field according to the format of the corresponding data stream field.
[0061] In this step, each transaction layer field is first parsed according to the format specified by the protocol in which the transaction layer data resides (such as the PCIe protocol) to extract the corresponding data values. For example, for a PCIe write transaction TLP, the transaction type field value is read from a specific field in the header (assuming "01" indicates a write transaction). The binary value corresponding to the target memory address (for example, a 32-bit address value) is obtained from the specified address field byte range. The number of data bytes indicated by the data length field is then obtained from the corresponding position. These specific values are then extracted and prepared for filling.
[0062] Then, the data in the transaction layer fields can be filled in according to the previously determined correspondence and the format requirements of the data stream fields. For example, for the transaction type "01" extracted above, the specific position (highest bit) used to represent the transaction type in AXI-Stream is set to "1" according to the convention. For the extracted 32-bit address value, the 32-bit address data is filled in sequentially according to the byte alignment and the format requirements of the data stream field for address storage (such as storage in a specific continuous byte position). For the value of the data length field, it is also converted to a format that conforms to the data length representation method in the data stream field (for example, converted to the number of data blocks) and then filled into the corresponding position.
[0063] During the filling process, Figure 2 The filling process shown needs to strictly follow the established correspondence and format specifications of the data stream fields to ensure that the data of each transaction layer field can be accurately filled into the corresponding data stream field. Only in this way can the correct conversion from the original transaction layer data to the data stream format be achieved, laying the foundation for subsequent data transmission and further processing under the corresponding data stream protocol.
[0064] For example, in a system on a chip, a PCIe device needs to transfer data to the on-chip memory. Through such a padding operation, the PCIe TLP transaction layer data is converted into the AXI-Stream data stream format. Then, the AXI-Stream bus protocol can be used to efficiently transfer the data to the interface module corresponding to the on-chip memory, realizing orderly data flow.
[0065] In step S104, data processing is performed on the data in the data stream field according to the first bus protocol transmission mode and the second bus protocol transmission mode.
[0066] For example, when the transaction layer data is converted into data transmitted using the first bus protocol transmission mode, the converted data transmitted using the first bus protocol transmission mode can be further converted into data transmitted using the second bus protocol transmission mode.
[0067] In some embodiments, the data in the data stream field may first be transmitted to a device that adopts the second bus protocol transmission mode using the first bus protocol transmission mode.
[0068] The second bus protocol can be the AXI-Stream bus protocol, which can transmit data in a streaming manner. It relies primarily on data fields and control fields such as TVALID (indicating whether the data is valid), TREADY (indicating whether the receiving end is ready to receive), and TLAST (indicating whether a frame of data has ended) to ensure orderly and accurate data transmission. The data field carries the actual content to be transmitted. During the conversion process, this data can be transmitted in the form of a data stream to devices that subsequently adopt other protocols.
[0069] For example, taking the video processing system as an example, after the video pre-processing module processes each frame of image data received, it needs to continue to transmit the processed video data to the video encoding module. Here, the AXI-Stream bus protocol can still be used to transmit data, and the transmission is also carried out in an orderly manner in accordance with the above-mentioned control field and data field. However, if the subsequent data transmission involves cache consistency issues in a multi-core system, the module device for the next operation adopts other specific protocols, such as the CHI bus protocol, then it involves the data conversion process from the AXI-Stream bus protocol to the CHI bus protocol. During the conversion, it is necessary to extract the data from the AXI-Stream data stream according to the corresponding rules, and reorganize and encode it according to the format requirements of the new protocol to achieve accurate data flow between different protocols.
[0070] Then, in a device adopting the second bus protocol transmission mode, the data in the received data stream field can be identified according to a data format that matches the third bus protocol transmission mode corresponding to the transaction layer data, so as to obtain the data boundary corresponding to each transaction layer field in the data in the data stream field, and extract the data corresponding to each transaction layer field from the data boundary corresponding to the data in the data stream field.
[0071] Optionally, the preset identification information can be searched for from the data in the data stream field in a data format that matches the third bus protocol transmission mode; then, when the preset identification information is found in the data in the data stream field, the preset identification information can be used as the data boundary corresponding to the header field in the data in the data stream field.
[0072] It should be noted that in the device that adopts the second bus protocol (such as the CHI bus protocol) transmission mode, the reason why the data in the received AXI-Stream data flow field must be identified according to the data format that matches the third bus protocol (such as the PCIe bus protocol) transmission mode is because the data undergoes conversion between different protocols during the entire flow process, but its initial organization and encoding method contains clues for the subsequent accurate restoration of each transaction layer field.
[0073] Specifically, under the PCIe bus protocol, the first byte of each data transaction unit identifies the transaction type (e.g., 00 for a read transaction, 01 for a write transaction, etc.). Subsequent bytes, in a fixed order, encode transaction-layer fields such as address information and data length. Although data appears to be an AXI-Stream data stream after transmission via the AXI-Stream bus protocol, in order to accurately understand the transaction-layer fields originally corresponding to each component, identification is necessary based on this format characteristic of the original third-party bus protocol.
[0074] Optionally, the format information of the third-party bus protocol data can be used to identify data boundary features in the AXI-Stream data stream. For example, if the third-party bus protocol specifies that the beginning and end of a complete data frame are marked by specific byte sequences (such as the beginning is fixed as 0xFF0xFE and the end is fixed as 0xFE0xFF), then these specific byte sequences can be searched byte by byte in the received AXI-Stream data stream to determine the data boundaries corresponding to each complete transaction.
[0075] Furthermore, after determining each data boundary, the scope of each complete data segment is known. The corresponding data can then be extracted according to the layout order and encoding method of the transaction layer fields specified in the third bus protocol. For example, if it is known that in each data unit, the four consecutive bytes starting from the second byte represent the source address field, then within this demarcated data unit, the four bytes of data content starting from the second byte are extracted; this is the data corresponding to the source address transaction layer field. Similarly, other transaction layer fields (such as transaction type, data length, etc.) are also extracted from the data boundaries in sequence according to their fixed byte positions and encoding rules under the third bus protocol.
[0076] Then, target data matching the second bus protocol transmission mode may be generated according to the data corresponding to each transaction layer field.
[0077] Optionally, the data content corresponding to each transaction layer field may be mapped to target data matching the second bus protocol transmission mode according to a data format matching the second bus protocol transmission mode.
[0078] For example, the transaction type and the corresponding operation may be determined first, and then key information may be filled into the target data structure, thereby constructing the complete target data.
[0079] The key information may include address-related information, data length, and other attribute information.
[0080] For example, the specific operation can be determined based on the transaction type data in the transaction layer field extracted from the previous step. For example, if the transaction type field corresponds to a "read" operation, a data structure related to the read transaction must be constructed as the target data according to the CHI bus protocol. If the transaction type is a "write" operation, a target data structure corresponding to the write transaction must be constructed. The address data extracted from the transaction layer field (which can be either the source address or the destination address, depending on whether the transaction type is read or write) must then be processed according to the address format requirements of the CHI bus protocol and populated into the target data structure. Addresses under the CHI bus protocol can involve concepts such as memory address space divisions and cache line addresses. The address information obtained from the original transaction layer must be accurately converted to an address format that complies with the CHI bus protocol. This includes performing address alignment and adding appropriate address tags to ensure that the data can be correctly located or read during subsequent data processing. The data in the transaction layer field representing the data length is converted into the corresponding data volume measurement method under the CHI bus protocol and populated into the corresponding field of the target data structure. In addition, there may be some other attribute information, such as the priority of the transaction (if the original transaction layer has relevant representation), which must also be encoded according to the rules of the CHI bus protocol and added to the target data structure. These attributes will affect the order and method of data processing in the system.
[0081] The first device can then be controlled to process the target data.
[0082] For example, the target data may include a target transaction type, target address information, and target load data; the first device may be controlled to process the target load data at a storage location corresponding to the target address information according to the target transaction type.
[0083] For example, when the target transaction type is a read transaction, the first device (which can be a processor core, cache controller, or other related module) will initiate a read operation based on the target address information to access the corresponding storage location (such as cache or main memory). It will send the target address information to the address bus through the corresponding hardware circuit or software instruction drive, then wait to obtain the data read from the address on the data bus, and fill this data into the location corresponding to the target payload data, completing the read operation.
[0084] In one possible implementation, when the transaction layer data is stored in an execution queue in a transmission order according to a third bus protocol transmission mode corresponding to the transaction layer data, target data matching the second bus protocol transmission mode can be generated in sequence according to the storage order of the transaction layer data to be executed stored in the execution queue and according to the data corresponding to each transaction layer field.
[0085] After generating the target data for the transaction-layer data at the head of the execution queue, the process of extracting field data and generating target data is repeated for the next transaction-layer data item in the queue's storage order. This process is repeated sequentially, ensuring that each transaction-layer data item is sequentially generated into the corresponding target data that conforms to the second bus protocol transmission mode. This allows the entire system to systematically convert data into a format that conforms to the target protocol according to the order in which it was generated, and then hand it off to the appropriate device for subsequent processing, ensuring the consistency and accuracy of the data processing flow.
[0086] In some embodiments, while controlling the first device to process the target data, return data after the data processing can also be obtained from the first device; wherein the target data is data matching the second bus protocol transmission mode generated based on the data corresponding to each transaction layer field; then, according to the data format matching the first bus protocol transmission mode, the return data is mapped to candidate return data matching the first bus protocol transmission mode; and according to the preset correspondence between the transaction layer field and the data stream field, the transaction layer field corresponding to each data stream field in the candidate return data is determined; the data of each data stream field in the candidate return data is filled into the transaction layer field according to the format of the corresponding transaction layer field; finally, the returned transaction layer data can be obtained based on the data in each transaction layer field.
[0087] The returned transaction layer data can be used to provide feedback to the source of the data request, informing it of the results of the data processing. For example, in a scenario where a PCIe device is communicating with a system-on-chip (SoC), the PCIe device initiates a data processing request (corresponding to the initial transaction layer data). After the aforementioned processing, as well as the data processing by the first device, the returned transaction layer data is returned to the PCIe device via the corresponding link. Based on this returned data, the PCIe device can determine whether the data transmission was successful and whether the read data was correct, allowing it to take further action, such as re-initiating the request or continuing with subsequent data processing.
[0088] In this way, after controlling the first device to process the target data, the returned data can be effectively processed and converted so that it can be fed back in a form that conforms to the original transaction layer data format, ensuring the integrity and accuracy of the entire data processing and processing flow in complex situations such as different bus protocol conversions, and facilitating effective information interaction and collaborative work between various parts of the system.
[0089] By adopting the above technical solution, the transaction layer data sent by the second device can be directly received, and the data can be filled into the data stream field through the correspondence between the preset transaction layer field and the data stream field. There is no need for complex splitting and semantic conversion, which can avoid the semantic loss caused by splitting and semantic conversion, so that data can be converted more completely and accurately between different bus protocols, and can avoid performance degradation caused by semantic loss, thereby improving the overall data processing rate and system performance.
[0090] Figure 3 1 is a block diagram of a data processing apparatus provided in an embodiment of the present application. The apparatus is applied to a first device. The first device uses a first bus protocol transmission mode and a second bus protocol transmission mode for data transmission. The first bus protocol transmission mode and the second bus protocol transmission mode are different. The apparatus 200 includes:
[0091] The receiving module 201 is configured to receive transaction layer data sent by a second device, where the transaction layer data includes multiple transaction layer fields.
[0092] A first determining module 202 is configured to determine a data flow field corresponding to each transaction layer field in the transaction layer data according to a preset correspondence between transaction layer fields and data flow fields;
[0093] A first filling module 203 is configured to fill the data of each transaction layer field in the transaction layer data into the data stream field according to the format of the corresponding data stream field, where the data stream field is a field that is transmitted using the first bus protocol transmission mode;
[0094] The processing module 204 is configured to process the data in the data stream field according to the first bus protocol transmission mode and the second bus protocol transmission mode.
[0095] Optionally, the processing module 204 is used to transmit the data in the data stream field to the device adopting the second bus protocol transmission mode using the first bus protocol transmission mode; identify the received data in the data stream field according to the data format matching the third bus protocol transmission mode corresponding to the transaction layer data to obtain the data boundary corresponding to each transaction layer field in the data in the data stream field, and extract the data corresponding to each transaction layer field from the data boundary corresponding to the data in the data stream field; generate target data matching the second bus protocol transmission mode based on the data corresponding to each transaction layer field; and control the first device to perform data processing on the target data.
[0096] Optionally, the transaction layer field includes a header field and a payload field; the data stream field includes a data field and a control field; the first filling module 203 is used to fill the data of the payload field into the data field when there is a correspondence between the payload field and the data field; when there is a correspondence between the header field and the control field, according to the preset identifier correspondence, select the preset identifier information that matches the data in the header field from multiple preset identifier information, and use the matching preset identifier information as the starting identifier of the data in the control field; the preset identifier correspondence includes the correspondence between the preset identifier and the data in the header field, and the preset identifier information is used to represent the identifier used by the data in the header field when the third bus protocol transmission mode is adopted for transmission.
[0097] Optionally, the transaction layer field includes a header field and a payload field; the data in the header field corresponds to preset identification information; the processing module 204 is used to search for the preset identification information from the data in the data stream field in accordance with a data format that matches the third bus protocol transmission mode; when the preset identification information is found from the data in the data stream field, the preset identification information is used as the data boundary corresponding to the header field in the data in the data stream field.
[0098] Optionally, the processing module 204 is configured to map the data content corresponding to each transaction layer field into target data matching the second bus protocol transmission mode according to a data format matching the second bus protocol transmission mode.
[0099] Optionally, the processing module 204 is further used to store the transaction layer data in an execution queue in a transmission order according to a third bus protocol transmission mode corresponding to the transaction layer data, and the execution queue is used to store the transaction layer data to be executed; according to the storage order of the transaction layer data to be executed stored in the execution queue, and according to the data corresponding to each transaction layer field, generate target data matching the second bus protocol transmission mode in sequence.
[0100] Optionally, the device further includes:
[0101] an acquisition module, configured to acquire, from the first device, returned data after the data processing, while controlling the first device to process the target data; the target data being data generated based on the data corresponding to each of the transaction layer fields and matching the second bus protocol transmission mode;
[0102] a mapping module, configured to map the returned data into candidate returned data matching the first bus protocol transmission mode according to a data format matching the first bus protocol transmission mode;
[0103] A second determining module is configured to determine the transaction layer field corresponding to each of the data flow fields in the candidate returned data according to a preset correspondence between the transaction layer field and the data flow field;
[0104] The second filling module is configured to fill the data of each data stream field in the candidate returned data into the transaction layer field according to the format of the corresponding transaction layer field;
[0105] The third determining module is configured to obtain the returned transaction layer data according to the data in each transaction layer field.
[0106] Optionally, the target data includes a target transaction type, target address information, and target load data; the processing module 204 is used to control the first device to process the target load data at a storage location corresponding to the target address information according to the target transaction type.
[0107] In summary, in the embodiments of the present application, the transaction layer data sent by the second device can be directly received, and the data can be filled into the data stream field through the correspondence between the preset transaction layer field and the data stream field. There is no need for complex splitting and semantic conversion, which can avoid the semantic loss caused by splitting and semantic conversion, so that the data can be converted more completely and accurately between different bus protocols, and the performance degradation caused by semantic loss can be avoided, thereby improving the overall data processing rate and system performance.
[0108] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0109] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0110] Regarding the apparatus in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0111] An embodiment of the present application provides a data processing device, comprising a memory and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by one or more processors to perform the methods described in one or more of the above embodiments.
[0112] Figure 4 1 is a block diagram of an electronic device 300 according to an exemplary embodiment. For example, the electronic device 300 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
[0113] Reference Figure 4 , the electronic device 300 may include one or more of the following components: a processing component 302 , a memory 304 , a power component 306 , a multimedia component 308 , an audio component 310 , an input / output interface 312 , a sensor component 314 , and a communication component 316 .
[0114] The processing component 302 generally controls the overall operation of the electronic device 300, such as operations associated with display, phone calls, data communications, camera operation, and recording operations. The processing component 302 may include one or more processors 320 to execute instructions to perform all or part of the steps of the above-described method. In addition, the processing component 302 may include one or more modules to facilitate interaction between the processing component 302 and other components. For example, the processing component 302 may include a multimedia module to facilitate interaction between the multimedia component 308 and the processing component 302.
[0115] The memory 304 is used to store various types of data to support operations on the electronic device 300. Examples of such data include instructions for any application or method operating on the electronic device 300, contact data, phone book data, messages, pictures, multimedia, etc. The memory 304 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.
[0116] The power supply assembly 306 provides power to the various components of the electronic device 300. The power supply assembly 306 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 300.
[0117] The multimedia component 308 includes a screen that provides an output interface between the electronic device 300 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 not only sense the demarcation of a touch or slide action, but also detect the duration and pressure associated with the touch or slide action. In some embodiments, the multimedia component 308 includes a front-facing camera and / or a rear-facing camera. When the electronic device 300 is in an operating mode, such as a capture mode or a multimedia 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 focal length and optical zoom capabilities.
[0118] The audio component 310 is used to output and / or input audio signals. For example, the audio component 310 includes a microphone (MIC) that receives external audio signals when the electronic device 300 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in the memory 304 or transmitted via the communication component 316. In some embodiments, the audio component 310 also includes a speaker for outputting audio signals.
[0119] The input / output interface 312 provides an interface between the processing component 302 and peripheral interface modules, such as a keyboard, a click wheel, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.
[0120] The sensor assembly 314 includes one or more sensors for providing various aspects of status assessment for the electronic device 300. For example, the sensor assembly 314 can detect the open / closed state of the electronic device 300, the relative positioning of components, such as the display and keypad of the electronic device 300. The sensor assembly 314 can also detect changes in the position of the electronic device 300 or a component of the electronic device 300, the presence or absence of user contact with the electronic device 300, the orientation or acceleration / deceleration of the electronic device 300, and temperature changes of the electronic device 300. The sensor assembly 314 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 314 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 314 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0121] The communication component 316 is used to facilitate wired or wireless communication between the electronic device 300 and other devices. The electronic device 300 can access a wireless network based on a communication standard, such as WiFi, a carrier network (such as 2G, 3G, 4G or 5G), or a combination thereof. In an exemplary embodiment, the communication component 316 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 316 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.
[0122] In an exemplary embodiment, the electronic device 300 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 implement the methods provided in the embodiments of the present application.
[0123] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 304 including instructions, which can be executed by the processor 320 of the electronic device 300 to perform the above method. For example, the non-transitory 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.
[0124] Figure 54 is a block diagram of an electronic device 400 according to an exemplary embodiment. For example, the electronic device 400 may be provided as a server. Figure 5 The electronic device 400 includes a processing component 422, which further includes one or more processors, and a memory resource represented by a memory 432 for storing instructions executable by the processing component 422, such as an application. The application stored in the memory 432 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 422 is configured to execute the instructions to perform the method provided in the embodiments of the present application.
[0125] The electronic device 400 may further include a power supply component 426 configured to perform power management of the electronic device 400, a wired or wireless network interface 450 configured to connect the electronic device 400 to a network, and an input / output interface 458. The electronic device 400 may operate based on an operating system stored in the memory 432, such as Windows Server 2003. TM , MacOSX TM , Unix TM , Linux TM , FreeBSD TM or similar.
[0126] An embodiment of the present application further provides a computer program product, including a computer program, which implements the method described in the above embodiment when executed by a processor.
[0127] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the application disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present application that follow the general principles of the present application and include common knowledge or customary techniques in the art not disclosed herein. The description and examples are to be considered as exemplary only, and the true scope and spirit of the present application are indicated by the following claims.
[0128] It should be understood that the present application is not limited to the exact structures described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A data processing method, characterized in that: The method is applied to a first device, wherein a first bus protocol transmission mode and a second bus protocol transmission mode are used for data transmission in the first device, and the first bus protocol transmission mode and the second bus protocol transmission mode are different. The method includes: receiving transaction layer data sent by a second device, where the transaction layer data includes a plurality of transaction layer fields; Determine the data flow field corresponding to each transaction layer field in the transaction layer data according to a preset correspondence between the transaction layer field and the data flow field; Filling the data of each transaction layer field in the transaction layer data into the data stream field according to the format of the corresponding data stream field, wherein the data stream field is a field transmitted using the first bus protocol transmission mode; the transaction layer field includes a header field and a payload field; the data in the header field corresponds to preset identification information; Transmitting the data in the data stream field to a device adopting the second bus protocol transmission mode using the first bus protocol transmission mode; searching for the preset identification information from the data in the data stream field according to a data format matching the third bus protocol transmission mode; when the preset identification information is found in the data in the data stream field, using the preset identification information as a data boundary corresponding to the header field in the data in the data stream field, and extracting data corresponding to each of the transaction layer fields from within the data boundary corresponding to the data in the data stream field; According to the data corresponding to each of the transaction layer fields, target data matching the second bus protocol transmission mode is generated; and the first device is controlled to perform data processing on the target data.
2. The method according to claim 1, characterized in that The transaction layer field includes a header field and a payload field; the data stream field includes a data field and a control field; Filling the data of each transaction layer field in the transaction layer data into the data stream field according to the format of the corresponding data stream field includes: In a case where there is a corresponding relationship between the payload field and the data field, filling the data of the payload field into the data field; In the case where there is a correspondence between the header field and the control field, preset identification information that matches the data in the header field is selected from multiple preset identification information according to the preset identification correspondence, and the matching preset identification information is used as the starting identifier of the data in the control field; the preset identification correspondence includes a correspondence between a preset identifier and the data in the header field, and the preset identification information is used to represent the identifier used by the data in the header field when the third bus protocol transmission mode is adopted for transmission.
3. The method according to claim 1, characterized in that Generating target data matching the second bus protocol transmission mode according to the data corresponding to each of the transaction layer fields includes: The data content corresponding to each of the transaction layer fields is mapped into target data matching the second bus protocol transmission mode according to a data format matching the second bus protocol transmission mode.
4. The method according to claim 1, wherein The method further comprises: According to a third bus protocol transmission mode corresponding to the transaction layer data, the transaction layer data is stored in an execution queue in a transmission order, wherein the execution queue is used to store the transaction layer data to be executed; Generating target data matching the second bus protocol transmission mode according to the data corresponding to each of the transaction layer fields includes: According to the storage order of the transaction layer data to be executed stored in the execution queue and based on the data corresponding to each transaction layer field, target data matching the second bus protocol transmission mode is generated in sequence.
5. The method according to claim 1, wherein The method further comprises: In a case where the first device is controlled to process target data, return data after the data processing is obtained from the first device; the target data is data generated according to the data corresponding to each of the transaction layer fields and matching the second bus protocol transmission mode; Mapping the returned data into candidate returned data matching the first bus protocol transmission mode according to a data format matching the first bus protocol transmission mode; Determine the transaction layer field corresponding to each of the data flow fields in the candidate returned data according to a preset correspondence between the transaction layer field and the data flow field; Filling the data of each data stream field in the candidate returned data into the transaction layer field according to the format of the corresponding transaction layer field; The returned transaction layer data is obtained according to the data in each transaction layer field.
6. The method according to any one of claims 1 to 5, characterized in that The target data includes target transaction type, target address information and target load data; The performing data processing on the data in the data stream field includes: The first device is controlled to process the target payload data at a storage location corresponding to the target address information according to the target transaction type.
7. A data processing device, characterized in that: The apparatus is applied to a first device, wherein a first bus protocol transmission mode and a second bus protocol transmission mode are used for data transmission in the first device, and the first bus protocol transmission mode and the second bus protocol transmission mode are different. The apparatus includes: a receiving module, configured to receive transaction layer data sent by a second device, wherein the transaction layer data includes multiple transaction layer fields; a first determining module, configured to determine, according to a preset correspondence between transaction layer fields and data flow fields, a data flow field corresponding to each transaction layer field in the transaction layer data; a first filling module, configured to fill the data of each transaction layer field in the transaction layer data into the data stream field according to the format of the corresponding data stream field, wherein the data stream field is a field transmitted using the first bus protocol transmission mode; the transaction layer field includes a header field and a payload field; the data in the header field corresponds to preset identification information; an identification module configured to transmit the data in the data stream field to a device adopting the second bus protocol transmission mode using the first bus protocol transmission mode; search the data in the data stream field for the preset identification information in a data format matching the third bus protocol transmission mode; and, if the preset identification information is found in the data in the data stream field, use the preset identification information as a data boundary corresponding to the header field in the data in the data stream field, and extract data corresponding to each of the transaction layer fields from within the data boundary corresponding to the data in the data stream field; The processing module is used to generate target data matching the second bus protocol transmission mode according to the data corresponding to each of the transaction layer fields; and control the first device to perform data processing on the target data.
8. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Communication method for processor and external SRIO equipment
CN117251397A