A method for opening a Ref SPAD matrix and related equipment
By obtaining the photon count from the RefSPAD matrix and optimizing the computational model, invalid cells are eliminated, and the SPAD cell combination is optimized using the DP algorithm, the problem of inaccuracy in the photon receiving function of the RefSPAD matrix is solved, the stability and fault tolerance of the matrix are improved, and the service life is extended.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHENZHEN ADAPS PHOTONICS TECH CO LTD
- Filing Date
- 2022-11-18
- Publication Date
- 2026-05-29
AI Technical Summary
In the time-of-flight ranging (DTOF) scheme, the photon receiving function of the RefSPAD matrix is inaccurate. It is affected by VCSEL product differences, uncertainty of the light receiving factor of a single RefSPAD, single attenuation factor, and thermal expansion and contraction, resulting in differences in the actual production and packaging process of the products.
By obtaining the photon count of each SPAD cell in the RefSPAD matrix and inputting it into a preset calculation model, the combination of SPAD cells that meets the photon count threshold is determined, invalid cells are eliminated, the number of times they are used is recorded, and the maximum value function is calculated using the DP algorithm to optimize the combination of SPAD cells, thereby ensuring improved matrix stability and fault tolerance when the photon count reaches the threshold.
The cell combination of the RefSPAD matrix is effectively calculated, reducing performance problems caused by VCSEL product differences, improving the fault tolerance and stability of the SPAD matrix, and extending the device lifespan.
Smart Images

