Data processing methods, apparatus, computer equipment, storage media and products

By dividing the memory into multiple regions to process data access requests in parallel, the problem of processors not supporting discrete vector access is solved, thereby improving data access efficiency and processor performance.

CN117008969BActive Publication Date: 2026-11-17TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211017411.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-23
Publication Date
2026-11-17
Estimated Expiration
2042-08-23

AI Technical Summary

Technical Problem

Some processors do not support discrete vector access or cause low data access efficiency when processing continuous vector access, which affects processor performance.

Method used

The memory is divided into multiple storage regions, each corresponding to a request queue. Multiple data access requests are processed by executing multiple request queues in parallel, supporting discrete vector access and avoiding bank collisions.

Benefits of technology

It improves data access efficiency and processor performance, and enhances the processor's software flexibility and overall performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117008969B_ABST
    Figure CN117008969B_ABST
Patent Text Reader

Abstract

This application discloses a data processing method, apparatus, computer device, storage medium, and product. The method involves receiving a target data access request, which includes multiple access sub-requests, each containing an access address. Based on the addresses of multiple storage regions in the memory and the access addresses, the target storage region accessed by each access sub-request is determined. For each access sub-request, it is added to a request queue corresponding to the target storage region. This request queue stores pending access sub-requests for data access to the target storage region. The request queues corresponding to multiple storage regions are executed in parallel to obtain access data for each pending access sub-request. The target data corresponding to the target access request is then obtained based on the access data. This method allows for parallel processing of multiple data access requests, improving data access efficiency and processor performance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication technology, specifically to a data processing method, apparatus, computer equipment, storage medium, and product, wherein the storage medium is a computer-readable storage medium, and the product is a computer program product. Background Technology

[0002] With the development of processor-related technologies, some processors can not only handle scalar instructions but also vector instructions (also known as vector requests), i.e., vector processors. Some vector processors only support continuous (accessing addresses are continuous) vector access and do not support discrete (accessing addresses are discrete) vector access. Other vector processors support discrete vector access, but only support one vector instruction to access memory at a time. Before the vector instruction is processed, other instructions are back-pushed until the vector instruction is completed, resulting in low data access efficiency and affecting processor performance. Summary of the Invention

[0003] This application provides a data processing method, apparatus, computer device, storage medium, and product that can process multiple data access requests in parallel, thereby improving data access efficiency and processor performance.

[0004] This application provides a data processing method, including: Receive a target data access request, the target data access request containing multiple access sub-requests, the access sub-requests containing access addresses; Based on the addresses of multiple storage regions in the memory and the access address, the target storage region accessed by each access sub-request is determined; For each access sub-request, the access sub-request is added to the request queue corresponding to the target storage area. The request queue corresponding to the target storage area stores pending access sub-requests for data access to the target storage area. Execute request queues corresponding to multiple storage areas in parallel to obtain access data for each pending access sub-request; The target data corresponding to the target access request is obtained based on the access data.

[0005] Accordingly, this application also provides a data processing apparatus, including: A receiving unit is configured to receive a target data access request, wherein the target data access request includes multiple access sub-requests, and the access sub-requests include access addresses; A region determination unit is used to determine the target storage region to be accessed by each access sub-request based on the addresses of multiple storage regions in the memory and the access address; The addition unit is used to add each access sub-request to the request queue corresponding to the target storage area. The request queue corresponding to the target storage area stores pending access sub-requests for data access to the target storage area. The queue execution unit is used to execute request queues corresponding to multiple storage areas in parallel to obtain access data for each pending access sub-request. The data acquisition unit is used to obtain the target data corresponding to the target access request based on the access data.

[0006] In one embodiment, the queue execution unit includes: The acquisition sub-unit is used to periodically and in parallel acquire the access sub-requests to be processed from the request queues corresponding to multiple storage areas of the memory. The access subunit is used to perform data access operations on the storage location that matches the access address in the storage area corresponding to the request queue where the access sub-request is located, based on the access address of the access sub-request to be processed, so as to obtain the access data of each access sub-request to be processed.

[0007] In one embodiment, the access subunit includes: The first address determination module is used to determine the data reading location in the storage area corresponding to the access sub-request based on the access address of the access sub-request if the access sub-request to be processed is a data reading request. The reading module is used to obtain the access data corresponding to the access sub-request to be processed from the data reading location.

[0008] In one embodiment, the access subunit includes: The second address determination module is used to determine the data write address in the corresponding storage area based on the access address of the access sub-request to be processed if the access sub-request to be processed is a data write request. The writing module is used to store the data to be written carried by the access sub-request to be processed into the data writing address; The data generation module is used to generate the identification data for the pending access sub-request, the identification data being used to indicate that the data to be written carried by the pending access sub-request has been written.

[0009] In one embodiment, the data obtaining unit includes: The filtering subunit is used to filter the access data according to the data access request to which the access sub-request to be processed belongs, so as to obtain target access data corresponding to multiple data access requests. The target data obtaining subunit is used to obtain the target data corresponding to the target access request when the target access data contains access data corresponding to each access sub-request in the target data access request.

[0010] In one embodiment, the filtering subunit includes: The data filtering module is used to filter the access data according to the data access request to which the access sub-request to be processed belongs, and obtain candidate access data corresponding to multiple data access requests. The sorting module is used to sort the candidate access data based on the position of the candidate access data in the data access request according to the access sub-request corresponding to the candidate access data, so as to obtain the target access data.

[0011] In one embodiment, the data processing apparatus further includes: A partitioning unit is used to divide the memory into multiple storage regions according to a region partitioning strategy; The queue corresponding unit is used to determine the request queue corresponding to each storage area.

[0012] In one embodiment, the region determination unit includes: The masking subunit is used to mask the access sub-requests in the target data access request whose access address does not match the address of the storage area for each storage area in the memory, so as to obtain the masked data access request corresponding to each storage area. The access area determination subunit is used to determine the target storage area accessed by each access sub-request in the target access sub-request based on the masked data access request.

