Grating simulation method and electronic equipment
By determining multiple target positions in the target simulation area of the grating and using the approximate function multiplexing simulation results, the problem of long calculation time for large-size grating simulation is solved, and the simulation efficiency is improved.
Patent Information
- Application Number
- CN202510465668.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-15
- Publication Date
- 2025-05-13
- Estimated Expiration
- 2045-04-15
AI Technical Summary
When processing large-size grating gratings, existing grating simulation algorithms need to calculate the simulation results of a large number of positions, resulting in a significant increase in calculation time and reducing simulation efficiency.
By determining multiple target positions in the target simulation area of the grating, the simulation results of the target position are calculated using the grating simulation model, and the simulation results of the target position are multiplexed using the approximate function to approximate the simulation results of the other positions.
The calculation amount during grating simulation is reduced, the time required for simulation is shortened, and the efficiency of simulation operations is improved.
Smart Images

Figure CN119989830A_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] As an important optical element, gratings are widely used in many fields such as spectral analysis, optical communication, and precision measurement. Their structure is usually composed of a large number of parallel slits or reflective surfaces with equal width and spacing. In practical applications, the effect of gratings on incident light depends on the complex electromagnetic field distribution inside them. Since the electromagnetic field distribution in the grating structure is complex and uneven, the processing results of the incident light at different positions on the same grating may be different. Therefore, in order to accurately simulate the effect of the grating on the light, in the existing grating simulation algorithm, it is necessary 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. Then, the overall simulation results of the grating are 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 makes the time required for the grating simulation operation increase sharply, thereby reducing the efficiency of the grating simulation operation. Summary of the invention
[0003] In view of this, an embodiment of the present application provides a grating simulation method and an electronic device to improve the computational efficiency of grating simulation.
[0004] A first aspect of an embodiment of the present application provides a grating simulation method, comprising: 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; 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 the first characteristic parameters of other positions in the target simulation area and the first simulation results corresponding to the target position into the approximate function to determine the second simulation results of the other positions; the second characteristic parameters of the other positions and the second characteristic parameters of the target position meet the association condition; the second characteristic parameters include at least one of the position parameter, the field characteristic quantity of the light field and the optical parameter; A target simulation result corresponding to the target simulation area is generated according to the first simulation result and the second simulation result.
[0005] In a possible implementation manner of the first aspect, determining a plurality of target positions from a target simulation area of the grating includes: 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 satisfy the approximate condition, the division operation is continued on the sub-area until the electromagnetic relationship of the light field at the center point satisfies the approximate condition, then the division operation is stopped, and the center point where the electromagnetic relationship satisfies the approximate condition is determined as the target position.
[0006] In a possible implementation manner of the first aspect, the approximation condition includes an approximation threshold; The determining whether the electromagnetic relationship of the light field at the center point of the sub-area 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, it is determined 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 satisfies the approximation condition.
[0007] 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: 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.
[0008] In a possible implementation manner of the first aspect, 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-region 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 function and a constant coefficient.
[0009] In a possible implementation manner of the first aspect, the first division operation is performed on the target simulation area to obtain multiple sub-areas, including: Obtain 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.
[0010] In a possible implementation manner of the first aspect, the division parameters in the X, Y, and Z directions are the same.
[0011] In a possible implementation manner of the first aspect, the first division operation is performed on the target simulation area to obtain multiple sub-areas, 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 training shape information, training simulation area and multiple expected sub-areas.
[0012] In a possible implementation manner of the first aspect, inputting the first characteristic parameter of other positions in the target simulation area and the first simulation result corresponding to the target position into an approximate function to determine the second simulation result of the other positions 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 results.
[0013] A second aspect of an embodiment of the present application provides a grating simulation device, comprising: A target position determination module, for determining a plurality of target positions from 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; A simulation operation module, used for inputting the first characteristic parameter of the target position into a grating simulation model to determine a first simulation result corresponding to the target position; An approximate calculation module, used for 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 the second simulation results of the other positions; the second characteristic parameters of the other positions and the second characteristic parameters of the target position meet the association condition; the second characteristic parameters include at least one of the position parameter, the field characteristic quantity of the light field and the optical parameter; A 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.
[0014] 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.
[0015] 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.
[0016] A fifth aspect of the embodiments of the present application provides a computer program product. When the computer program product is run on a computer, the computer executes the grating simulation method described in the first aspect.
[0017] Compared with the prior art, the embodiments of the present application have the following advantages: 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 calculations on other positions in the target simulation area according to the first simulation result and the approximate function to obtain a second simulation result of the other positions; finally, the electronic device can generate a target simulation result corresponding to the target simulation area according to 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, therefore, 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
[0018] In order 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 prior art descriptions. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0019] Figure 1is a schematic diagram of a grating simulation method provided in an embodiment of the present application; Figure 2 is a schematic diagram of another grating simulation method provided in an embodiment of the present application; Figure 3 is a flow chart of a grating simulation provided by an embodiment of the present application; Figure 4 is a schematic diagram of a grating simulation device provided in an embodiment of the present application; Figure 5 It is a schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0020] In the following description, specific details such as specific system structures, technologies, etc. are proposed for the purpose of illustration rather than limitation, so as to provide 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 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 to prevent unnecessary details from hindering the description of the present application.
[0021] 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 many fields such as spectral analysis, optical communication, and precision measurement. Its structure is usually composed of a large number of parallel slits or reflective surfaces of equal width and spacing. Since the performance of the grating, such as diffraction efficiency and spectral resolution, is closely related to the distribution of the electromagnetic field in the grating, the effect of the grating on the incident light depends on the complex electromagnetic field distribution inside it.
[0022] Grating simulation refers to the process of simulating and analyzing the optical characteristics and related physical phenomena of gratings using computer technology and related numerical calculation methods. Since the electromagnetic field distribution in the grating structure is complex and uneven, 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. 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 the 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 the outgoing light field corresponding to the target simulation area is generated according to the outgoing light of all positions in the target simulation area.
[0023] 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 position, 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 the second simulation results corresponding to other positions. Therefore, the method provided by this embodiment can reduce the amount of operations of the grating simulation operation, thereby reducing the operation time of the grating simulation operation and improving the operation efficiency.
[0024] 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, and optical detector design, 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: light field simulation used in fields such as physical optics and quantum mechanics. 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.
[0025] The technical solution of the present application is described below through specific embodiments.
[0026] Reference Figure 1 , shows a schematic diagram of a grating simulation method provided by an embodiment of the present application. The method can be applied to any electronic device capable of performing grating simulation operations, such as a computer, a mobile phone, a tablet computer, a server, etc. The grating simulation method can specifically include the following steps: S101 . In response to a simulation instruction, determine a plurality of target positions from a target simulation area of a grating.
[0027] 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 a 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.
[0028] Specifically, the light field corresponding to a certain position in the target simulation area may be the incident light field, the outgoing light field, 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 according to 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 according to the electromagnetic relationship, magnetic field function, and electric field function of the incident light field and the outgoing light field.
[0029] In a possible implementation, after determining the target simulation area, the electronic device can determine whether the electromagnetic relationship of the light field at each position in the target simulation area satisfies the approximate condition, that is, the electronic device can 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 approximate condition one by one. If the electronic device determines that the electromagnetic relationship of the light field at a certain position satisfies the approximate condition, the electronic device can 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 approximate condition, the electronic device may not identify the position as the target position.
[0030] S102, 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.
[0031] 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 coupled mode theory model, transfer matrix model, Fourier modal method model, finite element method model, etc., which can perform grating simulation operations, and the embodiment of the present application is not used to specifically limit the grating simulation model. The first characteristic parameter of the target position may include at least one of the optical parameters corresponding to the target position, the field characteristic quantity of the incident light field at the target position, and the field characteristic quantity of the outgoing light field at the target position. Among them, the optical parameter of a certain position on the grating can be a physical quantity used to describe the various effects and response characteristics of the grating on light at the position. Specifically, the optical parameter can include at least one of the 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.
[0032] The first characteristic parameter input by the electronic device to the grating simulation model may depend on the purpose of the current grating simulation. Exemplarily, 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.
[0033] S103, inputting the first characteristic parameters of other positions in the target simulation area and the first simulation results corresponding to the target positions into the approximate function to determine the second simulation results of the other positions.
[0034] In this embodiment, after determining the first simulation result corresponding to the target position, the electronic device can determine other positions associated with the target position according to the second characteristic parameter, and perform approximate calculations on other positions associated with the target position according to the first simulation result of the target position to obtain second simulation results corresponding to other positions. Specifically, other positions associated with a certain target position can be positions in the target simulation area where the second characteristic parameter satisfies the association condition with the second characteristic parameter of the target position. The second characteristic parameter may include at least one of a position parameter, a field characteristic quantity of the light field, and an optical parameter.
[0035] 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 an association condition with a target position, then the electronic device can determine that the position is another position associated with the current target position.
[0036] 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 the first threshold, the electronic device can determine that the position parameter of the position and the position parameter 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 the 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 the 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.
[0037] In a possible implementation, the process of the electronic device calculating the second simulation result through the 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 according to the first characteristic parameter of the target position and the first characteristic parameter of a certain other 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 according to multiple diagonal elements in the diagonal matrix and the first simulation result.
[0038] In a possible implementation, the approximate function may be specifically as follows:
[0039] 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; A first characteristic parameter corresponding to the other position may be represented; A first characteristic parameter corresponding to a target position associated with the other position may be represented; Can represent the matrix 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.
[0040] In a possible implementation, the approximate function may also be a linear function. After calculating the first simulation result corresponding to the target position, the electronic device may also input the first simulation result and the first characteristic parameter corresponding to other positions into a preset linear function, and calculate the second simulation result corresponding to other positions through the linear function. The coefficients in the linear function may be determined by the R&D personnel according to experiments.
[0041] S104: Generate a target simulation result corresponding to the target simulation area according to the first simulation result and the second simulation result.
[0042] 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 according to all currently calculated first simulation results and second simulation results.
[0043] According to the method provided by this embodiment, since the electronic device can approximate the second simulation results of other positions in the target simulation area according to the first simulation results of the target position, only some positions in the target simulation area need to be simulated by the grating simulation model. Furthermore, since the amount of calculation of the approximate function is much smaller than the amount of calculation 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 calculation efficiency of the grating simulation calculation.
[0044] Figure 2 FIG. 1 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, a grating simulation method provided in this embodiment includes S101: S201 to S203, which are described in detail as follows: S201, performing a first division operation on the target simulation area to obtain multiple sub-areas.
[0045] In this embodiment, after receiving the simulation instruction initiated by the user, the electronic device may perform a first division operation on the target simulation area, dividing the target simulation area into a plurality of sub-areas.
[0046] In a 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 preset by the R&D personnel, or can be obtained by the electronic device by querying the database according to the target shape information of the grating. After obtaining the division parameters, the electronic device can perform the first 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.
[0047] Specifically, the division parameters in the X direction, Y direction, and Z direction obtained by the electronic device may be the same. Exemplarily, the division parameter may be 10 nm. When the division parameters in the three directions are the same, the electronic device may divide the target simulation area into a plurality of sub-areas. Exemplarily, when the electronic device divides the target simulation area into three equal parts, the electronic device may obtain three sub-areas after the first division.
[0048] In a possible implementation, the electronic device can respond to the simulation instruction and input the target shape information and the target simulation area corresponding to the grating into a preset area division model for a first division operation to obtain multiple sub-areas. It should be noted that the area division model can be any machine learning model known to those skilled in the art, and the embodiments of the present application are not intended to specifically limit the area division model.
[0049] Before the electronic device performs the first division through the region division model, it can also obtain the model to be trained and the training data set input by the user. Among them, the training data set may include training shape information, training simulation area and multiple expected sub-areas. The electronic device can train the model to be trained through the training data set, and determine the model to be trained when the training stop condition is met as the region division model. Specifically, the electronic device can input the training shape information and the training simulation area in the training data set into the model to be trained to generate multiple initial sub-areas. Then, the electronic device can calculate the loss value between the initial sub-area and the expected sub-area according to the preset loss function, and determine whether the calculated loss value is less than or equal to the loss threshold. If the electronic device determines that the loss value is greater than the loss threshold, the electronic device can update the model to be trained according to the loss value, and regenerate the initial sub-area through 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 can determine that the current model to be trained meets the training stop condition, and determine the current model to be trained as the region division model for performing the first division operation.
[0050] S202: Determine whether the electromagnetic relationship of the light field corresponding to the center point of the sub-region satisfies an approximation condition.
[0051] In this embodiment, after dividing into a plurality of sub-regions, the electronic device can respectively determine whether the corresponding electromagnetic relationship of the light field of the center point of each sub-region satisfies the approximate condition.
[0052] In one possible implementation, for any sub-region obtained by the initial division, if the electronic device determines that the corresponding electromagnetic relationship of the light field of the center point on the sub-region satisfies the approximate condition, the electronic device may not further divide the current sub-region, and identify the center points corresponding to each of the current sub-regions as the target positions corresponding to the target simulation area.
[0053] In a 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.
[0054] Specifically, after the electronic device performs the division operation each time, for the sub-region currently divided, the first magnetic field function and the first electric field function of the light field corresponding to the center point on the sub-region can be obtained. It should be noted that, since the electronic device can determine whether the light field at the center point meets the approximate 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 on the sub-region obtained by the first division operation, or the magnetic field function of the light field corresponding to the center point on the sub-region obtained by the subsequent division operation; the first electric field function can represent the electric field function of the light field corresponding to the center point on the sub-region obtained by the first division operation, or the electric field function of the light field corresponding to the center point on the sub-region obtained by the subsequent division operation. 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 on the sub-region according to the proportional relationship between the first magnetic field function and the first electric field function.
[0055] 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 space vector, N can be a given Fourier expansion order, and x can be an independent variable. After acquiring 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 approximate threshold. For the rate of change of the first electromagnetic function of the light field corresponding to the center point on any sub-area, if the electronic device determines that the rate of change is less than the approximate threshold, the electronic device can determine that the center point meets the approximate condition. If the electronic device determines that the rate of change is greater than or equal to the approximate threshold, the electronic device can determine that the center point does not meet the approximate condition.
[0056] In a possible implementation, the electronic device may construct a Hessian matrix corresponding to the first electromagnetic function to perform a partial derivative operation on the first electromagnetic function to generate a first conversion matrix corresponding to the first electromagnetic function. Then, the electronic device may calculate the rate of change of the first electromagnetic function based on the sum of squares of multiple elements in the first conversion matrix.
[0057] Specifically, the formula for calculating the rate of change of the electromagnetic function by the electronic device can be as follows:
[0058] 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 sum of the squares.
[0059] In a possible implementation manner, after determining the first electromagnetic function, the electronic device may further determine the change rate corresponding to the first electromagnetic function by calculating the gradient function of the first electromagnetic function.
[0060] In a possible implementation, before determining whether the light field of the center point on the sub-region satisfies the approximation condition, the electronic device may first determine an approximation threshold value according to the multiple sub-regions obtained by the first division. For the multiple sub-regions obtained by the first division, the electronic device may obtain the second magnetic field function and the second electric field function of the light field corresponding to the center point on the sub-region obtained by the first division. It should be noted that in this implementation, since the approximation threshold value is determined according to the multiple sub-regions obtained by the first division, the second magnetic field function may represent the magnetic field function of the light field corresponding to the center point on the sub-region obtained by the first division operation, and the second electric field function may represent the electric field function of the light field corresponding to the center point on the sub-region obtained by the first division operation. 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 of the center point on each sub-region obtained by the first division according to 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 change rate of each second electromagnetic function respectively, and obtain the maximum value of the change rates of all second electromagnetic functions. Then, the electronic device may calculate the approximation threshold value according to the maximum value of the change rate and a preset constant.
[0061] Specifically, the specific function for the electronic device to calculate the approximate threshold value may be as follows.
[0062]
[0063] 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 be expressed as a calculation matrix The Frobenius norm of The sum of the squares of all elements in and the square root operation of the sum of squares; It can be expressed as taking the maximum value of the rate of change of the second electromagnetic function in all the sub-areas obtained by the first division; can represent constant coefficients, It may depend on the shape of the grating, and the value range may be 0 to 0.5. For example, It can be 0.1.
[0064] 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.
[0065] Through the method provided in this embodiment, the electronic device can judge whether the center point meets the approximate condition based on the rate of change of the electromagnetic function of the light field at the center point, and 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 the magnetic field of the light field at this position. Therefore, when the center point meets the approximate condition, that is, the rate of change of the electromagnetic function is less than the approximate threshold, that is, the electric field characteristics and the magnetic field characteristics of the light field at this position are similar, so the position is selected as the target position for simulation calculation, which can further reduce the amount of calculation when performing simulation calculation through the simulation model, thereby further accelerating the efficiency of grating simulation.
[0066] S203. If the electromagnetic relationship of the light field corresponding to the center point does not satisfy 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 satisfies the approximate condition, stop performing the division operation, and determine the center point whose electromagnetic relationship satisfies the approximate condition as the target position.
[0067] 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.
[0068] 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 position and calculate the first simulation result corresponding to the center point. The electronic device can also identify the positions other than the center point in the sub-region as other positions associated with the center point, that is, the electronic device can determine that the position parameters of the positions 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 positions other than the center point in the sub-region based on the first simulation result corresponding to the center point of the sub-region.
[0069] According to the method provided in this embodiment, since the electronic device can determine each target position in the target simulation area by dividing the sub-areas and judging whether the center point of each sub-area satisfies the approximate condition, and simultaneously determine other positions associated with each target position, the method provided in this embodiment can further improve the computational efficiency of the grating simulation.
[0070] 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 respond to the simulation instruction to divide the target simulation area of the grating for the first time 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.
[0071] After the electronic device calculates the first simulation result corresponding to the center point, the first simulation result can be stored. 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 to avoid the first simulation result from occupying too much memory and improve the efficiency of large-scale computing. 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 a target simulation result corresponding to the target simulation area based on all the first simulation results and the second simulation results.
[0072] 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 the present application.
[0073] 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: The target position determination module 401 is used to determine a plurality of target positions from the target simulation area of the grating in response to the simulation instruction; the electromagnetic relationship of the light field at the target positions satisfies the approximate condition; A simulation operation module 402 is used 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; An approximate calculation module 403 is used to input 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 the second simulation results of the other positions; the second characteristic parameters of the other positions and the second characteristic parameters of the target position meet the association condition; the second characteristic parameters include at least one of the position parameter, the field characteristic quantity of the light field and the optical parameter; The simulation result generating module 404 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.
[0074] 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.
[0075] 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 according to 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, determine 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, determine that the electromagnetic relationship of the light field at the center point meets the approximate condition.
[0076] The target position determination module can also be used to perform partial derivative operations on the first electromagnetic function to determine a 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.
[0077] 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 according to the proportional relationship between the second magnetic field function and the second electric field function; and calculate the approximate threshold value according to the maximum value of the rate of change and the constant coefficient of multiple second electromagnetic functions.
[0078] 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 area division on the target simulation area in the X, Y, and Z directions according to the division parameters to obtain multiple sub-areas.
[0079] The division parameters in the X, Y, and Z directions in the target position determination module are the same.
[0080] 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 the first 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.
[0081] 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.
[0082] 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.
[0083] 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, for example Figure 1 Alternatively, when the processor 510 executes the computer program 521, the functions of each module / unit in the above-mentioned device embodiments are realized, for example Figure 4 Functions of modules 401 to 404 are shown.
[0084] 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 completing 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: A target position determination module, for determining a plurality of target positions from 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; A simulation operation module, used for inputting the first characteristic parameter of the target position into a grating simulation model to determine a first simulation result corresponding to the target position; An approximate calculation module, used for 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 the second simulation results of the other positions; the second characteristic parameters of the other positions and the second characteristic parameters of the target position meet the association condition; the second characteristic parameters include at least one of the position parameter, the field characteristic quantity of the light field and the optical parameter; A 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.
[0085] 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. Those skilled in the art will appreciate 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.
[0086] The processor 510 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or 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, etc.
[0087] The memory 520 may be an internal storage unit of the electronic device 500, such as a hard disk or memory of the electronic device 500. The memory 520 may also be an external storage device of the electronic device 500, 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 500. Further, the memory 520 may also 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 may also be used to temporarily store data that has been output or is to be output.
[0088] An embodiment of the present application also discloses an electronic device, including 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 above-mentioned embodiments is implemented.
[0089] The embodiment of the present application further discloses 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 above-mentioned embodiments is implemented.
[0090] The 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 above-mentioned embodiments.
[0091] The above-described embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application is described in detail with reference to the above-mentioned embodiments, a person skilled in the art should understand that the technical solutions described in the above-mentioned embodiments can still be modified, or some of the technical features can be replaced by equivalents; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope 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 locations from a target simulation region of the grating; The electromagnetic relationship of the light field at the target position satisfies the approximate condition; 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 the first characteristic parameters of other positions in the target simulation area and the first simulation results corresponding to the target position into the approximate function to determine the second simulation results of the other positions; the second characteristic parameters of the other positions and the second characteristic parameters of the target position meet the association condition; the second characteristic parameters include at least one of the position parameter, the field characteristic quantity of the light field and the optical parameter; A target simulation result corresponding to the target simulation area is generated according to the first simulation result and the second 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 region 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 satisfy the approximate condition, the division operation is continued on the sub-area until the electromagnetic relationship of the light field at the center point satisfies the approximate condition, then the division operation is stopped, and the center point where the electromagnetic relationship satisfies 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-area 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, it is determined 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 satisfies 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 the target simulation area is divided for the first time 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-region 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 function 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 for the first time to obtain a plurality of sub-areas, including: Obtain 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 for the first time to obtain a plurality of sub-areas, 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 training shape information, training simulation area and multiple expected sub-areas.
9. The method according to any one of claims 2 to 5, characterized in that: The step of inputting the first characteristic parameter of other positions in the target simulation area and the first simulation result corresponding to the target position into an approximate function to determine the second simulation result of the other positions 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 results.
10. 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 as described in any one of claims 1 to 9.
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