Data processing method and device, equipment and storage medium

By receiving transaction layer data and filling data stream fields according to preset relationships, the cache consistency problem of PCIe devices when communicating with SoC is solved, and the accurate conversion of data between different bus protocols is achieved, and the data processing rate and system performance are improved. .

CN119396762AActive Publication Date: 2025-02-07BEIJING INSTITUTE OF OPEN SOURCE CHIP
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411996868.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-02-07
Estimated Expiration
2044-12-31

Smart Images

  • Figure CN119396762A_ABST
    Figure CN119396762A_ABST
Patent Text Reader

Abstract

The invention provides a data processing method and device, electronic equipment and a computer readable storage medium, and the method comprises the steps: receiving transaction layer data sent by second equipment, the transaction layer data comprising a plurality of transaction layer fields; determining a data stream field corresponding to each transaction layer field in the transaction layer data according to a preset corresponding relationship between the transaction layer fields and the data stream fields; data of each transaction layer field in the transaction layer data is filled into a data flow field according to the format of the corresponding data flow field, and the data flow field is a field transmitted in the first bus protocol transmission mode; and according to the first bus protocol transmission mode and the second bus protocol transmission mode, carrying out data processing on the data in the data stream field. According to the method, performance reduction caused by semantic loss can be avoided, and the overall data processing rate and system performance are improved.
Need to check novelty before this filing date? Find Prior Art

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 transmission between IP cores (Intellectual Property Core) in a system on chip (SoC). The CHI (Coherent Hub Interface) bus protocol is a cache coherent bus protocol used in systems on chip.

[0003] At present, when a PCIe device communicates with other components in a 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, the data written by the PCIe device may be cached by the processor core. The data written by the PCIe device needs to be converted into an AXI transaction through a PCIe-AXI bridge and transmitted on the AXI bus, and then converted into a CHI transaction through an AXI-CHI bridge to process cache consistency related transactions on the CHI bus. In related technologies, since the PCIe-AXI bridge will map the PCIe concept into an AXI transaction for splitting and semantic conversion, and the AXI-CHI bridge will also split and semantically convert to convert the AXI transaction into a CHI transaction, these two splits and semantic conversions will cause semantic loss, making data control inflexible, reducing the overall data processing rate, and thus causing 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 the problems in the related art.

[0005] In a first aspect, an embodiment of the present application provides a data processing method, which is applied to a first device, in which a first bus protocol transmission mode and a second bus protocol transmission mode are used to perform data transmission, 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, wherein the transaction layer data includes a plurality of transaction layer fields; According to a preset correspondence between transaction layer fields and data stream fields, determining a data stream field corresponding to each transaction layer field in the transaction layer data; 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 that is transmitted in the first bus protocol transmission mode; 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.

[0006] In a second aspect, an embodiment of the present application provides a data processing device, which is applied to a first device, in which a first bus protocol transmission mode and a second bus protocol transmission mode are used to perform data transmission, and the first bus protocol transmission mode and the second bus protocol transmission mode are different, and the device 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 the data stream field corresponding to each transaction layer field in the transaction layer data according to a preset correspondence relationship between the transaction layer field and the data stream field; A first filling module, used for 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 in the first bus protocol transmission mode; A processing module is used to perform data processing on the data in the data stream field according to the first bus protocol transmission mode and the second bus protocol transmission mode.

[0007] In a third aspect, an embodiment of the present application further provides an electronic device, including a processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the method of the first aspect.

[0008] 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.

[0009] In an embodiment of the present application, by receiving transaction layer data sent by a second device, the transaction layer data includes a plurality of transaction layer fields; according to the correspondence between the preset transaction layer fields and the data stream fields, determining the data stream field corresponding to each transaction layer field in the transaction layer data; 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, the data stream field is a field transmitted using the first bus protocol transmission mode; according to the first bus protocol transmission mode and the second bus protocol transmission mode, data in the data stream field is processed. 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 stream field through the correspondence between the preset transaction layer fields and the data stream fields, without the need for complex splitting and semantic conversion, and the semantic loss caused by splitting and semantic conversion can be avoided, so that the data can be converted between different bus protocols more completely and accurately, and the performance degradation caused by semantic loss can be avoided, thereby improving the overall data processing rate and system performance.