[0013] In one embodiment, the adding unit includes: The routing subunit is used to route the masked data access requests for each storage area to obtain the routed data access requests for each storage area. A queue addition sub-unit is used to add the access sub-requests in each of the routed data access requests to the request queue corresponding to the target storage area.

[0014] In one embodiment, the region determination unit includes: A location determination subunit is used to determine the location of each storage region in the memory; The classification subunit is used to classify the access addresses in the data access request according to the location, and to determine the target storage area accessed by each access sub-request.

[0015] Accordingly, this application also provides a computer device including a memory and a processor; the memory stores a computer program, and the processor is used to run the computer program in the memory to execute any of the data processing methods provided in this application.

[0016] Accordingly, embodiments of this application also provide a computer-readable storage medium for storing a computer program, which is loaded by a processor to execute any of the data processing methods provided in embodiments of this application.

[0017] Accordingly, this application also provides a computer program product, including a computer program, which, when executed by a processor, implements any of the data processing methods provided in this application.

[0018] This application embodiment receives a target data access request, which includes multiple access sub-requests, each containing an access address. Based on the addresses of multiple storage regions in the memory and the access addresses, the target storage region accessed by each access sub-request is determined. For each access sub-request, it is added to a request queue corresponding to the target storage region. This request queue stores pending access sub-requests for data access to the target storage region. The request queues corresponding to multiple storage regions are executed in parallel to obtain access data for each pending access sub-request. The target data corresponding to the target access request is then obtained based on the access data.

[0019] In this embodiment of the application, each storage area of ​​the memory corresponds to a request queue. The request queue is used to store at least one pending access sub-request for accessing the storage area in a data access request. Executing multiple request queues in parallel can realize the parallel processing of multiple data access requests, improve data access efficiency, and improve processor performance. Attached Figure Description

[0020] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0021] Figure 1 This is a scenario diagram of the data processing method provided in the embodiments of this application; Figure 2This is a flowchart of the data processing method provided in the embodiments of this application; Figure 3 This is a schematic diagram illustrating the address lookup of the data processing method provided in this application embodiment; Figure 4 This is a schematic diagram of the request queue for the data processing method provided in the embodiments of this application; Figure 5 This is a data access diagram of the data processing method provided in the embodiments of this application; Figure 6 This is a schematic diagram of the hardware acceleration engine structure provided in the embodiments of this application; Figure 7 This is another flowchart of the data processing method provided in the embodiments of this application; Figure 8 This is a schematic diagram illustrating the request routing effect of the data processing method provided in this application embodiment; Figure 9 This is a request routing diagram of the data processing method provided in the embodiments of this application; Figure 10 This is a schematic diagram of the data processing apparatus provided in an embodiment of this application; Figure 11 This is a schematic diagram of the structure of the computer device provided in the embodiments of this application. Detailed Implementation

[0022] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0023] This application provides a data processing method, apparatus, computer device, and computer-readable storage medium. The data processing apparatus can be integrated into a computer device, which may be a server or a terminal, etc.

[0024] The terminal may include mobile phones, wearable smart devices, tablets, laptops, personal computers (PCs), and in-vehicle computers, etc.

[0025] The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms.

[0026] For example, such as Figure 1 As shown, the computer device receives a target data access request, which contains multiple access sub-requests, each containing an access address. Based on the addresses of multiple storage regions in the memory and the access address, it determines the target storage region for each access sub-request. For each access sub-request, it adds it to the request queue corresponding to the target storage region. The request queue for the target storage region stores pending access sub-requests for data access to the target storage region. The request queues corresponding to multiple storage regions are executed in parallel to obtain the access data for each pending access sub-request. Finally, the target data corresponding to the target access request is obtained based on the access data.

[0027] In this embodiment of the application, each storage area of ​​the memory corresponds to a request queue. The request queue is used to store at least one pending access sub-request for accessing the storage area in a data access request. Executing multiple request queues in parallel can realize the parallel processing of multiple data access requests, improve data access efficiency, and improve processor performance.

[0028] The following sections provide detailed descriptions of each example. It should be noted that the order in which the embodiments are described is not intended to limit the preferred order of the embodiments.

[0029] This embodiment will be described from the perspective of a data processing device, which can be integrated into a computer device, such as a server or a terminal.

[0030] This application provides a data processing method, such as... Figure 2 As shown, the specific flow of this data processing method can be as follows: 101. Receive the target data access request. The target data access request contains multiple access sub-requests, and the access sub-requests contain the access address.

[0031] The target data access request can be a vector instruction used to access memory. The target data access request can contain the access addresses of multiple access sub-requests, and the access address is the address in memory that the corresponding access sub-request wants to access.

[0032] The address to be accessed can be specified by a vector and a scalar in the target data access request. The scalar is the base address, and the vector represents the address offset. Adding the address offset to the base address yields the access address. For example, ... Figure 3 As shown.

[0033] Since the data access operation and access address of each access sub-request can be determined based on the target data access request, it can be assumed that the target data access request contains multiple access sub-requests, and the data access operation can include read operation (Load) and write operation (Store), etc.

[0034] Before receiving a data access request, the memory can be divided into multiple banks and corresponding request queues can be determined. That is, in one embodiment, before the step of "receiving the target data access request", the data processing method provided in this application embodiment may further include: Based on the region partitioning strategy, the memory is divided into multiple memory regions; For each storage region, determine the request queue corresponding to that storage region.

[0035] One possible strategy for dividing the memory into multiple memory regions is to divide the memory into multiple memory regions based on the data bus width, where the data bus width refers to the width of data transmission within the chip.

[0036] For each storage region, a request queue corresponding to the storage region is determined, and access sub-requests to access the storage region are obtained from the request queue.

[0037] 102. Based on the addresses and access addresses of multiple memory regions in the memory, determine the target memory region to be accessed by each access sub-request.

