Storage switching method and electronic equipment

By detecting the number of target images in the electronic device and transferring them to NVM, the memory accumulation problem caused by shooting operations is solved, and the operating performance of the device is optimized.

CN119248174APending Publication Date: 2025-01-03HONOR DEVICE CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202410158597.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-02-04
Publication Date
2025-01-03

AI Technical Summary

Technical Problem

When the interval between multiple consecutive shooting operations is short or involves a large number of algorithmic processing, the target image is prone to accumulate in memory, resulting in the impact of the operating performance of the electronic device.

Method used

After turning on the camera, the number of target images in the cache area is detected. When the threshold is reached, it is transferred to nonvolatile memory (NVM) to free up the cache area, thereby avoiding image accumulation and optimizing operating performance. Specific conditions include the ratio of the remaining storage space to the total storage space of the NVM, the actual read and write speed, the processor operating frequency and operating temperature, etc.

Benefits of technology

It effectively avoids the accumulation of target images in memory, reduces memory usage, and ensures the smooth operation and performance of electronic devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119248174A_ABST
    Figure CN119248174A_ABST
Patent Text Reader

Abstract

The invention provides a storage switching method and electronic equipment. According to the method, electronic equipment such as a mobile phone and a tablet personal computer detects the storage amount of the target image corresponding to the shooting operation in the memory after a camera is started. After the storage amount of the target image reaches the threshold value, the electronic equipment can transfer the target image stored in the memory into the NVM, so that the situation that the target image is accumulated in the memory and the running performance of the electronic equipment is influenced is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of terminals, and in particular to a storage transfer method and an electronic device. Background Art

[0002] When the interval between multiple consecutive shooting operations is short, or when a large amount of algorithm processing is involved, the target images corresponding to the shooting operations are easily accumulated, thereby occupying a large amount of memory and affecting the operating performance of the electronic device. Summary of the invention

[0003] The present application provides a storage transfer method and an electronic device.

[0004] In a first aspect, the present application provides a storage transfer method, which includes: after turning on the camera, obtaining operating status information; when the operating status information meets a first condition, transferring the target image cached in the first cache area to the non-volatile memory NVM, and releasing the first cache area; wherein the target image is an image captured by the camera corresponding to the shooting operation; the first condition includes: the number of target images cached in the first cache area reaches a first threshold.

[0005] By implementing the storage transfer method provided in the first aspect, the electronic device can detect the number of target images cached in the cache area after turning on the camera, and after the number of target images cached in the cache area reaches a threshold, transfer the target images cached in the cache area to the NVM and release the cache area, thereby avoiding the target images from accumulating in the memory and affecting the operating performance of the electronic device.

[0006] In some embodiments, the first condition also includes one or more of the following: the ratio of the remaining storage space of the NVM to the total storage space is greater than or equal to a second threshold; the actual read and write speed of the NVM is greater than or equal to a third threshold; the actual operating frequency of the processor of the electronic device is greater than or equal to a fourth threshold; the operating temperature of the electronic device is less than or equal to a fifth threshold.

[0007] Preferably, the second threshold M2 ≥ 0.1; 40° C. ≤ the fifth threshold M5 ≤ 55° C. The third threshold M3 can be determined according to the reference operating speed of the NVM. The fourth threshold M4 can be determined according to the reference operating frequency of the processor 110 .

[0008] In this way, the electronic device can also detect whether the current operating state is suitable for transferring the target image in the buffer area to the NVM, so as to avoid the transfer process hindering the smooth operation of the camera application.

[0009] In some embodiments, a first number of target images are cached in the first cache area, and transferring the target images cached in the first cache area to the non-volatile memory NVM specifically includes: transferring a second number of target images in the first number of target images to the NVM; releasing the first cache area specifically includes: releasing the first sub-area, which is a storage area in the first cache area for storing the second number of target images.

[0010] The first cache area also includes a second sub-area, in which a third number of target images are stored. The third number of target images are images in the first number of target images excluding the second number of target images, and the camera captures the third number of target images before the camera captures the second number of images.

[0011] In this way, the electronic device can avoid transferring the target image that is undergoing algorithm processing, thereby preventing the transfer process from hindering the ongoing algorithm processing and hindering the smooth operation of the camera application.

[0012] Preferably, the third number of target images corresponds to one shooting operation, that is, only one group of target images being processed by the algorithm is retained, so as to transfer as many target images in the cache area as possible to the NVM, thereby reducing memory occupancy.

[0013] In some embodiments, the method further includes: acquiring a target image from the NVM; and processing the target image using a first algorithm to obtain a target photo. The first algorithm includes one or more of the following: a denoising algorithm, a beauty algorithm, a filter algorithm, and a background blur algorithm.

