Data acquisition method and device based on gain switching and storage medium
By determining the first and second gains in multi-level gain switching and combining weighting and smoothing processes, the data jump problem is solved, ensuring the consistency and accuracy of data acquisition and improving the user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING XIAOMI MOBILE SOFTWARE CO LTD
- Filing Date
- 2020-08-05
- Publication Date
- 2026-07-31
AI Technical Summary
In devices with multi-level gain switching, data may suddenly increase or decrease during gain switching, or the data may fluctuate back and forth between increasing and decreasing, affecting the function and causing inaccurate data acquisition after increasing hysteresis.
By determining the first and second gains to be switched when collecting data, and collecting data based on these gains, combined with weighting and smoothing, the consistency of data collection is ensured and jumps are avoided.
This achieves data consistency after the same data to be collected, avoids data jump issues, and improves the accuracy of data collection and user experience.
Smart Images

Figure CN114070315B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of data acquisition technology, and in particular to a data acquisition method, apparatus and storage medium based on gain switching. Background Technology
[0002] In related technologies, the sampling of sample data by adjusting the gain of an analog-to-digital converter (ADC) to enable products with ADC functionality to perform corresponding functions has been widely used. For example, for light sensors with multi-level gain switching functions on terminals, the automatic screen dimming function is commonly used by switching the gain during the process of collecting the light intensity of the terminal's environment.
[0003] For devices with multi-level gain switching capabilities, gain switching is typically performed based on the correspondence between the acquired data and the gain. However, during gain switching, devices with multi-level gain switching capabilities may exhibit sudden increases or decreases in data at the gain switching edges, or data jumps back and forth between increases and decreases, affecting the functional performance. To improve this data jump phenomenon, a hysteresis space is generally added during gain switching to prevent data jumps.
[0004] However, while increasing the hysteresis space alleviates the data fluctuation phenomenon to some extent, it can also lead to inaccurate data acquisition and output. For example, when a light sensor is collecting light intensity, if the ambient light intensity is currently within the hysteresis space, the initial state of the light intensity corresponds to calculating and outputting the light intensity using gain 2. If the light sensor is then blocked by hand, the gain switches to gain 1 for calculation and output. If the blockage is then lifted, the increased hysteresis space means that gain 1 will still be used to calculate and output the light intensity. Therefore, the calculated and output light intensity will differ from the initial calculated and output light intensity, resulting in inconsistent light intensity acquisition under the same environment. Summary of the Invention
[0005] To overcome the problems existing in related technologies, this disclosure provides a data acquisition method, device and storage medium based on gain switching.
[0006] According to a first aspect of the present disclosure, a data acquisition method based on gain switching is provided. The data acquisition method based on gain switching includes: determining data to be acquired, and determining a first gain and a second gain to be switched when acquiring the data to be acquired; acquiring data from the data to be acquired based on the first gain and the second gain, and outputting the acquired data.
[0007] In one implementation, determining a first gain and a second gain to be switched when collecting the data to be collected includes: determining the gain corresponding to a first data interval as the first gain based on the correspondence between data intervals and gains, and determining the gain corresponding to a second data interval as the second gain, wherein the first data interval and the second data interval are different data intervals corresponding to each data within the variation range of the data to be collected.
[0008] In another implementation, the data acquisition based on the first gain and the second gain includes: determining a first weight and a second weight based on the data to be acquired, the first data interval, and the second data interval, wherein the first weight is the weight for acquiring data from the data to be acquired based on the first gain, and the second weight is the weight for acquiring data from the data to be acquired based on the second gain; and acquiring data from the data to be acquired based on the first gain and the second gain according to the first weight and the second weight.
[0009] In another embodiment, the first data interval has a first boundary value adjacent to the second data interval, and the second data interval has a second boundary value adjacent to the first data interval; determining a first weight and a second weight based on the data to be collected, the first data interval, and the second data interval includes: if the difference between the data to be collected and the first boundary value of the first data interval is greater than the difference between the data to be collected and the second boundary value of the second data interval, then the first weight is less than the second weight; if the difference between the data to be collected and the first boundary value of the first data interval is less than the difference between the data to be collected and the second boundary value of the second data interval, then the first weight is greater than the second weight; if the difference between the data to be collected and the first boundary value of the first data interval is equal to the difference between the data to be collected and the second boundary value of the second data interval, then the first weight is equal to the second weight.
[0010] In another embodiment, the output of the acquired data includes: outputting the currently acquired data after smoothing the data.
[0011] In another embodiment, the step of smoothing the currently collected data and then outputting it includes: outputting the average of the currently collected data and a preset number of already collected data as the output data.
[0012] According to a second aspect of the present disclosure, a data acquisition device based on gain switching is provided. The data acquisition device based on gain switching includes: a determining module, configured to determine data to be acquired, and to determine a first gain and a second gain to be switched when acquiring the data to be acquired; and an acquisition module, configured to acquire the data to be acquired based on the first gain and the second gain, and to output the acquired data.
[0013] In one implementation, the determining module is used to: determine the gain corresponding to a first data interval as a first gain based on the correspondence between data intervals and gains, and determine the gain corresponding to a second data interval as a second gain, wherein the first data interval and the second data interval are different data intervals corresponding to each data within the data variation interval to be collected.
[0014] In another embodiment, the acquisition module is used to: determine a first weight and a second weight based on the data to be acquired, the first data interval, and the second data interval, wherein the first weight is a weight for acquiring data from the data to be acquired based on the first gain, and the second weight is a weight for acquiring data from the data to be acquired based on the second gain; and acquire data from the data to be acquired based on the first gain and the second gain according to the first weight and the second weight.
[0015] In another embodiment, the first data interval has a first boundary value adjacent to the second data interval, and the second data interval has a second boundary value adjacent to the first data interval; the acquisition module is configured to: if the difference between the data to be acquired and the first boundary value of the first data interval is greater than the difference between the data to be acquired and the second boundary value of the second data interval, then the first weight is less than the second weight; if the difference between the data to be acquired and the first boundary value of the first data interval is less than the difference between the data to be acquired and the second boundary value of the second data interval, then the first weight is greater than the second weight; if the difference between the data to be acquired and the first boundary value of the first data interval is equal to the difference between the data to be acquired and the second boundary value of the second data interval, then the first weight is equal to the second weight.
[0016] In another embodiment, the device further includes a reprocessing module for: smoothing the currently acquired data before outputting it.
[0017] In another embodiment, the reprocessing module is used to output the average of the currently collected data and a preset number of collected data as output data.
[0018] According to a third aspect of the present disclosure, a data acquisition device based on gain switching is provided. The data acquisition device based on gain switching includes: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to execute the data acquisition method based on gain switching according to the first aspect of the present disclosure or any embodiment thereof.
[0019] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium is provided, wherein when instructions in the storage medium are executed by a processor of a mobile terminal, the mobile terminal is enabled to perform the gain-switching-based data acquisition method described in the first aspect of the present disclosure or any embodiment of the first aspect.
[0020] The technical solutions provided by the embodiments of this disclosure may include the following beneficial effects: The data acquisition method based on gain switching provided by this disclosure determines the first gain and the second gain to be switched when acquiring the data to be acquired, and acquires the data to be acquired based on the determined first gain and the second gain. On the one hand, it can ensure that the acquired data output for the same data to be acquired has consistency. On the other hand, it can also avoid the problem of data jump in the acquired data output.
[0021] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0022] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.
[0023] Figure 1 This diagram illustrates a jump in the acquired data during gain switching.
[0024] Figure 2 This diagram illustrates another scenario where the acquired data jumps during gain switching.
[0025] Figure 3 This is a flowchart illustrating a data acquisition method based on gain switching according to an exemplary embodiment;
[0026] Figure 4 This is a flowchart illustrating data acquisition based on a first gain and a second gain according to an exemplary embodiment;
[0027] Figure 5 This diagram illustrates the result of data acquisition by adjusting the gain according to the weight during gain switching.
[0028] Figure 6 This diagram illustrates a smoothing process for currently collected data.
[0029] Figure 7 This diagram illustrates another method for smoothing the currently acquired data.
[0030] Figure 8 This diagram illustrates the result of smoothing the acquired data during gain switching.
[0031] Figure 9 This is a block diagram illustrating a gain-switching-based data acquisition device according to an exemplary embodiment;
[0032] Figure 10 This is a block diagram illustrating an apparatus for gain-switching-based data acquisition according to an exemplary embodiment. Detailed Implementation
[0033] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.
[0034] In related technologies, adjusting the gain of an analog-to-digital converter (ADC) to sample data, enabling products with ADC functionality to perform corresponding functions, has been widely adopted. For example, for a light sensor with multi-level gain switching capabilities on a terminal, when acquiring the light intensity of the environment, the light sensor needs to switch different gains to ensure that the acquired information about the light intensity of the environment (e.g., CRGB channel values) is within the reasonable operating range of the ADC during the acquisition of light intensity data. This prevents the data acquired by the light sensor from having too low resolution or exceeding the ADC's measurement range.
[0035] However, during gain switching, the acquired data often carries the risk of abrupt changes. For example... Figure 1 As shown, Figure 1 This diagram illustrates a jump in the acquired data during gain switching.
[0036] This is because, ideally, when switching between different gain levels, the data to be collected by the light sensor also needs to change accordingly to ensure that the collected data does not jump around. However, in practical applications, the gain change factor of the light sensor and the change factor of the data to be collected are not necessarily proportional. Therefore, at the edge of gain switching, data may suddenly increase or decrease, or data may jump back and forth between increasing and decreasing, affecting the functional performance.
[0037] exist Figure 1 In the diagram, the first light intensity of 30 corresponds to gain 1, and the second light intensity of 10 corresponds to gain 2, where the first light intensity is less than the second. When the data to be acquired abruptly changes from the first light intensity of 30 to the second light intensity of 10, gain switching (20) is required to ensure that the analog-to-digital converter (ADC) operates within a reasonable range when acquiring light intensity. However, this gain switching (20) process can cause the acquired data to suddenly increase or decrease at the gain switching edges, or exhibit data jumps between increasing and decreasing values, affecting the functionality.
[0038] It should be noted that if the data to be collected is light intensity, the collected light intensity can be obtained based on the gain in the following way.
[0039] LUX (采集后) =DWF*(K c *C+K r *R+K g *G+K b *B) / (Again*Atime)
[0040] Where C, R, G, and B are the CRGB channel values (C, R, G, B) corresponding to the light intensity to be collected; DWF and K mentioned in the above formula c K r K g and K b is the parameter value after linear programming; Again is the gain corresponding to the data to be collected (light intensity); Atime is the acquisition parameter of the acquisition device.
[0041] According to relevant technical records, currently, the aforementioned phenomenon of data fluctuations can be alleviated by increasing hysteresis space, but this does not completely solve the technical problem. For example... Figure 2 As shown, Figure 2 This diagram illustrates another scenario where the acquired data undergoes a jump during gain switching.
[0042] In one example, when the light sensor is collecting light intensity, the ambient light intensity is in the hysteresis space. The initial state of the current light intensity (second light intensity 10) corresponds to the calculation and output of the light intensity using gain 2. If the light sensor is blocked by hand, the gain switching process 20 switches the gain to gain 1 and outputs the corresponding light intensity. If the light sensor is then unblocked, due to the added hysteresis space, it will still use gain 1 to calculate and output the corresponding light intensity. Therefore, the calculated and output light intensity differs from the light intensity calculated and output in the initial state, resulting in inconsistent light intensity collection under the same environment.
[0043] This disclosure provides a data acquisition method based on gain switching. By determining the first gain and the second gain to be switched when acquiring the data to be acquired, and acquiring the data based on the first gain and the second gain, on the one hand, it can ensure the consistency of the acquired data output for the same data to be acquired, and on the other hand, it can also avoid the problem of data jump in the acquired data output.
[0044] The gain-switching-based data acquisition method provided in this disclosure can be applied to devices with multi-level gain switching capabilities, so that gain switching does not affect the sampled values. In one example, the gain-switching-based data acquisition method provided in this disclosure can be applied to the light sensor of a terminal.
[0045] Figure 3 This is a flowchart illustrating a data acquisition method based on gain switching according to an exemplary embodiment. Figure 3 As shown, the data acquisition method based on gain switching includes steps S11 and S12. Each step will be described in detail below.
[0046] In step S11, the data to be collected is determined, and the first gain and the second gain to be switched when collecting the data are determined.
[0047] In one example, the data to be collected could be the light intensity of the environment in which the terminal is located. During the application, the data to be collected can be acquired through gain, and the brightness of the terminal's display screen can be adjusted based on the acquired data to adapt to the current environment in which the terminal is located.
[0048] Since the brightness of the terminal's display screen is adjusted based on the collected data, the accuracy of the collected data and any data jumps will affect the user's experience during use.
[0049] Furthermore, since the acquired data is determined based on the data to be acquired and the gain of acquiring the data to be acquired, it is necessary to determine the gain of acquiring the data to be acquired.
[0050] It should be noted that the data to be collected is often corresponding to the gain used to collect that data; different data to be collected correspond to different gains.
[0051] In one example, the first and second gains to be switched when acquiring data can be determined in the following way.
[0052] Based on the correspondence between data intervals and gains, the gain corresponding to the first data interval is determined as the first gain, and the gain corresponding to the second data interval is determined as the second gain. Here, the first data interval and the second data interval are different data intervals corresponding to each data point within the range of data variation to be collected.
[0053] It should be noted that the data range and gain can be preset in advance.
[0054] If the data range to be collected (e.g., the light intensity to be collected) is 0 Lux-200 Lux, then it corresponds to the first gain; if the data range to be collected is 200 Lux-500 Lux, then it corresponds to the second gain; if the data range to be collected is 500 Lux-800 Lux, then it corresponds to the third gain.
[0055] Since the gain switching of the data to be acquired is often related to different gains—for example, when the light intensity to be acquired is around 200 Lux, the acquired data may be related to a first gain and a second gain—this embodiment, by determining the first gain and the second gain to be switched when acquiring the data, can, on the one hand, lay the foundation for obtaining consistent acquired data for the same light intensity to be acquired; and on the other hand, it can also lay the foundation for avoiding data jumps in the output acquired data.
[0056] In step S12, data is acquired based on the first gain and the second gain, and the acquired data is output.
[0057] In the application process, when the data to be collected is in the data range corresponding to the gain switching that is about to be completed or has just been completed, the data to be collected can be collected based on the first gain and the second gain. By continuously switching the two gains, a fixed gain can be configured for the same data to be collected, and the data can be collected based on the fixed gain, so that the data collected after the output of the same data to be collected is consistent.
[0058] Continuing with the example of the relationship between light intensity and gain described above, since 200 Lux is the critical point for a change in gain, to ensure consistency in the acquired data and to prevent data jumps, the light intensity range of 180-220 Lux can be considered as the data range corresponding to the point where the gain switch is about to occur or has just been completed. Within this data range, the first and second gains can be used to acquire the data.
[0059] The data acquisition method based on gain switching provided in this disclosure determines a first gain and a second gain to be switched when acquiring data to be acquired, and acquires data based on the first gain and the second gain. On the one hand, this ensures that the acquired data output for the same data to be acquired is consistent, and on the other hand, it can also avoid the problem of data jumps in the acquired data output.
[0060] This disclosure will illustrate the process of data acquisition based on a first gain and a second gain through the following embodiments.
[0061] Figure 4 This is a flowchart illustrating data acquisition based on a first gain and a second gain according to an exemplary embodiment.
[0062] In an exemplary embodiment of this disclosure, such as Figure 4 As shown, data acquisition based on the first gain and the second gain includes steps S21 and S22. Each step will be described in detail below.
[0063] In step S21, a first weight and a second weight are determined based on the data to be collected, the first data interval, and the second data interval. The first weight is the weight for collecting data based on the first gain, and the second weight is the weight for collecting data based on the second gain.
[0064] During application, when the data to be collected is in the data range corresponding to the period when gain switching is about to complete or has just been completed, data can be collected based on the first gain and the second gain. The first weight and the second weight will be determined according to the relationship between the data to be collected and the first and second data ranges.
[0065] In step S22, data is acquired based on the first gain and the second gain, according to the first weight and the second weight.
[0066] In one example, the acquired data can be determined based on the weighted average of the data acquired with the first gain and the data acquired with the second gain. In another example, the acquired data can also be determined by acquiring the data to be acquired multiple times with the first gain and the second gain respectively, and then determining the final output acquired data based on the multiple acquired data. The ratio of the number of times the data to be acquired is acquired based on the first gain to the number of times it is acquired based on the second gain is the same as the ratio of the first weight to the second weight.
[0067] As described above, when the data to be collected is in the data range corresponding to the gain switching that is about to or has just completed, this embodiment of the present disclosure makes the gain switching 20 more delicate and gradual, so as to ensure that the data to be collected in the data range corresponding to the gain switching that is about to or has just completed will not change after collection. Figure 5 This illustrates a schematic diagram showing the data acquisition results during gain switching by adjusting the gain according to the weights. Figure 5 It can be seen that the data to be acquired in the data range corresponding to the gain switching that is about to or has just completed does not experience any jumps after acquisition. Furthermore, by comparing with... Figure 1 By comparison, it can be seen that the present embodiment makes the gain switching 20 more delicate and gradual, which can ensure that the acquired data will not change abruptly.
[0068] In one example, the brightness of the terminal's display screen can be adjusted based on the collected data. On the one hand, this allows the screen brightness to adapt to the current environment of the terminal, ensuring consistency between the collected data and the output data. On the other hand, it also ensures that the changes in screen brightness are gradual, preventing sudden brightening or dimming of the screen, thus providing a better user experience.
[0069] Since the first and second weights affect the collected data, a reasonable allocation of the first and second weights will ensure the rationality of the collected data. This disclosure will illustrate the process of determining the first and second weights based on the data to be collected, a first data interval, and a second data interval through the following embodiments.
[0070] In an exemplary embodiment of this disclosure, a first data interval has a first boundary value adjacent to a second data interval, and a second data interval has a second boundary value adjacent to the first data interval. The first boundary value can be understood as the data to be acquired corresponding to the point where gain switching is about to occur. The first boundary value can be a value located within the first data interval, close to the upper limit of the first data interval. If the first data interval has a light intensity of 0 Lux-200 Lux, then 200 Lux can be understood as the upper limit of the first data interval. Since light intensities of 170 Lux, 180 Lux, and 190 Lux can all be understood as values close to the upper limit of the first data interval (200 Lux), therefore, 170 Lux, 180 Lux, and 190 Lux can all be used as the first boundary value of the first data interval. The first boundary value can be adjusted according to actual conditions; for example, it can be 180 Lux. In this disclosure, the first boundary value is not specifically limited.
[0071] Accordingly, the second boundary value can be understood as the data to be acquired at the point where the gain switching has just been completed. The second boundary value can be a value located within the second data interval, close to the lower limit of the second data interval. If the second data interval is a light intensity of 200 Lux-500 Lux, then 200 Lux can be understood as the lower limit of the second data interval. Since light intensities of 210 Lux, 220 Lux, and 230 Lux can all be understood as values close to the lower limit of the second data interval (200 Lux), therefore, 210 Lux, 220 Lux, and 230 Lux can all be used as the second boundary value of the second data interval. The second boundary value can be adjusted according to actual conditions; for example, it can be 220 Lux. In this disclosure, no specific limitation is made on the second boundary value.
[0072] During application, if the difference between the data to be collected and the first boundary value of the first data interval is greater than the difference between the data to be collected and the second boundary value of the second data interval, then the first weight is less than the second weight; if the difference between the data to be collected and the first boundary value of the first data interval is less than the difference between the data to be collected and the second boundary value of the second data interval, then the first weight is greater than the second weight; if the difference between the data to be collected and the first boundary value of the first data interval is equal to the difference between the data to be collected and the second boundary value of the second data interval, then the first weight is equal to the second weight.
[0073] Continuing with the example of the correspondence between light intensity and gain described above, as can be seen from the description, the first data range of light intensity to be collected is 0 Lux-200 Lux, which corresponds to the first gain; the second data range of light intensity to be collected is 200 Lux-500 Lux, which corresponds to the second gain. Furthermore, light intensity of 180 Lux-220 Lux can be considered as the data range corresponding to the period when the gain switch is about to complete or has just been completed. Within this data range, the first gain and the second gain are used to collect the data.
[0074] In one embodiment, the data to be acquired can be acquired using a first gain and a second gain, respectively, and the weighted average of the acquired data can be used as the final output data. Let the light intensity to be acquired be 190 Lux. Since the difference between the light intensity to be acquired (190 Lux) and the first boundary value of the first data interval (180 Lux) (190-180=10 Lux) is less than the difference between the light intensity to be acquired (190 Lux) and the second boundary value of the second data interval (220 Lux) (220-190=30 Lux), it can be determined that the first weight is greater than the second weight. In one embodiment, the ratio between the difference between the light intensity to be acquired and the first boundary value and the difference between the second boundary value and the light intensity to be acquired can be used as the ratio between the first weight and the second weight. In this embodiment, the first weight is 0.75 and the second weight is 0.25.
[0075] It should be noted that if the data to be acquired is not located in the data range corresponding to the data about to or just completed a gain switch (180 Lux-220 Lux), but is simply located in the first or second data range, for example, if the light intensity to be acquired is 170 Lux, then it is not necessary to acquire the data based on both the first and second gains simultaneously. Instead, the data can be acquired based on the first gain, in which case the first weight is 1 and the second weight is 0. Based on the same principle, if the light intensity to be acquired is 230 Lux, then it is not necessary to acquire the data based on both the first and second gains simultaneously. Instead, the data can be acquired based on the second gain, in which case the first weight is 0 and the second weight is 1.
[0076] Furthermore, the data to be acquired is acquired based on a first gain to obtain the first acquired data; the data to be acquired is acquired based on a second gain to obtain the second acquired data. The final acquired data is then determined by the weighted average of the first and second acquired data. It should be noted that the weight corresponding to the first acquired data is the first weight, and the weight corresponding to the second acquired data is the second weight.
[0077] In another example, the acquired data can be further processed by repeatedly acquiring the data using both a first gain and a second gain, and the final output data can be determined based on these multiple acquired data sets. For example, the final output data can be determined based on the average of the multiple acquired data sets. The ratio of the number of times the data is acquired using the first gain to the number of times it is acquired using the second gain is the same as the ratio of the first weight to the second weight.
[0078] In one example, taking the light intensity of 180Lux-220Lux as the data range corresponding to the data being about to or just completed gain switching, the number of times the data to be collected is collected based on the first gain and the number of times the data to be collected is collected based on the second gain can be determined by Table 1.
[0079] Table 1 shows the number of times the data to be collected is collected during gain switching.
[0080]
[0081] In one example, if the light intensity to be collected is 200 Lux, the light intensity to be collected can be collected twice based on the first gain and twice based on the second gain. The average value of all the collected data can then be calculated and used as the final output of the collected data.
[0082] In another example, the number of times the data to be collected is acquired based on the first gain and the number of times the data to be collected is acquired based on the second gain can be determined according to the ratio of the first weight and the second weight, as shown in Table 2. Taking the weight allocation with the sum of the first weight and the second weight being 8 as an example, the switching weights of the first gain and the second gain during the gain switching acquisition process are shown in Table 2.
[0083] Table 2 shows the number of times the data to be collected is collected during gain switching.
[0084]
[0085]
[0086] Continuing with the example of light intensity ranging from 180 Lux to 220 Lux, which corresponds to the data range where the gain switch is about to occur or has just been completed, in the application process, if the data to be collected is 0 Lux to 170 Lux, it can be collected based on the first gain and the second gain according to the ratio of first weight to second weight = 8:0; if the data to be collected is 180 Lux, it can be collected based on the ratio of first gain to second weight = 7:1; if the data to be collected is 220 Lux, it can be collected based on the ratio of first gain to second weight = 1:7; and if the data to be collected is 220 Lux to 500 Lux, it can be collected based on the ratio of first gain to second weight = 0:8.
[0087] In this embodiment, when the data to be collected is in the data range corresponding to a gain switch that is about to or has just completed, the gain switch can be handled more delicately and smoothly during data collection based on gain. This ensures that the collected data in the data range corresponding to the data range that is about to or has just completed a gain switch will not experience any abrupt changes after collection, and also ensures the timeliness of the collected data readings. Furthermore, adjusting the brightness of the terminal's display screen based on the collected data allows the screen brightness to adapt to the current environment of the terminal, ensuring the consistency of the collected data output. Moreover, it also ensures that changes in screen brightness are gradual, preventing sudden brightening or dimming of the screen, thus providing a better user experience.
[0088] To further ensure that the output data does not exhibit data jumps, embodiments of this disclosure may further process the acquired data to prevent such jumps. This disclosure illustrates the process of processing the output data through the following embodiments.
[0089] In an exemplary embodiment of this disclosure, the currently collected data can be smoothed before output. In one example, the average of the currently collected data and a preset number of previously collected data can be output as the output data. Figure 6 As shown, Figure 6 This demonstrates how the currently collected data is smoothed and then output based on the average of the currently collected data and a preset number of previously collected data.
[0090] In the application, the currently acquired data can be designated as Data1, and Data2-Data8 can be the data that has already been acquired. Both Data1 and the acquired data (Data2-Data8) can be acquired based on a first gain and a second gain. Let the preset quantity be 8. The average of the currently acquired data (Data1) and the preset quantity of acquired data (Data2-Data8) is used as the output data (Avg1) of the currently acquired data (Data1).
[0091] It should be noted that the output data (Avg1) obtained above regarding the currently collected data (Data1) can be used as the data that has been collected for the next currently collected data. That is, for the next currently collected data (Data0), the output data (Avg1) of the currently collected data (Data1) is the data that has been collected.
[0092] It should be noted that the smoothing process for the currently collected data is not limited to calculating the mean between the currently collected data and a preset number of collected data. Other methods can also be used. For example, the mode of the currently collected data and the preset number of collected data, or the average of the currently collected data and the preset number of collected data after removing the maximum and minimum values, can be used as the output data.
[0093] In order to resolve the issues in this disclosure Figure 1 and Figure 2 The risk of data abrupt changes during gain switching can also be mitigated through the following implementation methods.
[0094] In one example of this disclosure, the currently collected data can be smoothed before output. In one example, the average of the currently collected data and a preset number of previously collected data can be output as the output data. For example... Figure 7 As shown, Figure 7 This demonstrates how the currently collected data is smoothed and then output based on the average of the currently collected data and a preset number of previously collected data.
[0095] In application, the currently acquired data can be designated as Data1, and Data2-Data8 as the data that has been acquired. The currently acquired data Data1 and the acquired data Data2-Data8 can be acquired solely based on either the first gain or the second gain. In other words, the currently acquired data Data1 and the acquired data Data2-Data8 can be acquired according to... Figure 1 or Figure 2The data was collected using the method shown. The preset quantity is set to 8. The average of the currently collected data (Data1) and the preset quantity of collected data (Data2-Data8) is used as the output data (Avg1) of the currently collected data (Data1).
[0096] Figure 8 This diagram illustrates the result of smoothing the acquired data during gain switching. Figure 8 As can be seen, the above embodiments have alleviated the problem of data jumps to a certain extent, and the authenticity of the collected data has not been compromised.
[0097] As can be seen from the above description, the data acquisition method based on gain switching provided in this disclosure determines the first gain and the second gain to be switched when acquiring the data to be acquired, and acquires the data based on the first gain and the second gain. On the one hand, this ensures that the acquired data output for the same data to be acquired is consistent, and on the other hand, it can also avoid the problem of data jumps in the acquired data output.
[0098] Based on the same concept, this disclosure also provides a data acquisition device based on gain switching.
[0099] It is understood that the gain-switching-based data acquisition device provided in this disclosure includes hardware structures and / or software modules corresponding to each function in order to achieve the above-mentioned functions. In conjunction with the units and algorithm steps of the various examples disclosed in this disclosure, this disclosure can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed by hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the technical solutions of this disclosure.
[0100] Figure 9 This is a block diagram of a data acquisition device based on gain switching, according to an exemplary embodiment. (Refer to...) Figure 9 The gain-switching-based data acquisition device includes a determination module 110 and an acquisition module 120. Each module will be described in detail below.
[0101] The determination module 110 is configured to: determine the data to be acquired, and determine the first gain and the second gain to be switched when acquiring the data.
[0102] The acquisition module 120 is configured to: acquire data based on a first gain and a second gain, and output the acquired data.
[0103] In an exemplary embodiment of this disclosure, the determining module 110 is configured to: determine the gain corresponding to a first data interval as a first gain based on the correspondence between data intervals and gains, and determine the gain corresponding to a second data interval as a second gain, wherein the first data interval and the second data interval are different data intervals corresponding to each data within the data variation interval to be collected.
[0104] In an exemplary embodiment of this disclosure, the acquisition module 120 is configured to: determine a first weight and a second weight based on the data to be acquired, a first data interval, and a second data interval, wherein the first weight is a weight for acquiring data based on a first gain, and the second weight is a weight for acquiring data based on a second gain; and acquire data based on the first gain and the second weight according to the first weight and the second weight.
[0105] In an exemplary embodiment of this disclosure, a first data interval has a first boundary value adjacent to a second data interval, and a second data interval has a second boundary value adjacent to the first data interval; the acquisition module 120 is configured to: if the difference between the data to be acquired and the first boundary value of the first data interval is greater than the difference between the data to be acquired and the second boundary value of the second data interval, then a first weight is less than a second weight; if the difference between the data to be acquired and the first boundary value of the first data interval is less than the difference between the data to be acquired and the second boundary value of the second data interval, then a first weight is greater than a second weight; if the difference between the data to be acquired and the first boundary value of the first data interval is equal to the difference between the data to be acquired and the second boundary value of the second data interval, then a first weight is equal to a second weight.
[0106] In an exemplary embodiment of this disclosure, the data acquisition device based on gain switching further includes a reprocessing module. The reprocessing module is configured to: smooth the currently acquired data before outputting it.
[0107] In an exemplary embodiment of this disclosure, the reprocessing module is configured to output the average of the currently collected data and a preset number of collected data as output data.
[0108] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.
[0109] Figure 10This is a block diagram illustrating an apparatus 800 for gain-switching-based data acquisition according to an exemplary embodiment. For example, the apparatus 800 for gain-switching-based data acquisition may be a mobile phone, computer, digital broadcasting terminal, messaging device, game console, tablet device, medical device, fitness equipment, personal digital assistant, etc.
[0110] Reference Figure 10 The apparatus 800 for gain-switching-based data acquisition may include one or more of the following components: a processing component 802, a memory 804, a power component 806, a multimedia component 808, an audio component 810, an input / output (I / O) interface 812, a sensor component 814, and a communication component 816.
[0111] Processing component 802 typically controls the overall operation of the device 800 for gain-switching-based data acquisition, such as operations associated with display, telephone calls, data communication, camera operation, and recording. Processing component 802 may include one or more processors 820 to execute instructions to perform all or part of the steps of the methods described above. Furthermore, processing component 802 may include one or more modules to facilitate interaction between processing component 802 and other components. For example, processing component 802 may include a multimedia module to facilitate interaction between multimedia component 808 and processing component 802.
[0112] Memory 804 is configured to store various types of data to support the operation of apparatus 800 for gain-switching-based data acquisition. Examples of this data include instructions for any application or method operating on apparatus 800 for gain-switching-based data acquisition, contact data, phonebook data, messages, pictures, videos, etc. Memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0113] Power component 806 provides power to various components of the device 800 for gain-switching-based data acquisition. Power component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the device 800 for gain-switching-based data acquisition.
[0114] The multimedia component 808 includes a screen that provides an output interface between the device 800 for gain-switching-based data acquisition and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touchscreen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors may sense not only the boundaries of the touch or swipe action but also the duration and pressure associated with the touch or swipe operation. In some embodiments, the multimedia component 808 includes a front-facing camera and / or a rear-facing camera. When the device 800 for gain-switching-based data acquisition is in an operating mode, such as a shooting mode or a video mode, the front-facing camera and / or the rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.
[0115] Audio component 810 is configured to output and / or input audio signals. For example, audio component 810 includes a microphone (MIC) configured to receive external audio signals when the device 800 for gain-switching data acquisition is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 804 or transmitted via communication component 816. In some embodiments, audio component 810 also includes a speaker for outputting audio signals.
[0116] I / O interface 812 provides an interface between processing component 802 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to, home buttons, volume buttons, power buttons, and lock buttons.
[0117] Sensor assembly 814 includes one or more sensors for providing status assessments of various aspects of the gain-switching data acquisition device 800. For example, sensor assembly 814 may detect the on / off state of the gain-switching data acquisition device 800, the relative positioning of components such as the display and keypad of the gain-switching data acquisition device 800, changes in the position of the device 800 or a component thereof, the presence or absence of user contact with the gain-switching data acquisition device 800, the orientation or acceleration / deceleration of the gain-switching data acquisition device 800, and temperature changes of the gain-switching data acquisition device 800. Sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, sensor assembly 814 may also include an accelerometer, a gyroscope, a magnetometer, a pressure sensor, or a temperature sensor.
[0118] Communication component 816 is configured to facilitate wired or wireless communication between the gain-switching-based data acquisition device 800 and other devices. The gain-switching-based data acquisition device 800 can access wireless networks based on communication standards, such as WiFi, 2G, or 3G, or combinations thereof. In one exemplary embodiment, communication component 816 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 816 also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
[0119] In an exemplary embodiment, the apparatus 800 for gain-switching-based data acquisition may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the methods described above.
[0120] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 804 including instructions, which can be executed by a processor 820 of a gain-switching-based data acquisition device 800 to perform the above-described method. For example, the non-transitory computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.
[0121] It is understood that in this disclosure, "multiple" refers to two or more, and other quantifiers are similar. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, and B alone. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. The singular forms "a," "the," and "the" are also intended to include the plural forms unless the context clearly indicates otherwise.
[0122] It is further understood that the terms "first," "second," etc., are used to describe various types of information, but this information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another, and do not indicate a specific order or degree of importance. In fact, the expressions "first," "second," etc., are completely interchangeable. For example, without departing from the scope of this disclosure, first information can also be referred to as second information, and similarly, second information can also be referred to as first information.
[0123] It can be further understood that, unless otherwise specified, "connection" includes both direct connections where no other components exist between the two parties and indirect connections where other components exist between them.
[0124] It is further understood that although operations are described in a specific order in the accompanying drawings in the embodiments of this disclosure, this should not be construed as requiring these operations to be performed in the specific order or serial order shown, or requiring all of the shown operations to be performed to obtain the desired result. In certain environments, multitasking and parallel processing may be advantageous.
[0125] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the following claims.
[0126] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.
Claims
1. A gain-switching based data acquisition method, characterized by, include: The data to be collected is determined, and the first gain and the second gain to be switched when collecting the data to be collected are determined, wherein the data to be collected is the light intensity of the environment in which the terminal is located; The data to be collected is acquired based on the first gain and the second gain, and the acquired data is output. The acquired data is used to adjust the brightness of the display screen. The determination of the first gain and the second gain to be switched when collecting the data to be collected includes: Based on the correspondence between data intervals and gains, the gain corresponding to the first data interval is determined as the first gain, and the gain corresponding to the second data interval is determined as the second gain, wherein the first data interval and the second data interval are different data intervals corresponding to each data within the data variation interval to be collected; The data acquisition based on the first gain and the second gain includes: Based on the data to be collected, the first data interval, and the second data interval, a first weight and a second weight are determined. Based on the ratio between the difference between the data to be collected and the first boundary value, and the ratio between the difference between the data to be collected and the second boundary value, the ratio between the first weight and the second weight is determined. The ratio of the number of times the first gain collects the data to the number of times the second gain collects the data to the first gain is the same as the ratio between the first weight and the second weight. Data is collected based on the first weight and the second weight, and on the first gain and the second gain. Wherein, the first weight is the weight for collecting data from the data to be collected based on the first gain, the second weight is the weight for collecting data from the data to be collected based on the second gain, the first data interval has a first boundary value adjacent to the second data interval, and the second data interval has a second boundary value adjacent to the first data interval.
2. The gain-switched based data acquisition method of claim 1, wherein, The step of determining the first weight and the second weight based on the data to be collected, the first data interval, and the second data interval includes: If the difference between the data to be collected and the first boundary value of the first data interval is greater than the difference between the data to be collected and the second boundary value of the second data interval, then the first weight is less than the second weight. If the difference between the data to be collected and the first boundary value of the first data interval is less than the difference between the data to be collected and the second boundary value of the second data interval, then the first weight is greater than the second weight. If the difference between the data to be collected and the first boundary value of the first data interval is equal to the difference between the data to be collected and the second boundary value of the second data interval, then the first weight is equal to the second weight.
3. The gain-switched based data acquisition method of claim 1, wherein, The output data after acquisition includes: The currently collected data is smoothed before being output.
4. The gain-switched based data acquisition method of claim 3, wherein, The process of smoothing the currently collected data before outputting it includes: The average of the currently collected data and the preset number of collected data is used as the output data.
5. A gain-switched based data acquisition device, characterized by, include: The determination module is used to determine the data to be collected, and to determine the first gain and the second gain to be switched when collecting the data to be collected, wherein the data to be collected is the light intensity of the environment in which the terminal is located; The acquisition module is used to acquire data from the data to be acquired based on the first gain and the second gain, and output the acquired data, which is used to adjust the brightness of the display screen. The determining module is also used for: Based on the correspondence between data intervals and gains, the gain corresponding to the first data interval is determined as the first gain, and the gain corresponding to the second data interval is determined as the second gain, wherein the first data interval and the second data interval are different data intervals corresponding to each data within the data variation interval to be collected; The acquisition module is used for: Based on the data to be collected, the first data interval, and the second data interval, a first weight and a second weight are determined. Based on the ratio between the difference between the data to be collected and the first boundary value, and the ratio between the difference between the data to be collected and the second boundary value, the ratio between the first weight and the second weight is determined. The ratio of the number of times the first gain collects the data to the number of times the second gain collects the data to the first gain is the same as the ratio between the first weight and the second weight. Data is collected based on the first weight and the second weight, and on the first gain and the second gain. Wherein, the first weight is the weight for collecting data from the data to be collected based on the first gain, the second weight is the weight for collecting data from the data to be collected based on the second gain, the first data interval has a first boundary value adjacent to the second data interval, and the second data interval has a second boundary value adjacent to the first data interval.
6. The gain-switched based data acquisition device of claim 5, wherein, The acquisition module is used for: If the difference between the data to be collected and the first boundary value of the first data interval is greater than the difference between the data to be collected and the second boundary value of the second data interval, then the first weight is less than the second weight. If the difference between the data to be collected and the first boundary value of the first data interval is less than the difference between the data to be collected and the second boundary value of the second data interval, then the first weight is greater than the second weight. If the difference between the data to be collected and the first boundary value of the first data interval is equal to the difference between the data to be collected and the second boundary value of the second data interval, then the first weight is equal to the second weight.
7. The data acquisition device based on gain switching according to claim 5, characterized in that, The apparatus further includes a reprocessing module, the reprocessing module being used for: The currently collected data is smoothed before being output.
8. The gain-switched based data acquisition device of claim 7, wherein, The reprocessing module is used for: The average of the currently collected data and the preset number of collected data is used as the output data.
9. A gain-switched based data acquisition device, characterized by, include: processor; Memory used to store processor-executable instructions; The processor is configured to execute the data acquisition method based on gain switching as described in any one of claims 1 to 4.
10. A non-transitory computer-readable storage medium, comprising: When the instructions in the storage medium are executed by the processor of the mobile terminal, the mobile terminal is able to perform the data acquisition method based on gain switching as described in any one of claims 1 to 4.