[0038] The storage area can also be called a storage slot or a memory bank. Each storage area has a corresponding request queue, which is a queue for storing requests. A queue is a special type of linear list that uses a first-in, first-out (FIFO) strategy to abstract data structure. It only allows deletion operations at the front of the table and insertion operations at the rear.

[0039] The request queue corresponding to a storage area can store target access sub-requests for accessing that storage area. Based on the access address of the access sub-request and the address of the storage area, the target storage area accessed by the access sub-request can be determined, and the access sub-request can be added to the request queue corresponding to the target storage area.

[0040] For example, the memory can be divided into multiple memory regions, and then the target memory region accessed by each access sub-request can be determined based on the address of the memory region in the memory and the address in the target data access request.

[0041] The addresses of multiple storage regions can be used as categories for classification. Based on the access addresses of the sub-requests, the access sub-requests are classified to obtain the access sub-request corresponding to each storage region. Specifically, in one embodiment, the step "determining the target storage region accessed by each access sub-request based on the addresses and access addresses of multiple storage regions in the memory" may include: Determine the location of each storage region in memory; The access addresses in the data access requests are categorized based on location, and the target storage area accessed by each access sub-request is determined.

[0042] For example, by using the location of each storage region in memory as a classification category, and classifying the access sub-requests based on their access addresses, we can obtain the access sub-requests under each storage region category, thus determining the target storage region accessed by each access sub-request.

[0043] The memory is divided into multiple storage regions, the number of which is the same as the number of request queues. When there are many storage regions, after receiving a data access request, the access sub-requests need to be added to the corresponding request queues. Therefore, the unit used to determine the request queue corresponding to the access sub-request in the data access request (hereinafter referred to as the first unit) needs to be connected to many request queues. The first unit needs to send different data to different queues. In hardware design, wiring is difficult. Therefore, each request queue can be processed separately, filtering out access requests that do not belong to that request queue, thus obtaining only the data access request corresponding to the access sub-request of that request queue. In one embodiment, the step "determine the target storage region accessed by each access sub-request based on the addresses and access addresses of multiple storage regions in the memory" can specifically include: For each storage region in the memory, the access sub-requests in the target data access request whose access address does not match the address of the storage region are masked to obtain the masked data access request corresponding to each storage region. Based on the data access requests after masking, determine the target storage area accessed by each access sub-request in the target access sub-request.

[0044] For example, for each storage region, access sub-requests in the target data access request whose access address does not match the address of the storage region are blocked, resulting in the blocked data access request for each storage region. The blocked data access request only includes the access sub-request to access the storage region, and other access sub-requests are blocked. Blocking other access sub-requests can be done by deleting the access address and keeping only the access address to access the storage region.

[0045] The target access region of the access sub-requests contained in the masked data access request corresponding to each storage region is that storage region.

[0046] Optionally, each storage area corresponds to a masking unit. The target access request is input into each masking unit. The masking unit masks the access addresses in the target data access request that do not match the storage area, resulting in a masked data access request that only contains the access address to access the storage area. Based on the masked data access request, the access sub-request is added to the corresponding request queue.

[0047] After masking the target data access request, the access sub-requests in the masked data access request can be routed to the header of the vector, that is, the access address can be routed to the header of the vector so that the target access sub-request can be added to the request queue. In one embodiment, the step "for each access sub-request, add the access sub-request to the request queue corresponding to the target storage area" can specifically include: The data access requests after being masked for each storage area are routed to obtain the routed data access requests for each storage area. Add the access sub-requests in each routed data access request to the request queue corresponding to the target storage area.

[0048] For example, specifically, the access address in the masked data access request corresponding to each storage area can be moved to the vector header to obtain the routed data access request corresponding to each storage area. The target storage area accessed by the access sub-request in the routed data access request is the storage area. The access sub-request in the routed data access request is added to the request queue corresponding to the storage area.

[0049] 103. For each access sub-request, add the access sub-request to the request queue corresponding to the target storage area. The request queue corresponding to the target storage area stores the pending access sub-requests for data access to the target storage area.

[0050] For example, for each access sub-request, it is added to the request queue corresponding to the target storage area it accesses. The request queue may store at least one access sub-request for accessing the target storage area, including the access sub-request.

[0051] like Figure 4 As shown, assuming the request queues are all empty, data access request 'a' is a historical data access request received before the target data access request is received. The access sub-requests in data access request 'a' are stored in their corresponding target storage areas, resulting in... Figure 4The request queue shown is illustrated, where r0-dn are the access sub-requests of data access request a, and n is an integer greater than or equal to 0. After data access request a, data access request b (i.e., the target data access request) is received. The access sub-requests in data access request b are stored in their corresponding target storage areas, resulting in... Figure 4 The request queue shown is where r1-dn is the access sub-request of data access request b, and n is an integer greater than or equal to 0.

[0052] 104. Execute the request queues corresponding to multiple storage areas in parallel to obtain the access data of each pending access sub-request.

[0053] Among them, the pending access sub-requests can be access sub-requests stored in the request queue that are waiting to be processed.

[0054] In parallel, access sub-requests to be processed are obtained from the request queues corresponding to multiple storage areas, and the obtained access sub-requests to be processed are processed to obtain the access data of each access sub-request.

[0055] It is understood that the request queue adopts a first-in, first-out (FIFO) strategy. After a pending access sub-request is processed, the next pending access sub-request at the head of the request queue is retrieved and processed. After processing, the queue continues to retrieve the next pending access sub-request at the head for processing. When the pending access sub-request retrieved from the request queue is an access sub-request for a target data access request, the data corresponding to the target access request can be obtained. Optionally, pending access sub-requests can be retrieved from the request queue periodically. In one embodiment, the step "parallel execution of request queues corresponding to multiple storage areas to obtain access data for each pending access sub-request" can specifically include: Periodically and in parallel, retrieve pending access sub-requests from the request queues corresponding to multiple storage areas of the memory. Based on the access address of the sub-request to be processed, perform data access operation on the storage location that matches the access address in the storage area corresponding to the request queue where the sub-request to be processed is located, and obtain the access data of each sub-request to be processed.