[0014] In some embodiments, the target image includes multiple frames of images corresponding to the first shooting operation. Before processing the target image through the first algorithm to obtain the target photo, the method also includes: processing the multiple frames of images corresponding to the first shooting operation through a fusion algorithm to obtain a first fused image; processing the target image through the first algorithm to obtain the target photo, specifically including: processing the first fused image through the first algorithm to obtain the target photo.

[0015] That is, in the multi-frame fusion photo-taking method, before performing denoising, beautification, filter, background blur and other processing on the target image, the electronic device can perform multi-frame fusion on multiple frames of target images corresponding to a shooting operation to obtain a fused image, and then perform the above-mentioned processing on the fused image to output a photo.

[0016] In some embodiments, the shooting operation includes: an automatic capture operation and / or a user capture operation. The electronic device generates an automatic capture operation after identifying a wonderful image that meets preset conditions.

[0017] In a second aspect, the present application provides an electronic device, comprising one or more processors and one or more memories; wherein the one or more memories are coupled to the one or more processors, and the one or more memories are used to store computer programs, and when the one or more processors execute the computer programs, the electronic device executes the method described in the first aspect and any possible implementation method of the first aspect.

[0018] In a third aspect, an embodiment of the present application provides a chip system, which is applied to an electronic device, and the chip system includes one or more processors, which are used to call computer instructions so that the electronic device executes the method described in the first aspect and any possible implementation method of the first aspect.

[0019] In a fourth aspect, the present application provides a computer-readable storage medium, including a computer program. When the above-mentioned computer program runs on an electronic device, the above-mentioned electronic device executes the method described in the first aspect and any possible implementation method of the first aspect.

[0020] In a fifth aspect, the present application provides a computer program product comprising instructions, which, when executed on an electronic device, enables the electronic device to execute the method described in the first aspect and any possible implementation of the first aspect.

[0021] It can be understood that the electronic device provided in the second aspect, the chip system provided in the third aspect, the computer storage medium provided in the fourth aspect, and the computer program product provided in the fifth aspect are all used to execute the method provided in the present application. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method, which will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1 is a schematic diagram of the structure of an electronic device 100 provided in an embodiment of the present application;

[0023] Figure 2A-2J It is a user interface diagram of a group of electronic devices 100 implementing automatic snapshots provided in an embodiment of the present application;

[0024] Figure 3 is a schematic diagram of a target image stacking provided by an embodiment of the present application;

[0025] Figure 4 is a flow chart of a storage transfer method provided in an embodiment of the present application;

[0026] Figure 5 is a schematic diagram of transferring a target image to NVM provided by an embodiment of the present application;

[0027] Figure 6It is a flowchart of another storage transfer method provided in an embodiment of the present application. DETAILED DESCRIPTION

[0028] The terms used in the following embodiments of the present application are only for the purpose of describing specific embodiments and are not intended to limit the present application.

[0029] Figure 1 It is a schematic diagram of the structure of the electronic device 100 provided in an embodiment of the present application.

[0030] like Figure 1 As shown, the electronic device 100 may include a processor 110 , an internal memory 121 , a camera 193 , a display screen 194 , a sensor module 180 , and a button 190 .

[0031] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Among them, different processing units may be independent devices or integrated into one or more processors. The controller may generate an operation control signal according to the instruction opcode and the timing signal to complete the control of fetching and executing instructions.

[0032] The processor 110 may include one or more interfaces, such as an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc. The processor 110 may be coupled to various components, such as the internal memory 121, the camera 193, the display screen 194, the sensor module 180, the button 190, etc., through the one or more interfaces.

[0033] The internal memory 121 may include one or more random access memories (RAM) and one or more non-volatile memories (NVM). RAM includes static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM, for example, the fifth generation DDR SDRAM is generally referred to as DDR5 SDRAM), etc. NVM includes read only memory (ROM), programmable read-only memory (PROM), electrically erasable programmable read only memory (EAROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), flash memory (FLASH), etc.

[0034] RAM can be directly read and written by the processor 110, and can be used to store executable programs of the operating system or other running programs, and can also be used to store user and application data, etc. The memory of the electronic device 100 usually uses RAM. NVM is also used to store executable programs and user and application data, etc. The operating system, driver, various applications, users and application data of the electronic device 100 are all stored in NVM. When starting the operating system, driver, and various applications, the electronic device 100 loads the operating system, driver, and various applications, users and application data stored in NVM into RAM for direct reading and writing by the processor 110.

[0035] The camera 193 is used to capture images. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. After the photosensitive element converts the light signal into an electrical signal, it passes the electrical signal to the ISP for conversion into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. The electronic device 100 may include N cameras 193, where N≥1.

[0036] The display screen 194 is used to display images. The display screen 194 includes a display panel. The display panel may be a liquid crystal display (LCD). The display panel may also be an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), miniled, microled, micro-oled, a quantum dot light-emitting diode (QLED), etc. The electronic device may include N display screens 194, where N≥1.

[0037] The electronic device 100 can realize the shooting function through the camera 193, ISP, video codec, GPU, display screen 194 and application processor.

