WO2017206591A1 - Data processing system and data processing method - Google Patents

Data processing system and data processing method Download PDF

Info

Publication number
WO2017206591A1
WO2017206591A1 PCT/CN2017/079761 CN2017079761W WO2017206591A1 WO 2017206591 A1 WO2017206591 A1 WO 2017206591A1 CN 2017079761 W CN2017079761 W CN 2017079761W WO 2017206591 A1 WO2017206591 A1 WO 2017206591A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
coprocessor
sub
processed
control module
Prior art date
Application number
PCT/CN2017/079761
Other languages
French (fr)
Chinese (zh)
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 WO2017206591A1 publication Critical patent/WO2017206591A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F15/00Digital computers in general; Data processing equipment in general
    • G06F15/16Combinations of two or more digital computers each having at least an arithmetic unit, a program unit and a register, e.g. for a simultaneous processing of several programs
    • G06F15/163Interprocessor communication
    • G06F15/167Interprocessor communication using a common memory, e.g. mailbox
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F15/00Digital computers in general; Data processing equipment in general
    • G06F15/16Combinations of two or more digital computers each having at least an arithmetic unit, a program unit and a register, e.g. for a simultaneous processing of several programs
    • G06F15/163Interprocessor communication
    • G06F15/17Interprocessor communication using an input/output type connection, e.g. channel, I/O port