[0056] For example, specifically, it could be obtained in clock cycle 1. Figure 4 In each request queue shown, the currently pending access sub-request at the head is processed. Data access operations are performed in the storage area corresponding to that request queue, at the storage location corresponding to the access address of that pending access sub-request, resulting in the following: Figure 5The access data corresponding to the pending access sub-request obtained in clock cycle 1 is obtained in clock cycle 2. The pending access sub-request currently located at the head of the request queue is obtained from the request queue, and the access data corresponding to clock cycle 2 is obtained. This process is repeated to obtain the access data corresponding to clock cycle 3.

[0057] The access operation of the pending access sub-request can be a read operation or a write operation. That is, the pending access sub-request can be a data read request or a data write request. If the pending access sub-request is a data read request, then the data in the corresponding storage location is read. The accessed data is the read data. That is, in one embodiment, the accessed data includes read data. The step "According to the access address of the pending access sub-request, perform a data access operation in the storage location that matches the access address in the storage area corresponding to the message queue where the pending access sub-request is located" can specifically include: If the pending access sub-request is a data read request, then determine the data read location in the storage area corresponding to the pending access sub-request according to the access address of the pending access sub-request. Retrieve the access data corresponding to the pending access sub-request from the data reading location.

[0058] The data read location can be a storage unit in the storage area, and the access address is the address of that storage unit.

[0059] For example, if the access sub-request to be processed is a data read request, then in the storage area corresponding to the request queue where the access sub-request to be processed is located, query the data read position indicated by the access address of the access sub-request to be processed, and read the data at that data read position to obtain the access data.

[0060] If the access request to be processed is a data write request, then the data to be written in the data write request needs to be written to the location indicated by the access address. In one embodiment, the access data includes identification data. The step "to perform data access at the storage location matching the access address in the storage area corresponding to the message queue where the access sub-request to be processed is located, based on the access address of the access sub-request to be processed" includes: If the access sub-request to be processed is a data write request, then the data write address is determined in the corresponding storage area based on the access address of the access sub-request to be processed. Store the data to be written carried by the pending access sub-request to the data write location; For each pending access sub-request, an identifier is generated. The identifier is used to indicate that the data to be written carried by the pending access sub-request has been written.

[0061] The data write location can be a storage unit in the storage area, and the access address is the address of that storage unit.

[0062] For example, if the access sub-request to be processed is a data write request, then in the storage area corresponding to the request queue where the access sub-request to be processed is located, the data write position indicated by the access address of the access sub-request to be processed is queried, and the data to be written carried by the access request to be processed is carried in the data write position. After the write is successful, the identifier data indicating that the data write is successful is obtained.

[0063] 105. Obtain the target data corresponding to the target access request based on the access data.

[0064] For example, since the request queue stores the access sub-requests of the target access request, the access data obtained in step 104 contains the access data of each access sub-request of the target access request. Therefore, the target data corresponding to the target access request can be obtained based on the access data.

[0065] like Figure 4 As shown, each time an access sub-request is obtained from multiple request queues, the access sub-request may belong to different target access requests. The access data can be filtered to obtain access data for different data access requests. That is, in one embodiment, the step "obtain the target data corresponding to the target access request based on the access data" may specifically include: Based on the data access request to which the pending access sub-request belongs, the access data is filtered to obtain the target access data corresponding to multiple data access requests; When the target access data contains the access data corresponding to each access sub-request in the target data access request, the target data corresponding to the target access request is obtained.

[0066] For example, it can be that the access data is filtered according to the data access requests of the access sub-requests to be processed, and the access requests corresponding to multiple data access requests are obtained. When the target access data of the target data access request contains the access data corresponding to each access sub-request of the target data access request, it means that the target access request has been processed and the target data of the target access request is obtained.

[0067] Optionally, since the data in the target data access request vector has a certain arrangement order, that is, the access sub-requests have a certain arrangement order in the target data access request, after obtaining the access data, the access data can be sorted so that the order of the access data corresponds to the order of the access sub-requests. That is, in one embodiment, the step "filtering the access data according to the data access request to which the access sub-request to be processed belongs, and obtaining the target access data corresponding to multiple data access requests" can specifically be: Based on the data access request to which the pending access sub-request belongs, the access data is filtered to obtain candidate access data corresponding to multiple data access requests; Based on the position of the candidate access data in the data access request, the candidate access data is sorted to obtain the target access data.

[0068] For example, based on the data access request to which the pending access sub-request belongs, the access data is filtered to obtain candidate access data corresponding to multiple data access requests. Then, based on the position of the access sub-request within the data access requests, the candidate access data is sorted to obtain, as shown below. Figure 5 The target access data is shown.

[0069] As can be seen from the above, the embodiments of this application receive a target data access request, which includes multiple access sub-requests, each containing an access address; determine the target storage area to be accessed by each access sub-request based on the addresses of multiple storage areas in the memory and the access address; for each access sub-request, add the access sub-request to the request queue corresponding to the target storage area, the request queue corresponding to the target storage area stores pending access sub-requests for data access to the target storage area; execute the request queues corresponding to multiple storage areas in parallel to obtain the access data of each pending access sub-request; and obtain the target data corresponding to the target access request based on the access data.

[0070] In this embodiment of the application, each storage area of ​​the memory corresponds to a request queue. The request queue is used to store at least one pending access sub-request for accessing the storage area in a data access request. Executing multiple request queues in parallel can realize the parallel processing of multiple data access requests, improve data access efficiency, and improve processor performance.

[0071] Based on the above embodiments, the following examples will provide further detailed explanations.

[0072] This embodiment will use a data processing device as the hardware acceleration engine and divide the memory into 8 storage regions as an example to describe it from the perspective of the hardware acceleration engine. Figure 6 The diagram shows the overall structure of the hardware acceleration engine. The hardware acceleration engine may include a receiving unit, a region determination unit, an adding unit, a queue execution unit, and a data acquisition unit. The adding unit may include a routing subunit and a queue adding subunit, and the data acquisition unit may include a data filtering subunit and a target data acquisition subunit. A hardware acceleration engine, also known as a hardware accelerator, is a device that uses a dedicated acceleration chip or module to replace the CPU in performing complex and time-consuming computational operations. The process requires little or no CPU involvement, thereby improving processor performance.