[0038] The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, and the like.

[0039] The touch sensor 180K, also called a "touch control device", can be used to detect touch operations acting on the touch sensor 180K. The touch sensor 180K can be arranged in the display screen 194. The electronic device 100 can detect the user's touch operations, such as click operations, long press operations, sliding operations, etc., through the touch sensor 180K, and then provide visual output related to the touch operation through the display screen 194. The pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal. The pressure sensor 180A can also be arranged in the display screen 194. In some embodiments, the electronic device 100 can implement more complex touch operation detection, such as knuckle tapping operations, etc., through the touch sensor 180K and the pressure sensor 180A, and then provide visual output related to the above-mentioned more complex touch time through the display screen 194.

[0040] The gyroscope sensor 180B can be used to determine the angular velocity of the electronic device 100 around three axes (i.e., x, y, and z axes). The acceleration sensor 180E can be used to determine the magnitude of the acceleration of the electronic device 100 in various directions (generally three axes). The electronic device 100 can determine the posture of the electronic device 100 through the gyroscope sensor 180B and the acceleration sensor 180E. The air pressure sensor 180C can be used to measure air pressure. The magnetic sensor 180D can be used to detect the opening and closing of the flip leather case. The distance sensor 180F can be used to measure the distance. The proximity light sensor 180G can be used to detect nearby objects. The ambient light sensor 180L is used to sense the ambient light brightness. The electronic device 100 can adaptively adjust the brightness of the display screen 194 according to the perceived ambient light brightness. The fingerprint sensor 180H is used to collect fingerprints. The temperature sensor 180J is used to detect the temperature. The bone conduction sensor 180M can obtain a vibration signal.

[0041] The key 190 includes a power key, a volume key, etc. The key 190 may be a mechanical key or a touch key. The electronic device 100 may receive key input and generate key signal input related to user settings and function control of the electronic device 100.

[0042] like Figure 1 As shown, the electronic device 100 may also include an external memory interface 120, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a motor 191, an indicator 192, and a subscriber identification module (SIM) card interface 195 and other components.

[0043] The external memory interface 120 can be used to connect an external NVM to expand the storage capacity of the electronic device 100. The electronic device 100 can receive charging input through the charging management module 140, and power the electronic device 100 through the power management module 141 and the battery 142. The electronic device 100 can implement wireless communication functions through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor. The electronic device 100 can implement audio functions through the audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone interface 170D, and application processor, such as collecting sound signals when collecting and displaying images. The motor 191 can generate vibration prompts. The indicator 192 can be an indicator light, which can be used to indicate the charging status, power changes, messages, missed calls, notifications, etc. The SIM card interface 195 can be used to connect a SIM card.

[0044] It is to be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the electronic device 100. The electronic device 100 may include more or fewer components, or combine certain components, or separate certain components, or arrange the components in different ways. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0045] Preferably, the electronic device 100 is a mobile phone. Not limited to mobile phones, the electronic device 100 may also be a tablet computer, a desktop computer, a laptop computer, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, and a cellular phone, a personal digital assistant (PDA), an augmented reality (AR) device, a virtual reality (VR) device, an artificial intelligence (AI) device, a wearable device, a vehicle-mounted device, a smart home device and / or a smart city device. The embodiment of the present application does not impose any special restrictions on the specific type of the electronic device 100.

[0046] In the process of realizing the shooting function through the camera 193, ISP, video codec, GPU, display screen 194 and application processor, the electronic device 100 can obtain a photo by shooting the image captured by the camera 193 according to the user's shooting operation. The above-mentioned user shooting operation includes: an operation acting on a specific shooting control on the screen, and a pressing operation acting on a physical button. The above-mentioned screen includes a display screen 194, a touch sensor 180K, and may also include a pressure sensor 180A. The above-mentioned physical button includes a button 190.

[0047] In the embodiment of the present application, the electronic device 100 can also identify whether the image captured by the camera 193 meets the preset conditions of the wonderful image. After identifying the wonderful image that meets the preset conditions, the electronic device 100 can generate an automatic capture instruction, and then capture the wonderful image according to the above automatic capture instruction to obtain a photo. The operation of the electronic device 100 capturing the wonderful image according to the automatic capture instruction is an automatic capture operation.

[0048] Figure 2A-2J It is a schematic diagram of a user interface for implementing automatic snapshot by a group of electronic devices 100 provided in an embodiment of the present application.

[0049] The electronic device 100 can display the image through the display capability provided by the GPU and the display screen 194. Figure 2A-2J The user interface diagram shown in the figure. The electronic device 100 can detect the user's touch operation, such as a click operation, a long press operation, a sliding operation, etc., through the touch sensor 180K, and then provide visual output related to the touch operation through the display screen 194, such as updating the controls, images and other contents in the user interface, and switching the user interface.

[0050] Specifically, Figure 2A It is a main interface (homepage) 201 of an electronic device 100 provided in an embodiment of the present application.