[0010] 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

[0011] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. 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.

[0012] Figure 1 is a flow chart of a data processing method provided in an embodiment of the present application; Figure 2 This is an architecture diagram of data conversion provided by an embodiment of the present application; Figure 3 is a block diagram of a data processing device provided in an embodiment of the present application; Figure 4 is a block diagram of an electronic device provided by an embodiment of the present invention; Figure 5 is a block diagram of another electronic device according to another embodiment of the present invention. DETAILED DESCRIPTION

[0013] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0014] The terms "first", "second", etc. in the specification and claims of the present 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 a class, 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 kinds of relationships can exist, for example, A and / or B can be represented: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the front and back associated objects are a kind of "or" relationship. In the embodiment of the present application, the term "multiple" refers to two or more, and other quantifiers are similar.

[0015] 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 the scenario where the data transmission of the PCIe device involves the cache consistency problem in the multi-core system, and the data processing method provided by the embodiment of the present disclosure can be applied to the system on chip. Among them, the system on chip is a complete electronic system integrated on a single chip, and the electronic system may include multiple functional modules, such as a processor, a memory, various interfaces, an analog circuit, and various digital logic units.

[0016] At present, when a PCIe device communicates with other components in a 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, the data written by the PCIe device may be cached by the processor core. The data written by the PCIe device needs to be converted into an AXI transaction through a PCIe-AXI bridge and transmitted on the AXI bus, and then converted into a CHI transaction through an AXI-CHI bridge to process cache consistency related transactions on the CHI bus. In related technologies, since the PCIe-AXI bridge will map the PCIe concept into an AXI transaction for splitting and semantic conversion, and the AXI-CHI bridge will also split and semantically convert to convert the AXI transaction into a CHI transaction, these two splits and semantic conversions will cause semantic loss, making data control inflexible, reducing the overall data processing rate, and thus causing performance degradation.

[0017] 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 the computer. The AXI (Advanced eXtensible Interface) bus protocol is an on-chip bus protocol that supports parallel data transmission between IP cores (Intellectual Property Core) in the system on chip (SoC). The CHI (Coherent Hub Interface) bus protocol is a cache consistency bus protocol used between IP cores in the system on chip.

[0018] For example, taking the server's system on chip (SoC) as an example, a high-speed solid-state drive (SSD) connected through a PCIe interface can be used as a PCIe device. The SoC contains multiple processor cores, on-chip memory, and some IP cores with other functions. The SoC uses the AXI bus and CHI bus to achieve connection and communication between internal components to ensure functions such as data transmission and cache consistency.

[0019] When a high-speed solid-state drive (PCIe device) wants to write a batch of user data to the on-chip memory, it will encapsulate the data into TLPs (Transaction Layer Packets) according to the PCIe bus protocol and send them out. For example, if you want to write a data file of 10MB, the data will be split into multiple TLPs for transmission in sequence. First, the TLP will be converted through the PCIe-AXI bridge for protocol conversion so that it can be transmitted on the AXI bus. At this time, the information about the data address, transmission attributes, etc. in the TLP will be split and converted into relevant transaction contents such as the write address channel and write data channel that meet the requirements of the AXI bus protocol. In this process, semantic loss will occur. Then, the AXI transaction converted by the PCIe-AXI bridge is transmitted on the AXI bus to the on-chip memory. When data transmission involves cache consistency issues in a multi-core system (for example, the data may be used by the processor core cache later), these AXI transactions need to be further converted through the AXI-CHI bridge. Similarly, during this conversion process, some of the original semantic information in the AXI transaction will be lost and cannot be fully retained when converted to a CHI transaction, which may lead to misunderstandings when processing cache consistency later.

[0020] In this way, the semantic loss caused by these two splits and semantic conversions will make data control less flexible, and the overall data transmission rate will also be affected and reduced. Because each conversion takes a certain amount of time to parse, split, repackage and other operations, additional processing steps are added, resulting in a decrease in the amount of data that can be successfully transmitted to the on-chip memory per second, which in turn reduces the performance of the entire system.