[0073] This application provides a data processing method, such as... Figure 7As shown, the specific flow of this data processing method can be as follows: 201. The receiving unit receives the data access request and inputs the data access request into the area determination unit.

[0074] For example, the receiving unit inputs a data access request into an 8-channel area determination unit, which is... Figure 6 The bankn mark shown corresponds to the storage area bankn, where 0 ≤ n ≤ 8. Data access requests can include data read operations and data write operations, such as gather and scatter operations. The operation of reading data from memory into the cache is typically called a gather operation, i.e., data aggregation; the operation of writing data from the cache into memory is typically called a scatter operation, i.e., data dispersion. A typical gather / scatter operation diagram is shown below. Figure 3 As shown, the offsets of the discrete addresses to be accessed are specified by a vector, and the base addresses of these discrete addresses are specified by a scalar. By adding these vectors and scalars respectively, the final gather / scatter addresses to be accessed can be obtained.

[0075] These addresses are completely discrete and irregular, and there is a high probability of bank conflicts between different addresses, meaning that different access sub-requests access the same bank.

[0076] For the gather operation, after all data accesses for a data access request are completed, they are aggregated into a vector, which is returned as the final data result of gather; for the scatter operation, all data is written discretely to the corresponding addresses.

[0077] Data access requests are vector instructions. In modern DSP / AI processors, vector processing capability is a key performance indicator. DSP / AI processors have high parallelism in their vector processing units, which can meet the computing power requirements of different application scenarios. In these application scenarios, there are also high requirements for the flexibility of vector load / store, which needs to support not only continuous vector access but also discrete vector access.

[0078] Some existing DSP / AI processors only support continuous vector access and not discrete vector access; some processors support discrete vector access, but the hardware cannot resolve bank conflict issues, so software programmers must ensure that discrete access is free of bank conflicts; some processors have low throughput for gather / scatter access to memory, and at most only one request can be accessed simultaneously, and subsequent instructions will be backpressured before the current instruction is processed.

[0079] For processors that do not support discrete access, their software flexibility is low, and they can only concatenate a single discrete access instruction using multiple sequential access instructions. For processors that cannot resolve bank conflicts in hardware, software engineers need to arrange the addresses of memory accesses according to the hardware bank partitioning to ensure that there are no bank conflicts within each access, which greatly reduces software flexibility. After retrieving data from memory, a rearrangement process is also required, which significantly impacts processor performance. For processors that can only support one request at a time, if there are severe bank conflicts within the current discrete access, subsequent instructions will be backpressured for a long time, reducing processor performance.

[0080] This application provides a high-concurrency gather / scatter hardware engine that divides memory into multiple banks. When a gather / scatter access address falls into a different bank, its corresponding access sub-request is added to the request queue of the corresponding bank. The access sub-request is then retrieved from the request queue, avoiding bank conflicts and supporting parallel access of multiple data access requests. Sub-requests can be executed while the access sub-request of the current data access request is still in the request queue, significantly improving overall performance and enhancing processor performance. Moreover, the hardware handles bank conflicts within each data access request, as well as bank conflicts between different requests. The accessed data is then organized through a reorder buffer, without requiring any restrictions on the software, thus improving the software's flexibility.

[0081] The high-concurrency gather / scatter hardware engine proposed in this invention improves the concurrency of memory access and consumes less chip area, effectively enhancing the processor's competitiveness.

[0082] 202. The region determination unit masks the access addresses in the data access requests that do not match the storage region based on the address of the storage region, and obtains the masked data access requests.

[0083] For example, for bank0 mark, the data access request is masked except for the access address for bank0, while the access address for bank0 is retained, resulting in the masked data access request for bank0. The same applies to other area determination units.

[0084] The 8-way region determination unit can execute the above process in parallel to obtain the masked data access request corresponding to each storage region.

[0085] 203. The routing subunit in the added unit routes the access address in the masked data access request to obtain the routed data access request.

[0086] For example, the access address of the data access request after the masking is obtained is as follows: Figure 6 As shown, Figure 8 As shown, the routing sub-unit in the added unit routes the access address to the vector header so that it can be added to the request queue.

[0087] Optionally, the routing subunit can use a data exchange network to route the access address in the masked data access request to the vector header. The data exchange network can include Anyan network, Crossbar network, inverse-butterfly network, and Benes network, etc.

[0088] Taking the inverse butterfly network as an example, the inverse-butterfly network with 8 data sources includes 3 levels of routing nodes. The first level of routing nodes completes the exchange between two adjacent data, the second level of routing nodes completes the exchange between four adjacent data, and the third level of routing nodes completes the exchange between all 8 data. Through these three levels of routing nodes, the discrete access addresses can be compressed into the vector header. Figure 9 In the example, the four access addresses b, d, h, and g do not belong to the current bank and need to be blocked, while the four access addresses a, c, e, and f belong to the current bank. After passing through the inverse-butterfly network, the four access addresses a, c, e, and f are routed to the vector header, making it easier to write them into the request queue later.

[0089] 204. Adding a sub-unit to the queue in the added unit adds the access sub-requests in the data access request after routing to the request queue.

[0090] For example, adding sub-units to a queue (i.e.) Figure 8The shift unit in the request queue shifts the output of the inverse-butterfly network according to the position of the tail pointer of the request queue, and then writes it into the request queue in parallel. For example, if the current depth of the request queue is 8, the current tail pointer of the request queue is 3, and the output of the inverse-butterfly network is four requests a, c, e and f, then the shift unit needs to shift request a to the position of the tail pointer and then write it into the request queue.