[0051] like Figure 2A As shown, the main interface 201 may display multiple application icons, such as a setting application icon 213A, an application market application icon 213B, a gallery application icon 213C, a weather application icon 213D, a phone application icon 213E, a browser application icon 213F, a camera application icon 213G, etc. An application icon can be used to open an application. Not limited to the above icons, the main interface 201 may also include other application icons, which are not listed here one by one.

[0052] Understandably, Figure 2A The user interface described below merely illustrates a possible user interface style of the electronic device 100 taking a mobile phone as an example, and should not constitute a limitation on the embodiments of the present application.

[0053] The camera application icon 213G corresponds to the camera application. Figure 2A As shown, the electronic device 100 can detect the user operation acting on the camera application icon 213G. In response to the above operation, the electronic device 100 can open the camera application and turn on the camera 193. After the camera application is opened, the electronic device 100 can display Figure 2B A user interface of a camera application is shown. This interface is also called a preview interface 202.

[0054] like Figure 2B As shown, the preview interface 202 may include a shooting control 222 , a preview window 223 , and a review control 224 .

[0055] The shooting control 222 is also called a shutter key, which can be used to receive user operations. User operations acting on the shooting control 222, such as the operation of clicking the shooting control 222, are operations acting on specific shooting controls on the screen (user shooting operations). After detecting the user operation acting on the shooting control 222, the electronic device 100 can generate a shooting instruction, and then the electronic device 100 can shoot the image captured by the camera 193 at the corresponding time according to the above shooting instruction. In the photo mode, the electronic device 100 can shoot the image captured by the camera 193 at the corresponding time according to the above shooting instruction to obtain a photo. In the video recording mode, the electronic device 100 can shoot the image captured by the camera 193 at the corresponding time stamp according to the above shooting instruction to obtain a video. Among them, the photo mode includes a conventional photo mode, a portrait mode, a night scene mode, a large aperture mode, etc.; the video recording mode includes a conventional video recording mode, a movie mode, etc., which are not listed one by one here.

[0056] The preview window 223 can be used to display in real time the image captured by the camera 193. The review control 224 can display a thumbnail of the image (photo / video) taken most recently.

[0057] Taking photo taking as an example, after observing an image that meets the user's expectations through the preview window 223, the user can click the shooting control 222. According to the click operation on the shooting control 222, the electronic device 100 can generate a photo taking instruction, and then take the image collected by the camera 193 corresponding to the timestamp according to the above-mentioned photo taking instruction to obtain a photo. After obtaining the photo, the electronic device 100 can display a thumbnail of the taken photo in the review control 224. Then, through the user operation on the review control 224, the user can browse the above-mentioned photos.

[0058] In the embodiment of the present application, the preview interface 202 may further include an automatic snapshot control 221. The automatic snapshot control 221 may be used to enable automatic snapshot. Figure 2C, the electronic device 100 may detect a user operation, such as a click operation, acting on the automatic snapshot control 221. In response to the above operation, the electronic device 100 may start automatic snapshot.

[0059] After the automatic capture is turned on, the electronic device 100 starts to identify whether the image captured by the camera 193 meets the preset conditions of the wonderful image. After identifying the wonderful image that meets the preset conditions, the electronic device 100 can generate an automatic capture instruction, and then take the wonderful image according to the above automatic capture instruction to obtain a photo. Figure 2D After the automatic capture is turned on, the electronic device 100 can display the automatic capture control 225. The automatic capture control 225 can be used to turn off the automatic capture.

[0060] The electronic device 100 may capture a group of images of athletes performing long jump. The electronic device 100 may display the above images in the preview window 223 in sequence. Figure 2E-Figure 2I , the electronic device 100 can sequentially view images P1-P5 in the preview window 223. Exemplarily, the electronic device 100 can recognize that image P3 meets the preset conditions of a wonderful image. In response to image P3 meeting the preset conditions of a wonderful image, the electronic device 100 can generate an automatic capture instruction for capturing image P3, and then capture image P3 according to the automatic capture instruction to obtain a photo. Figure 2H After triggering the shooting of image P3, the electronic device 100 may display a thumbnail S3 obtained according to image P3 in the review control 224, prompting the user that a photo has been taken.

[0061] refer to Fig.2I , the electronic device 100 can detect the user operation acting on the review control 224. Figure 2J In response to the above operation, the electronic device 100 may display the gallery preview interface 203. The electronic device 100 may display the photos taken according to the image P3 in the gallery preview interface 203. Optionally, the electronic device 100 may also display an automatic capture mark 226 in the gallery preview interface 203 to prompt the user that the currently displayed photo is automatically captured by the electronic device 100.