[0021] 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, without the need for complex splitting and semantic conversion, and can avoid semantic loss caused by splitting and semantic conversion, so that data can be converted between different bus protocols more completely and accurately, and can avoid performance degradation caused by semantic loss, thereby improving the overall data processing rate and system performance.

[0022] 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.

[0023] Figure 1 is a flow chart of a data processing method provided in an embodiment of the present application, such as 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.

[0024] For example, the first device may be a system on chip. The system on chip is a complete electronic system integrated on a single chip, and the electronic system may include multiple functional modules, such as a processor, a memory, various interfaces, analog circuits, and various digital logic units. The first bus protocol may include an AXI-Stream (Advanced eXtensibleInterface-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 consistency bus protocol for a system on chip.

[0025] The method may include the following steps.

[0026] In step S101, transaction layer data sent by a second device is received.

[0027] The transaction layer data includes multiple transaction layer fields.

[0028] The transaction layer data may include multiple TLPs (Transaction Layer Packets), which are the basic unit of data transmission in the PCIe bus protocol and include multiple transaction layer fields. First, the TLP header field may include important fields such as the transaction type (indicating whether it is a read transaction, a write transaction, a configuration transaction, etc.), address information (source address or target address, used to specify the source or destination of the data), data length (indicating the amount of data carried by this TLP), and tags (used to distinguish and track different transactions, etc.). In addition to the TLP header field, there is also a data payload field, which is the actual valid data content to be transmitted. For example, in the TLP of a PCIe write transaction, the transaction type field in the TLP header field will be marked as "write", the address field contains the specific memory address of the data to be written, and the data length field specifies the number of data bytes to be written, followed by the actual data of the corresponding number of bytes as the payload.

[0029] In this embodiment, the first device may be a system-on-chip device that performs data exchange via an AXI bus and a CHI bus. For example, the first device may be a plurality of components in a system-on-chip SoC, which may include a processor, a memory, or other IP cores, etc. The second device may be a PCIe device that performs data exchange via a PCIe bus. For example, the PCIe device may include a PCIe graphics card, a solid-state drive (SSD) with a PCIe interface, and a PCIe network card and other devices.

[0030] In this step, in order to ensure that the data can be accurately received, 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. Taking a PCIe device (such as a PCIe graphics card) as an example of the second device, when the PCIe graphics card sends data to the first device through the PCIe bus, the data will be encapsulated into TLP according to the PCIe bus protocol. Among them, the format of the data packet, the order of transmission, the encoding of the signal, etc. are all specified by the PCIe bus protocol. If the first device does not receive 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.

[0031] 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.

[0032] The execution queue is used to store the transaction layer data to be executed.

[0033] First, the bus protocol used by the second device can be determined. This may be done through pre-configured information, device identification, or negotiation during the initialization of communication. For example, in a complex system on chip (SoC), devices may handshake at startup to determine each other's bus protocol type.

[0034] Then, according to the identified bus protocol, the first device adjusts its receiving mode. If the second device is a PCIe device, the first device needs to configure its interface to adapt to the parallel data transmission mode of the PCIe bus protocol. The PCIe bus protocol is a bus protocol that supports serial data transmission between PCIe devices and other components in the SoC (such as processors, memories, or other IP cores, etc.) through the PCIe interface IP core. When receiving transaction layer data packets, the first device needs to prepare the corresponding serial data channel to receive data.

[0035] Secondly, after correctly configuring the receiving mode, the first device can start receiving transaction layer data. Among them, the transaction layer data can include specific data and related control information. Taking the video processing system as an example, assuming that the second device is an external video capture card connected through the PCIe interface IP core, and the first device is the memory in the SoC. The video capture card encapsulates the collected video data into PCIe transaction layer data packets and sends them to the memory. The memory receives these data packets according to the PCIe bus protocol transmission mode.

[0036] In step S102, according to the preset correspondence between the transaction layer field and the data flow field, the data flow field corresponding to each transaction layer field in the transaction layer data is determined.

[0037] The data stream field is a field that is transmitted using the first bus protocol transmission mode.

[0038] 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.

[0039] 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, preset identifier information matching 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 a correspondence between a 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.

[0040] 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 set to 1 to represent a write operation. Then, according to 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, and when "00" is detected in the data, the data after "00" can be used as data in AXI-Stream to represent the transaction type.

[0041] In this step, the various fields included in the transaction layer data may be determined first, and then the data flow field corresponding to each transaction layer field in the transaction layer data may be determined according to the preset correspondence between the transaction layer field and the data flow field.

[0042] Specifically, the transaction layer data may include a variety of different 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.

[0043] 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 TLP into an AXI-Stream data stream, the bit used to indicate the transaction type in AXI-Stream is set according to the value of the TLP transaction type field.

[0044] And the data payload part of the TLP is the valid data to be actually transmitted. When converting the TLP into the AXI-Stream data stream, the data payload field of the TLP can be directly matched with the data field of the AXI-Stream.

[0045] Therefore, the transaction type field, address field, etc. in the transaction layer data used to characterize the control fields can be made to correspond to the control field in the data stream field, and the load field in the transaction layer data can be made to correspond to the data field in the data stream field.

[0046] 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.

[0047] In this step, first, each transaction layer field can be parsed according to the format specified by the protocol (such as the PCIe protocol) where the transaction layer data is located, and the corresponding data value can be extracted. Taking a TLP of a PCIe write transaction as an example, the value of the transaction type field is read from a specific field position in its header (assuming that "01" represents a write transaction), the binary value corresponding to the target memory address is obtained from the specified address field byte range (for example, a 32-bit address value), and the number of data bytes represented by the data length field is obtained from the corresponding position, and these specific values ​​are extracted for filling.

[0048] Then, the data of the transaction layer field can be filled in according to the previously determined correspondence and the format requirements of the data stream field. For example, for the above-extracted transaction type "01", 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, 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), the 32-bit address data is filled in sequentially; 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 as a unit) and then filled into the corresponding position.