[0091] Optionally, a corresponding access sub-request can be generated based on the data access operation type and access address of the data access request. If the access sub-request is a read operation, the generated access sub-request contains a read operation identifier and an access address corresponding to the read operation. The read operation identifier and access address are stored in the request queue. When the read operation identifier is retrieved from the request queue, the read operation can be determined, and then the access address is read to retrieve the data at the position indicated by the access address. If the access sub-request is a write operation, the generated access sub-request contains a write operation identifier, an access address, and the data to be written. The write operation identifier, access address, and data to be written are written to the message queue. When the write operation identifier is retrieved, it can be determined that a write operation will be executed. The access address and the data to be written are retrieved, and the data to be written is written at the position indicated by the access address. Figure 4 The request queue shown is a schematic diagram of access request storage. Here, r0-d1 represents an access sub-request corresponding to data access request a. It can contain data such as operation identifier and access address. The operation identifier and access address can be stored separately in the request queue, or they can be stored as a data packet in the request queue.

[0092] 205. The queue execution unit retrieves the pending access sub-requests from the request queue, performs data access operations on the storage area, and obtains the accessed data.

[0093] For example, the queue execution unit sequentially retrieves the pending access sub-requests located at the head of the request queue, performs data access operations on the storage area, and obtains the accessed data.

[0094] 206. The data filtering subunit in the data acquisition unit selects the access data to obtain the target access data for different data access requests.