Figure CN115828799B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of photoelectric sensing technology, and in particular to a method for enabling a RefSPAD matrix and related equipment. Background Technology
[0002] In the time-of-flight ranging (DTOF) scheme based on the transmitter and receiver, a reference SPAD is added to the receiver of the single-photon avalanche diode (SPAD) to receive the light emitted by the vertical-cavity surface-emitter laser (VCSEL) to confirm the time of emission, and at the same time to provide a valid reference waveform for the main SPAD.
[0003] RefSPADs primarily operate in a closed environment with minimal interference, and an increase in the amount of light received inevitably leads to an increase in effective light. However, due to differences between various VCSEL products, their emission power also varies, necessitating different enabling mechanisms for RefSPAD light reception. Furthermore, individual RefSPADs suffer from uncertainties in their light acceptance factor, attenuation factor, and interference immunity; they are also affected by thermal expansion and contraction of the optical channel and reflection; and their production and packaging processes introduce individual variations. These four factors contribute to the inaccuracy of RefSPAD photon reception.
[0004] Therefore, there is an urgent need for an activation method that can effectively calculate the combination of each SPAD in the RefSPAD matrix, thereby improving the accuracy of the RefSPAD matrix in receiving photons. Summary of the Invention
[0005] This application provides a method and related device for enabling a RefSPAD matrix, used to calculate an effective combination of RefSPAD matrix elements.
[0006] The first aspect of this application provides a method for enabling a RefSPAD matrix, including:
[0007] Obtain the number of photons received by each SPAD cell in the RefSPAD matrix;
[0008] The photon count of all SPAD units is input into a preset calculation model to determine whether there is a combination of SPAD units that meets the photon count threshold.
[0009] If so, determine that the SPAD unit combination is the SPAD that needs to be activated.
[0010] Optionally, obtaining the number of photons received by each SPAD cell in the RefSPAD matrix includes:
[0011] Open all SPAD cells in the RefSPAD matrix and set the photon number threshold of the RefSPAD matrix;
[0012] The RefSPAD matrix is put into operation, and all SPAD cells are detected to obtain the number of photons received by all SPAD cells.
[0013] Optionally, after placing the RefSPAD matrix into an active state and detecting all the SPAD cells, the method further includes:
[0014] If an invalid SPAD unit exists, remove the invalid SPAD unit.
[0015] Optionally, after inputting the photon counts of all SPAD units into a preset calculation model to determine whether there exists a combination of SPAD units that meets the photon count threshold, the method further includes:
[0016] If not, determine that all SPAD units are SPADs that need to be enabled.
[0017] Optionally, after determining that the SPAD unit combination is a SPAD that needs to be activated, the method further includes:
[0018] Record the number of times each SPAD cell in the RefSPAD matrix is used;
[0019] If the number of times a certain SPAD unit is used exceeds a preset threshold, the use of that SPAD unit is stopped, and the step of inputting the photon count of all SPAD units into a preset calculation model is executed to determine whether there is a combination of SPAD units that meets the photon count threshold is performed.
[0020] Optionally, after ceasing the use of the SPAD unit, the method further includes:
[0021] If the SPAD unit combination does not exist, the SPAD unit and all SPAD units are input into the preset calculation model to obtain the SPAD unit combination.
[0022] Optionally, the step of inputting the photon count of all SPAD units into a preset calculation model to determine whether there is a combination of SPAD units that meets the photon count threshold includes:
[0023] Sort the number of photons acquired by all SPAD units;
[0024] The photon counts are added one by one in ascending order to obtain the sum of the photon counts;
[0025] Determine whether the sum of the photon counts is less than the photon count threshold, and select the largest sum of photon counts less than the photon count threshold;
[0026] The step of determining that the SPAD unit combination is a SPAD that needs to be activated includes:
[0027] If so, based on the maximum sum of photons, determine the combination of SPAD units corresponding to each photon count in the sum of photons as the SPADs to be activated.
[0028] Optionally, the step of inputting the photon count of all SPAD units into a preset calculation model to determine whether there is a combination of SPAD units that meets the photon count threshold includes:
[0029] Determine the maximum value function;
[0030] All SPAD units are labeled, and the labels are associated with the number of photons in each SPAD unit.
[0031] Substitute the SPAD cell label and the corresponding photon number into the maximum value function to determine whether there is a combination of SPAD cells that satisfies the photon number threshold.
[0032] If so, proceed with the step of determining that the SPAD unit combination is a SPAD that needs to be enabled.
[0033] Optionally, substituting the SPAD cell label and the corresponding photon number into the maximum value function to determine whether there exists a combination of SPAD cells that satisfies the photon number threshold includes:
[0034] Using the DP algorithm, the maximum value function dp(n+1) = dp(n) + value(n+1) is obtained, where n is the label of the SPAD unit and value is the value function of the photon number.
[0035] Calculate the first dp value of the first SPAD unit based on the maximum value function;
[0036] Using the first dp value, calculate the second dp value of the second SPAD unit;
[0037] Calculate the nth dp value of the nth SPAD unit using the (n-1)th dp value of the nth SPAD unit; where n is a natural number greater than 1.
[0038] The maximum dp value is selected from all dp values. The combination of SPAD unit labels is obtained by analyzing the composition of the maximum dp value to determine whether there is a combination of SPAD units that satisfies the photon number threshold.
[0039] Optionally, the method further includes:
[0040] If the photon number threshold is y, then the dp value of each SPAD unit includes at least y+1 dp values; where y is a natural number greater than or equal to 1.
[0041] A second aspect of this application provides a system for opening a RefSPAD matrix, comprising:
[0042] The acquisition unit is used to acquire the number of photons received by each SPAD unit in the RefSPAD matrix.
[0043] The input unit is used to input the photon count of all SPAD units into a preset calculation model to determine whether there is a combination of SPAD units that meets the photon count threshold.
[0044] A determining unit is used to determine that a SPAD unit combination that meets a photon number threshold is a SPAD that needs to be activated.
[0045] Optionally, the system further includes: an opening unit;
[0046] The opening unit is used to open all SPAD units in the RefSPAD matrix and set the photon number threshold of the RefSPAD matrix;
[0047] The acquisition unit is specifically used to put the RefSPAD matrix into a working state and detect all the SPAD units to obtain the number of photons received by all the SPAD units.
[0048] Optionally, the system further includes: a rejection unit;
[0049] The rejection unit is used to reject the invalid SPAD unit when an invalid SPAD unit exists.
[0050] Optionally, the system further includes:
[0051] The determining unit is further configured to determine all SPAD units as SPADs that need to be activated when there is no combination of SPAD units that meets the photon number threshold.
[0052] Optionally, the system further includes: a recording unit and an execution unit;
[0053] The recording unit is used to record the number of times each SPAD unit in the RefSPAD matrix is used;
[0054] The execution unit is configured to stop using a SPAD unit when the number of times a certain SPAD unit is used exceeds a preset threshold, and to execute the step of inputting the photon count of all SPAD units into a preset calculation model to determine whether there is a combination of SPAD units that meets the photon count threshold.
[0055] Optionally, the system further includes:
[0056] The input unit is further configured to input the SPAD unit and all SPAD units into the preset calculation model to obtain the SPAD unit combination when the SPAD unit combination does not exist.
[0057] Optionally, the system further includes: a sorting unit and a judgment unit;
[0058] The sorting unit is used to sort the number of photons acquired by all the SPAD units;
[0059] The acquisition unit is specifically used to add the photon counts one by one in ascending order to obtain the sum of the photon counts;
[0060] The judgment unit is used to determine whether the sum of the photons is less than the photon count threshold, and select the largest sum of the photons that is less than the photon count threshold;
[0061] The determining unit is specifically used to determine, based on the maximum photon count and value, the combination of SPAD units corresponding to each photon count in the photon count and value that is to be activated when the SPAD unit combination is a SPAD that needs to be activated.
[0062] Optionally, the system further includes:
[0063] The determining unit is specifically used to determine the maximum value function;
[0064] The execution unit is specifically used to label all the SPAD units and associate the labels with the number of photons in the SPAD units.
[0065] The determining unit is specifically used to substitute the SPAD unit's label and the number of photons corresponding to the SPAD unit into the maximum value function to determine whether there is a combination of SPAD units that satisfies the photon number threshold.
[0066] The execution unit is specifically used to perform the step of determining that the SPAD unit combination is a SPAD that needs to be activated when there is a SPAD unit combination that meets the photon number threshold.
[0067] Optionally, the system further includes: a computing unit;
[0068] The computing unit is specifically used to use the DP algorithm to find the maximum value function dp(n+1)=dp(n)+value(n+1), where n is the label of the SPAD unit, value is the value function, and value is a function of the number of photons.
[0069] The calculation unit is also used to calculate the first dp value of the first SPAD unit according to the maximum value function;
[0070] The calculation unit is also used to calculate the second dp value of the second SPAD unit using the first dp value;
[0071] The calculation unit is also used to calculate the ndp value of the nth SPAD unit using the (n-1)th dp value of the nth SPAD unit; where n is a natural number greater than 1.
[0072] The determining unit is specifically used to select the maximum dp value among all dp values, and to parse the combination of SPAD unit labels by the composition of the maximum dp value, so as to determine whether there is a combination of SPAD units that satisfies the photon number threshold.
[0073] Optionally, the system further includes:
[0074] If the photon number threshold is y, then the dp value of each SPAD unit includes at least y+1 dp values; where y is a natural number greater than or equal to 1.
[0075] The second aspect of the embodiments of this application provides a method for performing the opening method described in the first aspect.
[0076] A third aspect of this application provides a device for opening a RefSPAD matrix, comprising:
[0077] Central processing unit, memory, input / output interfaces, wired or wireless network interfaces, and power supply;
[0078] The memory is either a short-term storage memory or a persistent storage memory;
[0079] The central processing unit is configured to communicate with the memory and execute instructions in the memory to perform the startup method described in the first aspect.
[0080] A fourth aspect of this application provides a computer-readable storage medium, characterized in that the computer-readable storage medium includes instructions that, when executed on a computer, cause the computer to perform the opening method described in the first aspect.
[0081] As can be seen from the above technical solutions, the embodiments of this application have the following advantages: the method for enabling a RefSPAD matrix proposed in the embodiments of this application can effectively calculate the unit combination of Ref SPAD in the SPAD matrix when the number of photons of RefSPAD reaches a threshold, thereby improving the fault tolerance and stability of the SPAD matrix. Attached Figure Description
[0082] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments recorded in this application. For those skilled in the art, other drawings can be obtained based on these drawings.
[0083] Figure 1 This is a schematic diagram illustrating the working principle of a VCSEL as disclosed in an embodiment of this application;
[0084] Figure 2 This is a flowchart illustrating a method for enabling a RefSPAD matrix as disclosed in an embodiment of this application;
[0085] Figure 3 This is a flowchart illustrating another method for enabling a RefSPAD matrix disclosed in an embodiment of this application;
[0086] Figure 4 This is a flowchart illustrating another method for enabling a RefSPAD matrix disclosed in an embodiment of this application;
[0087] Figure 5 This is a schematic diagram of the structure of a RefSPAD matrix opening system disclosed in an embodiment of this application;
[0088] Figure 6 This is a schematic diagram of the structure of a RefSPAD matrix opening device disclosed in an embodiment of this application. Detailed Implementation
[0089] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a particular order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in a sequence other than that illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0090] It should be noted that the use of terms such as "first" and "second" in this application is for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one of those features. Furthermore, the technical solutions of the various embodiments can be combined with each other, but this must be based on the ability of those skilled in the art to implement them. If the combination of technical solutions is contradictory or impossible to implement, such a combination of technical solutions should be considered non-existent and not within the scope of protection claimed in this application.
[0091] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0092] Because the number of photons received by a single RefSPAD is uncertain, the attenuation factor of a single RefSPAD is uncertain, and its anti-interference capability is limited, and because of the thermal expansion and contraction of the RefSPAD optical channel and the effects of reflection, products will have their own unique characteristics during actual production and packaging. Therefore, the above four factors lead to the precision of the RefSPAD's photon receiving function.
[0093] Under the influence of the aforementioned dynamic factors, neither fully enabling nor enabling a specific matrix element can effectively mitigate the impact of these factors. Therefore, it is necessary to find a maximum number of RefSPAD matrix combinations in any scenario to improve the fault tolerance and stability of the RefSPAD matrix.
[0094] Therefore, embodiments of this application provide a method and related apparatus for enabling a RefSPAD matrix, used to calculate an effective combination of RefSPAD matrix elements.
[0095] Please see Figure 1 , Figure 1 This is a schematic diagram illustrating the working principle of a VCSEL disclosed in an embodiment of this application.
[0096] In step 1, the VCSEL emits laser pulses, resulting in two beams. One beam travels towards the RefSPAD, and the other towards the Main SPAD. The laser beam directed towards the RefSPAD is reflected back to the RefSPAD by the cover glass, allowing the RefSPAD to receive the corresponding photon signal. Similarly, the laser beam directed towards the Main SPAD is reflected back to the Main SPAD by the test object, allowing the Main SPAD to receive the corresponding photon signal. The RefSPAD provides a stable and effective reference waveform to the Main SPAD by receiving these photon signals.
[0097] This is because the Main SPAD can be referenced by controlling the opening and closing of each SPAD cell in the RefSPAD matrix.
[0098] Specifically, for the RefSPAD matrix, the total received light count CNT = ∑i n (i is the number of light received by a single enabled SPAD, and n is the nth RefSPAD among all enabled RefSPADs).
[0099] Therefore, the direction of optimization is:
[0100] Condition 1: When a certain threshold (total number of received lights) is triggered, the more RefSPADs are turned on, the better;
[0101] Condition 2: Under the condition of satisfying condition 1, the larger the CNT value is under the threshold constraint, the better.
[0102] Please see Figure 2 , Figure 2 This is a flowchart illustrating a method for enabling a RefSPAD matrix as disclosed in an embodiment of this application. It includes steps 201-203.
[0103] 201. Obtain the number of photons received by each SPAD cell in the RefSPAD matrix.
[0104] Before testing each SPAD cell in the RefSPAD matrix, it is necessary to obtain the number of photons received by each RefSPAD cell, which will serve as the basis for subsequent calculations of the SPAD cells.
[0105] In one embodiment, the RefSPAD matrix contains three SPAD units, A, B, and C. Correspondingly, the number of photons received by A, B, and C can be measured to be 2, 1, and 3, respectively. It is easy to understand that this embodiment does not limit the number of SPAD units in the RefSPAD matrix; the RefSPAD matrix can also contain 4, 5, or 100 SPAD units, etc. For ease of understanding and description, this will not be elaborated further. Correspondingly, there is no limit to the number of photons received by each SPAD unit.
[0106] 202. Input the photon count of all SPAD units into the preset calculation model to determine whether there is a combination of SPAD units that meets the photon count threshold. If so, proceed to step 203.
[0107] Once the photon counts of all SPAD units are obtained, they can be input into a preset calculation model to determine whether there is a combination of SPAD units that meets the photon count threshold.
[0108] In one embodiment, the photon count threshold is preset and can be referenced to the threshold value of the received photon count of the Main SPAD matrix. However, it should be noted that the photon count threshold must be larger than the number of photons received by each SPAD cell in the RefSPAD matrix.
[0109] In another embodiment, after obtaining the photon count of all SPAD units, it is also necessary to perform a validity check on the photon count of all RefSPAD matrix units to eliminate bad pixels, i.e., SPAD units that cannot continue to be used normally. Specifically, invalid SPAD units are filtered out, and only valid SPAD units are counted. In this case, all SPAD units in the SPAD unit combination are considered valid SPAD units.
[0110] 203. Determine the SPAD unit combination as the SPAD that needs to be enabled.
[0111] If there exists a combination of SPAD cells that satisfies the photon number threshold, then it can be determined that this combination of SPAD cells is the SPAD cell that needs to be opened in the RefSPAD matrix.
[0112] In one embodiment, for example, if the combination of SPAD cells that satisfies the photon number threshold is cells A and C, then the RefSPAD matrix will only turn on the SPAD cells of A and C.
[0113] The RefSPAD matrix activation method proposed in this embodiment can effectively calculate the unit combination of RefSPAD in the SPAD matrix when the number of photons of RefSPAD reaches a threshold, thereby minimizing product performance issues caused by the differences in VCSEL products and improving the fault tolerance and stability of the SPAD matrix.
[0114] For a detailed description of the RefSPAD matrix enabling method proposed in the embodiments of this application, please refer to [link to relevant documentation]. Figure 3 , Figure 3 This is a flowchart illustrating another method for enabling a RefSPAD matrix disclosed in an embodiment of this application. It includes steps 301-308.
[0115] 301. Open all SPAD cells in the RefSPAD matrix, set the photon count threshold of the RefSPAD matrix, and put the RefSPAD matrix into working state. Detect all SPAD cells to obtain the number of photons received by all SPAD cells.
[0116] In this embodiment, step 301 is the same as the aforementioned Figure 2 Step 201 is similar and will not be elaborated here. However, it should be noted that all RefSPAD matrix cells need to be opened, and the photon count threshold of the RefSPAD matrix needs to be set. This photon count threshold is the threshold value of the RefSPAD matrix. Then, perform a light emission and light absorption process on the RefSPAD matrix. The corresponding steps can be found in [reference needed]. Figure 1 In other words, the RefSPAD matrix enters its working state when it undergoes one emission and reception process. This allows for the detection of all SPAD cells within the RefSPAD matrix, thus obtaining the number of photons received by each SPAD cell.
[0117] In one embodiment, it is also necessary to perform a validity check on all SPAD units in the RefSPAD matrix. It is easy to understand that the validity check can be understood as a quality check, used to check whether the SPAD units are operating normally, etc.
[0118] If an invalid SPAD unit exists, proceed to step 303. If a valid SPAD unit exists, proceed to step 302.
[0119] 302. Input the photon count of all SPAD units into a preset calculation model to determine whether there is a combination of SPAD units that meets the photon count threshold. If yes, proceed to step 305; otherwise, proceed to step 304.
[0120] It is easy to understand that all SPAD cells at this point are valid SPAD cells. Specifically, the photon count of each valid SPAD cell is input into the computational model to determine whether there exists a combination of SPAD cells that meets the photon count threshold. If yes, proceed to step 305; otherwise, proceed to step 304.
[0121] In one embodiment, it is necessary to find the case where the number of SPAD units is maximized under a constraint. This constraint is that the total number of photons in the SPAD unit combination must be less than a photon count threshold. If yes, proceed to step 305; otherwise, proceed to step 304.
[0122] 303. If there are invalid SPAD units, remove the invalid SPAD units.
[0123] When there are invalid SPAD cells, they need to be removed, i.e., bad pixels need to be eliminated.
[0124] Then, step 302 can be executed, which means that the number of photons received by the remaining valid SPAD units can be input into the preset calculation model.
[0125] 304. Identify all SPAD units as SPADs that need to be enabled.
[0126] If no SPAD cell combination meets the photon number threshold, meaning the combination is empty, then all SPAD cells in the RefSPAD matrix need to be activated. This ensures a stable and effective reference waveform for the Main SPAD.
[0127] 305. Determine the SPAD unit combination as the SPAD that needs to be enabled.
[0128] In this embodiment, step 305 is the same as described above. Figure 2 Step 203 is similar and will not be elaborated here. However, it should be noted that in one embodiment, the RefSPAD matrix has three SPAD units, namely A, B, and C. Correspondingly, the number of photons received by A, B, and C at this time can be measured to be 2, 1, and 3, respectively. The photon count threshold is set to 5. Based on the above embodiment, this calculation model is a sorting type calculation model, which arranges the photon counts in ascending order and adds them sequentially without skipping steps. By sorting, B(1), A(2), and C(3) are obtained. Since the sum of the photon counts corresponding to units B and A is 3, which is less than the photon count threshold of 5, while the sum of the photon counts of units B, A, and C is 6, which is greater than 5, it can be determined that the SPAD unit combination at this time is unit A and unit B.
[0129] 306. Record the number of times each SPAD cell in the RefSPAD matrix is used.
[0130] Once the SPAD cell combination of the RefSPAD matrix is determined, it is also necessary to record the number of times the SPAD cell in each RefSPAD matrix cell is used.
[0131] 307. If the number of times a SPAD unit is used exceeds a preset threshold, stop using that SPAD unit.
[0132] When the number of uses or the amount of light received by any SPAD unit reaches a certain threshold, the use of that unit is prohibited. It's easy to understand that the SPAD unit has reached its operating threshold at this point. It's also easy to understand that this certain threshold, under certain conditions, can be understood as a preset number of uses threshold.
[0133] Correspondingly, after deactivating this SPAD cell, the RefSPAD matrix needs to be recalculated. This involves removing the deactivated SPAD cells and then calculating the remaining SPAD cells in the RefSPAD matrix. This can be done by executing step 302.
[0134] In one embodiment, assume the RefSPAD matrix contains four SPAD units, A, B, C, and D, with corresponding photon counts of 1, 2, 3, and 4. The photon count threshold is 8. After calculation, A, B, and C are determined to be a usable SPAD unit combination. However, after a period of use, if the light intake of unit C reaches the set threshold, unit C will be disabled. A, B, and C are then recalculated, yielding results of 1, 2, and 4. Since the maximum number of units in this SPAD unit combination is 3, units A, B, and D are then enabled.
[0135] In another embodiment, if a SPAD unit exceeds its lifespan, the faulty SPAD unit is skipped.
[0136] 308. If no SPAD unit combination exists, input the SPAD unit and all SPAD units into the preset calculation model to obtain the SPAD unit combination.
[0137] If, after recalculation, no corresponding SPAD unit combination exists (i.e., no reasonable matrix unit array can be obtained), then the unit will continue to be enabled for calculation. Specifically, the SPAD unit and other valid SPAD units are input into the computational model for recalculation to obtain the SPAD units.
[0138] It should be noted that in this embodiment, steps 306 to 308 may also be not executed. Specifically, steps 306 to 308 can be understood as an error correction algorithm. That is, in actual use, it is to prevent the aging and necrosis of SPAD caused by excessive use times of matrix units. A method of dynamically balancing the use times of each unit in the RefSPAD matrix is added.
[0139] Through a method for enabling a RefSPAD matrix in this embodiment, when the received light number of the RefSPAD reaches the threshold, the number of each SPAD unit in the SPAD matrix can reach the maximum, and the stability of the RefSPAD matrix is improved as much as possible. Correspondingly, load balancing of the aging process of a single SPAD in actual use is proposed, thereby extending the usage cycle of the device.
[0140] For the convenience of describing the calculation model in the embodiments of the present application in detail, please refer to Figure 4 , Figure 4 which is a schematic flowchart of another method for enabling a RefSPAD matrix disclosed in the embodiments of the present application. It includes steps 401 to 407. It should be noted that after step 404 or step 407 is executed, steps 306 to 3 steps 08 in Figure 3 can be executed, and details will not be described hereinafter. It should be noted in advance that steps 402 to 407 can be understood as Figure 3 steps 302 to 305 in
[0141] 401. Open all SPAD units in the RefSPAD matrix, set the photon number threshold of the RefSPAD matrix, and place the RefSPAD matrix in the working state to detect all SPAD units to obtain the photon numbers received by all SPAD units.
[0142] Step 401 in this embodiment is similar to step 301 in the foregoing Figure 3 and details will not be described here. However, it should be noted that in this embodiment, basic definitions need to be made for various parameters. Among them, when opening all RefSPAD matrix units, the threshold T_Value also needs to be set. T_Value is the threshold critical value (thresholdvalue), that is, the photon number threshold described above.
[0143] CX_SEL is the received light number of a single enabled SPAD, and the corresponding constraint condition is sum(CX_SEL) < T_Value. Where sum(CX_SEL) represents the sum of the received light numbers of multiple enabled SPADs, that is, the photon number sum value.
[0144] 402. Sort the number of photons acquired by all SPAD units, and add the photon counts one by one in ascending order to obtain the sum of the photon counts.
[0145] It is not difficult to understand that steps 402-404 only satisfy... Figure 1 Condition 1, as described in the document, means that the more RefSPADs are turned on when a certain threshold (total number of received lights) is triggered, the better.
[0146] It's important to clarify that the value function at this point is value = N, where N is the maximum number of SPAD cells. Therefore, the optimization direction can be identified as maximizing the value function, which means finding the combination with the maximum number of SPAD cells that satisfies sum(CX_SEL) < T_Value.
[0147] Specifically, after obtaining the number of photons received by all SPAD cells in the RefSPAD matrix, the photon counts are arranged in ascending order.
[0148] In one embodiment, when the RefSPAD matrix has three cells A, B, and C, and the corresponding received photon counts are 2, 1, and 3, the photon count threshold is 5. The values B(1), A(2), and C(3) are obtained by sorting. At this point, the photon count and value have two possible values: 3 and 6.
[0149] It is easy to understand that this embodiment does not limit the number of SPAD units contained in the RefSPAD matrix. The RefSPAD matrix can also contain 4, 5, or 6 SPAD units, etc. For ease of understanding and description, this will not be elaborated further. Correspondingly, there is no limit to the number of photons received by each SPAD unit.
[0150] 403. Determine whether the sum of photon counts is less than the photon count threshold, and select the largest sum of photon counts less than the photon count threshold.
[0151] As can be seen from step 402, the sum of photon counts for selected lists A and B is 3, which satisfies the condition of being less than the photon count threshold. However, the sum of photon counts for selected lists A, B, and C is 6, which does not satisfy the photon count threshold condition. Therefore, the SPAD unit with a sum of photon counts of 3 is selected.
[0152] 404. Based on the maximum sum of photons, determine the SPAD unit combination corresponding to each photon number in the sum of photons as the SPAD to be activated.
[0153] Since the maximum sum of photons under the given conditions is 3, SPAD cells A and B are chosen. However, it's easy to understand that the SPAD cell combination of cells A and B is a suboptimal solution; the optimal solution should be SPAD cells B and C, which correspond to a sum of photons of 4.
[0154] However, since the number of photons is arranged in ascending order and added sequentially without skipping steps, there is only a suboptimal solution.
[0155] It should be noted that the photon number and value can be understood as the sum of values. As described above, N is 2 in the value function at this point.
[0156] As another method, the optimal solution can be obtained.
[0157] 405. Determine the maximum value function, label all SPAD cells, and associate the labels with the photon count of the SPAD cells.
[0158] It is not difficult to understand that steps 405-407 satisfy... Figure 1 Conditions 1 and 2 described herein mean that the more RefSPADs are turned on when a certain threshold (total number of received lights) is triggered, the better. Under the condition of satisfying condition 1, the larger the CNT value is under the threshold constraint, the better.
[0159] It's important to clarify that Max(CX_ALL) represents the maximum number of light received by a single SPAD cell among all valid matrix cells, and N is the number of currently selected SPAD cells. The value function at this point is Value = (Max(CX_ALL) + 1) × N + sum(CX_SEL). Therefore, the optimization direction can be identified as maximizing the value function, which means finding the combination of SPAD cells with the maximum number of cells satisfying sum(CX_SEL) < T_Value.
[0160] In one embodiment, a dynamic programming (DP) algorithm is required. Specifically, this method can obtain an optimal solution by transforming the number of elements and photon count into a conversion factor using the formula f(x) = ax + b. This involves multiplying the maximum number of elements by Max(CX_ALL) + 1 to obtain the sum of the photon count and the photon count of the currently selected unit. dp(n+1) = dp(n) + value(n+1), where n is the label of the SPAD unit, and value is the value function, a function of the photon count.
[0161] First, the maximum value function in the dynamic programming (DP) algorithm needs to be determined, and all SPAD cells need to be labeled. Specifically, the maximum value function is dp[w] = max(dp[w], dp[w-wt[i]]+val[i]). Here, w is the weight, which is the number of photons corresponding to the SPAD cell, and i is the label corresponding to the SPAD cell. It is easy to understand that i is 0, 1, 2, 3, etc., and wt[i] can be understood as the number of photons corresponding to the label.
[0162] Here, val[i] is the value function Value=(Max(CX_ALL)+1)×N+sum(CX_SEL).
[0163] 406. Substitute the SPAD cell label and the corresponding photon number into the maximum value function to determine whether there is a combination of SPAD cells that satisfies the photon number threshold.
[0164] In one embodiment, when the RefSPAD matrix has three cells A, B, and C, and the corresponding received photon counts are 2, 1, and 3, the photon count threshold is 5. The corresponding labels are 0, 1, and 2. Here, w is the weight (2, 1, 3), and i is the label corresponding to A, B, and C.
[0165] Then we have val[0] = (Max(CX_ALL) + 1) × 1 + 2; val[1] = (Max(CX_ALL) + 1) × 1 + 1; val[2] = (Max(CX_ALL) + 1) × 1 + 3.
[0166] At this point, the label of the SPAD unit and the number of photons corresponding to the SPAD unit are substituted into the maximum value function dp[w]=max(dp[w],dp[w-wt[i]]+val[i]) to screen out whether there is a combination of SPAD units that meets the photon number threshold.
[0167] Specifically, first define the initial state when i = 0,
[0168] At this time, dp[5]=dp[4]=dp[3]=dp[2]=dp[1]=dp[0]=0.
[0169] Then when i = 0, wt[0] = 2, val[0] = (Max(CX_ALL) + 1) × 1 + 2, and correspondingly, dp[5] = max(dp[5], dp[5-2] + ((3+1) × 1 + 2)) = max(0, dp[3] + 4 + 2) = max(0, 6) = 6. It is not difficult to understand that the 2 in dp[5-2] refers to the photon number corresponding to i = 0 being 2. For ease of understanding and description, this will not be elaborated further.
[0170] dp[4]=max(dp[4],dp[4-2]+((3+1)×1+2))=max(0,dp[2]+4+2)=max(0,6)=6;
[0171] dp[3]=max(dp[3],dp[3-2]+((3+1)×1+2))=max(0,dp[1]+4+2)=max(0,6)=6;
[0172] dp[2]=max(dp[2],dp[2-2]+((3+1)×1+2))=max(0,dp[0]+4+2)=max(0,6)=6;
[0173] dp[1]=0 BC dp[w-wt[i]]=dp[1-2]invalid,undo, error message;
[0174] dp[0]=0 BC dp[w-wt[i]]=dp[0-2]invalid,undo, error message;
[0175] When the initial state i = 1,
[0176] At this point, we define dp[5] = dp[4] = dp[3] = dp[2] = 6; dp[1] = dp[0] = 0.
[0177] Therefore, when i = 1, w = 1.
[0178] dp[5]=max(dp[5],dp[5-1]+((3+1)×1+1))=max(6,dp[4]+4+1)=max(0,11)=11;
[0179] dp[4]=max(dp[4],dp[4-1]+((3+1)×1+1))=max(6,dp[3]+4+1)=max(6,11)=11;
[0180] dp[3]=max(dp[3],dp[3-1]+((3+1)×1+1))=max(6,dp[2]+4+1)=max(6,11)=11;
[0181] dp[2]=max(dp[2],dp[2-1]+((3+1)×1+1))=max(0,dp[1]+4+1)=max(6,5)=6;
[0182] dp[1]=max(dp[1],dp[1-1]+((3+1)×1+1))=max(0,dp[1]+4+1)=max(0,5)=5;
[0183] dp[0]=0 BC dp[w-wt[i]]=dp[0-2]invalid,undo, error message;
[0184] It should be noted that the 1 in dp[5-1] refers to the photon number corresponding to i=1 being 1. For ease of understanding and description, this will not be elaborated further.
[0185] When the initial state i = 2,
[0186] At this point, we define dp[5] = dp[4] = dp[3] = 11; dp[2] = 6; dp[1] = 5; dp[0] = 0.
[0187] Therefore, when i = 2, w = 3.
[0188] dp[5]=max(dp[5],dp[5-3]+((3+1)×1+3))=max(11,dp[2]+4+3)=max(11,13)=13;
[0189] dp[4]=max(dp[4],dp[4-3]+((3+1)×1+3))=max(11,dp[1]+4+3)=max(11,12)=12;
[0190] dp[3]=max(dp[3],dp[3-3]+((3+1)×1+3))=max(11,dp[0]+4+3)=max(11,7)=11;
[0191] dp[2]=6 BC dp[w-wt[i]]=dp[2-3]invalid,undo, error message;
[0192] dp[1]=5 BC dp[w-wt[i]]=dp[1-3]invalid,undo, error message;
[0193] dp[0]=0 BC dp[w-wt[i]]=dp[0-3]invalid,undo, error message;
[0194] It should be noted that the 3 in dp[5-3] refers to the number of photons corresponding to i=2 being 3. For ease of understanding and description, this will not be elaborated on further.
[0195] Therefore, the value of the maximum value function at this time is 13. Correspondingly, by finding the condition that is satisfied at this time, we can find that when i=2 and w=3, the maximum value of the dp function is 13. Thus, we determine that C is one of the units in the SPAD unit combination. According to the existence of a corresponding dp[2] function in the dp[5] function when i=2 and w=3, we can deduce upwards that the number of photons corresponding to 2 is A. Thus, we determine that the other SPAD unit is A.
[0196] Correspondingly, it can also be deduced that 13 comes from 6+7, 6 corresponds to dp[2], 2 corresponds to A, and w=3 corresponds to C.
[0197] 407. Determine the SPAD unit combination as the SPAD that needs to be enabled.
[0198] Based on the above steps, it can be determined that the SPAD unit combination at this time is SPAD unit A and SPAD unit C.
[0199] In one embodiment, the DP algorithm can be used to add the values in a skipping manner. If there are 100 SPADs, the DP value can be calculated by any combination, and a combination that meets the threshold can be found.
[0200] It needs to be explained that, in combination Figure 3 Steps 306-308 and steps 402-407 in this embodiment are described. It can be seen that steps 402-407 involve two different algorithms, both of which obtain the enabled RefSPAD from a purely algorithmic perspective. However, in practical use, to prevent excessive use of matrix units leading to aging and failure of the SPAD, a dynamic balancing method for the number of RefSPAD unit uses is incorporated. Figure 3 Steps 306-308. Details will not be elaborated here.
[0201] This embodiment proposes a method for opening RefSPAD matrices, including two algorithms: one based on sorting to calculate the combination of SPAD units, and the other based on dynamic programming (DP) algorithms. This leads to an optimal mathematical modeling approach and solution, improving the feasibility of the proposed solution.
[0202] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0203] If the plan involves sensitive information (such as user information or corporate information), it should state that the collection, use, and processing of sensitive information must comply with the laws, regulations, and standards of the relevant countries and regions, and must be carried out with the permission or consent of the relevant entities (such as users or enterprises).
[0204] Please see Figure 5 , Figure 5 This is a schematic diagram of the structure of a RefSPAD matrix opening system disclosed in an embodiment of this application.
[0205] Acquisition unit 501 is used to acquire the number of photons received by each SPAD unit in the RefSPAD matrix;
[0206] Input unit 502 is used to input the photon count of all SPAD units into a preset calculation model to determine whether there is a combination of SPAD units that meets the photon count threshold.
[0207] The determination unit 503 is used to determine the SPAD unit combination that needs to be turned on when there is a SPAD unit combination that meets the photon number threshold.
[0208] For example, the system further includes: an opening unit 504;
[0209] Open cell 504 is used to open all SPAD cells in the RefSPAD matrix and set the photon number threshold of the Ref SPAD matrix;
[0210] The acquisition unit 501 is specifically used to put the RefSPAD matrix into the working state and detect all SPAD units to obtain the number of photons received by all SPAD units.
[0211] For example, the system further includes: a rejection unit 505;
[0212] The rejection unit 505 is used to reject invalid SPAD units when there are invalid SPAD units.
[0213] For example, the system also includes:
[0214] The determination unit 503 is also used to determine all SPAD units as SPADs that need to be turned on when there is no combination of SPAD units that meets the photon number threshold.
[0215] For example, the system further includes: a recording unit 506 and an execution unit 507;
[0216] Recording unit 506 is used to record the number of times each SPAD unit in the RefSPAD matrix is used;
[0217] The execution unit 507 is used to stop using a SPAD unit when the number of times a SPAD unit is used exceeds a preset threshold, and to perform the step of inputting the photon count of all SPAD units into a preset calculation model to determine whether there is a combination of SPAD units that meets the photon count threshold.
[0218] For example, the system also includes:
[0219] The input unit 502 is also used to input the SPAD unit and all SPAD units into a preset calculation model to obtain a SPAD unit combination when no SPAD unit combination exists.
[0220] For example, the system further includes: a sorting unit 508 and a judgment unit 509;
[0221] The sorting unit 508 is used to sort the number of photons acquired by all SPAD units;
[0222] The acquisition unit 501 is specifically used to add the photon counts one by one in ascending order to obtain the sum of the photon counts;
[0223] The judgment unit 509 is used to determine whether the sum of photons is less than the photon count threshold, and select the largest sum of photons less than the photon count threshold.
[0224] The determination unit 503 is specifically used to determine the SPAD unit combination corresponding to each photon number in the maximum photon number and value as the SPAD to be activated when the SPAD unit combination is the SPAD to be activated.
[0225] For example, the system also includes:
[0226] Unit 503 is specifically used to determine the maximum value function;
[0227] The execution unit 507 is specifically used to label all SPAD units and associate the labels with the photon count of the SPAD units.
[0228] The determination unit 503 is specifically used to substitute the SPAD unit's label and the photon number corresponding to the SPAD unit into the maximum value function to determine whether there is a combination of SPAD units that satisfies the photon number threshold.
[0229] The execution unit 507 is specifically used to perform the step of determining the SPAD unit combination as a SPAD that needs to be turned on when there is a SPAD unit combination that meets the photon number threshold.
[0230] For example, the system further includes: a computing unit 510;
[0231] The computing unit 510 is specifically used to use the DP algorithm to find the maximum value function dp(n+1)=dp(n)+value(n+1), where n is the label of the SPAD unit and value is the value function of the photon number;
[0232] The calculation unit 510 is also used to calculate the first dp value of the first SPAD unit according to the maximum value function;
[0233] The calculation unit is also used to calculate the second dp value of the second SPAD unit using the first dp value;
[0234] The calculation unit 510 is also used to calculate the ndp value of the nth SPAD unit using the (n-1)th dp value of the nth SPAD unit; where n is a natural number greater than 1.
[0235] Unit 503 is specifically used to select the maximum dp value among all dp values. By analyzing the composition of the maximum dp value, the combination of SPAD unit labels is obtained to determine whether there is a combination of SPAD units that satisfies the photon number threshold.
[0236] For example, the system also includes:
[0237] If the photon number threshold is y, then the dp value of each SPAD unit includes at least y+1 dp values; where y is a natural number greater than or equal to 1.
[0238] Please refer to the following: Figure 6 The schematic diagram of the structure of a RefSPAD matrix opening device disclosed in this application includes:
[0239] Central processing unit 601, memory 605, input / output interface 604, wired or wireless network interface 603, and power supply 602;
[0240] Memory 605 is either a short-term storage memory or a persistent storage memory;
[0241] The central processing unit 601 is configured to communicate with the memory 605 and execute instructions stored in the memory 605 to perform the aforementioned operations. Figure 2 , Figure 3 or Figure 4 The method in the illustrated embodiment.
[0242] This application also provides a chip system, characterized in that the chip system includes at least one processor and a communication interface, the communication interface and the at least one processor are interconnected via a circuit, and the at least one processor is used to run computer programs or instructions to perform the aforementioned... Figure 2 , Figure 3 or Figure 4 The method in the illustrated embodiment.
[0243] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0244] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection between apparatuses or units through some interfaces, and may be electrical, mechanical, or other forms.
[0245] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0246] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0247] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
Claims
1. A method for opening a Ref SPAD matrix, characterized in that, The method includes: Obtain the number of photons received by each SPAD cell in the Ref SPAD matrix; The photon count of all SPAD units is input into a preset calculation model to determine whether there is a combination of SPAD units that meets the photon count threshold. If so, determine that the SPAD unit combination is the SPAD that needs to be activated; The step of inputting the photon count of all SPAD units into a preset calculation model to determine whether there is a combination of SPAD units that meets the photon count threshold includes: Sort the number of photons acquired by all SPAD units; The photon counts are added one by one in ascending order to obtain the sum of the photon counts; Determine whether the sum of the photon counts is less than the photon count threshold, and select the largest sum of photon counts less than the photon count threshold; The step of determining that the SPAD unit combination is a SPAD that needs to be activated includes: If so, based on the maximum sum of photons, determine the combination of SPAD units corresponding to each photon count in the sum of photons as the SPADs to be activated; Alternatively, the step of inputting the photon count of all SPAD units into a preset calculation model to determine whether there exists a combination of SPAD units that meets the photon count threshold includes: Determine the maximum value function; the maximum value function is: The The maximum number of light received by a single SPAD unit among all SPAD units, where N is the number of selected SPAD units. For the photon number and value of the selected SPAD unit; All SPAD units are labeled, and the labels are associated with the number of photons in each SPAD unit. Substitute the SPAD cell label and the corresponding photon number into the maximum value function to determine whether there is a combination of SPAD cells that satisfies the photon number threshold. If so, proceed with the step of determining that the SPAD unit combination is a SPAD that needs to be enabled.
2. The opening method according to claim 1, characterized in that, The process of obtaining the number of photons received by each SPAD cell in the Ref SPAD matrix includes: Open all SPAD cells in the Ref SPAD matrix and set the photon number threshold of the Ref SPAD matrix; The Ref SPAD matrix is put into operation, and all SPAD cells are detected to obtain the number of photons received by all SPAD cells.
3. The opening method according to claim 2, characterized in that, After setting the Ref SPAD matrix to an active state and detecting all SPAD cells, the method further includes: If an invalid SPAD unit exists, remove the invalid SPAD unit.
4. The opening method according to claim 1, characterized in that, After inputting the photon counts of all SPAD units into a preset calculation model to determine whether there is a combination of SPAD units that meets the photon count threshold, the method further includes: If not, determine that all SPAD units are SPADs that need to be enabled.
5. The opening method according to claim 1, characterized in that, After determining that the SPAD unit combination is a SPAD that needs to be activated, the method further includes: Record the number of times each SPAD cell in the Ref SPAD matrix is used; If the number of times a certain SPAD unit is used exceeds a preset threshold, the use of that SPAD unit is stopped, and the step of inputting the photon count of all SPAD units into a preset calculation model is executed to determine whether there is a combination of SPAD units that meets the photon count threshold is performed.
6. The opening method according to claim 5, characterized in that, After ceasing the use of the SPAD unit, the method further includes: If the SPAD unit combination does not exist, the SPAD unit and all SPAD units are input into the preset calculation model to obtain the SPAD unit combination.
7. The opening method according to claim 1, characterized in that, The step of substituting the SPAD cell label and the corresponding photon number into the maximum value function to determine whether there exists a combination of SPAD cells that satisfies the photon number threshold includes: Find the maximum value function using the dynamic programming (DP) algorithm. Where n is the label of the SPAD unit, and value is the value function of the photon number; Calculate the first dp value of the first SPAD unit based on the maximum value function; Using the first dp value, calculate the second dp value of the second SPAD unit; Calculate the nth dp value of the nth SPAD unit using the (n-1)th dp value of the nth SPAD unit; where n is a natural number greater than 1. Select the largest dp value from all dp values, and then parse the result based on the composition of the largest dp value. The combination of SPAD cell labels is used to determine whether there exists a combination of SPAD cells that satisfies the photon number threshold.
8. The opening method according to claim 7, characterized in that, The method further includes: If the photon number threshold is y, then the dp value of each SPAD unit includes at least y+1 dp values; where y is a natural number greater than or equal to 1.
9. A SPAD matrix activation system, characterized in that, The system includes: The acquisition unit is used to acquire the number of photons received by each SPAD unit in the Ref SPAD matrix; The input unit is used to input the photon count of all SPAD units into a preset calculation model to determine whether there is a combination of SPAD units that meets the photon count threshold. A determining unit is used to determine that a SPAD unit combination that meets a photon number threshold is a SPAD that needs to be activated when there is such a combination. The system also includes: a sorting unit and a judgment unit; The sorting unit is used to sort the number of photons acquired by all the SPAD units; The acquisition unit is specifically used to add the photon counts one by one in ascending order to obtain the sum of the photon counts; The judgment unit is used to determine whether the sum of the photon counts is less than the photon count threshold, and select the largest sum of the photon counts less than the photon count threshold; The determining unit is specifically used to determine, based on the maximum photon count and value, the combination of SPAD units corresponding to each photon count in the photon count and value that is to be activated when the SPAD unit combination is to be activated. Alternatively, the system may further include: The determining unit is specifically used to determine the maximum value function; the maximum value function is... The The maximum number of light received by a single SPAD unit among all SPAD units, where N is the number of selected SPAD units. For the photon number and value of the selected SPAD unit; The execution unit is specifically used to label all the SPAD units and associate the labels with the number of photons in the SPAD units. The determining unit is specifically used to substitute the SPAD unit's label and the number of photons corresponding to the SPAD unit into the maximum value function to determine whether there is a combination of SPAD units that satisfies the photon number threshold. The execution unit is specifically used to perform the step of determining that the SPAD unit combination is a SPAD that needs to be activated when there is a SPAD unit combination that meets the photon number threshold.