[0049] 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.

[0050] For example, in a system on a chip, a PCIe device needs to transfer data to an on-chip memory. Through such a filling 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, thereby realizing the orderly flow of data.

[0051] 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.

[0052] For example, when the transaction layer data is converted into data transmitted in the first bus protocol transmission mode, the converted data transmitted in the first bus protocol transmission mode can be further converted into data transmitted in the second bus protocol transmission mode.

[0053] In some embodiments, the data in the data stream field may first be transmitted to a device using the second bus protocol transmission mode using the first bus protocol transmission mode.

[0054] The second bus protocol may be an AXI-Stream bus protocol, which can transmit data in a streaming manner, mainly relying on data fields and control fields such as TVALID (indicating whether the data is valid), TREADY (whether the receiving end is ready to receive), and TLAST (whether it is the end of a frame of data) to ensure that the data is transmitted in an orderly and accurate manner. Its data field carries the actual content to be transmitted. During the conversion process, these data can be transmitted in the form of a data stream to subsequent devices that use other protocols.

[0055] For example, taking the video processing system as an example, after the video preprocessing 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 orderly transmission is also carried out in accordance with the above-mentioned control field and data field. However, if the subsequent data transmission involves the cache consistency problem in the 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 in 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 flow of data between different protocols.

[0056] Then, in the device adopting the second bus protocol transmission mode, the data in the received data stream field can be identified according to the data format matching 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.

[0057] 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.

[0058] It should be noted that in the device adopting the second bus protocol (such as CHI bus protocol) transmission mode, the reason why the data in the received AXI-Stream data flow field is identified according to the data format matching the third bus protocol (such as PCIe bus protocol) transmission mode is because the data undergoes conversion of 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.