Definitions

  • the present application relates to the field of databases, and more particularly to data processing systems and data processing methods.
  • the hybrid platform architecture that the main processor and coprocessor assist in processing data typically consists of 1-2 central processing units (CPUs) and 1-8 integrated general core (MIC) coprocessors.
  • Coprocessor processors are often used as online analytical processing (OLAP) query accelerators, primarily for computationally intensive tasks in OLAP queries. From the perspective of computational features, coprocessors are especially useful for stand-alone operations such as connection processing or aggregation processing of data that are time-consuming and suitable for parallel execution.
  • OLAP online analytical processing
  • the present application provides a system and method for data processing that simplifies the design of the system and reduces the workload of the main processor.
  • a data processing system including a main processor, a coprocessor, and a control module;
  • the main processor is configured to send the to-be-processed data to the control module
  • the control module is configured to receive the to-be-processed data sent by the main processor, and send the to-be-processed data to the coprocessor
  • the coprocessor is configured to receive the to-be-processed data sent by the control module, process the to-be-processed data, obtain a processing result of the to-be-processed data, and send the processing result of the to-be-processed data to the main processor;
  • the main processor is configured to receive a processing result of the to-be-processed data sent by the coprocessor through the control module.
  • the data processing system of the embodiment of the present application reduces the workload of the main processor by adding a control module for controlling transmission data between the main processor and the coprocessor, and simplifies the integration of data processing and data transmission. And system code for memory management.
  • control module is configured to: Processing data is sent to the coprocessor at one time, or the data to be processed is sent to the coprocessor in batches, wherein the storage attribute of the data to be processed is carried when the data to be processed is sent to the coprocessor,
  • the storage attribute includes a resident attribute or a flow attribute indicating that the pending data can be accessed multiple times, the flow attribute indicating that the pending data can only be accessed once.
  • control module is specifically configured to: according to a processing context of the to-be-processed data, a data volume of the to-be-processed data And the memory size available to the coprocessor to determine the storage attributes of the pending data.
  • control module is further configured to: send the to-be-processed data to the coprocessor
  • the memory size of the resident area in the memory of the coprocessor and the memory size of the streaming area are determined according to the data amount of the data to be processed, the storage attribute of the data to be processed, and the memory size available to the coprocessor.
  • the data stored in the resident area can be accessed multiple times, and the data in the streaming area can only be accessed once and deleted or overwritten after being accessed.
  • the storage attribute of the data to be processed includes a resident attribute or a flow attribute, wherein the resident attribute indicates that the pending data can be accessed multiple times, and the streaming attribute indicates that the pending data can only be accessed once.
  • the amount of memory available to the coprocessor is the amount of memory in the coprocessor other than the memory occupied by the coprocessor system.
  • control module is configured to carry the storage attribute of the to-be-processed data in the to-be-processed data, and send the to-be-processed data block carrying the storage attribute to the coprocessor, or may be in the coprocessor
  • the indication information for indicating the storage attribute of the data to be processed is not limited in this embodiment of the present application.
  • control module is further configured to: before sending the to-be-processed data to the coprocessor, determine a memory size of the resident area in the co-processing and a memory size of the streaming area, where the resident area is stored The data can be accessed multiple times, the data stored in the streaming area can only be accessed once, and will be deleted or overwritten after the access.
  • control module sets the resident area and the flow area in the coprocessor, so that the data needs to be stored in the resident area for multiple times during the calculation, and the data used once is batched.
  • the transfer area is transferred and processed separately with the data in the camp, which reduces the amount of data transmission each time through the PCIe channel and improves the efficiency of data processing.
  • the flow area of the coprocessor includes a plurality of consecutive sub-flow regions
  • the control module is specifically configured to: send the data to be processed in batches to each of the plurality of consecutive sub-flow regions;
  • the coprocessor is specifically configured to: sequentially read data in each of the plurality of sub-flow regions, and process the data in each of the sub-flow regions, in the data in each of the sub-flow regions After the processing is completed, each sub-flow area is identified as idle; after the data processing in the last sub-flow area of the consecutive plurality of sub-flow areas is completed, and the first sub-flow area of the consecutive plurality of sub-flow areas When the flag is idle, the data is read from the first sub-streaming area of the consecutive plurality of sub-streaming areas.
  • the number of the plurality of sub-flow areas the memory size of the flow area / the memory size of the sub-flow area, wherein the size of the sub-flow area is set such that data in the sub-flow area is transmitted to the coprocessor
  • the time is the same or approximately the same as the time at which the core of the coprocessor computes the data in the subflow region.
  • the memory size of each of the plurality of sub-flow regions may be the same.
  • the data processing system of the embodiment of the present application can improve the data transmission efficiency of the PCIe channel and the processing efficiency of the data processing system by setting a plurality of sub-streaming areas and considering the memory size of the coprocessor and the transmission performance of the PCIe channel.
  • control module is specifically configured to:
  • the data amount of the first data block is smaller than the memory size available to the coprocessor, and the data amount of the second data block is greater than that available to the coprocessor a memory size, determining a storage attribute of the first data block as a resident attribute, and sending the first data block to a resident area of the coprocessor, determining that a storage attribute of the second data block is a flow attribute, and The second data block is divided into a plurality of second sub-blocks that are sequentially sent in batches to a flow area of the coprocessor.
  • the coprocessor is specifically configured to: the first data block and the flow in the resident area Processing each of the plurality of second sub-blocks in the region to obtain a processing result of the first data block and each of the second sub-blocks; according to the first data block and the Processing result of each second sub-block of the plurality of second sub-blocks, and processing results of the first block and the second block are obtained.
  • the process of processing the data to be processed by the coprocessor and the process of sending the data to be processed by the control module to the coprocessor can be performed simultaneously, thereby reducing the amount of data transmission each time through the PCIe channel, thereby further improving Data transmission efficiency.
  • control module is further configured to: Processing data includes a first data block and a second data block, the data amount of the second data block being greater than a memory size available to the coprocessor, and the data amount of the first data block after being hashed is greater than the coprocessing The available memory size, determining the storage attribute of the first data block as a flow attribute, and dividing the first data block into a plurality of first sub-blocks sent to the flow area of the coprocessor in batches, determining the first The storage attribute of the two data blocks is a flow attribute, and the second data block is divided into a plurality of second sub-blocks and sent to the flow area of the coprocessor in batches.
  • the coprocessor is further configured to: in the multiple first sub-blocks in the forwarding area Processing each of the first sub-data block and each of the plurality of second sub-data blocks to obtain a processing result of each of the first sub-data blocks and each of the second sub-blocks; Obtaining the first data block and the second data block according to a processing result of each of the first sub-data blocks and each of the plurality of second sub-data blocks Processing results.
  • the main processor includes a first buffer area and a second buffer area; the control module is configured to store the to-be-processed data in the first buffer area, and send the data in the first buffer area to the co-processor after the first buffer area is full. The remaining pending data is further stored to the second buffer area, and after the second buffer area is full, the data in the second cache is sent to the coprocessor.
  • control module is further configured to send data in the first buffer area to the coprocessor At the same time, the data to be processed is continuously stored in the second buffer area, and after the second buffer area is full, the data in the second buffer area is sent to the coprocessor.
  • the memory size of the first buffer area and the second buffer area in the main processor are the same as the memory size of the sub-streaming area in the coprocessor, which can improve memory utilization during data processing. Rate and improve data processing efficiency.
  • control module can improve the parallelism of the processed data and improve the transmission efficiency of the PCIe channel by alternately transmitting data between the first buffer area and the second buffer area in the main processor.
  • a data processing method is provided, the method being applied to a data processing system in a first aspect, the data processing system comprising a main processor, a coprocessor, and a control module, wherein the main processor, the coordinating The processor and the control module are configured to perform the method corresponding to the main processor, the coprocessor, and the control module in any of the possible implementations of the first aspect or the first aspect described above.
  • a computer readable medium for storing a computer program comprising instructions for performing the method of any of the second aspect or any of the possible implementations of the second aspect.
  • FIG. 1 is an architectural example of a data processing system of an embodiment of the present application.
  • FIG. 2 is a schematic block diagram of a data processing system of an embodiment of the present application.
  • FIG. 3 is a schematic flowchart of a data processing method according to an embodiment of the present application.
  • FIG. 4 is a schematic flowchart of another data processing method according to an embodiment of the present application.
  • FIG. 5 is a schematic flowchart of still another data processing method according to an embodiment of the present application.
  • FIG. 6 is a schematic flowchart of still another data processing method according to an embodiment of the present application.
  • FIG. 7 is a schematic diagram of a scenario of a data processing method according to an embodiment of the present application.
  • FIG. 8 is a schematic diagram of a scenario of another data processing method according to an embodiment of the present application.
  • FIG. 9 is a schematic diagram of a scenario of still another data processing method according to an embodiment of the present application.
  • the data processing system includes: a main processor 110, a coprocessor 120, and a control module 130, and the main processor 110 and Data transmission between the coprocessors 120 through the PIC channel, wherein the main processor 110 typically includes 1-2 CPUs, and the coprocessor 120 typically includes 1-8 MIC processors, the control module 130 is configured to control the data. Data processing and data transfer between the main processor 110 and the coprocessor 120.
  • the main processor 110 is configured to receive a data processing request of the user end, and determine data to be processed according to the data processing request of the user end, where the data processing request may be, for example, a connection processing request, a query processing request, or an aggregation processing request, etc.
  • the data processing request may be, for example, a connection processing request, a query processing request, or an aggregation processing request, etc.
  • the application embodiment does not limit this.
  • control module 130 is configured to receive the to-be-processed data sent by the main processor 110, determine a storage attribute of the to-be-processed data in the coprocessor, and send the to-be-processed data to the association by using two different transmission modes.
  • Processor 120 is configured to receive the to-be-processed data sent by the main processor 110, determine a storage attribute of the to-be-processed data in the coprocessor, and send the to-be-processed data to the association by using two different transmission modes.
  • the storage attribute of the data to be processed includes a resident attribute or a flow attribute, wherein the resident attribute indicates that the pending data can be accessed multiple times, and the streaming attribute indicates that the pending data can only be accessed once.
  • control module may send the data to be processed to the coprocessor at one time, or may send the data to be processed in batches to the coprocessor in sequence.
  • control module block may be implemented by software, for example, may be a program code in the system, or may be implemented by hardware, for example, may be a device integrated in other control devices, which is not limited by the embodiment of the present application.
  • the coprocessor 120 is configured to receive, by the control module 130, the to-be-processed data sent by the main processor 110, process the data to be processed, obtain a processing result, and finally return the processing result to the main processor 110 through the control module 130. .
  • the coprocessor 120 can be used to perform hash connection processing or OLAP query on the data, and the operations such as the computationally intensive data task or the aggregation processing are time-consuming and suitable for the parallel operation. .
  • the data processing system of the embodiment of the present application encapsulates a program and code that the main processor needs to call in the data processing process in the control module by adding a control module for controlling data transmission between the main processor and the coprocessor.
  • the main processor does not need to call all the code that needs to be used every time, and only needs to simply call the control module to control the data processing, data transmission and memory management, and reduce the control.
  • FIG. 2 shows a schematic block diagram of a system 200 for data processing in accordance with an embodiment of the present application.
  • the system 200 includes a main processor 210, a coprocessor 220, and a control module 230.
  • the main processor 210 is configured to send data to be processed to the control module 230.
  • the control module 230 is configured to receive the to-be-processed data sent by the main processor 210, and send the to-be-processed data to the coprocessor 220.
  • the coprocessor 220 is configured to receive the to-be-processed data sent by the control module 230, process the to-be-processed data, obtain a processing result of the to-be-processed data, and send the processing result of the to-be-processed data to the control module.
  • the main processor 210 To the main processor 210;
  • the main processor 210 is configured to receive a processing result of the to-be-processed data sent by the coprocessor 220 through the control module 230.
  • the data processing system of the embodiment of the present application encapsulates a program and code that the main processor needs to call in the data processing process in the control module by adding a control module for controlling data transmission between the main processor and the coprocessor.
  • the main processor does not need to call all the code that needs to be used multiple times, and only needs to simply call the control module, thereby realizing control of data processing, data transmission, and memory management, reducing the main The workload of the processor and simplifies the code design of the system.
  • the main processor is configured to determine data to be processed, and send the to-be-processed data to the control module.
  • control module is specifically configured to send the to-be-processed data to the coprocessor or send the to-be-processed data to the coprocessor in batches, and send the to-be-processed data to the control module.
  • the coprocessor carries the storage attribute of the data to be processed.
  • control module is specifically configured to: before the control module sends the to-be-processed data to the coprocessor, according to a processing context of the to-be-processed data, an amount of data of the to-be-processed data, and an available
  • the memory size determines the storage attribute of the data to be processed, but the embodiment of the present application is not limited thereto.
  • control module may determine, according to whether the to-be-processed data needs to be used multiple times, and whether the to-be-processed data can be all stored to the coprocessor, and determine a storage attribute of the to-be-processed data.
  • the storage attribute of the data to be processed includes a resident attribute or a flow attribute, wherein the resident attribute indicates that the pending data can be accessed multiple times, and the streaming attribute indicates that the pending data can only be accessed once.
  • the amount of memory available to the coprocessor is the amount of memory in the coprocessor other than the memory occupied by the coprocessor system.
  • control module is configured to carry the storage attribute of the to-be-processed data in the to-be-processed data, and send the to-be-processed data block carrying the storage attribute to the coprocessor, or may be in the coprocessor
  • the indication information for indicating the storage attribute of the data to be processed is not limited in this embodiment of the present application.
  • control module is further configured to: before sending the to-be-processed data to the coprocessor, determine a memory size of the resident area in the co-processing and a memory size of the streaming area, where the resident area is stored The data can be accessed multiple times, the data stored in the streaming area can only be accessed once, and will be deleted or overwritten after the access.
  • control module sets the resident area and the flow area in the coprocessor, so that the data needs to be stored in the resident area for multiple times during the calculation, and the data used once is batched.
  • the transfer area is transferred and processed separately with the data in the camp, which reduces the amount of data transmission each time through the PCIe channel and improves the efficiency of data processing.
  • control module may determine, according to the data volume of the data to be processed, the storage attribute of the data to be processed, and the memory size of the coprocessor, the memory size and the flow area of the resident area in the coprocessor. memory size.
  • control module may preferentially consider the data to be processed of the resident attribute, determine the memory size of the resident area in the available memory of the coprocessor according to the data amount of the data to be processed of the resident attribute, and then The remaining available memory of the coprocessor is determined as the memory size of the streaming area.
  • control module may divide the flow area into a plurality of sub-flow areas, where the number of the multiple sub-flow areas may be a memory size of the flow area divided by a memory size of each of the sub-flow areas, where each of the sub-flow areas
  • the memory size of the flow area can be pre-tested according to the platform of the data processing system, that is, the memory size of each sub-flow area can be set such that the data in each sub-flow area is copied to the coprocessor and the association.
  • the core of the processor calculates the time of the data in each of the sub-streaming areas to be the same or similar, and the transmission performance of the data of each sub-streaming area in the PCIe channel transmission may be considered, which is not limited in this embodiment of the present application.
  • the data processing system of the embodiment of the present application can improve the data transmission efficiency of the PCIe channel and the processing efficiency of the data processing system by setting a plurality of sub-streaming areas and considering the memory size of the coprocessor and the transmission performance of the PCIe channel.
  • control module is specifically configured to establish a queue of the plurality of sub-flow areas, form a plurality of consecutive sub-flow areas, and sequentially send the to-be-processed data to each of the plurality of sub-flow areas in batches.
  • the coprocessor is specifically configured to sequentially read data in each of the plurality of sub-flow regions, and process the data in the sub-flow region, and in each of the self-flow regions After the data is processed, the each self-flowing rotor region is identified as idle, after the data processing in the last sub-flow region of the consecutive plurality of sub-flow regions is completed, and the continuous plurality of sub-flow regions are detected. When the first sub-flow area is identified as idle, data is continuously read from the first sub-flow area of the plurality of consecutive sub-flow areas, and processed.
  • the coprocessor reads and processes data through a plurality of cyclic sub-flow regions, thereby improving memory utilization of the coprocessor and parallelism of the data processing.
  • the main processor may include a first buffer area and a second buffer area, where the control module is configured to The data is stored in the first buffer area, and after the first buffer area is full, the data in the first buffer area is sent to the coprocessor.
  • control module is configured to continue to store the data to be processed in the second buffer area while the data in the first buffer area is sent to the coprocessor, and save the data in the second buffer area. After the full, the data in the second buffer area is sent to the coprocessor.
  • the data processing system of the embodiment of the present application improves the parallelism of the system and the data processing efficiency by setting two buffer areas in the main processor to alternately transmit and store data, and can set the size of the buffer area to It is the same size as each of the reflow areas in the coprocessor, which improves coprocessor memory utilization and improves data processing efficiency.
  • the to-be-processed data includes a first data block and a second data block, wherein a data amount of the first data block is smaller than a memory size available to the coprocessor, and the second data block The amount of data is greater than the amount of memory available to the coprocessor.
  • control module is configured to receive the first data block and the second data block sent by the main processor, according to the data amount of the first data block, the data amount of the second data block, and the coprocessor The available memory size and the processing context, determining that the first data block is a resident attribute, the second data block is a streaming attribute, and sending the first data block to a resident area of the coprocessor, the second The data block is divided into a plurality of second sub-blocks, and the plurality of second sub-blocks are sent in batches to a flow area of the coprocessor.
  • the first data block may be sent to the resident area of the coprocessor at one time, and the first data block may be a hashed first data block, which is not limited in this embodiment of the present application.
  • the coprocessor is configured to process the first data block in the resident area and each of the plurality of second sub data blocks in the flow area, the first data block Processing result corresponding to each second sub-block, and obtaining the first data block and the first data block according to a processing result of the first data block and each second sub-data block of the plurality of second sub-data blocks Processing result of the two data blocks, and transmitting the processing result of the first data block and the second data block to the main processor through the control module.
  • the to-be-processor data includes a first data block and a second data block, wherein a data amount of the second data block is greater than a memory size available to the coprocessor, and is hashed.
  • the processed data volume of the first data block is also larger than the memory size available to the coprocessor.
  • the control module is configured to receive the first data block and the second data block sent by the main processor, according to the data amount of the first data block, the data amount of the second data block, and the available memory of the coprocessor Determining the size and the processing context, determining that the first data block and the second data block are both flow attributes, and dividing the first data block into a plurality of first sub-blocks sent to the flow area of the coprocessor in batches, The second data block is divided into a plurality of second sub-blocks and sent to the streaming area of the co-processor in batches.
  • the main processor may include a first buffer area and a second buffer area, where the first cache has the same memory size as the second cache, and the control module may use the first buffer area and the second buffer area to A plurality of first sub-blocks and a plurality of second sub-blocks are sent to the coprocessor, which is not limited in this embodiment of the present application.
  • control module is configured to divide the first data block and the second data block into blocks according to a memory size of the first buffer area or the second buffer area, to obtain a plurality of first sub-blocks and a second sub-block corresponding to each of the plurality of first sub-blocks, and such that each of the first sub-blocks and the second sub-block corresponding to each of the first sub-blocks
  • the sum of the data amounts is equal to the first buffer area or the second buffer area
  • control module is configured to rotate each of the plurality of first sub-blocks by the first buffer area and the second buffer area. Subdata
  • the block and each of the plurality of second sub-blocks are sent to the coprocessor.
  • the coprocessor is configured to process each of the first one of the plurality of first subblocks and the second of the plurality of second subblocks in the streaming area Obtaining a processing result of each of the first sub-blocks and each of the second sub-blocks, according to each of the plurality of first sub-blocks and the plurality of second sub-blocks Processing result of each second sub-block, obtaining a processing result of the first data block and the second data block, and sending the processing result of the first data block and the second data block to the main processor.
  • FIG. 3 is a schematic flowchart of a method 300 for data processing according to an embodiment of the present application.
  • the method 300 can be applied to the system shown in FIG. 2, and can implement various functions implemented by the main processor, the coprocessor, and the control module in the foregoing data processing system. To avoid repetition, details are not described herein again.
  • the main processor sends the to-be-processed data to the control module.
  • the control module receives the to-be-processed data sent by the main processor, and sends the to-be-processed data to the coprocessor.
  • the coprocessor receives the to-be-processed data sent by the control module, processes the to-be-processed data, obtains a processing result of the to-be-processed data, and sends the processing result of the to-be-processed data to the Main processor.
  • the main processor receives a processing result of the to-be-processed data sent by the coprocessor through the control module.
  • control module sends the to-be-processed data to the coprocessor, including:
  • An attribute comprising a resident attribute or a flow attribute, the resident attribute indicating that the pending data can be accessed multiple times, the flow attribute indicating that the pending data can only be accessed once.
  • control module determines, according to a processing context of the to-be-processed data, an amount of data of the to-be-processed data, and a memory size available to the coprocessor, a storage attribute of the to-be-processed data.
  • the method before the sending the to-be-processed data to the coprocessor, the method further includes:
  • the control module determines the memory size of the resident area in the memory of the coprocessor and the memory size of the streaming area according to the data amount of the data to be processed, the storage attribute of the data to be processed, and the available memory size of the coprocessor. Where the data stored in the resident area can be accessed multiple times, the data in the streaming area can only be accessed once and deleted or overwritten after being accessed.
  • the flow area of the coprocessor includes a plurality of consecutive sub-flow areas; the control module sends the data to be processed to the coprocessor in batches, and the control module sends the data to be processed in batches in sequence. Up to each of the plurality of sub-flow regions; the coprocessor processing the data to be processed, and obtaining the processing result of the data to be processed, including:
  • the coprocessor sequentially reads data in each of the plurality of sub-flow regions, and processes the data in each of the sub-flow regions. After the data processing in each of the sub-flow regions is completed, Identifying each sub-flow area as idle; the coprocessor is after the data processing in the last sub-flow area of the consecutive plurality of sub-flow areas is completed, and the first sub-flow area of the consecutive plurality of sub-flow areas When the flag is idle, the data is continuously read from the first sub-streaming area of the plurality of consecutive sub-streaming areas.
  • control module sends the to-be-processed data to the coprocessor in batches, including:
  • the control module determines that a storage attribute of the first data block is a resident attribute, and sends the first data block to a resident area of the coprocessor, and the control module determines a storage attribute of the second data block
  • the second data block is divided into a plurality of second sub-blocks and sent to the flow area of the co-processor in batches.
  • the coprocessor processes the to-be-processed data to obtain a processing result of the to-be-processed data, including:
  • the coprocessor processes the first data block in the resident area and each of the plurality of second sub data blocks in the flow area to obtain the first data block and the a processing result of each second sub-block; the coprocessor obtains the first data block according to the processing result of the first data block and each second sub-block of the plurality of second sub-blocks The processing result of the second data block.
  • the control module sends the to-be-processed data to the coprocessor, including: if the to-be-processed data includes the first data block and the second data block, the data volume of the second data block is greater than the coprocessor The available memory size, and the data amount of the hashed first data block is greater than the available memory size of the coprocessor, the control module determines that the storage attribute of the first data block is a streaming attribute, and the first a data block is divided into a plurality of first sub-blocks that are sent in batches to a flow area of the coprocessor, and the control module determines that a storage attribute of the second data block is a flow attribute, and divides the second data block into multiple The second sub-blocks are sent in batches to the flow area of the coprocessor.
  • the coprocessor processes the to-be-processed data to obtain a processing result of the to-be-processed data, including:
  • the coprocessor processes each of the plurality of first sub-blocks and the second of the plurality of second sub-blocks in the flow region to obtain each of the plurality of second sub-blocks Processing results of the first sub-block and the each second sub-block; the co-processor according to each of the plurality of first sub-blocks and the plurality of second sub-blocks The processing result of each second sub-block obtains the processing result of the first data block and the second data block.
  • the main processor includes a first buffer area and a second buffer area; the control module sends the to-be-processed data to the coprocessor, and the control module stores the to-be-processed data to the first cache. The area, until the first buffer area is full, sends the data in the first buffer area to the coprocessor.
  • control module sends the to-be-processed data to the coprocessor, including:
  • control module While the data in the first buffer area is sent to the coprocessor, the control module continues to store the to-be-processed data to the second buffer area, and after the second buffer area is full, the first The data in the second buffer is sent to the coprocessor.
  • the data processing method of the embodiment of the present application completes data transmission and data processing between the main processor and the coprocessor through a control module between the main processor and the coprocessor, thereby reducing the workload of the main processor and simplifying System code that originally integrates data processing, data transfer, and memory management.
  • FIG. 4 is a schematic flowchart of another data processing method 400 of the embodiment of the present application.
  • the method 400 can be applied to the system shown in FIG. 2, and the data processing system is described in detail in conjunction with FIG. 7.
  • each data table has several attributes. If one of the attributes can uniquely identify the data table, the attribute group is A primary key of the form, for example, the R table may be a student form, the student form includes a student number, a name, and a class, and each student's student number is unique, and the student number is a primary key, and the foreign key is mainly Another data table is associated.
  • the S table can be a transcript.
  • the transcript includes a student number, a course number, and a grade. The course number and the student number can be used together to determine the grade, so the primary key of the transcript is the student number. And the course number, and the student number in the transcript corresponds to the student number in the student table. Therefore, the student number in the transcript is a foreign key of the student table, and the student table and the transcript are associated by the student number.
  • the control module receives an R table and an S table sent by the main processor, where the R table and the S table are associated with each other, and the amount of data in the R table is smaller than a memory size available to the coprocessor, and the data in the S table. The amount is greater than the memory size that the coprocessor can.
  • the control module identifies the R-type resident attribute according to the data amount of the R table, the data amount of the S-table, the available memory size of the coprocessor, and the processing context, and identifies the S-table as a streaming attribute.
  • control module may send the R table to the camping area of the coprocessor at one time, and send the S table to the streaming area of the coprocessor in batches.
  • control module may: according to the data amount of the R table, the data amount of the S table, the resident attribute of the R table, the streaming attribute of the S table, and the available memory of the coprocessor Size, determines the memory size of the resident area in the coprocessor and the memory size of the flow area.
  • the control module performs a hash operation on the R table to obtain an R table hash table.
  • the control module sends the R table hash table to a resident area of the coprocessor.
  • the control module divides the S table into a plurality of sub-S tables. S406. The control module sends the jth sub-S table of the plurality of sub-S tables to the i-th free sub-streaming area of the coprocessor.
  • the main processor may include a first buffer area and a second buffer area
  • the control module may send, by using the first buffer area and the second buffer area, each sub-S table of the plurality of sub-S tables to the The flow area of the coprocessor.
  • the coprocessor performs a hash join operation on the R table hash table and the jth child S table in the i th substreaming area in the resident area, to obtain a processing result corresponding to the jth child S table.
  • the coprocessor identifies the i-th sub-streaming area as idle.
  • the control module sends the j+1th sub-S table in the plurality of sub-S tables to the i+1th idle sub-streaming area of the coprocessor.
  • the coprocessor performs a hash join operation on the R table hash table and the j+1th sub S table in the i+1th substreaming area in the resident area, to obtain the j+1th child S The processing result corresponding to the table.
  • the coprocessor identifies the i+1th sub-streaming area as idle.
  • the coprocessor may include a plurality of consecutive sub-flow regions, and the coprocessor may sequentially read the sub-S tables in each of the consecutive plurality of sub-flow regions, and each of the sub-flow regions The child S table in the process is processed with the R table in the resident area.
  • the coprocessor obtains the R table and the S table according to the hash join result of the R table hash table in the dwell area and the sub S table in each of the plurality of subflow regions. Hash the result of the connection.
  • the coprocessor can obtain the data connection processing result corresponding to each sub-S table in the plurality of sub-S tables according to the method described in S406-S411, and further obtain the hash connection of the R table and the S table. result.
  • the coprocessor sends the hash connection result to the main processor through the control module.
  • the data processing method of the embodiment of the present application completes data transmission and data processing between the main processor and the coprocessor through a control module between the main processor and the coprocessor, thereby reducing the workload of the main processor and simplifying System code that originally integrates data processing, data transfer, and memory management.
  • FIG. 5 is a schematic flowchart of still another data processing method 500 of the embodiment of the present application.
  • the method 500 can be applied to the system as shown in FIG. 2, and another method flow of the data processing system in performing data connection processing on the R table and the S table is described in detail in conjunction with FIG. 8.
  • the control module receives an R table and an S table sent by the main processor, where the R table is associated with the S table, and the data amount of the S table is greater than a memory size available to the coprocessor, and the hash operation is performed.
  • the amount of data in the R table is also greater than the amount of memory available to the coprocessor.
  • the control module identifies the R table and the S table as a flow attribute according to the data amount of the R table, the data amount of the S table, the available memory size of the coprocessor, and the processing context.
  • control module may send the R table to the camping area of the coprocessor at one time, and send the S table to the streaming area of the coprocessor in batches.
  • control module may: according to the data amount of the R table, the data amount of the S table, the resident attribute of the R table, the streaming attribute of the S table, and the available memory of the coprocessor Size, determines the memory size of the resident area in the coprocessor and the memory size of the flow area.
  • control module may not set a resident area in the coprocessor, and all available memory in the coprocessor is used to set a flow area, Improve memory utilization.
  • the control module performs an operation on the R table to obtain an R table hash table.
  • the control module divides the R table hash table and the S table into a plurality of sub-R table hash tables and a plurality of sub-S tables, and each of the plurality of sub-R table hash tables has a hash table and a hash table. Each of the plurality of S tables has a one-to-one correspondence.
  • the plurality of sub-S tables may be, for example, an S1 table or an S2 table in FIG. 8 and the plurality of sub-R table hash tables may be, for example, an R1 table hash table or an R2 table hash table in FIG. 8.
  • the control module sends the jth sub-R table hash table and the j-th sub-S table in the plurality of sub-R table hash tables to the i-th sub-streaming area of the coprocessor.
  • the main processor may include a first buffer area and a second buffer area
  • the control module may use the first buffer area and the second buffer area to list each of the plurality of sub-R tables and the same
  • the child S table corresponding to each child R table is sent to the flow area of the coprocessor.
  • the coprocessor performs hash connection processing on the jth sub-R table hash table and the j-th sub-S table in the i-th sub-streaming area.
  • the coprocessor identifies the i-th sub-streaming area as idle.
  • the coprocessor may include a plurality of consecutive sub-flow regions, and the coprocessor may sequentially read the sub-R table in each of the consecutive plurality of sub-flow regions and corresponding to the sub-R table.
  • the child S table, and the child S table and the child R table in each sub-flow region are processed.
  • the control module sends the j+1th sub-R table hash table and the j+1th sub-S table in the plurality of sub-R table hash tables to the i+1th sub-streaming area of the coprocessor.
  • the coprocessor performs hash connection processing on the j+1th sub-R table hash table and the j+1th sub-S table in the i+1th sub-flow region.
  • the coprocessor represents the i+1th sub-streaming area as idle.
  • the coprocessor can obtain the data connection processing result corresponding to each sub S table in the plurality of sub S tables according to the method described in S505-S510, and further obtain the data connection processing of the R table and the S table. As a result, the data connection processing result of the R table and the S table is transmitted to the main processor.
  • the coprocessor sends the R table and the hash processing result of the S table to the main processor through the control module.
  • the data processing method of the embodiment of the present application completes data transmission and data processing between the main processor and the coprocessor through a control module between the main processor and the coprocessor, thereby reducing the workload of the main processor and simplifying System code that would integrate data processing, data transfer, and memory management.
  • FIG. 6 shows a schematic flowchart of still another data processing method 600 of the embodiment of the present application.
  • the method 600 can be applied to the system as shown in FIG. 2, and the method flow of the data processing system in the hash connection processing in the fact table and the plurality of dimension tables of the fact table is described in detail in conjunction with FIG. .
  • the fact table is used to store at least one fact record, each fact record corresponds to a row in the fact table, and includes a key value column and a metric value column, wherein the value in the key value column corresponds to the dimension of the fact record, for example, Commodity origin, commodity price, merchandise quantity, transaction date, merchandise category, merchandise name, etc.; the value in the metric column corresponds to the subject matter of the fact table, for example, sales or sales volume, and so on.
  • the key value column corresponds to the dimension of the fact record, for example, Commodity origin, commodity price, merchandise quantity, transaction date, merchandise category, merchandise name, etc.
  • the value in the metric column corresponds to the subject matter of the fact table, for example, sales or sales volume, and so on.
  • the dimension table is used to store the dimensional characteristics of the fact record.
  • the dimension table may include a name column and an attribute column.
  • the commodity origin includes three columns in the dimension table, a place name (locationName), a place number (locationId), and Address, where the origin name is the name column, and the origin number and address are attribute columns.
  • the key-value column in the fact table can correspond to the attribute column in the dimension table, and each key-value column in the fact table can correspond to a dimension table.
  • the primary key which uniquely identifies a column in the table, any two rows in a table have different primary key values, and the primary key does not allow null values.
  • the primary key of a table is the first column of the table.
  • the control module receives a fact table and a plurality of dimension tables sent by the main processor, where the fact table is associated with each dimension table of the plurality of dimension tables, and the data volume of the fact table is greater than the coprocessor.
  • the amount of memory available, the total amount of data for the multiple dimension tables that have been hashed is less than the amount of memory available to the coprocessor.
  • the plurality of dimension tables may be, for example, the first dimension table and the second dimension table in FIG. 9 .
  • the control module identifies the multiple dimension table as a resident attribute according to the data volume of the multiple dimension tables, the data volume of the fact table, the memory size available to the coprocessor, and the processing context, and the fact The table is identified as a flow attribute.
  • control module may send the plurality of dimension tables to the resident area of the coprocessor in one time, and send the fact table in batches to the flow area of the coprocessor.
  • control module may perform, according to the connection filter, each dimension table of the plurality of dimension tables and the fact table. Filtering, filtering out the records that are not related to the current hash connection, and reducing the amount of data of the fact table and the dimension table that need to be transmitted, but the embodiment of the present application does not limit this.
  • the control module performs hash processing on each dimension table in the plurality of dimension tables to obtain each dimension table hash table in the plurality of dimension tables.
  • the multiple dimension table hash table may be, for example, the first dimension table hash table and the second dimension table hash table in FIG. 9, and the first dimension table is hashed to obtain the first A dimension table hash table, the second dimension table is hashed to obtain the second dimension table hash table.
  • the control module transmits the plurality of dimension table hash tables to a resident area of the coprocessor.
  • control module may simultaneously transmit the plurality of dimension table hash tables to the coprocessor, or may sequentially transmit each dimension table hash table in the plurality of dimension table hash tables to the association.
  • the processor is not limited in this embodiment.
  • control module may: according to the data volume of the multiple dimension tables, the data volume of the fact table, the resident attribute of the multiple dimension tables, the flow attribute of the fact table, and the co-processing
  • the amount of memory available to the device determines the memory size of the resident area in the coprocessor and the memory size of the flow area.
  • the coprocessor may store the multiple dimension table hash table in the resident storage area of the coprocessor, or may be based on the memory size of the resident storage area and the multiple dimension table hash table
  • the amount of data is divided into a plurality of sub-resident areas, and the plurality of dimension table hash tables are respectively stored in the plurality of sub-resident areas, which is not limited in this embodiment of the present application. .
  • the control module performs compression processing on the fact table to obtain a fact compression table.
  • the fact table is subjected to compression processing to obtain a fact compression table.
  • control module may further perform data compression processing on the fact table filtered by the connection filter, thereby further reducing the data amount of the fact table.
  • the control module divides the fact compression table into a plurality of sub-facts compression tables.
  • the control module sends the jth sub-facts compression table in the plurality of fact compression tables to the i-th sub-streaming area of the coprocessor.
  • the main processor includes a first buffer area and a second buffer area
  • the control module may send, by using the first buffer area and the second buffer area, each sub-facts compression table in the plurality of sub-facts compression tables to the Coprocessor flow area.
  • control module may divide the fact compression table into a plurality of sub-facts compression table according to the memory size of the buffer area, which is not limited in this embodiment of the present application.
  • the coprocessor hash-joins the j-th sub-fact compression table in the i-th sub-flow region and each dimension table hash table in the plurality of dimension table hash tables to obtain the j-th sub-fact The result of the hash join corresponding to the compressed table.
  • the coprocessor identifies the i-th sub-streaming area as idle.
  • the coprocessor may include a plurality of consecutive sub-flow regions, and the coprocessor may sequentially read the sub-fact compression table in each of the consecutive plurality of sub-flow regions, and compress the sub-facts
  • the table is hashed with each dimension table hash table in multiple dimension table hash tables in the residency region.
  • the control module sends the j+1th sub-facts compression table in the plurality of fact compression tables to the (i+1)th sub-streaming area of the coprocessor.
  • the coprocessor hash-joins the j+1th sub-fact compression table in the i+1th sub-flow region and each dimension table hash table in the plurality of dimension table hash tables, to obtain the The hash join result corresponding to the j+1th sub-fact compression table.
  • the coprocessor identifies the i+1th sub-streaming area as idle.
  • the coprocessor compresses the hash connection node corresponding to each sub-fact compression table in the plurality of sub-facts compression table. If the result of the connection between the plurality of dimension tables and the fact table is obtained.
  • the coprocessor can obtain the data connection processing result corresponding to each sub-facts compression table in the plurality of sub-facts compression tables according to the method described in S607-S612, and further obtain the fact table and the plurality of dimension tables.
  • the data connection processing result of each dimension table in the medium is transmitted to the main processor by the result of the data connection processing of the fact table and each dimension table in the plurality of dimension tables.
  • the coprocessor sends the fact table and the hash connection result of each dimension table in the plurality of dimension tables to the main processor through the control module.
  • the data processing method of the embodiment of the present application completes data transmission and data processing between the main processor and the coprocessor through a control module between the main processor and the coprocessor, thereby reducing the workload of the main processor and simplifying System code that originally integrates data processing, data transfer, and memory management.
  • each step of the above method may be completed by an integrated logic circuit of hardware in a processor or an instruction in a form of software.
  • the steps of the method disclosed in the embodiments of the present application may be directly implemented as a hardware processor, or may be performed by a combination of hardware and software modules in the processor.
  • the software module can be located in a conventional storage medium such as random access memory, flash memory, read only memory, programmable read only memory or electrically erasable programmable memory, registers, and the like.
  • the storage medium is located in a memory, and the processor executes instructions in the memory, in combination with hardware to perform the steps of the above method. To avoid repetition, it will not be described in detail here.
  • the disclosed systems, devices, and methods may be implemented in other manners.
  • the device embodiments described above are merely illustrative.
  • the division of the unit is only a logical function division.
  • there may be another division manner for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, or an electrical, mechanical or other form of connection.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the embodiments of the present application.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
  • the integrated unit if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a computer readable storage medium.
  • the technical solution of the present application is essential or the part contributing to the prior art, or all or part of the technical solution may be in the form of a software product.
  • the computer software product is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all of the methods described in the various embodiments of the present application or Part of the steps.
  • the foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like, which can store program code. .

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Advance Control (AREA)