[0095] For example, filtering sub-units ( Figure 8 The mux shown selects data and passes it to the corresponding position in the reorder buffer to complete the data reordering.

[0096] 207. Target data acquisition sub-unit, used to obtain the target data of the data access request when the target access data contains the access data of all access sub-requests of the data access request.

[0097] Once all access data for a data access request in the reorder buffer has been collected, the target data for the data access request is obtained. Optionally, the target data for the data access request can be output.

[0098] As can be seen from the above, in the hardware acceleration engine of this application embodiment, the receiving unit receives a data access request and inputs the data access request into the region determination unit; the region determination unit masks the access addresses in the data access request that do not match the storage region according to the address of the storage region, and obtains the masked data access request; the routing subunit in the adding unit routes the access addresses in the masked data access request, and obtains the routed data access request; the queue adding subunit in the adding unit adds the access sub-requests in the routed data access request to the request queue; the queue execution unit obtains the access sub-requests to be processed from the request queue, performs data access operations on the storage region, and obtains the access data; the data filtering subunit in the data obtaining unit selects the access data to obtain the target access data for different data access requests; the target data obtaining subunit is used to obtain the target data of the data access request when the target access data contains the access data of all access sub-requests of the data access request.

[0099] In this embodiment of the application, each storage area of ​​the memory corresponds to a request queue. The request queue is used to store at least one pending access sub-request for accessing the storage area in a data access request. Executing multiple request queues in parallel can realize the parallel processing of multiple data access requests, improve data access efficiency, and improve processor performance.

[0100] To facilitate better implementation of the data processing method provided in the embodiments of this application, a data processing apparatus is also provided in one embodiment. The meanings of the terms used are the same as in the data processing method described above, and specific implementation details can be found in the description of the method embodiments.

[0101] Specifically, the data processing device can be integrated into a computer device; alternatively, it can be integrated into a chip, and then further integrated into the computer device based on the chip, such as... Figure 10 As shown, the data processing device may include: a receiving unit 301, a region determination unit 302, an adding unit 303, a queue execution unit 304, and a data acquisition unit 305, as detailed below: (1) Receiving unit 301: used to receive target data access request, the target data access request includes multiple access sub-requests, and the access sub-requests include access addresses.

[0102] (2) Region determination unit 302: used to determine the target storage region to be accessed by each access sub-request based on the addresses and access addresses of multiple storage regions in the memory.

[0103] In one embodiment, the region determination unit 302 may include a shielding subunit and an access region determination subunit, specifically: Masking sub-unit: Used to mask the access sub-requests in the target data access request that do not match the address of the storage area for each storage area in the memory, so as to obtain the masked data access request corresponding to each storage area; Access Area Determination Sub-unit: Used to determine the target storage area accessed by each access sub-request in the target access sub-request based on the masked data access request.

[0104] In one embodiment, the region determination unit 302 may include a location determination subunit and a classification subunit, specifically: Location determination subunit: used to determine the location of each storage region in the memory; Classification sub-unit: Used to classify the access addresses in data access requests according to their location, and to determine the target storage area accessed by each access sub-request.

[0105] (3) Adding unit 303: for each access sub-request, add the access sub-request to the request queue corresponding to the target storage area. The request queue corresponding to the target storage area stores the pending access sub-requests for data access to the target storage area.

[0106] In one embodiment, the adding unit 303 may include a routing subunit and a queue adding subunit, specifically: Routing subunit: Used to route the masked data access requests for each storage area, and obtain the routed data access requests for each storage area; Add sub-unit to queue: Used to add the access sub-requests in each routed data access request to the request queue corresponding to the target storage area.

[0107] (4) Queue execution unit 304: used to execute the request queues corresponding to multiple storage areas in parallel to obtain the access data of each pending access sub-request.

[0108] In one embodiment, the queue execution unit 304 may include an acquisition subunit and an access subunit, specifically: Acquisition Sub-unit: Used to periodically and in parallel acquire pending access sub-requests from the request queues corresponding to multiple storage areas of the memory; Access sub-unit: Used to perform data access operations in the storage area corresponding to the request queue where the access sub-request is located, based on the access address of the access sub-request to be processed, and to obtain the access data of each access sub-request to be processed.

[0109] In one embodiment, the access subunit may include a first address determination module and a reading module, specifically: First address determination module: If the access sub-request to be processed is a data read request, then determine the data read location in the storage area corresponding to the access sub-request to be processed based on the access address of the access sub-request to be processed. Read module: Used to retrieve access data corresponding to the access sub-request to be processed from the data read location.

[0110] In one embodiment, the access subunit may include a second address determination module, a writing module, and a data generation module, specifically: Second address determination module: If the access sub-request to be processed is a data write request, then determine the data write address in the corresponding storage area based on the access address of the access sub-request to be processed. Write module: Used to store the data to be written carried by the access sub-request to the data write address; Data generation module: Used to generate identification data for the pending access sub-requests. The identification data is used to indicate that the data to be written carried by the pending access sub-requests has been written.

[0111] (5) Data acquisition unit 305: used to obtain the target data corresponding to the target access request based on the access data.

[0112] In one embodiment, the data obtaining unit 305 may include a filtering subunit and a target data obtaining subunit, specifically: Filtering subunit: Used to filter access data according to the data access request to which the access sub-request to be processed belongs, and obtain the target access data corresponding to multiple data access requests; Target data acquisition sub-unit: Used to obtain the target data corresponding to the target access request when the target access data contains the access data corresponding to each access sub-request in the target data access request.

[0113] In one embodiment, the filtering subunit may include a data filtering module and a sorting module, specifically: Data filtering module: Used to filter access data according to the data access request to which the access sub-request belongs, and obtain candidate access data corresponding to multiple data access requests; The sorting module is used to sort the candidate access data based on the position of the corresponding access sub-request in the data access request, and obtain the target access data.

[0114] In one embodiment, the data processing apparatus may further include a partitioning unit and a queue corresponding unit, specifically: Partitioning unit: Used to divide the memory into multiple storage regions according to the region partitioning strategy; Queue Corresponding Unit: Used to determine the request queue corresponding to each storage area.

[0115] In this embodiment of the application, the data processing device receives a target data access request through a receiving unit 301. The target data access request includes multiple access sub-requests, and each access sub-request includes an access address. A region determination unit 302 determines the target storage region to be accessed by each access sub-request based on the addresses of multiple storage regions in the memory and the access addresses. An adding unit 303 adds each access sub-request to a request queue corresponding to the target storage region. The request queue corresponding to the target storage region stores pending access sub-requests for data access to the target storage region. A queue execution unit 304 executes the request queues corresponding to multiple storage regions in parallel to obtain the access data for each pending access sub-request. Finally, a data obtaining unit 305 obtains the target data corresponding to the target access request based on the access data.

[0116] In this embodiment of the application, each storage area of ​​the memory corresponds to a request queue. The request queue is used to store at least one pending access sub-request for accessing the storage area in a data access request. Executing multiple request queues in parallel can realize the parallel processing of multiple data access requests, improve data access efficiency, and improve processor performance.

[0117] This application also provides a computer device, which can be a terminal or a server, such as... Figure 11 As shown, it illustrates a structural schematic diagram of the computer device involved in the embodiments of this application, specifically: The computer device may include components such as a processor 1001 with one or more processing cores, a memory 1002 with one or more computer-readable storage media, a power supply 1003, and an input unit 1004. Those skilled in the art will understand that... Figure 11 The computer device structure shown does not constitute a limitation on the computer device and may include more or fewer components than shown, or combine certain components, or have different component arrangements. Wherein: The processor 1001 is the control center of the computer device. It connects various parts of the computer device via various interfaces and lines. By running or executing software programs and / or modules stored in the memory 1002, and by calling data stored in the memory 1002, it performs various functions of the computer device and processes data, thereby performing overall detection of the computer device. Optionally, the processor 1001 may include one or more processing cores; preferably, the processor 1001 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and computer programs, and the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processor 1001.

[0118] The memory 1002 can be used to store software programs and modules. The processor 1001 executes various functional applications and data processing by running the software programs and modules stored in the memory 1002. The memory 1002 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, computer programs required for at least one function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 1002 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 1002 may also include a memory controller to provide the processor 1001 with access to the memory 1002.

[0119] The computer equipment also includes a power supply 1003 that supplies power to the various components. Preferably, the power supply 1003 can be logically connected to the processor 1001 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. The power supply 1003 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.

[0120] The computer device may also include an input unit 1004, which can be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.

[0121] Although not shown, the computer device may also include a display unit, etc., which will not be described in detail here. Specifically, in this embodiment, the processor 1001 in the computer device loads the executable files corresponding to the processes of one or more computer programs into the memory 1002 according to the following instructions, and the processor 1001 runs the computer programs stored in the memory 1002 to realize various functions, as follows: Receive a target data access request. The target data access request contains multiple access sub-requests, and each access sub-request contains an access address. Based on the addresses and access addresses of multiple memory regions in the memory, determine the target memory region accessed by each access sub-request; For each access sub-request, the access sub-request is added to the request queue corresponding to the target storage area. The request queue corresponding to the target storage area stores the pending access sub-requests for data access to the target storage area. Execute request queues corresponding to multiple storage areas in parallel to obtain access data for each pending access sub-request; The target data corresponding to the target access request is obtained based on the access data.

[0122] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.

[0123] As can be seen from the above, the computer device in this application embodiment can receive a target data access request, which includes multiple access sub-requests, each containing an access address; determine the target storage area accessed by each access sub-request based on the addresses of multiple storage areas in the memory and the access address; for each access sub-request, add the access sub-request to the request queue corresponding to the target storage area, the request queue corresponding to the target storage area storing pending access sub-requests for data access to the target storage area; execute the request queues corresponding to multiple storage areas in parallel to obtain the access data of each pending access sub-request; and obtain the target data corresponding to the target access request based on the access data.

[0124] In this embodiment of the application, each storage area of ​​the memory corresponds to a request queue. The request queue is used to store at least one pending access sub-request for accessing the storage area in a data access request. Executing multiple request queues in parallel can realize the parallel processing of multiple data access requests, improve data access efficiency, and improve processor performance.

[0125] According to one aspect of this application, a computer program product is provided, comprising a computer program containing computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the methods provided in the various optional implementations of the above embodiments.

[0126] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by a computer program, or by a computer program controlling related hardware. The computer program can be stored in a computer-readable storage medium and loaded and executed by a processor.

[0127] Therefore, embodiments of this application provide a computer-readable storage medium storing a computer program that can be loaded by a processor to execute any of the data processing methods provided in embodiments of this application.

[0128] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.

[0129] The computer-readable storage medium may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.

[0130] Since the computer program stored in the computer-readable storage medium can execute any of the data processing methods provided in the embodiments of this application, the beneficial effects that any of the data processing methods provided in the embodiments of this application can achieve can be realized. For details, please refer to the previous embodiments, which will not be repeated here.

[0131] The data processing method, apparatus, computer device, and computer-readable storage medium provided in the embodiments of this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A data processing method, characterized by, include: Receive a target data access request, the target data access request containing multiple access sub-requests, the access sub-requests containing access addresses; Based on the addresses of multiple storage regions in the memory and the access address, the target storage region to be accessed by each access sub-request is determined; For each access sub-request, the access sub-request is added to the request queue corresponding to the target storage area. The storage has multiple storage areas, and each storage area has a corresponding request queue. The request queue is used to cache pending access sub-requests across multiple data access requests. Periodically extract the pending access sub-requests at the head of the request queues corresponding to multiple storage areas and execute them in parallel to obtain the access data of each pending access sub-request. The target data corresponding to the target data access request is obtained based on the access data.

2. The method according to claim 1, characterized in that, The periodic extraction of the head-of-line pending access sub-requests from the request queues corresponding to multiple storage areas and their parallel execution to obtain access data for each pending access sub-request includes: Periodically and in parallel retrieve the pending access sub-requests at the head of the queues from the request queues corresponding to multiple storage areas of the memory. Based on the access address of the pending access sub-request, perform data access operation on the storage location that matches the access address in the storage area corresponding to the request queue where the pending access sub-request is located, and obtain the access data of each pending access sub-request.

3. The method according to claim 2, characterized in that, The access data includes reading data. The step of performing data access on the storage location matching the access address in the storage area corresponding to the message queue where the sub-request to be processed resides, based on the access address of the sub-request to be processed, includes: If the pending access sub-request is a data read request, then the data read location is determined in the storage area corresponding to the pending access sub-request based on the access address of the pending access sub-request. Obtain the access data corresponding to the access sub-request to be processed from the data reading location.

4. The method according to claim 2, characterized in that, The access data includes identification data. The step of performing data access on the storage location matching the access address in the storage area corresponding to the message queue where the sub-request to be processed resides, based on the access address of the sub-request to be processed, includes: If the pending access sub-request is a data write request, then the data write location is determined in the corresponding storage area according to the access address of the pending access sub-request. The data to be written carried by the pending access sub-request is stored in the data writing location; The identifier data is generated for the pending access sub-request, and the identifier data is used to indicate that the data to be written carried by the pending access sub-request has been written.

5. The method according to claim 1, characterized in that, The step of obtaining the target data corresponding to the target data access request based on the access data includes: Based on the data access request to which the pending access sub-request belongs, the access data is filtered to obtain target access data corresponding to multiple data access requests; When the target access data contains access data corresponding to each access sub-request in the target data access request, the target data corresponding to the target data access request is obtained.

6. The method according to claim 5, characterized in that, The step of filtering the access data according to the data access request to which the unprocessed access sub-request belongs, to obtain target access data corresponding to multiple data access requests, includes: Based on the data access request to which the unprocessed access sub-request belongs, the access data is filtered to obtain candidate access data corresponding to multiple data access requests; Based on the access sub-requests corresponding to the candidate access data, and their positions within the data access requests, the candidate access data is sorted to obtain the target access data.

7. The method according to claim 1, characterized in that, Before receiving the target data access request, the method further includes: According to the region partitioning strategy, the memory is divided into multiple storage regions; For each storage region, determine the request queue corresponding to that storage region.

8. The method according to any one of claims 1-7, characterized in that, The step of determining the target storage region to be accessed by each access sub-request based on the addresses of multiple storage regions in the memory and the access address includes: For each storage region in the memory, the access sub-requests in the target data access request whose access address does not match the address of the storage region are masked to obtain the masked data access request corresponding to each storage region. Based on the masked data access request, determine the target storage area accessed by each access sub-request in the target data access request.

9. The method according to claim 8, characterized in that, For each access sub-request, adding the access sub-request to the request queue corresponding to the target storage area includes: The data access requests after being masked for each storage area are routed to obtain the routed data access requests for each storage area. Each access sub-request in the post-routed data access request is added to the request queue corresponding to the target storage area.

10. The method according to claim 8, characterized in that, The step of determining the target storage region to be accessed by each access sub-request based on the addresses of multiple storage regions in the memory and the access address includes: Determine the location of each storage region within the memory; The access addresses in the data access requests are classified according to the location, and the target storage area accessed by each access sub-request is determined.

11. A data processing apparatus, characterized in that, include: A receiving unit is configured to receive a target data access request, wherein the target data access request includes multiple access sub-requests, and the access sub-requests include access addresses; The region determination unit is used to determine the target storage region to be accessed by each access sub-request based on the addresses of multiple storage regions in the memory and the access address; An adding unit is used to add each access sub-request to a request queue corresponding to the target storage area. The memory has multiple storage areas, and each storage area has a corresponding request queue. The request queue is used to cache pending access sub-requests across multiple data access requests. The queue execution unit is used to periodically extract the pending access sub-requests at the head of the queue from the request queues corresponding to multiple storage areas and execute them in parallel to obtain the access data of each pending access sub-request. The data acquisition unit is used to obtain the target data corresponding to the target data access request based on the access data.

12. A computer device, characterized in that, It includes a memory and a processor; the memory stores a computer program, and the processor is used to run the computer program in the memory to perform the data processing method according to any one of claims 1 to 10.

13. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store a computer program, which is loaded by a processor to perform the data processing method according to any one of claims 1 to 10.

14. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the data processing method according to any one of claims 1 to 10.

Citation Information

Patent Citations

  • Data reading method, data writing method and data reading and writing method

    CN113553009A

  • Scatter / gather accessing multiple cache lines in a single cache port

    US20120144089A1