[0062] Manual shooting operations and automatic snapshot operations may be collectively referred to as shooting operations. In the process of obtaining a photo by shooting an image captured by the camera 193 according to the shooting operation, the electronic device 100 first needs to write the target image corresponding to the shooting operation in the image captured by the camera 193 into a specific area of ​​the memory. Then, the electronic device 100 reads the target image from the above-mentioned specific area and performs algorithm processing to obtain a photo. The above-mentioned algorithm includes one or more of the following: multi-frame fusion algorithm, denoising algorithm, beauty algorithm, filter algorithm, and background blur algorithm.

[0063] In a shooting scene with automatic capture turned off, the electronic device 100 can detect multiple user shooting operations. In a shooting scene with automatic capture turned on, the electronic device 100 can detect multiple user shooting operations, and at the same time, the electronic device 100 can also perform multiple automatic capture operations based on the multiple wonderful images identified. When the interval between multiple consecutive shooting operations is short, or when a large amount of algorithm processing is involved, the target images in the memory are easily accumulated, thereby occupying a large amount of memory, affecting the operating performance of the electronic device 100.

[0064] Figure 3 It is a schematic diagram of target image stacking provided in an embodiment of the present application.

[0065] After detecting a user operation on the camera application icon 213G, the electronic device 100 may load the program code of the camera application stored in the NVM into the memory, start the camera application, and turn on the camera 193. Figure 3 During the loading process, the camera application may apply for two storage areas from the memory, such as the buffer area A1 and the buffer area A2, for storing the original images captured by the camera 193.

[0066] The image collected by the camera 193 is first sent to the buffer A1. Taking the frame rate of 30fps as an example, the camera 193 can generate an image every 33.3 milliseconds. The buffer A1 can receive a frame of the image reported by the camera 193 every 33.3 milliseconds.

[0067] Buffer A1 is a first-in, first-out queue. Preferably, buffer A1 is a circular first-in, first-out queue. After the number of images stored in buffer A1 reaches the maximum value, buffer A1 will release the storage block storing the earliest frame of image in the current queue, and then use the above storage block to store the latest frame of image sent by camera 193.

[0068] refer to Figure 3 , illustratively, the buffer area A1 may include 16 storage blocks B1 to B16. The buffer area A1 may sequentially receive the 1st frame image (F1) to the 16th frame image (F16) reported by the camera 193, and write the above images F1 to F16 into the storage blocks B1 to B16. After receiving the 17th frame image (F17) reported by the camera 193, the buffer area A1 may release the storage block B1, that is, delete the 1st frame image (F1) stored in the storage block B1, and then use the storage block B1 to store the latest received 17th frame image. By analogy, the buffer area A1 can always keep the cached 16 most recent frames of images.

[0069] After the shooting is triggered according to the user shooting operation or the automatic snapshot operation, the electronic device 100 can determine the target image corresponding to the shooting operation. In the multi-frame fusion shooting method, one shooting operation can correspond to multiple frames of target images. Figure 3 For example, the target image corresponding to the shooting operation capture1 may include the 2nd frame (F2) to the 5th frame (F5) reported by the camera 193; the target image corresponding to the shooting operation capture2 may include the 8th frame (F8) to the 11th frame (F11) reported by the camera 193; the target image corresponding to the shooting operation capture3 may include the 13th frame (F13) to the 16th frame (F16) reported by the camera 193. In ordinary photographing methods, one shooting operation may also correspond to only one frame of target image. For example, capture1 may correspond to the target image F3, capture2 may correspond to the target image F9, and capture3 may correspond to the target image F14.

[0070] After determining the target image, the electronic device 100 may write the target image into the buffer A2. Then, the electronic device 100 may read the target image from the buffer A2 and perform algorithm processing to obtain a photo. After the target image is processed by the algorithm to obtain a photo, the buffer A2 will release the storage block storing the target image.

[0071] refer to Figure 3 , after determining the target images F2 to F5 corresponding to the shooting operation capture1, the electronic device 100 may write the target images F2 to F5 into the buffer area A2. After the target images before capture1 are processed, the electronic device 100 may obtain the target images F2 to F5 corresponding to capture1 from the buffer area A2, and use the algorithm to process the target images F2 to F5 to obtain a frame of photo. In the process of using the algorithm to process the target images F2 to F5, the electronic device 100 may continue to detect more shooting operations such as shooting operation capture2 and shooting operation capture3, and then continue to write more target images such as target images F8 to F11 corresponding to capture2 and target images F13 to F16 corresponding to capture3 into the buffer area A2. At this time, when the interval between multiple consecutive shooting operations is short, or when a large amount of algorithm processing is involved, the target images in the buffer area A2 are easily accumulated, thereby occupying a large amount of memory, affecting the operating performance of the electronic device 100.

[0072] In view of this, an embodiment of the present application provides a storage transfer method.

[0073] In this method, the electronic device 100 can detect the storage amount of the target image in the memory, that is, the number of target images stored in the buffer area A2, after turning on the camera 193. After the storage amount of the target image in the memory reaches the threshold M1, the electronic device 100 can transfer the target image stored in the memory to the NVM, thereby avoiding the accumulation of the target image in the memory.