Abstract

A data processing system (100) and a data processing method. The data processing system (100) comprises a main processor (110), a co-processor (120) and a control module (130), wherein the main processor (110) is used for sending data to be processed to the control module (130); the control module (130) is used for receiving the data to be processed sent by the main processor (110), and sending the data to be processed to the co-processor (120); the co-processor (120) is used for receiving the data to be processed sent by the control module (130), processing the data to be processed to obtain a processing result of the data to be processed, and sending the processing result of the data to be processed to the main processor (110) via the control module (130); and the main processor (110) is used for receiving the processing result of the data to be processed sent by the co-processor (120) via the control module (130). The data processing system (100) and the data processing method can simplify the design of the system, and alleviate the workload of the main processor (110).

Description

数据处理系统和数据处理方法Data processing system and data processing method
本申请要求于2016年6月1日提交中国专利局、申请号为201610387562.5、发明名称为“数据处理系统和数据处理方法”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。The present application claims priority to Chinese Patent Application No. 201610387562.5, entitled "Data Processing System and Data Processing Method", which is incorporated herein by reference. .
技术领域Technical field
本申请涉及数据库领域,尤其涉及数据处理系统和数据处理方法。The present application relates to the field of databases, and more particularly to data processing systems and data processing methods.
背景技术Background technique
主处理器与协处理器协助处理数据的混合平台架构通常由1-2个中央处理器(central processing unit,CPU)和1-8个集成众核(many integrated core,MIC)协处理器构成,协处理器处理器常用作联机分析处理(online analytical processing,OLAP)查询加速器,主要处理OLAP查询中计算密集型任务。从计算特征来看,协处理器尤其用于数据的连接处理或聚集处理等耗时且适合并行完成的独立操作。The hybrid platform architecture that the main processor and coprocessor assist in processing data typically consists of 1-2 central processing units (CPUs) and 1-8 integrated general core (MIC) coprocessors. Coprocessor processors are often used as online analytical processing (OLAP) query accelerators, primarily for computationally intensive tasks in OLAP queries. From the perspective of computational features, coprocessors are especially useful for stand-alone operations such as connection processing or aggregation processing of data that are time-consuming and suitable for parallel execution.
在现有的CPU与MIC混合架构处理数据的过程中,需要先在MIC端分配空间,从CPU端通过外部设备互连总线(peripheral component interconnect express,PCIe)通道向MIC端拷贝需要处理的两个数据,然后在MIC端执行实时操作系统(kernel)程序对两个数据进行处理,并将处理结果通过PCIe通道由MIC端拷贝到CPU端,最后MIC端释放已分配的空间。In the process of processing data between the existing CPU and MIC hybrid architecture, it is necessary to allocate space on the MIC end, and copy the two required to be processed from the CPU side through the peripheral component interconnect express (PCIe) channel to the MIC end. Data, then execute the real-time operating system (kernel) program on the MIC side to process the two data, and copy the processing result from the MIC end to the CPU end through the PCIe channel, and finally the MIC end releases the allocated space.
然而,当需要进行大数据量的数据处理时,不能将数据一次全部存储于MIC端,这时需要在CPU端对两个数据进行数据分区,然后在MIC端对每一分区进行上述数据处理过程,这样以来,所有的数据处理、数据传输以及内存访问管理工作都是由主处理器来执行,导致主处理器的工作负担比较重,并且在系统代码设计中需要集成数据传输、数据处理与内存访问管理的功能,代码比较复杂。However, when large data volume data processing is required, the data cannot be stored all at once on the MIC end. In this case, data partitioning of the two data is performed on the CPU side, and then the above data processing process is performed on each partition at the MIC end. In this way, all data processing, data transfer and memory access management work is performed by the main processor, resulting in a heavy workload of the main processor, and integrated data transmission, data processing and memory in the system code design. Access management features, the code is more complicated.
发明内容Summary of the invention
本申请提供了一种数据处理的系统和方法,能够简化系统的设计,并且减轻主处理器的工作负担。The present application provides a system and method for data processing that simplifies the design of the system and reduces the workload of the main processor.
第一方面,提供了一种数据处理系统,包括主处理器、协处理器和控制模块;In a first aspect, a data processing system is provided, including a main processor, a coprocessor, and a control module;
该主处理器用于将待处理数据发送至该控制模块;该控制模块用于接收该主处理器发送的该待处理数据,并将该待处理数据发送至该协处理器;The main processor is configured to send the to-be-processed data to the control module, and the control module is configured to receive the to-be-processed data sent by the main processor, and send the to-be-processed data to the coprocessor;
该协处理器用于接收该控制模块发送的该待处理数据,对该待处理数据进行处理,得到该待处理数据的处理结果,并将该待处理数据的处理结果通过该控制模块发送至该主处理器;The coprocessor is configured to receive the to-be-processed data sent by the control module, process the to-be-processed data, obtain a processing result of the to-be-processed data, and send the processing result of the to-be-processed data to the main processor;
该主处理器用于接收该协处理器通过该控制模块发送的该待处理数据的处理结果。The main processor is configured to receive a processing result of the to-be-processed data sent by the coprocessor through the control module.
本申请实施例的数据处理系统,通过在主处理器和协处理器之间增加用于控制传输数据的控制模块,减轻了主处理器的工作负担,并且简化了原本将集成数据处理、数据传输以及内存管理于一体的系统代码。The data processing system of the embodiment of the present application reduces the workload of the main processor by adding a control module for controlling transmission data between the main processor and the coprocessor, and simplifies the integration of data processing and data transmission. And system code for memory management.
结合第一方面,在第一方面的第一种可能的实现方式中,该控制模块用于:将该待 处理数据一次性发送至该协处理器,或者将该待处理数据分批发送至该协处理器,其中,在将该待处理数据发送至该协处理器时携带该待处理数据的存储属性,该存储属性包括驻留属性或流转属性,该驻留属性表示该待处理数据能够被多次访问,该流转属性表示该待处理数据仅能够被访问一次。In conjunction with the first aspect, in a first possible implementation manner of the first aspect, the control module is configured to: Processing data is sent to the coprocessor at one time, or the data to be processed is sent to the coprocessor in batches, wherein the storage attribute of the data to be processed is carried when the data to be processed is sent to the coprocessor, The storage attribute includes a resident attribute or a flow attribute indicating that the pending data can be accessed multiple times, the flow attribute indicating that the pending data can only be accessed once.
结合第一方面的第一种可能的实现方式,在第一方面的第二种可能的实现方式中,该控制模块具体用于:根据该待处理数据的处理上下文、该待处理数据的数据量和该协处理器可用的内存大小,确定该待处理数据的存储属性。In conjunction with the first possible implementation of the first aspect, in a second possible implementation manner of the first aspect, the control module is specifically configured to: according to a processing context of the to-be-processed data, a data volume of the to-be-processed data And the memory size available to the coprocessor to determine the storage attributes of the pending data.
结合第一方面的第一种或第二种可能的实现方式,在第一方面的第三种可能的实现方式中,该控制模块还用于:在将该待处理数据发送至该协处理器之前,根据该待处理数据的数据量、该待处理数据的存储属性和该协处理器可用的内存大小,确定该协处理器的内存中的驻留区域的内存大小和流转区域的内存大小,其中,该驻留区域中存储的数据能够被多次访问,该流转区域中的数据仅能够被访问一次,并且在被访问后删除或覆盖。In conjunction with the first or second possible implementation of the first aspect, in a third possible implementation of the first aspect, the control module is further configured to: send the to-be-processed data to the coprocessor The memory size of the resident area in the memory of the coprocessor and the memory size of the streaming area are determined according to the data amount of the data to be processed, the storage attribute of the data to be processed, and the memory size available to the coprocessor. The data stored in the resident area can be accessed multiple times, and the data in the streaming area can only be accessed once and deleted or overwritten after being accessed.
应理解,待处理数据的存储属性包括驻留属性或者流转属性,其中,驻留属性表示该待处理数据能够被多次访问,流转属性表示该待处理数据仅能够被访问一次。It should be understood that the storage attribute of the data to be processed includes a resident attribute or a flow attribute, wherein the resident attribute indicates that the pending data can be accessed multiple times, and the streaming attribute indicates that the pending data can only be accessed once.
还应理解,该协处理器可用的内存大小为该协处理器中除该协处理器系统占用的内存以外的内存大小。It should also be understood that the amount of memory available to the coprocessor is the amount of memory in the coprocessor other than the memory occupied by the coprocessor system.
可选地,该控制模块用于将该待处理数据的存储属性携带在该待处理数据中,并将携带存储属性的待处理数据块发送至该协处理器,或者可以在向该协处理器发送用于指示该待处理数据的存储属性的指示信息,本申请实施例对此不作限定。Optionally, the control module is configured to carry the storage attribute of the to-be-processed data in the to-be-processed data, and send the to-be-processed data block carrying the storage attribute to the coprocessor, or may be in the coprocessor The indication information for indicating the storage attribute of the data to be processed is not limited in this embodiment of the present application.
可选地,该控制模块还用于在将该待处理数据发送至该协处理器之前,确定该协处理中的驻留区域的内存大小和流转区域的内存大小,其中该驻留区域中存储的数据能够被多次访问,该流转区域中存储的数据仅能够被访问一次,并且会在访问后被删除或覆盖。Optionally, the control module is further configured to: before sending the to-be-processed data to the coprocessor, determine a memory size of the resident area in the co-processing and a memory size of the streaming area, where the resident area is stored The data can be accessed multiple times, the data stored in the streaming area can only be accessed once, and will be deleted or overwritten after the access.
本申请实施例的数据处理系统,控制模块通过在协处理器中设置驻留区域和流转区域,使得在计算时需要被多次数据保持一直存储在驻留区域中,将一次使用的数据分批传输流转区域,并分别与驻留中的数据进行处理,减少了每次通过PCIe通道的数据传输量,并且提高了数据处理的效率。In the data processing system of the embodiment of the present application, the control module sets the resident area and the flow area in the coprocessor, so that the data needs to be stored in the resident area for multiple times during the calculation, and the data used once is batched. The transfer area is transferred and processed separately with the data in the camp, which reduces the amount of data transmission each time through the PCIe channel and improves the efficiency of data processing.
结合第一方面的第三种可能的实现方式,在第一方面的第四种可能的实现方式中,该协处理器的流转区域包括多个连续的子流转区域;In conjunction with the third possible implementation of the first aspect, in a fourth possible implementation manner of the first aspect, the flow area of the coprocessor includes a plurality of consecutive sub-flow regions;
该控制模块具体用于:将该待处理数据分批依次发送至该多个连续的子流转区域中的每个子流转区域;The control module is specifically configured to: send the data to be processed in batches to each of the plurality of consecutive sub-flow regions;
该协处理器具体用于:依次读取该连续的多个子流转区域中每个子流转区域中的数据,并对该每个子流转区域中的数据进行处理,在对该每个子流转区域中的数据处理完成后,将该每个子流转区域标识为空闲;在该连续的多个子流转区域中最后一个子流转区域中的数据处理完成后,并且该连续的多个子流转区域中第一个子流转区域标识为空闲时,则继续从该连续的多个子流转区域中的第一个子流转区域开始读取数据。The coprocessor is specifically configured to: sequentially read data in each of the plurality of sub-flow regions, and process the data in each of the sub-flow regions, in the data in each of the sub-flow regions After the processing is completed, each sub-flow area is identified as idle; after the data processing in the last sub-flow area of the consecutive plurality of sub-flow areas is completed, and the first sub-flow area of the consecutive plurality of sub-flow areas When the flag is idle, the data is read from the first sub-streaming area of the consecutive plurality of sub-streaming areas.
可选地,该多个子流转区域的数量=该流转区域的内存大小/该子流转区域的内存大小,其中该子流转区域的大小的设置使得该子流转区域中的数据传输至协处理器的时间和该协处理器的内核计算该子流转区域中的数据的时间相同或者近似为佳。 Optionally, the number of the plurality of sub-flow areas = the memory size of the flow area / the memory size of the sub-flow area, wherein the size of the sub-flow area is set such that data in the sub-flow area is transmitted to the coprocessor The time is the same or approximately the same as the time at which the core of the coprocessor computes the data in the subflow region.
可选地,该多个子流转区域中每个子流转区域的内存大小可以相同。Optionally, the memory size of each of the plurality of sub-flow regions may be the same.
本申请实施例的数据处理系统,通过设置多个子流转区域,并同时考虑协处理器可以的内存大小以及PCIe通道的传输性能,能够提高PCIe通道的数据传输效率以及数据处理系统的处理效率。The data processing system of the embodiment of the present application can improve the data transmission efficiency of the PCIe channel and the processing efficiency of the data processing system by setting a plurality of sub-streaming areas and considering the memory size of the coprocessor and the transmission performance of the PCIe channel.
结合第一方面的第一种至第四种可能的实现方式中的任一种可能的实现方式,在第一方面的第五种可能的实现方式中,该控制模块具体用于:With reference to any one of the possible implementations of the first to fourth possible implementations of the first aspect, in a fifth possible implementation of the first aspect, the control module is specifically configured to:
若该待处理数据包括第一数据块和第二数据块,该第一数据块的数据量小于该协处理器可用的内存大小,并且该第二数据块的数据量大于该协处理器可用的内存大小,确定该第一数据块的存储属性为驻留属性,并将该第一数据块发送至该协处理器的驻留区域,确定该第二数据块的存储属性为流转属性,并将该第二数据块划分为多个第二子数据块分批依次发送至该协处理器的流转区域。If the data to be processed includes the first data block and the second data block, the data amount of the first data block is smaller than the memory size available to the coprocessor, and the data amount of the second data block is greater than that available to the coprocessor a memory size, determining a storage attribute of the first data block as a resident attribute, and sending the first data block to a resident area of the coprocessor, determining that a storage attribute of the second data block is a flow attribute, and The second data block is divided into a plurality of second sub-blocks that are sequentially sent in batches to a flow area of the coprocessor.
结合第一方面的第五种可能的实现方式,在第一方面的第六种可能的实现方式中,该协处理器具体用于:对该驻留区域中的该第一数据块和该流转区域中的该多个第二子数据块中的每个第二子数据块进行处理,得到该第一数据块和该每个第二子数据块的处理结果;根据该第一数据块和该多个第二子数据块中每个第二子数据块的处理结果,得到该第一数据块和该第二数据块的处理结果。In conjunction with the fifth possible implementation of the first aspect, in a sixth possible implementation manner of the first aspect, the coprocessor is specifically configured to: the first data block and the flow in the resident area Processing each of the plurality of second sub-blocks in the region to obtain a processing result of the first data block and each of the second sub-blocks; according to the first data block and the Processing result of each second sub-block of the plurality of second sub-blocks, and processing results of the first block and the second block are obtained.
本申请实施例的数据处理系统,协处理器对待处理数据的处理过程与控制模块向协处理器发送待处理数据的过程可以同时进行,可以减少每次通过PCIe通道的数据传输量,从而进一步提高数据传输效率。In the data processing system of the embodiment of the present application, the process of processing the data to be processed by the coprocessor and the process of sending the data to be processed by the control module to the coprocessor can be performed simultaneously, thereby reducing the amount of data transmission each time through the PCIe channel, thereby further improving Data transmission efficiency.
结合第一方面的第一种至第六种可能的实现方式中的任一种可能的实现方式,在第一方面的第七种可能的实现方式中,该控制模块还用于:若该待处理数据包括第一数据块和第二数据块,该第二数据块的数据量大于该协处理器可用的内存大小,且经过哈希处理后的该第一数据块的数据量大于该协处理器可用的内存大小,确定该第一数据块的存储属性为流转属性,并将该第一数据块划分为多个第一子数据块分批发送至该协处理器的流转区域,确定该第二数据块的存储属性为流转属性,并将该第二数据块划分为多个第二子数据块分批发送至该协处理器的流转区域。With reference to any one of the possible implementations of the first to the sixth possible implementations of the first aspect, in a seventh possible implementation manner of the first aspect, the control module is further configured to: Processing data includes a first data block and a second data block, the data amount of the second data block being greater than a memory size available to the coprocessor, and the data amount of the first data block after being hashed is greater than the coprocessing The available memory size, determining the storage attribute of the first data block as a flow attribute, and dividing the first data block into a plurality of first sub-blocks sent to the flow area of the coprocessor in batches, determining the first The storage attribute of the two data blocks is a flow attribute, and the second data block is divided into a plurality of second sub-blocks and sent to the flow area of the coprocessor in batches.
结合第一方面的第七种可能的实现方式,在第一方面的第八种可能的实现方式中,该协处理器还用于:对该流转区域中的该多个第一子数据块中每个第一子数据块和该多个第二子数据块中的每个第二子数据块进行处理,得到该每个第一子数据块和该每个第二子数据块的处理结果;根据该多个第一子数据块中每个第一子数据块和该多个第二子数据块中每个第二子数据块的处理结果,得到该第一数据块和该第二数据块的处理结果。In conjunction with the seventh possible implementation of the first aspect, in an eighth possible implementation of the first aspect, the coprocessor is further configured to: in the multiple first sub-blocks in the forwarding area Processing each of the first sub-data block and each of the plurality of second sub-data blocks to obtain a processing result of each of the first sub-data blocks and each of the second sub-blocks; Obtaining the first data block and the second data block according to a processing result of each of the first sub-data blocks and each of the plurality of second sub-data blocks Processing results.
结合第一方面的第一种至第八种可能的实现方式中的任一种可能的实现方式,在第一方面的第九种可能的实现方式中,该主处理器包括第一缓存区和第二缓存区;该控制模块具体用于将该待处理数据存储至该第一缓存区,直到该第一缓存区存满后,将该第一缓存区中的数据发送至该协处理器,将剩余的待处理数据继续存储至第二缓存区,直到所述第二缓存区存满后,将所述第二缓存中的数据发送至所述协处理器。With reference to any one of the first to the eighth possible implementation manners of the first aspect, in a ninth possible implementation manner of the first aspect, the main processor includes a first buffer area and a second buffer area; the control module is configured to store the to-be-processed data in the first buffer area, and send the data in the first buffer area to the co-processor after the first buffer area is full. The remaining pending data is further stored to the second buffer area, and after the second buffer area is full, the data in the second cache is sent to the coprocessor.
结合第一方面的第九种可能的实现方式,在第一方面的第十种可能的实现方式中,该控制模块还用于在将该第一缓存区中的数据发送至该协处理器的同时,继续将该待处理数据存储至该第二缓存区,并在该第二缓存区存满后,将该第二缓存区中的数据发送至该协处理器。 In conjunction with the ninth possible implementation of the first aspect, in a tenth possible implementation manner of the first aspect, the control module is further configured to send data in the first buffer area to the coprocessor At the same time, the data to be processed is continuously stored in the second buffer area, and after the second buffer area is full, the data in the second buffer area is sent to the coprocessor.
可选地,该主处理器中的该第一缓存区和该第二缓存区的内存大小均与该协处理器中的该子流转区域的内存大小相同,能够提高数据处理过程中内存的利用率,并提高数据处理效率。Optionally, the memory size of the first buffer area and the second buffer area in the main processor are the same as the memory size of the sub-streaming area in the coprocessor, which can improve memory utilization during data processing. Rate and improve data processing efficiency.
本申请实施例的数据处理系统,该控制模块通过将主处理器中第一缓存区和第二缓存区交替传输数据,可以提高处理数据的并行度,提高PCIe通道的传输效率。In the data processing system of the embodiment of the present application, the control module can improve the parallelism of the processed data and improve the transmission efficiency of the PCIe channel by alternately transmitting data between the first buffer area and the second buffer area in the main processor.
第二方面,提供了一种数据处理方法,该方法应用于第一方面中的数据处理系统,该数据处理系统包括主处理器、协处理器和控制模块,其中,该主处理器、该协处理器以及该控制模块用于执行上述第一方面或第一方面的任意可能的实现方式中与该主处理器、协处理器和控制模块对应的方法。In a second aspect, a data processing method is provided, the method being applied to a data processing system in a first aspect, the data processing system comprising a main processor, a coprocessor, and a control module, wherein the main processor, the coordinating The processor and the control module are configured to perform the method corresponding to the main processor, the coprocessor, and the control module in any of the possible implementations of the first aspect or the first aspect described above.
第三方面,提供了一种计算机可读介质,用于存储计算机程序,该计算机程序包括用于执行第二方面或第二方面的任意可能的实现方式中的方法的指令。In a third aspect, a computer readable medium is provided for storing a computer program comprising instructions for performing the method of any of the second aspect or any of the possible implementations of the second aspect.
附图说明DRAWINGS
图1是本申请实施例的数据处理系统的架构示例。FIG. 1 is an architectural example of a data processing system of an embodiment of the present application.
图2是本申请实施例的数据处理系统的示意性框图。2 is a schematic block diagram of a data processing system of an embodiment of the present application.
图3是本申请实施例的数据处理方法的示意性流程图。FIG. 3 is a schematic flowchart of a data processing method according to an embodiment of the present application.
图4是本申请实施例的另一数据处理方法的示意性流程图。FIG. 4 is a schematic flowchart of another data processing method according to an embodiment of the present application.
图5是本申请实施例的再一数据处理方法的示意性流程图。FIG. 5 is a schematic flowchart of still another data processing method according to an embodiment of the present application.
图6是本申请实施例的又一数据处理方法的示意性流程图。FIG. 6 is a schematic flowchart of still another data processing method according to an embodiment of the present application.
图7是本申请实施例的数据处理方法的场景示意图。FIG. 7 is a schematic diagram of a scenario of a data processing method according to an embodiment of the present application.
图8是本申请实施例的另一数据处理方法的场景示意图。FIG. 8 is a schematic diagram of a scenario of another data processing method according to an embodiment of the present application.
图9是本申请实施例的再一数据处理方法的场景示意图。FIG. 9 is a schematic diagram of a scenario of still another data processing method according to an embodiment of the present application.
具体实施方式detailed description
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行描述。The technical solutions in the embodiments of the present application will be described below with reference to the accompanying drawings in the embodiments of the present application.
图1示出了本申请实施例的数据处理系统100的架构示例,如图1所示,该数据处理系统包括:主处理器110、协处理器120和控制模块130,该主处理器110和该协处理器120之间通过PICe通道进行数据传输,其中,主处理器110通常包括1-2个CPU,协处理器120通常包括1-8个MIC处理器,该控制模块130用于控制该主处理器110与该协处理器120之间的数据处理和数据传输。1 shows an architectural example of a data processing system 100 of an embodiment of the present application. As shown in FIG. 1, the data processing system includes: a main processor 110, a coprocessor 120, and a control module 130, and the main processor 110 and Data transmission between the coprocessors 120 through the PIC channel, wherein the main processor 110 typically includes 1-2 CPUs, and the coprocessor 120 typically includes 1-8 MIC processors, the control module 130 is configured to control the data. Data processing and data transfer between the main processor 110 and the coprocessor 120.
具体地,该主处理器110用于接收用户端的数据处理请求,根据该用户端的数据处理请求确定待处理数据,该数据处理请求例如可以为连接处理请求、查询处理请求或者聚集处理请求等,本申请实施例对此不作限定。Specifically, the main processor 110 is configured to receive a data processing request of the user end, and determine data to be processed according to the data processing request of the user end, where the data processing request may be, for example, a connection processing request, a query processing request, or an aggregation processing request, etc. The application embodiment does not limit this.
具体地,该控制模块130用于接收该主处理器110发送的待处理数据,确定待处理数据在协处理器中的存储属性,并可以通过两种不同的传输方式将待处理数据发送至协处理器120。Specifically, the control module 130 is configured to receive the to-be-processed data sent by the main processor 110, determine a storage attribute of the to-be-processed data in the coprocessor, and send the to-be-processed data to the association by using two different transmission modes. Processor 120.
应理解,待处理数据的存储属性包括驻留属性或者流转属性,其中,驻留属性表示该待处理数据能够被多次访问,流转属性表示该待处理数据仅能够被访问一次。It should be understood that the storage attribute of the data to be processed includes a resident attribute or a flow attribute, wherein the resident attribute indicates that the pending data can be accessed multiple times, and the streaming attribute indicates that the pending data can only be accessed once.
还应理解,该控制模块可以将待处理数据一次性发送至协处理器,或者可以将待处理数据分批依次发送至协处理器。 It should also be understood that the control module may send the data to be processed to the coprocessor at one time, or may send the data to be processed in batches to the coprocessor in sequence.
可选地,该控制模块块可以通过软件实现,例如可以为系统中的程序代码,或者可以通过硬件实现,例如可以为集成在其它控制设备中的装置,本申请实施例对此不作限定。Optionally, the control module block may be implemented by software, for example, may be a program code in the system, or may be implemented by hardware, for example, may be a device integrated in other control devices, which is not limited by the embodiment of the present application.
具体地,该协处理器120用于通过控制模块130接收主处理器110发送的待处理数据,并对待处理数据进行处理,得到处理结果,最后通过该控制模块130向主处理器110返回处理结果。Specifically, the coprocessor 120 is configured to receive, by the control module 130, the to-be-processed data sent by the main processor 110, process the data to be processed, obtain a processing result, and finally return the processing result to the main processor 110 through the control module 130. .
可选地,该协处理器120可以用于对数据进行哈希连接处理或者OLAP查询,等计算密集型数据任务或者聚集处理等耗时且适合并行完成的操作,本申请实施例对此不作限定。Optionally, the coprocessor 120 can be used to perform hash connection processing or OLAP query on the data, and the operations such as the computationally intensive data task or the aggregation processing are time-consuming and suitable for the parallel operation. .
本申请实施例的数据处理系统,通过在主处理器和协处理器之间增加用于控制数据传输的控制模块,将主处理器在数据处理过程中需要调用的程序和代码封装在该控制模块中,使得主处理器在进行数据处理的过程中无需每次都调用所有需要使用的代码,只需要简单地调用该控制模块,便可以实现对数据处理、数据传输以及内存管理的控制,减轻了主处理器的工作负担,并且简化了系统的代码设计。The data processing system of the embodiment of the present application encapsulates a program and code that the main processor needs to call in the data processing process in the control module by adding a control module for controlling data transmission between the main processor and the coprocessor. In the process of data processing, the main processor does not need to call all the code that needs to be used every time, and only needs to simply call the control module to control the data processing, data transmission and memory management, and reduce the control. The workload of the main processor and simplifying the code design of the system.
图2示出了本申请实施例的数据处理的系统200的示意性框图。该系统200包括主处理器210、协处理器220和控制模块230。FIG. 2 shows a schematic block diagram of a system 200 for data processing in accordance with an embodiment of the present application. The system 200 includes a main processor 210, a coprocessor 220, and a control module 230.
该主处理器210用于将待处理数据发送至该控制模块230。The main processor 210 is configured to send data to be processed to the control module 230.
该控制模块230用于接收该主处理器210发送的该待处理数据,并将该待处理数据发送至该协处理器220。The control module 230 is configured to receive the to-be-processed data sent by the main processor 210, and send the to-be-processed data to the coprocessor 220.
该协处理器220用于接收该控制模块230发送的该待处理数据,对该待处理数据进行处理,得到该待处理数据的处理结果,并将该待处理数据的处理结果通过该控制模块发送至该主处理器210;The coprocessor 220 is configured to receive the to-be-processed data sent by the control module 230, process the to-be-processed data, obtain a processing result of the to-be-processed data, and send the processing result of the to-be-processed data to the control module. To the main processor 210;
该主处理器210用于接收该协处理器220通过该控制模块230发送的该待处理数据的处理结果。The main processor 210 is configured to receive a processing result of the to-be-processed data sent by the coprocessor 220 through the control module 230.
本申请实施例的数据处理系统,通过在主处理器和协处理器之间增加用于控制数据传输的控制模块,将主处理器在数据处理过程中需要调用的程序和代码封装在该控制模块中,使得主处理器在进行数据处理的过程中无需多次调用所有需要使用的代码,只需要简单地调用该控制模块,便可以实现对数据处理、数据传输以及内存管理的控制,减轻了主处理器的工作负担,并且简化了系统的代码设计。The data processing system of the embodiment of the present application encapsulates a program and code that the main processor needs to call in the data processing process in the control module by adding a control module for controlling data transmission between the main processor and the coprocessor. In the process of data processing, the main processor does not need to call all the code that needs to be used multiple times, and only needs to simply call the control module, thereby realizing control of data processing, data transmission, and memory management, reducing the main The workload of the processor and simplifies the code design of the system.
具体地,该主处理器用于确定待处理数据,并将该待处理器数据发送至控制模块。Specifically, the main processor is configured to determine data to be processed, and send the to-be-processed data to the control module.
具体地,该控制模块具体用于将该待处理数据一次性发送至该协处理器或者将该待处理数据分批发送至该协处理器,并且在该控制模块将该待处理数据发送至该协处理器时携带该待处理数据的存储属性。Specifically, the control module is specifically configured to send the to-be-processed data to the coprocessor or send the to-be-processed data to the coprocessor in batches, and send the to-be-processed data to the control module. The coprocessor carries the storage attribute of the data to be processed.
可选地,该控制模块具体用于在该控制模块将该待处理数据发送至该协处理器之前,根据该待处理数据的处理上下文、该待处理数据的数据量以及该协处理器可用的内存大小,确定该待处理数据的存储属性,但本申请实施例不限于此。Optionally, the control module is specifically configured to: before the control module sends the to-be-processed data to the coprocessor, according to a processing context of the to-be-processed data, an amount of data of the to-be-processed data, and an available The memory size determines the storage attribute of the data to be processed, but the embodiment of the present application is not limited thereto.
可选地,该控制模块可以根据该待处理数据是否需要多次使用以及该待处理数据是否能够全部存储至该协处理器,判断该待处理数据的存储属性。Optionally, the control module may determine, according to whether the to-be-processed data needs to be used multiple times, and whether the to-be-processed data can be all stored to the coprocessor, and determine a storage attribute of the to-be-processed data.
应理解,待处理数据的存储属性包括驻留属性或者流转属性,其中,驻留属性表示该待处理数据能够被多次访问,流转属性表示该待处理数据仅能够被访问一次。 It should be understood that the storage attribute of the data to be processed includes a resident attribute or a flow attribute, wherein the resident attribute indicates that the pending data can be accessed multiple times, and the streaming attribute indicates that the pending data can only be accessed once.
还应理解,该协处理器可用的内存大小为该协处理器中除该协处理器系统占用的内存以外的内存大小。It should also be understood that the amount of memory available to the coprocessor is the amount of memory in the coprocessor other than the memory occupied by the coprocessor system.
可选地,该控制模块用于将该待处理数据的存储属性携带在该待处理数据中,并将携带存储属性的待处理数据块发送至该协处理器,或者可以在向该协处理器发送用于指示该待处理数据的存储属性的指示信息,本申请实施例对此不作限定。Optionally, the control module is configured to carry the storage attribute of the to-be-processed data in the to-be-processed data, and send the to-be-processed data block carrying the storage attribute to the coprocessor, or may be in the coprocessor The indication information for indicating the storage attribute of the data to be processed is not limited in this embodiment of the present application.
可选地,该控制模块还用于在将该待处理数据发送至该协处理器之前,确定该协处理中的驻留区域的内存大小和流转区域的内存大小,其中该驻留区域中存储的数据能够被多次访问,该流转区域中存储的数据仅能够被访问一次,并且会在访问后被删除或覆盖。Optionally, the control module is further configured to: before sending the to-be-processed data to the coprocessor, determine a memory size of the resident area in the co-processing and a memory size of the streaming area, where the resident area is stored The data can be accessed multiple times, the data stored in the streaming area can only be accessed once, and will be deleted or overwritten after the access.
本申请实施例的数据处理系统,控制模块通过在协处理器中设置驻留区域和流转区域,使得在计算时需要被多次数据保持一直存储在驻留区域中,将一次使用的数据分批传输流转区域,并分别与驻留中的数据进行处理,减少了每次通过PCIe通道的数据传输量,并且提高了数据处理的效率。In the data processing system of the embodiment of the present application, the control module sets the resident area and the flow area in the coprocessor, so that the data needs to be stored in the resident area for multiple times during the calculation, and the data used once is batched. The transfer area is transferred and processed separately with the data in the camp, which reduces the amount of data transmission each time through the PCIe channel and improves the efficiency of data processing.
可选地,该控制模块可以根据该待处理数据的数据量、该待处理数据的存储属性以及该协处理器可以的内存大小,确定该协处理器中驻留区域的内存大小和流转区域的内存大小。Optionally, the control module may determine, according to the data volume of the data to be processed, the storage attribute of the data to be processed, and the memory size of the coprocessor, the memory size and the flow area of the resident area in the coprocessor. memory size.
应理解,该控制模块可以优先考虑驻留属性的待处理数据,根据驻留属性的待处理数据的数据量,在该协处理器可用的内存中确定出驻留区域的内存大小,然后将该协处理器剩余的可用内存确定为流转区域的内存大小。It should be understood that the control module may preferentially consider the data to be processed of the resident attribute, determine the memory size of the resident area in the available memory of the coprocessor according to the data amount of the data to be processed of the resident attribute, and then The remaining available memory of the coprocessor is determined as the memory size of the streaming area.
可选地,该控制模块可以将该流转区域划分为多个子流转区域,该多个子流转区域的数量可以为该流转区域的内存大小除以该每个子流转区域的内存大小,其中,该每个子流转区域的内存大小可以根据数据处理系统的平台情况预先测试得到,即可以将该每个子流转区域的内存大小设置为使得该每个子流转区域中的数据复制到该协处理器的时间与该协处理器的内核计算该每个子流转区域中的数据的时间相同或相近,同时可以考虑可以使得每个子流转区域的数据在PCIe通道传输时的传输性能,本申请实施例对此不作限定。Optionally, the control module may divide the flow area into a plurality of sub-flow areas, where the number of the multiple sub-flow areas may be a memory size of the flow area divided by a memory size of each of the sub-flow areas, where each of the sub-flow areas The memory size of the flow area can be pre-tested according to the platform of the data processing system, that is, the memory size of each sub-flow area can be set such that the data in each sub-flow area is copied to the coprocessor and the association. The core of the processor calculates the time of the data in each of the sub-streaming areas to be the same or similar, and the transmission performance of the data of each sub-streaming area in the PCIe channel transmission may be considered, which is not limited in this embodiment of the present application.
本申请实施例的数据处理系统,通过设置多个子流转区域,并同时考虑协处理器可以的内存大小以及PCIe通道的传输性能,能够提高PCIe通道的数据传输效率以及数据处理系统的处理效率。The data processing system of the embodiment of the present application can improve the data transmission efficiency of the PCIe channel and the processing efficiency of the data processing system by setting a plurality of sub-streaming areas and considering the memory size of the coprocessor and the transmission performance of the PCIe channel.
具体地,该控制模块具体用于建立该多个子流转区域的队列,形成连续的多个子流转区域,并将该待处理数据分批依次发送至该多个子流转区域中的每个子流转区域。Specifically, the control module is specifically configured to establish a queue of the plurality of sub-flow areas, form a plurality of consecutive sub-flow areas, and sequentially send the to-be-processed data to each of the plurality of sub-flow areas in batches.
具体地,该协处理器具体用于依次读取该连续的多个子流转区域中每个子流转区域中的数据,并对该子流转区域中的数据进行处理,并对该每个自流转区域中的数据处理完之后,将该每个自流转子区域标识为空闲,在该连续的多个子流转区域中最后一个子流转区域中的数据处理完成后,并且检测到该连续的多个子流转区域中第一个子流转区域标识为空闲时,继续从该连续的多个子流转区域中第一个子流转区域中读取数据,并处理。Specifically, the coprocessor is specifically configured to sequentially read data in each of the plurality of sub-flow regions, and process the data in the sub-flow region, and in each of the self-flow regions After the data is processed, the each self-flowing rotor region is identified as idle, after the data processing in the last sub-flow region of the consecutive plurality of sub-flow regions is completed, and the continuous plurality of sub-flow regions are detected. When the first sub-flow area is identified as idle, data is continuously read from the first sub-flow area of the plurality of consecutive sub-flow areas, and processed.
本申请实施例的数据处理系统,该协处理器通过多个循环的子流转区域对数据进行读取和处理,可以提高协处理器的内存利用率以及该数据处理的并行度。In the data processing system of the embodiment of the present application, the coprocessor reads and processes data through a plurality of cyclic sub-flow regions, thereby improving memory utilization of the coprocessor and parallelism of the data processing.
可选地,该主处理器可以包括第一缓存区和第二缓存区,该控制模块用于将该待处 理数据存储至该第一缓存区,直到该第一缓存区存满后,将该第一缓存区中的数据发送至协处理器。Optionally, the main processor may include a first buffer area and a second buffer area, where the control module is configured to The data is stored in the first buffer area, and after the first buffer area is full, the data in the first buffer area is sent to the coprocessor.
可选地,该控制模块用于在将该第一缓存区中的数据发送至该协处理器的同时,将该待处理数据继续存储至该第二缓存区,并在该第二缓存区存满之后,将该第二缓存区中的数据发送至该协处理器。Optionally, the control module is configured to continue to store the data to be processed in the second buffer area while the data in the first buffer area is sent to the coprocessor, and save the data in the second buffer area. After the full, the data in the second buffer area is sent to the coprocessor.
本申请实施例的数据处理系统,通过在主处理器中设置两个缓存区交替进行数据的传输和存储,提高了系统的并行度,以及数据处理效率,同时可以将缓存区设置的大小设置为与协处理器中每个流转区域的大小相同,从而达到提高协处理器内存利用率,以及提高数据处理效率。The data processing system of the embodiment of the present application improves the parallelism of the system and the data processing efficiency by setting two buffer areas in the main processor to alternately transmit and store data, and can set the size of the buffer area to It is the same size as each of the reflow areas in the coprocessor, which improves coprocessor memory utilization and improves data processing efficiency.
作为一个可选地实施例,假设,该待处理数据包括第一数据块和第二数据块,其中,该第一数据块的数据量小于该协处理器可用的内存大小,该第二数据块的数据量大于该协处理器可用的内存大小。As an optional embodiment, it is assumed that the to-be-processed data includes a first data block and a second data block, wherein a data amount of the first data block is smaller than a memory size available to the coprocessor, and the second data block The amount of data is greater than the amount of memory available to the coprocessor.
具体地,该控制模块用于接收该主处理器发送的该第一数据块和该第二数据块,根据该第一数据块的数据量、该第二数据块的数据量、该协处理器可用的内存大小以及处理上下文,确定该第一数据块为驻留属性,该第二数据块为流转属性,并且将该第一数据块发送至该协处理器的驻留区域,将该第二数据块划分为多个第二子数据块,并将该多个第二子数据块分批发送至该协处理器的流转区域。Specifically, the control module is configured to receive the first data block and the second data block sent by the main processor, according to the data amount of the first data block, the data amount of the second data block, and the coprocessor The available memory size and the processing context, determining that the first data block is a resident attribute, the second data block is a streaming attribute, and sending the first data block to a resident area of the coprocessor, the second The data block is divided into a plurality of second sub-blocks, and the plurality of second sub-blocks are sent in batches to a flow area of the coprocessor.
可选地,该第一数据块可以一次性发送至该协处理器的驻留区域,且该第一数据块可以为经过哈希运算的第一数据块,本申请实施例对此不作限定。Optionally, the first data block may be sent to the resident area of the coprocessor at one time, and the first data block may be a hashed first data block, which is not limited in this embodiment of the present application.
具体地,该协处理器用于对驻留区域中的该第一数据块以及该流转区域中的该多个第二子数据块中的每个第二子数据块进行处理,该第一数据块与每个第二子数据块对应的处理结果,并根据该第一数据块与该多个第二子数据块中每个第二子数据块的处理结果,得到该第一数据块与该第二数据块的处理结果,并将该第一数据块与该第二数据块的处理结果通过该控制模块发送至该主处理器。Specifically, the coprocessor is configured to process the first data block in the resident area and each of the plurality of second sub data blocks in the flow area, the first data block Processing result corresponding to each second sub-block, and obtaining the first data block and the first data block according to a processing result of the first data block and each second sub-data block of the plurality of second sub-data blocks Processing result of the two data blocks, and transmitting the processing result of the first data block and the second data block to the main processor through the control module.
作为另一个可选的实施例,假设该待处理器数据包括第一数据块和第二数据块,其中,该第二数据块的数据量大于该协处理器可用的内存大小,且经过哈希处理后的该第一数据块的数据量也大于该协处理器可用的内存大小。As another optional embodiment, it is assumed that the to-be-processor data includes a first data block and a second data block, wherein a data amount of the second data block is greater than a memory size available to the coprocessor, and is hashed. The processed data volume of the first data block is also larger than the memory size available to the coprocessor.
该控制模块用于接收该主处理器发送的该第一数据块和该第二数据块,根据该第一数据块的数据量、该第二数据块的数据量、该协处理器可用的内存大小以及处理上下文,确定该第一数据块和该第二数据块均为流转属性,并将该第一数据块划分为多个第一子数据块分批发送至该协处理器的流转区域,将该第二数据块划分为多个第二子数据块分批发送至该协处理器的流转区域。The control module is configured to receive the first data block and the second data block sent by the main processor, according to the data amount of the first data block, the data amount of the second data block, and the available memory of the coprocessor Determining the size and the processing context, determining that the first data block and the second data block are both flow attributes, and dividing the first data block into a plurality of first sub-blocks sent to the flow area of the coprocessor in batches, The second data block is divided into a plurality of second sub-blocks and sent to the streaming area of the co-processor in batches.
可选地,该主处理器可以包括第一缓存区和第二缓存区,该第一缓存与该第二缓存的内存大小相同,该控制模块可以通过第一缓存区和第二缓存区将该多个第一子数据块和该多个第二子数据块发送至该协处理器,本申请实施例对此不作限定。Optionally, the main processor may include a first buffer area and a second buffer area, where the first cache has the same memory size as the second cache, and the control module may use the first buffer area and the second buffer area to A plurality of first sub-blocks and a plurality of second sub-blocks are sent to the coprocessor, which is not limited in this embodiment of the present application.
具体地,该控制模块用于根据该第一缓存区或该第二缓存区的内存大小,将该第一数据块和该第二数据块分块,得到多个第一子数据块以及与该多个第一子数据块中每个第一子数据块对应的第二子数据块,并且使得该每个第一子数据块和与该每个第一子数据块对应的第二子数据块的数据量总和与该第一缓存区或该第二缓存区相等,该控制模块用于通过该第一缓存区和该第二缓存区轮流将该多个第一子数据块中每个第一子数据 块和该多个第二子数据块中每个第二子数据块发送至协处理器。Specifically, the control module is configured to divide the first data block and the second data block into blocks according to a memory size of the first buffer area or the second buffer area, to obtain a plurality of first sub-blocks and a second sub-block corresponding to each of the plurality of first sub-blocks, and such that each of the first sub-blocks and the second sub-block corresponding to each of the first sub-blocks The sum of the data amounts is equal to the first buffer area or the second buffer area, and the control module is configured to rotate each of the plurality of first sub-blocks by the first buffer area and the second buffer area. Subdata The block and each of the plurality of second sub-blocks are sent to the coprocessor.
具体地,该协处理器用于对该流转区域中的该多个第一子数据块中每个第一子数据块和该多个第二子数据块中的每个第二子数据块进行处理,得到该每个第一子数据块和该每个第二子数据块的处理结果,根据该多个第一子数据块中每个第一子数据块和该多个第二子数据块中每个第二子数据块的处理结果,得到该第一数据块和该第二数据块的处理结果,并将该第一数据块和该第二数据块的处理结果通过该控制模块发送至主处理器。Specifically, the coprocessor is configured to process each of the first one of the plurality of first subblocks and the second of the plurality of second subblocks in the streaming area Obtaining a processing result of each of the first sub-blocks and each of the second sub-blocks, according to each of the plurality of first sub-blocks and the plurality of second sub-blocks Processing result of each second sub-block, obtaining a processing result of the first data block and the second data block, and sending the processing result of the first data block and the second data block to the main processor.
上面结合图1和图2对本申请的数据处理的系统进行了描述,下面将结合图3至图6介绍在上述数据处理系统中进行数据处理的方法。The system for data processing of the present application has been described above with reference to Figs. 1 and 2, and a method of performing data processing in the above data processing system will be described below with reference to Figs.
图3示出了本申请实施例的数据处理的方法300的示意性流程图。该方法300可以应用于如图2所示的系统中,并可以实现上述数据处理系统中主处理器、协处理器和控制模块实现的各个功能,为避免重复,此处不再赘述。FIG. 3 is a schematic flowchart of a method 300 for data processing according to an embodiment of the present application. The method 300 can be applied to the system shown in FIG. 2, and can implement various functions implemented by the main processor, the coprocessor, and the control module in the foregoing data processing system. To avoid repetition, details are not described herein again.
S301,该主处理器将待处理数据发送至该控制模块。S301. The main processor sends the to-be-processed data to the control module.
S302,该控制模块接收该主处理器发送的该待处理数据,并将该待处理数据发送至该协处理器。S302. The control module receives the to-be-processed data sent by the main processor, and sends the to-be-processed data to the coprocessor.
S303,该协处理器接收该控制模块发送的该待处理数据,对该待处理数据进行处理,得到该待处理数据的处理结果,并将该待处理数据的处理结果通过该控制模块发送至该主处理器。S303, the coprocessor receives the to-be-processed data sent by the control module, processes the to-be-processed data, obtains a processing result of the to-be-processed data, and sends the processing result of the to-be-processed data to the Main processor.
S304,该主处理器接收该协处理器通过该控制模块发送的该待处理数据的处理结果。S304. The main processor receives a processing result of the to-be-processed data sent by the coprocessor through the control module.
可选地,该控制模块将该待处理数据发送至该协处理器,包括:Optionally, the control module sends the to-be-processed data to the coprocessor, including:
将该待处理数据一次性发送至该协处理器,或者将该待处理数据分批发送至该协处理器,并且在将该待处理数据发送至该协处理器时携带该待处理数据的存储属性,该存储属性包括驻留属性或流转属性,该驻留属性表示该待处理数据能够被多次访问,该流转属性表示该待处理数据仅能够被访问一次。Sending the to-be-processed data to the coprocessor once, or sending the to-be-processed data to the coprocessor in batches, and carrying the to-be-processed data when the to-be-processed data is sent to the coprocessor An attribute comprising a resident attribute or a flow attribute, the resident attribute indicating that the pending data can be accessed multiple times, the flow attribute indicating that the pending data can only be accessed once.
可选地,该控制模块根据该待处理数据的处理上下文、该待处理数据的数据量和该协处理器可用的内存大小,确定该待处理数据的存储属性。Optionally, the control module determines, according to a processing context of the to-be-processed data, an amount of data of the to-be-processed data, and a memory size available to the coprocessor, a storage attribute of the to-be-processed data.
可选地,在将该待处理数据发送至该协处理器之前,该方法还包括:Optionally, before the sending the to-be-processed data to the coprocessor, the method further includes:
该控制模块根据该待处理数据的数据量、该待处理数据的存储属性和该协处理器可用的内存大小,确定该协处理器的内存中的驻留区域的内存大小和流转区域的内存大小,其中,该驻留区域中存储的数据能够被多次访问,该流转区域中的数据仅能够被访问一次,并且在被访问后删除或覆盖。The control module determines the memory size of the resident area in the memory of the coprocessor and the memory size of the streaming area according to the data amount of the data to be processed, the storage attribute of the data to be processed, and the available memory size of the coprocessor. Where the data stored in the resident area can be accessed multiple times, the data in the streaming area can only be accessed once and deleted or overwritten after being accessed.
可选地,该协处理器的流转区域包括连续的多个子流转区域;该控制模块将该待处理数据分批发送至该协处理器,包括:该控制模块将该待处理数据分批依次发送至该连续的多个子流转区域中的每个子流转区域;该协处理器对该待处理数据进行处理,得到该待处理数据的处理结果,包括:Optionally, the flow area of the coprocessor includes a plurality of consecutive sub-flow areas; the control module sends the data to be processed to the coprocessor in batches, and the control module sends the data to be processed in batches in sequence. Up to each of the plurality of sub-flow regions; the coprocessor processing the data to be processed, and obtaining the processing result of the data to be processed, including:
该协处理器依次读取该连续的多个子流转区域中每个子流转区域中的数据,并对该每个子流转区域中的数据进行处理,在对该每个子流转区域中的数据处理完成后,将该每个子流转区域标识为空闲;该协处理器在该连续的多个子流转区域中最后一个子流转区域中的数据处理完成后,并且该连续的多个子流转区域中第一个子流转区域标识为空闲时,继续从该连续的多个子流转区域中的第一个子流转区域开始读取数据。 The coprocessor sequentially reads data in each of the plurality of sub-flow regions, and processes the data in each of the sub-flow regions. After the data processing in each of the sub-flow regions is completed, Identifying each sub-flow area as idle; the coprocessor is after the data processing in the last sub-flow area of the consecutive plurality of sub-flow areas is completed, and the first sub-flow area of the consecutive plurality of sub-flow areas When the flag is idle, the data is continuously read from the first sub-streaming area of the plurality of consecutive sub-streaming areas.
可选地,该控制模块将该待处理数据分批发送至该协处理器,包括:Optionally, the control module sends the to-be-processed data to the coprocessor in batches, including:
若该待处理数据包括第一数据块和第二数据块,该第一数据块的数据量小于该协处理器可用的内存大小,并且该第二数据块的数据量大于该协处理器可用的内存大小,该控制模块确定该第一数据块的存储属性为驻留属性,并将该第一数据块发送至该协处理器的驻留区域,该控制模块确定该第二数据块的存储属性为流转属性,并将该第二数据块划分为多个第二子数据块分批依次发送至该协处理器的流转区域。If the data to be processed includes the first data block and the second data block, the data amount of the first data block is smaller than the memory size available to the coprocessor, and the data amount of the second data block is greater than that available to the coprocessor a memory size, the control module determines that a storage attribute of the first data block is a resident attribute, and sends the first data block to a resident area of the coprocessor, and the control module determines a storage attribute of the second data block For the flow attribute, the second data block is divided into a plurality of second sub-blocks and sent to the flow area of the co-processor in batches.
可选地,该协处理器对该待处理数据进行处理,得到该待处理数据的处理结果,包括:Optionally, the coprocessor processes the to-be-processed data to obtain a processing result of the to-be-processed data, including:
该协处理器对该驻留区域中的该第一数据块和该流转区域中的该多个第二子数据块中的每个第二子数据块进行处理,得到该第一数据块和该每个第二子数据块的处理结果;该协处理器根据该第一数据块和该多个第二子数据块中每个第二子数据块的处理结果,得到该第一数据块和该第二数据块的处理结果。The coprocessor processes the first data block in the resident area and each of the plurality of second sub data blocks in the flow area to obtain the first data block and the a processing result of each second sub-block; the coprocessor obtains the first data block according to the processing result of the first data block and each second sub-block of the plurality of second sub-blocks The processing result of the second data block.
可选地,该控制模块将该待处理数据发送至该协处理器,包括:若该待处理数据包括第一数据块和第二数据块,该第二数据块的数据量大于该协处理器可用的内存大小,且经过哈希处理后的该第一数据块的数据量大于该协处理器可用的内存大小,该控制模块确定该第一数据块的存储属性为流转属性,并将该第一数据块划分为多个第一子数据块分批发送至该协处理器的流转区域,该控制模块确定该第二数据块的存储属性为流转属性,并将该第二数据块划分为多个第二子数据块分批发送至该协处理器的流转区域。Optionally, the control module sends the to-be-processed data to the coprocessor, including: if the to-be-processed data includes the first data block and the second data block, the data volume of the second data block is greater than the coprocessor The available memory size, and the data amount of the hashed first data block is greater than the available memory size of the coprocessor, the control module determines that the storage attribute of the first data block is a streaming attribute, and the first a data block is divided into a plurality of first sub-blocks that are sent in batches to a flow area of the coprocessor, and the control module determines that a storage attribute of the second data block is a flow attribute, and divides the second data block into multiple The second sub-blocks are sent in batches to the flow area of the coprocessor.
可选地,该协处理器对该待处理数据进行处理,得到该待处理数据的处理结果,包括:Optionally, the coprocessor processes the to-be-processed data to obtain a processing result of the to-be-processed data, including:
该协处理器对该流转区域中的该多个第一子数据块中每个第一子数据块和该多个第二子数据块中的每个第二子数据块进行处理,得到该每个第一子数据块和该每个第二子数据块的处理结果;该协处理器根据该多个第一子数据块中每个第一子数据块和该多个第二子数据块中每个第二子数据块的处理结果,得到该第一数据块和该第二数据块的处理结果。The coprocessor processes each of the plurality of first sub-blocks and the second of the plurality of second sub-blocks in the flow region to obtain each of the plurality of second sub-blocks Processing results of the first sub-block and the each second sub-block; the co-processor according to each of the plurality of first sub-blocks and the plurality of second sub-blocks The processing result of each second sub-block obtains the processing result of the first data block and the second data block.
可选地,该主处理器包括第一缓存区和第二缓存区;该控制模块将该待处理数据发送至该协处理器,包括:该控制模块将该待处理数据存储至该第一缓存区,直到该第一缓存区存满后,将该第一缓存区中的数据发送至该协处理器。Optionally, the main processor includes a first buffer area and a second buffer area; the control module sends the to-be-processed data to the coprocessor, and the control module stores the to-be-processed data to the first cache. The area, until the first buffer area is full, sends the data in the first buffer area to the coprocessor.
可选地,该控制模块将该待处理数据发送至该协处理器,包括:Optionally, the control module sends the to-be-processed data to the coprocessor, including:
在将该第一缓存区中的数据发送至该协处理器的同时,该控制模块继续将该待处理数据存储至该第二缓存区,并在该第二缓存区存满后,将该第二缓存区中的数据发送至该协处理器。While the data in the first buffer area is sent to the coprocessor, the control module continues to store the to-be-processed data to the second buffer area, and after the second buffer area is full, the first The data in the second buffer is sent to the coprocessor.
本申请实施例的数据处理方法,通过主处理器和协处理器之间的控制模块完成主处理器和协处理器之间的数据传输以及数据处理,减轻了主处理器的工作负担,并且简化了原本将数据处理、数据传输以及内存管理集成于一体的系统代码。The data processing method of the embodiment of the present application completes data transmission and data processing between the main processor and the coprocessor through a control module between the main processor and the coprocessor, thereby reducing the workload of the main processor and simplifying System code that originally integrates data processing, data transfer, and memory management.
上面结合图3对本申请实施例的数据处理方法进行了描述,下面将结合具体的实施例对本申请实施例的数据处理方法进行详细描述。The data processing method of the embodiment of the present application is described in detail with reference to FIG. 3, and the data processing method of the embodiment of the present application will be described in detail below with reference to specific embodiments.
图4示出了本申请实施例的另一数据处理方法400的示意性流程图,该方法400可以应用于如图2所示的系统中,并且结合图7详细介绍了数据处理系统在对R表和S表进行哈希连接处理时的方法流程,其中,该R表与该S表相关联。 FIG. 4 is a schematic flowchart of another data processing method 400 of the embodiment of the present application. The method 400 can be applied to the system shown in FIG. 2, and the data processing system is described in detail in conjunction with FIG. 7. A method flow when the table and the S table perform a hash join process, wherein the R table is associated with the S table.
应理解,本申请实施例可以应用于关系型数据库,在关系型数据库中,每个数据表中都有若干个属性,若其中的某一个属性能够唯一标识该数据表,则该属性组就为该表格的一个主键,例如,该R表可以为学生表,该学生表包括学号、姓名和班级,而其中每个学生的学号是惟一的,则学号就是主键,外键主要是与另外一个数据表进行关联,例如,该S表可以为成绩表,该成绩表包括学号、课程号和成绩,其中课程号和学号一起才可以确定成绩,所以该成绩表的主键为学号和课程号,并且成绩表中的学号和学生表中的学号对应,因此,该成绩表中的学号为学生表的外键,该学生表和该成绩表通过学号进行关联。It should be understood that the embodiment of the present application can be applied to a relational database. In a relational database, each data table has several attributes. If one of the attributes can uniquely identify the data table, the attribute group is A primary key of the form, for example, the R table may be a student form, the student form includes a student number, a name, and a class, and each student's student number is unique, and the student number is a primary key, and the foreign key is mainly Another data table is associated. For example, the S table can be a transcript. The transcript includes a student number, a course number, and a grade. The course number and the student number can be used together to determine the grade, so the primary key of the transcript is the student number. And the course number, and the student number in the transcript corresponds to the student number in the student table. Therefore, the student number in the transcript is a foreign key of the student table, and the student table and the transcript are associated by the student number.
S401,控制模块接收主处理器发送的R表和S表,该R表和该S表相互关联,并且,该R表中的数据量小于协处理器可用的内存大小,该S表中的数据量大于该协处理器可以的内存大小。S401. The control module receives an R table and an S table sent by the main processor, where the R table and the S table are associated with each other, and the amount of data in the R table is smaller than a memory size available to the coprocessor, and the data in the S table. The amount is greater than the memory size that the coprocessor can.
S402,该控制模块根据该R表的数据量、该S表的数据量、该协处理器可用的内存大小以及处理上下文,将该R表标识驻留属性,将该S表标识为流转属性。S402. The control module identifies the R-type resident attribute according to the data amount of the R table, the data amount of the S-table, the available memory size of the coprocessor, and the processing context, and identifies the S-table as a streaming attribute.
具体地,该控制模块可以将该R表一次性发送至该协处理器的驻留区,将该S表分批发送至该协处理器的流转区。Specifically, the control module may send the R table to the camping area of the coprocessor at one time, and send the S table to the streaming area of the coprocessor in batches.
可选地,在该S402之前,该控制模块可以根据该R表的数据量、该S表的数据量、该R表的驻留属性、该S表的流转属性以及该协处理器可用的内存大小,确定该协处理器中的驻留区域的内存大小以及流转区域的内存大小。Optionally, before the S402, the control module may: according to the data amount of the R table, the data amount of the S table, the resident attribute of the R table, the streaming attribute of the S table, and the available memory of the coprocessor Size, determines the memory size of the resident area in the coprocessor and the memory size of the flow area.
S403,该控制模块对该R表进行哈希运算,得到R表哈希表。S403. The control module performs a hash operation on the R table to obtain an R table hash table.
S404,该控制模块将该R表哈希表发送至协处理器的驻留区域。S404. The control module sends the R table hash table to a resident area of the coprocessor.
S405,该控制模块将该S表划分为多个子S表。S406,该控制模块将该多个子S表中第j个子S表发送至该协处理器的第i个空闲的子流转区域。S405. The control module divides the S table into a plurality of sub-S tables. S406. The control module sends the jth sub-S table of the plurality of sub-S tables to the i-th free sub-streaming area of the coprocessor.
可选地,该主处理器可以包括第一缓存区和第二缓存区,该控制模块可以通过该第一缓存区和该第二缓存区将该多个子S表中每个子S表发送至该协处理器的流转区域。Optionally, the main processor may include a first buffer area and a second buffer area, and the control module may send, by using the first buffer area and the second buffer area, each sub-S table of the plurality of sub-S tables to the The flow area of the coprocessor.
S407,该协处理器对该驻留区域中该R表哈希表和该第i个子流转区域中的第j个子S表进行哈希连接运算,得到该第j个子S表对应的处理结果。S407. The coprocessor performs a hash join operation on the R table hash table and the jth child S table in the i th substreaming area in the resident area, to obtain a processing result corresponding to the jth child S table.
S408,该协处理器将该第i个子流转区域标识为空闲。S408. The coprocessor identifies the i-th sub-streaming area as idle.
S409,该控制模块将该多个子S表中第j+1个子S表发送至该协处理器的第i+1个空闲的子流转区域。S409. The control module sends the j+1th sub-S table in the plurality of sub-S tables to the i+1th idle sub-streaming area of the coprocessor.
S410,该协处理器对该驻留区域中该R表哈希表和该第i+1个子流转区域中的第j+1个子S表进行哈希连接运算,得到该第j+1个子S表对应的处理结果。S410, the coprocessor performs a hash join operation on the R table hash table and the j+1th sub S table in the i+1th substreaming area in the resident area, to obtain the j+1th child S The processing result corresponding to the table.
S411,该协处理器将该第i+1个子流转区域标识为空闲。S411. The coprocessor identifies the i+1th sub-streaming area as idle.
可选地,该协处理器可以包括连续的多个子流转区域,该协处理器可以依次读取该连续的多个子流转区域中每个子流转区域中的子S表,并将该每个子流转区域中的子S表与该驻留区域中的R表进行处理。Optionally, the coprocessor may include a plurality of consecutive sub-flow regions, and the coprocessor may sequentially read the sub-S tables in each of the consecutive plurality of sub-flow regions, and each of the sub-flow regions The child S table in the process is processed with the R table in the resident area.
S412,该协处理器根据该驻留区中的该R表哈希表和该多个子流转区域中每个子流转区域中的子S表的哈希连接结果,得到该R表与该S表的哈希连接结果。S412. The coprocessor obtains the R table and the S table according to the hash join result of the R table hash table in the dwell area and the sub S table in each of the plurality of subflow regions. Hash the result of the connection.
具体地,该协处理器可以根据S406-S411中所述的方法,获得该多个子S表中每个子S表对应的数据连接处理结果,可以进一步得到该R表与该S表的哈希连接结果。Specifically, the coprocessor can obtain the data connection processing result corresponding to each sub-S table in the plurality of sub-S tables according to the method described in S406-S411, and further obtain the hash connection of the R table and the S table. result.
S413,该协处理器通过该控制模块将该哈希连接结果发送至该主处理器。 S413. The coprocessor sends the hash connection result to the main processor through the control module.
本申请实施例的数据处理方法,通过主处理器和协处理器之间的控制模块完成主处理器和协处理器之间的数据传输以及数据处理,减轻了主处理器的工作负担,并且简化了原本将数据处理、数据传输以及内存管理集成于一体的系统代码。The data processing method of the embodiment of the present application completes data transmission and data processing between the main processor and the coprocessor through a control module between the main processor and the coprocessor, thereby reducing the workload of the main processor and simplifying System code that originally integrates data processing, data transfer, and memory management.
图5示出了本申请实施例的再一数据处理方法500的示意性流程图。该方法500可以应用于如图2所示的系统中,并且结合图8详细介绍了数据处理系统在对R表和S表进行数据连接处理时的另一方法流程。FIG. 5 is a schematic flowchart of still another data processing method 500 of the embodiment of the present application. The method 500 can be applied to the system as shown in FIG. 2, and another method flow of the data processing system in performing data connection processing on the R table and the S table is described in detail in conjunction with FIG. 8.
S501,控制模块接收主处理器发送的R表和S表,其中,该R表与该S表相关联,该S表的数据量大于该协处理器可用的内存大小,经过哈希运算的该R表的数据量也大于该协处理器可用的内存大小。S501. The control module receives an R table and an S table sent by the main processor, where the R table is associated with the S table, and the data amount of the S table is greater than a memory size available to the coprocessor, and the hash operation is performed. The amount of data in the R table is also greater than the amount of memory available to the coprocessor.
S502,该控制模块根据该R表的数据量、该S表的数据量、该协处理器可用的内存大小以及处理上下文,将该R表和该S表均标识为流转属性。S502. The control module identifies the R table and the S table as a flow attribute according to the data amount of the R table, the data amount of the S table, the available memory size of the coprocessor, and the processing context.
具体地,该控制模块可以将该R表一次性发送至该协处理器的驻留区,将该S表分批发送至该协处理器的流转区。Specifically, the control module may send the R table to the camping area of the coprocessor at one time, and send the S table to the streaming area of the coprocessor in batches.
可选地,在该S502之前,该控制模块可以根据该R表的数据量、该S表的数据量、该R表的驻留属性、该S表的流转属性以及该协处理器可用的内存大小,确定该协处理器中的驻留区域的内存大小以及流转区域的内存大小。Optionally, before the S502, the control module may: according to the data amount of the R table, the data amount of the S table, the resident attribute of the R table, the streaming attribute of the S table, and the available memory of the coprocessor Size, determines the memory size of the resident area in the coprocessor and the memory size of the flow area.
可选地,由于该R表和该S表均为流转属性,则该控制模块可以不在该协处理器中设置驻留区域,将该协处理器中可用的内存全部用来设置流转区域,以提高内存利用率。Optionally, since the R table and the S table are both flow attributes, the control module may not set a resident area in the coprocessor, and all available memory in the coprocessor is used to set a flow area, Improve memory utilization.
S503,该控制模块对该R表进行运算,得到R表哈希表。S503. The control module performs an operation on the R table to obtain an R table hash table.
S504,该控制模块将该R表哈希表和该S表划分为多个子R表哈希表和多个子S表,且该多个子R表哈希表中的每个子R表哈希表与该多个S表中的每个子S表一一对应。S504. The control module divides the R table hash table and the S table into a plurality of sub-R table hash tables and a plurality of sub-S tables, and each of the plurality of sub-R table hash tables has a hash table and a hash table. Each of the plurality of S tables has a one-to-one correspondence.
该多个子S表例如可以为图8中的S1表、S2表,该多个子R表哈希表例如可以为图8中的R1表哈希表、R2表哈希表。The plurality of sub-S tables may be, for example, an S1 table or an S2 table in FIG. 8, and the plurality of sub-R table hash tables may be, for example, an R1 table hash table or an R2 table hash table in FIG. 8.
S505,该控制模块将该多个子R表哈希表中第j个子R表哈希表与第j个子S表发送至协处理器的第i个子流转区域。S505. The control module sends the jth sub-R table hash table and the j-th sub-S table in the plurality of sub-R table hash tables to the i-th sub-streaming area of the coprocessor.
可选地,该主处理器可以包括第一缓存区和第二缓存区,该控制模块可以通过该第一缓存区和该第二缓存区将该多个子R表中每个子R表以及与该每个子R表对应的子S表发送至该协处理器的流转区域。Optionally, the main processor may include a first buffer area and a second buffer area, and the control module may use the first buffer area and the second buffer area to list each of the plurality of sub-R tables and the same The child S table corresponding to each child R table is sent to the flow area of the coprocessor.
S506,该协处理器对该第i个子流转区域中该第j个子R表哈希表与第j个子S表进行哈希连接处理。S506. The coprocessor performs hash connection processing on the jth sub-R table hash table and the j-th sub-S table in the i-th sub-streaming area.
S507,该协处理器将该第i个子流转区域标识为空闲。S507. The coprocessor identifies the i-th sub-streaming area as idle.
可选地,该协处理器可以包括连续的多个子流转区域,该协处理器可以依次读取该连续的多个子流转区域中每个子流转区域中的子R表以及与该子R表对应的子S表,并将每个子流转区域中的子S表与子R表进行处理。Optionally, the coprocessor may include a plurality of consecutive sub-flow regions, and the coprocessor may sequentially read the sub-R table in each of the consecutive plurality of sub-flow regions and corresponding to the sub-R table. The child S table, and the child S table and the child R table in each sub-flow region are processed.
S508,该控制模块将该多个子R表哈希表中第j+1个子R表哈希表与第j+1个子S表发送至协处理器的第i+1个子流转区域。S508. The control module sends the j+1th sub-R table hash table and the j+1th sub-S table in the plurality of sub-R table hash tables to the i+1th sub-streaming area of the coprocessor.
S509,该协处理器对该第i+1个子流转区域中该第j+1个子R表哈希表与第j+1个子S表进行哈希连接处理。S509. The coprocessor performs hash connection processing on the j+1th sub-R table hash table and the j+1th sub-S table in the i+1th sub-flow region.
S510,该协处理器将该第i+1个子流转区域表示为空闲。S510. The coprocessor represents the i+1th sub-streaming area as idle.
S511,该协处理器根据该多个子R表哈希表中每个子R表哈希表与该多个子S表中 每个子S表的哈希连接结果,确定该R表与该S表的哈希处理结果。S511. The coprocessor according to the plurality of sub-R table hash tables in each of the sub-R table hash tables and the plurality of sub-S tables The hash connection result of each sub-S table determines the hash processing result of the R table and the S table.
具体地,该协处理器可以根据S505-S510中所述的方法,获得该多个子S表中每个子S表对应的数据连接处理结果,可以进一步得到该R表与该S表的数据连接处理结果,并将该R表与S表的数据连接处理结果,传输至该主处理器。Specifically, the coprocessor can obtain the data connection processing result corresponding to each sub S table in the plurality of sub S tables according to the method described in S505-S510, and further obtain the data connection processing of the R table and the S table. As a result, the data connection processing result of the R table and the S table is transmitted to the main processor.
S512,该协处理器将该R表与该S表的哈希处理结果通过该控制模块发送至该主处理器。S512. The coprocessor sends the R table and the hash processing result of the S table to the main processor through the control module.
本申请实施例的数据处理方法,通过主处理器和协处理器之间的控制模块完成主处理器和协处理器之间的数据传输以及数据处理,减轻了主处理器的工作负担,并且简化了原本将集成数据处理、数据传输以及内存管理于一体的系统代码。The data processing method of the embodiment of the present application completes data transmission and data processing between the main processor and the coprocessor through a control module between the main processor and the coprocessor, thereby reducing the workload of the main processor and simplifying System code that would integrate data processing, data transfer, and memory management.
图6示出了本申请实施例的又一数据处理方法600的示意性流程图。该方法600可以应用于如图2所示的系统中,并且结合图9详细介绍了数据处理系统在事实表与该事实表的多个维度表中的进行哈希连接处理时的另一方法流程。FIG. 6 shows a schematic flowchart of still another data processing method 600 of the embodiment of the present application. The method 600 can be applied to the system as shown in FIG. 2, and the method flow of the data processing system in the hash connection processing in the fact table and the plurality of dimension tables of the fact table is described in detail in conjunction with FIG. .
应理解,事实表用于存储至少一个事实记录,每个事实记录对应事实表中的一行,并且包括键值列和度量值列,其中,键值列中的值对应事实记录的维度,例如,商品产地、商品价格、商品数量、交易日期、商品种类、商品名称,等等;度量值列中的值对应于事实表的主题内容,例如,销售额或销售量,等等。It should be understood that the fact table is used to store at least one fact record, each fact record corresponds to a row in the fact table, and includes a key value column and a metric value column, wherein the value in the key value column corresponds to the dimension of the fact record, for example, Commodity origin, commodity price, merchandise quantity, transaction date, merchandise category, merchandise name, etc.; the value in the metric column corresponds to the subject matter of the fact table, for example, sales or sales volume, and so on.
还应理解,维度表用于存储事实记录的维度特性,维度表可以包括名称列和属性列,例如,商品产地这个维度表中包括三个列,产地名称(locationName)、产地编号(locationId)和地址(Address),其中,产地名称为名称列,产地编号和地址为属性列。事实表中的键值列可以对应于维度表中的属性列,事实表中的每个键值列都可以对应于一个维度表。It should also be understood that the dimension table is used to store the dimensional characteristics of the fact record. The dimension table may include a name column and an attribute column. For example, the commodity origin includes three columns in the dimension table, a place name (locationName), a place number (locationId), and Address, where the origin name is the name column, and the origin number and address are attribute columns. The key-value column in the fact table can correspond to the attribute column in the dimension table, and each key-value column in the fact table can correspond to a dimension table.
主键,唯一标识表中的一列,一个表中任意两行具有不同的主键值,并且主键不允许有空值。一般地,表的主键为表的第一列。The primary key, which uniquely identifies a column in the table, any two rows in a table have different primary key values, and the primary key does not allow null values. In general, the primary key of a table is the first column of the table.
外键,用于连接两个表,如果表A中的列M与表B中的列N相对应,即列M与列N对应于相同的属性,例如,均对应于订单号,并且列M为表A中的主键,则列N为表B中的外键。事实表的外键对应于维度表的主键。Foreign key, used to join two tables, if the column M in the table A corresponds to the column N in the table B, that is, the column M and the column N correspond to the same attribute, for example, both correspond to the order number, and the column M For the primary key in Table A, column N is the foreign key in Table B. The foreign key of the fact table corresponds to the primary key of the dimension table.
S601,控制模块接收主处理器发送的事实表和多个维度表,其中,所述事实表与所述多个维度表中每个维度表相关联,该事实表的数据量大于该协处理器可用的内存大小,经过哈希运算的该多个维度表的数据总量小于该协处理器可用的内存大小。S601. The control module receives a fact table and a plurality of dimension tables sent by the main processor, where the fact table is associated with each dimension table of the plurality of dimension tables, and the data volume of the fact table is greater than the coprocessor. The amount of memory available, the total amount of data for the multiple dimension tables that have been hashed is less than the amount of memory available to the coprocessor.
可选地,该多个维度表例如可以为图9中的第一维度表、第二维度表。Optionally, the plurality of dimension tables may be, for example, the first dimension table and the second dimension table in FIG. 9 .
S602,该控制模块根据该多个维度表的数据量、该事实表的数据量、该协处理器可用的内存大小以及处理上下文,将该多个维度表标识为驻留属性,并将该事实表标识为流转属性。S602. The control module identifies the multiple dimension table as a resident attribute according to the data volume of the multiple dimension tables, the data volume of the fact table, the memory size available to the coprocessor, and the processing context, and the fact The table is identified as a flow attribute.
具体地,该控制模块可以将该多个维度表一次性发送至该协处理器的驻留区,将该事实表分批发送至该协处理器的流转区。Specifically, the control module may send the plurality of dimension tables to the resident area of the coprocessor in one time, and send the fact table in batches to the flow area of the coprocessor.
可选地,在该控制模块向该协处理器发送该多个维度表和该事实表之前,该控制模块可以根据连接过滤器对该多个维度表中的每个维度表以及该事实表进行过滤,过滤掉与本次哈希连接无关的记录,减少了需要传输的事实表和维度表的数据量,但本申请实施例对此不作限定。Optionally, before the control module sends the multiple dimension table and the fact table to the coprocessor, the control module may perform, according to the connection filter, each dimension table of the plurality of dimension tables and the fact table. Filtering, filtering out the records that are not related to the current hash connection, and reducing the amount of data of the fact table and the dimension table that need to be transmitted, but the embodiment of the present application does not limit this.
S603,该控制模块对该多个维度表中的每个维度表进行哈希处理,得到该多个维度表中每个维度表哈希表。 S603. The control module performs hash processing on each dimension table in the plurality of dimension tables to obtain each dimension table hash table in the plurality of dimension tables.
可选地,该多个维度表哈希表例如可以为图9中的第一维度表哈希表、第二维度表哈希表,且该第一维度表经过哈希处理后得到该第一维度表哈希表,该第二维度表经过哈希处理后得到该第二维度表哈希表。Optionally, the multiple dimension table hash table may be, for example, the first dimension table hash table and the second dimension table hash table in FIG. 9, and the first dimension table is hashed to obtain the first A dimension table hash table, the second dimension table is hashed to obtain the second dimension table hash table.
S604,该控制模块将该多个维度表哈希表传输至协处理器的驻留区域。S604. The control module transmits the plurality of dimension table hash tables to a resident area of the coprocessor.
可选地,该控制模块器可以将该多个维度表哈希表同时传输至该协处理器,或者可以将该多个维度表哈希表中每个维度表哈希表依次传输至该协处理器,本申请实施例对此不作限定。Optionally, the control module may simultaneously transmit the plurality of dimension table hash tables to the coprocessor, or may sequentially transmit each dimension table hash table in the plurality of dimension table hash tables to the association. The processor is not limited in this embodiment.
可选地,在该S604之前,该控制模块可以根据该多个维度表的数据量、该事实表的数据量、该多个维度表的驻留属性、该事实表的流转属性以及该协处理器可用的内存大小,确定该协处理器中的驻留区域的内存大小以及流转区域的内存大小。Optionally, before the S604, the control module may: according to the data volume of the multiple dimension tables, the data volume of the fact table, the resident attribute of the multiple dimension tables, the flow attribute of the fact table, and the co-processing The amount of memory available to the device determines the memory size of the resident area in the coprocessor and the memory size of the flow area.
可选地,该协处理器可以将该多个维度表哈希表存储在该协处理器的驻留存储区,或者可以根据该驻留存储区的内存大小以及该多个维度表哈希表的数据量,将该协处理器的驻留存储区划分为多个子驻留区域,并将该多个维度表哈希表分别存储至该多个子驻留区域,本申请实施例对此不作限定。Optionally, the coprocessor may store the multiple dimension table hash table in the resident storage area of the coprocessor, or may be based on the memory size of the resident storage area and the multiple dimension table hash table The amount of data is divided into a plurality of sub-resident areas, and the plurality of dimension table hash tables are respectively stored in the plurality of sub-resident areas, which is not limited in this embodiment of the present application. .
S605,该控制模块对该事实表进行压缩处理,得到事实压缩表。S605. The control module performs compression processing on the fact table to obtain a fact compression table.
可选地,如图9中所示,该事实表经过压缩处理后得到事实压缩表。Alternatively, as shown in FIG. 9, the fact table is subjected to compression processing to obtain a fact compression table.
可选地,该控制模块可以对经过连接过滤器过滤后的事实表进一步进行数据压缩处理,从而更进一步地减少该事实表的数据量。Optionally, the control module may further perform data compression processing on the fact table filtered by the connection filter, thereby further reducing the data amount of the fact table.
S606,该控制模块将该事实压缩表划分为多个子事实压缩表。S606. The control module divides the fact compression table into a plurality of sub-facts compression tables.
S607,该控制模块将该多个事实压缩表中的第j个子事实压缩表发送至该协处理器的第i个子流转区域。S607. The control module sends the jth sub-facts compression table in the plurality of fact compression tables to the i-th sub-streaming area of the coprocessor.
具体地,该主处理器包括第一缓存区和第二缓存区,该控制模块可以通过该第一缓存区和该第二缓存区将该多个子事实压缩表中每个子事实压缩表发送至该协处理器流转区域。Specifically, the main processor includes a first buffer area and a second buffer area, and the control module may send, by using the first buffer area and the second buffer area, each sub-facts compression table in the plurality of sub-facts compression tables to the Coprocessor flow area.
可选地,该控制模块可以根据该缓存区的内存大小,将该事实压缩表划分为多个子事实压缩表,本申请实施例对此不作限定。Optionally, the control module may divide the fact compression table into a plurality of sub-facts compression table according to the memory size of the buffer area, which is not limited in this embodiment of the present application.
S608,该协处理器对该第i个子流转区域中该第j个子事实压缩表与该多个维度表哈希表中每个维度表哈希表进行哈希连接处理,得到该第j个子事实压缩表对应的哈希连接结果。S608, the coprocessor hash-joins the j-th sub-fact compression table in the i-th sub-flow region and each dimension table hash table in the plurality of dimension table hash tables to obtain the j-th sub-fact The result of the hash join corresponding to the compressed table.
S609,该协处理器将该第i个子流转区域标识为空闲。S609. The coprocessor identifies the i-th sub-streaming area as idle.
可选地,该协处理器可以包括连续的多个子流转区域,该协处理器可以依次读取该连续的多个子流转区域中每个子流转区域中的子事实压缩表,并将该子事实压缩表与驻留区域中多个维度表哈希表中的每个维度表哈希表进行哈希连接处理。Optionally, the coprocessor may include a plurality of consecutive sub-flow regions, and the coprocessor may sequentially read the sub-fact compression table in each of the consecutive plurality of sub-flow regions, and compress the sub-facts The table is hashed with each dimension table hash table in multiple dimension table hash tables in the residency region.
S610,该控制模块将该多个事实压缩表中的第j+1个子事实压缩表发送至该协处理器的第i+1个子流转区域。S610. The control module sends the j+1th sub-facts compression table in the plurality of fact compression tables to the (i+1)th sub-streaming area of the coprocessor.
S611,该协处理器对该第i+1个子流转区域中该第j+1个子事实压缩表与该多个维度表哈希表中每个维度表哈希表进行哈希连接处理,得到该第j+1个子事实压缩表对应的哈希连接结果。S611, the coprocessor hash-joins the j+1th sub-fact compression table in the i+1th sub-flow region and each dimension table hash table in the plurality of dimension table hash tables, to obtain the The hash join result corresponding to the j+1th sub-fact compression table.
S612,该协处理器将该第i+1个子流转区域标识为空闲。S612. The coprocessor identifies the i+1th sub-streaming area as idle.
S613,该协处理器根据该多个子事实压缩表中每个子事实压缩表对应的哈希连接结 果,得到该多个维度表与该事实表的连接结果。S613. The coprocessor compresses the hash connection node corresponding to each sub-fact compression table in the plurality of sub-facts compression table. If the result of the connection between the plurality of dimension tables and the fact table is obtained.
具体地,该协处理器可以根据S607-S612中所述的方法,获得该多个子事实压缩表中每个子事实压缩表对应的数据连接处理结果,可以进一步得到该事实表与该多个维度表中每个维度表的数据连接处理结果,并将该事实表与该多个维度表中每个维度表的数据连接处理结果,传输至该主处理器。Specifically, the coprocessor can obtain the data connection processing result corresponding to each sub-facts compression table in the plurality of sub-facts compression tables according to the method described in S607-S612, and further obtain the fact table and the plurality of dimension tables. The data connection processing result of each dimension table in the medium is transmitted to the main processor by the result of the data connection processing of the fact table and each dimension table in the plurality of dimension tables.
S614,该协处理器将该事实表与该多个维度表中每个维度表的哈希连接结果通过该控制模块发送至该主处理器。S614. The coprocessor sends the fact table and the hash connection result of each dimension table in the plurality of dimension tables to the main processor through the control module.
本申请实施例的数据处理方法,通过主处理器和协处理器之间的控制模块完成主处理器和协处理器之间的数据传输以及数据处理,减轻了主处理器的工作负担,并且简化了原本将数据处理、数据传输以及内存管理集成于一体的系统代码。The data processing method of the embodiment of the present application completes data transmission and data processing between the main processor and the coprocessor through a control module between the main processor and the coprocessor, thereby reducing the workload of the main processor and simplifying System code that originally integrates data processing, data transfer, and memory management.
在实现过程中,上述方法的各步骤可以通过处理器中的硬件的集成逻辑电路或者软件形式的指令完成。结合本申请实施例所公开的方法的步骤可以直接体现为硬件处理器执行完成,或者用处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器,处理器执行存储器中的指令,结合其硬件完成上述方法的步骤。为避免重复,这里不再详细描述。In the implementation process, each step of the above method may be completed by an integrated logic circuit of hardware in a processor or an instruction in a form of software. The steps of the method disclosed in the embodiments of the present application may be directly implemented as a hardware processor, or may be performed by a combination of hardware and software modules in the processor. The software module can be located in a conventional storage medium such as random access memory, flash memory, read only memory, programmable read only memory or electrically erasable programmable memory, registers, and the like. The storage medium is located in a memory, and the processor executes instructions in the memory, in combination with hardware to perform the steps of the above method. To avoid repetition, it will not be described in detail here.
本领域普通技术人员可以意识到,结合本文中所公开的实施例中描述的各方法步骤和单元,能够以电子硬件、计算机软件或者二者的结合来实现,为了清楚地说明硬件和软件的可互换性,在上述说明中已经按照功能一般性地描述了各实施例的步骤及组成。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。本领域普通技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those skilled in the art will appreciate that the various method steps and elements described in connection with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both, in order to clearly illustrate hardware and software. Interchangeability, the steps and composition of the various embodiments have been generally described in terms of function in the foregoing description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the solution. Different methods may be used to implement the described functionality for each particular application, but such implementation should not be considered to be beyond the scope of the application.
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。A person skilled in the art can clearly understand that, for the convenience and brevity of the description, the specific working process of the system, the device and the unit described above can refer to the corresponding process in the foregoing method embodiment, and details are not described herein again.
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另外,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口、装置或单元的间接耦合或通信连接,也可以是电的,机械的或其它的形式连接。In the several embodiments provided by the present application, it should be understood that the disclosed systems, devices, and methods may be implemented in other manners. For example, the device embodiments described above are merely illustrative. For example, the division of the unit is only a logical function division. In actual implementation, there may be another division manner, for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, or an electrical, mechanical or other form of connection.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本申请实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the embodiments of the present application.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以是两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分,或者该技术方案的全部或部分可以以软件产品的形 式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read-only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。The integrated unit, if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application is essential or the part contributing to the prior art, or all or part of the technical solution may be in the form of a software product. The computer software product is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all of the methods described in the various embodiments of the present application or Part of the steps. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like, which can store program code. .
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到各种等效的修改或替换,这些修改或替换都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以权利要求的保护范围为准。 The foregoing is only a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto, and any equivalents can be easily conceived by those skilled in the art within the technical scope disclosed in the present application. Modifications or substitutions are intended to be included within the scope of the present application. Therefore, the scope of protection of this application should be determined by the scope of protection of the claims.

