WO2024037076A1 - 数据交互方法、装置、系统、电子设备和存储介质 - Google Patents

数据交互方法、装置、系统、电子设备和存储介质 Download PDF

Info

Publication number
WO2024037076A1
WO2024037076A1 PCT/CN2023/094736 CN2023094736W WO2024037076A1 WO 2024037076 A1 WO2024037076 A1 WO 2024037076A1 CN 2023094736 W CN2023094736 W CN 2023094736W WO 2024037076 A1 WO2024037076 A1 WO 2024037076A1
Authority
WO
WIPO (PCT)
Prior art keywords
circuit unit
parameter
buffer
data processing
downlink
Prior art date
Application number
PCT/CN2023/094736
Other languages
English (en)
French (fr)
Inventor
吕永志
万红星
杨作兴
陈小桥
王忠平
Original Assignee
深圳比特微电子科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳比特微电子科技有限公司 filed Critical 深圳比特微电子科技有限公司
Publication of WO2024037076A1 publication Critical patent/WO2024037076A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/14Handling requests for interconnection or transfer
    • G06F13/16Handling requests for interconnection or transfer for access to memory bus
    • G06F13/1668Details of memory controller
    • G06F13/1673Details of memory controller using buffers
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/14Handling requests for interconnection or transfer
    • G06F13/16Handling requests for interconnection or transfer for access to memory bus
    • G06F13/1668Details of memory controller
    • G06F13/1684Details of memory controller using multiple buses
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/40Bus structure
    • G06F13/4063Device-to-bus coupling
    • G06F13/4068Electrical coupling

