Grating simulation method and electronic equipment
By determining the target position of the approximate condition in the grating simulation area for simulation operations, and calculating the simulation results of other positions using the approximate function, the problem of low computing efficiency in large-size grating simulation is solved, and more efficient grating simulation is achieved.
Patent Information
- Application Number
- CN202510465668.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-15
- Publication Date
- 2025-08-22
- Estimated Expiration
- 2045-04-15
AI Technical Summary
The existing grating simulation algorithms have a large amount of calculation during large-size grating simulation, resulting in low computing efficiency.
By determining the target position that meets the approximate conditions in the target simulation area of the grating, the grating simulation model is used to perform simulation operations, and the simulation results of other positions are calculated through the approximation function, the direct simulation operations for other positions are reduced.
The calculation amount during grating simulation is significantly reduced and the calculation efficiency of grating simulation is improved.
Smart Images

Figure CN119989830B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application belong to the field of computer technology, and in particular, relate to a grating simulation method and electronic equipment. Background Art
[0002] Gratings, as important optical components, are widely used in fields such as spectral analysis, optical communications, and precision measurement. Their structures typically consist of a large number of parallel slits or reflective surfaces of equal width and spacing. In practical applications, the effect of a grating on incident light depends on the complex electromagnetic field distribution within it.
[0003] Since the electromagnetic field distribution in the grating structure is complex and non-uniform, the processing results of incident light at different positions on the same grating may be different. Therefore, in order to accurately simulate the effect of the grating on light, the existing grating simulation algorithm needs to perform simulation operations on each position on the grating according to the characteristic parameters of each position on the grating to obtain the simulation results corresponding to each position. The overall simulation results of the grating are then determined based on the simulation results of all positions. However, when the size of the grating to be simulated is large, the number of positions that need to be calculated will increase significantly, which causes the time required for the grating simulation operation to increase sharply, thereby reducing the efficiency of the grating simulation operation. Summary of the Invention
[0004] In view of this, embodiments of the present application provide a grating simulation method and electronic device to improve the computational efficiency of grating simulation.
[0005] A first aspect of an embodiment of the present application provides a grating simulation method, comprising:
[0006] In response to the simulation instruction, a plurality of target positions are determined from the target simulation area of the grating; the electromagnetic relationship of the light field at the target positions satisfies the approximation condition;
[0007] Inputting a first characteristic parameter of the target position into a grating simulation model to determine a first simulation result corresponding to the target position;
[0008] Inputting first characteristic parameters of other positions in the target simulation area and the first simulation results corresponding to the target position into an approximate function to determine second simulation results of the other positions; the second characteristic parameters of the other positions and the second characteristic parameters of the target position satisfy an association condition; the second characteristic parameters include at least one of a position parameter, a field characteristic quantity of the light field, and an optical parameter;
[0009] A target simulation result corresponding to the target simulation area is generated according to the first simulation result and the second simulation result.
[0010] In a possible implementation manner of the first aspect, determining a plurality of target positions from a target simulation area of the grating includes:
[0011] Performing a first division operation on the target simulation area to obtain a plurality of sub-areas;
[0012] Determining whether the electromagnetic relationship of the light field at the center point of the sub-region satisfies the approximate condition; the approximate condition is determined based on the multiple sub-regions obtained by the first division;
[0013] If the electromagnetic relationship of the light field at the center point does not meet the approximate condition, the division operation is continued on the sub-area until the electromagnetic relationship of the light field at the center point meets the approximate condition, and the division operation is stopped, and the center point where the electromagnetic relationship meets the approximate condition is determined as the target position.
[0014] In a possible implementation manner of the first aspect, the approximation condition includes an approximation threshold;
[0015] The determining whether the electromagnetic relationship of the light field at the center point of the sub-region satisfies the approximation condition includes:
[0016] Acquire a first magnetic field function and a first electric field function of the light field at the center point of the sub-region;
[0017] determining a first electromagnetic function of the light field at the center point according to a proportional relationship between the first magnetic field function and the first electric field function;
[0018] If the rate of change of the first electromagnetic function is greater than or equal to the approximation threshold, determining that the electromagnetic relationship of the light field at the center point does not satisfy the approximation condition;
[0019] If the rate of change of the first electromagnetic function is less than the approximation threshold, it is determined that the electromagnetic relationship of the light field at the center point meets the approximation condition.
[0020] In a possible implementation manner of the first aspect, after determining the first electromagnetic function of the light field at the center point according to the proportional relationship between the first magnetic field function and the first electric field function, the method further includes:
[0021] performing a partial derivative operation on the first electromagnetic function to determine a first transformation matrix corresponding to the first electromagnetic function;
[0022] The change rate of the first electromagnetic function is calculated according to the sum of squares of a plurality of elements in the first conversion matrix.
[0023] In a possible implementation manner of the first aspect, after performing the initial division operation on the target simulation area to obtain multiple sub-areas, the method further includes:
[0024] Obtaining a second magnetic field function and a second electric field function of the light field corresponding to the center point in the sub-area obtained by the first division;
[0025] determining a second electromagnetic function according to a proportional relationship between the second magnetic field function and the second electric field function;
[0026] The approximate threshold is calculated based on a plurality of maximum values of the rate of change of the second electromagnetic functions and a constant coefficient.
[0027] In a possible implementation of the first aspect, the first division operation is performed on the target simulation area to obtain multiple sub-areas, including:
[0028] Get the division parameters corresponding to the X, Y, and Z directions in the three-dimensional coordinate system respectively;
[0029] The target simulation area is initially divided in the X, Y, and Z directions according to the division parameters to obtain a plurality of sub-areas.
[0030] In a possible implementation manner of the first aspect, the division parameters in the X, Y, and Z directions are the same.
[0031] In a possible implementation of the first aspect, the first division operation is performed on the target simulation area to obtain multiple sub-areas, including:
[0032] The target shape information and target simulation area corresponding to the grating are input into a preset area division model for a first division operation to obtain multiple sub-areas; the area division model is trained by the training shape information, the training simulation area and multiple expected sub-areas.
[0033] In a possible implementation of the first aspect, inputting the first characteristic parameters of other positions in the target simulation area and the first simulation results corresponding to the target positions into an approximate function to determine the second simulation results of the other positions includes:
[0034] Constructing a diagonal matrix according to the first characteristic parameter of the target position and the first characteristic parameters of the other positions;
[0035] The second simulation results at the other positions are calculated according to the multiple diagonal elements in the diagonal matrix and the first simulation result.
[0036] A second aspect of an embodiment of the present application provides a grating simulation device, comprising:
[0037] A target position determination module is configured to determine a plurality of target positions in a target simulation area of the grating in response to a simulation instruction; the electromagnetic relationship of the light field at the target positions satisfies an approximate condition;
[0038] A simulation operation module, configured to input the first characteristic parameter of the target position into a grating simulation model to determine a first simulation result corresponding to the target position;
[0039] an approximate calculation module, configured to input first characteristic parameters of other positions in the target simulation area and a first simulation result corresponding to the target position into an approximate function to determine a second simulation result of the other positions; the second characteristic parameters of the other positions and the second characteristic parameters of the target position satisfy an association condition; the second characteristic parameters include at least one of a position parameter, a field characteristic quantity of the light field, and an optical parameter;
[0040] The simulation result generating module is used to generate a target simulation result corresponding to the target simulation area according to the first simulation result and the second simulation result.
[0041] A third aspect of an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the grating simulation method as described in the first aspect above is implemented.
[0042] A fourth aspect of an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the grating simulation method as described in the first aspect above is implemented.
[0043] A fifth aspect of the embodiments of the present application provides a computer program product, which, when executed on a computer, enables the computer to execute the grating simulation method described in the first aspect.
[0044] Compared with the prior art, the embodiments of the present application have the following advantages:
[0045] In an embodiment of the present application, the electronic device can determine multiple target positions from the target simulation area of the grating in response to a simulation instruction; wherein the electromagnetic relationship of the target position satisfies the approximate condition; after determining the target position, the electronic device can perform simulation operation on the target position through the grating simulation model to obtain a first simulation result of the target position; then, the electronic device can perform approximate calculation on other positions in the target simulation area based on the first simulation result and the approximate function to obtain a second simulation result for the other positions; finally, the electronic device can generate a target simulation result corresponding to the target simulation area based on the first simulation result and the second simulation result. Through the method provided by this embodiment, since the electronic device does not need to perform simulation operation on other positions in the target simulation area through the grating simulation model, but can reuse the first simulation result of the target position for approximate operation, and the amount of operation of the approximate function is much smaller than the amount of operation of the grating simulation model, the method provided by this embodiment can significantly reduce the amount of operation in the grating simulation process, thereby reducing the time required for the grating simulation operation, and thereby improving the operation efficiency of the grating simulation. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] To more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the embodiments or descriptions of the prior art. Obviously, the drawings described below are only some embodiments of the present application, and those skilled in the art can derive other drawings based on these drawings without inventive effort.
[0047] Figure 1 is a schematic diagram of a grating simulation method provided in an embodiment of the present application;
[0048] Figure 2 is a schematic diagram of another grating simulation method provided in an embodiment of the present application;
[0049] Figure 3 This is a flow chart of a grating simulation provided by an embodiment of the present application;
[0050] Figure 4 is a schematic diagram of a grating simulation device provided in an embodiment of the present application;
[0051] Figure 5 This is a schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0052] In the following description, specific details such as specific system structures and technologies are provided for the purpose of illustration rather than limitation to facilitate a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid obstructing the description of the present application with unnecessary details.
[0053] A grating is an optical element composed of a large number of parallel slits or notches of equal width and spacing. It is widely used in a variety of fields, including spectral analysis, optical communications, and precision measurement. Its structure typically consists of a large number of parallel slits or reflective surfaces of equal width and spacing. Because grating performance, such as diffraction efficiency and spectral resolution, is closely related to the distribution of the electromagnetic field within the grating, the grating's effect on incident light depends on the complex electromagnetic field distribution within it.
[0054] Grating simulation refers to the process of simulating and analyzing the optical properties and related physical phenomena of a grating using computer technology and related numerical calculation methods. Since the electromagnetic field distribution in the grating structure is complex and non-uniform, the electric and magnetic field strengths, phases and other characteristics at different positions may be different, and the Maxwell equations are usually required in the grating simulation process. However, when solving the Maxwell equations, certain boundary conditions and continuity conditions of the electromagnetic field need to be met. In the grating structure, these conditions may have different manifestations at different positions. Therefore, in existing grating simulation technology, it is usually necessary to simulate and calculate each position in the target simulation area separately to obtain the overall simulation results of the target simulation area. For example, for each position in the target simulation area, the incident light processing results corresponding to each position are calculated separately to obtain the outgoing light corresponding to each position, and based on the outgoing light of all positions in the target simulation area, the outgoing light field corresponding to the target simulation area is generated.
[0055] However, when the target simulation area of the simulation operation is large, the number of positions that need to be simulated will also increase significantly. Therefore, the overall time required for the grating simulation operation will also increase sharply, resulting in low computational efficiency of the grating simulation operation. In view of this, an embodiment of the present application provides a grating simulation method. Through the method provided by this embodiment, the electronic device only needs to perform simulation operations on part of the positions in the target simulation area, that is, the target positions, through the grating simulation model. For other positions in the target simulation area, the electronic device can reuse the first simulation result of the target position for approximate operations to obtain second simulation results corresponding to other positions. Therefore, the method provided by this embodiment can reduce the amount of computation of the grating simulation operation, thereby reducing the computational time of the grating simulation operation and improving computational efficiency.
[0056] The method provided in the embodiment of the present application can be applied to any field that requires grating simulation operations, such as optical simulation, computer graphics, astronomy, physical simulation, and optical engineering. Specifically, in the field of optical simulation, when R&D personnel need to simulate grating and beam propagation, such as in the design process of optical design, laser system design, optical detector design, etc., R&D personnel can perform grating simulation operations through the method provided in this embodiment. In the field of computer graphics, R&D personnel can perform 3D graphics rendering of gratings through the method provided in this embodiment to improve the computing speed of large-scale rendering tasks. In the field of astronomy, when R&D personnel need to simulate and analyze gratings in astronomical image processing, R&D personnel can perform simulation operations through the method provided in this embodiment. In physical simulation: used for light field simulation in the fields of physical optics, quantum mechanics, etc. In the field of optical engineering, the method provided in the embodiment of the present application can be applied to grating simulation operations in engineering such as optical fiber communications and laser devices.
[0057] The technical solution of this application is described below through specific embodiments.
[0058] Reference Figure 1 , shows a schematic diagram of a grating simulation method provided by an embodiment of the present application. This method can be applied to any electronic device capable of performing grating simulation operations, such as a computer, mobile phone, tablet computer, server, etc. The above-mentioned grating simulation method may specifically include the following steps:
[0059] S101 , in response to a simulation instruction, determining a plurality of target positions from a target simulation area of a grating.
[0060] In this embodiment, when the user needs to perform simulation operations on the grating, the user can initiate a simulation instruction to the electronic device. The simulation instruction initiated by the user may include information such as the target simulation area of the grating, the optical parameters corresponding to each position in the target simulation area, and the target shape information corresponding to the grating. After receiving the simulation instruction initiated by the user, the electronic device can respond to the simulation instruction and determine multiple target positions from the target simulation area of the grating. The target position may be an area in the target simulation area where the electromagnetic relationship of the light field meets the approximate condition. The electromagnetic relationship of the light field may be the proportional relationship between the electric field and the magnetic field in the light field at a certain position. The approximate condition may be a condition for judging whether the electric field and the magnetic field of the light field at a certain position in the target simulation area are similar.
[0061] Specifically, the light field corresponding to a certain position in the target simulation area can be the incident light field, the outgoing light field corresponding to the position, and the internal light field at the position when the light passes through the inside of the grating. When the electronic device determines the electromagnetic relationship, the specific light field used can be determined according to the purpose of the current simulation operation. For example, when the purpose of the simulation operation is to simulate and calculate the outgoing light field based on the incident light field and the known optical parameters of the grating, the electronic device can execute the method provided in the embodiment of the present application based on the electromagnetic relationship, magnetic field function and electric field function of the incident light field. When the purpose of the simulation operation is to perform simulation operations based on the incident light field and the outgoing light field to obtain the reflection matrix of the target simulation area, the electronic device can simultaneously execute the method provided in the embodiment of the present application based on the electromagnetic relationship, magnetic field function and electric field function of the incident light field and the outgoing light field.
[0062] In one possible implementation, after determining the target simulation area, the electronic device may determine whether the electromagnetic relationship of the light field at each position in the target simulation area satisfies the approximation condition. That is, the electronic device may obtain the electromagnetic relationship of the light field at each position in the target simulation area one by one, and determine whether the obtained electromagnetic relationship satisfies the approximation condition one by one. If the electronic device determines that the electromagnetic relationship of the light field at a certain position satisfies the approximation condition, the electronic device may identify the position as the target position. If the electronic device determines that the electromagnetic relationship of the light field at a certain position does not satisfy the approximation condition, the electronic device may not identify the position as the target position.
[0063] S102: Input the first characteristic parameter of the target position into the grating simulation model to determine a first simulation result corresponding to the target position.
[0064] In this embodiment, after determining the target position, the electronic device can input the first characteristic parameter of the target position into the grating simulation model to calculate the first simulation result corresponding to the target position through the grating simulation model. It should be noted that the grating simulation model can be any model known to those skilled in the art, such as a coupled mode theory model, a transfer matrix model, a Fourier modal method model, a finite element method model, etc., which can perform grating simulation operations. The embodiments of this application are not intended to specifically limit the grating simulation model. The first characteristic parameter of the target position can include at least one of the following: an optical parameter corresponding to the target position, a field characteristic quantity of the incident light field at the target position, and a field characteristic quantity of the outgoing light field at the target position. The optical parameter of a position on the grating can be a physical quantity used to describe the various effects and response characteristics of the grating on light at that position. Specifically, the optical parameter can include at least one of physical quantities such as refractive index, absorption coefficient, scattering coefficient, grating constant, extinction ratio, reflectivity, and transmittance. The field characteristic quantity of the light field can be a physical quantity used to describe various physical properties and characteristics of the light field. Specifically, the field characteristic quantity may include at least one of the physical quantities of the light field, such as the magnetic field function, electric field function, light intensity, phase, polarization state, frequency, and wavelength.
[0065] The first characteristic parameter input by the electronic device to the grating simulation model may depend on the purpose of the current grating simulation. For example, when the purpose of the simulation operation is to determine the reflection matrix of the target area in a certain polarization direction, the first characteristic parameter input by the electronic device to the simulation model may include the field characteristic quantity corresponding to the incident light field at the target position and the field characteristic quantity corresponding to the outgoing light field at the target position. For another example, when the purpose of the simulation operation is to calculate the modulation effect of the grating on the incident light, the first characteristic parameter input by the electronic device to the grating simulation model may include the refractive index, reflectivity and transmittance of the target position. When the purpose of the simulation operation is to determine the outgoing light field after processing of the target simulation area, the first characteristic parameter input by the electronic device to the grating simulation model may include the field characteristic quantity of the incident light field at the target position and the optical parameters of the target position.
[0066] S103 , inputting the first characteristic parameters of other positions in the target simulation area and the first simulation results corresponding to the target position into an approximate function to determine second simulation results of the other positions.
[0067] In this embodiment, after determining the first simulation result corresponding to the target location, the electronic device can determine other locations associated with the target location based on the second characteristic parameter, and perform approximate calculations on the other locations associated with the target location based on the first simulation result for the target location to obtain second simulation results corresponding to the other locations. Specifically, the other locations associated with a target location can be locations within the target simulation area where the second characteristic parameter satisfies an association condition with the second characteristic parameter of the target location. The second characteristic parameter can include at least one of a position parameter, a field characteristic quantity of the light field, and an optical parameter.
[0068] In one possible implementation, for a position other than the target position in the target simulation area, if the electronic device determines that any one or more of the position parameters, field characteristic quantities of the light field, and optical parameters of the position meet the association conditions with a target position, then the electronic device can determine that the position is another position associated with the current target position.
[0069] Specifically, for a position other than the target position in the target simulation area, if the electronic device determines that the distance between the position and a target position is less than or equal to a first threshold, the electronic device can determine that the position parameters of the position and the position parameters of the current target position meet the association condition. For a position other than the target position in the target simulation area, if the electronic device determines that the similarity between the field characteristic quantity of the light field at the position and the field characteristic quantity of the light field at a target position is less than or equal to a second threshold, the electronic device can determine that the field characteristic quantity of the light field at the position and the field characteristic quantity of the light field at the current target position meet the association condition. For a position other than the target position in the target simulation area, if the electronic device determines that the similarity between the optical parameters of the position and the optical parameters of a target position is less than or equal to a second threshold, the electronic device can determine that the optical parameters of the position and the optical parameters of the current target position meet the association condition.
[0070] In one possible implementation, the process of the electronic device calculating the second simulation result using an approximate function can be described as follows. After obtaining the first simulation result corresponding to the target position, the electronic device can construct a diagonal matrix based on the first characteristic parameter of the target position and the first characteristic parameter of another position associated with the target position. After constructing the diagonal matrix, the electronic device can calculate the second simulation result corresponding to the other position based on multiple diagonal elements in the diagonal matrix and the first simulation result.
[0071] In a possible implementation, the approximate function may be specifically as follows:
[0072]
[0073] in, It may be a second simulation result corresponding to some other position; It may be a first simulation result corresponding to the target position associated with the other position; It can be expressed as a diagonalization operation on the matrix M; It can represent the first characteristic parameter corresponding to the other position; A first characteristic parameter corresponding to the target position associated with the other position may be represented; Can represent matrices The element in the i-th row and j-th column of the matrix; the f function can represent a function that operates on the elements of the matrix, and the f function can be experimentally fitted by R&D personnel. For example, when hour, ,in, It can be an approximate coefficient set by R&D personnel based on experiments; The diagonal matrix A of matrix A can be represented ` In , the element in row i and column i; The diagonal matrix A of matrix A can be represented ` In , the element in row j and column j; It can represent the element in the i-th row and j-th column of matrix A.
[0074] In one possible implementation, the approximate function may be a linear function. After calculating the first simulation result corresponding to the target position, the electronic device may input the first simulation result and first characteristic parameters corresponding to other positions into a preset linear function, and use the linear function to calculate second simulation results corresponding to other positions. The coefficients in the linear function may be determined by researchers based on experiments.
[0075] S104: Generate a target simulation result corresponding to the target simulation area according to the first simulation result and the second simulation result.
[0076] In this embodiment, after determining the first simulation results of all target positions in the target simulation area and the second simulation results of all other positions, the electronic device can generate a target simulation result corresponding to the target simulation area based on all currently calculated first simulation results and second simulation results.
[0077] With the method provided by this embodiment, the electronic device can approximate the second simulation results for other locations in the target simulation area based on the first simulation results for the target location. Therefore, only some locations in the target simulation area need to be simulated using the grating simulation model. Furthermore, because the computational complexity of the approximation function is much smaller than that of the grating simulation model, the method provided by this embodiment can reduce the time required for the electronic device to perform simulation calculations on the target simulation area, thereby improving the computational efficiency of the grating simulation calculations.
[0078] Figure 2 FIG2 shows a specific implementation flow chart of a grating simulation method S101 provided in the second embodiment of the present application. Figure 2 , compared to Figure 1 In the embodiment, the grating simulation method provided in this embodiment includes S101 and S201 to S203, which are described in detail as follows:
[0079] S201: Perform an initial division operation on the target simulation area to obtain multiple sub-areas.
[0080] In this embodiment, after receiving the simulation instruction initiated by the user, the electronic device may perform an initial division operation on the target simulation area, dividing the target simulation area into a plurality of sub-areas.
[0081] In one possible implementation, in response to a simulation instruction initiated by a user, the electronic device can respectively obtain the division parameters corresponding to the X direction, the Y direction, and the Z direction in the three-dimensional coordinate system. The division parameters corresponding to each direction in the three-dimensional coordinate system can be pre-set by the R&D personnel, or can be obtained by the electronic device by querying the database based on the target shape information of the grating. After obtaining the division parameters, the electronic device can perform the initial regional division of the target simulation area in the X direction, Y direction, and Z direction of the three-dimensional coordinate system according to the division parameters to obtain multiple sub-areas.
[0082] Specifically, the division parameters obtained by the electronic device in the X direction, Y direction, and Z direction can all be the same. Exemplarily, the division parameter can be 10 nm. When the division parameters in the three directions are all the same, the electronic device can divide the target simulation area into multiple sub-areas. Exemplarily, when the electronic device divides the target simulation area into three equal parts, the electronic device can obtain three sub-areas after the first division.
[0083] In one possible implementation, the electronic device may, in response to a simulation instruction, input the target shape information corresponding to the grating and the target simulation area into a preset region partitioning model for an initial partitioning operation, thereby obtaining a plurality of sub-regions. It should be noted that the region partitioning model may be any machine learning model known to those skilled in the art, and the embodiments of this application are not intended to be specifically limited to the region partitioning model.
[0084] Before performing the initial segmentation using the region segmentation model, the electronic device may also obtain a model to be trained and a training dataset input by the user. The training dataset may include training shape information, a training simulation area, and multiple desired sub-areas. The electronic device may train the model to be trained using the training dataset and determine the model to be trained when it meets the training stop condition as the region segmentation model. Specifically, the electronic device may input the training shape information and training simulation area from the training dataset into the model to be trained to generate multiple initial sub-areas. The electronic device may then calculate the loss value between the initial sub-areas and the desired sub-areas based on a preset loss function and determine whether the calculated loss value is less than or equal to a loss threshold. If the electronic device determines that the loss value is greater than the loss threshold, the electronic device may update the model to be trained based on the loss value and regenerate the initial sub-areas using the updated model to be trained until the loss value is less than or equal to the loss threshold. If the electronic device determines that the loss value is less than or equal to the loss threshold, the electronic device may determine that the current model to be trained meets the training stop condition and determine the current model to be trained as the region segmentation model for performing the initial segmentation operation.
[0085] S202: Determine whether the electromagnetic relationship of the light field corresponding to the center point of the sub-region meets the approximation condition.
[0086] In this embodiment, after dividing the sub-regions into a plurality of sub-regions, the electronic device may respectively determine whether the corresponding electromagnetic relationship of the light field of the center point of each sub-region satisfies the approximation condition.
[0087] In one possible implementation, for any sub-area obtained by the initial division, if the electronic device determines that the corresponding electromagnetic relationship of the light field of the center point of the sub-area meets the approximate condition, the electronic device may not further divide the current sub-area, and identify the center points corresponding to each of the current sub-areas as the target positions corresponding to the target simulation area.
[0088] In one possible implementation, after performing the first division operation to obtain multiple sub-areas, the electronic device can determine whether the center point meets the approximation condition by judging whether the rate of change of the electromagnetic function of the light field at the center point is less than an approximation threshold.
[0089] Specifically, after each division operation is performed, the electronic device can obtain the first magnetic field function and the first electric field function of the light field corresponding to the center point of the sub-region obtained by the current division. It should be noted that since the electronic device can determine whether the light field at the center point meets the approximation condition after each division of the sub-region, the sub-region can be the sub-region obtained by the electronic device through the first division operation, or the sub-region obtained by the electronic device through subsequent division operations. The first magnetic field function can represent the magnetic field function of the light field corresponding to the center point of the sub-region obtained through the first division operation, or it can represent the magnetic field function of the light field corresponding to the center point of the sub-region obtained through subsequent division operations; the first electric field function can represent the electric field function of the light field corresponding to the center point of the sub-region obtained through the first division operation, or it can represent the electric field function of the light field corresponding to the center point of the sub-region obtained through subsequent division operations. After obtaining the first magnetic field function and the first electric field function of any sub-region, the electronic device can determine the first electromagnetic function of the light field corresponding to the center point of the sub-region based on the proportional relationship between the first magnetic field function and the first electric field function.
[0090] Specifically, when the first magnetic field function is J N (r, x), the first electric field function is E N (r, x), the proportional relationship between the first magnetic field function and the first electric field function can be expressed as E N (r,x) = Q N (r,x)J N (r,x),Q N (r, x) can be a first electromagnetic function. Among them, r can be a spatial vector, N can be a given Fourier expansion order, and x can be an independent variable. After obtaining the first electromagnetic function, the electronic device can calculate the rate of change of the first electromagnetic function. Then, the electronic device can determine whether the calculated rate of change is less than the approximation threshold. For the rate of change of the first electromagnetic function of the light field corresponding to the center point of any sub-area, if the electronic device determines that the rate of change is less than the approximation threshold, the electronic device can determine that the center point meets the approximation condition. If the electronic device determines that the rate of change is greater than or equal to the approximation threshold, the electronic device can determine that the center point does not meet the approximation condition.
[0091] In one possible implementation, the electronic device may construct a Hessian matrix corresponding to the first electromagnetic function, perform a partial derivative operation on the first electromagnetic function, and generate a first transformation matrix corresponding to the first electromagnetic function. The electronic device may then calculate the rate of change of the first electromagnetic function based on the sum of the squares of multiple elements in the first transformation matrix.
[0092] Specifically, the formula for calculating the rate of change of the electromagnetic function by the electronic device can be shown as follows:
[0093]
[0094] in, It can represent the rate of change of the first electromagnetic function corresponding to the light field at the center point of the i-th sub-region; i It can represent the first transformation matrix corresponding to the first electromagnetic function of the light field at the center point in the i-th sub-region; It can be expressed as calculating the Frobenius norm of the matrix H1, that is, calculating the sum of the squares of all elements in the matrix H1 and performing a square root operation on the square sum.
[0095] In a possible implementation, after determining the first electromagnetic function, the electronic device may further determine the change rate corresponding to the first electromagnetic function by calculating a gradient function of the first electromagnetic function.
[0096] In one possible implementation, before determining whether the light field at the center point of a subregion satisfies the approximation condition, the electronic device may first determine an approximation threshold based on the multiple subregions obtained from the initial division. For the multiple subregions obtained from the initial division, the electronic device may obtain a second magnetic field function and a second electric field function of the light field corresponding to the center point of the subregion obtained from the initial division. It should be noted that in this implementation, since the approximation threshold is determined based on the multiple subregions obtained from the initial division, the second magnetic field function may represent the magnetic field function of the light field corresponding to the center point of the subregion obtained from the initial division, and the second electric field function may represent the electric field function of the light field corresponding to the center point of the subregion obtained from the initial division. After obtaining the second magnetic field function and the second electric field function, the electronic device may determine the second electromagnetic function corresponding to the light field at the center point of each subregion obtained from the initial division based on the proportional relationship between the second magnetic field function and the second electric field function. After determining the multiple second electromagnetic functions, the electronic device may calculate the rate of change of each second electromagnetic function and obtain the maximum rate of change of all the second electromagnetic functions. The electronic device may then calculate the approximation threshold based on the maximum rate of change and a preset constant.
[0097] Specifically, the specific function for the electronic device to calculate the approximate threshold value may be as follows.
[0098]
[0099] in, It can represent the rate of change of the second electromagnetic function of the light field at the center point in the i-th sub-region obtained by the first division; It can represent the second transformation matrix corresponding to the second electromagnetic function of the light field at the center point in the i-th sub-region obtained by the first division; Can represent the calculation matrix The Frobenius norm of the matrix The sum of the squares of all elements in and the square root operation of the sum of the squares; It can be expressed as taking the maximum value of the rate of change of the second electromagnetic function in all sub-regions obtained by the first division; can represent constant coefficients, It may depend on the shape of the grating and may range from 0 to 0.5. For example, It can be 0.1.
[0100] Among them, the method for the electronic device to determine the second electromagnetic function and the method for determining the rate of change of the second electromagnetic function are similar to the method for determining the first electromagnetic function in this embodiment. Readers can refer to the content of determining the second electromagnetic function in this embodiment, and replace "first magnetic field function" with "second magnetic field function", replace "first electric field function" with "second electric field function", and replace "first electromagnetic function" with "second electromagnetic function" to understand the specific method for the electronic device to determine the second electromagnetic function and the specific method for determining the rate of change of the second electromagnetic function.
[0101] Through the method provided in this embodiment, an electronic device can determine whether a center point meets the approximation condition based on the rate of change of the electromagnetic function of the light field at that center point. The electromagnetic function of the light field at the center point is a function that represents the mutual conversion relationship between the electric field and magnetic field of the light field at that location. Therefore, when the center point meets the approximation condition, that is, the rate of change of the electromagnetic function is less than the approximation threshold, and the electric field characteristics and magnetic field characteristics of the light field at that location are similar, then that location can be selected as the target location for simulation calculations, which can further reduce the computational complexity of simulation calculations performed using the simulation model, thereby further improving the efficiency of grating simulation.
[0102] S203. If the electromagnetic relationship of the light field corresponding to the center point does not meet the approximate condition, continue to perform the division operation on the sub-area until the electromagnetic relationship of the light field corresponding to the center point meets the approximate condition, stop performing the division operation, and determine the center point whose electromagnetic relationship meets the approximate condition as the target position.
[0103] In this embodiment, for any sub-area obtained by the first division, if the electronic device determines that the corresponding electromagnetic relationship of the light field of the center point on the sub-area does not meet the approximate condition, the electronic device can continue to perform the division operation on the sub-area. Among them, the specific method for the electronic device to perform the division operation on the sub-area can be understood by referring to the method for the electronic device to perform the first division operation on the target simulation area in S201 of this embodiment. Specifically, the electronic device can determine whether the center point of the sub-area currently divided meets the approximate condition after each division operation. If the electronic device determines that the electromagnetic relationship of the light field corresponding to the center point of the sub-area currently divided does not meet the approximate condition, the electronic device can continue to divide the sub-area into multiple sub-areas. If the electronic device determines that the electromagnetic relationship of the light field corresponding to the center point of the sub-area currently divided meets the approximate condition, the electronic device can stop performing the division operation and determine the center point where the electromagnetic relationship meets the approximate condition as the target position.
[0104] In this embodiment, after the division operation is stopped, for any sub-region where the electromagnetic relationship of the light field corresponding to the center point satisfies the approximate condition, the electronic device can identify the center point of the sub-region as the target location and calculate the first simulation result corresponding to the center point. The electronic device can also identify locations other than the center point in the sub-region as other locations associated with the center point, that is, the electronic device can determine that the position parameters of the locations other than the center point in the sub-region meet the association condition with the position parameters of the center point. Therefore, for any sub-region, the electronic device can approximate the second simulation result of the locations other than the center point in the sub-region based on the first simulation result corresponding to the center point of the sub-region.
[0105] The method provided in this embodiment can further improve the computational efficiency of raster simulation because the electronic device can determine each target position in the target simulation area by dividing the area into sub-areas and determining whether the center point of each sub-area meets the approximation condition, and simultaneously determine other positions associated with each target position.
[0106] See also Figure 3 , shows a flow chart of a grating simulation provided by an embodiment of the present application. Figure 3As shown, after receiving the simulation instruction initiated by the user, the electronic device can, in response to the simulation instruction, perform the first division of the target simulation area of the grating to obtain multiple sub-areas. For any sub-area, the electronic device can calculate the rate of change of the electromagnetic function of the center point on the sub-area through the Hessian matrix. The electronic device can determine whether the sub-area needs to be further subdivided by judging whether the rate of change is less than the approximate threshold. When the electronic device determines that the rate of change of the electromagnetic function of the center point on the current sub-area is greater than or equal to the approximate threshold, the electronic device can further divide the sub-area to further divide it into multiple sub-areas. Then, the electronic device can repeat the operation of judging whether the rate of change is less than the approximate threshold for each subdivided sub-area. When the electronic device determines that the rate of change of the electromagnetic function of the center point on the current sub-area is less than the approximate threshold, the electronic device can stop performing the division operation on the sub-area, and input the first characteristic parameter of the center point on the sub-area into the grating simulation model to determine the first simulation result corresponding to the center point on the sub-area.
[0107] After the electronic device calculates the first simulation result corresponding to the center point, it can store the first simulation result. In order to further speed up the computational efficiency of the grating simulation, the electronic device can store the first simulation result through memory optimization technology. Specifically, the electronic device can store the first simulation result through disk caching or distributed computing, etc., to avoid the first simulation result from occupying too much memory and improve the efficiency of large-scale calculations. After the electronic device records the first simulation result, for any sub-area, the electronic device can calculate the second simulation result of the position other than the center point in the sub-area based on the first simulation result of the center point. Finally, the electronic device can generate the target simulation result corresponding to the target simulation area based on all the first simulation results and the second simulation results.
[0108] It should be noted that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0109] Reference Figure 4 , shows a schematic diagram of a grating simulation device provided in an embodiment of the present application, which may specifically include a target position determination module 401, a simulation operation module 402, an approximate calculation module 403 and a simulation result generation module 404, wherein:
[0110] The target position determination module 401 is configured to determine a plurality of target positions in a target simulation area of the grating in response to a simulation instruction; the electromagnetic relationship of the light field at the target positions satisfies an approximate condition;
[0111] A simulation operation module 402 is configured to input the first characteristic parameter of the target position into a grating simulation model to determine a first simulation result corresponding to the target position;
[0112] an approximate calculation module 403, configured to input the first characteristic parameters of other positions in the target simulation area and the first simulation result corresponding to the target position into an approximate function to determine a second simulation result of the other positions; the second characteristic parameters of the other positions and the second characteristic parameters of the target position satisfy an association condition; the second characteristic parameters include at least one of a position parameter, a field characteristic quantity of the light field, and an optical parameter;
[0113] The simulation result generating module 404 is configured to generate a target simulation result corresponding to the target simulation area according to the first simulation result and the second simulation result.
[0114] The target position determination module can also be used to perform an initial division operation on the target simulation area to obtain multiple sub-areas; determine whether the electromagnetic relationship of the light field at the center point of the sub-area meets the approximate condition; the approximate condition is determined based on the multiple sub-areas obtained by the initial division; if the electromagnetic relationship of the light field at the center point does not meet the approximate condition, continue to perform the division operation on the sub-area until the electromagnetic relationship of the light field at the center point meets the approximate condition, stop performing the division operation, and determine the center point where the electromagnetic relationship meets the approximate condition as the target position.
[0115] The target position determination module can also be used to obtain the first magnetic field function and the first electric field function of the light field at the center point of the sub-area; determine the first electromagnetic function of the light field at the center point based on the proportional relationship between the first magnetic field function and the first electric field function; if the rate of change of the first electromagnetic function is greater than or equal to the approximate threshold, it is determined that the electromagnetic relationship of the light field at the center point does not meet the approximate condition; if the rate of change of the first electromagnetic function is less than the approximate threshold, it is determined that the electromagnetic relationship of the light field at the center point meets the approximate condition.
[0116] The target position determination module can also be used to perform partial derivative operations on the first electromagnetic function to determine the first transformation matrix corresponding to the first electromagnetic function; and calculate the rate of change of the first electromagnetic function based on the sum of squares of multiple elements in the first transformation matrix.
[0117] The target position determination module can also be used to obtain the second magnetic field function and the second electric field function of the light field corresponding to the center point in the sub-area obtained by the first division; determine the second electromagnetic function based on the proportional relationship between the second magnetic field function and the second electric field function; and calculate the approximate threshold based on the maximum value of the rate of change and the constant coefficient of multiple second electromagnetic functions.
[0118] The target position determination module can also be used to obtain the division parameters corresponding to the X, Y, and Z directions in the three-dimensional coordinate system respectively; and perform the first region division on the target simulation area in the X, Y, and Z directions according to the division parameters to obtain multiple sub-areas.
[0119] The division parameters of the X, Y, and Z directions in the target position determination module are the same.
[0120] The target position determination module can also be used to input the target shape information and target simulation area corresponding to the grating into a preset area division model for an initial division operation to obtain multiple sub-areas; the area division model is trained by training shape information, training simulation area and multiple expected sub-areas.
[0121] The approximate calculation module can also be used to construct a diagonal matrix based on the first characteristic parameters of the target position and the first characteristic parameters of the other positions; and calculate the second simulation results of the other positions based on multiple diagonal elements in the diagonal matrix and the first simulation results.
[0122] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the description of the method embodiment part.
[0123] Reference Figure 5 , shows a schematic diagram of an electronic device provided by an embodiment of the present application. Figure 5 As shown, the electronic device 500 in the embodiment of the present application includes: a processor 510, a memory 520, and a computer program 521 stored in the memory 520 and executable on the processor 510. When the processor 510 executes the computer program 521, the steps in each embodiment of the above-mentioned grating simulation method are implemented, such as Figure 1 Alternatively, when the processor 510 executes the computer program 521, the functions of the modules / units in the above-mentioned device embodiments are realized, for example, Figure 4 Functions of modules 401 to 404 are shown.
[0124] Exemplarily, the computer program 521 may be divided into one or more modules / units, which are stored in the memory 520 and executed by the processor 510 to complete the present application. The one or more modules / units may be a series of computer program instruction segments capable of performing specific functions, which may be used to describe the execution process of the computer program 521 in the electronic device 500. For example, the computer program 521 may be divided into a target position determination module, a simulation operation module, an approximate calculation module, and a simulation result generation module, and the specific functions of each module are as follows:
[0125] A target position determination module is configured to determine a plurality of target positions in a target simulation area of the grating in response to a simulation instruction; the electromagnetic relationship of the light field at the target positions satisfies an approximate condition;
[0126] A simulation operation module, configured to input the first characteristic parameter of the target position into a grating simulation model to determine a first simulation result corresponding to the target position;
[0127] an approximate calculation module, configured to input first characteristic parameters of other positions in the target simulation area and a first simulation result corresponding to the target position into an approximate function to determine a second simulation result of the other positions; the second characteristic parameters of the other positions and the second characteristic parameters of the target position satisfy an association condition; the second characteristic parameters include at least one of a position parameter, a field characteristic quantity of the light field, and an optical parameter;
[0128] The simulation result generating module is used to generate a target simulation result corresponding to the target simulation area according to the first simulation result and the second simulation result.
[0129] The electronic device 500 may be a computing device such as a desktop computer or a cloud server. The electronic device 500 may include, but is not limited to, a processor 510 and a memory 520. It will be understood by those skilled in the art that Figure 5 It is only an example of the electronic device 500 and does not constitute a limitation of the electronic device 500. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the electronic device 500 may also include input and output devices, network access devices, buses, etc.
[0130] The processor 510 may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.
[0131] The memory 520 can be an internal storage unit of the electronic device 500, such as a hard drive or memory of the electronic device 500. The memory 520 can also be an external storage device of the electronic device 500, such as a plug-in hard drive, a Smart Media Card (SMC), a Secure Digital (SD) card, a flash memory card, etc. equipped on the electronic device 500. Furthermore, the memory 520 can include both an internal storage unit of the electronic device 500 and an external storage device. The memory 520 is used to store the computer program 521 and other programs and data required by the electronic device 500. The memory 520 can also be used to temporarily store data that has been output or is about to be output.
[0132] An embodiment of the present application further discloses an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the grating simulation method as described in the aforementioned embodiments is implemented.
[0133] An embodiment of the present application further discloses a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program. When the computer program is executed by a processor, the grating simulation method as described in the above embodiments is implemented.
[0134] An embodiment of the present application further discloses a computer program product. When the computer program product is run on a computer, the computer is enabled to execute the grating simulation method described in the aforementioned embodiments.
[0135] The above embodiments are intended only to illustrate the technical solutions of the present application and are not intended to limit them. Although the present application has been described in detail with reference to the above embodiments, those skilled in the art should understand that they may still modify the technical solutions described in the above embodiments or replace some of the technical features therein with equivalents; and such modifications or replacements do not deviate from the spirit and scope of the technical solutions of the embodiments of the present application and should be included within the scope of protection of the present application.
Claims
1. A grating simulation method, characterized in that: include: In response to the simulation instruction, determining a plurality of target positions from a target simulation area of the raster; The electromagnetic relationship of the light field at the target position satisfies the approximate condition; The approximate condition is a condition for determining whether the electric field and the magnetic field at a certain position in the target simulation area are similar; Inputting a first characteristic parameter of the target position into a grating simulation model to determine a first simulation result corresponding to the target position; Inputting first characteristic parameters of other positions in the target simulation area and a first simulation result corresponding to the target position into an approximate function; second characteristic parameters of the other positions and the second characteristic parameters of the target position satisfy an association condition; the second characteristic parameters include at least one of a position parameter, a field characteristic quantity of the light field, and an optical parameter; Determine a second simulation result of the other position by using the approximate function; generating a target simulation result corresponding to the target simulation area according to the first simulation result and the second simulation result; Determining the second simulation result of the other position by using the approximate function includes: Constructing a diagonal matrix according to the first characteristic parameter of the target position and the first characteristic parameters of the other positions; The second simulation results at the other positions are calculated according to the multiple diagonal elements in the diagonal matrix and the first simulation result.
2. The method according to claim 1, characterized in that The step of determining a plurality of target positions from a target simulation area of the grating comprises: Performing a first division operation on the target simulation area to obtain a plurality of sub-areas; Determining whether the electromagnetic relationship of the light field at the center point of the sub-region satisfies the approximate condition; the approximate condition is determined based on the multiple sub-regions obtained by the first division; If the electromagnetic relationship of the light field at the center point does not meet the approximate condition, the division operation is continued on the sub-area until the electromagnetic relationship of the light field at the center point meets the approximate condition, and the division operation is stopped, and the center point where the electromagnetic relationship meets the approximate condition is determined as the target position.
3. The method according to claim 2, characterized in that The approximation condition includes an approximation threshold; The determining whether the electromagnetic relationship of the light field at the center point of the sub-region satisfies the approximation condition includes: Acquire a first magnetic field function and a first electric field function of the light field at the center point of the sub-region; determining a first electromagnetic function of the light field at the center point according to a proportional relationship between the first magnetic field function and the first electric field function; If the rate of change of the first electromagnetic function is greater than or equal to the approximation threshold, determining that the electromagnetic relationship of the light field at the center point does not satisfy the approximation condition; If the rate of change of the first electromagnetic function is less than the approximation threshold, it is determined that the electromagnetic relationship of the light field at the center point meets the approximation condition.
4. The method according to claim 3, characterized in that After determining the first electromagnetic function of the light field at the center point according to the proportional relationship between the first magnetic field function and the first electric field function, the method further includes: performing a partial derivative operation on the first electromagnetic function to determine a first transformation matrix corresponding to the first electromagnetic function; The change rate of the first electromagnetic function is calculated according to the sum of squares of a plurality of elements in the first conversion matrix.
5. The method according to claim 3, characterized in that After performing the first division operation on the target simulation area to obtain a plurality of sub-areas, the method further includes: Obtaining a second magnetic field function and a second electric field function of the light field corresponding to the center point in the sub-area obtained by the first division; determining a second electromagnetic function according to a proportional relationship between the second magnetic field function and the second electric field function; The approximate threshold is calculated based on a plurality of maximum values of the rate of change of the second electromagnetic functions and a constant coefficient.
6. The method according to any one of claims 2 to 5, characterized in that: The target simulation area is divided into multiple sub-areas for the first time, including: Get the division parameters corresponding to the X, Y, and Z directions in the three-dimensional coordinate system respectively; The target simulation area is initially divided in the X, Y, and Z directions according to the division parameters to obtain a plurality of sub-areas.
7. The method according to claim 6, characterized in that The division parameters in the X, Y, and Z directions are the same.
8. The method according to any one of claims 2 to 5, characterized in that: The target simulation area is divided into multiple sub-areas for the first time, including: The target shape information and target simulation area corresponding to the grating are input into a preset area division model for a first division operation to obtain multiple sub-areas; the area division model is trained by the training shape information, the training simulation area and multiple expected sub-areas.
9. An electronic device, characterized in that: The electronic device comprises a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the electronic device implements the grating simulation method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Simulation model construction method for micro-nano fiber grating
CN109141830A
Optical simulation method, device and equipment for refractive and diffractive optical system
CN118483821A