[0074] Figure 4 It is a flow chart of a storage transfer method provided in an embodiment of the present application.

[0075] S401. After detecting that the camera 193 is turned on, the electronic device 100 obtains the storage capacity of the target image in the memory.

[0076] refer to Figure 3 According to the introduction, after the camera 193 is turned on, the electronic device 100 will apply for the buffer area A2 in the memory, and after determining the target image corresponding to the shooting operation, write the target image into the buffer area A2. Therefore, after detecting that the camera 193 is turned on, the electronic device 100 can detect the storage capacity of the target image in the buffer area A2 (the first buffer area), that is, detect the storage capacity of the target image in the memory.

[0077] S402: When the storage amount of the target image in the memory reaches the threshold M1, the electronic device 100 transfers the target image stored in the memory to the NVM.

[0078] The threshold M1 (first threshold) can be set according to the size of the memory, the number of running applications, and the number of images required for image fusion. For example, the larger the memory is, the fewer the number of running applications is, and the larger the threshold M1 can be set accordingly. Exemplarily, in a shooting scenario of four-image fusion (i.e., one shooting operation corresponds to four frames of target images, and one frame of image occupies one storage block), the threshold M1 can be set to 12 (storage blocks).

[0079] One shooting operation corresponds to multiple frames of target images as a group of target images. For example, the target images F2 to F5 corresponding to capture1 are a group of target images, the target images F8 to F11 corresponding to capture2 are a group of target images, and the target images F13 to F16 corresponding to capture3 are a group of target images. Preferably, after the storage capacity of the target images in the memory reaches the threshold M1, the electronic device 100 may transfer only part of the target images in the buffer area A2 to the NVM, rather than all of them. Preferably, the electronic device 100 may keep the first group of target images stored in the buffer area A2, and transfer other target images after the first group of target images to the NVM.

[0080] For example, Figure 3Taking capture1 to capture3 and M1=12 as an example, after the target images F13 to F16 are written into the buffer area A2, the storage amount of the target images in the memory reaches the threshold value M1. Figure 5 is a schematic diagram of transferring a target image to NVM provided by an embodiment of the present application. Figure 5 After the storage amount of the target images in the memory reaches the threshold value M1, the electronic device 100 can keep the first group of target images, that is, the target images F2~F5 corresponding to capture1, and continue to store them in the cache area A2. The electronic device 100 can transfer other target images after the first group of target images, such as target images F8~F11 and target images F13~F16, to the NVM.

[0081] In this way, the electronic device 100 can avoid transferring the target image that is undergoing algorithm processing, thereby avoiding hindering the ongoing algorithm processing and hindering the smooth operation of the camera application.

[0082] Optionally, the electronic device 100 may also keep 2 or more sets of target images stored in the buffer area A2 and transfer fewer target images to the NVM. This embodiment of the present application does not limit this.

[0083] refer to Figure 5 After transferring the target image to the NVM, the electronic device 100 may release the storage blocks storing the transferred image in the buffer area A2, such as storage blocks B22 and B23, to reduce the accumulation of the target image in the memory and reduce the memory occupancy.

[0084] S403: The electronic device 100 processes the target image stored in the NVM to obtain a photo.

[0085] After transferring the target image to the NVM, the electronic device 100 may directly read the target image from the NVM and input the target image into the algorithm for processing.

[0086] Exemplarily, after processing the target images F8 to F11 and the target images F13 to F16, and after processing the target images F2 to F5 to obtain the photo Q1, the electronic device 100 can directly read the target images F8 to F11 from the NVM, and perform multi-frame fusion on the target images F8 to F11 to obtain a frame of fused image (first fused image), without loading the target images F8 to F11 into the memory and occupying the memory. Then, the electronic device 100 can perform image processing on the above-mentioned fused image to obtain the photo Q2. The above-mentioned image processing includes one or more of the following: denoising, beautification, filters, and background blur. Of course, it is not limited to denoising, beautification, filters, and background blur, and image processing can also include other more processing. Similarly, after processing the target images F8 to F11, the electronic device 100 can directly read the target images F3 to F16 from the NVM, perform multi-frame fusion and image processing on the target images F13 to F16, and obtain the photo Q3 and so on.

[0087] It can be understood that in ordinary photo-taking methods, that is, one shooting operation corresponds to one frame of target image. After reading the target image from the NVM, the electronic device 100 does not need to perform multi-frame fusion processing on the target image, and can directly perform image processing such as denoising, beautification, filter, background blur, etc.