[0059] Specifically, under the PCIe bus protocol, the first byte of each transaction unit of data is used to identify the transaction type (such as 00 for read transactions, 01 for write transactions, etc.), and the subsequent bytes are the encoding content of transaction layer fields such as address information and data length in a fixed order. Although the data is transformed into the form of AXI-Stream data stream after being transmitted through the AXI-Stream bus protocol, in order to accurately know the meaning of the transaction layer fields originally corresponding to each part, it is necessary to identify it based on the format characteristics of the original third bus protocol.

[0060] Optionally, the identification features that can reflect the data boundary in the AXI-Stream data stream can be searched based on the format information of the third bus protocol data. For example, in the third bus protocol, if it is specified that the beginning and end of a frame of complete data are marked by specific byte sequences (such as the beginning is fixed to 0xFF0xFE, and the end is fixed to 0xFE0xFF), then in the received AXI-Stream data stream, these specific byte sequences can be searched byte by byte to determine where the data boundary corresponding to each complete transaction is.

[0061] Furthermore, after determining each data boundary, we know the scope of each complete data segment. Then, we can extract the corresponding data according to the layout order and encoding method of the transaction layer field in the data specified in the third bus protocol. For example, it is known that in each data unit, the 4 consecutive bytes starting from the second byte represent the source address field. Then, in this demarcated data unit, extract the 4-byte data content starting from the second byte, which is the data corresponding to the source address transaction layer field. Similarly, for other transaction layer fields (such as transaction type, data length, etc.), they are also extracted from the data boundary in sequence according to their fixed byte positions and encoding rules under the third bus protocol.

[0062] Next, target data matching the second bus protocol transmission mode may be generated according to the data corresponding to each of the transaction layer fields.

[0063] Optionally, the data content corresponding to each of the transaction layer fields may be mapped to target data matching the second bus protocol transmission mode in a data format matching the second bus protocol transmission mode.

[0064] 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 complete target data.

[0065] The key information may include address-related information, data length, and other attribute information.

[0066] For example, first, the specific operation can be clarified according to the data representing the transaction type in the transaction layer field extracted from the previous step. For example, if the value of the transaction type field corresponds to a "read" operation, it means that a data structure related to a read transaction is to 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 needs to be constructed. Then the address data extracted from the transaction layer field (which can be a source address or a target address, depending on whether the transaction type is read or write) is processed according to the CHI bus protocol for the address format requirements and then filled into the target data structure. The address under the CHI bus protocol may involve concepts such as the division of the memory address space and the cache line address. The address information obtained from the original transaction layer needs to be accurately converted into an address format that complies with the CHI bus protocol, such as address alignment, adding corresponding address tags, etc., to ensure that the data storage or reading location can be correctly located in the subsequent data processing. The field data representing the data length in the transaction layer is converted into the corresponding data volume measurement method under the CHI bus protocol, and filled 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.

[0067] Then, the first device may be controlled to perform data processing on the target data.

[0068] 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.

[0069] 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 modules) will initiate a read operation based on the target address information to access the corresponding storage location (such as cache or main memory, etc.). It will send the target address information to the address bus through the corresponding hardware circuit or software instruction drive, and then wait to obtain the data read from the address from the data bus, and fill these data into the position corresponding to the target load data to complete the read operation.

[0070] 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.

[0071] After completing the generation of target data for the transaction layer data at the head of the execution queue, repeat the above operations of extracting field data and generating target data for the next transaction layer data according to the storage order of the queue, and do this one by one in sequence to ensure that each transaction layer data can generate corresponding target data that conforms to the second bus protocol transmission mode in sequence. In this way, the entire system can systematically convert the data into a form that conforms to the target protocol according to the order in which the data is generated, and then hand it over to the corresponding device for subsequent data processing, ensuring the consistency and correctness of the data processing process.

[0072] 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 according to the data corresponding to each of the transaction layer fields; 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 of the data stream fields in the candidate return data is determined; the data of each of the data stream fields 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 according to the data in each of the transaction layer fields.

