Data management method and device, electronic equipment and storage medium
By performing FFT calculation and prediction time adjustment of the flicker sensor ring buffer data, dynamically adjusting the amount of data stored in the ring buffer, solving the resource waste and data accumulation problems caused by the fixed sliding window size in the prior art, and achieving more efficient data management.
Patent Information
- Application Number
- CN202510441648.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-09
- Publication Date
- 2025-08-01
AI Technical Summary
In the prior art, the data management method of the flicker sensor is not flexible enough during camera photography and imaging, resulting in resource fragmentation and data accumulation, and the sliding window size cannot be effectively adjusted, affecting data processing efficiency.
By performing FFT calculation on the ring buffer data of the flicker sensor, predict the calculation time and dynamically adjust the target window value, dynamically adjust the amount of data stored in the ring buffer, and flexible adjustment of the sliding window size is achieved.
It improves the flexibility of data management of electronic devices in camera photography and camera process, avoids resource fragmentation and data accumulation, and ensures the efficiency and stability of data processing.
Smart Images

Figure CN120408002A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the technical field of electronic devices, and particularly relates to a data management method, apparatus, electronic device, and storage medium. Background Art
[0002] A Flicker Sensor is an electronic device capable of detecting the flicker of a light source and can be used for an Anti–Banding function in images, that is, to eliminate or reduce the bright and dark stripe phenomenon in an image caused by the asynchronous light source frequency and the camera shutter speed or exposure time in photography and videography.
[0003] Currently, during the process of a camera taking photos and videos, the Flicker Sensor periodically obtains light source data from the surrounding environment and fills the obtained light source data into a First In First Out (FIFO) memory integrated in a SensorHub. Then, the light source data in the amount of the sliding window size is stored from the SensorHub FIFO into a circular buffer (Buffer). After the amount of light source data in the Buffer reaches a certain quantity, a Fast Fourier Transform (FFT) calculation is triggered. Finally, information such as the frequency corresponding to the light source data obtained by the calculation is reported, so that the camera can timely adjust parameters such as the shutter speed and exposure time to reduce or eliminate the flicker stripes appearing in the image.
[0004] However, in the above method, the amount of light source data transferred from the SensorHub FIFO to the circular Buffer each time is fixed, that is, the size of the sliding window is fixed. Thus, the way for the electronic device to manage data is not flexible enough. Summary of the Invention
[0005] The purpose of the embodiments of this application is to provide a data management method, apparatus, electronic device, and storage medium, which can improve the flexibility of the electronic device in data management.
[0006] In a first aspect, the embodiments of this application provide a data management method, which includes: performing an FFT calculation on first data stored in a circular buffer of a Flicker Sensor and obtaining a first calculation duration for performing the FFT calculation on the first data; predicting a second prediction duration for the next FFT calculation based on a first prediction duration of the previous FFT calculation and the first calculation duration; determining a target window value based on the second prediction duration and an FFT calculation reference duration; and storing second data collected by the Flicker Sensor into the circular buffer according to the target window value.
[0007] Second aspect, an embodiment of the present application provides a data management device, which includes: a processing module, an acquisition module, a determination module, and a storage module. The processing module is configured to perform FFT calculation on the first data stored in the circular buffer of the scintillation sensor. The acquisition module is configured to acquire a first calculation duration of the processing module for performing FFT calculation on the first data. The processing module is further configured to predict a second prediction duration of the next FFT calculation based on a first prediction duration of the previous FFT calculation and the first calculation duration acquired by the acquisition module. The determination module is configured to determine a target window value based on the second prediction duration predicted by the processing module and an FFT calculation reference duration. The storage module is configured to store the second data collected by the scintillation sensor into the circular buffer according to the target window value determined by the determination module.
[0008] Third aspect, an embodiment of the present application provides an electronic device, which includes a processor and a memory. The memory stores a program or instruction that can run on the processor. When the program or instruction is executed by the processor, the steps of the method described in the first aspect are implemented.
[0009] Fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.
[0010] Fifth aspect, an embodiment of the present application provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor, and the processor is configured to run a program or instruction to implement the method described in the first aspect.
[0011] Sixth aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the method described in the first aspect.
[0012] In an embodiment of the present application, perform FFT calculation on the first data stored in the circular buffer of the scintillation sensor, and obtain the first calculation duration for performing FFT calculation on the first data; based on the first prediction duration of the previous FFT calculation and the first calculation duration, predict the second prediction duration of the next FFT calculation; based on the second prediction duration and the FFT calculation reference duration, determine the target window value; according to the target window value, store the second data collected by the scintillation sensor into the circular buffer. In this solution, the electronic device can predict the second prediction duration of the next FFT calculation based on the first calculation duration of performing FFT calculation on the first data stored in the circular buffer of the scintillation sensor this time and the first prediction duration of the previous FFT calculation. Then, the electronic device can determine the target window value, that is, the amount of data of the data to be stored in the circular buffer next time, based on the second prediction duration and the FFT calculation reference duration. Finally, the electronic device can store the second data collected by the scintillation sensor into the circular buffer according to the target window value, so that the electronic device can dynamically adjust the size of the sliding window according to the predicted FFT calculation duration, that is, realize dynamically adjusting the amount of data of the data stored in the circular buffer. In this way, the flexibility of the electronic device for data management is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] Figure 1 is a flowchart of a data management method provided by the related art;
[0014] Figure 2 is one of the flowcharts of the data management method provided by the embodiment of the present application;
[0015] Figure 3 is another flowchart of the data management method provided by the embodiment of the present application;
[0016] Figure 4 is yet another flowchart of the data management method provided by the embodiment of the present application;
[0017] Figure 5 is still another flowchart of the data management method provided by the embodiment of the present application;
[0018] Figure 6 is one more flowchart of the data management method provided by the embodiment of the present application;
[0019] Figure 7 is yet one more flowchart of the data management method provided by the embodiment of the present application;
[0020] Figure 8 is still yet one more flowchart of the data management method provided by the embodiment of the present application;
[0021] Figure 9 is one last flowchart of the data management method provided by the embodiment of the present application;
[0022] Figure 10 It is the ninth flowchart of the data management method provided by the embodiments of the present application;
[0023] Figure 11 It is a schematic structural diagram of the flashing sensor provided by the embodiments of the present application;
[0024] Figure 12 It is a schematic structural diagram of the data management device provided by the embodiments of the present application;
[0025] Figure 13 It is a schematic structural diagram of the electronic device provided by the embodiments of the present application;
[0026] Figure 14 It is a schematic hardware structure diagram of the electronic device provided by the embodiments of the present application. Specific Embodiments
[0027] Next, the technical solutions in the embodiments of the present application will be clearly described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art belong to the scope of protection of the present application.
[0028] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, rather than to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are usually of the same category, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims means at least one of the connected objects, and the character " / " generally means an "or" relationship between the associated objects before and after.
[0029] The terms "at least one (item)", "at least one of", etc. in the present application refer to any one, any two or more combinations of the objects they contain. For example, at least one (item) of a, b, and c can represent: "a", "b", "c", "a and b", "a and c", "b and c", and "a, b, and c", where a, b, and c can be single or multiple. Similarly, "at least two (items)" means two or more, and its meaning is similar to that of "at least one (item)".
[0030] First, the nouns involved in the specification of the present application are explained.
[0031] Flicker Sensor: A flicker sensor is an electronic device specifically designed to detect the flicker of light sources. By detecting the frequency fluctuations of light sources, it optimizes the anti-flicker performance of devices. It is based on photoelectric detection technology and internally integrates photosensitive elements (such as photodiodes) that can capture the intensity changes of ambient light sources in real time. When the light source fluctuates, the sensor converts it into an electrical signal and transmits it to the processor for frequency analysis. For example, when detecting power frequency flicker of 50Hz or 60Hz, the system automatically adjusts device parameters (such as the camera shutter speed or screen refresh rate) to achieve synchronization with the light source, thereby eliminating screen flicker or signal interference.
[0032] Anti–Banding: The anti-banding function is a technology used in photography and videography to eliminate or reduce the phenomenon of bright and dark stripes (banding) caused by the asynchronous frequency of the light source and the camera shutter speed or exposure time. The Anti-Banding function is based on the light source flicker information detected by the Flicker Sensor. By adjusting parameters such as the camera's shutter speed and exposure time, the camera is prevented from being interfered by the light source flicker during the shooting process. Its core principle is to make the camera's exposure time match the flicker period of the light source, thereby reducing or eliminating the flicker stripes in the image.
[0033] FFT: Fast Fourier Transform is an algorithm for efficiently calculating the Discrete Fourier Transform (DFT) and its inverse transform. FFT is a fast implementation algorithm of DFT, used to convert time-domain signals into frequency-domain representations to reveal the frequency components of signals. DFT is defined as a linear transformation from a complex number sequence to a complex number sequence, and FFT significantly improves the signal processing efficiency by optimizing the computational complexity. Its core idea is to decompose DFT into smaller sub-problems and utilize symmetry and periodicity to reduce redundant calculations.
[0034] The following combines the accompanying drawings to detail the data management methods, devices, electronic devices, and storage media provided by the embodiments of the present application through specific embodiments and their application scenarios.
[0035] The data management method provided by the embodiments of the present application can be applied to scenarios where the sliding window size, that is, the amount of data stored in the circular buffer, needs to be dynamically adjusted. For example, during the process of photography and videography through a camera, the flicker sensor obtains light source data from the surrounding environment and stores the light source data in the circular buffer for subsequent FFT calculations. In this scenario, the amount of light source data stored in the circular buffer needs to be dynamically adjusted according to requirements.
[0036] At present, many light sources in daily life (such as fluorescent lamps, LED lamps, etc.) generate flicker at a certain frequency due to being powered by alternating current. This flicker may not be easily perceptible to the human eye, but when taking images, it may cause problems such as streaks, flicker, or color distortion in the images. In related technologies, during the process of photography and videography through a camera, as Figure 1 shown, the Flicker Sensor periodically obtains light source data from the surrounding environment and fills the obtained light source data into the FIFO memory integrated in the Sensor Hub at a certain frequency, for example, at a frequency of 1000 Hz. Then, the light source data with a fixed window size is stored from the SensorHub FIFO to the circular buffer Buffer. For example, 50 light source data of the fixed window are stored in the circular buffer each time. After the data volume of the light source data in the Buffer reaches a certain amount, for example, after reaching 256, the FFT calculation is triggered. Finally, the information such as the frequency corresponding to the 256 light source data obtained by the calculation is reported, so that the camera can adjust parameters such as the shutter speed and exposure time in a timely manner to reduce or eliminate the flicker streaks in the image.
[0037] However, in the above method, the data volume of the light source data transmitted from the SensorHub FIFO to the circular Buffer each time is fixed, that is, the size of the sliding window is fixed. Also, since the time-consuming of the FFT calculation is affected by various factors, in the case of too small a window, the FFT calculation will be frequently triggered, resulting in resource fragmentation and an increase in the overhead of the Central Processing Unit (CPU) context switch; in the case of too large a window, some of the light source data in the circular Buffer has not been processed in time, and there will be data accumulation, leading to the risk of memory overflow, resulting in a high data reporting delay. Thus, the way of data management of the electronic device is not flexible enough.
[0038] The data management method provided by the embodiment of the present application performs FFT calculation on the first data stored in the circular buffer of the scintillation sensor, and obtains the first calculation duration for performing FFT calculation on the first data; based on the first prediction duration of the previous FFT calculation and the first calculation duration, predicts the second prediction duration of the next FFT calculation; based on the second prediction duration and the FFT calculation reference duration, determines the target window value; and stores the second data collected by the scintillation sensor into the circular buffer according to the target window value. In this solution, the electronic device can predict the second prediction duration of the next FFT calculation based on the first calculation duration of the FFT calculation performed on the first data stored in the circular buffer of the scintillation sensor this time and the first prediction duration of the previous FFT calculation. Then, the electronic device can determine the target window value, that is, the amount of data of the data to be stored in the circular buffer next time, based on the second prediction duration and the FFT calculation reference duration. Finally, the electronic device can store the second data collected by the scintillation sensor into the circular buffer according to the target window value, so that the electronic device can dynamically adjust the size of the sliding window according to the predicted FFT calculation duration, that is, realize the dynamic adjustment of the amount of data stored in the circular buffer. In this way, the flexibility of the electronic device for data management is improved.
[0039] The data management method provided by the embodiment of the present application, the execution subject can be a data management device. Exemplarily, the data management device can be an electronic device, or a component in the electronic device, such as an integrated circuit or a chip, which can be specifically determined according to actual usage requirements, and the embodiment of the present application does not make a limitation. Hereinafter, taking the data management device as an electronic device and the electronic device executing the data management method as an example, the data management method provided by the embodiment of the present application will be exemplarily described.
[0040] Figure 2 The flowchart of a data management method provided by the embodiment of the present application is shown. As Figure 2 shown, the data management method provided by the embodiment of the present application may include the following steps 201 to step 204.
[0041] Step 201, the electronic device performs FFT calculation on the first data stored in the circular buffer of the scintillation sensor, and obtains the first calculation duration for performing FFT calculation on the first data.
[0042] It can be understood that the above circular buffer, also known as a cyclic buffer, is a data structure for data buffering. Its core idea is to regard the buffer as a circular structure. When data is written to the end of the buffer, it will automatically wrap around to the beginning of the buffer and continue to be written, forming a cycle. Similarly, when reading data, it can also be cyclically read from the buffer.
[0043] In some embodiments of the present application, the data volume of the above-mentioned first data meets the condition for triggering FFT calculation, that is, when the data volume of the data stored in the circular buffer of the above-mentioned scintillation sensor reaches the third threshold, the electronic device can trigger FFT calculation.
[0044] In some embodiments of the present application, the electronic device performs FFT calculation on data with a second data volume each time, and the second data volume is equal to the above-mentioned third threshold.
[0045] Exemplarily, the above-mentioned third threshold can be 256, 1024, 2048, etc. Specifically, it can be determined according to actual usage requirements, and the embodiments of the present application do not limit this.
[0046] Exemplarily, taking the above-mentioned third threshold as 256 as an example, when the data volume of the light source data stored in the circular buffer of the above-mentioned scintillation sensor reaches 256 records, the electronic device will trigger FFT calculation, and the data volume of the light source data for each FFT calculation is 256 records.
[0047] In some embodiments of the present application, the first calculation duration for performing FFT calculation on the above-mentioned first data refers to the actual time consumed by the electronic device for performing FFT calculation on the above-mentioned first data this time.
[0048] It should be noted that the above-mentioned FFT calculation refers to the calculation using the FFT algorithm.
[0049] In some embodiments of the present application, the above-mentioned first data can be first light source data.
[0050] Step 202, the electronic device predicts the second prediction duration of the next FFT calculation based on the first prediction duration and the first calculation duration of the previous FFT calculation.
[0051] In some embodiments of the present application, before each FFT calculation, the electronic device can first predict the calculation duration of the current FFT calculation, that is, predict the calculation duration of the FFT calculation to be performed. It can also be understood that after each FFT calculation, the electronic device can first predict the calculation duration of the next FFT calculation, that is, predict the calculation duration of the FFT calculation to be performed.
[0052] In some embodiments of the present application, the first prediction duration of the previous FFT calculation refers to the calculation duration predicted by the electronic device for the previous FFT calculation, and the previous FFT calculation refers to an FFT calculation performed by the electronic device before performing FFT calculation on the above-mentioned first data.
[0053] In some embodiments of the present application, the second predicted duration of the next FFT calculation refers to the calculation duration predicted by the electronic device for the next FFT calculation. This next FFT calculation refers to an FFT calculation performed by the electronic device after performing the FFT calculation on the first data, that is, the nearest upcoming FFT calculation to be performed.
[0054] Optionally, in some embodiments of the present application, in combination Figure 2 , such as Figure 3 shown, step 202 can be specifically implemented through the following step 202a.
[0055] Step 202a: The electronic device uses a first duration weight and a second duration weight to perform weighted accumulation on the first predicted duration and the first calculation duration of the previous FFT calculation to obtain the second predicted duration of the next FFT calculation.
[0056] In some embodiments of the present application, the sum of the first duration weight and the second duration weight is 1.
[0057] In some embodiments of the present application, the first duration weight and the second duration weight are related to the load change rate of the digital audio signal processor (Audio Digital Signal Processor, ADSP) corresponding to the flicker sensor.
[0058] It can be understood that the load change rate of the ADSP is an important indicator to measure its performance stability. The load change rate generally refers to the stability degree or change amount of the output signal of the ADSP when the input signal or load condition changes. The larger the load change rate of the ADSP, the less stable the current performance of the ADSP; the smaller the load change rate of the ADSP, the more stable the current performance of the ADSP.
[0059] In some embodiments of the present application, when the load change rate of the ADSP is greater than or equal to a fourth threshold, the electronic device can assign a higher weight to recent data, that is, when predicting the second predicted duration of the next FFT calculation, a higher weight is assigned to the first calculation duration, that is, the second duration weight is greater than the first duration weight. Thus, when the load change rate of the ADSP is relatively large, when predicting the second predicted duration of the next FFT calculation, it can rely more on the first calculation duration, that is, more on the calculation duration of the FFT calculation closest to the next FFT calculation, thereby improving the accuracy of predicting the second predicted duration of the next FFT calculation.
[0060] Exemplarily, the fourth threshold can be 10%, 15%, or 20%, etc. Specifically, it can be determined according to actual usage requirements, and the embodiments of the present application do not limit this.
[0061] Exemplarily, the electronic device may predict the second prediction duration of the next FFT calculation according to the following formula (1):
[0062] T pred = α × T current + (1 - α) × T pred_prev (1)
[0063] Where, T pred is the second prediction duration of the next FFT calculation predicted by the electronic device, α is the second duration weight, which can also be called the smoothing coefficient, T current is the first calculation duration, (1 - α) is the first duration weight, and T pred_prev is the first prediction duration of the previous FFT calculation.
[0064] Exemplarily, taking the above fourth threshold as 10% as an example, the electronic device may dynamically adjust the smoothing coefficient α according to the following rules:
[0065] α = 0.3 when the load change rate < 10%
[0066] α = 0.7 when the load change rate ≥ 10%
[0067] Optionally, in some embodiments of the present application, the electronic device may also monitor the ADSP subsystem utilization rate in real time. If the ADSP mcps_vote lasts for more than 60 seconds in a certain gear, it is marked as a high-load state.
[0068] It should be noted that the ADSP subsystem utilization rate is a measure of the extent to which the resources of the ADSP are effectively utilized when processing specific tasks. Million Cycles Per Second (mcps) represents the computing resource occupancy rate of the ADSP (for example: a certain task occupies 80% of the computing power, that is, 80 mcps is required), which can characterize the load situation of the ADSP. Vote is a "voting" mechanism, which means that multiple tasks or modules apply for computing power resources from the ADSP, and the system dynamically allocates computing power according to the "voting requirements" (mcps values) of each module. The electronic device can determine whether the ADSP is in a high-load state by monitoring the gear and duration of the ADSP mcps_vote, and trigger operations such as frequency reduction, restricting non-critical tasks, or alarming to ensure system stability.
[0069] In the embodiments of the present application, the electronic device can perform weighted accumulation on the first prediction duration and the first calculation duration of the previous FFT calculation using different duration weights to predict the second prediction duration of the next FFT calculation. Moreover, the electronic device can dynamically adjust the duration weights of the first prediction duration and the first calculation duration of the previous FFT calculation according to the load change situation, so that in the case of a large load change rate, when the electronic device predicts the second prediction duration of the next FFT calculation, it can rely more on the first calculation duration, that is, more on the calculation duration of the FFT calculation closest to the next FFT calculation, thereby improving the accuracy of predicting the second prediction duration of the next FFT calculation.
[0070] Step 203: The electronic device determines a target window value based on the second prediction duration and the FFT calculation reference duration.
[0071] Optionally, in some embodiments of the present application, the above FFT calculation reference duration may include but is not limited to at least one of the following: the FFT calculation reference duration preset when the electronic device initializes the flicker sensor, the FFT calculation reference duration calculated by the electronic device. Specifically, it can be determined according to actual usage requirements, and the embodiments of the present application do not limit this.
[0072] Optionally, in some embodiments of the present application, the FFT calculation reference duration calculated by the above electronic device may be the FFT calculation reference duration calculated by the electronic device based on the actual calculation durations of a certain number of FFT calculations, or may be the FFT calculation reference duration calculated by the electronic device according to the operating conditions of the main chip of the flicker sensor, such as the temperature change of the main chip.
[0073] Exemplarily, in the case where the electronic device performs the first FFT calculation or the number of FFT calculations performed is too small, the above FFT calculation reference duration may be the FFT calculation reference duration preset when the electronic device initializes the flicker sensor.
[0074] Exemplarily, in the case where the number of FFT calculations performed by the electronic device reaches a certain number, the above FFT calculation reference duration may be the FFT calculation reference duration calculated by the electronic device.
[0075] In some embodiments of the present application, the above target window value refers to the amount of data that the electronic device stores in the circular buffer at a single time.
[0076] Optionally, in some embodiments of the present application, in combination with Figure 2 , as Figure 4 shown, the above step 203 can be specifically implemented by the following step 203a and step 203b.
[0077] Step 203a: The electronic device multiplies the arithmetic square root of the ratio of the second prediction duration to the FFT calculation reference duration by the first window value to obtain the reference window value.
[0078] In some embodiments of the present application, the above-mentioned first window value is the window value used when storing the above-mentioned first data in the above-mentioned circular buffer.
[0079] It should be noted that the above-mentioned first window value is the window value used when storing the last batch of data in the above-mentioned first data in the above-mentioned circular buffer. Because of the influence of the window size, the data in the first data is stored in the circular buffer in batches.
[0080] Exemplarily, the electronic device can calculate the reference window value according to the following formula (2) to establish a non-linear mapping relationship between the reference window value and the second prediction duration:
[0081]
[0082] Where, is the reference window value, W current is the first window value, T pred is the second prediction duration, and Tbase is the FFT calculation reference duration.
[0083] Step 203b: The electronic device determines the target window value based on the reference window value, the first window value, and the window viscosity coefficient corresponding to the flash sensor.
[0084] It can be understood that the window viscosity coefficient is usually used to describe the "viscosity" degree when the window or state changes in some systems or models, that is, the characteristic that the system or state tends to maintain the current state. In some embodiments of the present application, the above-mentioned window viscosity coefficient corresponding to the flash sensor is used to describe the characteristic that the sliding window value tends to maintain the current state.
[0085] Optionally, in some embodiments of the present application, the above-mentioned window viscosity coefficient can be between 0.2 and 0.5. Specifically, it can be determined according to actual usage requirements, and the embodiments of the present application do not limit this.
[0086] Exemplarily, the electronic device can adjust the reference window value according to the following formula (3) to determine the target window value:
[0087]
[0088] Where, W new is the target window value, W current is the first window value, μ is the window viscosity coefficient, is the reference window value.
[0089] In the embodiments of the present application, the electronic device may first calculate a reference window value based on the second prediction duration, the FFT calculation reference duration, and the current first window value, and then introduce a window viscosity coefficient to adjust the reference window value to obtain a target window value. By introducing the window viscosity coefficient, the gap between the target window value and the current first window value is prevented from being too large, and high-frequency jitter of the window value is avoided.
[0090] Optionally, in some embodiments of the present application, in combination with Figure 2 , as Figure 5 shown, the above step 203 may be specifically implemented by the following steps 203d, 203e, and 203f1, or the above step 203 may be specifically implemented by the following steps 203d, 203e, and 203f2.
[0091] Step 203d: The electronic device calculates a second window value based on the second prediction duration and the FFT calculation reference duration.
[0092] It should be noted that, in some embodiments of the present application, the target window value determined by the electronic device by executing the above steps 203a and 203b can be understood as the second window value here.
[0093] Step 203e: The electronic device obtains the upper window value and the lower window value of the window range.
[0094] In some embodiments of the present application, the upper window value and the lower window value of the above window range may be the upper window value and the lower window value of the window range preset when the electronic device initializes the flicker sensor.
[0095] Optionally, in some embodiments of the present application, the upper window value of the above window range may be 100, and the lower window value of the above window range may be 20. Specifically, it can be determined according to actual usage requirements, and the embodiments of the present application do not limit this.
[0096] It can be understood that the upper window value of the above window range refers to the maximum value of the data volume of the data stored in the circular buffer by the electronic device at a single time, and the lower window value of the window range refers to the minimum value of the data volume of the data stored in the circular buffer by the electronic device at a single time.
[0097] Step 203f1: When the second window value is less than the lower window value, the electronic device uses the lower window value as the target window value.
[0098] Step 203f2: When the second window value is greater than the upper window value, the electronic device uses the upper window value as the target window value.
[0099] In the embodiments of the present application, the electronic device first calculates a second window value according to the second prediction duration and the FFT calculation reference duration, and then determines whether the second window value is within a preset window range. When the second window value exceeds the preset window range, the upper window limit value or the lower window limit value of the preset window range is used as the target window value, thus avoiding the final determined target window value from exceeding the preset window range.
[0100] Optionally, in some embodiments of the present application, in combination with Figure 2 , such as Figure 6 shown, before step 203 above, the data management method provided by the embodiments of the present application may further include the following step 301 and step 302.
[0101] Step 301: The electronic device obtains an initial FFT calculation reference duration.
[0102] In some embodiments of the present application, the above initial FFT calculation reference duration may be the average of the calculation durations of N FFT calculations, where N is a positive integer.
[0103] In some embodiments of the present application, the calculation duration of the above FFT calculation refers to the actual calculation time taken by the electronic device for FFT calculation.
[0104] Optionally, in some embodiments of the present application, N may be 10, 15, or 20. Specifically, it can be determined according to actual usage requirements, and the embodiments of the present application do not limit this.
[0105] Exemplarily, taking N as 10 as an example, the above initial FFT calculation reference duration may be the average of the actual calculation durations of the previous 10 FFT calculations before the FFT calculation to be performed.
[0106] Optionally, in some embodiments of the present application, when the electronic device performs the first FFT calculation or the number of FFT calculations performed is too small, the above initial FFT calculation reference duration may be the FFT calculation reference duration preset when the electronic device initializes the flash sensor. When the number of FFT calculations performed by the electronic device reaches a certain amount, the initial FFT calculation reference duration can be adjusted based on the average of the actual calculation durations of N FFT calculations.
[0107] Step 302: The electronic device determines the FFT calculation reference duration based on the reference temperature of the main chip of the flash sensor, the current temperature, the time increase coefficient corresponding to the flash sensor, and the initial FFT calculation reference duration.
[0108] In some embodiments of the present application, the main chip of the above-mentioned scintillation sensor may be a system-on-chip (SoC) of the scintillation sensor, and the calculation duration of the FFT calculation is affected by the temperature of the SoC of the scintillation sensor.
[0109] It should be noted that through the hot chamber experiment test, it is obtained that for every 1°C increase in the temperature of the SoC of the scintillation sensor, the calculation duration of the FFT calculation will increase by a coefficient That is, the time increase coefficient of the calculation duration of the FFT calculation is
[0110] In some embodiments of the present application, the electronic device may correct the initial FFT calculation reference duration according to the temperature change of the SoC of the scintillation sensor to determine the FFT calculation reference duration.
[0111] Exemplarily, the electronic device may correct the initial FFT calculation reference duration according to the following formula (4) to determine the FFT calculation reference duration:
[0112]
[0113] And, the electronic device may calculate ΔT according to the following formula (5):
[0114] ΔT = max(T curr - T nominal , 0) (5)
[0115] Wherein, is the FFT calculation reference duration, T base is the initial FFT calculation reference duration, is the time increase coefficient, T curr is the current temperature of the SoC of the scintillation sensor, T nominal is the reference temperature of the SoC of the scintillation sensor, ΔT is the maximum value between the difference between the current temperature and the reference temperature of the SoC of the scintillation sensor and the value 0, that is, when the difference between the current temperature and the reference temperature of the SoC of the scintillation sensor is greater than 0, ΔT is the difference between the current temperature and the reference temperature of the SoC of the scintillation sensor, and when the difference between the current temperature and the reference temperature of the SoC of the scintillation sensor is less than 0, ΔT is 0. It can be understood as a scenario for compensating for temperature rise, that is, when the current temperature of the SoC of the scintillation sensor is higher than the reference temperature, the initial FFT calculation reference duration is corrected.
[0116] In some embodiments of the present application, the reference temperature of the above-mentioned SoC of the scintillation sensor refers to the nominal value of the temperature of the SoC of the scintillation sensor, that is, the ideal temperature parameter claimed by the SoC of the scintillation sensor.
[0117] In some embodiments of the present application, the electronic device can collect the current temperature of the SoC of the flash sensor every once in a while through the temperature sensor built in the SensorHub. For example, the current temperature T of the SoC of the flash sensor is collected every 5 seconds. curr .
[0118] It should be noted that when the electronic device executes the above steps 301 and 302, the above FFT calculation reference duration is the FFT calculation reference duration calculated by the electronic device, and the FFT calculation reference duration in the above step 203 is the corrected FFT calculation reference duration, that is, T in the above formula (2). base is obtained through the calculation of formula (4) and formula (5).
[0119] In the embodiments of the present application, the electronic device can first determine the initial FFT calculation reference duration based on the average value of the actual calculation durations of a certain number of FFT calculations, and then consider the influence of the temperature of the SoC of the flash sensor on the FFT calculation duration, introduce a time increase coefficient, and correct the initial FFT calculation reference duration to determine the final FFT calculation reference duration. In this way, the accuracy of the subsequent calculation of the target window value is improved.
[0120] Step 204: The electronic device stores the second data collected by the flash sensor into the circular buffer according to the target window value.
[0121] In some embodiments of the present application, the data volume of the data corresponding to the second data is equal to the above target window value.
[0122] In some embodiments of the present application, the second data may be second light source data.
[0123] Optionally, in some embodiments of the present application, in combination Figure 2 , such as Figure 7 shown, the above step 204 can be specifically implemented by the following step 204a.
[0124] Step 204a: The electronic device stores the data with the first data volume in the data collected by the flash sensor into the circular buffer.
[0125] In some embodiments of the present application, the first data volume is equal to the above target window value.
[0126] In some embodiments of the present application, the electronic device can store the light source data with the first data volume in the light source data collected by the flash sensor into the circular buffer.
[0127] Exemplarily, the electronic device first stores the light source data collected by the flash sensor into the SensorHub FIFO, and then stores the light source data of the first data volume from the SensorHub FIFO into the circular buffer, thereby realizing the dynamic adjustment of the window.
[0128] The embodiment of the present application provides a data management method. The electronic device can predict the second prediction duration of the next FFT calculation based on the first calculation duration of the FFT calculation performed on the first data stored in the circular buffer of the flash sensor this time and the first prediction duration of the previous FFT calculation. Then, the electronic device can determine the target window value, that is, the data volume of the data to be stored in the circular buffer next time, based on the second prediction duration and the FFT calculation reference duration. Finally, the electronic device can store the second data collected by the flash sensor into the circular buffer according to the target window value, so that the electronic device can dynamically adjust the size of the sliding window according to the predicted FFT calculation duration, that is, realize the dynamic adjustment of the data volume of the data stored in the circular buffer. In this way, the flexibility of the electronic device for data management is improved.
[0129] Optionally, in some embodiments of the present application, in combination with Figure 2 , as Figure 8 shown, after step 204 above, the data management method provided by the embodiment of the present application may further include the following steps 205 to 207.
[0130] Step 205: The electronic device performs an FFT calculation on the third data stored in the circular buffer and obtains the second calculation duration of the FFT calculation on the third data.
[0131] In some embodiments of the present application, the above third data includes the above second data.
[0132] In some embodiments of the present application, the data volume of the data corresponding to the above third data is the above second data volume.
[0133] In some embodiments of the present application, the above third data may be third light source data.
[0134] It should be noted that each time the electronic device performs an FFT calculation on the data of the second data volume, the second data volume is equal to the above third threshold, and the data volume of the data corresponding to the above second data is equal to the above target window value. Since the target window value is not necessarily equal to the third threshold, that is, the data volume of the data corresponding to the second data newly stored in the circular buffer is not necessarily equal to the third threshold, the above third data for the FFT calculation includes the above second data and other data adjacent to the second data previously stored in the circular buffer.
[0135] Step 206: The electronic device determines the calculation error value between the second calculation duration and the second prediction duration based on the second calculation duration and the second prediction duration.
[0136] Exemplarily, the electronic device can determine the calculation error value between the second calculation duration and the second prediction duration according to the following formula (6):
[0137] Error = ∣(T real - T pred ) / T real ∣ × 100% (6)
[0138] Where Error is the calculation error value between the second calculation duration and the second prediction duration, T real is the second calculation duration, and T pred is the second prediction duration.
[0139] Step 207: When the calculation error values corresponding to the data stored in the circular buffer for M consecutive times are greater than the first threshold, the electronic device stores the data collected by the scintillation sensor in the circular buffer according to the initial window value.
[0140] Optionally, in some embodiments of the present application, M can be 3, 4, or 5. Specifically, it can be determined according to actual usage requirements, and the embodiments of the present application do not limit this.
[0141] Optionally, in some embodiments of the present application, the above first threshold can be 20%, 25%, or 30%. Specifically, it can be determined according to actual usage requirements, and the embodiments of the present application do not limit this.
[0142] In some embodiments of the present application, after each FFT calculation, the electronic device can obtain the second calculation duration of the current FFT calculation, and then the electronic device determines the calculation error value between the second calculation duration and the second prediction duration based on the second calculation duration and the second prediction duration.
[0143] Optionally, in some embodiments of the present application, the electronic device can determine whether the condition that the calculation error values corresponding to the data stored in the circular buffer for M consecutive times are greater than the first threshold is satisfied after a certain FFT calculation by maintaining a counter.
[0144] In some embodiments of the present application, the above initial window value can be the window value preset when the electronic device initializes the scintillation sensor.
[0145] Exemplarily, taking M as 3 and the first threshold as 25% as an example, when the electronic device detects that the calculation error values corresponding to the light source data stored in the circular buffer are greater than 25% for 3 consecutive times, it will fallback to the fixed window mode, that is, the amount of light source data stored in the circular buffer each time subsequently is fixed, and the amount of light source data stored in the circular buffer each time is equal to the initial window value, and the counter is cleared for subsequent re - counting.
[0146] Optionally, in some embodiments of the present application, when the calculation error values corresponding to the data stored in the circular buffer by the electronic device are greater than the first threshold for M consecutive times, after storing the data collected by the flashing sensor into the circular buffer according to the initial window value, the electronic device can also restore to the dynamic prediction window mode when the calculation error values corresponding to the data stored in the circular buffer are less than the fifth threshold for L consecutive times, that is, calculate the target window value according to the second prediction duration calculated by the predicted FFT, and dynamically adjust the amount of data stored in the circular buffer each time subsequently according to the target window value.
[0147] Optionally, in some embodiments of the present application, L can be 2, 3, or 4. Specifically, it can be determined according to actual usage requirements, and the embodiments of the present application do not limit this.
[0148] Optionally, in some embodiments of the present application, the above - mentioned fifth threshold can be 10%, 15%, or 20%. Specifically, it can be determined according to actual usage requirements, and the embodiments of the present application do not limit this.
[0149] Exemplarily, taking L as 2 and the fifth threshold as 15% as an example, when the electronic device detects that the calculation error values corresponding to the light source data stored in the circular buffer are less than 15% for 2 consecutive times, it will restore to the dynamic prediction window mode, that is, calculate the target window value according to the second prediction duration calculated by the predicted FFT, and dynamically adjust the amount of light source data stored in the circular buffer each time subsequently according to the target window value.
[0150] In the embodiments of the present application, when the electronic device detects that the calculation error values of the second calculation duration and the second prediction duration are greater than the first threshold for M consecutive times, it will fallback to the fixed window mode, that is, store the data collected by the flashing sensor into the circular buffer according to the initial window value, so that the amount of data stored in the circular buffer each time subsequently is reasonable, and avoid unreasonable window size caused by incorrect prediction.
[0151] Optionally, in some embodiments of the present application, in combination with Figure 2 , as Figure 9 shown, after the above - mentioned step 204, the data management method provided by the embodiments of the present application may further include the following step 208.
[0152] Step 208: When the current temperature of the main chip of the flashing sensor is greater than the second threshold, the electronic device stores the data collected by the flashing sensor into the circular buffer according to the initial window value.
[0153] Optionally, in some embodiments of the present application, the second threshold may be 55 °C, 60 °C or 65 °C. Specifically, it can be determined according to actual usage requirements, and the embodiments of the present application do not limit this.
[0154] Exemplarily, when the electronic device detects that the current temperature of the SoC of the flashing sensor is greater than 60 °C, it will fall back to the fixed window mode, that is, the amount of data of the light source data stored in the circular buffer each time subsequently is fixed, and the amount of data of the light source data stored in the circular buffer each time is equal to the initial window value.
[0155] Optionally, in some embodiments of the present application, the electronic device may also restore to the dynamic prediction window mode when detecting that the current temperature of the main chip of the flashing sensor is less than or equal to the second threshold, that is, calculate the target window value according to the second prediction duration calculated by the predicted FFT, and dynamically adjust the amount of data of the data stored in the circular buffer each time subsequently according to the target window value.
[0156] In the embodiments of the present application, when the current temperature of the main chip of the flashing sensor is greater than the second threshold, the electronic device falls back to the fixed window mode, that is, stores the data collected by the flashing sensor into the circular buffer according to the initial window value, so that the amount of data of the data stored in the circular buffer each time subsequently is reasonable, and avoids the influence of too high temperature on the calculation of the dynamic window value.
[0157] In some embodiments of the present application, after the electronic device performs FFT calculation on the data each time, it reports the result obtained by the FFT calculation to other modules related to the flashing sensor.
[0158] Exemplarily, after the electronic device performs FFT calculation on the light source data each time, it reports the result obtained by the FFT calculation to the camera module, for example, reports information such as the frequency corresponding to the calculated light source data, so as to facilitate the camera to adjust parameters such as the shutter speed and exposure time in a timely manner to reduce or eliminate the flashing stripes appearing in the image.
[0159] Next, the implementation process of the data management method provided by the embodiments of the present application will be schematically described through specific implementation manners. Figure 10 The flowchart of a data management method provided by the embodiments of the present application is shown. Figure 11 The structural schematic diagram of a flashing sensor provided by the embodiments of the present application is shown. As Figure 10As shown in the figure, the implementation process of the data management method provided by the embodiment of the present application may include the following steps 1011 to 1018.
[0160] Step 1011: The electronic device initializes the system of the scintillation sensor and sets initial parameters.
[0161] It should be noted that the above initial parameters may include an initial cycle period, an initial window value, an initial FFT calculation reference duration, and a window range. Among them, the initial cycle period refers to the period for the scintillation sensor to collect light source data from the surrounding environment. The initial FFT calculation reference duration can be the FFT calculation reference duration obtained according to related technologies, and the initial FFT calculation reference duration can be corrected later.
[0162] Step 1012: The electronic device triggers the FIFO to sample the light source data and monitors the data volume.
[0163] Specifically, in step 1012, the electronic device triggers the scintillation sensor to collect light source data from the surrounding environment according to the initial cycle period, and fills the collected light source data into the SensorHub FIFO. At this time, the light source data is filled into the SensorHub FIFO21 in Figure 11 Then, the electronic device first deposits the light source data corresponding to the data volume into the circular buffer Buffer23 from the SensorHub FIFO according to the initial window value and monitors the data volume. When the data volume of the light source data in the circular buffer 23 is greater than 256 records, an FFT calculation is triggered, and the dynamic control process is started through the dynamic window controller 22 in Figure 11 That is, the process of dynamically adjusting the window size is started.
[0164] Step 1013: The electronic device determines the FFT calculation reference duration and predicts the second prediction duration of the next FFT calculation.
[0165] Specifically, after the electronic device performs 10 FFT calculations, it requests the time prediction model 25 in Figure 11 to predict the calculation duration of the next FFT calculation. First, the initial FFT calculation reference duration is adjusted to the average value of the calculation durations of these 10 FFT calculations, and the temperature of the SoC of the scintillation sensor is detected through the temperature sensor. Based on the time increase coefficient With the initial FFT calculation reference duration, referring to the above formulas (4) and (5), the FFT calculation reference duration is determined. Meanwhile, based on the first calculation duration of the current completed FFT calculation, the first predicted duration of the previous predicted FFT calculation, the first duration weight, and the second duration weight, the electronic device predicts the second predicted duration of the next FFT calculation with reference to the above formula (1), which is implemented by the time prediction model 25. The first duration weight and the second duration weight are related to the load change rate of the ADSP corresponding to the flicker sensor. The electronic device monitors the temperature and load throughout the process.
[0166] Step 1014: The electronic device feeds back the calculated FFT calculation reference duration and the second predicted duration to the dynamic window controller to apply for adjusting the window size.
[0167] It should be noted that when it is detected in step 1014 that the calculation error value between the second predicted duration and the actual calculation duration of the corresponding FFT calculation is greater than 25% for three consecutive times, it reverts to the fixed window mode, and according to the initial window value, the light source data of the corresponding data volume is stored from the SensorHub FIFO into the circular buffer. Subsequently, when it is detected that the calculation error value between the second predicted duration and the actual calculation duration of the corresponding FFT calculation is less than 15% for two consecutive times, it resumes to the dynamic prediction window mode. Alternatively, when the electronic device detects that the temperature of the SoC of the flicker sensor is greater than 60 °C, it activates high-temperature protection and reverts to the fixed window mode. Subsequently, when it is detected that the temperature of the SoC of the flicker sensor is less than or equal to 60 °C, it resumes to the dynamic prediction window mode.
[0168] Step 1015: The electronic device dynamically adjusts the window based on the target window value calculated from the FFT calculation reference duration and the second predicted duration.
[0169] Specifically, based on the FFT calculation reference duration and the second predicted duration, and introducing the window hysteresis coefficient and the preset window range during initialization, referring to the above formulas (2) and (3), the electronic device determines the target window value and dynamically adjusts the window value of the circular buffer through the dynamic window controller 22. This process is Figure 11 implemented by the dynamic window controller 22 and the window adjustment decision module 26 in
[0170] Step 1016: The electronic device stores the light source data into the circular buffer according to the target window value and triggers the FFT calculation when the FFT calculation condition is met.
[0171] Specifically, the electronic device dynamically adjusts the window value of the circular buffer through the dynamic window controller ②② and stores the light source data of the corresponding data volume from the SensorHub FIFO21 into the circular buffer 23 according to this window value. This is Figure 11It is implemented by the dynamic window controller 22, the window adjustment decision module 26, and the circular buffer 23 in
[0172] Step 1017: The electronic device performs FFT calculation and feeds back the calculation result.
[0173] Specifically, the electronic device performs the next FFT calculation in the circular buffer and reports the calculation result of the FFT calculation to the camera module. It is Figure 11 implemented by the FFT calculation module 24 and the frequency data reporting module 27 in
[0174] Step 1018: The electronic device feeds back the actual calculation duration of the FFT calculation to the time prediction model.
[0175] Specifically, the electronic device feeds back the actual calculation time of the FFT calculation to the time prediction model 25 for subsequent prediction of the FFT calculation duration.
[0176] It can be understood that during the implementation process of the above steps 1011 to 1018, the electronic device dynamically adjusts the cycle period according to the time consumption of the FFT calculation and the dynamic change of the window, that is, the period for the flicker sensor to collect light source data from the surrounding environment. The dynamic window controller 22 is responsible for controlling the entire dynamic process.
[0177] It should be noted that Figure 11 the frequency data reporting module 27 in
[0178] is the module that finally reports the calculation result. The Flicker sensor 20 finally feeds back the calculated frequency result to the camera Camera module through the frequency data reporting module 27, and the Camera module implements the anti-banding function according to the frequency result.
[0179] Each of the above method embodiments, or various possible implementation manners in each method embodiment, can be executed alone, or any two or more of them can be combined and executed. Specifically, it can be determined according to actual usage requirements, and the embodiments of the present application do not limit this.
[0180] The data management method provided by the embodiments of the present application may be executed by a data management device. In the embodiments of the present application, taking the data management device executing the data management method as an example, the data management device provided by the embodiments of the present application is described.
[0181] Figure 12 FIG. 4 shows a possible structural schematic diagram of a data management device involved in some embodiments of the present application. As Figure 12 shown, the data management device 10 may include: a processing module 11, an acquisition module 12, a determination module 13, and a storage module 14. The processing module 11 is configured to perform FFT calculation on the first data stored in the circular buffer of the scintillation sensor. The acquisition module 12 is configured to acquire a first calculation duration for the processing module 11 to perform FFT calculation on the first data. The processing module 11 is further configured to predict a second prediction duration for the next FFT calculation based on a first prediction duration of the previous FFT calculation and the first calculation duration acquired by the acquisition module 12. The determination module 13 is configured to determine a target window value based on the second prediction duration predicted by the processing module 11 and an FFT calculation reference duration. The storage module 14 is configured to store the second data collected by the scintillation sensor into the circular buffer according to the target window value determined by the determination module 13.
[0182] In a possible implementation manner, the above-mentioned processing module 11 is specifically configured to: perform weighted accumulation on the first prediction duration of the previous FFT calculation and the above-mentioned first calculation duration by using a first duration weight and a second duration weight, so as to obtain a second prediction duration for the next FFT calculation.
[0183] In a possible implementation manner, the above-mentioned determination module 13 is specifically configured to: use the arithmetic square root of the ratio of the above-mentioned second prediction duration to the above-mentioned FFT calculation reference duration, multiplied by a first window value, as a reference window value, where the first window value is the window value used when storing the above-mentioned first data in the circular buffer; and determine the above-mentioned target window value based on the reference window value, the first window value, and the window stickiness coefficient corresponding to the scintillation sensor.
[0184] In a possible implementation manner, the above-mentioned processing module 11 is further configured to calculate a second window value based on the above-mentioned second prediction duration and the above-mentioned FFT calculation reference duration. The above-mentioned acquisition module 12 is further configured to acquire an upper window limit value and a lower window limit value of a window range. The above-mentioned determination module 13 is specifically configured to: in the case where the second window value calculated by the processing module 11 is less than the lower window limit value acquired by the acquisition module 12, use the lower window limit value as the above-mentioned target window value; or, in the case where the second window value calculated by the processing module 11 is greater than the upper window limit value acquired by the acquisition module 12, use the upper window limit value as the above-mentioned target window value.
[0185] In a possible implementation, the above-mentioned acquisition module 12 is further configured to obtain an initial FFT calculation reference duration before the above-mentioned determination module 13 determines a target window value based on the above-mentioned second prediction duration and the FFT calculation reference duration. The initial FFT calculation reference duration is the average of the calculation durations of N FFT calculations, where N is a positive integer. The above-mentioned determination module 13 is further configured to determine the above-mentioned FFT calculation reference duration based on the reference temperature, the current temperature of the main chip of the above-mentioned scintillation sensor, the time increase coefficient corresponding to the above-mentioned scintillation sensor, and the initial FFT calculation reference duration obtained by the above-mentioned acquisition module 12.
[0186] In a possible implementation, the above-mentioned storage module 14 is specifically configured to store data of a first data volume in the above-mentioned circular buffer from the data collected by the above-mentioned scintillation sensor, where the first data volume is equal to the target window value determined by the above-mentioned determination module 13.
[0187] In a possible implementation, the above-mentioned processing module 11 is further configured to perform an FFT calculation on the third data stored in the above-mentioned circular buffer after the above-mentioned storage module 14 stores the second data collected by the above-mentioned scintillation sensor in the above-mentioned circular buffer according to the above-mentioned target window value. The third data includes the second data. The above-mentioned acquisition module 12 is further configured to obtain a second calculation duration of the above-mentioned processing module 11 for performing an FFT calculation on the third data. The above-mentioned determination module 13 is further configured to determine a calculation error value between the second calculation duration and the second prediction duration based on the second calculation duration obtained by the above-mentioned acquisition module 12 and the second prediction duration predicted by the above-mentioned processing module 11. The above-mentioned storage module 14 is further configured to store the data collected by the above-mentioned scintillation sensor in the above-mentioned circular buffer according to an initial window value when the calculation error values corresponding to the data stored in the above-mentioned circular buffer are greater than a first threshold for M consecutive times.
[0188] In a possible implementation, the above-mentioned storage module 14 is further configured to store the data collected by the above-mentioned scintillation sensor in the above-mentioned circular buffer according to an initial window value when the current temperature of the main chip of the above-mentioned scintillation sensor is greater than a second threshold.
[0189] An embodiment of the present application provides a data management device. The data management device can predict a second prediction duration for the next FFT calculation based on a first calculation duration of performing an FFT calculation on first data stored in a circular buffer of a scintillation sensor this time and a first prediction duration of the previous FFT calculation. Then, the data management device can determine a target window value, that is, the amount of data of the data to be stored in the circular buffer next time, based on the second prediction duration and an FFT calculation reference duration. Finally, the data management device can store second data collected by the scintillation sensor into the circular buffer according to the target window value, so that the data management device can dynamically adjust the size of the sliding window according to the predicted FFT calculation duration, that is, the amount of data stored in the circular buffer is dynamically adjusted. In this way, the flexibility of the data management device for data management is improved.
[0190] The data management device in the embodiment of the present application can be an electronic device or a component in an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices other than a terminal. Exemplarily, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a handheld computer, a vehicle-mounted electronic device, a Mobile Internet Device (MID), an augmented reality (AR) / virtual reality (VR) device, a robot, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA), etc., and can also be a server, a Network Attached Storage (NAS), a personal computer (PC), a television (TV), a teller machine, or a self-service machine, etc. The embodiment of the present application does not make specific limitations.
[0191] The data management device in the embodiment of the present application can be a device with an operating system. The operating system can be an Android operating system, an iOS operating system, or other possible operating systems. The embodiment of the present application does not make specific limitations.
[0192] The data management device provided by the embodiment of the present application can implement each process implemented by the above method embodiment. To avoid repetition, it will not be elaborated here.
[0193] Optionally, as Figure 13As shown in the figure, an embodiment of the present application further provides an electronic device 1300, including a processor 1301 and a memory 1302. A program or instruction that can run on the processor 1301 is stored on the memory 1302. When the program or instruction is executed by the processor 1301, it implements each step of the above-mentioned data management method embodiment and can achieve the same technical effect. To avoid repetition, it will not be elaborated here.
[0194] It should be noted that the electronic devices in the embodiments of the present application include the above-mentioned mobile electronic devices and non-mobile electronic devices.
[0195] Figure 14 It is a schematic diagram of the hardware structure of an electronic device according to an embodiment of the present application.
[0196] The electronic device 100 includes, but is not limited to: a radio frequency unit 101, a network module 102, an audio output unit 103, an input unit 104, a sensor 105, a display unit 106, a user input unit 107, an interface unit 108, a memory 109, and a processor 110 and other components.
[0197] Those skilled in the art can understand that the electronic device 100 may further include a power supply (such as a battery) for supplying power to each component. The power supply can be logically connected to the processor 110 through a power management system, so as to realize functions such as management of charging, discharging, and power consumption management through the power management system. Figure 14 The structure of the electronic device shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine some components, or have different component arrangements, which will not be elaborated here.
[0198] Among them, the above-mentioned processor 110 is used to perform FFT calculation on the first data stored in the circular buffer of the scintillation sensor and obtain the first calculation duration for performing FFT calculation on the first data; and, based on the first prediction duration of the previous FFT calculation and the first calculation duration, predict the second prediction duration of the next FFT calculation; and, based on the second prediction duration and the FFT calculation reference duration, determine the target window value; and, according to the target window value, store the second data collected by the scintillation sensor into the circular buffer.
[0199] In a possible implementation manner, the above-mentioned processor 110 is specifically used to: use the first duration weight and the second duration weight to perform weighted accumulation on the first prediction duration of the previous FFT calculation and the first calculation duration to obtain the second prediction duration of the next FFT calculation.
[0200] In a possible implementation, the above-mentioned processor 110 is specifically configured to: use the arithmetic square root of the ratio of the above-mentioned second prediction duration to the above-mentioned FFT calculation reference duration, multiplied by the first window value, as the reference window value, where the first window value is the window value used when storing the above-mentioned first data in the above-mentioned circular buffer; and, based on the reference window value, the first window value, and the window viscosity coefficient corresponding to the above-mentioned scintillation sensor, determine the above-mentioned target window value.
[0201] In a possible implementation, the above-mentioned processor 110 is further configured to calculate a second window value based on the above-mentioned second prediction duration and the above-mentioned FFT calculation reference duration; and obtain the upper window value and the lower window value of the window range. The processor 110 is further configured to, when the second window value is less than the lower window value, use the lower window value as the above-mentioned target window value; or, when the second window value is greater than the upper window value, use the upper window value as the above-mentioned target window value.
[0202] In a possible implementation, the above-mentioned processor 110 is further configured to obtain an initial FFT calculation reference duration before determining the target window value based on the above-mentioned second prediction duration and the FFT calculation reference duration, where the initial FFT calculation reference duration is the average of the calculation durations of N FFT calculations, and N is a positive integer; and, based on the reference temperature, the current temperature of the main chip of the above-mentioned scintillation sensor, the time increase coefficient corresponding to the above-mentioned scintillation sensor, and the above-mentioned initial FFT calculation reference duration, determine the above-mentioned FFT calculation reference duration.
[0203] In a possible implementation, the above-mentioned memory 109 is specifically configured to store data of a first data volume in the above-mentioned scintillation sensor collection data into the above-mentioned circular buffer, where the first data volume is equal to the target window value determined by the above-mentioned processor 110.
[0204] In a possible implementation, the above-mentioned processor 110 is further configured to, after the above-mentioned memory 109 stores the second data collected by the above-mentioned scintillation sensor into the above-mentioned circular buffer according to the above-mentioned target window value, perform an FFT calculation on the third data stored in the above-mentioned circular buffer, and obtain a second calculation duration for performing the FFT calculation on the third data, where the third data includes the second data; and, based on the second calculation duration and the above-mentioned second prediction duration, determine the calculation error value between the second calculation duration and the above-mentioned second prediction duration. The above-mentioned memory 109 is further configured to, when the calculation error values corresponding to the data stored in the above-mentioned circular buffer are greater than a first threshold for M consecutive times, store the data collected by the above-mentioned scintillation sensor into the above-mentioned circular buffer according to the initial window value.
[0205] In a possible implementation, the above-mentioned memory 109 is further configured to store the data collected by the scintillation sensor into the above-mentioned circular buffer according to the initial window value when the current temperature of the main chip of the scintillation sensor is greater than the second threshold.
[0206] In the embodiment of the present application, an electronic device can predict the second prediction duration of the next FFT calculation based on the first calculation duration of the FFT calculation performed on the first data stored in the circular buffer of the scintillation sensor this time and the first prediction duration of the previous FFT calculation. Then, the electronic device can determine the target window value, that is, the amount of data of the second data collected by the scintillation sensor to be stored in the circular buffer next time, based on the second prediction duration and the FFT calculation reference duration. Finally, the electronic device can store the second data collected by the scintillation sensor into the circular buffer according to the target window value, so that the electronic device can dynamically adjust the size of the sliding window according to the predicted FFT calculation duration, that is, the amount of data stored in the circular buffer is dynamically adjusted. In this way, the flexibility of the electronic device for data management is improved.
[0207] The electronic device provided in the embodiment of the present application can implement each process implemented in the above method embodiment and achieve the same technical effects. To avoid repetition, it will not be elaborated here. The beneficial effects of various implementation manners in this embodiment can be specifically referred to the beneficial effects of the corresponding implementation manners in the above method embodiment. To avoid repetition, it will not be elaborated here.
[0208] It should be understood that in the embodiment of the present application, the input unit 104 may include a Graphics Processing Unit (GPU) 1041 and a microphone 1042. The graphics processor 1041 processes the image data of static pictures or videos obtained by an image capture device (such as a camera) in the video capture mode or the image capture mode. The display unit 106 may include a display panel 1061, and the display panel 1061 may be configured in the form of a liquid crystal display, an organic light-emitting diode, etc. The user input unit 107 includes at least one of a touch panel 1071 and other input devices 1072. The touch panel 1071 is also called a touch screen. The touch panel 1071 may include two parts: a touch detection device and a touch controller. The other input devices 1072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which will not be elaborated here.
[0209] The memory 109 can be used to store software programs and various data. The memory 109 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data. Among them, the first storage area may store an operating system, application programs or instructions required for at least one function (such as a sound playback function, an image playback function, etc.). In addition, the memory 109 may include a volatile memory or a non-volatile memory, or the memory 109 may include both a volatile memory and a non-volatile memory. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDR SDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synch link dynamic random access memory (SLDRAM), and a direct rambus random access memory (DRRAM). The memory 109 in the embodiments of the present application includes, but is not limited to, these and any other suitable types of memories.
[0210] The processor 110 may include one or more processing units; optionally, the processor 110 integrates an application processor and a modem processor. Among them, the application processor mainly processes operations related to the operating system, user interface, and application programs, etc., and the modem processor mainly processes wireless communication signals, such as a baseband processor. It can be understood that the above modem processor may not be integrated into the processor 110 either.
[0211] The embodiments of the present application also provide a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, it implements each process of the above data management method embodiments and can achieve the same technical effects. To avoid repetition, it will not be elaborated here.
[0212] Among them, the processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media such as computer read-only memory ROM, random access memory RAM, magnetic disks, or optical discs, etc.
[0213] Another embodiment of the present application provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement each process of the above data management method embodiment, and can achieve the same technical effects. To avoid repetition, it will not be elaborated here.
[0214] It should be understood that the chip mentioned in the embodiments of the present application may also be referred to as a system-on-chip, system chip, chip system, or system-on-chip, etc.
[0215] The embodiments of the present application provide a computer program product. The program product is stored in a storage medium and is executed by at least one processor to implement each process of the above data management method embodiment, and can achieve the same technical effects. To avoid repetition, it will not be elaborated here.
[0216] It should be noted that in this article, the terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including a..." does not exclude the existence of additional identical elements in the process, method, article or device including that element. In addition, it should be pointed out that the methods and devices in the embodiments of the present application are not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in a reverse order according to the functions involved. For example, the described methods may be performed in an order different from that described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
[0217] Through the description of the above embodiments, those skilled in the art can clearly understand that the above-described example methods can be implemented by means of software plus a necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation. Based on such an understanding, the technical solution of the present application, in essence or the part that contributes to the prior art, can be embodied in the form of a computer software product. The computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions for causing a terminal (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in various embodiments of the present application.
[0218] The embodiments of the present application have been described above in conjunction with the accompanying drawings. However, the present application is not limited to the above specific embodiments. The above specific embodiments are merely illustrative and not restrictive. Under the inspiration of the present application, those of ordinary skill in the art can also make many forms without departing from the purpose of the present application and the scope protected by the claims, and all of them fall within the protection scope of the present application.
Claims
1. A data management method, characterized in that, Including: Performing fast Fourier transform (FFT) calculation on the first data stored in the circular buffer of the scintillation sensor, and obtaining the first calculation duration for performing FFT calculation on the first data; Predicting the second prediction duration for the next FFT calculation based on the first prediction duration of the previous FFT calculation and the first calculation duration; Determining a target window value based on the second prediction duration and the FFT calculation reference duration; Storing the second data collected by the scintillation sensor into the circular buffer according to the target window value.
2. The method according to claim 1, wherein The predicting the second prediction duration for the next FFT calculation based on the first prediction duration of the previous FFT calculation and the first calculation duration includes: Using a first duration weight and a second duration weight to perform weighted accumulation on the first prediction duration of the previous FFT calculation and the first calculation duration, to obtain the second prediction duration for the next FFT calculation.
3. The method according to claim 1, wherein The determining the target window value based on the second prediction duration and the FFT calculation reference duration includes: Taking the product of the arithmetic square root of the ratio of the second prediction duration to the FFT calculation reference duration and the first window value as a reference window value, where the first window value is the window value used when storing the first data in the circular buffer; Determining the target window value based on the reference window value, the first window value, and the window viscosity coefficient corresponding to the scintillation sensor.
4. The method according to claim 1 or 3, characterized in that, The determining the target window value based on the second prediction duration and the FFT calculation reference duration includes: Calculating a second window value based on the second prediction duration and the FFT calculation reference duration; Obtaining the window upper limit value and the window lower limit value of the window range; In the case where the second window value is less than the window lower limit value, taking the window lower limit value as the target window value; or In the case where the second window value is greater than the window upper limit value, taking the window upper limit value as the target window value.
5. The method according to claim 1, characterized in that, Before the determining the target window value based on the second prediction duration and the FFT calculation reference duration, the method further includes: Obtaining an initial FFT calculation reference duration, where the initial FFT calculation reference duration is the average of the calculation durations of N FFT calculations, and N is a positive integer; Determining the FFT calculation reference duration based on the reference temperature of the main chip of the scintillation sensor, the current temperature, the time increase coefficient corresponding to the scintillation sensor, and the initial FFT calculation reference duration.
6. The method according to claim 1, wherein The storing the second data collected by the scintillation sensor into the circular buffer according to the target window value includes: Storing data with a first data volume in the data collected by the scintillation sensor into the circular buffer, where the first data volume is equal to the target window value.
7. The method according to claim 1, characterized in that After the storing the second data collected by the scintillation sensor into the circular buffer according to the target window value, the method further includes: Performing FFT calculation on the third data stored in the circular buffer, and obtaining the second calculation duration for performing FFT calculation on the third data, where the third data includes the second data; Based on the second calculation duration and the second prediction duration, determine the calculation error value of the second calculation duration and the second prediction duration; When the calculation error values corresponding to the data stored in the circular buffer are greater than the first threshold for M consecutive times, store the data collected by the scintillation sensor into the circular buffer according to the initial window value.
8. The method according to claim 1, wherein The method further includes: When the current temperature of the main chip of the scintillation sensor is greater than the second threshold, store the data collected by the scintillation sensor into the circular buffer according to the initial window value.
9. A data management device, characterized in that, It includes: A processing module, an acquisition module, a determination module and a storage module; The processing module is used to perform fast Fourier transform (FFT) calculation on the first data stored in the circular buffer of the scintillation sensor; The acquisition module is used to acquire the first calculation duration of the processing module for performing FFT calculation on the first data; The processing module is further used to predict the second prediction duration of the next FFT calculation based on the first prediction duration of the previous FFT calculation and the first calculation duration acquired by the acquisition module; The determination module is used to determine the target window value based on the second prediction duration predicted by the processing module and the FFT calculation reference duration; The storage module is used to store the second data collected by the scintillation sensor into the circular buffer according to the target window value determined by the determination module.
10. An electronic device, characterized in that, It includes a processor and a memory, and the memory stores a program or instruction that can run on the processor. When the program or instruction is executed by the processor, the steps of the data management method according to any one of claims 1-8 are implemented.
11. A computer-readable storage medium, characterized in that, The program or instruction is stored on the readable storage medium. When the program or instruction is executed by the processor, the steps of the data management method according to any one of claims 1-8 are implemented.
Citation Information
Cited By
Fluorescence intensity signal acquisition method, fluorescence thermodetector and storage medium
CN122346332A
Methods for acquiring fluorescence intensity signals, fluorescence thermometers, and storage media.
CN122346332B