[0088] In the above method, M1 (e.g., 12) frames of target images cached in the buffer area A2, such as target images F2 to F5, target images F8 to F11, and target images F13 to F16, are the first number of target images. The target images retained in the buffer area A2, such as 4 frames of target images F2 to F5, are the third number of target images. The cache area corresponding to the target images retained in the buffer area A2, such as the storage block B21, can be called the second sub-area. The target images transferred to the NVM, such as the target images F8 to F11 and the target images F13 to F16 are the second number of target images. The storage area corresponding to the target images transferred to the NVM, such as the storage blocks B22 and B23, can be called the first sub-area. The image processing algorithm (including one or more of the denoising algorithm, the beauty algorithm, the filter algorithm, and the background blur algorithm) is the first algorithm. The target images F8 to F11 and the target images F13 to F16 can be called the multiple frames of images corresponding to the first shooting operation. Correspondingly, capture2 and capture3 can be referred to as the first shooting operation.

[0089] Furthermore, while detecting the storage capacity of the target image in the memory, the electronic device 100 may also obtain other operating status information to determine whether the current operating state of the electronic device 100 is suitable for transferring the target image stored in the buffer area A2 to the NVM. If suitable, the electronic device 100 transfers the target image stored in the buffer area A2 to the NVM of the electronic device 100 to avoid the transfer process hindering the smooth operation of the camera application.

[0090] Figure 6 It is a flowchart of another storage transfer method provided in an embodiment of the present application.

[0091] S601. After detecting that the camera 193 is turned on, the electronic device 100 obtains operating status information.

[0092] The operation status information first includes the storage capacity of the target image in the memory. Optionally, the operation status information may also include one or more of the following: the remaining storage space of the NVM, the actual operation speed of the NVM, the actual operating frequency of the processor 110, and the operation temperature of the electronic device 100. The electronic device 100 may obtain the operation temperature of the electronic device 100 at any time through the temperature sensor 180J.

[0093] S602: When the operation status information meets a preset condition, the electronic device 100 transfers the target image stored in the memory to the NVM.

[0094] Corresponding to the storage capacity of the target image in the memory in the operation status information, the preset condition first includes: the storage capacity of the target image in the memory reaches the threshold value M1. In addition, optionally, the preset condition also includes one or more of the following: (1) the ratio of the remaining storage space of the NVM to the total storage space is greater than or equal to the threshold value M2 (second threshold); (2) the actual read and write speed of the NVM (unit: bit / second) is greater than or equal to the threshold value M3 (third threshold); (3) the actual operating frequency of the processor 110 is greater than or equal to the threshold value M4 (fourth threshold); (4) the operating temperature is less than or equal to the threshold value M5 (fifth threshold).

[0095] Among them, preferably, M2≥0.1; 40℃≤M5≤55℃.

[0096] The reference operating speeds of NVMs with different storage media, storage cycles, and circuit designs are different. For example, the read speed of NAND FLASH can usually reach hundreds of megabytes per second, while the read and write speed of EEPROM is generally several megabytes per second. Therefore, the threshold M3 can be determined according to the reference operating speed of the NVM. For example, the threshold M3 can be set to 0.5 times the reference operating speed.

[0097] Similarly, the threshold M4 may be determined according to the reference operating frequency of the processor 110. For example, the threshold M4 may be set to N times the reference operating frequency, 0.7≤N≤0.8.

[0098] When the operation status information meets the above preset conditions, the electronic device 100 can confirm whether the current operation status is suitable for transferring the target image stored in the buffer area A2 to the NVM, so the electronic device 100 transfers the target image stored in the buffer area A2 to the NVM, thereby releasing the corresponding memory space, reducing the accumulation of target images in the memory, and reducing the memory occupancy. Similarly, the electronic device 100 can also keep the first group of target images stored in the buffer area A2, and transfer other target images after the first group of target images to the NVM to avoid transferring the target images that are being processed by the algorithm, thereby avoiding hindering the ongoing algorithm processing process and hindering the smooth operation of the camera application.

[0099] S603: The electronic device 100 processes the target image stored in the NVM to obtain a photo.

[0100] The term "user interface (UI)" in the specification, claims and drawings of this application refers to the medium interface for interaction and information exchange between an application or operating system and a user, which realizes the conversion between the internal form of information and the form acceptable to the user. The user interface of an application is source code written in a specific computer language such as Java and extensible markup language (XML). The interface source code is parsed and rendered on the terminal device, and finally presented as content that the user can recognize, such as pictures, text, buttons and other controls. Controls, also known as widgets, are the basic elements of the user interface. Typical controls include toolbars, menu bars, text boxes, buttons, scroll bars, pictures and text. The properties and contents of controls in the interface are defined by tags or nodes, such as XML through <textview> 、 <imgview> 、

[0101] <videoview>The controls contained in the interface are specified by nodes such as <head> and <body>. A node corresponds to a control or attribute in the interface. After being parsed and rendered, the node is presented as user-visible content. In addition, many applications, such as hybrid applications, usually also contain web pages in their interfaces. A web page, also known as a page, can be understood as a special control embedded in the application interface. A web page is source code written in a specific computer language, such as hypertext markup language (HTML), cascading style sheets (CSS), JavaScript (JS), etc. The web page source code can be loaded and displayed as user-recognizable content by a browser or a web page display component with similar functions to a browser. The specific content contained in a web page is also defined by tags or nodes in the web page source code. For example, HTML is defined by <body>. 、 、 <video> 、 <canvas>To define the elements and attributes of a web page.