[0073] The returned transaction layer data can be used to provide feedback to the source of the data request, so that it can know the result of the data processing. For example, in a scenario where a PCIe device communicates with a system on a chip, the PCIe device initiates a data processing request (corresponding to the initial transaction layer data). After a series of the above-mentioned processing and the data processing of the first device, the returned transaction layer data can be returned to the PCIe device through the corresponding link. The PCIe device can judge whether the data transmission is successful and whether the read data is correct based on this returned data, so as to take further actions, such as re-initiating the request or continuing the subsequent data processing process.

[0074] In this way, after controlling the first device to process the target data, the return 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, thereby 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 exchange and collaborative work between various parts of the system.

[0075] 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 between different bus protocols more completely and accurately, and the performance degradation caused by semantic loss can be avoided, thereby improving the overall data processing rate and system performance.

[0076] Figure 3 1 is a block diagram of a data processing device provided in an embodiment of the present application. The device is applied to a first device. 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 is different from the second bus protocol transmission mode. The device 200 includes: The receiving module 201 is used to receive transaction layer data sent by the second device, where the transaction layer data includes multiple transaction layer fields; A first determining module 202, configured to determine a data stream field corresponding to each transaction layer field in the transaction layer data according to a preset correspondence relationship between the transaction layer field and the data stream field; A first filling module 203 is used 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, and the data stream field is a field that adopts the first bus protocol transmission mode for transmission; The processing module 204 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.

[0077] 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.

[0078] Optionally, the transaction layer field includes a header field and a load 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 load field into the data field when there is a correspondence between the load field and the data field; when there is a correspondence between the header field and the control field, according to a preset identifier correspondence, select preset identifier information matching 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 a correspondence between a 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.

[0079] Optionally, the transaction layer field includes a header field and a load 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 according to a data format that matches the third bus protocol transmission mode; when the preset identification information is found in 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.

[0080] Optionally, the processing module 204 is used to map the data content corresponding to each of the transaction layer fields into target data matching the second bus protocol transmission mode according to a data format matching the second bus protocol transmission mode.

[0081] Optionally, the processing module 204 is further used to store the transaction layer data in a transmission order in an execution queue 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.

[0082] Optionally, the device further comprises: an acquisition module, configured to acquire returned data after the data processing from the first device while controlling the first device to process the target data; the target data is data matching the second bus protocol transmission mode generated according to the data corresponding to each of the transaction layer fields; A mapping module, configured to map the return data into candidate return data matching the first bus protocol transmission mode according to a data format matching the first bus protocol transmission mode; A second determination module, configured to determine the transaction layer field corresponding to each of the data stream fields in the candidate returned data according to a preset correspondence between the transaction layer field and the data stream field; A second filling module is used 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; The third determination module is used to obtain the returned transaction layer data according to the data in each transaction layer field.

[0083] 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.

[0084] 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, without the need for complex splitting and semantic conversion, and the semantic loss caused by splitting and semantic conversion can be avoided, so that the data can be converted between different bus protocols more completely and accurately, and the performance degradation caused by semantic loss can be avoided, thereby improving the overall data processing rate and system performance.

[0085] 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.

[0086] 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.

[0087] Regarding the device 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.

[0088] An embodiment of the present application provides a data processing device, including a memory and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by one or more processors to perform the methods described in one or more of the above embodiments.

[0089] Figure 4 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.

[0090] 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 .

[0091] 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 operations, and recording operations. The processing component 302 may include one or more processors 320 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 302 may include one or more modules to facilitate the interaction between the processing component 302 and other components. For example, the processing component 302 may include a multimedia module to facilitate the interaction between the multimedia component 308 and the processing component 302.

[0092] The memory 304 is used to store various types of data to support the operation of 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.

[0093] The power supply component 306 provides power to the various components of the electronic device 300. The power supply component 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.

[0094] 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, the screen 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 touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 308 includes a front camera and / or a rear camera. When the electronic device 300 is in an operating mode, such as a shooting mode or a multimedia mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.

[0095] The audio component 310 is used to output and / or input audio signals. For example, the audio component 310 includes a microphone (MIC), and when the electronic device 300 is in an operation mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is used to receive an external audio signal. The received audio signal can be further stored in the memory 304 or sent via the communication component 316. In some embodiments, the audio component 310 also includes a speaker for outputting audio signals.