Definitions

  • This application relates to the field of data processing technology, and in particular to a data interaction method, device, system, electronic equipment and storage medium.
  • a complete embedded chip system includes a central processing unit (or central processing unit), a storage unit, a bus interconnection structure and an IP (Intellectual Property) module, etc.
  • the IP module can also be called IP core.
  • the normal operation of the IP module depends on the parameter configuration of the central processor, and the central processor also needs to obtain the current running status of the IP module and configure the parameters (or operation codes) to the IP module at the appropriate time.
  • Embodiments of the present application disclose a data interaction method, device, system, electronic equipment and storage medium to reduce the frequency of interaction between the IP module as a data processing circuit unit and the outside and avoid the performance impact of frequent interactions on the IP module. This improves the performance of the IP module.
  • a data interaction method including:
  • the output data stored in the uplink buffer is output in batches.
  • a data exchange device includes a downlink writing circuit unit, a downlink buffer circuit unit, a downlink reading circuit unit, an uplink writing circuit unit, an uplink buffering circuit unit, an uplink status monitoring circuit unit and an uplink reading circuit unit; among them,
  • the downlink writing circuit unit is configured to respond to the parameter writing operation signal sent by the central processing unit, obtain the first parameter and store it in the downlink buffer circuit unit;
  • the downstream buffer circuit unit is electrically connected to the downstream writing circuit unit and is used to store the first parameter
  • the downlink reading circuit unit is electrically connected to the downlink buffer circuit unit and the data processing circuit unit, and is used to obtain the second parameter from the downlink buffer circuit unit and send it to the data processing circuit unit;
  • the uplink writing circuit unit is electrically connected to the data processing circuit unit, and is used to store the output data corresponding to the second parameter obtained by the data processing circuit unit performing data processing based on the second parameter in the Upstream buffer circuit unit;
  • the upstream buffer circuit unit is electrically connected to the upstream write circuit unit and is used to store output data corresponding to the second parameter;
  • the uplink status monitoring circuit unit is electrically connected to the uplink buffer circuit unit and is used to record the number of output data stored in the uplink buffer circuit unit, and the number of output data stored in the uplink buffer circuit unit reaches When the output quantity threshold is reached, the storage status information of the upstream buffer circuit unit is sent to trigger a data read operation instruction, wherein the storage status information of the upstream buffer circuit unit is used to indicate that the upstream buffer circuit unit cannot continue to store new Output Data;
  • the upstream readout circuit unit is electrically connected to the upstream buffer circuit unit, and is configured to batch output the output data stored in the upstream buffer circuit unit in response to the data read operation instruction.
  • a data interaction system including:
  • a central processing unit that communicates through a bus and a data interaction device as described in any of the above items;
  • the central processing unit is configured to send the parameter write operation signal to the data interaction device through the bus, and in response to the received storage status information of the uplink buffer circuit unit, send the parameter write operation signal to the data interaction device.
  • the data reading operation instruction is executed and the output data output by the upstream readout circuit unit is received in batches.
  • An electronic device including:
  • Embodiments of the present application also provide a non-volatile computer-readable storage medium, wherein machine-readable instructions are stored in the storage medium, and the machine-readable instructions can be executed by a processor to complete the above method.
  • Embodiments of the present application also provide a computer program product.
  • the computer program product includes computer instructions.
  • the computer instructions are stored in a computer-readable storage medium. When the computer instructions are executed, the above data interaction method is implemented.
  • Figure 1 is a flow chart of a data interaction method according to some illustrative embodiments
  • Figure 2 is an embodiment flow chart illustrating management of downlink buffering according to some illustrative embodiments
  • Figure 3 is a flowchart illustrating a process of storing parameters according to some illustrative embodiments
  • Figure 4 is a flowchart illustrating a process of outputting data according to some illustrative embodiments
  • Figure 5 is a flow chart illustrating parameter sending using ping-pong buffering according to some exemplary embodiments
  • Figure 6 is a flow chart of the processing process in the case of data processing failure using ping-pong buffering according to some illustrative embodiments
  • Figure 7 is a schematic diagram of cache changes for parameter transmission using ping-pong buffering according to some exemplary embodiments
  • Figure 8 is a schematic diagram of a data interaction device according to some exemplary embodiments.
  • Figure 9 is a schematic diagram of application scenarios of data interaction methods and devices according to some exemplary embodiments.
  • Figure 10 is a schematic diagram of a data interaction system according to some illustrative embodiments.
  • FIG. 11 is a schematic structural diagram of an electronic device according to some exemplary embodiments.
  • registers are used in embedded chip systems to realize the interaction between the central processor and the IP module.
  • the central processor configures parameters (or operation codes) to the IP module through the bus interconnection structure, and the IP module follows the configuration After the parameters (or opcodes) are processed, the relevant information obtained is written into the status register. After the central processor queries the relevant information in the status register, it configures the next round of parameters (or opcodes) for the IP module.
  • this application provides a data interaction method, device, system, electronic device and storage medium, which are described in detail below.
  • Figure 1 is a flow chart of a data interaction method according to some illustrative embodiments. As shown in Figure 1, the data interaction method mainly includes the following operations S101 to S105.
  • the parameter write operation signal originates from the bus, and the parameter write operation signal may be sent by the central processing unit through the bus.
  • the direction of data flow from the outside (such as a central processing unit) to the data processing circuit unit is called the downstream direction, and a downstream buffer is set for this downstream direction.
  • the downstream buffer is a cache area used to store parameters required by the data processing circuit unit to perform data processing.
  • the data processing circuit unit may be an IP module.
  • the first parameter is stored in the downstream buffer, and the data processing circuit unit obtains the second parameter from the downstream buffer.
  • the second parameter is obtained from the downlink buffer and sent to the data processing circuit unit, the second parameter is further deleted from the downlink buffer.
  • Embodiments of the present disclosure utilize downlink buffering.
  • the central processing unit only stores the first parameter in the downlink buffer, and the data processing circuit unit only obtains the second parameter from the downlink buffer, so that the number of steps between the central processing unit and the data processing circuit unit is reduced in the parameter transfer process. interactions between the data processing circuit units, thereby reducing the frequency of the data processing circuit unit performing response operations in response to external data interactions, allowing the data processing circuit unit to have more time to perform data processing, thereby avoiding the consequences of frequent interactions on the data processing circuit unit. Performance impact, improving the performance of the data processing circuit unit.
  • the output data corresponding to the second parameter includes result data obtained by performing data processing based on the second parameter and status information obtained during the execution of data processing.
  • the direction of data flow from the data processing circuit unit to the outside is called the upstream direction, and an upstream buffer is set for this upstream direction.
  • the uplink buffer is a cache area used to store output data obtained by data processing performed by the data processing circuit unit.
  • S104 Record the number of output data stored in the uplink buffer, and when the number of output data stored in the uplink buffer reaches the output quantity threshold, send the storage status information of the uplink buffer to trigger a data read operation instruction, wherein the uplink buffer's storage status information is The storage status information is used to indicate that the uplink buffer cannot continue to store new output data.
  • the storage status information of the uplink buffer can be used to trigger the subject (such as a central processing unit) that receives the storage status information of the uplink buffer to issue a data read operation instruction to obtain the output data of the uplink buffer in batches, such as, You can obtain all the output data stored in the uplink buffer at one time, or you can also obtain part of the data stored in the uplink buffer.
  • the central processing unit may be configured to issue a data read operation instruction after receiving the storage status information of the uplink buffer.
  • the storage status information of the upstream buffer is sent through the bus and obtained by the central processing unit.
  • the central processing unit can obtain the output data stored in the upstream buffer in batches, and the data processing circuit unit only stores the output data in the upstream buffer, so that the output data is reduced in the process of uploading from the data processing circuit unit
  • the interaction between the central processing unit and the data processing circuit unit reduces the frequency of the data processing circuit unit interacting with the central processing unit in order to output data, allowing the data processing circuit unit to have more time to perform data processing, thus avoiding The performance impact of frequent interactions on the data processing circuit unit improves the performance of the data processing circuit unit.
  • the output data output in batches is further deleted from the uplink buffer.
  • the data read operation instructions originate from the bus, and the data read operation instructions may be issued by the central processing unit through the bus.
  • the output data is output over a bus.
  • the output data is output to a central processing unit.
  • the output data may also be output to a storage unit connected to a bus.
  • the output data stored in the uplink buffer is output in batches in response to the data read operation instruction, thereby realizing batch transmission of the output data and reducing the frequency of the data processing circuit unit interacting with the central processing unit in order to output data, so that The data processing circuit unit has more time to perform data processing, thereby This avoids the performance impact of frequent interactions on the data processing circuit unit and improves the performance of the data processing circuit unit.
  • the central processing unit which is the core of system scheduling, has a lot of work to handle.
  • the interaction between the central processing unit and the data processing circuit unit requires the central processing unit to Scheduling arrangements are made on the side.
  • the central processing unit needs to continuously process data in order to ensure the data processing of each data processing circuit unit. Send parameters to each data processing circuit unit and obtain respective output data from each data processing circuit unit. In this process, the central processing unit needs to continuously interact between each data processing circuit unit, which greatly increases the central processing time.
  • the interaction between the unit and the data processing circuit is time-consuming, making it impossible for the data processing circuit unit to fully release the data processing performance. Frequent interactions with each data processing circuit unit also increase the burden on the central processing unit.
  • the data processing circuit unit only needs to obtain the parameters required to perform data processing from the downstream buffer and store the output data in the upstream buffer. There is no need to obtain parameters and send output data.
  • the need to interact with the central processing unit can reduce the frequency of interaction between the data processing circuit unit and the central processing unit, so that the data processing circuit unit can fully release the performance of data processing.
  • the central processing unit is buffering in the upstream
  • the output data stored in the upstream buffer is output in batches, realizing the batch output form of output data, which can reduce the need for the central processing unit to perform output data
  • the frequency of interactions in the output process from the side of the data processing circuit unit helps reduce the burden on the central processing unit.
  • the data interaction method of the present disclosure may further include a management solution for the number of parameters stored in the downlink buffer.
  • Figure 2 is a flowchart of an embodiment of managing downlink buffering according to an illustrative embodiment. As shown in Figure 2, the process includes the following operations S201 to S203.
  • the first downstream storage status information and the second downstream storage status information are sent over the bus.
  • the first downstream storage status information indicates that the number of parameters stored in the downstream buffer reaches the input quantity upper limit threshold.
  • second The downstream storage status information indicates that the number of parameters stored in the downstream buffer does not exceed the input quantity lower limit threshold.
  • Adopting the above-mentioned method of managing the downlink buffer and cooperating with the work of the central processing unit that receives the first downlink storage status information and the second downlink storage status information and sends parameters through the bus can enable the central processing unit to receive the first downlink buffer status information. Stop sending parameters after the downlink storage status information, and continue to send parameters after receiving the second downlink storage status information, so that the central processing unit only needs to execute parameters based on the first downlink storage status information and the second downlink storage status information. Delivery avoids frequent interactions with the data processing circuit unit to determine whether the data processing circuit unit needs to receive parameters, which can reduce the burden on the central processing unit.
  • the parameter write operation signal can be sent by the central processing unit through the bus.
  • the signal transmission in the bus is performed according to the preset bus protocol, and the parameter write of the downstream buffer is
  • Figure 3 is a flow chart of a parameter storage process according to an exemplary embodiment. As shown in Figure 3, in response to the parameter write operation signal in S101, obtaining the first parameter and storing it in the downstream buffer includes:
  • the downstream buffer is FIFO (First Input First Output) or SRAM (Static Random-Access Memory).
  • FIFO has a first-in-first-out writing and reading strategy, which can ensure the consistency of the order of parameters written into FIFO and read out from FIFO, and ensure that the order of data processing by the data processing circuit unit is not disrupted.
  • SRAM can be used to write and read parameters according to the address index. It can also ensure the consistency of the order of parameters written to SRAM and read from SRAM, and ensure that the order of data processing by the data processing circuit unit is not disrupted. chaos.
  • Figure 4 is a flow chart of a process of outputting data according to an illustrative embodiment. As shown in Figure 4, in response to the data read operation instruction in S105, outputting the output data stored in the upstream buffer in batches includes:
  • the upstream buffer may also be in the form of FIFO or SRAM.
  • multiple methods can be used to obtain parameters from the downlink buffer and send them to the data processing circuit unit, including sequential reading, ping-pong buffering, and other methods.
  • sequential reading refers to obtaining one (or a group of) parameters in the downstream buffer and sending it to the data processing circuit unit in a specified order, such as first-in-first-out queue order, and the data processing circuit unit performs data processing based on the obtained parameters. Processing. After the data processing is completed, the next (or next group of) parameters in the downlink buffer are obtained and sent to the data processing circuit unit. The data processing circuit unit performs data processing according to the obtained next (or next group of) parameters, in sequence. analogy.
  • a ping-pong buffering method is used to obtain the second parameter from the downlink buffer and send it to the data processing circuit unit.
  • S102 obtains the second parameter from the downlink buffer and sends it to the data processing circuit unit, further including:
  • the second parameter is obtained from the downlink buffer and stored in the ping-pong buffer.
  • the second parameter is obtained from the ping-pong buffer and sent to the data processing circuit unit.
  • the ping-pong buffer includes two cache areas, wherein any one of the two cache areas is a first cache area, and the other cache area of the two cache areas except the first cache area is The second cache area, the two cache areas are used to store different parameters respectively.
  • Figure 5 is a flow chart of parameter transmission using ping-pong buffering according to an exemplary embodiment. As shown in Figure 5, based on the embodiment in which the ping-pong buffer includes two cache areas, the second parameter is obtained from the downlink buffer and Stored in the ping pong buffer, further including:
  • the data interaction method according to the embodiment of the present disclosure further includes the following operations S503 to S507.
  • Figure 6 is a flow chart of a processing process using ping-pong buffering according to an exemplary embodiment. As shown in Figure 6, based on ping-pong buffering, the data interaction method of the embodiment of the present disclosure can further include the following operations S601 to S603 process.
  • whether the data processing circuit unit fails to perform data processing can be determined by the data processing circuit unit itself. For example, the data processing circuit unit can obtain its execution status through the information of its status flag bit, thereby determining whether the data processing fails. Among them, the execution status can be set accordingly according to whether the data processing circuit unit completes data processing.
  • Figure 7 is a schematic diagram of cache changes for parameter transmission in a ping-pong buffering manner according to an exemplary embodiment. As shown in Figure 7, the change process is as follows.
  • parameters such as parameter A, parameter B, and parameter C are stored in the first-in-first-out queue in sequence.
  • parameter A in the first-in-first-out queue enters a cache location in the ping-pong buffer, and the next parameter in the first-in-first-out queue that will be sent to the ping-pong buffer is parameter B.
  • parameter A is because It has entered the ping-pong buffer so it is deleted from the first-in-first-out queue.
  • parameter B in the first-in-first-out queue enters another cache location in the ping-pong buffer, and the next parameter in the first-in-first-out queue that will be sent to the ping-pong buffer is parameter C.
  • parameter B Because it has entered the ping-pong buffer, it is deleted from the first-in-first-out queue.
  • parameter A is obtained from the ping-pong buffer and sent to the data processing circuit unit.
  • the data processing circuit unit performs data processing based on parameter A.
  • parameter A is not deleted from the ping-pong buffer.
  • the data processing circuit unit fails to perform data processing based on parameter A, because parameter A is still stored in the ping-pong buffer, the data processing circuit unit can still obtain parameter A and perform data processing based on parameter A again.
  • S705 can be entered.
  • the parameter B is obtained from the ping-pong buffer and sent to the data processing circuit unit.
  • the data processing circuit unit performs the data processing based on the parameter A based on the parameter A.
  • B performs data processing.
  • parameter B is not deleted in the ping-pong buffer.
  • Parameter C in the FIFO queue enters the cache location where the original parameter A in the ping-pong buffer is located, and the next one in the FIFO queue will be sent.
  • the parameter of the ping-pong buffer is parameter D. At this time, parameter C is deleted from the first-in-first-out queue because it has entered the ping-pong buffer.
  • the parameter C is obtained from the ping-pong buffer and sent to the data processing circuit unit, which performs the data processing based on the parameter B. C performs data processing.
  • parameter C is not deleted in the ping-pong buffer.
  • Parameter D in the first-in-first-out queue enters the cache location where the original parameter B in the ping-pong buffer is located, and the next one in the first-in-first-out queue will be sent.
  • the parameter of the ping-pong buffer is parameter E. At this time, parameter D is deleted from the first-in-first-out queue because it has entered the ping-pong buffer.
  • the data processing circuit unit When the data processing circuit unit fails to perform data processing based on the parameter C, because the parameter C is still stored in the ping-pong buffer, the data processing circuit unit can still obtain the parameter C and perform data processing based on the parameter C again.
  • the data processing circuit unit When the data processing circuit unit performs data processing based on parameter C without failure and completes the execution normally, the data processing circuit unit can obtain parameters such as parameter D, parameter E, parameter F, and parameter G according to the above description.
  • the failure of data processing may refer to an error in the data processing result.
  • the data processing process is terminated due to incomplete data processing due to various reasons, resulting in an error in the data processing result.
  • parameter A can represent a parameter or a group of parameters.
  • Parameter A represents the combination of all parameters required by the data processing circuit unit for a data processing. All parameters are set according to the function and application environment of the specific data processing circuit unit, and may be one parameter or more than one parameter.
  • the data interaction method of the embodiment of the present disclosure can reduce the frequency of interaction between the data processing circuit unit and the outside during the data interaction process in the downstream direction from the outside to the data processing circuit unit and from the data processing circuit unit to the outside in the upstream direction, which is helpful to Avoiding the performance impact of frequent interactions on the data processing circuit unit helps improve the performance of the data processing circuit unit.
  • a downlink buffering hardware method is used in the downlink direction from the outside to the data processing circuit unit to store the parameters required by the data processing circuit unit for data processing.
  • the data processing circuit unit directly obtains the parameters from the downlink buffer for data processing.
  • the output data output by the data processing circuit unit is stored, and when the number of data in the uplink buffer reaches the output quantity threshold, the output data is sent to the outside in batches.
  • the data processing unit does not need to interact with the outside once for each output data. This can reduce the frequency of the data processing unit's interaction with the outside in order to output output data, and reduce the frequency of the data processing unit's interaction with the outside in order to obtain parameters and output data, which helps to avoid frequent interactions that bring problems to the data processing circuit unit.
  • the downlink buffer adopts a first-in-first-out queue method, so that the data processing circuit unit can perform data processing sequentially in the order provided by the parameters, avoiding confusion in the data processing process, and using a ping-pong buffer method from The downstream buffer provides parameters to the data processing circuit unit, so that if the data processing is not performed correctly, the data processing circuit unit can regain the parameters for which the data processing is not performed correctly and perform data processing again, ensuring the correctness of the output data.
  • Figure 8 is a schematic diagram of a data exchange device according to an exemplary embodiment.
  • the data exchange device includes a downlink write circuit unit 801, a downlink buffer circuit unit 802, a downlink read circuit unit 803, an uplink Write circuit unit 804, uplink buffer circuit unit 805, uplink status monitoring circuit unit 806, and uplink read circuit unit 807.
  • a data interaction device further includes: a data processing circuit unit 809.
  • a data processing circuit unit 809 In the following, in order to clearly describe the interaction process between the data interaction device and the data processing circuit unit 809, each module will be described in detail.
  • the downlink writing circuit unit 801 is used to respond to the parameter writing operation signal sent by the central processing unit, obtain the first parameter and store it in the downlink buffer circuit unit 802.
  • the downstream writing circuit unit 801 is communicatively connected to the bus, and the parameter writing operation signal and the first parameter originate from the bus.
  • the parameter writing circuit unit 801 The input operation signal and the first parameter may be sent by the central processing unit through the bus.
  • the downstream buffer circuit unit 802 is electrically connected to the downstream writing circuit unit 801 and is used to store the first parameter.
  • the downlink buffer circuit unit 802 is an SRAM.
  • the downlink buffer circuit unit 802 stores the first parameter in a first-in-first-out queue buffering manner.
  • the downlink reading circuit unit 803 is electrically connected to the downlink buffer circuit unit 802 and the data processing circuit unit 809.
  • the downlink reading circuit unit 803 is used to obtain the second parameter from the downlink buffer circuit unit 802 and send it to the data processing circuit unit 809.
  • the upstream writing circuit unit 804 is electrically connected to the data processing circuit unit 809.
  • the upstream writing circuit unit 804 is used to store the output data obtained by the data processing circuit unit 809 in the upstream buffer circuit unit 805.
  • the upstream buffer circuit unit 805 is electrically connected to the upstream writing circuit unit 804, and the upstream buffer circuit unit 805 is used to store output data.
  • the upstream status monitoring circuit unit 806 is electrically connected to the upstream buffer circuit unit 805, and is used to record the number of output data stored in the upstream buffer circuit unit 805, and when the number of output data stored in the upstream buffer circuit unit 805 reaches the output quantity threshold. , sending the storage status information of the uplink buffer circuit unit 805 to trigger the data read operation instruction, where the storage status information of the uplink buffer circuit unit 805 is used to indicate that the uplink buffer circuit unit 805 cannot continue to store new output data.
  • the upstream status monitoring circuit unit 806 is communicatively connected to the bus, and sends the storage status information of the upstream buffer circuit unit 805 through the bus.
  • the storage status information of the upstream buffer circuit unit 805 is transmitted by the central processing unit. Obtain, thus triggering the central processing unit to issue data read operation instructions.
  • the upstream readout circuit unit 807 is electrically connected to the upstream buffer circuit unit 805.
  • the upstream readout circuit unit 807 is configured to batch output the output data stored in the upstream buffer circuit unit 805 in response to the data read operation instruction.
  • the upstream readout circuit unit 807 is communicatively connected to the bus, and the data read operation instructions come from the bus.
  • the data read operation instructions can be issued by the central processing unit through the bus, and the output data can be Through the bus output, the output data can be received by the central processing unit or by the storage unit connected to the bus.
  • the data processing circuit unit 809 is configured to perform data processing based on the second parameter to obtain output data corresponding to the second parameter, and send the output data corresponding to the second parameter to the upstream writing circuit unit 804 .
  • the data exchange device further includes a downlink status monitoring circuit unit 808 .
  • the downlink status monitoring circuit unit 808 is electrically connected to the downlink buffer circuit unit 802.
  • the downstream status monitoring circuit unit 808 is communicatively connected to the bus.
  • the downlink status monitoring circuit unit 808 is used to: record the number of parameters stored in the downlink buffer circuit unit 802; when the number of parameters stored in the downlink buffer circuit unit 802 changes from less than the input quantity upper limit threshold to greater than or equal to the input quantity upper limit threshold, Send the first downlink storage status information; when the number of parameters stored in the downlink buffer circuit unit 802 changes from greater than the input quantity lower limit threshold to less than or equal to the input quantity lower limit threshold, send the second downlink storage status information; wherein, the first downlink storage status information is sent.
  • the row storage status information is used to indicate that the downlink buffer circuit unit 802 cannot continue to store new parameters and controls the central processing unit to stop sending parameter write operation signals to suspend parameter delivery.
  • the second downlink storage status information is used to indicate that the downlink buffer circuit unit 802 You can continue to store new parameters and control the central processing unit to resume issuing parameter writing operation signals to resume issuing parameters.
  • the downstream status monitoring circuit unit 808 sends the first downstream storage status information and the second downstream storage status information through the bus.
  • the downlink status monitoring circuit unit 808 adopts the above-mentioned method of managing the downlink buffer circuit unit 802 and cooperates with the work of the central processing unit that receives the first downlink storage status information and the second downlink storage status information and sends parameters through the bus, and can
  • the central processing unit is caused to stop sending parameters after receiving the first downlink storage status information, and resume sending parameters after receiving the second downlink storage status information, so that the central processing unit only needs to be based on the first downlink storage status information and
  • the second downstream storage status information executes the delivery of parameters, thereby avoiding frequent interactions between the central processing unit and the data processing circuit unit 809 to determine whether the data processing circuit unit 809 needs to receive parameters, which can reduce the burden on the central processing unit. .
  • the downlink read circuit unit 803 includes a downlink read control sub-circuit unit and a ping-pong buffer sub-circuit unit.
  • the downlink read control sub-circuit unit is used to: obtain the second parameter from the downlink buffer circuit unit 802 and store it in the ping-pong buffer sub-circuit unit, obtain the second parameter from the ping-pong buffer sub-circuit unit and send it to the data processing circuit Unit 809.
  • the ping-pong buffer sub-circuit unit includes two cache areas, namely a first cache area and a second cache area.
  • the two cache areas are used to store different parameters respectively; the downlink read control sub-circuit unit further uses At:
  • the first cache area does not store any parameters, obtain the second parameters from the downlink buffer circuit unit 802 and store them in the first cache area; otherwise,
  • the second cache area does not store any parameters
  • the second parameters are obtained from the downlink buffer circuit unit 802 and stored in the second cache area.
  • the downlink reading circuit unit 803 is further used for:
  • the data processing circuit unit 809 performs data processing based on the second parameter obtained from the first cache area If it fails, obtain the second parameter from the first cache area again and send it to the data processing circuit unit 809;
  • the data processing circuit unit 809 successfully performs data processing based on the second parameter obtained from the first cache area, the second parameter in the first cache area is deleted from the first cache area, and the second parameter in the second cache area is obtained.
  • the currently stored third parameter is sent to the data processing circuit unit 809;
  • the data processing circuit unit 809 fails to perform data processing based on the second parameter obtained from the second cache area, the second parameter is obtained from the second cache area again and sent to the data processing circuit unit 809;
  • the data processing circuit unit 809 successfully performs data processing based on the second parameter obtained from the second cache area, the second parameter in the second cache area is deleted from the second cache area, and the data in the first cache area is obtained.
  • the currently stored fourth parameter is sent to the data processing circuit unit 809.
  • the downlink reading circuit unit 803 is also used for:
  • the data processing circuit unit 809 fails to perform data processing based on the second parameter, obtain the second parameter again from the ping-pong buffer sub-circuit unit and send it to the data processing circuit unit 809;
  • the new second parameters are read from the downstream buffer circuit unit 802 and stored in the ping-pong buffer sub-circuit unit.
  • the uplink readout circuit unit 807 and the downlink status monitoring circuit unit 808 both adopt the form of hardware circuit modules.
  • the data processing circuit unit 809 also takes the form of a hardware circuit module.
  • the data processing circuit unit 809 can be an IP module alone, or can be combined with other modules to form an IP module.
  • the downlink reading circuit unit 803, the uplink writing circuit unit 804, the uplink buffer circuit unit 805, the uplink status monitoring circuit unit 806, the uplink reading circuit unit 807 and the downlink status monitoring circuit unit 808 can also be used as independent IP modules. exist.
  • FIG 9 is a schematic diagram of an application scenario of a data interaction method and device according to an exemplary embodiment.
  • the application scenario is image compression of image data from an image sensor in a System on Chip (SOC) system.
  • the data processing circuit unit 809 is used to perform image compression on the image data of the image sensor.
  • the downlink buffer circuit unit 802 adopts The parameters are stored in a first-in-first-out queue buffering manner, and the downstream reading circuit unit 803 adopts a ping-pong buffering strategy.
  • the image data collected by the image sensor is first parsed after being sent to the on-chip system. After compression processing, it is written into the system memory through the DMA (Direct Memory Access) channel.
  • DMA Direct Memory Access
  • the compression processing of image data and the parameters written into the system memory address are written by the central processing unit through the downlink writing circuit unit 801 into the downlink buffer circuit unit 802.
  • the downstream reading circuit unit 803 reads the parameter from the first-in-first-out queue of the downstream buffer circuit unit 802 and sends it to the data processing circuit unit 809.
  • the data processing circuit unit 809 starts the compression processing of the current frame data, and the compression processing is completed.
  • the data processing circuit unit 809 feeds back the execution completion message to the downstream reading circuit unit 803, and stores the output data (image compression data and status information) obtained after the compression process in the upstream buffer circuit through the upstream writing circuit unit 804.
  • Unit 805 is used for uploading by the uplink reading circuit unit 807.
  • the downstream reading circuit unit 803 adopts a ping-pong buffering strategy. The downstream reading circuit unit 803 first reads the first (group) parameter from the downstream buffering circuit unit 802 and puts it into the first sub-buffer in the ping-pong buffer.
  • the downstream reading circuit unit 803 reads the second (group) parameter from the downstream buffer circuit unit 802 and puts it into the second parameter in the ping-pong buffer.
  • sub-buffer position if the data processing circuit unit 809 returns the first (group) parameter and executes correctly, the downstream reading circuit unit 803 sends the second (group) parameter of the second sub-buffer position to the data processing circuit unit 809, Then read the third (group) parameter from the downlink buffer circuit unit 802 and put it into the first sub-buffer position in the ping-pong buffer.
  • the downlink read The circuit unit 803 again sends the first (group) parameters of the first sub-buffer position to the data processing circuit unit 809, thereby ensuring the correctness of the output data and avoiding leakage of parameters in the downlink buffer circuit unit 802.
  • FIG 10 is a schematic diagram of a data interaction system according to an illustrative embodiment.
  • the data interaction system includes a central processing unit 1001 and a data interaction device 1002 that are communicated through a bus.
  • the data interaction device 1002 It is the data interaction device of any of the above embodiments.
  • the central processing unit 1001 is used to send a parameter write operation signal to the data interaction device 1002 through the bus, and in response to the received storage status information of the upstream buffer circuit unit 805, send a data read operation instruction to the data interaction device 1002 and receive
  • the downstream reading circuit unit 803 outputs the output data in batches.
  • the central processing unit 1001 is also configured to: when receiving the first downlink storage status information, Stop sending the parameter write operation signal to the data interaction device 1002, and continue to send the parameter write operation signal to the data interaction device 1002 when the second downlink storage status information is received.
  • FIG. 11 is a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure.
  • the electronic device is a server.
  • the electronic device 1100 may vary greatly due to different configurations or performance, and may include one or more processors (Central Processing Units, CPU) 1101 and one or more memories 1102, wherein the memory 1102 stores At least one program code is loaded and executed by the processor 1101 to implement the data interaction method provided by the above embodiments.
  • the electronic device 1100 may also have components such as wired or wireless network interfaces, keyboards, and input and output interfaces for input and output.
  • the electronic device 1100 may also include other components for realizing device functions, which will not be described again here.
  • a computer-readable storage medium including at least one instruction, such as a memory including at least one instruction, is also provided.
  • the at least one instruction can be executed by a processor in a computer device to complete the above embodiments. Data interaction methods.
  • the above-mentioned computer-readable storage medium may be a non-transitory computer-readable storage medium.
  • the non-transitory computer-readable storage medium may include ROM (Read-Only Memory), RAM (Random-Access Memory). memory), CD-ROM (Compact Disc Read-Only Memory), tapes, floppy disks and optical data storage devices, etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Information Transfer Systems (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本申请公开了一种数据交互方法、装置、系统、电子设备和存储介质,该数据交互方法包括:响应于中央处理单元发出的参数写入操作信号,获得第一参数并存储于下行缓冲;从下行缓冲中获取第二参数并发送给数据处理电路单元,以使数据处理电路单元基于所述第二参数执行数据处理以获得所述第二参数对应的输出数据;将所述第二参数对应的输出数据存储于上行缓冲;记录上行缓冲中存储的输出数据的数量,并在上行缓冲中存储的输出数据的数量达到输出数量阈值时,发送上行缓冲的存储状态信息以触发数据读取操作指令;响应于所述数据读取操作指令,批量输出上行缓冲中存储的输出数据。

Description

数据交互方法、装置、系统、电子设备和存储介质
本申请要求于2022年8月17日提交中国专利局、申请号为202210985974.4,发明名称为“数据交互方法、装置、系统、电子设备和存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及数据处理技术领域,特别涉及一种数据交互方法、装置、系统、电子设备和存储介质。
背景技术
通常来说,一套完整的嵌入式芯片系统包括中央处理器(或者称为中央处理单元)、存储单元、总线互联结构和IP(Intellectual Property,知识产权)模块等,其中IP模块也可以称为IP核。IP模块的正常工作会依赖于中央处理器的参数配置,并且中央处理器也需要获取当前IP模块的运行状态,在合适的时间点将参数(或操作码)配置给IP模块。
技术内容
本申请实施例公开了一种数据交互方法、装置、系统、电子设备和存储介质,以减少作为数据处理电路单元的IP模块与外部的交互频次,避免频繁交互给IP模块带来的性能影响,进而提升IP模块的性能。
本公开的技术方案是这样实现的:
一种数据交互方法,包括:
响应于中央处理单元发出的参数写入操作信号,将所获得的第一参数存储于下行缓冲;
从所述下行缓冲中获取第二参数并发送给数据处理电路单元,以使所述数据处理电路单元基于所述第二参数执行数据处理以获得所述第二参数对应的输出数据;
将所述第二参数对应的输出数据存储于上行缓冲;
记录所述上行缓冲中存储的输出数据的数量,并在所述上行缓冲中存储的输出数据的数量达到输出数量阈值时,发送所述上行缓冲的存储状态信息以触发数据读取操作指令,其中,所述上行缓冲的存储状态信息用于表征所述上行缓冲不可继续存储新的输出 数据;
响应于所述数据读取操作指令,批量输出所述上行缓冲中存储的所述输出数据。
一种数据交互装置,所述数据交互装置包括下行写入电路单元、下行缓冲电路单元、下行读取电路单元、上行写入电路单元、上行缓冲电路单元、上行状态监控电路单元和上行读出电路单元;其中,
所述下行写入电路单元,用于响应于中央处理单元发出的参数写入操作信号,获得第一参数并存储于所述下行缓冲电路单元;
所述下行缓冲电路单元电连接于所述下行写入电路单元,用于存储所述第一参数;
所述下行读取电路单元电连接于所述下行缓冲电路单元和数据处理电路单元,用于从所述下行缓冲电路单元中获取第二参数并发送给所述数据处理电路单元;
所述上行写入电路单元电连接于所述数据处理电路单元,用于将由所述数据处理电路单元基于所述第二参数执行数据处理获得的所述第二参数对应的输出数据存储于所述上行缓冲电路单元;
所述上行缓冲电路单元电连接于所述上行写入电路单元,用于存储所述第二参数对应的输出数据;
所述上行状态监控电路单元电连接于所述上行缓冲电路单元,用于记录所述上行缓冲电路单元中存储的输出数据的数量,并在所述上行缓冲电路单元中存储的输出数据的数量达到输出数量阈值时,发送所述上行缓冲电路单元的存储状态信息以触发数据读取操作指令,其中,所述上行缓冲电路单元的存储状态信息用于表征所述上行缓冲电路单元不可继续存储新的输出数据;
所述上行读出电路单元电连接于所述上行缓冲电路单元,用于响应于所述数据读取操作指令,批量输出所述上行缓冲电路单元中存储的输出数据。
一种数据交互系统,包括:
通过总线进行通讯连接的中央处理单元和如上任一项所述的数据交互装置;其中,
所述中央处理单元用于通过所述总线向所述数据交互装置发出所述参数写入操作信号,响应于接收到的所述上行缓冲电路单元的存储状态信息,向所述数据交互装置发出所述数据读取操作指令并接收所述上行读出电路单元批量输出的输出数据。
一种电子设备,包括:
处理器;
与所述处理器相连接的存储器;所述存储器中存储有机器可读指令模块;所述机器 可读指令模块包括:
本申请实施例还提供了一种非易失性计算机可读存储介质,其中所述存储介质中存储有机器可读指令,所述机器可读指令可以由处理器执行以完成上述方法。
本申请实施例还提供了一种计算机程序产品,所述计算机程序产品包括计算机指令,所述计算机指令存储在计算机可读存储介质中,当所述计算机指令被执行时,实现上述数据交互方法。
附图简要说明
图1是根据一些示意性实施例示出的数据交互方法流程图;
图2是根据一些示意性实施例示出的对下行缓冲进行管理的实施例流程图;
图3是根据一些示意性实施例示出的存储参数过程的流程图;
图4是根据一些示意性实施例示出的输出输出数据过程的流程图;
图5是根据一些示意性实施例示出的采用乒乓缓冲的方式进行参数发送的流程图;
图6是根据一些示意性实施例示出的采用乒乓缓冲的方式在数据处理失败情况下的处理过程流程图;
图7是根据一些示意性实施例示出的乒乓缓冲的方式进行参数发送的缓存变化示意图;
图8是根据一些示意性实施例示出的一种数据交互装置示意图;
图9是根据一些示意性实施例示出的数据交互方法、装置的应用场景示意图;
图10是根据一些示意性实施例示出的一种数据交互系统示意图;
图11是根据一些示意性实施例提供的电子设备的结构示意图。
具体实施方式
为使本申请的目的、技术方案和优点更加清楚,下面结合附图对本申请作进一步的详细阐述。
需要说明的是,本公开的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本公开的实施例能够以除了在这里图示或描述的那些以外的顺序实施。以下示例性实施例中所描述的实施方式并不代表与本公开相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本公开的 一些方面相一致的装置和方法的例子。
在一些实例中,嵌入式芯片系统中采用寄存器的方式实现中央处理器与IP模块之间的交互,中央处理器通过总线互联结构将参数(或操作码)配置给IP模块,IP模块按照所配置的参数(或操作码)完成处理后将处理得到的相关信息写进状态寄存器,中央处理器在状态寄存器查询到相关信息后,对IP模块进行下一轮参数(或操作码)的配置。采用这种交互方式,对于参数多、实时性要求高的IP模块来说,受制于寄存器存储容量的限制,会严重限制IP模块的性能。因此,如何解决IP模块与外部的交互对IP模块所带来的性能影响,便成为亟待解决的问题。
为解决上述技术问题,本申请提供了一种数据交互方法、装置、系统、电子设备和存储介质,以下进行详细介绍。
图1是根据一些示意性实施例示出的数据交互方法流程图,如图1所示,该数据交互方法主要包括以下操作S101至S105。
S101、响应于中央处理单元发出的参数写入操作信号,获得第一参数并存储于下行缓冲。
在一些实施例中,参数写入操作信号来源于总线,参数写入操作信号可以是中央处理单元通过总线发出的。
本公开实施例中,将从外部(如中央处理单元)到数据处理电路单元的数据流转方向称为下行方向,针对该下行方向设置了下行缓冲。下行缓冲是一缓存区域,用于存储数据处理电路单元执行数据处理所需的参数。
S102、从下行缓冲中获取第二参数并发送给数据处理电路单元,以使数据处理电路单元基于第二参数执行数据处理以获得第二参数对应的输出数据。
在一些实施例中,数据处理电路单元可以是IP模块。本公开实施例中,将第一参数存储于下行缓冲,数据处理电路单元从下行缓冲获取第二参数。
本公开实施例中,在从下行缓冲中获取第二参数并发送给数据处理电路单元后,进一步将该第二参数从所述下行缓冲中删除。
本公开实施例利用下行缓冲,中央处理单元只向下行缓冲存储第一参数,并且数据处理电路单元只从下行缓冲获取第二参数,使得参数传递过程中减少了中央处理单元和数据处理电路单元之间的交互,从而减少了数据处理电路单元为了响应外部数据交互而执行响应操作的频次,使得数据处理电路单元有更多的时间执行数据处理,从而避免了频繁交互给数据处理电路单元带来的性能影响,提升了数据处理电路单元的性能。
S103、将第二参数对应的输出数据存储于上行缓冲。
在一些实施例中,第二参数对应的输出数据包括基于第二参数执行数据处理所得到的结果数据和在执行数据处理过程中所得到的状态信息。
本公开实施例中,将从数据处理电路单元到外部(如中央处理单元)的数据流转方向称为上行方向,针对该上行方向设置了上行缓冲。上行缓冲是一缓存区域,用于存储数据处理电路单元执行数据处理获得的输出数据。
S104、记录上行缓冲中存储的输出数据的数量,并在上行缓冲中存储的输出数据的数量达到输出数量阈值时,发送上行缓冲的存储状态信息以触发数据读取操作指令,其中,上行缓冲的存储状态信息用于表征上行缓冲不可继续存储新的输出数据。
在一些实施例中,上行缓冲的存储状态信息可以用于触发接收该上行缓冲的存储状态信息的主体(如中央处理单元)发出数据读取操作指令以批量获取上行缓冲存储的输出数据,比如,可以一次性获取上行缓冲中存储的全部输出数据,或者,也可以获取上行缓冲中存储的部分数据。其中,中央处理单元可以配置为在接收到上行缓冲的存储状态信息后发出数据读取操作指令。
在一些实施例中,上行缓冲的存储状态信息通过总线发送,并由中央处理单元获取。基于这种情况,中央处理单元可以批量的获取上行缓冲中存储的输出数据,并且,数据处理电路单元只向上行缓冲存储输出数据,使得输出数据在从数据处理电路单元进行上传的过程中减少了中央处理单元和数据处理电路单元之间的交互,从而减少了数据处理电路单元为了输出数据而与中央处理单元进行交互的频次,使得数据处理电路单元有更多的时间执行数据处理,从而避免了频繁交互给数据处理电路单元带来的性能影响,提升了数据处理电路单元的性能。
S105、响应于数据读取操作指令,批量输出上行缓冲中存储的输出数据。
本公开实施例中,批量输出上行缓冲中存储的输出数据之后,进一步将该被批量输出的输出数据从上行缓冲中删除。
在一些实施例中,数据读取操作指令来源于总线,数据读取操作指令可以是中央处理单元通过总线发出的。在一些实施例中,输出数据通过总线输出。在一些实施例中,输出数据是输出至中央处理单元,在一些实施例中,输出数据也可以是输出至连接于总线的存储单元。采用上述方式,响应于数据读取操作指令而批量输出上行缓冲中存储的输出数据,实现了输出数据的批量传输,减少了数据处理电路单元为了输出数据而与中央处理单元进行交互的频次,使得数据处理电路单元有更多的时间执行数据处理,从而 避免了频繁交互给数据处理电路单元带来的性能影响,提升了数据处理电路单元的性能。
需要说明的是,作为系统调度核心的中央处理单元有大量工作需要处理,通常来说,为确保系统整体运行的通畅和稳定,中央处理单元与数据处理电路单元之间的交互需要中央处理单元一侧进行调度安排,在系统中同时存在多个数据处理电路单元时,在不采用本公开实施例的数据交互方法的情况下,中央处理单元为了确保各个数据处理电路单元的数据处理,需要不断地向各个数据处理电路单元发送参数,并从各个数据处理电路单元获取各自的输出数据,在这个过程中,中央处理单元需要不断地在各个数据处理电路单元之间进行交互,极大地增加了中央处理单元和数据处理电路的交互耗时,使得数据处理电路单元无法充分释放数据处理的性能,与各个数据处理电路单元之间的频繁交互也增加了中央处理单元的负担。在采用本公开实施例的数据交互方法的情况下,数据处理电路单元只需要从下行缓冲获取执行数据处理所需要的参数并将输出数据存储于上行缓冲,对于参数的获取和输出数据的发送不需要与中央处理单元进行交互,可减少数据处理电路单元和中央处理单元的交互频次,使得数据处理电路单元能够充分释放数据处理的性能,在输出数据的输出过程中,中央处理单元是在上行缓冲中存储的输出数据的数量达到输出数量阈值的情况下发出数据读取操作指令,并且批量输出上行缓冲中存储的输出数据,实现了输出数据的批量输出形式,可减少中央处理单元在执行输出数据从数据处理电路单元一侧输出过程中的交互频次,有助于减轻中央处理单元的负担。
除了对上行缓冲的输出数据数量的管理外,在一些实施例中,本公开的数据交互方法还可以进一步包括对下行缓冲存储的参数数量的管理方案。图2是根据一示意性实施例示出的对下行缓冲进行管理的实施例流程图,如图2所示,该过程包括以下操作S201至S203。
S201、记录下行缓冲中存储的参数的数量。
S202、在下行缓冲中存储的参数的数量上升到大于或等于输入数量上限阈值时,发送第一下行存储状态信息,第一下行存储状态信息用于表征下行缓冲不可继续存储新的参数,并控制中央处理单元中止发出参数写入操作信号从而暂停下发参数。
S203、在下行缓冲中存储的参数的数量下降到小于或等于输入数量下限阈值时,发送第二下行存储状态信息,第二下行存储状态信息用于表征下行缓冲可以继续存储新的参数,并控制中央处理单元恢复发出参数写入操作信号从而恢复下发参数。
在一些实施例中,第一下行存储状态信息和第二下行存储状态信息通过总线发送。第一下行存储状态信息表征下行缓冲中存储的参数的数量达到输入数量上限阈值。第二 下行存储状态信息表征下行缓冲中存储的参数的数量未超过输入数量下限阈值。
采用上述对下行缓冲进行管理的方式,配合于接收第一下行存储状态信息和第二下行存储状态信息并通过总线下发参数的中央处理单元的工作,能够使得中央处理单元在接收到第一下行存储状态信息之后中止下发参数,在接收到第二下行存储状态信息之后继续下发参数,使得中央处理单元只需要基于第一下行存储状态信息和第二下行存储状态信息执行参数的下发,避免了与数据处理电路单元之间的频繁交互来确定数据处理电路单元是否需要接收参数的情况,可减轻中央处理单元的负担。
在基于参数写入操作信号来源于总线,参数写入操作信号可以是中央处理单元通过总线发出的实施例中,总线中的信号传输依据预设的总线协议执行,而对下行缓冲的参数写入操作和从上行缓冲的输出数据的读取操作与总线协议之间可能存在不兼容的问题,基于这种情况,需要在总线协议与下行缓冲的参数写入操作之间,以及上行缓冲的输出数据读取操作与总线协议之间,进行协议转换。因此,在S101和S105中还可以进一步包括关于协议转换的过程。
图3是根据一示意性实施例示出的存储参数过程的流程图,如图3所示,S101的响应于参数写入操作信号,获得第一参数并存储于下行缓冲,包括:
S1011、响应于参数写入操作信号,获得第一参数;
S1012、将参数写入操作信号转换为写入下行缓冲操作的电写入信号,其中,参数写入操作信号基于总线协议;
S1013、基于电写入信号,将第一参数存储于下行缓冲。
在一些实施例中,下行缓冲为FIFO(先进先出队列,First Input First Output)或者SRAM(Static Random-Access Memory,静态随机存取存储器)。其中,FIFO具有先进先出的写入读出策略,能够确保写入FIFO和从FIFO读出的参数的顺序的一致性,保证数据处理电路单元对数据处理的先后顺序不被打乱。其中,采用SRAM可以按照地址索引的方式写入和读出参数,同样能够保证写入SRAM和从SRAM读出的参数的顺序的一致性,保证数据处理电路单元对数据处理的先后顺序不被打乱。
图4是根据一示意性实施例示出的输出输出数据过程的流程图,如图4所示,S105的响应于数据读取操作指令,批量输出上行缓冲中存储的输出数据,包括:
S1051、响应于数据读取操作指令,从上行缓冲中批量读取输出数据;
S1052、将批量读取的输出数据转换为基于总线协议的信号并通过总线发送。
在一些实施例中,上行缓冲也可以采用FIFO或者SRAM的形式。
在一些实施例中,可以采用多种方式实现从下行缓冲中获取参数并发送给数据处理电路单元,包括顺序读取、乒乓缓冲等方式。其中,顺序读取是指按照指定顺序,如按照先进先出队列的顺序,获取下行缓冲中的一个(或一组)参数并发送给数据处理电路单元,数据处理电路单元根据得到的参数进行数据处理,数据处理完毕后,获取下行缓冲中的下一个(或下一组)参数并发送给数据处理电路单元,数据处理电路单元根据得到的下一个(或下一组)参数进行数据处理,依次类推。然而,顺序读取的方式,可能存在由于数据处理电路单元的数据处理失败并且该数据处理所需要的参数已从下行缓冲中自动删除而无法再次获得,使得数据处理电路单元无法重新执行该数据处理以进行纠正的问题。因此,在一些实施例中,采用乒乓缓冲的方式实现从下行缓冲中获取第二参数并发送给数据处理电路单元。
在一些实施例中,S102的从下行缓冲中获取第二参数并发送给数据处理电路单元,进一步包括:
从下行缓冲中获取第二参数并存入乒乓缓冲中,从乒乓缓冲中获取所述第二参数并发送给数据处理电路单元。
在一些实施例中,乒乓缓冲包括两个缓存区域,其中,两个缓存区域中的任意一个缓存区域为第一缓存区域,两个缓存区域中的除第一缓存区域以外的另外一个缓存区域为第二缓存区域,两个缓存区域用于分别存储不同的参数。
图5是根据一示意性实施例示出的采用乒乓缓冲的方式进行参数发送的流程图,如图5所示,基于乒乓缓冲包括两个缓存区域的实施例,从下行缓冲中获取第二参数并存入乒乓缓冲中,进一步包括:
S501、如果第一缓存区域未存储任何参数,则从下行缓冲中获取所述第二参数并存入第一缓存区域;否则,执行S502;
S502、如果第二缓存区域未存储任何参数,则从下行缓冲中获取所述第二参数并存入第二缓存区域;
采用上述方式,能够避免数据处理电路单元出现异常而导致当前参数未正确执行且参数丢失的问题。
具体地,继续参见图5所示,本公开实施例的数据交互方法进一步包括以下操作S503至S507。
S503、获取第一缓存区域中的第二参数或者第二缓存区域中的第二参数,并发送给数据处理电路单元。
S504、如果数据处理电路单元基于从第一缓存区域中获取的第二参数执行数据处理失败,则再次从第一缓存区域中获取该第二参数并发送给数据处理电路单元;
S505、如果数据处理电路单元基于从第一缓存区域中获取的第二参数执行数据处理成功,则将第一缓存区域中的该第二参数从第一缓存区域中删除,并获取第二缓存区域中当前存储的第三参数并发送给数据处理电路单元;
S506、如果数据处理电路单元基于从第二缓存区域中获取的第二参数执行数据处理失败,则再次从第二缓存区域中获取该第二参数并发送给数据处理电路单元;
S507、如果数据处理电路单元基于从第二缓存区域中获取的第二参数执行数据处理成功,则将第二缓存区域中的该第二参数从第二缓存区域中删除,并获取第一缓存区域中当前存储的第四参数并发送给数据处理电路单元;
以此类推。
图6是根据一示意性实施例示出的采用乒乓缓冲的方式处理过程流程图,如图6所示,基于乒乓缓冲,本公开实施例的数据交互方法还可以进一步包括如下操作S 601至S603的过程。
S601、在数据处理电路单元基于第二参数执行数据处理失败的情况下,从乒乓缓冲中再次获取该第二参数并再次执行数据处理;
S602、在数据处理电路单元基于第二参数执行数据处理成功的情况下,从乒乓缓冲中删除该第二参数;或者,
S603、在乒乓缓冲未存满参数的情况下,从下行缓冲中读取新的第二参数并存储于乒乓缓冲中。
在一些实施例中,数据处理电路单元执行数据处理是否失败可由数据处理电路单元自身判断,例如,数据处理电路单元可以通过其状态标志位的信息来获其执行状态,从而确定数据处理是否失败,其中,执行状态可根据数据处理电路单元是否完成数据处理而进行相应设置。
图7是根据一示意性实施例示出的乒乓缓冲的方式进行参数发送的缓存变化示意图,如图7所示,该变化过程如下。
在S701的变化状态中,先进先出队列中依次存储参数A、参数B、参数C等参数。
在S702的变化状态中,先进先出队列中的参数A进入乒乓缓冲中的一个缓存位置,并且,先进先出队列中下一个将被送入乒乓缓冲的参数为参数B,此时参数A因为已经进入乒乓缓冲所以从先进先出队列中删除。
在S703的变化状态中,先进先出队列中的参数B进入乒乓缓冲中的另一个缓存位置,并且,先进先出队列中下一个将被送入乒乓缓冲的参数为参数C,此时参数B因为已经进入乒乓缓冲所以从先进先出队列中删除。
在S704的变化状态中,从乒乓缓冲中获取参数A并发送给数据处理电路单元,数据处理电路单元基于参数A执行数据处理,此时乒乓缓冲中并不删除参数A。在数据处理电路单元基于参数A执行数据处理出现失败的情况下,因为乒乓缓冲中仍然存储参数A,所以数据处理电路单元仍然可以得到参数A并再次基于参数A执行数据处理。在数据处理电路单元基于参数A执行数据处理没有出现失败而正常执行完毕的情况下,可以进入S705。
在S705的变化状态中,在数据处理电路单元基于参数A执行数据处理没有出现失败而正常执行完毕的情况下,从乒乓缓冲中获取参数B并发送给数据处理电路单元,数据处理电路单元基于参数B执行数据处理,此时乒乓缓冲中并不删除参数B,先进先出队列中的参数C进入乒乓缓冲中的原参数A所在的缓存位置,并且,先进先出队列中下一个将被送入乒乓缓冲的参数为参数D,此时参数C因为已经进入乒乓缓冲所以从先进先出队列中删除。在数据处理电路单元基于参数B执行数据处理出现失败的情况下,因为乒乓缓冲中仍然存储参数B,所以数据处理电路单元仍然可以得到参数B并再次基于参数B执行数据处理。在数据处理电路单元基于参数B执行数据处理没有出现失败而正常执行完毕的情况下,可以进入S706。
在S706的变化状态中,在数据处理电路单元基于参数B执行数据处理没有出现失败而正常执行完毕的情况下,从乒乓缓冲中获取参数C并发送给数据处理电路单元,数据处理电路单元基于参数C执行数据处理,此时乒乓缓冲中并不删除参数C,先进先出队列中的参数D进入乒乓缓冲中的原参数B所在的缓存位置,并且,先进先出队列中下一个将被送入乒乓缓冲的参数为参数E,此时参数D因为已经进入乒乓缓冲所以从先进先出队列中删除。在数据处理电路单元基于参数C执行数据处理出现失败的情况下,因为乒乓缓冲中仍然存储参数C,所以数据处理电路单元仍然可以得到参数C并再次基于参数C执行数据处理。在数据处理电路单元基于参数C执行数据处理没有出现失败而正常执行完毕的情况下,数据处理电路单元可以按照上述说明而获取参数D、参数E、参数F、参数G等参数。
其中,数据处理的失败可以是指数据处理结果出现错误,例如,在数据处理过程中因为各种原因导致的未完成数据处理而终止的情况,导致数据处理结果出现错误。
其中,参数A、参数B、参数C、参数D、参数E、参数F、参数G仅为不同参数之间的区分命名,以参数A为例,参数A可以代表一个参数或者一组参数,参数A代表数据处理电路单元进行一次数据处理所需要的全部参数的组合,该全部参数依据具体的数据处理电路单元的功能和应用环境而设定,可以是一个参数也可以是多于一个参数。
本公开实施例的数据交互方法,可减少从外部到数据处理电路单元的下行方向和从数据处理电路单元到外部的上行方向的数据交互过程中数据处理电路单元与外部的交互频次,有助于避免频繁交互给数据处理电路单元带来的性能影响,有助于提升数据处理电路单元的性能。具体地,在从外部到数据处理电路单元的下行方向采用下行缓冲的硬件方式,将数据处理电路单元将要进行数据处理所需要的参数进行存储,数据处理电路单元从下行缓冲中直接获取参数进行数据处理而无需通过与外部的交互而获得参数,从而可减少数据处理单元为获取参数而与外部进行交互的频次,并且,在从数据处理电路单元到外部到上行方向采用上行缓冲的硬件方式,将数据处理电路单元输出的输出数据进行存储,并且在上行缓冲中的数据的数量达到输出数量阈值的情况下批量向外部发送输出数据,数据处理单元无需针对每次的输出数据与外部进行一次交互,从而可减少数据处理单元为输出输出数据而与外部进行交互的频次,而减少数据处理单元为获取参数和输出输出数据而与外部的交互频次,有助于避免频繁交互给数据处理电路单元带来的性能影响,有助于提升数据处理电路单元的性能。其中,在一些实施例中,下行缓冲采用先进先出队列的方式,使得数据处理电路单元能够按照参数提供的顺序顺次执行数据处理,避免了数据处理过程的混乱,并且采用乒乓缓冲的方式从下行缓冲向数据处理电路单元提供参数,使得数据处理电路单元在数据处理未正确执行的情况下能够重新获得数据处理未正确执行的参数并再次执行数据处理,确保了输出数据的正确。
图8是根据一示意性实施例示出的一种数据交互装置示意图,如图8所示,该数据交互装置包括下行写入电路单元801、下行缓冲电路单元802、下行读取电路单元803、上行写入电路单元804、上行缓冲电路单元805、上行状态监控电路单元806和上行读出电路单元807。进一步,根据另一示意性实施例示出的一种数据交互装置,还包括:数据处理电路单元809。下面为清楚的描述数据交互装置与数据处理电路单元809之间的交互过程,将结合各个模块进行详细说明。
其中,下行写入电路单元801,用于响应于中央处理单元发出的参数写入操作信号,获得第一参数并存储于下行缓冲电路单元802。在一些实施例中,下行写入电路单元801通讯连接于总线,参数写入操作信号和第一参数来源于总线,在一些实施例中,参数写 入操作信号和第一参数可以是中央处理单元通过总线发出。
下行缓冲电路单元802电连接于下行写入电路单元801,用于存储第一参数。在一些实施例中,下行缓冲电路单元802为SRAM,在一些实施例中,下行缓冲电路单元802采用先进先出队列缓冲的方式存储第一参数。
下行读取电路单元803电连接于下行缓冲电路单元802和数据处理电路单元809,下行读取电路单元803用于从下行缓冲电路单元802中获取第二参数并发送给数据处理电路单元809。
上行写入电路单元804电连接于数据处理电路单元809,上行写入电路单元804用于将由数据处理电路单元809获得的输出数据存储于上行缓冲电路单元805。
上行缓冲电路单元805电连接于上行写入电路单元804,上行缓冲电路单元805用于存储输出数据。
上行状态监控电路单元806电连接于上行缓冲电路单元805,用于记录上行缓冲电路单元805中存储的输出数据的数量,并在上行缓冲电路单元805中存储的输出数据的数量达到输出数量阈值时,发送上行缓冲电路单元805的存储状态信息以触发数据读取操作指令,其中,上行缓冲电路单元805的存储状态信息用于表征上行缓冲电路单元805不可继续存储新的输出数据。在一些实施例中,上行状态监控电路单元806通讯连接于总线,并通过总线发送上行缓冲电路单元805的存储状态信息,在一些实施例中,上行缓冲电路单元805的存储状态信息由中央处理单元获取,从而触发中央处理单元发出数据读取操作指令。
上行读出电路单元807电连接于上行缓冲电路单元805,上行读出电路单元807用于响应于数据读取操作指令,批量输出上行缓冲电路单元805中存储的输出数据。在一些实施例中,上行读出电路单元807通讯连接于总线,数据读取操作指令来源于总线,在一些实施例中,数据读取操作指令可以是中央处理单元通过总线发出,输出数据可以是通过总线输出,输出数据可以被中央处理单元接收也可以被连接于总线的存储单元接收。
在一些实施例中,数据处理电路单元809用于基于第二参数执行数据处理以获得第二参数对应的输出数据,并将第二参数对应的输出数据发送给上行写入电路单元804。
继续参见图8所示,在一些实施例中,数据交互装置还包括下行状态监控电路单元808。其中,下行状态监控电路单元808电连接于下行缓冲电路单元802。在一些实施例中,下行状态监控电路单元808通讯连接于总线。
下行状态监控电路单元808用于:记录下行缓冲电路单元802中存储的参数的数量;在下行缓冲电路单元802中存储的参数的数量从小于输入数量上限阈值达到大于或等于输入数量上限阈值时,发送第一下行存储状态信息;在下行缓冲电路单元802中存储的参数的数量从大于输入数量下限阈值达到小于或等于输入数量下限阈值时,发送第二下行存储状态信息;其中,第一下行存储状态信息用于表征下行缓冲电路单元802不可继续存储新的参数并控制中央处理单元中止发出参数写入操作信号从而暂停下发参数,第二下行存储状态信息用于表征下行缓冲电路单元802可以继续存储新的参数并控制中央处理单元恢复发出参数写入操作信号从而恢复下发参数。
在一些实施例中,下行状态监控电路单元808通过总线发送第一下行存储状态信息和第二下行存储状态信息。
下行状态监控电路单元808采用上述对下行缓冲电路单元802进行管理的方式,配合于接收第一下行存储状态信息和第二下行存储状态信息并通过总线下发参数的中央处理单元的工作,能够使得中央处理单元在接收到第一下行存储状态信息之后中止下发参数,在接收到第二下行存储状态信息之后恢复下发参数,使得中央处理单元只需要基于第一下行存储状态信息和第二下行存储状态信息执行参数的下发,从而避免了中央处理单元与数据处理电路单元809之间的频繁交互来确定数据处理电路单元809是否需要接收参数的情况,可减轻中央处理单元的负担。
在一些实施例中,下行读取电路单元803包括下行读取控制子电路单元和乒乓缓冲子电路单元。其中,下行读取控制子电路单元用于:从下行缓冲电路单元802中获取第二参数并存入乒乓缓冲子电路单元中,从乒乓缓冲子电路单元中获取第二参数并发送给数据处理电路单元809。
在一些实施例中,乒乓缓冲子电路单元包括两个缓存区域,分别为第一缓存区域和第二缓存区域,两个缓存区域用于分别存储不同的参数;下行读取控制子电路单元进一步用于:
如果第一缓存区域未存储任何参数,则从下行缓冲电路单元802中获取第二参数并存入第一缓存区域;否则,
如果第二缓存区域未存储任何参数,则从下行缓冲电路单元802中获取第二参数并存入第二缓存区域。
在一些实施例中,下行读取电路单元803进一步还用于:
如果数据处理电路单元809基于从第一缓存区域中获取的第二参数执行数据处理 失败,则再次从第一缓存区域中获取该第二参数并发送给数据处理电路单元809;
如果数据处理电路单元809基于从第一缓存区域中获取的第二参数执行数据处理成功,则将第一缓存区域中的该第二参数从第一缓存区域中删除,并获取第二缓存区域中当前存储的第三参数并发送给数据处理电路单元809;
如果数据处理电路单元809基于从第二缓存区域中获取的第二参数执行数据处理失败,则再次从第二缓存区域中获取该第二参数并发送给数据处理电路单元809;
如果数据处理电路单元809基于从第二缓存区域中获取的第二参数执行数据处理成功,则将第二缓存区域中的该第二参数从第二缓存区域中删除,并获取第一缓存区域中当前存储的第四参数并发送给数据处理电路单元809。
在一些实施例中,下行读取电路单元803还用于:
在数据处理电路单元809基于第二参数执行数据处理失败的情况下,从乒乓缓冲子电路单元中再次获取该第二参数并发送给数据处理电路单元809;
在数据处理电路单元809基于第二参数执行数据处理成功的情况下,从乒乓缓冲子电路单元中删除该第二参数;
在乒乓缓冲子电路单元未存满参数的情况下,从下行缓冲电路单元802中读取新的第二参数并存储于乒乓缓冲子电路单元中。
本公开实施例的数据交互装置中,下行写入电路单元801、下行缓冲电路单元802、下行读取电路单元803、上行写入电路单元804、上行缓冲电路单元805、上行状态监控电路单元806、上行读出电路单元807和下行状态监控电路单元808均采用硬件电路模块的形式。数据处理电路单元809也采用硬件电路模块的形式,其中,数据处理电路单元809可以单独为一个IP模块,也可以与其它各个模块共同组成一个IP模块,下行写入电路单元801、下行缓冲电路单元802、下行读取电路单元803、上行写入电路单元804、上行缓冲电路单元805、上行状态监控电路单元806、上行读出电路单元807和下行状态监控电路单元808也可以各自作为独立的IP模块存在。
关于上述实施例中的数据交互装置,其中各个单元执行操作的具体方式已经在有关该数据交互方法的实施例中进行了详细描述,此处将不作详细阐述说明。
图9是根据一示意性实施例示出的数据交互方法、装置的应用场景示意图,如图9所示,该应用场景是片上(SOC,System on Chip)系统中对图像传感器的图像数据进行图像压缩的应用场景,其中结合于图8所示的数据交互装置,数据处理电路单元809用于对图像传感器的图像数据进行图像压缩。该应用场景中,下行缓冲电路单元802采 用先进先出队列缓冲的方式存储参数,并且,下行读取电路单元803采用乒乓缓冲策略。
在图像采集系统中,图像传感器采集的图像数据送入片上系统后首先会被解析,经过压缩处理之后通过DMA(Direct Memory Access,直接存储器访问)通道写入系统内存中。其中,结合图8所示,图像数据的压缩处理以及写入系统内存地址的参数由中央处理单元通过下行写入电路单元801写入下行缓冲电路单元802,当图像数据的vsync(帧头)到来时下行读取电路单元803从下行缓冲电路单元802的先进先出队列读取该参数,并送入数据处理电路单元809,数据处理电路单元809启动对当前帧数据的压缩处理,压缩处理执行完成后,数据处理电路单元809将执行完成的消息反馈至下行读取电路单元803,并将压缩处理后得到的输出数据(图像压缩数据和状态信息)通过上行写入电路单元804存储于上行缓冲电路单元805,供上行读出电路单元807进行上传。
若数据处理电路单元809在执行压缩处理过程中,因为图像传感器受外部环境干扰,导致输出的图像数据不完整,进而数据处理电路单元809压缩数据错误或者DMA通道不能正确的将数据写入系统内存,进而可能导致不完整帧对应的参数被浪费或丢失的情况。为了避免这种情况,下行读取电路单元803采用乒乓缓冲策略,下行读取电路单元803首先从下行缓冲电路单元802中读取第一个(组)参数放入乒乓缓冲中的第一子缓冲位置,并将第一个(组)参数送入数据处理电路单元804,随后下行读取电路单元803从下行缓冲电路单元802中读取第二个(组)参数放入乒乓缓冲中的第二子缓冲位置,若数据处理电路单元809返回第一个(组)参数执行正确,则下行读取电路单元803将第二子缓冲位置的第二个(组)参数送入数据处理电路单元809,然后从下行缓冲电路单元802中读取第三个(组)参数放入乒乓缓冲中的第一子缓冲位置,若数据处理电路单元809返回第一个(组)参数执行错误,则下行读取电路单元803再次将第一子缓冲位置的第一个(组)参数送入数据处理电路单元809,从而确保了输出数据的正确,避免了下行缓冲电路单元802中的参数的漏执行。
图10是根据一示意性实施例示出的数据交互系统示意图,如图10所示,该数据交互系统,包括通过总线进行通讯连接的中央处理单元1001和数据交互装置1002,其中,数据交互装置1002为上述任一实施例的数据交互装置。其中,中央处理单元1001用于通过总线向数据交互装置1002发出参数写入操作信号,响应于接收到的上行缓冲电路单元805的存储状态信息,向数据交互装置1002发出数据读取操作指令并接收下行读取电路单元803批量输出的输出数据。
在一些实施例中,中央处理单元1001还用于在接收到第一下行存储状态信息时中 止向数据交互装置1002发出参数写入操作信号,在接收到第二下行存储状态信息时继续向数据交互装置1002发出参数写入操作信号。
图11是本公开实施例提供的一种电子设备的结构示意图。在一些实施例中,该电子设备为服务器。该电子设备1100可因配置或性能不同而产生比较大的差异,可以包括一个或一个以上处理器(Central Processing Units,CPU)1101和一个或一个以上的存储器1102,其中,该存储器1102中存储有至少一条程序代码,该至少一条程序代码由该处理器1101加载并执行以实现上述各个实施例提供的数据交互方法。当然,该电子设备1100还可以具有有线或无线网络接口、键盘以及输入输出接口等部件,以便进行输入输出,该电子设备1100还可以包括其他用于实现设备功能的部件,在此不做赘述。
在示例性实施例中,还提供了一种包括至少一条指令的计算机可读存储介质,例如包括至少一条指令的存储器,上述至少一条指令可由计算机设备中的处理器执行以完成上述实施例中的数据交互方法。
上述计算机可读存储介质可以是非临时性计算机可读存储介质,例如,该非临时性计算机可读存储介质可以包括ROM(Read-Only Memory,只读存储器)、RAM(Random-Access Memory,随机存取存储器)、CD-ROM(Compact Disc Read-Only Memory,只读光盘)、磁带、软盘和光数据存储设备等。
以上所述仅为本申请的较佳实施例而已,并不用以限制本申请,凡在本申请的原则之内所作的任何修改、等同替换和改进等,均应包含在本申请的保护范围之内。

Claims (18)

  1. 一种数据交互方法,包括:
    响应于中央处理单元发出的参数写入操作信号,获得第一参数并存储于下行缓冲;
    从所述下行缓冲中获取第二参数并发送给数据处理电路单元,以使所述数据处理电路单元基于所述第二参数执行数据处理以获得所述第二参数对应的输出数据;
    将所述第二参数对应的输出数据存储于上行缓冲;
    记录所述上行缓冲中存储的输出数据的数量,并在所述上行缓冲中存储的输出数据的数量达到输出数量阈值时,发送所述上行缓冲的存储状态信息以触发数据读取操作指令,其中,所述上行缓冲的存储状态信息用于表征所述上行缓冲不可继续存储新的输出数据;
    响应于所述数据读取操作指令,批量输出所述上行缓冲中存储的输出数据。
  2. 根据权利要求1所述的数据交互方法,进一步包括:
    记录所述下行缓冲中存储的参数的数量;
    在从所述下行缓冲中获取第二参数并发送给数据处理电路单元后,将所述第二参数从所述下行缓冲中删除;
    在所述下行缓冲中存储的参数的数量上升到大于或等于所述输入数量上限阈值时,发送第一下行存储状态信息,所述第一下行存储状态信息用于表征所述下行缓冲不可继续存储新的参数,并控制中央处理单元中止发出参数写入操作信号从而暂停下发参数;
    在所述下行缓冲中存储的参数的数量下降到小于或等于所述输入数量下限阈值时,发送第二下行存储状态信息,所述第二下行存储状态信息用于表征所述下行缓冲可以继续存储新的参数,并控制中央处理单元恢复发出参数写入操作信号从而恢复下发参数。
  3. 根据权利要求1所述的数据交互方法,其中,所述响应于中央处理单元发出的参数写入操作信号,获得第一参数并存储于下行缓冲,包括:
    响应于所述参数写入操作信号,获得所述第一参数;
    将所述参数写入操作信号转换为写入所述下行缓冲操作的电写入信号,其中,所述参数写入操作信号基于总线协议;
    基于所述电写入信号,将所述第一参数存储于所述下行缓冲。
  4. 根据权利要求1所述的数据交互方法,其特征在于:
    所述下行缓冲为先进先出队列FIFO或者SRAM中。
  5. 根据权利要求1所述的数据交互方法,其特征在于,所述从所述下行缓冲中获 取第二参数并发送给数据处理电路单元,包括:
    从所述下行缓冲中获取所述第二参数并存入乒乓缓冲中,从所述乒乓缓冲中获取所述第二参数并发送给所述数据处理电路单元。
  6. 根据权利要求5所述的数据交互方法,其特征在于:
    所述乒乓缓冲包括两个缓存区域,分别为第一缓存区域和第二缓存区域,所述两个缓存区域用于分别存储不同的参数;
    其中,所述从所述下行缓冲中获取第二参数并存入乒乓缓冲中,包括:
    如果所述第一缓存区域未存储任何参数,则从所述下行缓冲中获取所述第二参数并存入所述第一缓存区域;否则,
    如果所述第二缓存区域未存储任何参数,则从所述下行缓冲中获取所述第二参数并存入所述第二缓存区域。
  7. 根据权利要求6所述的数据交互方法,进一步包括:
    如果所述数据处理电路单元基于从所述第一缓存区域中获取的第二参数执行数据处理失败,则再次从所述第一缓存区域中获取该第二参数并发送给所述数据处理电路单元;
    如果所述数据处理电路单元基于从所述第一缓存区域中获取的第二参数执行数据处理成功,则将所述第一缓存区域中的该第二参数从所述第一缓存区域中删除,并获取所述第二缓存区域中当前存储的第三参数并发送给所述数据处理电路单元;
    如果所述数据处理电路单元基于从所述第二缓存区域中获取的第二参数执行数据处理失败,则再次从所述第二缓存区域中获取该第二参数并发送给所述数据处理电路单元;
    如果所述数据处理电路单元基于从所述第二缓存区域中获取的第二参数执行数据处理成功,则将所述第二缓存区域中的该第二参数从所述第二缓存区域中删除,并获取所述第一缓存区域中当前存储的第四参数并发送给所述数据处理电路单元。
  8. 根据权利要求1所述的数据交互方法,其特征在于,所述响应于所述数据读取操作指令,批量输出所述上行缓冲中存储的输出数据,包括:
    响应于所述数据读取操作指令,从所述上行缓冲中批量读取输出数据;
    将批量读取的输出数据转换为基于总线协议的信号并通过总线发送。
  9. 一种数据交互装置,其特征在于:
    所述数据交互装置包括下行写入电路单元、下行缓冲电路单元、下行读取电路单元、 上行写入电路单元、上行缓冲电路单元、上行状态监控电路单元和上行读出电路单元;其中,
    所述下行写入电路单元,用于响应于中央处理单元发出的参数写入操作信号,获得第一参数并存储于所述下行缓冲电路单元;
    所述下行缓冲电路单元电连接于所述下行写入电路单元,用于存储所述第一参数;
    所述下行读取电路单元电连接于所述下行缓冲电路单元和数据处理电路单元,用于从所述下行缓冲电路单元中获取第二参数并发送给所述数据处理电路单元;
    所述上行写入电路单元电连接于所述数据处理电路单元,用于将由所述数据处理电路单元获得的输出数据存储于所述上行缓冲电路单元;
    所述上行缓冲电路单元电连接于所述上行写入电路单元,用于存储所述输出数据;
    所述上行状态监控电路单元电连接于所述上行缓冲电路单元,用于记录所述上行缓冲电路单元中存储的输出数据的数量,并在所述上行缓冲电路单元中存储的输出数据的数量达到输出数量阈值时,发送所述上行缓冲电路单元的存储状态信息以触发数据读取操作指令,其中,所述上行缓冲电路单元的存储状态信息用于表征所述上行缓冲电路单元不可继续存储新的输出数据;
    所述上行读出电路单元电连接于所述上行缓冲电路单元,用于响应于所述数据读取操作指令,批量输出所述上行缓冲电路单元中存储的输出数据。
  10. 根据权利要求9所述的数据交互装置,其特征在于,所述数据交互装置还包括:所述数据处理电路单元,用于基于所述第二参数执行数据处理以获得所述第二参数对应的输出数据,并将所述第二参数对应的输出数据发送给所述上行写入电路单元。
  11. 根据权利要求9所述的数据交互装置,其特征在于,
    所述下行读取电路单元,在从所述下行缓冲电路单元中获取第二参数并发送给数据处理电路单元后,进一步用于:将所述第二参数从所述下行缓冲中删除;
    所述数据交互装置还包括:
    下行状态监控电路单元,所述下行状态监控电路单元电连接于所述下行缓冲电路单元,用于:
    记录所述下行缓冲电路单元中存储的参数的数量;在所述下行缓冲电路单元中存储的参数的数量从上升到大于或等于所述输入数量上限阈值时,发送第一下行存储状态信息;在所述下行缓冲电路单元中存储的参数的数量下降到小于或等于所述输入数量下限阈值时,发送第二下行存储状态信息;
    其中,所述第一下行存储状态信息用于表征所述下行缓冲电路单元不可继续存储新的参数,并控制中央处理单元中止发出参数写入操作信号从而暂停下发参数,所述第二下行存储状态信息用于表征所述下行缓冲电路单元可以继续存储新的参数,并控制中央处理单元恢复发出参数写入操作信号从而恢复下发参数。
  12. 根据权利要求9所述的数据交互装置,其特征在于:
    所述下行读取电路单元包括下行读取控制子电路单元和乒乓缓冲子电路单元;
    所述下行读取控制子电路单元用于:从所述下行缓冲电路单元中获取第二参数并存入所述乒乓缓冲子电路单元中,从所述乒乓缓冲子电路单元中获取所述第二参数并发送给所述数据处理电路单元。
  13. 根据权利要求12所述的数据交互装置,其特征在于:
    所述乒乓缓冲子电路单元包括两个缓存区域,分别为第一缓存区域和第二缓存区域,所述两个缓存区域用于分别存储不同的第二参数;
    所述下行读取控制子电路单元进一步用于:
    如果所述第一缓存区域未存储任何参数,则从所述下行缓冲电路单元中获取第二参数并存入所述第一缓存区域;否则,
    如果所述第二缓存区域未存储任何参数,则从所述下行缓冲电路单元中获取第二参数并存入所述第二缓存区域。
  14. 根据权利要求13所述的数据交互装置,其特征在于,所述下行读取电路单元进一步用于:
    如果所述数据处理电路单元基于从所述第一缓存区域中获取的第二参数执行数据处理失败,则再次从所述第一缓存区域中获取该第二参数并发送给所述数据处理电路单元;
    如果所述数据处理电路单元基于从所述第一缓存区域中获取的第二参数执行数据处理成功,则将所述第一缓存区域中的该第二参数从所述第一缓存区域中删除,并获取所述第二缓存区域中当前存储的第三参数并发送给所述数据处理电路单元;
    如果所述数据处理电路单元基于从所述第二缓存区域中获取的第二参数执行数据处理失败,则再次从所述第二缓存区域中获取该第二参数并发送给所述数据处理电路单元;
    如果所述数据处理电路单元基于从所述第二缓存区域中获取的第二参数执行数据处理成功,则将所述第二缓存区域中的该第二参数从所述第二缓存区域中删除,并获取 所述第一缓存区域中当前存储的第四参数并发送给所述数据处理电路单元。
  15. 一种数据交互系统,其特征在于,包括:
    通过总线进行通讯连接的中央处理单元和如权利要求9至14任一项所述的数据交互装置;其中,
    所述中央处理单元用于通过所述总线向所述数据交互装置发出所述参数写入操作信号,响应于接收到的所述上行缓冲电路单元的存储状态信息,向所述数据交互装置发出所述数据读取操作指令并接收所述上行读出电路单元批量输出的输出数据。
  16. 一种电子设备,其特征在于,包括:
    处理器;
    用于存储所述处理器的可执行指令的存储器;
    其中,所述处理器被配置为执行所述可执行指令,以实现如权利要求1至8任一项所述的数据交互方法。
  17. 一种计算机可读存储介质,其特征在于,当所述计算机可读存储介质中的至少一条指令被电子设备的处理器执行时,使得所述电子设备实现如权利要求1至8任一项所述的数据交互方法。
  18. 一种计算机程序产品,所述计算机程序产品包括计算机指令,所述计算机指令存储在计算机可读存储介质中,当所述计算机指令被执行时,实现如权利要求1-8中任一项所述的数据交互方法。
PCT/CN2023/094736 2022-08-17 2023-05-17 数据交互方法、装置、系统、电子设备和存储介质 WO2024037076A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210985974.4 2022-08-17
CN202210985974.4A CN115061959B (zh) 2022-08-17 2022-08-17 数据交互方法、装置、系统、电子设备和存储介质

Publications (1)

Publication Number Publication Date
WO2024037076A1 true WO2024037076A1 (zh) 2024-02-22

Family

ID=83208328

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/094736 WO2024037076A1 (zh) 2022-08-17 2023-05-17 数据交互方法、装置、系统、电子设备和存储介质

Country Status (2)

Country Link
CN (1) CN115061959B (zh)
WO (1) WO2024037076A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115061959B (zh) * 2022-08-17 2022-10-25 深圳比特微电子科技有限公司 数据交互方法、装置、系统、电子设备和存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000020716A (ja) * 1998-07-01 2000-01-21 Seiko Epson Corp データ処理装置およびデータ処理方法
CN110162489A (zh) * 2018-02-14 2019-08-23 爱思开海力士有限公司 存储器控制器及该存储器控制器的操作方法
CN112131164A (zh) * 2020-09-23 2020-12-25 山东云海国创云计算装备产业创新中心有限公司 应用于加速板卡的数据调度方法、装置及加速板卡和介质
CN115061959A (zh) * 2022-08-17 2022-09-16 深圳比特微电子科技有限公司 数据交互方法、装置、系统、电子设备和存储介质

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7436765B2 (en) * 2003-09-03 2008-10-14 Teknovus, Inc. Method and apparatus for dynamically allocating upstream bandwidth in passive optical networks
CN102571280B (zh) * 2012-01-09 2015-11-25 华为终端有限公司 数据传输的方法及装置
CN103714038B (zh) * 2012-10-09 2019-02-15 中兴通讯股份有限公司 一种数据处理方法和装置
CN108132904A (zh) * 2016-12-01 2018-06-08 深圳市中兴微电子技术有限公司 一种基带中频交互方法和系统
US10924223B2 (en) * 2018-02-14 2021-02-16 Google Llc Method of managing HARQ buffer for NR
CN114205183A (zh) * 2020-08-26 2022-03-18 希姆通信息技术(上海)有限公司 基于实时操作系统的at指令协议栈的通信方法及系统
CN112783810B (zh) * 2021-01-08 2022-05-03 国网浙江省电力有限公司电力科学研究院 一种面向应用的多通道srio dma传输系统及方法
CN113518044B (zh) * 2021-09-15 2021-12-21 浙江国利信安科技有限公司 Epa设备

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000020716A (ja) * 1998-07-01 2000-01-21 Seiko Epson Corp データ処理装置およびデータ処理方法
CN110162489A (zh) * 2018-02-14 2019-08-23 爱思开海力士有限公司 存储器控制器及该存储器控制器的操作方法
CN112131164A (zh) * 2020-09-23 2020-12-25 山东云海国创云计算装备产业创新中心有限公司 应用于加速板卡的数据调度方法、装置及加速板卡和介质
CN115061959A (zh) * 2022-08-17 2022-09-16 深圳比特微电子科技有限公司 数据交互方法、装置、系统、电子设备和存储介质

Also Published As

Publication number Publication date
CN115061959A (zh) 2022-09-16
CN115061959B (zh) 2022-10-25

Similar Documents

Publication Publication Date Title
US10372199B2 (en) Apparatus for managing power and running and booting an inter-processor communication link between independently operable processors
US9021155B2 (en) Fibre channel input/output data routing including discarding of data transfer requests in response to error detection
US8364853B2 (en) Fibre channel input/output data routing system and method
US8185713B2 (en) Flexible sequencer design architecture for solid state memory controller
US20140068134A1 (en) Data transmission apparatus, system, and method
US10901838B2 (en) Predictive caching for check word snooping in high performance ficon
US11784756B2 (en) Memory access technology and computer system
US9021147B1 (en) Command queuing in disk drives
CN111683252B (zh) 一种服务器以及一种视频压缩图像的输出系统和方法
US20070011333A1 (en) Automated serial protocol initiator port transport layer retry mechanism
US20070002827A1 (en) Automated serial protocol target port transport layer retry mechanism
US8683084B2 (en) Fibre channel input/output data routing system and method
WO2024037076A1 (zh) 数据交互方法、装置、系统、电子设备和存储介质
US20200210224A1 (en) Methods and apparatus for verifying completion of groups of data transactions between processors
CN110941582B (zh) 一种bmc芯片的usb总线结构及其通信方法
US8230137B2 (en) Network processor, reception controller and data reception processing method performing direct memory access transfer
CN104796652A (zh) 一种基于srio传输视频帧的数据传输方法和装置
US20030145150A1 (en) Interface conversion system and data transfer method
US8683083B2 (en) Fibre channel input/output data routing system and method
US8769253B2 (en) Fibre channel input/output data routing system and method
CN102420749A (zh) 一种网卡发包功能的实现装置和方法
JP2014096162A (ja) インタフェース変換装置及びインタフェース変換方法
US20230169029A1 (en) Method of transmitting Universal Serial Bus (USB) commands and associated electronic device
CN116489379A (zh) 一种基于srio传输视频帧的数据传输方法和装置
CN117370233A (zh) Hdmi控制器upi存储电路和upi数据存储方法

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23853983

Country of ref document: EP

Kind code of ref document: A1