Claims (22)

  1. 一种数据处理系统,其特征在于,包括主处理器、协处理器和控制模块;A data processing system, comprising: a main processor, a coprocessor, and a control module;
    所述主处理器用于将待处理数据发送至所述控制模块;The main processor is configured to send data to be processed to the control module;
    所述控制模块用于接收所述主处理器发送的所述待处理数据,并将所述待处理数据发送至所述协处理器;The control module is configured to receive the to-be-processed data sent by the main processor, and send the to-be-processed data to the coprocessor;
    所述协处理器用于接收所述控制模块发送的所述待处理数据,对所述待处理数据进行处理,得到所述待处理数据的处理结果,并将所述待处理数据的处理结果通过所述控制模块发送至所述主处理器;The coprocessor is configured to receive the to-be-processed data sent by the control module, process the to-be-processed data, obtain a processing result of the to-be-processed data, and pass the processing result of the to-be-processed data The control module sends to the main processor;
    所述主处理器还用于接收所述协处理器通过所述控制模块发送的所述待处理数据的处理结果。The main processor is further configured to receive a processing result of the to-be-processed data sent by the coprocessor through the control module.
  2. 根据权利要求1所述的数据处理系统,其特征在于,所述控制模块用于将所述待处理数据一次性发送至所述协处理器,或者将所述待处理数据分批发送至所述协处理器;The data processing system according to claim 1, wherein the control module is configured to send the to-be-processed data to the coprocessor at one time, or send the to-be-processed data in batches to the Coprocessor
    所述控制模块还用于在将所述待处理数据发送至所述协处理器时携带所述待处理数据的存储属性,所述存储属性包括驻留属性或流转属性,所述驻留属性表示所述待处理数据能够被多次访问,所述流转属性表示所述待处理数据仅能够被访问一次。The control module is further configured to: when the to-be-processed data is sent to the coprocessor, carry a storage attribute of the to-be-processed data, where the storage attribute includes a resident attribute or a flow attribute, where the resident attribute represents The to-be-processed data can be accessed multiple times, and the streaming attribute indicates that the to-be-processed data can only be accessed once.
  3. 根据权利要求2所述的数据处理系统,其特征在于,所述控制模块具体用于:The data processing system according to claim 2, wherein the control module is specifically configured to:
    在将所述待处理数据发送至所述协处理器之前,根据所述待处理数据的处理上下文、所述待处理数据的数据量和所述协处理器可用的内存大小,确定所述待处理数据的存储属性。Determining the to-be-processed according to a processing context of the to-be-processed data, an amount of data of the to-be-processed data, and a memory size available to the coprocessor before transmitting the to-be-processed data to the coprocessor The storage properties of the data.
  4. 根据权利要求2或3所述的数据处理系统,其特征在于,所述控制模块还用于:The data processing system according to claim 2 or 3, wherein the control module is further configured to:
    在将所述待处理数据发送至所述协处理器之前,根据所述待处理数据的数据量、所述待处理数据的存储属性和所述协处理器可用的内存大小,确定所述协处理器的内存中的驻留区域的内存大小和流转区域的内存大小,其中,所述驻留区域中存储的数据能够被多次访问,所述流转区域中的数据仅能够被访问一次,并且在被访问后删除或覆盖。Determining the co-processing according to the data amount of the to-be-processed data, the storage attribute of the to-be-processed data, and the available memory size of the coprocessor before transmitting the to-be-processed data to the coprocessor The memory size of the resident area in the memory of the device and the memory size of the streaming area, wherein the data stored in the resident area can be accessed multiple times, the data in the streaming area can only be accessed once, and Deleted or overwritten after being accessed.
  5. 根据权利要求4所述的数据处理系统,其特征在于,所述协处理器的流转区域包括连续的多个子流转区域;The data processing system according to claim 4, wherein the flow area of the coprocessor comprises a plurality of consecutive sub-flow areas;
    所述控制模块具体用于:The control module is specifically configured to:
    将所述待处理数据分批依次发送至所述连续的多个子流转区域中的每个子流转区域;And sending the to-be-processed data in batches to each of the consecutive plurality of sub-flow regions;
    所述协处理器具体用于:The coprocessor is specifically used to:
    依次读取所述连续的多个子流转区域中每个子流转区域中的数据,并对所述每个子流转区域中的数据进行处理,在对所述每个子流转区域中的数据处理完成后,将所述每个子流转区域标识为空闲;And sequentially reading data in each of the plurality of sub-flow regions, and processing data in each of the sub-flow regions, after processing the data in each of the sub-flow regions, Each of the sub-flow areas is identified as idle;
    在所述连续的多个子流转区域中最后一个子流转区域中的数据处理完成后,并且所述连续的多个子流转区域中第一个子流转区域标识为空闲时,则继续从所述连续的多个子流转区域中的第一个子流转区域开始读取数据。After the data processing in the last sub-streaming area of the consecutive plurality of sub-flow areas is completed, and the first sub-streaming area of the consecutive plurality of sub-flow areas is identified as idle, continuing from the continuous The first sub-streaming area of the plurality of sub-flow areas begins to read data.
  6. 根据权利要求2至5中任一项所述的数据处理系统,其特征在于,所述控制模块具体用于:The data processing system according to any one of claims 2 to 5, wherein the control module is specifically configured to:
    若所述待处理数据包括第一数据块和第二数据块,所述第一数据块的数据量小于所述协处理器可用的内存大小,并且所述第二数据块的数据量大于所述协处理器可用的内 存大小,If the to-be-processed data includes the first data block and the second data block, the data amount of the first data block is smaller than the memory size available to the coprocessor, and the data amount of the second data block is greater than the Coprocessor available Save size,
    确定所述第一数据块的存储属性为驻留属性,并将所述第一数据块发送至所述协处理器的驻留区域,Determining that a storage attribute of the first data block is a resident attribute, and transmitting the first data block to a resident area of the coprocessor
    确定所述第二数据块的存储属性为流转属性,并将所述第二数据块划分为多个第二子数据块分批依次发送至所述协处理器的流转区域。Determining, that the storage attribute of the second data block is a flow attribute, and dividing the second data block into a plurality of second sub-blocks sent to the flow area of the co-processor in batches.
  7. 根据权利要求6所述的数据处理系统,其特征在于,所述协处理器具体用于:The data processing system according to claim 6, wherein the coprocessor is specifically configured to:
    对所述驻留区域中的所述第一数据块和所述流转区域中的所述多个第二子数据块中的每个第二子数据块进行处理,得到所述第一数据块和所述每个第二子数据块的处理结果;Processing the first data block in the resident area and each of the plurality of second sub-data blocks in the flow area to obtain the first data block and a processing result of each of the second sub-blocks;
    根据所述第一数据块和所述多个第二子数据块中每个第二子数据块的处理结果,得到所述第一数据块和所述第二数据块的处理结果。And processing result of the first data block and the second data block according to a processing result of each of the first data block and each of the plurality of second sub data blocks.
  8. 根据权利要求2至7中任一项所述的数据处理系统,其特征在于,所述控制模块还用于:The data processing system according to any one of claims 2 to 7, wherein the control module is further configured to:
    若所述待处理数据包括第一数据块和第二数据块,所述第二数据块的数据量大于所述协处理器可用的内存大小,且经过哈希处理后的所述第一数据块的数据量大于所述协处理器可用的内存大小,If the to-be-processed data includes a first data block and a second data block, the data amount of the second data block is greater than a memory size available to the coprocessor, and the hashed first data block The amount of data is greater than the amount of memory available to the coprocessor.
    确定所述第一数据块的存储属性为流转属性,并将所述第一数据块划分为多个第一子数据块分批发送至所述协处理器的流转区域,Determining, that the storage attribute of the first data block is a flow attribute, and dividing the first data block into a plurality of first sub-blocks sent to the flow area of the coprocessor in batches,
    确定所述第二数据块的存储属性为流转属性,并将所述第二数据块划分为多个第二子数据块分批发送至所述协处理器的流转区域。Determining, that the storage attribute of the second data block is a flow attribute, and dividing the second data block into a plurality of second sub-blocks sent to the flow area of the coprocessor in batches.
  9. 根据权利要求8所述的数据处理系统,其特征在于,所述协处理器还用于:The data processing system of claim 8 wherein said coprocessor is further configured to:
    对所述流转区域中的所述多个第一子数据块中每个第一子数据块和所述多个第二子数据块中的每个第二子数据块进行处理,得到所述每个第一子数据块和所述每个第二子数据块的处理结果;Processing each of the first one of the plurality of first sub-blocks and the second of the plurality of second sub-blocks in the flow area to obtain each of the Processing results of the first sub-block and the each of the second sub-blocks;
    根据所述多个第一子数据块中每个第一子数据块和所述多个第二子数据块中每个第二子数据块的处理结果,得到所述第一数据块和所述第二数据块的处理结果。Obtaining the first data block and the first data block according to a processing result of each of the first one of the plurality of first sub-blocks and each of the plurality of second sub-blocks The processing result of the second data block.
  10. 根据权利要求2至9中任一项所述的数据处理系统,其特征在于,所述主处理器包括第一缓存区和第二缓存区;The data processing system according to any one of claims 2 to 9, wherein the main processor comprises a first buffer area and a second buffer area;
    所述控制模块具体用于:The control module is specifically configured to:
    将所述待处理数据存储至所述第一缓存区,直到所述第一缓存区存满后,将所述第一缓存区中的数据发送至所述协处理器;And storing the to-be-processed data in the first buffer area, and after the first buffer area is full, sending data in the first buffer area to the coprocessor;
    将剩余的待处理数据继续存储至第二缓存区,直到所述第二缓存区存满后,将所述第二缓存中的数据发送至所述协处理器。The remaining pending data is further stored to the second buffer area, and after the second buffer area is full, the data in the second cache is sent to the coprocessor.
  11. 根据权利要求10所述的数据处理系统,其特征在于,所述控制模块还用于在将所述第一缓存区中的数据发送至所述协处理器的同时,继续将所述待处理数据存储至所述第二缓存区,并在所述第二缓存区存满后,将所述第二缓存区中的数据发送至所述协处理器。The data processing system according to claim 10, wherein the control module is further configured to continue to send the data to be processed while transmitting data in the first buffer area to the coprocessor Storing to the second buffer area, and after the second buffer area is full, transmitting data in the second buffer area to the coprocessor.
  12. 一种数据处理方法,其特征在于,应用于数据处理系统,所述数据处理系统包括主处理器、协处理器和控制模块,所述数据处理方法包括:A data processing method, which is applied to a data processing system, the data processing system includes a main processor, a coprocessor, and a control module, and the data processing method includes:
    所述主处理器将待处理数据发送至所述控制模块; The main processor sends the to-be-processed data to the control module;
    所述控制模块接收所述主处理器发送的所述待处理数据,并将所述待处理数据发送至所述协处理器;The control module receives the to-be-processed data sent by the main processor, and sends the to-be-processed data to the coprocessor;
    所述协处理器接收所述控制模块发送的所述待处理数据,对所述待处理数据进行处理,得到所述待处理数据的处理结果,并将所述待处理数据的处理结果通过所述控制模块发送至所述主处理器;The coprocessor receives the to-be-processed data sent by the control module, processes the to-be-processed data, obtains a processing result of the to-be-processed data, and passes the processing result of the to-be-processed data through the Control module is sent to the main processor;
    所述主处理器接收所述协处理器通过所述控制模块发送的所述待处理数据的处理结果。The main processor receives a processing result of the to-be-processed data sent by the coprocessor through the control module.
  13. 根据权利要求12所述的数据处理方法,其特征在于,所述控制模块将所述待处理数据发送至所述协处理器,包括:The data processing method according to claim 12, wherein the control module sends the to-be-processed data to the coprocessor, including:
    将所述待处理数据一次性发送至所述协处理器,或者将所述待处理数据分批发送至所述协处理器,其中,Sending the to-be-processed data to the coprocessor at one time, or sending the to-be-processed data to the coprocessor in batches, where
    在将所述待处理数据发送至所述协处理器时携带所述待处理数据的存储属性,所述存储属性包括驻留属性或流转属性,所述驻留属性表示所述待处理数据能够被多次访问,所述流转属性表示所述待处理数据仅能够被访问一次。And storing, when the data to be processed is sent to the coprocessor, a storage attribute of the to-be-processed data, where the storage attribute includes a resident attribute or a flow attribute, where the resident attribute indicates that the to-be-processed data can be With multiple accesses, the flow attribute indicates that the pending data can only be accessed once.
  14. 根据权利要求13所述的数据处理方法,其特征在于,在所述控制模块将所述待处理数据发送至所述协处理器之前,所述方法还包括:The data processing method according to claim 13, wherein before the controlling module sends the to-be-processed data to the coprocessor, the method further includes:
    所述控制模块根据所述待处理数据的处理上下文、所述待处理数据的数据量和所述协处理器可用的内存大小,确定所述待处理数据的存储属性。The control module determines a storage attribute of the to-be-processed data according to a processing context of the to-be-processed data, an amount of data of the to-be-processed data, and a memory size available to the coprocessor.
  15. 根据权利要求13或14所述的数据处理方法,其特征在于,所述在将所述待处理数据发送至所述协处理器之前,所述方法还包括:The data processing method according to claim 13 or 14, wherein before the sending the to-be-processed data to the coprocessor, the method further comprises:
    所述控制模块根据所述待处理数据的数据量、所述待处理数据的存储属性和所述协处理器可用的内存大小,确定所述协处理器的内存中的驻留区域的内存大小和流转区域的内存大小,其中,所述驻留区域中存储的数据能够被多次访问,所述流转区域中的数据仅能够被访问一次,并且在被访问后删除或覆盖。Determining, by the control module, a memory size of a resident area in a memory of the coprocessor according to an amount of data of the to-be-processed data, a storage attribute of the to-be-processed data, and a memory size available to the coprocessor The memory size of the streaming area, wherein the data stored in the resident area can be accessed multiple times, the data in the streaming area can only be accessed once, and deleted or overwritten after being accessed.
  16. 根据权利要求15所述的数据处理方法,其特征在于,所述协处理器的流转区域包括连续的多个子流转区域;The data processing method according to claim 15, wherein the flow area of the coprocessor comprises a plurality of consecutive sub-flow areas;
    所述控制模块将所述待处理数据分批发送至所述协处理器,包括:The control module sends the to-be-processed data to the coprocessor in batches, including:
    所述控制模块将所述待处理数据分批依次发送至所述连续的多个子流转区域中的每个子流转区域;The control module sequentially sends the to-be-processed data in batches to each of the consecutive plurality of sub-flow regions;
    所述协处理器对所述待处理数据进行处理,得到所述待处理数据的处理结果,包括:Processing, by the coprocessor, the data to be processed, and obtaining the processing result of the data to be processed, including:
    所述协处理器依次读取所述连续的多个子流转区域中每个子流转区域中的数据,并对所述每个子流转区域中的数据进行处理,在对所述每个子流转区域中的数据处理完成后,将所述每个子流转区域标识为空闲;The coprocessor sequentially reads data in each of the plurality of sub-flow regions, and processes data in each of the sub-stream regions, and data in each of the sub-flow regions After the processing is completed, each of the sub-flow areas is identified as idle;
    所述协处理器在所述连续的多个子流转区域中最后一个子流转区域中的数据处理完成后,并且所述连续的多个子流转区域中第一个子流转区域标识为空闲时,继续从所述连续的多个子流转区域中的第一个子流转区域开始读取数据。After the data processing in the last sub-streaming area of the consecutive plurality of sub-flow areas is completed, and the first sub-streaming area of the consecutive plurality of sub-flow areas is identified as idle, the coprocessor continues to The first of the plurality of consecutive sub-flow regions begins to read data.
  17. 根据权利要求13至16中任一项所述的数据处理方法,其特征在于,所述控制模块将所述待处理数据发送至所述协处理器,包括:The data processing method according to any one of claims 13 to 16, wherein the control module sends the to-be-processed data to the coprocessor, including:
    若所述待处理数据包括第一数据块和第二数据块,所述第一数据块的数据量小于所述协处理器可用的内存大小,并且所述第二数据块的数据量大于所述协处理器可用的内 存大小,If the to-be-processed data includes the first data block and the second data block, the data amount of the first data block is smaller than the memory size available to the coprocessor, and the data amount of the second data block is greater than the Coprocessor available Save size,
    所述控制模块确定所述第一数据块的存储属性为驻留属性,并将所述第一数据块发送至所述协处理器的驻留区域,The control module determines that a storage attribute of the first data block is a resident attribute, and sends the first data block to a resident area of the coprocessor,
    所述控制模块确定所述第二数据块的存储属性为流转属性,并将所述第二数据块划分为多个第二子数据块分批依次发送至所述协处理器的流转区域。The control module determines that the storage attribute of the second data block is a flow attribute, and divides the second data block into a plurality of second sub-blocks that are sequentially sent to the flow area of the coprocessor in batches.
  18. 根据权利要求17所述的数据处理方法,其特征在于,所述协处理器对所述待处理数据进行处理,得到所述待处理数据的处理结果,包括:The data processing method according to claim 17, wherein the coprocessor processes the data to be processed to obtain a processing result of the data to be processed, including:
    所述协处理器对所述驻留区域中的所述第一数据块和所述流转区域中的所述多个第二子数据块中的每个第二子数据块进行处理,得到所述第一数据块和所述每个第二子数据块的处理结果;Processing, by the coprocessor, the first data block in the resident area and each of the plurality of second sub data blocks in the flow area to obtain the a processing result of the first data block and each of the second sub-blocks;
    所述协处理器根据所述第一数据块和所述多个第二子数据块中每个第二子数据块的处理结果,得到所述第一数据块和所述第二数据块的处理结果。Processing, by the coprocessor, processing of the first data block and the second data block according to processing results of each of the first data block and each of the plurality of second sub data blocks result.
  19. 根据权利要求13至18中任一项所述的数据处理方法,其特征在于,所述控制模块将所述待处理数据发送至所述协处理器,包括:The data processing method according to any one of claims 13 to 18, wherein the control module sends the to-be-processed data to the coprocessor, including:
    若所述待处理数据包括第一数据块和第二数据块,所述第二数据块的数据量大于所述协处理器可用的内存大小,且经过哈希处理后的所述第一数据块的数据量大于所述协处理器可用的内存大小,If the to-be-processed data includes a first data block and a second data block, the data amount of the second data block is greater than a memory size available to the coprocessor, and the hashed first data block The amount of data is greater than the amount of memory available to the coprocessor.
    所述控制模块确定所述第一数据块的存储属性为流转属性,并将所述第一数据块划分为多个第一子数据块分批发送至所述协处理器的流转区域,The control module determines that the storage attribute of the first data block is a flow attribute, and divides the first data block into a plurality of first sub-blocks that are sent in batches to a flow area of the coprocessor,
    所述控制模块确定所述第二数据块的存储属性为流转属性,并将所述第二数据块划分为多个第二子数据块分批发送至所述协处理器的流转区域。The control module determines that the storage attribute of the second data block is a flow attribute, and divides the second data block into a plurality of second sub-blocks that are sent in batches to a flow area of the coprocessor.
  20. 根据权利要求19所述的数据处理方法,其特征在于,所述协处理器对所述待处理数据进行处理,得到所述待处理数据的处理结果,包括:The data processing method according to claim 19, wherein the coprocessor processes the data to be processed to obtain a processing result of the data to be processed, including:
    所述协处理器对所述流转区域中的所述多个第一子数据块中每个第一子数据块和所述多个第二子数据块中的每个第二子数据块进行处理,得到所述每个第一子数据块和所述每个第二子数据块的处理结果;Processing, by the coprocessor, each of the plurality of first subblocks and the second of the plurality of second subblocks in the streaming region Obtaining a processing result of each of the first sub-blocks and each of the second sub-blocks;
    所述协处理器根据所述多个第一子数据块中每个第一子数据块和所述多个第二子数据块中每个第二子数据块的处理结果,得到所述第一数据块和所述第二数据块的处理结果。The coprocessor obtains the first according to a processing result of each of the first sub-blocks of the plurality of first sub-blocks and each of the second sub-blocks of the plurality of second sub-blocks The processing result of the data block and the second data block.
  21. 根据权利要求13至20中任一项所述的数据处理方法,其特征在于,所述主处理器包括第一缓存区和第二缓存区;The data processing method according to any one of claims 13 to 20, wherein the main processor comprises a first buffer area and a second buffer area;
    在所述控制模块将所述待处理数据发送至所述协处理器之前,所述方法还包括:Before the control module sends the to-be-processed data to the coprocessor, the method further includes:
    所述控制模块将所述待处理数据存储至所述第一缓存区,直到所述第一缓存区存满;The control module stores the to-be-processed data to the first buffer area until the first buffer area is full;
    所述控制模块在将所述第一缓存区存满之后,将剩余的待处理数据存储至所述第二缓存区,直到所述第二缓存区存满;After the control module saves the first buffer area, storing the remaining data to be processed to the second buffer area until the second buffer area is full;
    所述控制模块将所述待处理数据发送至所述协处理器,包括:The control module sends the to-be-processed data to the coprocessor, including:
    所述控制模块将所述第一缓存区中的数据发送至所述协处理器;The control module sends data in the first buffer area to the coprocessor;
    所述控制模块在将所述第一缓存中的数据发送至所述协处理器之后,将所述第二缓存区中的数据发送至所述协处理器。The control module sends data in the second buffer to the coprocessor after transmitting data in the first cache to the coprocessor.
  22. 根据权利要求21所述的数据处理方法,其特征在于,所述控制模块将所述待处 理数据发送至所述协处理器,包括:The data processing method according to claim 21, wherein said control module treats said to be in place The data is sent to the coprocessor, including:
    在将所述第一缓存区中的数据发送至所述协处理器的同时,所述控制模块继续将剩余的待处理数据存储至所述第二缓存区,并在所述第二缓存区存满后,将所述第二缓存区中的数据发送至所述协处理器。 While transmitting data in the first buffer to the coprocessor, the control module continues to store remaining data to be processed to the second buffer and saves in the second buffer After being full, the data in the second buffer area is sent to the coprocessor.