[0096] The input / output interface 312 provides an interface between the processing component 302 and the peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.

[0097] 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, and the sensor assembly 314 can also detect the position change 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 the temperature change 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 an optical 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 acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0098] 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.

[0099] 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.

[0100] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 304 including instructions, and the instructions can be executed by a processor 320 of an 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.

[0101] Figure 5 4 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 that can be executed 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 instructions to perform the method provided in the embodiment of the present application.

[0102] The electronic device 400 may also 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 2008. TM , MacOSXTM , Unix TM , Linux TM , FreeBSD TM or similar.

[0103] 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.

[0104] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the application disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.

[0105] It should be understood that the present application is not limited to the precise structures that have been 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 in the first device for data transmission, 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, wherein the transaction layer data includes a plurality of transaction layer fields; According to a preset correspondence between transaction layer fields and data stream fields, determining a data stream field corresponding to each transaction layer field in the transaction layer data; 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 that is transmitted in the first bus protocol transmission mode; Data in the data stream field is processed according to the first bus protocol transmission mode and the second bus protocol transmission mode.

2. The method according to claim 1, characterized in that The performing data processing on the data in the data stream field according to the first bus protocol transmission mode and the second bus protocol transmission mode comprises: Transmitting the data in the data stream field to a device adopting the second bus protocol transmission mode by adopting the first bus protocol transmission mode; Identify the received data in the data stream field according to a data format matching the third bus protocol transmission mode corresponding to the transaction layer data to obtain a 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; 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.

3. The method according to claim 1, characterized in that The transaction layer field includes a header field and a load 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 comprises: In the case where there is a corresponding relationship between the load field and the data field, filling the data of the load field into the data field; In the case where there is a correspondence between the header field and the control field, according to the preset identifier correspondence, preset identifier information matching 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 a correspondence between a 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.

4. The method according to claim 2, characterized in that: The transaction layer field includes a header field and a load field; the data in the header field corresponds to preset identification information; The received data in the data stream field is identified according to a data format matching a third bus protocol transmission mode corresponding to the transaction layer data to obtain each of the transaction layer fields, wherein the corresponding data boundary in the data in the data stream field includes: 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; In the case where the preset identification information is found in 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.

5. The method according to claim 2, 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 comprises: 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.

6. The method according to claim 2, characterized in that 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, and 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 comprises: 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, target data matching the second bus protocol transmission mode is generated in sequence.

7. The method according to claim 1, characterized in that The method further comprises: In the case of controlling the first device to process the target data, obtaining the returned data after the data processing from the first device; the target data is data matching the second bus protocol transmission mode generated according to the data corresponding to each of the transaction layer fields; Mapping the return data into candidate return data matching the first bus protocol transmission mode according to a data format matching the first bus protocol transmission mode; According to a preset correspondence between a transaction layer field and a data stream field, determining the transaction layer field corresponding to each of the data stream fields in the candidate returned data; Fill the data of each of the data stream fields 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 of the transaction layer fields.

8. The method according to claim 2, 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 comprises: Control the first device to perform data processing on the target load data at a storage location corresponding to the target address information according to the target transaction type.

9. A data processing device, characterized in that: The device is applied to a first device, in which a first bus protocol transmission mode and a second bus protocol transmission mode are used for data transmission, and the first bus protocol transmission mode and the second bus protocol transmission mode are different, and the device 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 the data stream field corresponding to each transaction layer field in the transaction layer data according to a preset correspondence relationship between the transaction layer field and the data stream field; A first filling module, used for 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 in the first bus protocol transmission mode; A processing module is used to perform data processing on the data in the data stream field according to the first bus protocol transmission mode and the second bus protocol transmission mode.

10. 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 8.

11. 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 as claimed in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Data protocol conversion method and device, electronic equipment and storage medium

    CN111970267A

  • Dynamic self-adaptive virtual channel mapping method and device and storage medium

    CN113806258A

  • Communication method for processor and external SRIO equipment

    CN117251397A

  • Multi-high-speed interface protocol message conversion system

    CN117596309A