Method and apparatus for data scheduling based on ray tracing, system, device, storage medium, and computer program product
By adopting write-first and read-first scheduling methods in ray tracing processing, the problem of memory read and write conflicts is solved, data reading efficiency and computing efficiency are improved, and efficient computing of ray data and block data is achieved.
Patent Information
- Application Number
- PCT/CN2024/081658
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-03-30
- Filing Date
- 2024-03-14
- Publication Date
- 2024-10-03
AI Technical Summary
In ray tracing processing, due to read and write conflicts in storage blocks in the memory, data reading needs to wait, which affects the efficiency of data reading and the efficiency of subsequent operations.
By using write priority and read priority respectively in two scheduling cycles for data read scheduling, the read and write priorities are dynamically adjusted to take into account the read and write needs of data in the target storage block group and improve the reading efficiency of block data.
It is possible to read complete block data from the target storage block group within two scheduling cycles, which improves the efficiency of light data and block data operations and improves the utilization of the computing unit.
Smart Images

Figure CN2024081658_03102024_PF_FP_ABST
Abstract
Description
Data scheduling method, device, system, equipment, storage medium and computer program product based on ray tracing
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This disclosure is based on Chinese patent application number 202310331358.1, application date March 30, 2023, and application name “Data scheduling method, device and equipment based on ray tracing, and storage medium”, and claims the priority of the Chinese patent application. The entire content of the Chinese patent application is hereby introduced into this disclosure as a reference. Technical Field
[0003] The present disclosure relates to, but is not limited to, the field of information technology, and in particular to a data scheduling method, apparatus, system, device, storage medium, and computer program product based on ray tracing. Background Art
[0004] In ray tracing, the intersection calculation between a ray and an object block (such as a bounding box or triangle) requires obtaining both the ray data and the object block data before sending them to the Arithmetic and Logic Unit (ALU) for intersection calculation. However, in related technologies, read / write conflicts between memory blocks cause data read latency, thus affecting data read efficiency.
[0005] Summary of the Invention
[0006] The embodiments of the present disclosure provide a data scheduling method, apparatus, system, device, storage medium and computer program product based on ray tracing, which can improve the read scheduling efficiency of block data, thereby improving the computational efficiency of subsequent operations based on ray data and block data.
[0007] The technical solution of the embodiment of the present disclosure is implemented as follows:
[0008] The present disclosure provides a data scheduling method based on ray tracing, the method comprising:
[0009] Determining a first target storage block in a first memory and a target storage block group in a second memory, wherein the first target storage block and the target storage block group respectively store light data and block data having a corresponding relationship;
[0010] Reading the light data from the first target storage block;
[0011] The block data is read from the target storage block group within two scheduling cycles; wherein the first scheduling cycle and the second scheduling cycle of the two scheduling cycles respectively adopt a write priority method and a read priority method to perform data read scheduling.
[0012] An embodiment of the present disclosure provides a data scheduling device based on ray tracing, the device comprising:
[0013] A first determining part is configured to determine a first target storage block in the first memory and a target storage block group in the second memory, wherein the first target storage block and the target storage block group respectively store ray data and block data having a corresponding relationship;
[0014] a first reading part, configured to read the light data from the first target storage block;
[0015] The second reading part is configured to read the block data from the target storage block group within two scheduling cycles; wherein the first scheduling cycle and the second scheduling cycle of the two scheduling cycles respectively adopt a write priority method and a read priority method to perform data reading scheduling.
[0016] The present disclosure provides a data scheduling system based on ray tracing, the system comprising:
[0017] A first memory, for storing light data;
[0018] a second memory for storing block data;
[0019] A scheduler is communicatively connected to the first memory and the second memory, and is used to execute part or all of the steps in the above method.
[0020] An embodiment of the present disclosure provides a computer device, including a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the program, some or all of the steps in the above method are implemented.
[0021] An embodiment of the present disclosure provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, some or all of the steps in the above method are implemented.
[0022] An embodiment of the present disclosure provides a computer program product, including a computer program or instructions, which implements some or all of the steps in the above method when executed by a processor.
[0023] In an embodiment of the present disclosure, a first target storage block in a first memory and a target storage block group in a second memory are determined, wherein the first target storage block and the target storage block group respectively store light data and block data having a corresponding relationship; light data is read from the first target storage block; and block data is read from the target storage block group within two scheduling cycles; wherein the first scheduling cycle and the second scheduling cycle of the two scheduling cycles respectively adopt a write priority method and a read priority method to perform data read scheduling. In this way, the reading of block data can be divided into two cycles. On the one hand, the data read scheduling is performed in a write priority method in the first scheduling cycle, which can maintain a high priority for the data write in the target storage block group as much as possible; on the other hand, the data read scheduling is performed in a read priority method in the second scheduling cycle, which can enable the complete block data to be read from the target storage block group within at most two scheduling cycles. In this way, by dynamically adjusting the read and write priorities of the data read scheduling in the two scheduling cycles, the read and write requirements of the data in the target storage block group can be taken into account, the read scheduling efficiency of the block data is improved, and thus the efficiency of subsequent operations based on the light data and the block data is improved.
[0024] It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] The accompanying drawings herein are incorporated into and constitute a part of the specification. These drawings illustrate embodiments consistent with the present disclosure and, together with the specification, are used to explain the technical solutions of the present disclosure.
[0026] FIG1A is a schematic diagram of a first implementation flow of a data scheduling method based on ray tracing provided by an embodiment of the present disclosure;
[0027] FIG1B is a schematic diagram illustrating an implementation of reading ray data and block data in a ray tracing-based data scheduling method provided by an embodiment of the present disclosure;
[0028] FIG2A is a second schematic diagram of an implementation flow of a data scheduling method based on ray tracing provided by an embodiment of the present disclosure;
[0029] FIG2B is a schematic diagram of an implementation flow of determining a first target storage block and a target storage block group provided by an embodiment of the present disclosure;
[0030] FIG3A is a first schematic diagram of the structure of a data scheduling system based on ray tracing provided by an embodiment of the present disclosure;
[0031] FIG3B is a second structural diagram of a data scheduling system based on ray tracing provided by an embodiment of the present disclosure;
[0032] FIG4 is a schematic diagram of the structure of a data scheduling device based on ray tracing provided by an embodiment of the present disclosure;
[0033] FIG5 is a schematic diagram of a hardware entity of a computer device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0034] In order to make the purpose, technical solutions and advantages of the present disclosure clearer, the technical solutions of the present disclosure are further elaborated in detail below with reference to the accompanying drawings and embodiments. The described embodiments should not be regarded as limiting the present disclosure. All other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present disclosure.
[0035] In the following description, reference is made to “some embodiments”, which describes a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0036] In the following description, the terms "first / second / third" are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It is understandable that "first / second / third" can be interchanged with a specific order or sequence where permitted, so that the embodiments of the present disclosure described herein can be implemented in an order other than that illustrated or described herein.
[0037] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which the present disclosure pertains. The terms used herein are for the purpose of describing the present disclosure only and are not intended to limit the present disclosure.
[0038] In order to better understand the data scheduling method based on ray tracing provided by the embodiment of the present disclosure, the data scheduling scheme in the related art is first described below.
[0039] In ray tracing, the intersection calculation between a ray and an object block requires obtaining both the ray data and the object block data before sending them to the arithmetic unit (ALU). In related technologies, block data is typically stored using a double data rate (DDR) synchronous dynamic random access memory (RAM) + cache structure. The cache is typically a single-port random access memory (RAM) with writes set to an absolute high priority. When a data write request arrives, read scheduling is suspended, impacting block data read scheduling efficiency and, in turn, ALU utilization.
[0040] Based on this, embodiments of the present disclosure provide a data scheduling method based on ray tracing, which can be applied to a scheduler of a processor. The processor may include, for example, but is not limited to, at least one of a central processing unit (CPU) and a graphics processing unit (GPU).
[0041] FIG1A is a schematic diagram of a first implementation flow of a data scheduling method based on ray tracing provided by an embodiment of the present disclosure. As shown in FIG1A , the method may include the following steps S101 to S103:
[0042] Step S101 : determining a first target storage block in a first memory and a target storage block group in a second memory, wherein the first target storage block and the target storage block group respectively store corresponding ray data and block data.
[0043] Here, the first memory and the second memory may be any suitable memory determined according to actual circumstances, including but not limited to at least one of a cache, a buffer, etc. In some embodiments, the first memory may be a buffer for storing ray data, and the second memory may be a cache for storing block data.
[0044] The first memory may include multiple memory blocks. The second memory may include multiple memory block groups, each memory block group including multiple memory blocks. Light data may be written to at least one memory block in the first memory through a write operation, and block data may be written to a memory block in at least one memory block group in the second memory through a write operation. In some embodiments, each address in the first memory may correspond to at least one memory block, and each address in the second memory may correspond to at least one memory block in a memory block group. A memory block in the first memory may store one light data, and in the memory block group in the second memory, at least one memory block corresponding to one address may collectively store a complete block data.
[0045] During implementation, data stored in each storage block in the first memory and each storage block group in the second memory can be pre-fetched to detect whether a first target storage block and a target storage block group, respectively storing corresponding ray data and block data, exist in the first memory and the second memory. After determining the first target storage block in the first memory and the target storage block group in the second memory, the corresponding ray data and block data can be read from the first target storage block and the target storage block group, respectively. For example, the corresponding ray data and block data can be a pair of ray data and block data to be intersected. By performing an intersection operation on the pair of ray data and block data, it can be determined whether the ray corresponding to the ray data intersects with the object block corresponding to the block data.
[0046] Step S102: Read the light data from the first target storage block.
[0047] Here, after the first target storage block is determined, data read scheduling may be performed to read the light data from the first target storage block.
[0048] During implementation, any suitable method may be used to schedule reads of the first target storage block to read the light data in the first target storage block, and the present disclosure is not limited thereto. For example, a read-first method or a write-first method may be used to schedule reads of the first target storage block to read the light data in the first target storage block.
[0049] In some embodiments, the ray data can be read from the first target storage block to the scheduler, and the scheduler can transmit the read ray data to other units (such as computing units). In some embodiments, the scheduler can send a read scheduling instruction to the first memory to cause the first memory to transmit the ray data stored in the first target storage block to other units (such as computing units).
[0050] Step S103 , reading the block data from the target storage block group within two scheduling cycles; wherein the first scheduling cycle and the second scheduling cycle of the two scheduling cycles respectively adopt a write priority method and a read priority method to perform data read scheduling.
[0051] Here, data read scheduling may be performed in a write-first manner in a first scheduling cycle, and then in a read-first manner in a second scheduling cycle, so as to read block data from the target storage block group in two beats.
[0052] It can be understood that, in the first scheduling cycle, data read scheduling is performed in a write-first manner, which means that the data write operation has the highest priority in the first scheduling cycle. If there is a data write demand for at least one storage block in the target storage block group in the first scheduling cycle, the data write demand for the at least one storage block needs to be met first, and in the first scheduling cycle, only data in other storage blocks other than the at least one storage block can be read. In the second scheduling cycle, data read scheduling is performed in a read-first manner, which means that the data read operation has the highest priority in the second scheduling cycle. If there is data in at least one storage block in the target storage block group that has not been read in the first scheduling cycle, the demand for reading data in the at least one storage block will be met first in the second scheduling cycle, so that the complete block data can be read from the target storage block group within at most two scheduling cycles.
[0053] FIG1B is a schematic diagram illustrating an implementation of reading ray data and block data in a ray tracing-based data scheduling method provided by an embodiment of the present disclosure. As shown in FIG1B , a first memory 100 for storing ray data includes a plurality of storage blocks 110, and a second memory 200 for storing block data includes a plurality of storage block groups 210, each of which includes a plurality of storage blocks 211. The scheduler 300 may determine a first target storage block from the first memory 100 and a target storage block group from the second memory 200, wherein the first target storage block and the target storage block group respectively store ray data and block data having a corresponding relationship. After determining the first target storage block and the target storage block group, the scheduler 300 may read the ray data from the first target storage block and read the block data from the target storage block group within two scheduling cycles, wherein the first scheduling cycle and the second scheduling cycle of the two scheduling cycles respectively adopt a write-first and a read-first approach for data read scheduling. After reading the ray data and the block data, the scheduler 300 may transmit the ray data and the block data to the operation unit for an intersection operation to obtain an intersection state between the ray corresponding to the ray data and the object block corresponding to the block data.
[0054] In some embodiments, the ray data may be stored at a first target address of the first target storage block, and the block data may be stored at a second target address in the target storage block group. In implementation, the ray data may be read from the first target address of the first target storage block, and the block data may be read from the second target address in the target storage block group within two scheduling cycles.
[0055] In an embodiment of the present disclosure, a first target storage block in a first memory and a target storage block group in a second memory are determined, wherein the first target storage block and the target storage block group respectively store light data and block data having a corresponding relationship; light data is read from the first target storage block; and block data is read from the target storage block group within two scheduling cycles; wherein the first scheduling cycle and the second scheduling cycle of the two scheduling cycles respectively adopt a write priority method and a read priority method to perform data read scheduling. In this way, the reading of block data can be divided into two cycles. On the one hand, the data read scheduling is performed in a write priority method in the first scheduling cycle, which can maintain a high priority for the data write in the target storage block group as much as possible; on the other hand, the data read scheduling is performed in a read priority method in the second scheduling cycle, which can enable the complete block data to be read from the target storage block group within at most two scheduling cycles. In this way, by dynamically adjusting the read and write priorities of the data read scheduling in the two scheduling cycles, the read and write requirements of the data in the target storage block group can be taken into account, the read scheduling efficiency of the block data is improved, and thus the efficiency of subsequent operations based on the light data and the block data is improved.
[0056] In some embodiments, the block data is stored in a second target address in the target storage block group, where the second target address corresponds to multiple storage blocks in the target storage block group; the block data includes at least one of the first sub-data and the second sub-data; and the above step S103 may include the following steps S111 to S112:
[0057] Step S111: within the first scheduling cycle, if there is at least one second target storage block in the plurality of storage blocks corresponding to the second target address and no data is currently written thereto, reading the first sub-data from the at least one second target storage block;
[0058] Step S112: During the second scheduling cycle, if there is at least one third target storage block other than the second target storage block in the multiple storage blocks corresponding to the second target address, read-lock the at least one third target storage block and read the second sub-data from the at least one third target storage block.
[0059] Here, among the multiple storage blocks corresponding to the second target address, the number of the second target storage blocks and the third target storage blocks can be determined according to actual conditions.
[0060] For example, in the first scheduling cycle, if no data is written to the storage blocks corresponding to the second target address in the target storage block group, then the storage blocks corresponding to the second target address in the target storage block group are all second target storage blocks, and the first sub-data can be read from the second target storage blocks in the first scheduling cycle; and in the second scheduling cycle, since the storage blocks corresponding to the second target address in the target storage block group are all second target storage blocks, that is, there is no third target storage block in the storage blocks corresponding to the second target address, then there is no need to continue data read scheduling in the storage blocks corresponding to the second target address in the target storage block group in the second scheduling cycle; in this way, the read block data only includes the first sub-data, that is, the complete block data can be read in the first scheduling cycle.
[0061] For another example, in the first scheduling cycle, if at least one of the storage blocks corresponding to the second target address in the target storage block group has data written, then the storage blocks corresponding to the second target address in the target storage block group that have no data written are determined as second target storage blocks, and the first sub-data can be read from the second target storage blocks in the first scheduling cycle; and in the second scheduling cycle, the storage blocks except the second target storage blocks in the storage blocks corresponding to the second target address in the target storage block group can be determined as third target storage blocks, that is, the storage blocks with data written in the first scheduling cycle are determined as third target storage blocks, and the second sub-data can be read from the third target storage blocks in the second scheduling cycle; in this way, the read block data includes the first sub-data and the second sub-data, that is, the complete block data is read in the first scheduling cycle and the second scheduling cycle.
[0062] For another example, in the first scheduling cycle, if data is written to each storage block corresponding to the second target address in the target storage block group, then the second target storage block does not exist in the storage blocks corresponding to the second target address in the target storage block group. In this case, data read scheduling cannot be performed in the target storage block group in the first scheduling cycle, that is, the first sub-data cannot be read. In the second scheduling cycle, since the second target storage block does not exist in the storage blocks corresponding to the second target address in the target storage block group, that is, the storage blocks corresponding to the second target address are all third target storage blocks, the second sub-data can be read from the third target storage blocks in the second scheduling cycle. In this way, the read block data only includes the second sub-data, that is, the complete block data can be read in the second scheduling cycle.
[0063] It is understandable that after the second sub-data is read from the third target storage block, the read lock of the third target storage block can be released. After the read lock is released, the third target storage block is in an unlocked state.
[0064] In the disclosed embodiment, during a first scheduling cycle, if at least one second target storage block currently having no data written thereto exists among the multiple storage blocks corresponding to the second target address, the first sub-data is read from the at least one second target storage block; during a second scheduling cycle, if at least one third target storage block other than the second target storage block exists among the multiple storage blocks corresponding to the second target address, the at least one third target storage block is read-locked, and the second sub-data is read from the at least one third target storage block. In this way, complete block data can be simply and quickly read from the target storage block group within at most two scheduling cycles.
[0065] In some embodiments, the above step S103 may further include the following step S121:
[0066] Step S121 : within the second scheduling period, if a fourth target storage block in the target storage block group currently has a data write request and the fourth target storage block is not read locked, write data into the fourth target storage block.
[0067] Here, during the second scheduling cycle, the scheduler uses a read-first approach to schedule data reads. If there is a data write request for the fourth target storage block, it can first determine whether the fourth target storage block is read-locked. If the fourth target storage block is not read-locked, data can be written to the fourth target storage block. If the fourth target storage block is read-locked, data cannot be written to the fourth target storage block during the second scheduling cycle and must wait for the next scheduling cycle.
[0068] During implementation, the fourth target storage block can be any suitable storage block in the target storage block group, and the embodiment of the present disclosure is not limited to this. For example, the fourth target storage block can be the second target storage block to which no data is written in the first scheduling cycle, that is, data can be read from the fourth target storage block in the first scheduling cycle, and the fourth target storage block will not be read-locked in the second scheduling cycle, so that in the second scheduling cycle, when the fourth target storage block currently has a data write request, since the fourth target storage block is not read-locked, data can be written to the fourth target storage block. For another example, the fourth target storage block can be the third target storage block other than the second target storage block among the multiple storage blocks corresponding to the second target address, and the fourth target storage block will be read-locked in the second scheduling cycle, so that in the second scheduling cycle, when the fourth target storage block currently has a data write request, since the fourth target storage block has been read-locked, data cannot be written to the fourth target storage block.
[0069] In the above embodiment, during the second scheduling cycle, if a data write request is currently received for the fourth target storage block in the target storage block group and the fourth target storage block is not read locked, data is written to the fourth target storage block. In this way, a higher priority can be maintained for data writing in the target storage block group as much as possible, thereby better balancing the read and write requirements of data in the target storage block group.
[0070] The present disclosure provides a data scheduling method based on ray tracing, which can be applied to a processor scheduler. FIG2A is a second schematic diagram of an implementation flow of a data scheduling method based on ray tracing provided by the present disclosure. As shown in FIG2A , the method may include the following steps S201 to S205:
[0071] Step S201, determining at least one pair of candidate storage blocks and candidate storage block groups from multiple storage blocks in the first memory and multiple storage block groups in the second memory; wherein each pair of candidate storage blocks and candidate storage block groups respectively stores corresponding light data and block data.
[0072] Here, by prefetching the data stored in each storage block in the first memory and each storage block group in the second memory, and when a ray of light data is prefetched in a storage block in the first memory and block data corresponding to the ray of light data is prefetched in a storage block group in the second memory, it is determined that the storage block in the first memory and the storage block group in the second memory respectively store ray of light data and block data having a corresponding relationship, thereby determining the storage block and the storage block group as a pair of candidate storage blocks and candidate storage block groups.
[0073] In some embodiments, when it is determined that a storage block in a first memory and a storage block group in a second memory respectively store corresponding light data and block data, and the storage block in the first memory is not occupied by other operations, the storage block and the storage block group can be determined as a pair of candidate storage blocks and candidate storage block group.
[0074] Step S202 : determining a target storage block group from each of the candidate storage block groups based on the number of readable storage blocks in each of the candidate storage block groups.
[0075] Here, a readable storage block refers to a storage block that is currently in a readable state. In implementation, the read / write state of each storage block in the candidate storage block group can be obtained to determine whether each storage block is in a readable state, that is, whether each storage block is a readable storage block, and thus determine the number of readable storage blocks in the candidate storage block group.
[0076] In some implementations, a candidate storage block group having the largest number of readable storage blocks among the candidate storage block groups may be determined as the target storage block group.
[0077] In some implementations, one candidate storage block group may be randomly selected from a plurality of candidate storage block groups having the largest number of readable storage blocks in each candidate storage block group and determined as the target storage block group.
[0078] Step S203: Determine the candidate storage block corresponding to the target storage block group as the first target storage block.
[0079] Here, the candidate memory blocks corresponding to the target memory block group may be candidate memory blocks belonging to the same pair of candidate memory blocks and candidate memory block group as the target memory block group.
[0080] In some implementations, the target storage block group may correspond to a candidate storage block, and the candidate storage block may be determined as the first target storage block.
[0081] In some embodiments, the target storage block group may correspond to at least two candidate storage blocks, and any suitable selection rule may be used to select a candidate storage block from the at least two candidate storage blocks as the first target storage block. For example, the candidate storage block with the smallest identifier among the at least two candidate storage blocks may be determined as the first target storage block. For another example, a candidate storage block may be randomly selected from the at least two candidate storage blocks as the first target storage block.
[0082] Step S204: Read the light data from the first target storage block.
[0083] Step S205 , reading the block data from the target storage block group within two scheduling cycles; wherein the first scheduling cycle and the second scheduling cycle of the two scheduling cycles respectively adopt a write priority method and a read priority method to perform data read scheduling.
[0084] Here, steps S204 to S205 correspond to steps S102 to S103 in the aforementioned embodiment, respectively. When implementing, reference may be made to the implementation of the aforementioned steps S102 to S103.
[0085] In an embodiment of the present disclosure, at least one pair of candidate storage blocks and candidate storage block groups is determined from a plurality of storage blocks in a first memory and a plurality of storage block groups in a second memory; wherein each pair of candidate storage blocks and candidate storage block groups respectively stores corresponding light data and block data; based on the number of readable storage blocks in each candidate storage block group, a target storage block group is determined from each candidate storage block group; and the candidate storage block corresponding to the target storage block group is determined as the first target storage block. In this way, the number of readable storage blocks in each candidate storage block group is taken into consideration during the process of determining the target storage block group and the first target storage block, thereby determining a more suitable target storage block group and the first target storage block.
[0086] In some embodiments, step S202 may include the following steps S211 to S212:
[0087] Step S211 : determining the number of readable storage blocks in each candidate storage block group.
[0088] The read / write state of the readable storage block is a readable state.
[0089] Step S212 : determining the storage block group with the largest number of readable storage blocks among the candidate storage block groups as the target storage block group.
[0090] In this way, since the target storage block group is the storage block group with the largest number of readable storage blocks among the candidate storage block groups, more second target storage blocks can be determined in the first scheduling cycle, so that the number of third target storage blocks that need to be read-locked in the second scheduling cycle is smaller. In this way, data reading and writing conflicts in the block data reading process can be further reduced, and the reading and writing requirements of data in the target storage block group can be better taken into account.
[0091] In some embodiments, when there are multiple storage block groups with the largest number of readable storage blocks in each candidate storage block group, a storage block group can be selected as the target storage block group from the multiple storage block groups with the largest number of readable storage blocks according to a preset selection method.
[0092] In some implementations, when there is only one storage block group with the largest number of readable storage blocks among the candidate storage block groups, the storage block group with the largest number of readable storage blocks can be directly determined as the target storage block group.
[0093] In some embodiments, step S211 may include the following step S221:
[0094] Step S221: for each candidate storage block group, determine the read / write status of each storage block in the candidate storage block group, and count the storage blocks in the candidate storage block group whose read / write status is readable to obtain the number of readable storage blocks in the candidate storage block group.
[0095] Here, the read / write status of each storage block may include a readable state or an unreadable state. By counting the number of storage blocks whose read / write status in the candidate storage block group is a readable state, the number of readable storage blocks in the candidate storage block group can be determined.
[0096] In some embodiments, the above method may further include the following steps S231 to S232:
[0097] Step S231 : obtaining the write lock status and the read lock status of each storage block in each candidate storage block group.
[0098] The write lock state includes one of the following: a first state indicating that data is currently being written to the storage block, and a second state indicating that no data is currently being written to the storage block; the read lock state includes one of the following: a third state indicating that the storage block is currently read locked, and a fourth state indicating that the storage block is currently not read locked.
[0099] Here, the write lock state of a storage block may indicate whether the storage block is write-locked, i.e., whether the storage block is currently locked by other data write operations. The read lock state of a storage block may indicate whether the storage block is read-locked, i.e., whether the storage block is currently locked by other data read operations.
[0100] In some embodiments, when the storage block is currently locked by other data read operations, the read lock state of the storage block can be determined to be the third state; when the storage block is not currently locked by other data read operations, the read lock state of the storage block can be determined to be the fourth state.
[0101] In some embodiments, the other data read operation that performs a read lock on the storage block may be an operation that performs a read lock on the storage block to read data from the storage block before the current scheduling cycle. After the other data read operation completes reading the data from the storage block, the read lock on the storage block may be released, and after the read lock is released, the storage block is in a non-read locked state. For example, if the other data read operation that performs a read lock on the storage block performs a read lock on the storage block before the current scheduling cycle, but has not completed reading the data in the storage block until the current scheduling cycle begins, in this case, the read lock on the storage block will not be released, that is, the storage block will still be read locked, and thus, in the current scheduling cycle, the read lock state of the storage block is the third state indicating that the storage block is currently read locked. For another example, if other data reading operations that read-lock the storage block read-lock the storage block before the current scheduling cycle, but the reading of the data in the storage block has been completed before entering the current scheduling cycle, in this case, the read lock of the storage block will be released before the current scheduling cycle, so that within the current scheduling cycle, the read lock state of the storage block is the fourth state indicating that the storage block is not currently read locked.
[0102] During implementation, those skilled in the art may determine the write lock state and the read lock state of each storage block in any appropriate manner according to actual circumstances, and the embodiments of the present disclosure are not limited thereto.
[0103] In some embodiments, two status information may be set for each storage block: a write lock state and a read lock state. If data is currently being written to the storage block, the write lock state corresponding to the storage block may be set to a first state. If no data is currently being written to the storage block, the write lock state corresponding to the storage block may be set to a second state. If the storage block is currently read-locked, the read lock state corresponding to the storage block may be set to a third state. If the storage block is currently not read-locked, the read lock state corresponding to the storage block may be set to a fourth state.
[0104] In some embodiments, the read lock state and write lock state corresponding to each storage block may be stored in registers, and the scheduler may determine the read lock state and write lock state corresponding to each storage block by reading the values in the registers. In practice, the read lock state and write lock state may be stored in the same register or in different registers, and this is not limited in the embodiments of the present disclosure.
[0105] In some embodiments, the scheduler can request the second memory to query the write lock status and read lock status of each storage block through a set interface, and the second memory can send the write lock status and read lock status of each storage block to the scheduler after receiving the request for querying the write lock status and read lock status sent by the scheduler.
[0106] Step S232 : for each of the storage blocks, when the write lock state of the storage block is the second state and the read lock state of the storage block is the fourth state, determining that the read / write state of the storage block is the readable state.
[0107] In the above embodiment, the write lock state and read lock state of each storage block in the candidate storage block group are obtained, and for each storage block in the candidate storage block group, if the write lock state of the storage block is not write locked and the read lock state is not read locked, the read-write state of the storage block is determined to be a readable state. In this way, the readable storage blocks in each candidate storage block group can be determined simply and efficiently.
[0108] In some embodiments, the above step S202 may include the following steps S241 to S242:
[0109] Step S241, determining a first storage block group having the largest number of readable storage blocks among the candidate storage block groups;
[0110] Step S242 : When there are multiple first storage block groups, select one first storage block group from each of the first storage block groups as the target storage block group according to a preset selection method.
[0111] Here, the preset selection method can be pre-set by the user, and the embodiments of the present disclosure are not limited to this. For example, a random selection method can be used to randomly select a first storage block group from each first storage block group as the target storage block group. For another example, a first storage block group with the smallest corresponding group identifier can be selected from each first storage block group as the target storage block group.
[0112] In some embodiments, when the number of readable storage blocks in each candidate storage block group is the same, each candidate storage block group is a first storage block group, and a candidate storage block group can be selected from each candidate storage block group as the target storage block group according to a preset selection method.
[0113] In some embodiments, when the number of readable storage blocks in each candidate storage block group is different, the candidate storage block with the largest number of readable storage blocks in each candidate storage block group can be determined as the first storage block group. When there are multiple first storage block groups, one first storage block group can be selected from each first storage block group as the target storage block group according to a preset selection method; when there is only one first storage block group, the first storage block group can be directly determined as the target storage block group.
[0114] In some embodiments, the above step S201 may include the following step S251:
[0115] Step S251, from the multiple storage blocks in the first memory and the multiple storage block groups in the second memory, determine at least one pair of candidate storage blocks and candidate storage block groups, as well as the first target address corresponding to the candidate storage block in each pair of candidate storage blocks and candidate storage block groups, and the second target address corresponding to the candidate storage block group; wherein, for each pair of candidate storage blocks and candidate storage block groups, the first target address of the candidate storage block and the second target address of the candidate storage block group respectively store corresponding light data and block data.
[0116] Here, by prefetching the data stored in each storage block in the first memory and each storage block group in the second memory, and when a ray data is prefetched in a storage block of the first memory and block data having a corresponding relationship with the ray data is prefetched in a storage block group of the second memory, it is determined that the storage block in the first memory and the storage block group in the second memory respectively store ray data and block data having a corresponding relationship, thereby determining the storage block and the storage block group as a pair of candidate storage blocks and a candidate storage block group, and determining the address of the storage block storing the corresponding ray data as the first target address corresponding to the candidate storage block, and determining the addresses corresponding to the multiple storage blocks storing the corresponding block data in the storage block group as the second target address corresponding to the candidate storage block group.
[0117] In some embodiments, the addresses of the first pair of corresponding light data and block data pre-fetched in the storage block and storage block group can be determined as the first target address of the candidate storage block corresponding to the light data and the second target address of the candidate storage block group corresponding to the block data, respectively.
[0118] In some embodiments, the addresses of the earliest stored pair of ray data and block data among multiple pairs of corresponding ray data and block data pre-fetched in the storage blocks and storage block groups can be determined as the first target address of the candidate storage block corresponding to the ray data and the second target address of the candidate storage block group corresponding to the block data, respectively.
[0119] In some embodiments, the above step S201 may include the following steps S261 to S262:
[0120] Step S261: for each pair of storage blocks and storage block groups determined from the multiple storage blocks in the first memory and the multiple storage block groups in the second memory, detect whether the storage blocks and the storage block groups respectively store corresponding light data and block data.
[0121] Step S262: for each pair of storage blocks and storage block groups that respectively store corresponding light data and block data, when the read / write state of the storage block is a readable state, determine the storage block and the storage block group as a pair of candidate storage blocks and candidate storage block group.
[0122] Here, a pair of candidate storage blocks and candidate storage block group may be a storage block and a storage block group respectively storing corresponding ray data and block data, and the read / write state of the candidate storage block is a readable state.
[0123] In this way, the first target storage block is determined to be in a readable state, so that the light data can be read directly from the first target storage block without waiting for read-write conflicts with other operations, thereby further improving the efficiency of light data read scheduling, and further improving the utilization of the operation unit and the operation efficiency of the intersection operation.
[0124] In some embodiments, for each pair of candidate storage blocks and candidate storage block groups, light data and block data with corresponding relationships are stored in the first target address of the candidate storage block and the second target address of the candidate storage block group, respectively; the above-mentioned step S202 may include: based on the number of readable storage blocks in the multiple storage blocks corresponding to the first target address in each of the candidate storage block groups, determining the target storage block group from each of the candidate storage block groups.
[0125] In some implementations, the storage block group having the largest number of readable storage blocks among the multiple storage blocks corresponding to the first target address in each of the candidate storage block groups may be determined as the target storage block group.
[0126] FIG2B is a schematic diagram of an implementation process for determining a first target storage block and a target storage block group provided by an embodiment of the present disclosure. As shown in FIG2B , assuming that the first memory includes four storage blocks rbank0, rbank1, rbank2, and rbank3, and the second memory includes 16 storage blocks nbank0 to nbank15, and these 16 storage blocks nbank0 to nbank15 are respectively located in four storage block groups group0, group1, group2, and group3; first, the write lock status wr_bank_status[15:0] and the read lock status lock_bank[15:1] of the storage blocks nbank15 to nbank0 in the second memory can be obtained. :0]; perform mask operation on the write lock state wr_bank_status[15:0] and the read lock state lock_bank[15:0] of the storage blocks nbank15 to nbank0 to obtain the idle state idle_bank[15:0] (i.e., read and write state) of the storage blocks nbank15 to nbank0, wherein idle_bank[15:0]=~(wr_bank_status[15:0]||lock_bank[15:0]); then ... nk[15:0], group and count the number of free memory blocks (i.e., readable memory blocks) sum0 to sum3 in the memory block groups group0, group1, group2, and group3, and determine the memory block group with the largest number of free memory blocks as the target memory block group sel_group; in addition, for the 16 pairs of memory blocks and memory block groups composed of the 4 memory blocks in the first memory and the 4 memory block groups in the second memory, it is possible to determine whether each pair of memory blocks and memory block groups stores corresponding light data and block data by data prefetching, which is recorded as tri_va lid[15:0], if a pair of storage blocks and storage block groups respectively store light data and block data with corresponding relationships, then the value of the corresponding data bit of the pair of storage blocks and storage block group in tri_valid[15:0] is 0, otherwise, it is 1; the read and write status (that is, whether they are occupied by other operations) of the four storage blocks rbank3 to rbank0 in the first memory can also be obtained. rtram_rts_use[3:0], if the storage block is not occupied by other operations, then the value of the corresponding data bit of the pair of storage blocks in rtram_rts_use[3:0] is 0, otherwise, it is 1;For each storage block in the storage blocks rbank3 to rbank0, a mask operation can be performed on whether the 4 pairs of storage blocks and storage block groups containing the storage block respectively store corresponding light data and block data (i.e., the 4-bit data corresponding to the storage block in tri_valid[15:0]), and the read and write status corresponding to the storage block (i.e., the 1-bit data corresponding to the storage block in rtram_rts_use[3:0]), to obtain the selection status sel[3:0] / sel[7:4 ] / sel[11:8] / sel[15:12] (i.e., whether the corresponding pair of storage blocks and storage block groups are in a state that can be selected for scheduling. If a pair of storage blocks and storage block groups are in a state that can be selected for scheduling, then the value of the corresponding data bit of the pair of storage blocks and storage block groups in sel[3:0] / sel[7:4] / sel[11:8] / sel[15:12] is 1, otherwise it is 0); according to the selection status sel[3:0] / sel[7:4] / sel[11:8] / sel[15:12] corresponding to each storage block, the 4 pairs of storage blocks and storage block groups respectively correspond to each other. el[15:12], the selection states sel[12 / 8 / 4 / 0] / sel[13 / 9 / 5 / 1] / sel[14 / 10 / 8 / 2] / sel[15 / 11 / 7 / 3] corresponding to the four pairs of storage blocks and storage block groups corresponding to each storage block group can be determined; for each storage block group, the first pair of storage blocks and storage block groups whose selection states are selectable for scheduling among the four pairs of storage blocks and storage block groups corresponding to the storage block group can be determined as a pair of candidate storage blocks and candidate storage block groups, that is, the four pairs of storage blocks and storage block groups corresponding to each storage block group can be determined as the candidate storage blocks and candidate storage block groups. The corresponding selection state sel[12 / 8 / 4 / 0] / sel[13 / 9 / 5 / 1] / sel[14 / 10 / 8 / 2] / sel[15 / 11 / 7 / 3] takes the first 1 data bit (i.e., the first data bit that is 1), and the pair of storage blocks and storage block groups corresponding to this data bit are a pair of candidate storage blocks and candidate storage block groups; finally, using the data selector MUX, according to the target storage block group sel_group, the first target storage block sel_bank corresponding to the target storage block group sel_group is selected from each pair of candidate storage blocks and candidate storage block groups. It should be noted that in the process of determining the target storage block group sel_group, only the number of free storage blocks in each pair of storage blocks and storage block groups whose selection state is a state that can be selected for scheduling is counted to reduce the amount of calculation.;
[0127] The present disclosure provides a data scheduling system based on ray tracing. FIG3A is a first schematic diagram of the structure of a data scheduling system based on ray tracing provided by the present disclosure. As shown in FIG3A , the system includes:
[0128] A first memory 100, for storing light data;
[0129] The second memory 200 is used to store block data;
[0130] The scheduler 300 is in communication with the first memory 100 and the second memory 200 and is used to implement the data scheduling method based on ray tracing described in the above embodiment.
[0131] In some embodiments, the scheduler 300 is used to: determine a first target storage block in a first memory 100 and a target storage block group in a second memory 200, wherein the first target storage block and the target storage block group respectively store corresponding light data and block data; read the light data from the first target storage block; read the block data from the target storage block group within two scheduling cycles; wherein the first scheduling cycle and the second scheduling cycle of the two scheduling cycles respectively adopt a write-first method and a read-first method for data read scheduling.
[0132] In some embodiments, FIG3B is a second schematic diagram of the structure of a ray tracing-based data scheduling system provided in an embodiment of the present disclosure. As shown in FIG3B , the system may further include: an operation unit 400, which is in communication with the first memory 100 and the second memory 200 and is configured to receive ray data and block data from the first memory 100 and the second memory 200, respectively, for intersection operations. The scheduler 300 is further configured to: read ray data from the first target storage block to the operation unit 400; and read block data from the target storage block group to the operation unit 400 within two scheduling cycles, so that the operation unit 400 performs an intersection operation on the ray data and the block data.
[0133] It should be noted that the scheduler 300 can be communicated with the first memory 100 and the second memory 200 in any suitable manner, and the computing unit 400 can be communicated with the first memory 100 and the second memory 200 in any suitable manner, and the embodiments of the present disclosure are not limited thereto. For example, the communication connection may include, but is not limited to, a communication connection based on at least one of a bus, an interface, and a shared storage space.
[0134] Based on the foregoing embodiments, the embodiments of the present disclosure provide a data scheduling device based on ray tracing, which includes the various parts included and the sub-parts included in each part, and can be implemented by a processor in a computer device; of course, it can also be implemented by a specific logic circuit; in the implementation process, the processor can be a central processing unit (CPU), a microprocessor (MPU), a digital signal processor (DSP) or a field programmable gate array (FPGA), etc.
[0135] FIG4 is a schematic diagram of the structure of a data scheduling device based on ray tracing provided by an embodiment of the present disclosure. As shown in FIG4 , the data scheduling device based on ray tracing 500 includes: a first determining part 510, a first reading part 520, and a second reading part 530, wherein:
[0136] The first determining part 510 is configured to determine a first target storage block in the first memory and a target storage block group in the second memory, wherein the first target storage block and the target storage block group respectively store ray data and block data having a corresponding relationship;
[0137] A first reading part 520 is configured to read the light data from the first target storage block;
[0138] The second reading part 530 is configured to read the block data from the target storage block group within two scheduling cycles; wherein the first scheduling cycle and the second scheduling cycle of the two scheduling cycles respectively adopt a write priority method and a read priority method to perform data reading scheduling.
[0139] In some embodiments, the first reading part is further configured to: read the light data from the first target storage block to the operation unit; the second reading part is further configured to: read the block data from the target storage block group to the operation unit within two scheduling cycles, so that the operation unit performs an intersection operation on the light data and the block data.
[0140] In some embodiments, the block data is stored in a second target address in the target storage block group, the second target address corresponds to multiple storage blocks in the target storage block group, and the block data includes at least one of first sub-data and second sub-data; the second reading part is further configured to: within the first scheduling cycle, when there is at least one second target storage block in the multiple storage blocks corresponding to the second target address and no data is currently written, read the first sub-data from the at least one second target storage block; within the second scheduling cycle, when there is at least one third target storage block other than the second target storage block in the multiple storage blocks corresponding to the second target address, read-lock the at least one third target storage block and read the second sub-data from the at least one third target storage block.
[0141] In some embodiments, the second read part is further configured to: during the second scheduling cycle, when there is currently a data write request for the fourth target storage block in the target storage block group and the fourth target storage block is not read locked, write data to the fourth target storage block.
[0142] In some embodiments, the first determination part is further configured to: determine at least one pair of candidate storage blocks and candidate storage block groups from multiple storage blocks in the first memory and multiple storage block groups in the second memory; wherein each pair of candidate storage blocks and candidate storage block groups respectively stores light data and block data with a corresponding relationship; based on the number of readable storage blocks in each of the candidate storage block groups, determine the target storage block group from each of the candidate storage block groups; and determine the candidate storage block corresponding to the target storage block group as the first target storage block.
[0143] In some embodiments, the first determination part is further configured to: determine the number of readable storage blocks in each of the candidate storage block groups; wherein the read and write state of the readable storage blocks is a readable state; and determine the storage block group with the largest number of readable storage blocks in each of the candidate storage block groups as the target storage block group.
[0144] In some embodiments, the device further includes: an acquisition part, configured to acquire the write lock state and read lock state of each storage block in each of the candidate storage block groups; wherein, the write lock state includes one of the following: a first state indicating that data is currently being written to the storage block, a second state indicating that no data is currently being written to the storage block; the read lock state includes one of the following: a third state indicating that the storage block is currently read locked, a fourth state indicating that the storage block is currently not read locked; a second determination part, configured to, for each of the storage blocks, determine that the read-write state of the storage block is a readable state when the write lock state of the storage block is the second state and the read lock state of the storage block is the fourth state.
[0145] In some embodiments, the first determination part is further configured to: determine the first storage block group with the largest number of readable storage blocks among each of the candidate storage block groups; when there are multiple first storage block groups, select a first storage block group from each of the first storage block groups as the target storage block group according to a preset selection method.
[0146] In some embodiments, the first determination part is further configured to: determine at least one pair of candidate storage blocks and candidate storage block groups from multiple storage blocks in the first memory and multiple storage block groups in the second memory, as well as the first target address corresponding to the candidate storage block and the second target address corresponding to the candidate storage block group in each pair of candidate storage blocks and candidate storage block groups; wherein, for each pair of candidate storage blocks and candidate storage block groups, the first target address of the candidate storage block and the second target address of the candidate storage block group respectively store corresponding light data and block data.
[0147] In the embodiments of the present disclosure and other embodiments, "part" can be part of a circuit, part of a processor, part of a program or software, etc., and of course it can also be a unit, a module, or a non-modular one.
[0148] The description of the above device embodiment is similar to the description of the above method embodiment and has similar beneficial effects as the method embodiment. In some embodiments, the functions or modules included in the device provided by the embodiment of the present disclosure can be used to perform the method described in the above method embodiment. For technical details not disclosed in the device embodiment of the present disclosure, please refer to the description of the method embodiment of the present disclosure for understanding.
[0149] It should be noted that, in the embodiments of the present disclosure, if the above method is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present disclosure is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, which is stored in a storage medium and includes a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in each embodiment of the present disclosure. The aforementioned storage medium includes: various media that can store program codes, such as a U disk, a mobile hard disk, a read-only memory (ROM), a magnetic disk or an optical disk. In this way, the embodiments of the present disclosure are not limited to any specific hardware, software or firmware, or any combination of hardware, software and firmware.
[0150] An embodiment of the present disclosure provides a computer device, including a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the program, some or all of the steps in the above method are implemented.
[0151] Embodiments of the present disclosure provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements some or all of the steps of the above-described method. The computer-readable storage medium may be a tangible device that retains and stores instructions used by an instruction execution device, and may be a volatile storage medium or a non-volatile storage medium, and may be either transient or non-transient.
[0152] An embodiment of the present disclosure provides a computer program, including computer-readable codes. When the computer-readable codes are executed in a computer device, a processor in the computer device executes some or all of the steps for implementing the above method.
[0153] The present disclosure provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and when the computer program is read and executed by a computer, implements some or all of the steps in the above method. The computer program product can be implemented specifically by hardware, software, or a combination thereof. In some embodiments, the computer program product is specifically embodied as a computer storage medium. In other embodiments, the computer program product is specifically embodied as a software product, such as a software development kit (SDK), etc.
[0154] An embodiment of the present disclosure provides a computer program product, including a computer program or instructions, which implements some or all of the steps in the above method when executed by a processor.
[0155] It should be noted that the descriptions of the various embodiments above tend to emphasize the differences between the embodiments, and reference can be made to the similarities or similarities between them. The descriptions of the above embodiments of the device, storage medium, computer program, and computer program product are similar to the descriptions of the above-mentioned method embodiments and have similar beneficial effects as the method embodiments. For technical details not disclosed in the embodiments of the device, storage medium, computer program, and computer program product disclosed herein, please refer to the description of the method embodiments disclosed herein for understanding.
[0156] It should be noted that FIG5 is a schematic diagram of the hardware entity of a computer device provided in an embodiment of the present disclosure. As shown in FIG5 , the hardware entity of the computer device 600 includes: a processor 601, a communication interface 602, and a memory 603, wherein:
[0157] Processor 601 generally controls the overall operation of computer device 600 .
[0158] The communication interface 602 enables the computer device to communicate with other terminals or servers through a network.
[0159] The memory 603 is configured to store instructions and applications executable by the processor 601. It can also cache data to be processed or processed by the processor 601 and various modules in the computer device 600 (for example, image data, audio data, voice communication data, and video communication data). This can be implemented using flash memory (FLASH) or random access memory (RAM). Data can be transmitted between the processor 601, the communication interface 602, and the memory 603 via the bus 604.
[0160] It should be understood that “one embodiment” or “an embodiment” mentioned throughout the specification means that specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present disclosure. Therefore, “in one embodiment” or “in an embodiment” appearing throughout the specification does not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that in the various embodiments of the present disclosure, the size of the serial numbers of the above-mentioned steps / processes does not mean the order of execution, and the execution order of each step / process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present disclosure. The serial numbers of the embodiments of the present disclosure are for description only and do not represent the advantages and disadvantages of the embodiments.
[0161] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or apparatus comprising the element.
[0162] In the several embodiments provided in the present disclosure, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.
[0163] The units described above as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; they may be located in one place or distributed across multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment. In addition, the functional units in the various embodiments of the present disclosure may all be integrated into one processing unit, or each unit may be separately used as a unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0164] Those skilled in the art will understand that all or part of the steps of implementing the above-mentioned method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above-mentioned method embodiment; and the aforementioned storage medium includes: mobile storage devices, read-only memories (ROM), magnetic disks or optical disks, and other media that can store program codes.
[0165] Alternatively, if the above-mentioned integrated unit of the present disclosure is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present disclosure, or the part that contributes to the relevant technology, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a number of instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the methods described in each embodiment of the present disclosure. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROMs, magnetic disks, or optical disks.
[0166] The above is only an embodiment of the present disclosure, but the scope of protection of the present disclosure is not limited thereto. Any changes or substitutions that can be easily conceived by any technician familiar with this technical field within the technical scope disclosed in this disclosure should be covered by the scope of protection of the present disclosure. Industrial Applicability
[0167] The embodiments of the present disclosure provide a data scheduling method, apparatus, system, device, storage medium, and computer program product based on ray tracing, wherein the data scheduling method based on ray tracing includes: determining a first target storage block in a first memory and a target storage block group in a second memory, wherein the first target storage block and the target storage block group respectively store ray data and block data having a corresponding relationship; reading the ray data from the first target storage block; reading the block data from the target storage block group within two scheduling cycles; wherein the first scheduling cycle and the second scheduling cycle of the two scheduling cycles respectively adopt a write-first method and a read-first method to perform data read scheduling. According to the embodiments of the present disclosure, the read scheduling efficiency of block data can be improved.
Claims
1. A data scheduling method based on ray tracing, the method comprising: Determine a first target storage block in the first storage and a target storage block group in the second storage, wherein the first target storage block and the target storage block group respectively store light data and block data having a corresponding relationship; Reading the light data from the first target storage block; The block data is read from the target storage block group within two scheduling cycles; wherein the first scheduling cycle and the second scheduling cycle of the two scheduling cycles respectively perform data read scheduling in a write priority manner and a read priority manner.
2. The data scheduling method according to claim 1, wherein: The reading the light data from the first target storage block includes: Reading the light data from the first target storage block to a computing unit; The step of reading the block data from the target storage block group within two scheduling cycles includes: Within two scheduling cycles, the block data is read from the target storage block group to the operation unit, so that the operation unit performs an intersection operation on the ray data and the block data.
3. The data scheduling method according to claim 1, wherein: The block data is stored in a second target address in the target storage block group, the second target address corresponds to a plurality of storage blocks in the target storage block group, and the block data includes at least one of the first sub-data and the second sub-data; The step of reading the block data from the target storage block group within two scheduling cycles includes: In the first scheduling cycle, if there is at least one second target storage block to which no data is currently written among the plurality of storage blocks corresponding to the second target address, reading the first sub-data from the at least one second target storage block; During the second scheduling cycle, when there is at least one third target storage block other than the second target storage block in the multiple storage blocks corresponding to the second target address, the at least one third target storage block is read-locked, and the second sub-data is read from the at least one third target storage block.
4. The data scheduling method according to claim 3, wherein: The step of reading the block data from the target storage block group within two scheduling cycles further includes: In the second scheduling cycle, when a fourth target storage block in the target storage block group currently has a data write request and the fourth target storage block is not read-locked, data is written to the fourth target storage block.
5. The data scheduling method according to any one of claims 1 to 4, wherein: The determining of a first target storage block in the first storage and a target storage block group in the second storage comprises: Determine at least one pair of candidate storage blocks and candidate storage block groups from a plurality of storage blocks in the first storage and a plurality of storage block groups in the second storage; wherein each pair of candidate storage blocks and candidate storage block groups respectively stores light data and block data having a corresponding relationship; Determine the target storage block group from each of the candidate storage block groups based on the number of readable storage blocks in each of the candidate storage block groups; A candidate storage block corresponding to the target storage block group is determined as the first target storage block.
6. The data scheduling method according to claim 5, wherein: The step of determining the target storage block group from each of the candidate storage block groups based on the number of readable storage blocks in each of the candidate storage block groups comprises: Determine the number of readable storage blocks in each candidate storage block group; wherein the read / write state of the readable storage block is a readable state; The storage block group having the largest number of readable storage blocks among the candidate storage block groups is determined as the target storage block group.
7. The data scheduling method according to claim 6, wherein: The method further comprises: Acquire the write lock state and the read lock state of each storage block in each candidate storage block group; wherein the write lock state includes one of the following: a first state indicating that data is currently written to the storage block, and a second state indicating that no data is currently written to the storage block; the read lock state includes one of the following: a third state indicating that the storage block is currently read locked, and a fourth state indicating that the storage block is currently not read locked; For each of the storage blocks, when the write lock state of the storage block is the second state and the read lock state of the storage block is the fourth state, it is determined that the read-write state of the storage block is the readable state.
8. The data scheduling method according to claim 5, wherein: The step of determining the target storage block group from each of the candidate storage block groups based on the number of readable storage blocks in each of the candidate storage block groups comprises: Determine a first storage block group having the largest number of readable storage blocks among the candidate storage block groups; In the case that there are multiple first storage block groups, one first storage block group is selected from the first storage block groups as the target storage block group according to a preset selection method.
9. The data scheduling method according to claim 5, wherein: The step of determining at least one pair of candidate storage blocks and candidate storage block groups from the plurality of storage blocks in the first storage and the plurality of storage block groups in the second storage comprises: From the multiple storage blocks in the first memory and the multiple storage block groups in the second memory, determine at least one pair of candidate storage blocks and candidate storage block groups, as well as a first target address corresponding to the candidate storage block in each pair of candidate storage blocks and candidate storage block groups, and a second target address corresponding to the candidate storage block group; wherein, for each pair of candidate storage blocks and candidate storage block groups, the first target address of the candidate storage block and the second target address of the candidate storage block group respectively store corresponding light data and block data.
10. A data scheduling device based on ray tracing, the device comprising: A first determining part is configured to determine a first target storage block in the first memory and a target storage block group in the second memory, wherein the first target storage block and the target storage block group respectively store light data and block data having a corresponding relationship; A first reading part, configured to read the light data from the first target storage block; The second reading part is configured to read the block data from the target storage block group within two scheduling cycles; wherein the first scheduling cycle and the second scheduling cycle of the two scheduling cycles respectively adopt a write priority method and a read priority method to perform data read scheduling.
11. A data scheduling system based on ray tracing, the system comprising: A first memory, used for storing light data; A second memory, used for storing block data; A scheduler, communicatively connected to the first memory and the second memory, for executing the method according to any one of claims 1 to 9.
12. A computer device comprising a memory and a processor, wherein the memory stores a computer program executable on the processor, and the processor implements the steps of the method according to any one of claims 1 to 9 when executing the program.
13. A computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the steps in the method according to any one of claims 1 to 9 are implemented.
14. A computer program product, comprising a computer program or instructions, wherein when the computer program or instructions are executed by a processor, the method according to any one of claims 1 to 9 is implemented.
Citation Information
Patent Citations
Method and device for remaining signal sequence
CN102388359A
Data read-write priority balancing method, system and device and storage medium
CN112416556A
DDR3-based read-write control dynamic scheduling method and storage medium thereof
CN115328822A
Method and apparatus for ray tracing scheduling
CN115640138A
Data scheduling method and device based on ray tracing, equipment and storage medium
CN116049032A