PCT/CN2017/079761 2016-06-01 2017-04-07 Data processing system and data processing method WO2017206591A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610387562.5A CN107451090B (en) 2016-06-01 2016-06-01 Data processing system and data processing method
CN201610387562.5 2016-06-01

Publications (1)

Publication Number Publication Date
WO2017206591A1 true WO2017206591A1 (en) 2017-12-07

Family

ID=60479711

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/079761 WO2017206591A1 (en) 2016-06-01 2017-04-07 Data processing system and data processing method

Country Status (2)

Country Link
CN (1) CN107451090B (en)
WO (1) WO2017206591A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111274193A (en) * 2018-12-05 2020-06-12 锐迪科(重庆)微电子科技有限公司 Data processing apparatus and method
CN111694839A (en) * 2020-04-28 2020-09-22 平安科技(深圳)有限公司 Time series index construction method and device based on big data and computer equipment

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112905542A (en) * 2019-12-03 2021-06-04 华为技术有限公司 File processing method, device, server, equipment and storage medium
CN111263339B (en) * 2020-01-14 2021-06-04 荣耀终端有限公司 Wireless communication method and device with wireless communication function
CN113535719A (en) * 2021-07-07 2021-10-22 锐掣(杭州)科技有限公司 Data filtering method, data filtering device, storage medium and product

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0740249A1 (en) * 1995-04-28 1996-10-30 Matsushita Electric Industrial Co., Ltd. Data processing device with coprocessor
CN103049421A (en) * 2012-12-11 2013-04-17 百度在线网络技术(北京)有限公司 Method and device for data transmission between central processing unit (CPU) and co-processors
CN103279391A (en) * 2013-06-09 2013-09-04 浪潮电子信息产业股份有限公司 Load balancing optimization method based on CPU (central processing unit) and MIC (many integrated core) framework processor cooperative computing
CN103309958A (en) * 2013-05-28 2013-09-18 中国人民大学 OLAP star connection query optimizing method under CPU and GPU mixing framework
CN104317754A (en) * 2014-10-15 2015-01-28 中国人民解放军国防科学技术大学 Strided data transmission optimization method for heterogeneous computing system

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050071578A1 (en) * 2003-09-25 2005-03-31 International Business Machines Corporation System and method for manipulating data with a plurality of processors
US7395410B2 (en) * 2004-07-06 2008-07-01 Matsushita Electric Industrial Co., Ltd. Processor system with an improved instruction decode control unit that controls data transfer between processor and coprocessor
CN102156684A (en) * 2010-12-15 2011-08-17 成都市华为赛门铁克科技有限公司 Interface delay protecting method, coprocessor and data processing system
CN103294554A (en) * 2012-03-05 2013-09-11 中兴通讯股份有限公司 SOC multiprocessor dispatching method and apparatus
CN102999385B (en) * 2012-11-06 2016-05-25 国网山东省电力公司枣庄供电公司 Multiprocessor cooperative processing method in computing equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0740249A1 (en) * 1995-04-28 1996-10-30 Matsushita Electric Industrial Co., Ltd. Data processing device with coprocessor
CN103049421A (en) * 2012-12-11 2013-04-17 百度在线网络技术(北京)有限公司 Method and device for data transmission between central processing unit (CPU) and co-processors
CN103309958A (en) * 2013-05-28 2013-09-18 中国人民大学 OLAP star connection query optimizing method under CPU and GPU mixing framework
CN103279391A (en) * 2013-06-09 2013-09-04 浪潮电子信息产业股份有限公司 Load balancing optimization method based on CPU (central processing unit) and MIC (many integrated core) framework processor cooperative computing
CN104317754A (en) * 2014-10-15 2015-01-28 中国人民解放军国防科学技术大学 Strided data transmission optimization method for heterogeneous computing system

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111274193A (en) * 2018-12-05 2020-06-12 锐迪科(重庆)微电子科技有限公司 Data processing apparatus and method
CN111694839A (en) * 2020-04-28 2020-09-22 平安科技(深圳)有限公司 Time series index construction method and device based on big data and computer equipment
CN111694839B (en) * 2020-04-28 2023-07-14 平安科技(深圳)有限公司 Time sequence index construction method and device based on big data and computer equipment

