Data processing method, device, equipment and storage medium
By selecting an appropriate operating mode according to the attribute fields of the transaction layer data packet in the first device to process the PCIe device request transaction, the performance degradation caused by sequential waiting in the AXI bus is solved, and the data processing rate and performance are improved.
Patent Information
- Application Number
- CN202411997212.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-05-02
- Estimated Expiration
- 2044-12-31
AI Technical Summary
When maintaining the order of transaction requests by PCIe devices in the AXI bus protocol, it is necessary to wait for the response of the previous transaction to be displayed, resulting in an idle waiting period in the system, which reduces the overall data processing rate and performance.
By receiving the attribute fields in the transaction layer data packet sent by the second device, an appropriate working mode is selected, and the first device is controlled to process the data packet according to the working mode to avoid idle resources waiting.
When processing transactions sent by the second device, the appropriate processing order is selected according to the attribute fields of the transaction layer data packet, which improves the data processing rate and improves the overall performance.
Smart Images

Figure CN119396540B_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 transmission between IP cores (Intellectual Property Core) in a system-on-chip (SoC).
[0003] Currently, PCIe devices can communicate with other components in SoC (such as processors, memories, or other IP cores, etc.) through PCIe interface IP cores. In related technologies, since the AXI bus protocol supports parallel data transmission, while the PCIe bus protocol supports serial data transmission, if you want to maintain the order of PCIe device request transactions in parallel AXI transactions, you need to maintain the order by explicitly waiting for the response of the previous transaction. However, this method will cause idle waiting cycles in the system, and the bandwidth and related processing resources of the AXI bus will be idle during the waiting period, reducing the overall data processing rate, thereby 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 and includes:
[0006] receiving a transaction layer data packet sent by the second device according to a bus protocol transmission mode matching the second device, the transaction layer data packet comprising an attribute field, the attribute field comprising a plurality of field types, different field types being used to characterize different working modes adopted when the transaction layer data packet is executed in the first device, the working mode matching the bus protocol transmission mode of the first device;
[0007] According to the field type, selecting a working mode adopted when the transaction layer data packet is executed in the first device from a plurality of working modes, and using the adopted working mode as a target working mode;
[0008] According to the target working mode, the first device is controlled to perform data processing on the transaction layer data packet.
[0009] In a second aspect, an embodiment of the present application provides a data processing apparatus, which is applied to a first device, and includes:
[0010] a receiving module, configured to receive a transaction layer data packet sent by the second device according to a bus protocol transmission mode matching the second device, wherein the transaction layer data packet includes an attribute field, wherein the attribute field includes a plurality of field types, and different field types are used to characterize different working modes adopted when the transaction layer data packet is executed in the first device, and the working mode matches the bus protocol transmission mode of the first device;
[0011] A selection module, configured to select, from a plurality of working modes, a working mode adopted when the transaction layer data packet is executed in the first device according to the field type, and use the adopted working mode as a target working mode;
[0012] A processing module is used to control the first device to perform data processing on the transaction layer data packet according to the target working mode.
[0013] In a third aspect, an embodiment of the present application further provides an electronic device, including a processor;
[0014] a memory for storing instructions executable by the processor;
[0015] The processor is configured to execute the instructions to implement the method of the first aspect.
[0016] 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.
[0017] In an embodiment of the present application, a transaction layer data packet sent by a second device is received according to a bus protocol transmission mode that matches the second device, the transaction layer data packet includes an attribute field, the attribute field includes multiple field types, different field types are used to characterize different working modes adopted when the transaction layer data packet is executed in the first device, and the working mode matches the bus protocol transmission mode of the first device; according to the field type, the working mode adopted when the transaction layer data packet is executed in the first device is selected from the multiple working modes, and the adopted working mode is used as the target working mode; according to the target working mode, the first device is controlled to perform data processing on the transaction layer data packet. In this way, the corresponding target working mode can be selected from the first device according to the different field types in the attribute field of the transaction layer data packet sent by the second device, so that the first device can adopt a matching data processing method for the transmission mode of different data packets to call different hardware and software resources from the first device for data processing, and can provide a processing sequence for each transaction sent by the second device that is different from sequential waiting and matches the transaction sent by the second device. When processing the transaction sent by the second device, different types of transactions can be allocated to suitable resource modules for processing according to the selected target working mode based on the attributes of the transaction layer data packet, thereby avoiding idle waiting of resources, and increasing the data processing rate, thereby improving data processing performance.
[0018] 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
[0019] 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.
[0020] Figure 1 is a flow chart of a data processing method provided in an embodiment of the present application;
[0021] Figure 2 This is an architecture diagram of an ordering node provided in an embodiment of the present application;
[0022] Figure 3 is a flow chart of another data processing method provided in an embodiment of the present application;
[0023] Figure 4is a block diagram of a data processing device provided in an embodiment of the present application;
[0024] Figure 5 is a block diagram of an electronic device provided by an embodiment of the present invention;
[0025] Figure 6 is a block diagram of another electronic device according to another embodiment of the present invention. DETAILED DESCRIPTION
[0026] 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.
[0027] 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.
[0028] 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 a PCIe device communicates with other components (such as a processor, memory, or other IP cores, etc.) in a system-on-chip SoC through a PCIe interface IP core, 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.
[0029] Currently, PCIe devices can communicate with other components in SoC (such as processors, memories, or other IP cores) through PCIe interface IP cores. Since the AXI bus protocol used between the PCIe interface IP core and other components in the SoC supports parallel data transmission, and the PCIe bus protocol used between the PCIe device and the PCIe interface IP core supports serial data transmission, if you want to maintain the order of PCIe device request transactions in parallel AXI transactions, you need to maintain the order by explicitly waiting for the response of the previous transaction. However, this method will cause the system to have idle waiting cycles, and the bandwidth of the AXI bus and related processing resources will be idle during the waiting period, reducing the overall data processing rate, thereby causing performance degradation.
[0030] 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, and 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).
[0031] For example, a video processing system SoC integrates components such as a video processor, memory, and an external video capture card connected via a PCIe interface IP core. The video capture card can transmit the collected video data to the SoC via the PCIe bus, and the video processor and other components in the SoC can exchange data via the AXI bus.
[0032] When the video capture card collects video data at a high frame rate, it frequently sends data storage requests to the memory in the SoC through the PCIe interface IP core. Since the PCIe bus is a serial transmission, and the AXI bus between the memory and the video processor is a parallel transmission, if the order of the PCIe device request transactions in the AXI parallel transactions is to be strictly guaranteed in sequence, the video capture card can only initiate the next request after each memory write operation is completed and responded to.
[0033] For example, when processing a frame of high-definition video data, it is assumed that the acquisition card sends a data storage request to the memory through the PCIe interface IP core every 10 microseconds, but because it needs to wait for the response of the previous transaction on the AXI bus, there may be an idle waiting cycle of 5 microseconds between each request. This results in the request that could originally be processed every 10 microseconds being processed once every 15 microseconds.
[0034] For the video processing system, this waiting makes it impossible to store video data in memory in time, which in turn affects the speed at which the video processor obtains data from memory for processing. This may eventually cause the video playback to become stuck and fail to achieve the frame rate required for smooth playback, seriously reducing the performance of the entire video processing system. At the same time, the bandwidth and related processing resources of the AXI bus are idle during the waiting period and are not fully utilized.
[0035] In order to solve the above problems, the present disclosure provides a data processing method, apparatus, electronic device and computer-readable storage medium, which can select a corresponding target working mode from a first device according to different field types in the attribute field of a transaction layer data packet sent by a second device, so that the first device can adopt a matching data processing method for the transmission mode of different data packets to call different hardware and software resources from the first device for data processing, and can provide a processing sequence that is different from sequential waiting and matches the transaction sent by the second device for each transaction sent by the second device. When processing the transaction sent by the second device, different types of transactions can be allocated to suitable resource modules according to the selected target working mode according to the attributes of the transaction layer data packet for processing, thereby avoiding idle waiting of resources, and increasing the data processing rate, thereby improving data processing 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 is a flow chart of a data processing method provided in an embodiment of the present application, such as Figure 1 As shown, the method is applied to a system on chip, wherein 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.
[0038] The method may include the following steps.
[0039] In step S101, a transaction layer data packet sent by a second device is received according to a bus protocol transmission mode matching the second device.
[0040] Among them, the transaction layer data packet includes an attribute field, and the attribute field includes multiple field types. Different field types are used to characterize different working modes adopted when the transaction layer data packet is executed in the first device, and the working mode matches the bus protocol transmission mode of the first device.
[0041] In this embodiment, the first device may be an AXI device that performs data interaction through an AXI bus. For example, the AXI device may be a plurality of components in a system on chip SoC, which may include components such as a processor, a memory, or other IP cores. The second device may be a PCIe device that performs data interaction through 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.
[0042] In this step, in order to ensure that the data can be accurately received, the transaction layer data packet sent by the second device can be received according to the bus protocol transmission mode that matches the second device.
[0043] Taking a PCIe device (such as a PCIe graphics card) as the second device as an example, when the PCIe graphics card sends data to the first device via the PCIe bus, it will encapsulate the data into a transaction layer data packet according to the PCIe bus protocol. 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 the data in accordance with the PCIe bus protocol transmission mode, it may not be able to correctly parse these data packets, resulting in data loss or errors.
[0044] In this embodiment, the bus protocol used by the second device may be determined first. This may be accomplished through pre-configured information, device identification, or negotiation during the communication initialization phase. For example, in a system on chip (SoC), devices may perform handshakes at startup to determine each other's bus protocol types.
[0045] 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.
[0046] Secondly, after correctly configuring the receiving mode, the first device can start receiving transaction layer data packets, wherein the transaction layer data packets include data and related control information.
[0047] Taking the video processing system as an example, assume 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 captured 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.
[0048] It should be noted that the transaction layer data packet includes an attribute field, and the attribute field may include multiple field types. Different field types are used to characterize different working modes adopted by the transaction layer data packet when it is executed in the first device. For example, in a storage system, if the first device is a memory, the attribute field of the transaction layer data packet may include a sorting form that indicates that the received multiple transaction layer data packets can adopt, such as a strong sorting form or a loose sorting form. In a possible implementation, the attribute field may also indicate whether the data in each transaction layer data packet is a write operation or a read operation.
[0049] In step S102, according to the field type, a working mode adopted when the transaction layer data packet is executed in the first device is selected from multiple working modes, and the adopted working mode is used as the target working mode.
[0050] The multiple working modes may be multiple preset working modes that can be supported in the first device. For example, the first device may support working modes corresponding to a strong sorting mode, and may also support working modes corresponding to a loose sorting mode.
[0051] In this step, firstly, the order requirement of the transaction layer data packet can be obtained from the attribute field in the received transaction layer data packet according to the field type corresponding to the attribute field.
[0052] For example, the attribute field may contain multiple field types, each of which may imply the order requirements of the data packet from different angles. For example, there may be a specific identification field. If the value of this field is in a certain set range, it means that the operation corresponding to the data packet is a critical system operation and needs to strictly follow the sequence. For example, the transaction layer data packet involving the transmission of critical configuration files at system startup, its related attribute field will indicate through a specific value that it must be executed in a strong order, that is, the order requirement is extremely high.
[0053] At the same time, the order requirements can also be determined in combination with the specific business scenario in which the transaction layer data packet is located. Taking the financial transaction system as an example, if the transaction layer data packet carries data related to the transfer, then from the perspective of the attribute field combined with the business logic, it is necessary to ensure that the order of each operation step is accurate, and the funds are first deducted from the transfer account and then added to the transfer account, etc., so its order requirements are strict, and a strong sorting mode may be required; if the data packet involves the update of market data, its order arrangement has little impact on the overall situation, and the attribute field reflects that the order requirements are relatively loose, and a loose sorting mode can be applied.
[0054] Then, when the operating mode adopted when the transaction layer data packet is executed in the first device is selected from multiple operating modes, the operating mode adopted when the transaction layer data packet is executed in the first device can be used as the target operating mode.
[0055] The target operating mode is the operating mode adopted by the first device when receiving the transaction layer data packet.
[0056] For example, when the transaction layer data packet represents a data packet transmitted by a key configuration file when the system is started, its relevant attribute field will indicate through a specific value that it is to be executed in strong order. At this time, the working mode determined by the first device can be the working mode corresponding to the strong ordering mode.
[0057] In some embodiments, Figure 2 As shown, a sorting node may be provided in the first device, and the sorting node may be in the form of an integrated circuit or a software module.
[0058] Optionally, when receiving a transaction layer data packet sent by a second device, the transaction layer data packet sent by the second device can be received in accordance with a bus protocol transmission mode that matches the second device, and the received transaction layer data packet can be stored in the sorting node, and the storage device corresponding to the sorting node can be provided with an execution queue; further, the received transaction layer data packet can be stored in the execution queue in the order in which it is received.
[0059] Then, the control device of the first device can derive the order requirement of the transaction layer data packet from the corresponding attribute field of each transaction layer data packet received in the execution queue, and then select the working mode adopted when the transaction layer data packet is executed in the first device from multiple working modes. In this case, the working mode adopted when executing in the first device can be used as the target working mode.
[0060] By adopting the above technical solution, the sequence of data packets can be clearly recorded, making it easier to determine how to process them according to their sequence and other attributes.
[0061] In one possible implementation, when it is determined that data processing of a target transaction layer data packet is completed, the target storage location corresponding to the target transaction layer data packet in the execution queue may be released to receive the next transaction layer data packet; and the newly received transaction layer data packet may be stored in the target storage location.
[0062] In this way, the entire data processing system can have dynamic adaptability and high resource utilization efficiency. On the one hand, by releasing the storage location of the processed data packet in time, the system will not be unable to receive new data packets due to the storage location being occupied, thus ensuring the continuity of data processing; on the other hand, the released location can be reasonably used to store new data packets without opening up a large number of new storage resources, thus optimizing the storage resource utilization of the system, helping to efficiently process a large number of transaction layer data packets under limited resource conditions, and meeting the data processing needs in actual application scenarios.
[0063] Taking into account the situation that the first device may simultaneously receive data packets sent by multiple second devices, in some embodiments, when receiving transaction layer data packets sent by multiple second devices, the attribute field also includes second device identification information of the second device that sends the transaction layer data packets.
[0064] Optionally, when receiving transaction layer data packets sent by multiple second devices, you can first select preset identification information that matches the second device identification information from multiple preset identification information for each second device based on a preset identification correspondence, and use the matching preset identification information as the target identification information.
[0065] The preset identification correspondence relationship includes a correspondence relationship between the second device identification information and the preset identification information, and the preset identification information is used to characterize the execution level of the transaction layer data packet in the first device.
[0066] In this embodiment, in the case of the second device identification information of the second device that sends the transaction layer data packet from the attribute field, the preset identification information that matches the second device identification information can be selected from the multiple preset identification information based on the acquired multiple second device identification information and the preset identification correspondence relationship, and the matching preset identification information can be used as the target identification information.
[0067] The preset identification correspondence relationship can be used to establish a clear mapping rule to associate the second device identification information with the preset identification information. The preset identification information can be used to characterize the execution level of the transaction layer data packet in the first device, that is, in the subsequent data processing flow, data packets corresponding to different preset identification information will be processed according to the corresponding execution level, and data packets with high execution levels can be processed preferentially.
[0068] For example, after obtaining multiple second device identification information from the attribute field, the corresponding matching operation can be performed according to the above preset identification correspondence. Specifically, for each obtained second device identification information, the one that matches it can be found in multiple preset identification information. Through one-to-one comparison, the preset identification information that matches a certain second device identification information can be determined as the target identification information.
[0069] For example, in the case of three second devices, their identification information can be respectively represented as "Dev001", "Dev002", and "Dev003". In the preset identification correspondence table, it can be determined that the execution level represented by the preset identification information corresponding to "Dev001" is 01, which is represented as level 1, the execution level corresponding to "Dev002" is 10, which is represented as level 2, and the execution level corresponding to "Dev003" is 11, which is represented as level 3. When the transaction layer data packets from these three devices are received and the corresponding second device identification information is extracted from their attribute fields, matching can be performed according to the preset identification correspondence. For the second device identified as "Dev001", "01" can be selected from "01, 02, 03" as its corresponding target identification information. Similarly, "02" can also be used as the target identification information corresponding to the second device identified as "Dev002", and "03" can be used as the target identification information corresponding to the second device identified as "Dev003".
[0070] Then, according to the execution level corresponding to each of the second devices and based on the field type, a working mode adopted when the transaction layer data packet is executed in the first device can be selected from multiple working modes.
[0071] In this way, the data processing operation may be performed on the second device identified as "Dev001" first, then on the second device identified as "Dev002", and finally on the second device identified as "Dev003".
[0072] Through the above technical solution, different processing strategies can be adopted according to the identification of different second devices and the execution level, making the entire data processing flow more orderly and reasonable, fully considering the characteristics and importance of data packets from different sources, and ensuring the efficiency and accuracy of data processing.
[0073] In a possible implementation, taking data processing operations on a second device identified as "Dev001" as an example, according to the aforementioned steps, when it is concluded that the second device identified as "Dev001" has a strong sorting mode for its order requirement, since the on-chip bus protocol used for data interaction between the first device, i.e., the IP cores in the system on chip (SoC), is the AXI (Advanced eXtensible Interface) bus protocol, and the AXI bus protocol allows user-defined signals, the user-defined signals in the AXI bus protocol can be defined as mapping the attribute fields of the second device (regarding the order requirement).
[0074] Optionally, you can agree that a specific user-defined signal value corresponds to a strong sorting mode.
[0075] For example, when the first device receives a transaction layer data packet from "Dev001", the detected attribute field (representing the strong sorting mode) can be mapped to a 01 signal. In this way, the first device can detect the value of this user-defined signal and, when a 01 signal is detected, it can determine that the data packet needs to be processed in accordance with the strong sorting mode. Then, the processing mechanism inside the first device can correspondingly initiate some measures to ensure strict execution of the order, such as enabling a strict sequential lock mechanism, setting precise synchronization points, etc., to ensure that data is processed in strict order.
[0076] In this way, the flexibility of the AXI bus protocol can be fully utilized. By mapping custom signals and device attribute fields, the first device can quickly and accurately identify and process transaction layer data packets with different sequence requirements sent by different second devices according to the corresponding requirements, further improving the accuracy and adaptability of the entire data processing process, and better ensuring the stable operation of the system and the effectiveness of data interaction.
[0077] In some embodiments, the field type includes a first type and a second type, and the operating mode includes a parallel mode and a serial mode; therefore, when the field type is the first type, the parallel mode can be used as the operating mode adopted when the transaction layer data packet is executed in the first device; and when the field type is the second type, the serial mode can be used as the operating mode adopted when the transaction layer data packet is executed in the first device.
[0078] In step S103, the first device is controlled to perform data processing on the transaction layer data packet according to the target working mode.
[0079] In this step, when the target working mode is a parallel mode, data processing can be performed simultaneously on multiple transaction layer data packets in the execution queue; or, when the target working mode is a serial mode, data processing can be performed on multiple transaction layer data packets in the execution queue in the order of transmission.
[0080] Optionally, the transaction layer data packet includes a request type and a request address; when processing the data, such as Figure 2 As shown, a data processing operation corresponding to the request type is performed by the first device on the storage space corresponding to the request address.
[0081] For example, when processing data, you can use Figure 2 According to the logic shown, the first device can work as follows:
[0082] First, locate the storage space corresponding to the request address, which may be where the data is actually stored or should be operated. For example, if the request address points to a specific address range of a cache area, the first device will focus the operation on the corresponding position in the cache area.
[0083] Then, the first device will perform the data processing operation corresponding to the request type. If the request type is a read operation, the first device will extract the corresponding data from the storage space corresponding to the request address; if the request type is a write operation, the first device will store the data to be written in the specified storage space to ensure that the data is placed correctly; if it is a modification operation, it will first obtain the original data at the location, modify it according to the requirements, and then store it back to the storage space.
[0084] Through such a mechanism, the first device can accurately and orderly complete the corresponding data processing tasks, ensuring that the entire data processing process can accurately perform appropriate operations on data at different locations according to different needs, thereby achieving effective management and utilization of data within the system.
[0085] In other embodiments, while controlling the first device to perform data processing on the transaction layer data packet, return data after data processing is respectively obtained from multiple parallel channels of the first device; the multiple return data are mapped into a serial data stream in a preset order; and the serial data stream is sent to the second device.
[0086] By adopting the above technical scheme, the corresponding target working mode can be selected from the first device according to the different field types in the attribute field of the transaction layer data packet sent by the second device, so that the first device can adopt a matching data processing method for the transmission mode of different data packets to call different hardware and software resources from the first device for data processing, and can provide a processing sequence that is different from sequential waiting and matches the transaction sent by the second device for each transaction sent by the second device. When processing the transaction sent by the second device, different types of transactions can be allocated to suitable resource modules according to the selected target working mode according to the attributes of the transaction layer data packet for processing, thereby avoiding idle waiting of resources, and increasing the data processing rate, thereby improving data processing performance.
[0087] Figure 3 is a flow chart of another data processing method provided in an embodiment of the present application. Figure 3 As shown, the method is applied to a system on chip, wherein 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.
[0088] The method may include the following steps.
[0089] In step S201, a transaction layer data packet sent by a second device is received according to a bus protocol transmission mode matching the second device.
[0090] Among them, the transaction layer data packet includes an attribute field, and the attribute field includes multiple field types. Different field types are used to characterize different working modes adopted when the transaction layer data packet is executed in the first device, and the working mode matches the bus protocol transmission mode of the first device.
[0091] And in the case of receiving multiple transaction layer data packets sent by the second device, the attribute field also includes second device identification information of the second device that sends the transaction layer data packet.
[0092] In step S202, for each of the second devices, preset identification information matching the second device identification information is selected from a plurality of preset identification information according to the preset identification correspondence, and the matching preset identification information is used as the target identification information.
[0093] The preset identification correspondence relationship includes a correspondence relationship between the second device identification information and the preset identification information, and the preset identification information is used to characterize the execution level of the transaction layer data packet in the first device.
[0094] In step S203, according to the execution level corresponding to each of the second devices and based on the field type, a working mode adopted when the transaction layer data packet is executed in the first device is selected from a plurality of working modes.
[0095] In step S204, when the target working mode is the parallel mode, data processing is performed simultaneously on a plurality of transaction layer data packets in the execution queue.
[0096] In step S205, when the target working mode is the serial mode, data processing is performed on the multiple transaction layer data packets in the execution queue according to the transmission order.
[0097] In step S206, when it is determined that the data processing of the target transaction layer data packet is completed, the target storage location corresponding to the target transaction layer data packet in the execution queue is released to receive the next transaction layer data packet.
[0098] In step S207, the newly received transaction layer data packet is stored in the target storage location.
[0099] In step S208, the returned data after data processing is respectively obtained from the multiple parallel channels of the first device.
[0100] In step S209, the plurality of returned data are mapped into a serial data stream according to a preset order.
[0101] In step S210, the serial data stream is sent to the second device.
[0102] By adopting the above technical scheme, the corresponding target working mode can be selected from the first device according to the different field types in the attribute field of the transaction layer data packet sent by the second device, so that the first device can adopt a matching data processing method for the transmission mode of different data packets to call different hardware and software resources from the first device for data processing, and can provide a processing sequence that is different from sequential waiting and matches the transaction sent by the second device for each transaction sent by the second device. When processing the transaction sent by the second device, different types of transactions can be allocated to suitable resource modules according to the selected target working mode according to the attributes of the transaction layer data packet for processing, thereby avoiding idle waiting of resources, and increasing the data processing rate, thereby improving data processing performance.
[0103] Figure 4 300 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 device 300 includes:
[0104] A receiving module 301 is used to receive a transaction layer data packet sent by a second device according to a bus protocol transmission mode that matches the second device, where the transaction layer data packet includes an attribute field, where the attribute field includes multiple field types, and different field types are used to characterize different working modes adopted when the transaction layer data packet is executed in the first device, where the working mode matches the bus protocol transmission mode of the first device;
[0105] A selection module 302, configured to select, according to the field type, a working mode adopted by the transaction layer data packet when it is executed in the first device from a plurality of working modes, and use the adopted working mode as a target working mode;
[0106] The processing module 303 is used to control the first device to perform data processing on the transaction layer data packet according to the target working mode.
[0107] Optionally, in the case of receiving multiple transaction layer data packets sent by the second device, the attribute field also includes the second device identification information of the second device that sends the transaction layer data packet; the selection module 302 is used to select, for each of the second devices, preset identification information that matches the second device identification information from multiple preset identification information according to a preset identification correspondence, and use the matching preset identification information as the target identification information; the preset identification correspondence includes a correspondence between the second device identification information and the preset identification information, and the preset identification information is used to characterize the execution level of the transaction layer data packet in the first device; according to the execution level corresponding to each of the second devices, and according to the field type, the working mode adopted when the transaction layer data packet is executed in the first device is selected from multiple working modes.
[0108] Optionally, the field type includes a first type and a second type, and the working mode includes a parallel mode and a serial mode; the selection module 302 is used to, when the field type is the first type, use the parallel mode as the working mode adopted when the transaction layer data packet is executed in the first device; and when the field type is the second type, use the serial mode as the working mode adopted when the transaction layer data packet is executed in the first device.
[0109] Optionally, the receiving module 301 is used to store the plurality of transaction layer data packets in a transmission order to an execution queue according to a bus protocol transmission mode matching the second device, and the execution queue is used to store the transaction layer data packets to be executed;
[0110] The processing module 303 is used to simultaneously process multiple transaction layer data packets in the execution queue when the target working mode is a parallel mode; and to process multiple transaction layer data packets in the execution queue according to the transmission order when the target working mode is a serial mode.
[0111] Optionally, the execution queue includes a preset number of storage locations, and the receiving module 301 is further used to release the target storage location corresponding to the target transaction layer data packet in the execution queue when it is determined that data processing of the target transaction layer data packet is completed, so as to receive the next transaction layer data packet; and store the newly received transaction layer data packet in the target storage location.
[0112] Optionally, the transaction layer data packet includes a request type and a request address; data processing is performed in the following manner: a data processing operation corresponding to the request type is performed by the first device on the storage space corresponding to the request address.
[0113] Optionally, the device further comprises:
[0114] An acquisition module, used to respectively acquire returned data after data processing from a plurality of parallel channels of the first device, while controlling the first device to process the transaction layer data packet;
[0115] A mapping module, used for mapping the multiple returned data into a serial data stream according to a preset order;
[0116] The sending module is used to send the serial data stream to the second device.
[0117] In summary, in the embodiments of the present application, the corresponding target operating mode can be selected from the first device according to the different field types in the attribute field of the transaction layer data packet sent by the second device, so that the first device can adopt a matching data processing method for the transmission mode of different data packets to call different hardware and software resources from the first device for data processing, and can provide a processing order that is different from sequential waiting and matches the transaction sent by the second device for each transaction sent by the second device. When processing the transaction sent by the second device, different types of transactions can be allocated to suitable resource modules for processing according to the selected target operating mode based on the attributes of the transaction layer data packet, thereby avoiding idle waiting of resources, and increasing the data processing rate, thereby improving data processing performance.
[0118] 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.
[0119] 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.
[0120] 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.
[0121] 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.
[0122] 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 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.
[0123] Reference Figure 5 , the electronic device 400 may include one or more of the following components: a processing component 402 , a memory 404 , a power component 406 , a multimedia component 408 , an audio component 410 , an input / output interface 412 , a sensor component 414 , and a communication component 416 .
[0124] The processing component 402 generally controls the overall operation of the electronic device 400, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 402 may include one or more processors 420 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 402 may include one or more modules to facilitate the interaction between the processing component 402 and other components. For example, the processing component 402 may include a multimedia module to facilitate the interaction between the multimedia component 408 and the processing component 402.
[0125] The memory 404 is used to store various types of data to support the operation of the electronic device 400. Examples of such data include instructions for any application or method operating on the electronic device 400, contact data, phone book data, messages, pictures, multimedia, etc. The memory 404 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.
[0126] The power supply component 406 provides power to the various components of the electronic device 400. The power supply component 406 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 400.
[0127] The multimedia component 408 includes a screen that provides an output interface between the electronic device 400 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 408 includes a front camera and / or a rear camera. When the electronic device 400 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.
[0128] The audio component 410 is used to output and / or input audio signals. For example, the audio component 410 includes a microphone (MIC), and when the electronic device 400 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 404 or sent via the communication component 416. In some embodiments, the audio component 410 also includes a speaker for outputting audio signals.
[0129] The input / output interface 412 provides an interface between the processing component 402 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.
[0130] The sensor assembly 414 includes one or more sensors for providing various aspects of status assessment for the electronic device 400. For example, the sensor assembly 414 can detect the open / closed state of the electronic device 400, the relative positioning of the components, such as the display and keypad of the electronic device 400, and the sensor assembly 414 can also detect the position change of the electronic device 400 or a component of the electronic device 400, the presence or absence of contact between the user and the electronic device 400, the orientation or acceleration / deceleration of the electronic device 400, and the temperature change of the electronic device 400. The sensor assembly 414 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 414 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 414 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0131] The communication component 416 is used to facilitate wired or wireless communication between the electronic device 400 and other devices. The electronic device 400 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 416 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 416 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.
[0132] In an exemplary embodiment, the electronic device 400 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.
[0133] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 404 including instructions, and the instructions can be executed by a processor 420 of an electronic device 400 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.
[0134] Figure 6is a block diagram of an electronic device 500 according to an exemplary embodiment. For example, the electronic device 500 may be provided as a server. Figure 6 , the electronic device 500 includes a processing component 522, which further includes one or more processors, and a memory resource represented by a memory 532, for storing instructions that can be executed by the processing component 522, such as an application. The application stored in the memory 532 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 522 is configured to execute instructions to perform the method provided in the embodiment of the present application.
[0135] The electronic device 500 may also include a power supply component 526 configured to perform power management of the electronic device 500, a wired or wireless network interface 550 configured to connect the electronic device 500 to a network, and an input / output interface 558. The electronic device 500 may operate based on an operating system stored in the memory 532, such as Windows Server 2003. TM , MacOSX TM , Unix TM , Linux TM , FreeBSD TM or similar.
[0136] 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.
[0137] 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.
[0138] 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, and the method includes: receiving a transaction layer data packet sent by the second device according to a bus protocol transmission mode matched with the second device, the transaction layer data packet comprising an attribute field, the attribute field being stored in a user-defined signal included in the bus protocol matched with the second device, the attribute field comprising a plurality of field types, different field types being used to characterize different working modes adopted when the transaction layer data packet is executed in the first device, the working mode matching the bus protocol transmission mode of the first device; According to the field type corresponding to the attribute field stored in the user-defined signal, selecting a working mode adopted when the transaction layer data packet is executed in the first device from a plurality of working modes, and using the adopted working mode as a target working mode; According to the target working mode, the first device is controlled to perform data processing on the transaction layer data packet.
2. The method according to claim 1, characterized in that In the case of receiving a plurality of transaction layer data packets sent by the second devices, the attribute field further includes second device identification information of the second device sending the transaction layer data packets; The selecting, according to the field type, from a plurality of working modes, a working mode adopted when the transaction layer data packet is executed in the first device comprises: For each of the second devices, according to a preset identification correspondence, select preset identification information matching the second device identification information from multiple preset identification information, and use the matching preset identification information as the target identification information; the preset identification correspondence includes a correspondence between the second device identification information and the preset identification information, and the preset identification information is used to characterize the execution level of the transaction layer data packet in the first device; According to the execution level corresponding to each of the second devices and based on the field type, a working mode adopted when the transaction layer data packet is executed in the first device is selected from multiple working modes.
3. The method according to claim 1 or 2, characterized in that: The field type includes a first type and a second type, and the working mode includes a parallel mode and a serial mode; The selecting, according to the field type, from a plurality of working modes, a working mode adopted when the transaction layer data packet is executed in the first device comprises: In a case where the field type is the first type, using the parallel mode as the working mode adopted when the transaction layer data packet is executed in the first device; When the field type is the second type, the serial mode is used as the working mode adopted when the transaction layer data packet is executed in the first device.
4. The method according to claim 1, characterized in that: The receiving a transaction layer data packet sent by the second device according to the bus protocol transmission mode matching the second device includes: According to the bus protocol transmission mode matching the second device, the plurality of transaction layer data packets are stored in an execution queue in a transmission order, wherein the execution queue is used to store the transaction layer data packets to be executed; According to the target working mode, controlling the first device to process the transaction layer data packet includes: When the target working mode is a parallel mode, simultaneously processing data on a plurality of transaction layer data packets in the execution queue; When the target working mode is the serial mode, data processing is performed on the multiple transaction layer data packets in the execution queue in a transmission order.
5. The method according to claim 4, characterized in that The execution queue includes a preset number of storage locations, and the method further includes: When it is determined that the data processing of the target transaction layer data packet is completed, releasing the target storage location corresponding to the target transaction layer data packet in the execution queue to receive the next transaction layer data packet; The newly received transaction layer data packet is stored in the target storage location.
6. The method according to claim 4, characterized in that The transaction layer data packet includes a request type and a request address; data processing is performed in the following manner: A data processing operation corresponding to the request type is performed by the first device on the storage space corresponding to the request address.
7. The method according to any one of claims 1 to 6, characterized in that: The method further comprises: Under the condition of controlling the first device to process the transaction layer data packet, respectively obtaining returned data after the data processing from a plurality of parallel channels of the first device; Mapping the plurality of returned data into a serial data stream in a preset order; The serial data stream is sent to the second device.
8. A data processing device, characterized in that: The device is applied to a first device, and includes: a receiving module, configured to receive a transaction layer data packet sent by a second device according to a bus protocol transmission mode matched with the second device, wherein the transaction layer data packet includes an attribute field, wherein the attribute field is stored in a user-defined signal included in the bus protocol matched with the second device, and wherein the attribute field includes a plurality of field types, wherein different field types are used to characterize different working modes adopted when the transaction layer data packet is executed in the first device, and wherein the working mode matches the bus protocol transmission mode of the first device; A selection module, configured to select, from a plurality of working modes, a working mode adopted when the transaction layer data packet is executed in the first device according to the field type corresponding to the attribute field stored in the user-defined signal, and use the adopted working mode as a target working mode; A processing module is used to control the first device to process the transaction layer data packet according to the target working mode.
9. 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 7.
10. 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 7.
Citation Information
Patent Citations
Transaction layer packet format
CN114528241A