[0102] The most common form of user interface is graphical user interface (GUI), which refers to a user interface related to computer operation that is displayed in a graphical manner. It can be an icon, window, control or other interface element displayed on the display screen of an electronic device, where a control can include icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, widgets and other visual interface elements.

[0103] As used in the specification and appended claims of the present application, the singular expressions "a", "an", "said", "above", "the" and "this" are intended to also include plural expressions, unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used in the present application refers to and includes any or all possible combinations of one or more listed items. As used in the above embodiments, the term "when..." may be interpreted to mean "if..." or "after..." or "in response to determining..." or "in response to detecting...", depending on the context. Similarly, the phrase "when determining..." or "if (stated condition or event) is detected" may be interpreted to mean "if determining..." or "in response to determining..." or "when (stated condition or event) is detected" or "in response to detecting (stated condition or event)", depending on the context.

[0104] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that contains one or more available media integration. The available medium can be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk), etc.

[0105] Those skilled in the art can understand that to implement all or part of the processes in the above-mentioned embodiments, the processes can be completed by computer programs to instruct related hardware, and the programs can be stored in computer-readable storage media. When the programs are executed, they can include the processes of the above-mentioned method embodiments. The aforementioned storage media include: ROM or random access memory RAM, magnetic disk or optical disk and other media that can store program codes.< / canvas> < / video> < / videoview> < / imgview> < / textview>

Claims

1. A storage transfer method, applied to electronic equipment, characterized in that: The method comprises: After turning on the camera, obtain the running status information; When the operation status information satisfies a first condition, the target image cached in the first buffer area is transferred to a non-volatile memory NVM, and the first buffer area is released; The target image is an image captured by a camera corresponding to the shooting operation; The first condition includes: the number of the target images cached in the first cache area reaches a first threshold.

2. The method according to claim 1, characterized in that The first condition also includes one or more of the following: A ratio of the remaining storage space of the NVM to the total storage space is greater than or equal to a second threshold; The actual read and write speed of the NVM is greater than or equal to a third threshold; The actual operating frequency of the processor of the electronic device is greater than or equal to a fourth threshold; The operating temperature of the electronic device is less than or equal to a fifth threshold.

3. The method according to claim 1 or 2, characterized in that: A first number of target images are cached in the first cache area, and transferring the target images cached in the first cache area to the non-volatile memory NVM specifically includes: transferring a second number of target images in the first number of target images to the NVM; The releasing the first buffer area specifically includes: releasing a first sub-area, where the first sub-area is a storage area in the first buffer area storing the second number of target images.

4. The method according to claim 3, characterized in that The first cache area also includes a second sub-area, in which a third number of target images are stored. The third number of target images are images of the first number of target images excluding the second number of target images, and the camera collects the third number of target images before the camera collects the second number of target images.

5. The method according to claim 4, characterized in that The third number of target images corresponds to one photographing operation.

6. The method according to any one of claims 1 to 5, characterized in that: The method further comprises: Acquire the target image from the NVM; The target image is processed by a first algorithm to obtain a target photo.

7. The method according to claim 6, characterized in that The first algorithm includes one or more of the following: a denoising algorithm, a beauty algorithm, a filter algorithm, and a background blur algorithm.

8. The method according to claim 6, characterized in that The target image includes multiple frames of images corresponding to the first shooting operation. Before the target image is processed by the first algorithm to obtain the target photo, the method further includes: processing the multiple frames of images corresponding to the first shooting operation by a fusion algorithm to obtain a first fused image; Processing the target image by using the first algorithm to obtain the target photo specifically includes: processing the first fused image by using the first algorithm to obtain the target photo.

9. The method according to claim 1, characterized in that: The shooting operation includes: an automatic snapshot operation and / or a user shooting operation. The electronic device generates the automatic snapshot operation after identifying a wonderful image that meets a preset condition.

10. An electronic device, characterized in that: The method comprises one or more processors and one or more memories; wherein the one or more memories are coupled to the one or more processors, and the one or more memories are used to store a computer program, and when the one or more processors execute the computer program, the method according to any one of claims 1 to 9 is executed.

11. A chip system, the chip system is applied to electronic equipment, the chip system comprises one or more processors, characterized in that: The processor is configured to call computer instructions so that the electronic device executes the method according to any one of claims 1 to 9.

12. A computer-readable storage medium comprising a computer program, characterized in that: When the computer program is executed on an electronic device, the electronic device is enabled to execute the method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Continuous shooting image processing method and device, electronic equipment and storage medium

    CN115686359A

  • Image shooting method and electronic equipment

    CN116347229A

  • Photographing control method based on foldable screen and electronic device

    WO2023020006A1