Also Published As

Publication number Publication date
CN107451090B (en) 2020-09-11
CN107451090A (en) 2017-12-08

Similar Documents

Publication Publication Date Title
WO2017206591A1 (en) Data processing system and data processing method
US11514045B2 (en) Structured cluster execution for data streams
AU2018361246B2 (en) Data protection via aggregation-based obfuscation
JP6559892B2 (en) Storage and retrieval of data cube data
CN110019292B (en) Data query method and device
US11620818B2 (en) Spatially sparse neural network accelerator for multi-dimension visual analytics
CN106649828B (en) Data query method and system
WO2017161540A1 (en) Data query method, data object storage method and data system
WO2021036449A1 (en) Dimension data processing method and apparatus, computer device, and storage medium
TW201415262A (en) Construction of inverted index system, data processing method and device based on Lucene
CN109791543B (en) Control method for executing multi-table connection operation and corresponding device
WO2020207084A1 (en) Payment complaint method, device, server, and readable storage medium
CN110968585B (en) Storage method, device, equipment and computer readable storage medium for alignment
TWI353535B (en)
CN107193494B (en) RDD (remote data description) persistence method based on SSD (solid State disk) and HDD (hard disk drive) hybrid storage system
CN110309174A (en) A kind of data query method, apparatus and server
WO2018120933A1 (en) Storage and query method and device of data base
CN115470156A (en) RDMA-based memory use method, system, electronic device and storage medium
CN108140022A (en) Data query method and Database Systems
EP3652660B1 (en) Systems and methods for joining datasets
KR102061069B1 (en) Texture cache memory system of non-blocking for texture mapping pipeline and operation method of the texture cache memory
JP6316503B2 (en) Computer system, accelerator, and database processing method
CN114860460B (en) Database acceleration method and device and computer equipment
US20160259703A1 (en) Retrieval control method, and retrieval control device
Jaspers Acceleration of read alignment with coherent attached FPGA coprocessors

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: 17805536

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17805536

Country of ref document: EP

Kind code of ref document: A1