A grating simulation method, device, electronic device and readable storage medium
By dividing the grating simulation tasks into sub-tasks by the number of layers, and combining parallel computing with local serialization, the problem of large memory consumption in grating simulation is solved, the balance of computing efficiency and resource utilization is achieved, and the overall computing performance of grating simulation is improved.
Patent Information
- Application Number
- CN202510451003.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-11
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2045-04-11
AI Technical Summary
In the existing raster simulation methods, parallel computing has a problem of high memory consumption.
The simulation tasks of the raster structure are divided into sub-simulation tasks according to the number of layers, and the matrix of each sub-simulation task is calculated in parallel, the historical intermediate structure matrix is aggregated in real time, and local serial computing is combined to optimize memory utilization and computing efficiency.
By combining parallel and serial, memory overhead is reduced, cluster computing power is fully utilized, computing efficiency and resource utilization are improved, and computing power and memory allocation are optimized.
Smart Images

Figure CN119989734B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of optical technology, and particularly relates to a grating simulation method, device, electronic device, and readable storage medium. Background Art
[0002] Currently, grating simulation is used to simulate the scattering characteristics of optical elements with periodic structures. The specific process is to set the light parameters, layer the entire measured grating structure, calculate the structure matrix of each layer in parallel, aggregate the structure matrices into a total structure matrix, and calculate the scattering characteristics through the relationship between the incident light field, the scattered light field, and the total structure matrix.
[0003] However, parallel computing has the problem of large memory consumption. Summary of the Invention
[0004] Embodiments of this application provide a grating simulation method, device, electronic device, readable storage medium, and computer program product, which can solve the problem of large memory consumption in parallel computing.
[0005] In a first aspect, embodiments of this application provide a grating simulation method, including:
[0006] Obtain a simulation task of a grating structure;
[0007] Divide the simulation task of the grating structure according to the number of layers of the grating structure to obtain at least two sub-simulation tasks, where each sub-simulation task includes simulation tasks of at least two grating layers;
[0008] During parallel computing of each sub-simulation task, for each sub-simulation task, calculate the matrix of the current grating layer;
[0009] Aggregate the matrix of the current grating layer with the historical intermediate structure matrix to obtain a new intermediate structure matrix, where the historical intermediate structure matrix is the result of aggregating the matrices of historical grating layers, and the historical grating layers include the grating layers before the current grating layer;
[0010] After taking the next grating layer as the current grating layer in the layer sequence, return to execute the step: calculate the matrix of the current grating layer;
[0011] When the sub-simulation task is completed, obtain a sub-structure matrix;
[0012] After obtaining all the sub-structure matrices, aggregate each sub-structure matrix to obtain a total structure matrix.
[0013] In one embodiment, each sub-simulation task includes simulation tasks of at least two consecutive grating layers.
[0014] In one embodiment, aggregating each of the sub-structure matrices to obtain a total structure matrix includes:
[0015] Aggregating each of the sub-structure matrices in reverse layer order to obtain the total structure matrix.
[0016] In one embodiment, the aggregation methods include block aggregation, hierarchical aggregation, and algorithmic aggregation.
[0017] In one embodiment, the grating structure is a double-period grating structure.
[0018] In one embodiment, the sub-structure matrix is a sparse matrix or a dense matrix.
[0019] In a second aspect, an embodiment of the present application provides a grating simulation device, including:
[0020] An acquisition module, configured to acquire a simulation task of a grating structure;
[0021] A simulation module, configured to divide the simulation task of the grating structure according to the number of layers of the grating structure to obtain at least two sub-simulation tasks, where the sub-simulation tasks include simulation tasks of at least two grating layers;
[0022] It is further configured to, during parallel computing of each of the sub-simulation tasks, for each of the sub-simulation tasks, calculate the matrix of the current grating layer; aggregate the matrix of the current grating layer with a historical intermediate structure matrix to obtain a new intermediate structure matrix, where the historical intermediate structure matrix is the result of aggregating the matrices of historical grating layers, and the historical grating layers include the grating layers before the current grating layer; after taking the next grating layer as the current grating layer in layer order, return to execute the step: calculate the matrix of the current grating layer; when the sub-simulation task is completed, obtain a sub-structure matrix;
[0023] It is further configured to, after obtaining all the sub-structure matrices, aggregate each of the sub-structure matrices to obtain a total structure matrix.
[0024] In one embodiment, the simulation module is specifically configured to aggregate each of the sub-structure matrices in reverse layer order to obtain the total structure matrix.
[0025] In a third aspect, an embodiment of the present application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where when the processor executes the computer program, the method described in any one of the above first aspects is implemented.
[0026] Fourthly, an embodiment of the present application provides a computer-readable storage medium storing a computer program, which when executed by a processor, implements the method according to any one of the above first aspects.
[0027] Fifthly, an embodiment of the present application provides a computer program product, which when running on an electronic device, causes the electronic device to execute the method according to any one of the above first aspects.
[0028] The beneficial effects of the embodiments of the present application compared with the prior art are as follows:
[0029] In the embodiment of the present application, by obtaining a simulation task of a grating structure; dividing the simulation task of the grating structure according to the number of layers of the grating structure to obtain at least two sub-simulation tasks, where the sub-simulation task includes a simulation task of at least two grating layers; during parallel computing of each sub-simulation task, for each sub-simulation task, calculating a matrix of the current grating layer; aggregating the matrix of the current grating layer with a historical intermediate structure matrix to obtain a new intermediate structure matrix, where the historical intermediate structure matrix is the result of aggregating matrices of historical grating layers, and the historical grating layers include the grating layers before the current grating layer; after taking the next grating layer as the current grating layer in the layer sequence, returning to execute the steps: calculating the matrix of the current grating layer; when the sub-simulation task is completed, obtaining a sub-structure matrix; after obtaining all sub-structure matrices, aggregating each sub-structure matrix to obtain a total structure matrix, combining parallel computing and serial computing, and adding a local serial method in the global parallel framework to implement matrix calculation and real-time aggregation for each layer, which can achieve real-time aggregation to reduce memory overhead, and at the same time make full use of cluster computing power and accelerate computing, achieve the balance of computing efficiency and resource utilization, and optimize the computing power and memory data allocation of the cluster.
[0030] It can be understood that the beneficial effects of the above second to fifth aspects can refer to the relevant descriptions in the above first aspect, and will not be elaborated here. Description of the Drawings
[0031] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings in the following description are only some embodiments of the present application, and those of ordinary skill in the art can also obtain other drawings based on these drawings without creative efforts.
[0032] Figure 1 is a schematic flowchart of a grating simulation method provided by an embodiment of the present application;
[0033] Figure 2 is a schematic diagram of the steps of a grating simulation method provided by an embodiment of the present application;
[0034] Figure 3 It is a schematic structural diagram of a grating simulation device provided by an embodiment of the present application;
[0035] Figure 4 It is a schematic structural diagram of an electronic device provided by an embodiment of the present application. Detailed implementation manners
[0036] In the following description, for the purpose of illustration rather than limitation, specific details such as specific system structures and technologies are put forward in order to thoroughly understand the embodiments of the present application. However, those skilled in the art should understand that the present application can also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to impede the description of the present application with unnecessary details.
[0037] It should be understood that when used in the specification of the present application and the appended claims, the term "comprising" indicates the presence of the described features, wholes, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components, and / or their combinations.
[0038] It should also be understood that the term " / and" as used in the specification of the present application and the appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0039] As used in the specification of the present application and the appended claims, the term "if" can be interpreted as "when", "once", "in response to determining", or "in response to detecting" according to the context. Similarly, the phrase "if determined" or "if [the described condition or event] is detected" can be interpreted as meaning "once determined", "in response to determining", "once [the described condition or event] is detected", or "in response to detecting [the described condition or event]" according to the context.
[0040] In addition, in the description of the specification of the present application and the appended claims, the terms "first", "second", "third", etc. are only used for distinguishing descriptions and cannot be understood as indicating or implying relative importance.
[0041] References to "one embodiment" or "some embodiments" etc. described in the specification of the present application mean that specific features, structures or characteristics described in connection with that embodiment are included in one or more embodiments of the present application. Thus, statements such as "in one embodiment", "in some embodiments", "in other some embodiments", "in still other embodiments" etc. that appear at different places in this specification are not necessarily all referring to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "comprising", "including", "having" and their variants all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0042] In one embodiment, Figure 1 is a schematic flow chart of a grating simulation method provided by an embodiment of the present application. As Figure 1 shown, the method includes:
[0043] S11: Obtain the simulation task of the grating structure.
[0044] S12: Divide the simulation task of the grating structure according to the number of layers of the grating structure to obtain at least two sub-simulation tasks.
[0045] Among them, the sub-simulation task includes the simulation tasks of at least two grating layers.
[0046] Exemplarily, if the number of layers of the grating structure is 100, the simulation task of 100 layers is divided into 10 sub-simulation tasks, and each sub-simulation task includes the simulation tasks of 10 layers.
[0047] In a possible implementation manner, the sub-simulation task includes the simulation tasks of at least two consecutive grating layers, so that each sub-simulation task is for consecutive grating layers, rather than randomly allocated or in a thread pool manner for grating layer simulation tasks, ensuring that the calculation order of the sub-simulation tasks is consistent with the data dependency, that is, ensuring that the boundaries of the sub-simulation tasks are clear and reducing the data transfer and synchronization overhead brought by the random allocation and thread pool manner.
[0048] Exemplarily, for the simulation task of 100 layers, each sub-simulation task includes the simulation tasks of 10 consecutive layers. The first calculates layers 1-10, the second calculates layers 11-20, and so on.
[0049] S13: During the parallel calculation of each sub-simulation task, for each sub-simulation task, calculate the matrix of the current grating layer.
[0050] In an application, a parallel computing framework and a cluster task scheduler are used to allocate appropriate threads or computing nodes according to sub-simulation tasks, and each sub-simulation task's sub-structure matrix is computed in parallel by each thread or computing node. The number of threads or computing nodes is the same as the number of sub-simulation tasks. For example, for 10 sub-simulation tasks, they can be allocated to 10 threads or computing nodes.
[0051] Among them, the parallel computing framework can be selected according to the computing environment, hardware resources, task scale, and performance requirements. For example: When the parallel computing environment is shared memory, with simple operations and small-scale parallel tasks, choose openMP (Open Multi-Processing). When the parallel computing is distributed memory, for large-scale computing clusters, choose MPI (Message Passing Interface). When the parallel computing is for GPU (Graphics Processing Unit) acceleration and requires high-throughput computing scenarios, choose CUDA (Compute Unified Device Architecture).
[0052] The cluster task scheduling system is responsible for resource allocation and task scheduling. The cluster task scheduling system can be selected according to the cluster scale and task characteristics. For example: When it comes to large-scale cluster task scheduling, flexible configuration, and complex scheduling requirements, choose Slurm (Simple Linux Utility for Resource Management). When it is easy to configure, for medium and small-scale clusters, choose PBS (Portable Batch System). When it is for high-throughput computing tasks and dynamic load balancing, choose HTCondor (High-Throughput Computing Condor). When it is for the scheduling of containerized computing tasks, elastic scaling, and multi-node deployment, choose Kubernetes.
[0053] For each sub-simulation task, within the sub-simulation task, input parameters: wavelength, angle of incidence, polarization state, layer parameters, and select an optical model; then calculate the electromagnetic field distribution and determine the boundary conditions; then construct a matrix and output the matrix.
[0054] S14: Aggregate the matrix of the current grating layer with the historical intermediate structure matrix to obtain a new intermediate structure matrix.
[0055] Among them, the historical intermediate structure matrix is the result of aggregating the matrices of historical grating layers, and the historical grating layers include the grating layers before the current grating layer.
[0056] In an application, within a thread or a computing node, after calculating the matrix of the current raster layer, directly aggregate the matrix with the historical intermediate structure matrix maintained within the thread or the computing node to generate a new intermediate structure matrix, so as not to store the matrix of a single layer during the aggregation process, but to perform real-time aggregation to reduce the storage requirement.
[0057] S15: After taking the next raster layer as the current raster layer in the layer sequence, return to execute step S13: Calculate the matrix of the current raster layer.
[0058] In an application, after the matrix calculation of the current raster layer is completed, select the next raster layer in the layer sequence. At this time, the next raster layer becomes the current raster layer, and execute the steps: Calculate the matrix of the current raster layer, and then aggregate the obtained matrix with the historical intermediate structure matrix maintained within the thread or the computing node to generate a new intermediate structure matrix, and so on, to perform the above steps S13 to S15 for each raster layer.
[0059] S16: When the sub-simulation task is completed, obtain the sub-structure matrix.
[0060] In an application, the thread or the computing node serially calculates the matrices of each layer, completes the sub-simulation task, and obtains a sub-structure matrix.
[0061] Exemplarily, the first thread or computing node calculates layers 1 - 10. The current raster layer is layer 1, calculate the matrix of layer 1, and this matrix serves as the historical intermediate structure matrix. The current raster layer is layer 2, calculate the matrix of layer 2, and aggregate this matrix with the historical intermediate structure matrix to obtain a new intermediate structure matrix (the result of aggregating the matrices of layers 1 and 2). The current raster layer is layer 3, calculate the matrix of layer 3, and aggregate this matrix with the historical intermediate structure matrix (the result of aggregating the matrices of layers 1 and 2) to obtain a new intermediate structure matrix (the result of aggregating the matrices of layers 1 - 3), and so on. After aggregating the matrix of layer 10 with the historical intermediate structure matrix, obtain the sub-structure matrix.
[0062] Please refer to Figure 2 , Figure 2 is a schematic diagram of the steps of the raster simulation method provided by an embodiment of the present application. The raster structure is stratified to obtain n raster layers. Then grouping is performed to obtain sub-simulation tasks, and each sub-simulation task includes the simulation tasks of two consecutive raster layers. Real-time matrix aggregation is performed within the thread or the computing node. After each sub-simulation task is completed, aggregate each sub-structure matrix to obtain the total structure matrix.
[0063] In a possible implementation, the sub-structure matrix is a sparse matrix or a dense matrix. By using sparse matrix storage to reduce memory overhead and reduce the operation complexity, or using dense matrix storage to improve the computing performance.
[0064] In a possible implementation, when the matrix has symmetry, the symmetry is utilized to reduce the storage and computational amount of the matrix.
[0065] By making the substructure matrix a sparse matrix or a dense matrix, or storing the matrix using symmetry, different forms of the structure matrix can be flexibly replaced to adapt to the specific requirements of the algorithm and eliminate redundant calculations.
[0066] S17: After obtaining all the substructure matrices, aggregate the substructure matrices to obtain the total structure matrix.
[0067] In a possible implementation, aggregate the substructure matrices in reverse layer order to obtain the total structure matrix.
[0068] In an application, after each thread or computing node completes the calculation, obtain the substructure matrices of each sub-simulation task, and aggregate the substructure matrices in reverse layer order from the bottom layer to the top layer to generate the total structure matrix.
[0069] In a possible implementation, the aggregation methods include block aggregation, hierarchical aggregation, and algorithmic aggregation. During the aggregation process, a suitable aggregation method can be selected according to the actual situation to aggregate the structure matrix. Among them, when reducing the computational complexity of a single aggregation, select the block aggregation method, divide the matrix into small blocks and aggregate them step by step. When the simulation task has an obvious hierarchical structure, select hierarchical aggregation, first locally aggregate the matrix and then globally aggregate it. When it is necessary to accelerate the aggregation process, select algorithmic aggregation to optimize the aggregation, such as algorithms like high-performance matrix operation libraries or the divide-and-conquer method.
[0070] Through which the substructure matrices can directly participate in the aggregation of the final structure matrix, and aggregating in reverse layer order can improve the overall computational efficiency and system stability.
[0071] In this embodiment, a simulation task of a grating structure is obtained; according to the number of layers of the grating structure, the simulation task of the grating structure is divided to obtain at least two sub-simulation tasks, and the sub-simulation task includes the simulation tasks of at least two grating layers; during the parallel calculation of each sub-simulation task, for each sub-simulation task, the matrix of the current grating layer is calculated; the matrix of the current grating layer is aggregated with the historical intermediate structure matrix to obtain a new intermediate structure matrix, and the historical intermediate structure matrix is the result of the aggregation of the matrices of the historical grating layers, and the historical grating layers include the grating layers before the current grating layer; after taking the next grating layer as the current grating layer in the layer sequence, return to execute the steps: calculate the matrix of the current grating layer; when the sub-simulation task is completed, obtain the sub-structure matrix; after obtaining all the sub-structure matrices, aggregate the sub-structure matrices to obtain the total structure matrix. By combining parallel calculation and serial calculation, and adding a local serial method in the global parallel framework to implement each-layer matrix calculation and real-time aggregation, it can achieve real-time aggregation to reduce memory overhead, and at the same time make full use of the cluster computing power and accelerate the calculation, realizing the balance between calculation efficiency and resource utilization, and optimizing the computing power and memory data allocation of the cluster.
[0072] Please refer to the following table. The following table shows the calculation time and memory occupancy of various solutions in the case of a cluster configured with 5 128-core nodes and 512G of memory for each node:
[0073]
[0074] It can be understood that by using the parallel calculation strategy to parallelly calculate each sub-simulation task, the time required for simulation can be shortened, the performance of the cluster can be exerted in large-scale computing tasks, the overall computing efficiency of grating simulation can be improved, and the overall computing speed can be increased. That is, in the simulation task with large matrix operations, the operation efficiency is optimized through cluster parallel calculation. At the same time, introducing local serial calculation in the calculation of sub-simulation tasks can solve the problem of low efficiency of parallel calculation in the serial calculation framework, further improve the overall computing efficiency of grating simulation, and increase the overall computing speed.
[0075] And by introducing the local serial calculation and the method of layer-by-layer aggregation in the calculation of sub-simulation tasks, after calculating the matrix of each single layer, it is aggregated with the historical intermediate structure matrix, without storing the matrices of all layers, maintaining an independent intermediate structure matrix, effectively reducing the memory occupancy, effectively solving the problems of excessive memory pressure or memory overflow caused by storing the matrices of all layers and solving the problem of system instability caused by insufficient memory, and can also reduce the resource overhead of matrix transmission and synchronization operations under parallel calculation.
[0076] This makes the simulation method applicable to fields such as physical simulation and material design for large-scale matrix calculation and aggregation.
[0077] In one embodiment, the grating structure is a double-period grating structure. Through parallel computing and local serial computing, the stability and task scalability of the computer cluster are improved, while the memory overhead is reduced, providing an efficient and reliable solution for the simulation of complex double-period grating structures, especially grating structures with complex structures and multiple layers.
[0078] It should be noted that the method of the above embodiment is applicable to the simulation of other periodic grating structures, such as planar gratings, diffraction gratings, and photonic crystals, etc.
[0079] It should be understood that the magnitudes of the sequence numbers of the steps in the above embodiments do not mean the order of execution. The order of execution of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present application. And the data collection in the above embodiments is compliant, and its use or implementation does not involve harming the public interest.
[0080] Corresponding to the method described in the above embodiments, for the sake of convenience of description, only the parts related to the embodiments of the present application are shown.
[0081] In one embodiment, Figure 3 is a schematic structural diagram of a grating simulation device provided by an embodiment of the present application. As Figure 3 shown, the device includes:
[0082] An acquisition module 10, configured to acquire a simulation task of a grating structure;
[0083] A simulation module 11, configured to divide the simulation task of the grating structure according to the number of layers of the grating structure to obtain at least two sub-simulation tasks, and the sub-simulation tasks include simulation tasks of at least two grating layers;
[0084] It is also configured to, during the parallel calculation of each sub-simulation task, for each sub-simulation task, calculate the matrix of the current grating layer; aggregate the matrix of the current grating layer with the historical intermediate structure matrix to obtain a new intermediate structure matrix, and the historical intermediate structure matrix is the result of the aggregation of the matrices of the historical grating layers, and the historical grating layers include the grating layers before the current grating layer; after taking the next grating layer as the current grating layer in accordance with the layer sequence, return to execute the step: calculate the matrix of the current grating layer; when the sub-simulation task is completed, obtain a sub-structure matrix;
[0085] It is also configured to, after obtaining all the sub-structure matrices, aggregate the sub-structure matrices to obtain a total structure matrix.
[0086] In one embodiment, the simulation module is specifically configured to aggregate the sub-structure matrices in reverse layer order to obtain a total structure matrix.
[0087] Figure 4 is a schematic structural diagram of an electronic device provided by an embodiment of the present application. AsFigure 4 As shown, the electronic device 2 of this embodiment includes: at least one processor 20 ( Figure 4 only one is shown in the figure), a memory 21, and a computer program 22 stored in the memory 21 and operable on the at least one processor 20. When the processor 20 executes the computer program 22, the steps in any of the above method embodiments are implemented.
[0088] The electronic device 2 may be a computing device such as a desktop computer, a notebook, a palm computer, and a cloud server. The electronic device 2 may include, but is not limited to, a processor 20 and a memory 21. Those skilled in the art can understand that Figure 4 merely examples of the electronic device 2, which do not constitute a limitation on the electronic device 2, and may include more or fewer components than shown in the figure, or combine some components, or different components. For example, it may also include input / output devices, network access devices, etc.
[0089] The processor 20 may be a central processing unit (CPU), and the processor 20 may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0090] In some embodiments, the memory 21 may be an internal storage unit of the electronic device 2, such as the hard disk or memory of the electronic device 2. In other embodiments, the memory 21 may also be an external storage device of the electronic device 2, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 2. Further, the memory 21 may also include both the internal storage unit and the external storage device of the electronic device 2. The memory 21 is used to store an operating system, application programs, a boot loader, data, and other programs, such as the program code of the computer program. The memory 21 may also be used to temporarily store data that has been output or will be output.
[0091] It should be noted that for the information interaction, execution process, etc. between the above-mentioned devices / units, since they are based on the same concept as the method embodiments of the present application, for their specific functions and the technical effects brought about, reference can be specifically made to the method embodiment part, and details will not be elaborated here.
[0092] Those skilled in the art can clearly understand that for the convenience and brevity of description, only the above-mentioned division of each functional unit and module is used as an example for illustration. In actual applications, the above-mentioned functions can be allocated to different functional units and modules according to needs, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above. Each functional unit and module in the embodiments can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of a software functional unit. In addition, the specific names of each functional unit and module are only for the convenience of mutual distinction and do not limit the protection scope of the present application. The specific working process of the units and modules in the above system can refer to the corresponding process in the foregoing method embodiments, and details will not be elaborated here.
[0093] The embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps in each of the above method embodiments can be implemented.
[0094] The embodiment of the present application provides a computer program product. When the computer program product runs on an electronic device, the electronic device can execute the steps in each of the above method embodiments when executed.
[0095] When the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, to implement all or part of the processes in the above method embodiments of this application, a computer program can be used to instruct relevant hardware to complete. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, the steps of the above method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in the form of source code, object code, executable file or some intermediate form, etc. The computer-readable medium can at least include: any entity or device that can carry the computer program code to the photographing device / terminal device, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electrical carrier signal, telecommunication signal, and software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disc, etc. In some cases, the computer-readable medium may not be an electrical carrier signal and a telecommunication signal.
[0096] In the above embodiments, the descriptions of the respective embodiments have their own focuses. For the parts not detailed or recorded in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0097] Those of ordinary skill in the art can realize that the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.
[0098] In the embodiments provided in this application, it should be understood that the disclosed device / network device and method can be implemented in other ways. For example, the device / network device embodiments described above are merely illustrative. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection to each other can be through some interfaces. The indirect coupling or communication connection of the device or unit can be in an electrical, mechanical or other form.
[0099] The unit described as a separation component may or may not be physically separated. The component displayed as a unit may or may not be a physical unit, that is, it may be located in one place or distributed across multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0100] The above embodiments are only used to illustrate the technical solutions of the present application, not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A grating simulation method, characterized in that, including: Obtaining a simulation task of a grating structure; Dividing the simulation task of the grating structure according to the number of layers of the grating structure to obtain at least two sub-simulation tasks, where the sub-simulation task includes simulation tasks of at least two grating layers; During parallel computing of each of the sub-simulation tasks, for each of the sub-simulation tasks, calculating a matrix of the current grating layer; Aggregating the matrix of the current grating layer with a historical intermediate structure matrix to obtain a new intermediate structure matrix, where the historical intermediate structure matrix is the result of aggregating matrices of historical grating layers, and the historical grating layers include the grating layers before the current grating layer; After taking the next grating layer as the current grating layer in the layer sequence, returning to execute the step: calculating a matrix of the current grating layer; When the sub-simulation task is completed, obtaining a sub-structure matrix, where the sub-structure matrix is a sparse matrix or a dense matrix; After obtaining all the sub-structure matrices, aggregating each of the sub-structure matrices in reverse layer order to obtain a total structure matrix.
2. The method according to claim 1, wherein The sub-simulation task includes simulation tasks of at least two consecutive grating layers.
3. The method according to claim 1, characterized in that, The aggregation methods include block aggregation, hierarchical aggregation, and algorithm aggregation.
4. The method according to any one of claims 1 to 3, characterized in that, The grating structure is a double-period grating structure.
5. A grating simulation device, characterized in that, including: An obtaining module, configured to obtain a simulation task of a grating structure; A simulation module, configured to divide the simulation task of the grating structure according to the number of layers of the grating structure to obtain at least two sub-simulation tasks, where the sub-simulation task includes simulation tasks of at least two grating layers; It is also configured to, during parallel computing of each of the sub-simulation tasks, for each of the sub-simulation tasks, calculate a matrix of the current grating layer; aggregate the matrix of the current grating layer with a historical intermediate structure matrix to obtain a new intermediate structure matrix, where the historical intermediate structure matrix is the result of aggregating matrices of historical grating layers, and the historical grating layers include the grating layers before the current grating layer; After taking the next grating layer as the current grating layer in the layer sequence, returning to execute the step: calculating a matrix of the current grating layer; when the sub-simulation task is completed, obtaining a sub-structure matrix, where the sub-structure matrix is a sparse matrix or a dense matrix; It is also configured to, after obtaining all the sub-structure matrices, aggregate each of the sub-structure matrices in reverse layer order to obtain a total structure matrix.
6. An electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method according to any one of claims 1 to 4.
7. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Simulating and routing method of communication between component models and concurrent transaction level simulation system
CN102761473A
Accelerated simulation method of gradient period polarization holographic grating and related device
CN119493270A