Hotspot file identification method and electronic equipment

By using bitmaps in electronic devices to record the access status of each file in a sub-time period and counting the number of visits in a specified time period, the problem of low recognition accuracy of hotspot files in the prior art is solved, and a higher recognition accuracy is achieved.

CN119537570APending Publication Date: 2025-02-28HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311101237.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-08-29
Publication Date
2025-02-28

AI Technical Summary

Technical Problem

The prior art has low accuracy in identifying hotspot files and cannot effectively overwrite the real usage of files, resulting in low accuracy in identifying hotspot files.

Method used

By obtaining the bitmap of each sub-time period in the specified time period, it records whether each file has been accessed in the sub-time period, and counts the number of times the target file has been accessed in the specified time period to identify whether the target file is a hotspot file.

Benefits of technology

The recognition accuracy of hotspot files is improved, and the access status of files is recorded through bitmaps, achieving more accurate identification of whether the file is a hotspot file.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119537570A_ABST
    Figure CN119537570A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a hotspot file identification method and electronic equipment, and the method comprises the steps: obtaining a bitmap of each sub-time period in a specified time period, the bitmap of each sub-time period being used for recording whether each file is accessed in the sub-time period; the sub-time periods form a specified time period; determining whether the target file is accessed in each sub-time period or not according to the bitmap of each sub-time period; according to whether the target file is accessed in each sub-time period, counting the accessed times of the target file in a specified time period; and identifying whether the target file is a hotspot file or not according to the accessed times of the target file in the specified time period. According to the embodiment of the invention, the recognition accuracy of the hotspot file can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a hotspot file identification method and an electronic device. Background Art

[0002] The purpose of hot file identification is to identify frequently used files. Hot file identification can be used for hot file caching, accurate file pre-reading solutions, and determining the priority of file data elimination when eliminating memory. However, the current hot file identification technology has low accuracy in identifying hot files. Summary of the invention

[0003] The embodiments of the present application provide a hotspot file identification method and an electronic device, which can improve the recognition accuracy of hotspot files.

[0004] In the first aspect, the present application provides a method for identifying hot files, which is applied to electronic devices, and includes: obtaining a bitmap of each sub-time period in a specified time period, the bitmap of each sub-time period is used to record whether each file has been accessed in the sub-time period; the sub-time period constitutes a specified time period; determining whether a target file has been accessed in each sub-time period according to the bitmap of each sub-time period; counting the number of accesses of the target file in the specified time period according to whether the target file has been accessed in each sub-time period; and identifying whether the target file is a hot file according to the number of accesses of the target file in the specified time period. In the method, whether each file has been accessed in the sub-time period is recorded by the bitmap of the sub-time period, so that the number of accesses of the target file in the specified time period can be counted by the bitmap, and then whether the target file is a hot file, thereby realizing the identification of whether the file is a hot file based on the bitmap, and because the bitmap records the access situation of each file comprehensively and accurately, the result of identifying whether the file is a hot file based on the bitmap is also relatively more accurate, thereby improving the accuracy of identifying hot files.

[0005] In a possible implementation, obtaining a bitmap of each sub-time period in a specified time period includes: obtaining a bitmap of a file system at the end of each sub-time period as the bitmap of each sub-time period; the file system is located in the electronic device.

[0006] In a possible implementation, the method further includes: when the file system receives data access to the first file, recording the first file as accessed in a bitmap of the file system. In this method, the file system records whether each file has been accessed, so that the access status of the file is recorded comprehensively and accurately, thereby improving the accuracy of identifying hot files.

[0007] In a possible implementation, after obtaining the bitmap of the file system, the method further includes: the file system initializes the bitmap of the file system. The bitmap initialization enables the bitmap to record the file access situation in each sub-time period, thereby improving the accuracy of the bitmap recording the file access situation, and further improving the accuracy of hot file identification based on the bitmap.

[0008] In one possible implementation, the bitmap includes a first number of bits, where the first number is the total number of file identifiers that the file system can allocate to files; each bit corresponds to a file identifier, and each bit is used to record whether the file indicated by the corresponding file identifier has been accessed.

[0009] In a possible implementation, the electronic device includes a storage device, and the storage device stores files in units of storage units; the bitmap of each sub-time period is specifically used to record whether each storage unit has been accessed in the sub-time period. In this method, the file system records whether each storage unit in the storage device has been accessed, and the storage unit is used to store files, so that by recording whether the storage unit has been accessed, it is possible to record whether the file has been accessed, and the file system records whether each storage unit has been accessed, which can make the record of the file access situation comprehensive and accurate, thereby improving the recognition accuracy of hot files.

[0010] In one possible implementation, determining whether the target file has been accessed in each sub-time period based on the bitmap of each sub-time period includes: obtaining storage units occupied by the target file in a storage device; obtaining from the bitmap of each sub-time period whether each storage unit occupied by the target file has been accessed in each sub-time period; and determining whether the target file has been accessed in each sub-time period based on whether each storage unit occupied by the target file has been accessed in each sub-time period.

[0011] In one possible implementation, whether the target file has been accessed in each sub-time period is determined based on whether each storage unit occupied by the target file has been accessed in each sub-time period, including: for each sub-time period, when at least one storage unit occupied by the target file has been accessed in the sub-time period, determining that the target file has been accessed in the sub-time period.

[0012] In one possible implementation, a bitmap of each sub-time period in a specified time period is obtained, including: at the end of each sub-time period, a bitmap of a file system is obtained as the bitmap of each sub-time period; the file system is located in an electronic device, and the bitmap of the file system is used to record whether each storage unit has been accessed.

[0013] In a possible implementation, the method further includes: when the file system receives a data access to the first file, determining a storage unit associated with the data access, and recording the storage unit associated with the data access as having been accessed in a bitmap of the file system.

[0014] In a possible implementation manner, after obtaining the bitmap of the file system, the method further includes: the file system initializing the bitmap of the file system.

[0015] In a possible implementation, the bitmap includes a second number of bits, where the second number is the total number of storage units included in the storage device; each bit corresponds to a storage unit, and each bit is used to record whether the corresponding storage unit has been accessed.

[0016] In a possible implementation, whether the target file is a hot file is identified based on the number of times the target file is accessed within a specified time period, including: when the number of times the target file is accessed within the specified time period exceeds a preset threshold, identifying the target file as a hot file.

[0017] In a possible implementation, the method also includes: taking each file to be identified as a target file in turn, executing the steps of determining whether the target file has been accessed in each sub-time period, counting the number of times the target file has been accessed in a specified time period, and identifying whether the target file is a hot file, to obtain an identification result of whether each file to be identified is a hot file; and generating a hot file list based on the identification result of whether each file to be identified is a hot file.

[0018] In the second aspect, the embodiment of the present application provides a method for identifying hot files, which is applied to electronic devices, and includes: obtaining an access frequency table for a specified time period, the access frequency table for a specified time period is used to record the number of times each file in the electronic device is accessed within the specified time period; obtaining the number of times a target file is accessed within the specified time period from the access frequency table; and identifying whether the target file is a hot file according to the number of times the target file is accessed within the specified time period. In this method, the number of times each file is accessed within the specified time period is recorded through the access frequency table, so that the number of times the target file is accessed within the specified time period can be obtained from the access frequency table, and then whether the target file is a hot file is identified, thereby realizing the identification of whether the file is a hot file based on the access frequency table. Since the access frequency table can comprehensively and accurately record the number of times each file is accessed within the specified time period, the result of identifying whether the target file is a hot file based on the access frequency table is also relatively more accurate, thereby improving the accuracy of identifying hot files.

[0019] In a possible implementation, obtaining the access frequency table for the specified time period includes: at the end of the specified time period, obtaining the access frequency table of the file system from the file system as the access frequency table for the specified time period. In this implementation, the file system maintains the access frequency table, so that the access frequency table can record the file access situation more comprehensively and accurately, so the result of identifying whether the target file is a hot file based on the access frequency table is relatively more accurate, thereby improving the accuracy of identifying hot files.

[0020] In a possible implementation, the method further includes: when the file system receives data access to the first file within a specified time period, adding 1 to the number of times the first file is accessed in the access frequency table of the file system.

[0021] In a possible implementation, the method further includes: at an initial moment of a specified time period, the file system initializes an access frequency table of the file system.

[0022] In a possible implementation, the access frequency table includes: a file identifier and the number of accesses corresponding to the file identifier. The file identifier is used to identify a file, and the file identifier is allocated to each file by the file system.

[0023] In a possible implementation, the method also includes: taking each file to be identified as a target file in turn, executing the steps of obtaining the number of times the target file is accessed within a specified time period, and identifying whether the target file is a hot file, to obtain an identification result of whether each file to be identified is a hot file; and generating a hot file list based on the identification result of whether each file to be identified is a hot file.

[0024] In a third aspect, an embodiment of the present application provides an electronic device, comprising: one or more processors; a memory; wherein one or more computer programs are stored in the memory, and the one or more computer programs include instructions, which, when executed by the processor, enable the electronic device to execute any one of the methods of the first aspect or the second aspect.

[0025] In a fourth aspect, the present application provides a computer-readable storage medium, in which a computer program is stored. When the computer-readable storage medium is run on a computer, the computer executes any one of the methods of the first aspect or the second aspect.

[0026] In a fifth aspect, the present application provides a computer program, which, when executed by a computer, is used to execute the method of the first aspect.

[0027] In one possible design, the program in the fifth aspect may be stored in whole or in part on a storage medium packaged together with the processor, or may be stored in whole or in part on a memory not packaged together with the processor. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] Figure 1 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0029] Figure 2 A schematic diagram of a software structure of an electronic device provided in an embodiment of the present application;

[0030] Figure 3 Another structural schematic diagram of an electronic device provided in an embodiment of the present application;

[0031] Figure 4A A schematic diagram of the structure of a storage unit bitmap provided in an embodiment of the present application;

[0032] Figure 4B A schematic flow chart of a method for updating a storage unit bitmap provided in an embodiment of the present application;

[0033] Figure 5A A schematic diagram of another structure of an electronic device provided in an embodiment of the present application;

[0034] Figure 5B A schematic diagram of a method flow of a file-based read operation provided in an embodiment of the present application;

[0035] Figure 5C A schematic diagram of a method flow based on file write operation provided in an embodiment of the present application;

[0036] Figure 6 A schematic diagram of the file access status query principle based on the storage unit bitmap provided in an embodiment of the present application;

[0037] Figure 7 A flowchart of a hotspot file identification method provided in an embodiment of the present application;

[0038] Fig. 8A A fourth structural schematic diagram of an electronic device provided in an embodiment of the present application;

[0039] Figure 8B Another flowchart of the hot file identification method provided in the embodiment of the present application;

[0040] Fig.9A A fifth structural schematic diagram of an electronic device provided in an embodiment of the present application;

[0041] Fig. 9B Based on the embodiments of the present application Fig.9A Another flow chart of the hotspot file identification method of the structure shown;

[0042] Fig.10A schematic diagram of the structure of a file bitmap provided in an embodiment of the present application;

[0043] Fig.11 A fourth flow chart of the hot file identification method provided in the embodiment of the present application;

[0044] Fig.12 A fifth flow chart of the hotspot file identification method provided in the embodiment of the present application;

[0045] Fig.13 Based on the embodiments of the present application Fig.9A Another flow chart of the hotspot file identification method of the structure shown;

[0046] Fig.14 A schematic diagram of the structure of a file bitmap provided in an embodiment of the present application;

[0047] Fig.15 A fourth flow chart of the hot file identification method provided in the embodiment of the present application;

[0048] Fig.16 A fifth flow chart of the hotspot file identification method provided in the embodiment of the present application;

[0049] Fig.17 Based on the embodiments of the present application Fig.9A Another flowchart of the hot file identification method of the structure shown. DETAILED DESCRIPTION

[0050] The terms used in the implementation section of this application are only used to explain the specific embodiments of this application and are not intended to limit this application.

[0051] Hot file identification refers to identifying frequently used files. At present, the identification method and process of hot file are concentrated on the application layer. First, the applications with high frequency of use (hereinafter referred to as high-frequency applications) are identified, and then the hot files under the application are identified according to the usage time of the high-frequency application for a certain period of time.

[0052] However, this solution counts the usage time of files associated with high-frequency applications within a certain period of time, which can be, for example, the period of screen on and off, or the period of switching between the foreground and background. However, since the application switches to the background or the phone turns off the screen, the application or the system itself will also access the file to perform background tasks, etc., and only counting the usage time of a file within the above period of time cannot fully cover the actual usage of a file, and the recognition accuracy of hot files is low.

[0053] Moreover, this technical solution only identifies hotspot files from files associated with high-frequency applications, which will result in the inability to identify hotspot files associated with non-high-frequency applications, resulting in the problem of missing hotspot files and reducing the accuracy of hotspot file identification.

[0054] To this end, an embodiment of the present application provides a hot file identification method and an electronic device, which can improve the recognition accuracy of hot file.

[0055] The hot file identification method provided in the embodiment of the present application can be applied to scenarios such as hot file identification, hot file caching, accurate pre-reading of hot files, determining the priority of file data elimination when eliminating memory, and migrating hot files to fast devices, to realize hot file identification in the above scenarios.

[0056] Figure 1 1 shows a schematic diagram of the structure of the electronic device 100. The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, 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 sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195. 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, etc.

[0057] 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. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or separate some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0058] 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. Different processing units may be independent devices or integrated into one or more processors.

[0059] The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.

[0060] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0061] In some embodiments, the processor 110 may include one or more interfaces. The interface may include 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.

[0062] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple groups of I2C buses. The processor 110 may be coupled to the touch sensor 180K, the charger, the flash, the camera 193, etc. through different I2C bus interfaces. For example: the processor 110 may be coupled to the touch sensor 180K through the I2C interface, so that the processor 110 communicates with the touch sensor 180K through the I2C bus interface, thereby realizing the touch function of the electronic device 100.

[0063] The I2S interface can be used for audio communication. In some embodiments, the processor 110 can include multiple I2S buses. The processor 110 can be coupled to the audio module 170 via the I2S bus to achieve communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 can transmit an audio signal to the wireless communication module 160 via the I2S interface to achieve the function of answering a call through a Bluetooth headset.

[0064] The PCM interface can also be used for audio communication, sampling, quantizing and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 can be coupled via a PCM bus interface. In some embodiments, the audio module 170 can also transmit audio signals to the wireless communication module 160 via the PCM interface to realize the function of answering calls via a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.

[0065] The UART interface is a universal serial data bus for asynchronous communication. The bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, the UART interface is generally used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface to implement the Bluetooth function. In some embodiments, the audio module 170 can transmit an audio signal to the wireless communication module 160 through the UART interface to implement the function of playing music through a Bluetooth headset.

[0066] The MIPI interface can be used to connect the processor 110 with peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), etc. In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to implement the shooting function of the electronic device 100. The processor 110 and the display screen 194 communicate via the DSI interface to implement the display function of the electronic device 100.

[0067] The GPIO interface can be configured by software. The GPIO interface can be configured as a control signal or as a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 with the camera 193, the display 194, the wireless communication module 160, the audio module 170, the sensor module 180, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.

[0068] The USB interface 130 is an interface that complies with the USB standard specification, and specifically can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used to transfer data between the electronic device 100 and a peripheral device. It can also be used to connect headphones to play audio through the headphones. The interface can also be used to connect other electronic devices, such as AR devices, etc.

[0069] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present invention is only a schematic illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.

[0070] The charging management module 140 is used to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from a wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 may receive wireless charging input through a wireless charging coil of the electronic device 100. While the charging management module 140 is charging the battery 142, it may also power the electronic device through the power management module 141.

[0071] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the display screen 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc. In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.

[0072] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.

[0073] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.

[0074] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.

[0075] The modem processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 170A, a receiver 170B, etc.), or displays an image or video through a display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.

[0076] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0077] In some embodiments, the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS).

[0078] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.

[0079] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), 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. In some embodiments, the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.

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

[0081] ISP is used to process the data fed back by camera 193. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to ISP for processing and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on the noise, brightness, and skin color of the image. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, ISP can be set in camera 193.

[0082] The camera 193 is used to capture still images or videos. 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. The photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP to be converted 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. In some embodiments, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.

[0083] The digital signal processor is used to process digital signals, and can process not only digital image signals but also other digital signals. For example, when the electronic device 100 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.

[0084] Video codecs are used to compress or decompress digital videos. The electronic device 100 may support one or more video codecs. Thus, the electronic device 100 may play or record videos in a variety of coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.

[0085] NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can also continuously self-learn. Through NPU, applications such as intelligent cognition of electronic device 100 can be realized, such as image recognition, face recognition, voice recognition, text understanding, etc.

[0086] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function, such as storing music, video and other files in the external memory card.

[0087] The internal memory 121 can be used to store computer executable program codes, which include instructions. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. The processor 110 executes various functional applications and data processing of the electronic device 100 by running instructions stored in the internal memory 121, and / or instructions stored in a memory provided in the processor.

[0088] The electronic device 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.

[0089] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be arranged in the processor 110, or some functional modules of the audio module 170 can be arranged in the processor 110.

[0090] The speaker 170A, also called a "speaker", is used to convert an audio electrical signal into a sound signal. The electronic device 100 can listen to music or listen to a hands-free call through the speaker 170A.

[0091] The receiver 170B, also called a "earpiece", is used to convert audio electrical signals into sound signals. When the electronic device 100 receives a call or voice message, the voice can be received by placing the receiver 170B close to the human ear.

[0092] Microphone 170C, also called "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak by putting their mouth close to microphone 170C to input the sound signal into microphone 170C. The electronic device 100 can be provided with at least one microphone 170C. In other embodiments, the electronic device 100 can be provided with two microphones 170C, which can not only collect sound signals but also realize noise reduction function. In other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify the sound source, realize directional recording function, etc.

[0093] The earphone interface 170D is used to connect a wired earphone and can be a USB interface 130 or a 3.5 mm open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.

[0094] The pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A can be set on the display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc. The capacitive pressure sensor can be a parallel plate including at least two conductive materials. When a force acts on the pressure sensor 180A, the capacitance between the electrodes changes. The electronic device 100 determines the intensity of the pressure according to the change in capacitance. When a touch operation acts on the display screen 194, the electronic device 100 detects the touch operation intensity according to the pressure sensor 180A. The electronic device 100 can also calculate the touch position according to the detection signal of the pressure sensor 180A. In some embodiments, touch operations acting on the same touch position but with different touch operation intensities can correspond to different operation instructions. For example: when a touch operation with a touch operation intensity less than the first pressure threshold acts on the short message application icon, an instruction to view the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, an instruction to create a new short message is executed.

[0095] The gyro sensor 180B can be used to determine the motion posture of the electronic device 100. In some embodiments, the angular velocity of the electronic device 100 around three axes (i.e., x, y, and z axes) can be determined by the gyro sensor 180B. The gyro sensor 180B can be used for anti-shake shooting. For example, when the shutter is pressed, the gyro sensor 180B detects the angle of the electronic device 100 shaking, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to offset the shaking of the electronic device 100 through reverse movement to achieve anti-shake. The gyro sensor 180B can also be used for navigation and somatosensory game scenes.

[0096] The air pressure sensor 180C is used to measure air pressure. In some embodiments, the electronic device 100 calculates the altitude through the air pressure value measured by the air pressure sensor 180C to assist positioning and navigation.

[0097] The magnetic sensor 180D includes a Hall sensor. The electronic device 100 can use the magnetic sensor 180D to detect the opening and closing of the flip leather case. In some embodiments, when the electronic device 100 is a flip phone, the electronic device 100 can detect the opening and closing of the flip cover according to the magnetic sensor 180D. Then, according to the detected opening and closing state of the leather case or the opening and closing state of the flip cover, the flip cover can be automatically unlocked.

[0098] The acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device 100 in all directions (generally three axes). When the electronic device 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of the electronic device and is applied to applications such as horizontal and vertical screen switching and pedometers.

[0099] The distance sensor 180F is used to measure the distance. The electronic device 100 can measure the distance by infrared or laser. In some embodiments, when shooting a scene, the electronic device 100 can use the distance sensor 180F to measure the distance to achieve fast focusing.

[0100] The proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector, such as a photodiode. The light emitting diode may be an infrared light emitting diode. The electronic device 100 emits infrared light outward through the light emitting diode. The electronic device 100 uses a photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100. When insufficient reflected light is detected, the electronic device 100 can determine that there is no object near the electronic device 100. The electronic device 100 can use the proximity light sensor 180G to detect that the user holds the electronic device 100 close to the ear to talk, so as to automatically turn off the screen to save power. The proximity light sensor 180G can also be used in leather case mode and pocket mode to automatically unlock and lock the screen.

[0101] 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 ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures. The ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the electronic device 100 is in a pocket to prevent accidental touches.

[0102] The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can use the collected fingerprint characteristics to implement fingerprint unlocking, access application locks, fingerprint photography, fingerprint call answering, etc.

[0103] The temperature sensor 180J is used to detect temperature. In some embodiments, the electronic device 100 uses the temperature detected by the temperature sensor 180J to execute a temperature processing strategy. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold, the electronic device 100 reduces the performance of a processor located near the temperature sensor 180J to reduce power consumption and implement thermal protection. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 heats the battery 142 to avoid abnormal shutdown of the electronic device 100 due to low temperature. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 performs a boost on the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperature.

[0104] The touch sensor 180K is also called a "touch control device". The touch sensor 180K can be set on the display screen 194. The touch sensor 180K and the display screen 194 form a touch screen, also called a "touch control screen". The touch sensor 180K is used to detect touch operations acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor 180K can also be set on the surface of the electronic device 100, which is different from the position of the display screen 194.

[0105] The bone conduction sensor 180M can obtain a vibration signal. In some embodiments, the bone conduction sensor 180M can obtain a vibration signal of a vibrating bone block of the vocal part of the human body. The bone conduction sensor 180M can also contact the human pulse to receive a blood pressure beat signal. In some embodiments, the bone conduction sensor 180M can also be set in an earphone and combined into a bone conduction earphone. The audio module 170 can parse out a voice signal based on the vibration signal of the vibrating bone block of the vocal part obtained by the bone conduction sensor 180M to realize a voice function. The application processor can parse the heart rate information based on the blood pressure beat signal obtained by the bone conduction sensor 180M to realize a heart rate detection function.

[0106] 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.

[0107] Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects. For touch operations acting on different areas of the display screen 194, motor 191 can also correspond to different vibration feedback effects. Different application scenarios (for example: time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.

[0108] Indicator 192 may be an indicator light, which may be used to indicate charging status, power changes, messages, missed calls, notifications, etc.

[0109] The SIM card interface 195 is used to connect a SIM card. The SIM card can be connected to and separated from the electronic device 100 by inserting it into the SIM card interface 195 or pulling it out from the SIM card interface 195. The electronic device 100 can support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, and the like. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of the multiple cards can be the same or different. The SIM card interface 195 can also be compatible with different types of SIM cards. The SIM card interface 195 can also be compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to implement functions such as calls and data communications. In some embodiments, the electronic device 100 uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.

[0110] The software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. In the embodiment of the present invention, the Android system of the layered architecture is taken as an example to exemplify the software structure of the electronic device 100.

[0111] Figure 2 1 is a software structure block diagram of the electronic device 100 according to an embodiment of the present invention.

[0112] The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. The embodiment of the present application takes the Android system as an example to illustrate the software structure of the first electronic device of the Android system. In some embodiments, the Android system is divided into five layers, from top to bottom, namely, the application layer, the application framework layer (also called: system framework layer), the system library and Android runtime layer, the hardware abstraction layer (HAL) and the kernel layer.

[0113] The application layer may include several applications (hereinafter referred to as applications), such as camera, gallery, calendar, WLAN, etc.

[0114] The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer, including various components and services to support developers' Android development. The application framework layer also includes some predefined functions. For example, the application framework layer may include a window manager, a content provider, a resource manager, a camera service, etc.

[0115] The system library and Android runtime layer include the system library and Android runtime. The system library can include multiple functional modules. For example: surface manager, two-dimensional graphics engine, three-dimensional graphics processing library (for example: OpenGLES), media library, font library, etc. Among them, the browser kernel is responsible for interpreting the syntax of the web page (such as an application HTML, JavaScript under the standard universal markup language) and rendering (displaying) the web page; the two-dimensional graphics engine is used to implement two-dimensional graphics drawing, image rendering, synthesis and layer processing, etc.; the three-dimensional graphics processing library is used to implement three-dimensional graphics drawing, image rendering, synthesis and layer processing, etc.; the media library is used to implement the input of different streaming media; the font library is used to implement the input of different fonts. The Android runtime is responsible for the scheduling and management of the Android system, specifically including the core library and the virtual machine. Among them, the core library contains two parts: one part is the function function that needs to be called by the Java language, and the other part is the core library of Android; the virtual machine is used to run Android applications developed using the Java language.

[0116] The HAL layer is an interface layer between the operating system kernel and the hardware circuit. The HAL layer includes but is not limited to: the audio hardware abstraction layer (Audio HAL) and the camera hardware abstraction layer (Camera HAL). Among them, the Audio HAL is used to process the audio stream, for example, to perform noise reduction, directional enhancement, etc. on the audio stream, and the Camera HAL is used to process the image stream.

[0117] The kernel layer is the layer between hardware and software. The kernel layer may include: display driver, audio driver, camera driver, storage device driver, file system, etc.

[0118] The file system in the Android system uses a virtual file system (VFS) mechanism based on Linux. VFS is a file operation interface that supports various file systems. Therefore, it can manage different file systems in a unified manner, allowing applications to read and write VFS files just like reading and writing disk files, without having to consider different physical devices and different file systems. When the Android system uses the file operation API, it is actually accessing files on the storage device through VFS.

[0119] For ease of understanding, the following embodiments of the present application will be described in detail with Figure 1 and Figure 2 Taking the electronic device with the structure shown as an example, the method provided in the embodiment of the present application is specifically described in combination with the accompanying drawings and application scenarios.

[0120] In electronic devices, files are persistently recorded through storage devices. Storage devices are composed of several storage units, for example, storage units may include sectors, blocks, etc. Files are stored in these storage units in units of storage units. Therefore, access to files (such as read, write and other operations) is actually access to data in the storage unit of the storage device. In addition, the data cached in the memory also has corresponding data records on the external storage device, so it can also be considered as access to data in the storage unit of the storage device. In other words, the storage device in the embodiment of the present application can be an internal storage device or an external storage device.

[0121] Based on the above principle, the embodiment of the present application provides a bitmap, which is used to record whether each storage unit of the storage device has been accessed. In order to distinguish it from the file bitmap in the subsequent embodiments, the bitmap used to record whether the storage unit has been accessed in the embodiment of the present application is called a storage unit bitmap.

[0122] In order to reduce the amount of data in the storage cell bitmap, the storage cell bitmap may include n bits, where n is the total number of storage cells included in the storage device. Each bit in the storage cell bitmap corresponds to a storage cell in the storage device and is used to record whether the storage cell has been accessed. Different bits in the storage cell bitmap correspond to different storage cells, so that the storage cell bitmap can record whether each storage cell in the storage device has been accessed through the above n bits.

[0123] In the storage unit bitmap, each bit can take a value of 0 or 1, which can be used to record whether the corresponding storage unit has been accessed. In the embodiment of the present application, it is assumed that 0 represents that the corresponding storage unit has not been accessed, and 1 represents that the corresponding storage unit has been accessed. It is understandable that in other embodiments, 0 may represent that the storage unit has been accessed, and 1 may represent that the corresponding storage unit has not been accessed.

[0124] The storage unit bitmap of the embodiment of the present application can record the access status of all storage units of the storage device, and the data in a single file must correspond to several storage units on the storage device. Access to part or all of the data in the file will inevitably bring about access to the storage unit corresponding to the file. Therefore, by recording the access status of the storage unit through the storage unit bitmap, the usage status of all files in the electronic device can be recorded.

[0125] In some scenarios, the smallest storage unit for reading files on a storage device is a block. In the following embodiments of the present application, the storage unit is a block as an example to exemplify the storage unit bitmap and hot file identification method provided in the embodiments of the present application. At this time, the above storage unit bitmap can also be called a block bitmap. Each bit in the block bitmap provided in the embodiment of the present application corresponds to a block in the storage device to record whether the block has been accessed. It is understandable that different bits may correspond to different blocks to reduce the amount of data in the block bitmap.

[0126] The storage unit bitmap provided in the embodiment of the present application is set in the file system of the electronic device, and the file system updates the storage unit bitmap based on the data access of the application to the file. Since the application's access to the file must be completed through the file system, the above-mentioned storage unit bitmap can accurately record the application's access to the file.

[0127] Optionally, the storage unit on the storage device can be identified by a physical address, so each bit in the above storage unit bitmap (block bitmap) can specifically correspond to a physical address, so that each bit corresponds to a storage unit.

[0128] Combination Figure 3 As shown, an application in an electronic device can implement data access to a file stored in a storage device through a file system. Specifically, when an application in an electronic device performs data access to a file, it generally uses the logical address of the file and the target data in the file, and the storage unit on the storage device is identified by a physical address. Therefore, when an application needs to perform data access to a file, the file system can map the logical address of the file and the target data in the file to a physical address, and access the data in the storage unit indicated by the physical address, thereby implementing data access to the file by the application.

[0129] The following Figure 4A Taking the block bitmap shown as an example, the principle of the storage unit bitmap recording the access status of the file in the electronic device is exemplarily explained.

[0130] like Figure 4AAs shown, assuming that file file_A contains a total of 5 physical pages of data, in a certain data access to file file_A, the data of the first 4 physical pages of file file_A are accessed. By mapping the logical address of file file_A to the physical address, it is obtained that the corresponding block numbers of the first 4 physical pages of file file_A on the storage device are 1, 3, 6, and 10 respectively. When accessing data to these blocks, the corresponding bits on the block bitmap are synchronously updated, and 0 is changed to 1. Therefore, by recording the bits corresponding to the blocks numbered 1, 3, 6, and 10 on the block bitmap as 1, the access to file file_A is recorded.

[0131] Through the above storage unit bitmap, the usage of all files in the electronic device within a certain period of time (time period) can be recorded, with comprehensive coverage and accurate recording.

[0132] Moreover, in the above storage unit bitmap, one binary bit corresponds to one storage unit of the storage device, and the total number of storage units in a storage device is fixed, so the storage space occupied by the storage unit bitmap is fixed. Assuming that a block is 4k, for a 256G storage device, its corresponding block bitmap only needs to occupy 8MB of storage space, which takes up very little storage space; in addition, when updating the storage unit bitmap, it only needs to change the bit corresponding to the storage unit from 0 to 1 or from 1 to 0, and the additional overhead brought to the electronic device is almost negligible.

[0133] In the embodiment of the present application, the file system in the electronic device can maintain and update the storage unit bitmap according to the storage unit where the data accessed by the application is located when the application accesses the file. Figure 4B , taking the application program accessing the data of the file M as an example, the updating process of the storage unit bitmap by the file system is explained.

[0134] Step 401: The application sends a data access request for file M to the file system.

[0135] In some embodiments, the data access request may include: a read request or a write request, etc.

[0136] The data access request for file M may include: access type (read operation, write operation, etc.), logical address of file M, and logical address of target data in file M.

[0137] In some embodiments, the read request may include: a read indication, a logical address of file M, one or more of the starting position or data length of the target data to be read in file M, wherein the starting position and data length of the target data to be read in file M may also be referred to as the logical address of the target data to be read in file M.

[0138] In some embodiments, the write request may include: a write indication, a logical address of file M, one or more of the starting position and data length of the target data to be written in file M, wherein the starting position and data length of the target data to be written in file M may also be referred to as the logical address of the target data to be written in file M.

[0139] In some embodiments, the logical address of file M may be the storage path of file M.

[0140] Step 402: The file system receives a data access request and performs address mapping from a logical address to a physical address.

[0141] In some embodiments, the address mapping from the logical address to the physical address may specifically be: determining the physical address of the target data according to the logical address of the file M and the logical address of the target data in the file M.

[0142] In some embodiments, the physical address of the target data may indicate the storage unit occupied by the target data. In other words, the storage unit occupied by the target data may be determined through address mapping.

[0143] Optionally, determining the physical address of the target data according to the logical address of the file M and the logical address of the target data in the file M may be implemented in the following manner:

[0144] The file system maps the logical address of file M to the physical address of file M, and the physical address of file M indicates a number of storage units occupied by file M;

[0145] The file system determines the physical address of the target data from the physical address corresponding to the file M according to the logical address of the target data in the file M, and the physical address of the target data indicates the storage unit occupied by the target data.

[0146] Still with the above Figure 4AFor example, assuming that the data of the first four physical pages of file file_A are accessed during data access to file file_A, the logical address of file file_A can be first mapped to the block number of file file_A. Assuming that the block numbers are 1, 3, 6, 10, and 13, the block numbers corresponding to the first four physical pages can be determined from block numbers 1, 3, 6, 10, and 13 to be 1, 3, 6, and 10, respectively. The physical addresses of the first four physical pages are obtained as follows: block numbers 1, 3, 6, and 10.

[0147] Step 403: The file system requests the storage device to access the target data in the storage unit indicated by the physical address according to the physical address of the target data.

[0148] In some embodiments, accessing the target data in the storage unit indicated by the physical address may include: reading the target data from the storage unit, writing the target data to the storage unit, etc.

[0149] Step 404: After completing data access to the data in the storage unit indicated by the physical address based on the request, the storage device returns the data access result to the file system.

[0150] Step 405: The file system returns the data access result to the application.

[0151] Step 406: The file system updates the storage unit bitmap according to the physical address of the target data.

[0152] In some embodiments, if the data access result, i.e., updating the storage unit bitmap, is not considered, step 406 can be executed after step 402, and there is no restriction on the execution order between steps 403 to 405; if the storage unit bitmap only records the storage units to which data access has been successfully performed as accessed, then step 406 can be executed after step 404, and there is no restriction on the execution order between step 405. In this case, it can be ensured that the storage units recorded as 1 in the storage unit bitmap are the storage units to which the application has successfully completed data access, thereby improving the accuracy of the storage unit bitmap in recording the storage unit access status.

[0153] In some embodiments, if the storage unit bitmap only records the storage units to which data access is successful as having been accessed, the step between step 404 and step 406 may further include: the file system determines that the data access result is a successful data access. Thus, the file system updates the storage unit bitmap only when the application successfully accesses the target data.

[0154] In this step, when the file system updates the storage unit bitmap, it can obtain the bit corresponding to the physical address of the target data from the storage unit bitmap and update the bit to 1.

[0155] It should be noted that the same storage unit may be accessed twice or more times, and the bit of the storage unit in the storage unit bitmap has been updated to 1 during the first access. When the storage unit is accessed for the second or more times, the bit can be updated to 1 again or no operation will be performed when it is determined that the bit is already 1.

[0156] The following Figure 5A to Figure 5C Embodiments of this application Figure 4B The specific implementation of updating the above storage unit bitmap by the electronic device is exemplified.

[0157] Figure 5A It is a structural diagram of an electronic device provided in an embodiment of the present application, including: an application program, a system service, a file system, and a storage device.

[0158] System services can be located at Figure 2 The application framework layer of the Android system shown, the system services may include: a read-write interface for accessing the file system, the read-write interface can be called by the application to enable the application to access the file system and complete file read and write operations.

[0159] The file system can be located, for example, at Figure 2 In the kernel layer of the Android system shown, the file system may include: a file data reading and writing module, an address mapping module, and a file access status recording module.

[0160] The file data read and write module is used to read and write data in the storage device.

[0161] The address mapping module is used to map the logical address of the target data into a physical address.

[0162] The file access status recording module is used to manage the storage unit bitmap and update the storage unit bitmap.

[0163] The storage device may be located at the hardware layer of the electronic device and is used to store data. The data may include various files in the electronic device, databases of applications, etc.

[0164] The file data read and write module reads and writes data in the storage device. Specifically, the data read and write instructions can be sent to the storage device driver located in the kernel layer, and the storage device driver drives the storage device to read and write data to the storage unit based on the data read and write instructions.

[0165] Figure 5B is based on Figure 5A The structure shown in the figure provides a flow chart of a method for updating a storage unit bitmap in an embodiment of the present application, taking a data access request as an example, that is, a read request. Figure 5B As shown, the method may include:

[0166] Step 501: When the application determines to read target data in the file M, it sends a read request to the read-write interface.

[0167] Step 502: The read / write interface sends a read request to the file data read / write module of the file system.

[0168] Steps 501 to 502 may be used to implement the above step 401 .

[0169] Step 503: The file data reading and writing module sends an address mapping request to the address mapping module of the file system.

[0170] The address mapping request may carry the logical address of the file M and the logical address of the target data.

[0171] Step 504: the address mapping module receives the address mapping request, maps the logical address of the file M and the logical address of the target data into the physical address of the target data, and sends the physical address of the target data to the file data reading and writing module.

[0172] Steps 503 to 504 may be used to implement the above step 402 .

[0173] Step 505: The file data reading and writing module requests the storage device driver to read the target data according to the physical address of the target data and the received read request.

[0174] Step 505 can be used to implement the above step 403.

[0175] Step 506: The storage device driver reads the target data from the storage unit indicated by the physical address of the target data, and returns the target data to the file data reading and writing module of the file system.

[0176] Step 506 may be used to implement the above step 404 .

[0177] Step 507: The file data reading and writing module returns the target data to the reading and writing interface.

[0178] Step 508: The read / write interface returns the target data to the application.

[0179] Steps 507 to 508 may be used to implement the above step 405 .

[0180] Step 509: the file data reading and writing module sends a bitmap update request to the file access status recording module of the file system, and the bitmap update request includes the physical address of the target data.

[0181] Step 510: The file access status recording module updates the bit corresponding to the physical address of the target data in the storage unit bitmap to 1.

[0182] Steps 509 to 510 may be used to implement the above step 406 .

[0183] Optionally, if the data access result, i.e., updating the storage unit bitmap, is not considered, the above steps 509 to 510 may be executed after step 504, and there is no restriction on the execution order between steps 505 to 508; if the storage unit bitmap only records the storage units to which data has been successfully accessed as having been accessed, then steps 509 to 510 may be executed after step 506, and there is no restriction on the execution order between steps 507 to 508, so as to ensure that the storage unit recorded as 1 in the storage unit bitmap is the storage unit accessed when the application successfully completes reading data, thereby improving the accuracy of the storage unit bitmap in recording the storage unit access status.

[0184] like Figure 5C As shown, if the application writes to file M, that is, writes the target data to file M, the step flow can refer to Figure 5B , the main difference is:

[0185] In step 601 to step 602, the data access request sent by the application to the read-write interface and the read-write interface to the file data read-write module is replaced from a read request to a write request;

[0186] In steps 603 to 605, the address mapping module maps the logical address of file M and the logical address of the target data to be written into the physical address of the target data, and the file data read and write module requests the storage device driver to write the target data into the storage unit indicated by the physical address of the target data.

[0187] In steps 606 to 608, the data returned by the storage device driver to the file system's file data read and write module, the file data read and write module to the read and write interface, and the read and write interface to the application is replaced with the data write result, and the data write result is used to indicate whether the target data is written successfully.

[0188] The implementation of steps 609 to 610 may refer to steps 509 to 510 and will not be described in detail here.

[0189] Through the above embodiments, the file system can complete the update of the storage unit bitmap based on the data access of the application program to the file such as reading and writing. Since the file access in the electronic device needs to be implemented through the file system, the storage unit bitmap maintained by the file system can record the usage of all files in the electronic device within a certain period of time (also called a time period or time interval), with comprehensive coverage and accurate records.

[0190] Based on the above storage unit bitmap provided in the embodiment of the present application, for a file, the electronic device can query the physical address distribution of the file on the storage device from the file system, that is, query the physical address set of all storage units storing the file, and then query the value of the bit corresponding to the physical address of each storage unit in the storage unit bitmap to be 0 or 1, so as to obtain whether each storage unit of the file has been accessed, and determine whether the file has been accessed based on the access status of each storage unit of the file. For example, it can be pre-set that at least one storage unit of the file has been accessed, and then determine that the file has been accessed.

[0191] Taking the storage unit bitmap as an example, the file system can query the block number set of a file, and then query the bit value corresponding to each block number in the block bitmap to find out whether it is 0 or 1, so as to obtain whether each block of the file has been accessed, and determine whether the file has been accessed based on the access status of each block of the file.

[0192] like Figure 6 As shown in the figure, for file_A, it can be found that the block numbers of file_A are 1, 3, 5, 6, and 10. In the block bitmap, the bit values ​​corresponding to the blocks numbered 1, 3, 5, 6, and 10 can be found. Figure 6 The bit values ​​corresponding to blocks numbered 1, 3, 6, and 10 are 1, indicating that these four blocks have been accessed, and file file_A has been accessed.

[0193] For file_B, you can find out that the block numbers of file_B are 7, 11, 13, and 15. In the storage unit bitmap, you can find out the bit values ​​corresponding to the blocks numbered 7, 11, 13, and 15. Figure 6 The bit values ​​corresponding to blocks numbered 7, 11, 13, and 15 are all 0, indicating that the above four blocks have not been accessed, and file file_B has not been accessed.

[0194] Since the file system can record whether each storage unit has been accessed within a time period according to the storage unit bitmap, accordingly, based on the above method, it can be determined whether a file has been accessed within the time period. On this basis, if the electronic device wishes to identify whether a certain file, such as the aforementioned file M, is a hot file within a certain time period T, the time period T can be divided into multiple sub-time periods, and the above storage unit bitmap is used to record whether each storage unit has been accessed within each sub-time period, and then determine whether the file M has been accessed within each sub-time period according to the storage unit bitmap of each sub-time period, thereby obtaining the number of times the file M has been accessed within the above time period T, and identifying whether the file M is a hot file based on the number of times it has been accessed. The following is a detailed description.

[0195] Figure 7 is a flow chart of a hotspot file identification method provided in an embodiment of the present application, such as Figure 7 As shown, the method may include:

[0196] Step 701: Obtain a storage unit bitmap of each sub-time period in a specified time period, where the storage unit bitmap of the sub-time period is used to record whether each storage unit in the storage device has been accessed in the sub-time period;

[0197] In some embodiments, the above-mentioned specified time period can be specified by the electronic device or by the user, which is not limited in the embodiments of the present application. For example, the time period for hot file identification can be preset in the electronic device, and the time period for hot file identification can be preset in the above-mentioned electronic device as the above-mentioned specified time period, or the electronic device can provide the user with a setting interface for the specified time period, and the user sets the start time, duration, and / or end time of the specified time period on the setting interface.

[0198] It is understandable that the durations of the above different sub-time periods may be the same or different, and the present application embodiment does not limit this. In order to reduce the data processing volume and data processing difficulty of the electronic device, the durations of the sub-time periods may be set to be the same.

[0199] Step 702: Obtain the storage unit occupied by the file M in the storage device;

[0200] Step 703: For the file M, determine whether the file M has been accessed in each sub-time period according to the storage unit bitmap of each sub-time period.

[0201] In one instance, for the storage unit bitmap of each sub-time period, it is queried from the storage unit bitmap of the sub-time period whether each storage unit occupied by file M has been accessed. When it is queried from the storage unit bitmap of the sub-time period that at least one storage unit of file M has been accessed, it is determined that file M has been accessed in the sub-time period.

[0202] Step 704: According to whether the file M has been accessed in each sub-time period, count the number of times the file M has been accessed in the specified time period.

[0203] For example, assuming that the specified time period is divided into 20 sub-time periods, and the file M is accessed in 14 of the sub-time periods, the number of times the file M is accessed in the specified time period may be 14.

[0204] Step 705: Identify whether the file M is a hot file based on the number of times the file M is accessed within a specified time period.

[0205] Optionally, when the number of accesses to the file M in a specified time period exceeds a preset first number threshold, the file M can be determined as a hot file. The specific value of the first number threshold is not limited in the embodiment of the present application.

[0206] It can be seen that the electronic device can obtain whether the file M has been accessed in each sub-time period through the storage unit bitmap of each sub-time period, and then can determine whether the file M has been accessed in multiple sub-time periods included in the specified time period, thereby obtaining the number of times the file M has been accessed in the specified time period, and identifying whether the file is a hot file based on the number of times it has been accessed.

[0207] The electronic device can use each file among the multiple files to be identified as the above-mentioned file M, execute the above-mentioned steps 702 to 705, and obtain the identification result of whether each file is a hot file, so that hot files can be identified from the multiple files to be identified, and then a hot file list can be generated and stored.

[0208] Optionally, the above hot file list can be stored in a preset database.

[0209] In some embodiments, the above-mentioned files to be identified refer to files that need to be identified whether they are hot files. The above-mentioned files to be identified can be specified by the electronic device or by the user. For example, the electronic device can preset or determine based on a certain processing rule which files in the electronic device are files to be identified, or the electronic device can provide the user with a setting interface for files to be identified, and the user specifies which files in the electronic device are files to be identified.

[0210] Optionally, the above hot file identification can be performed by a hot file identification service provided by the electronic device, and the above storage unit bitmap can be maintained and updated by the file system. Fig. 8A As shown, the electronic device may include: a hot file identification service, a file system, and a storage device.

[0211] Figure 8B This embodiment of the application is based on Fig. 8A A flow chart of a hot file identification method provided by the structure shown. In the embodiment of the present application, it is assumed that the hot file identification service is to identify hot files in files 1 to n within a specified time period.

[0212] In some embodiments, in combination Figure 5A In the electronic device structure shown, the hot file identification service can be used as a system service to communicate with the modules in the file system respectively. In this case, the implementation structure of the electronic device is as follows: Fig.9A shown.

[0213] In some embodiments, the hot file identification service may be located at the application framework layer of the Android system.

[0214] In some embodiments, the hot file identification service may also be a service provided by an application, and the hot file identification service may be located at the application layer as a part of the application.

[0215] Fig. 9B This embodiment of the application is based on Fig.9A A flow chart of a hot file identification method provided by the structure shown.

[0216] The following will be combined Figures 8A to 9B The hot file identification method of the embodiment of the present application is described.

[0217] like Figure 8B As shown, the hotspot file identification method may include:

[0218] Step 801: The hot file identification service determines the end time of period i that reaches the specified time period.

[0219] In the embodiment of the present application, it is assumed that the specified time period is divided into m cycles, and the storage unit bitmap query of the hot file identification service is triggered at the end of each cycle, so that the hot file identification service can obtain the storage unit bitmap corresponding to each cycle, and the storage unit bitmap of each cycle records whether each storage unit of the storage device has been accessed in the cycle. The above m is a natural number greater than.

[0220] In some embodiments, the above-mentioned period i may be any period among the m periods included in the specified time period.

[0221] Step 802: The hot file identification service sends a bitmap query request to the file system.

[0222] See also Fig. 9B In step 902, the hot file identification service may specifically send a bitmap query request to the file access status recording module of the file system.

[0223] In some embodiments, the file system may provide an interface for accessing the file access status recording module, so that the hot file identification service may send a storage unit bitmap query request to the file access status recording module by calling the interface.

[0224] Step 803: The file system returns the storage unit bitmap to the hot file identification service.

[0225] In some embodiments, see Fig. 9B In step 903, the file access status recording module of the file system may specifically return a storage unit bitmap to the hot file identification service.

[0226] Step 804: The file system initializes the storage unit bitmap.

[0227] In some embodiments, the storage unit bitmap initialization may specifically include: setting each bit in the storage unit bitmap to 0, and then the file access status recording module may re-initialize the storage unit bitmap based on Figure 6 The method shown records the access status of the storage unit in the next cycle.

[0228] In some embodiments, see Fig. 9B In step 904, this step may be specifically performed by the file access status recording module of the file system.

[0229] Step 805: The hot file identification service queries the file system for the physical address distribution of file M.

[0230] In some embodiments, see Fig. 9B In step 905, the hot file identification service may query the address mapping module of the file system for the physical address distribution of the file M.

[0231] Optionally, the file system may provide an interface for accessing the address mapping module, so that the hot file identification service may query the address mapping module for the physical address distribution of the file M by calling the interface.

[0232] Step 806: The file system sends the physical address distribution of file M to the hot file identification service.

[0233] In some embodiments, the physical address distribution of file M is the set of physical addresses of storage units occupied by file M.

[0234] In some embodiments, see Fig. 9B In step 906, the address mapping module of the file system may send the physical address distribution information of the file M to the hot file identification service.

[0235] Step 807: The hot file identification service identifies the usage of file M.

[0236] In some embodiments, in this step, the hot file identification service identifies the usage of file M, that is, the hot file identification service identifies whether file M has been accessed in period i.

[0237] In some embodiments, the hot file identification service can query the bit corresponding to each physical address from the storage unit bitmap based on the physical address included in the physical address distribution of file M. Depending on whether the value of the bit is 0 or 1, it can be determined whether the storage unit indicated by each physical address of file M has been accessed, and whether file M has been accessed in cycle i can be determined based on whether the storage unit indicated by each physical address of file M has been accessed.

[0238] For example, the hot file identification service can determine that the file M has been accessed when the bit corresponding to at least one physical address in the physical address distribution is 1, that is, when the storage unit indicated by at least one physical address has been accessed.

[0239] By repeatedly executing steps 801 to 807, the hot file identification service can identify whether file M has been accessed within the m periods of the specified time period, and obtain the identification results of whether file M has been accessed within the m periods of the specified time period, and then obtain the number of times file M has been accessed within the specified time period.

[0240] For example, assuming that steps 801 to 807 are repeatedly executed from cycle 1 to cycle 10, it can be determined whether file M has been accessed in the cycles from cycle 1 to cycle 10, and then the number of times file M has been accessed in the time period consisting of cycle 1 to cycle 10 can be obtained. For example, assuming that file M has been accessed in cycles 1, 3, and 5, then the number of times file M has been accessed in the time period consisting of cycle 1 to cycle 10 is 3 times.

[0241] Step 808: The hot file identification service performs hot file identification.

[0242] In this step, the specific implementation of the hot file identification service identifying whether the file M is a hot file can refer to the above steps 704 to 705, which will not be repeated here.

[0243] The hot file identification service can use each file among multiple files to be identified as the above-mentioned file M, execute the above-mentioned steps 804 to 808, and obtain the identification result of whether each file to be identified is a hot file, so that hot files can be identified from multiple files to be identified, and then a hot file list can be generated.

[0244] Step 809: The hot file identification service sends the hot file list to the file system.

[0245] In some embodiments, see Fig. 9B In step 909, the hot file identification service may send the hot file list to the file data reading and writing module of the file system.

[0246] Step 810: The file system sends the hot file list to the storage device.

[0247] In some embodiments, the storage device driver may drive the storage device to store the above hot file list.

[0248] In some embodiments, see Fig. 9B In steps 910 to 911, taking storing the hot file list in a preset database as an example, the hot file identification service can specifically send the hot file list to the database to request the database to store the hot file list, and then the database can send the hot file list to the storage device driver to request the storage device to store the hot file list.

[0249] Step 811: The storage device returns storage completion information of the hot file list to the file system.

[0250] In some embodiments, see Fig. 9B In steps 912 to 913, after driving the storage device to complete the hot file storage, the storage device driver can return the indication information of the completion of the hot file list storage to the database, and then the database returns the indication information of the completion of the hot file list storage to the file data read and write module of the file system.

[0251] Step 812: The file system returns an indication that the hot file list storage is complete to the hot file identification server.

[0252] In some embodiments, see Fig. 9B In step 914, the file data reading and writing module of the file system may return the indication information of the completion of the storage of the hot file list to the hot file identification server.

[0253] In the above-mentioned embodiment of the present application, the identification of whether a file is a hot file is realized based on the storage unit bitmap. Since the storage unit bitmap records the access status of each storage unit comprehensively and accurately, the identification of whether a file is a hot file is also relatively more accurate.

[0254] The storage unit bitmap in the above embodiment records whether each storage unit has been accessed. In another embodiment provided in the present application, a file bitmap is also provided to record whether each file has been accessed.

[0255] Optionally, each bit in the file bitmap corresponds to a file, and is used to record whether the file has been accessed. In the file bitmap, each bit can take a value of 0 or 1, which can be used to record whether the file has been accessed. In the embodiment of the present application, it is assumed that 0 represents that the file has not been accessed, and 1 represents that the file has been accessed. In other embodiments, 0 may also represent that the file has been accessed, and 1 may represent that the file has not been accessed.

[0256] When a file is created, the file system in the electronic device will assign a file identifier to the file to uniquely identify the file. The total number of file identifiers that the file system can assign to the file can be fixed, and the specific value of the total number can be set independently in the file system implementation.

[0257] For example, the above-mentioned file identifier can be an index node (inode) of the file. From the perspective of the file system, the index node (inode) of the file is a unique identifier of the file. The inode of a file can contain information required by the file system to process the file, such as: the file type, the number of hard links associated with the file, the length of the file in bytes, the device identifier, the index number that identifies the file in the file system, the user identifier (UserID, UID) of the user to whom the file belongs, the group identifier (Group ID, GID) of the group to which the file belongs, and various timestamps such as the time when the file status changes, the last access time and the last modification time of the file.

[0258] The number of bits in the file bitmap can be equal to the total number of file identifiers that the file system can allocate to the file, and each bit corresponds to a file identifier, that is, corresponds to a file. For example, if the file identifier is an inode, and the number of inodes that the file system can allocate to the file is 8MB, then the file bitmap can be 8MB, so that each bit can correspond to an inode.

[0259] It should be noted that the number of files managed in the file system is generally less than 8MB. In other words, the file system only allocates some of the 8MB file identifiers to files. At this time, the value of the bits corresponding to the file identifiers that are not allocated to the files in the file bitmap can be 0 (not accessed). Strictly speaking, it does not mean that the file corresponding to the file identifier has not been accessed, but it has no effect on the identification results of hot files based on the file bitmap in the subsequent embodiments of this application.

[0260] For example Fig.10The figure shows a schematic diagram of the structure of a file bitmap, which includes 16 file identifiers from 0 to 15. Accordingly, the file bitmap includes 16 bits, each bit corresponds to 1 file identifier. Assume that the bit position is 0, which means it has not been accessed, and the bit position is 1, which means it has been accessed. Figure 3 The files with file identifiers 1, 3, 6, and 10 have been accessed, and accordingly, their corresponding bit positions are 1.

[0261] The file system can initialize the above file bitmap every time period (time interval), that is, set the value of each bit of the above file bitmap to 0, so that the file bitmap corresponding to each time period can record whether each file has been accessed in the time period. Since the above file bitmap can record whether all files have been accessed, the file bitmap has comprehensive coverage and accurate records.

[0262] Moreover, in the above bitmap, one binary bit corresponds to one file, and the number of file identifiers that the file system can allocate to the file can be fixed. Accordingly, the size of the file bitmap can be fixed. By setting the number of file identifiers that the file system can allocate to the file to an appropriate value, such as 8MB, the file bitmap can occupy less storage space. In addition, when updating the file bitmap, it is only necessary to change the bit corresponding to the file bitmap from 0 to 1 or from 1 to 0, and the additional overhead brought about is almost negligible.

[0263] The updating method of the file bitmap in the embodiment of the present application can refer to Figure 4B , the main difference is:

[0264] The bitmap maintained in the file system is replaced from the storage unit bitmap to the file bitmap. At this time, when the file system updates the file bitmap in step 406, the bit corresponding to the file identifier in the file bitmap can be updated according to the file identifier in the received data access request. Still taking 1 for access and 0 for non-access as an example, the bit corresponding to the file identifier in the file bitmap can be updated to 1.

[0265] Optionally, in an embodiment of the present application, if the file access result, i.e., updating the file bitmap, is not considered, the file bitmap update of step 406 can be executed after step 401, and is not restricted by the execution order between steps 402 to 404; if the file bitmap only records the successfully accessed files as having been accessed, then the file bitmap update of step 406 can be executed after step 404, and is not restricted by the execution order of step 405, so as to ensure that the file recorded as 1 in the file bitmap is the file to which the application has successfully completed read data access, thereby improving the accuracy of the file bitmap in recording file access conditions.

[0266] Similarly, in Figure 5BIn step 509, the bitmap update request sent by the file data reading and writing module to the file access situation recording module may include: a file identifier;

[0267] exist Figure 5B In step 510, the file access status recording module may update the file bitmap according to the file identifier in the bitmap update request. Specifically, the bit corresponding to the file identifier in the file bitmap may be updated to 1.

[0268] Optionally, if the file access result is not considered, that is, updating the file bitmap, steps 509 to 510 can be executed after step 502, and the execution order between steps 503 to 508 is not restricted; if the file bitmap only records the successfully accessed files as having been accessed, steps 509 to 510 can be executed after step 506, and the execution order between steps 507 to 508 is not restricted.

[0269] Similarly, in Figure 5C In step 609, the bitmap update request sent by the file data reading and writing module to the file access situation recording module may include: a file identifier;

[0270] exist Figure 5C In step 610, the file access status recording module may update the file bitmap according to the file identifier in the bitmap update request. Specifically, the bit corresponding to the file identifier in the file bitmap is updated to 1.

[0271] Optionally, if the file access result is not considered, that is, updating the file bitmap, steps 609 to 610 can be executed after step 602, and the execution order between steps 603 to 608 is not restricted; if the file bitmap only records the successfully accessed files as having been accessed, then steps 609 to 610 can be executed after step 606, and the execution order between steps 607 to 608 is not restricted.

[0272] Based on the above file bitmap, the embodiment of the present application also provides a hotspot file identification method, still taking the identified file as file M as an example, Fig.11 As shown, the method may include:

[0273] Step 1101: Obtain a file bitmap for each sub-time period in a specified time period, where the file bitmap for each sub-time period is used to record whether each file in the sub-time period has been accessed;

[0274] Step 1102: Determine whether the file M has been accessed in each sub-time period according to the file bitmap of each sub-time period.

[0275] Step 1103: According to whether the file M has been accessed in each sub-time period, count the number of times the file M has been accessed in the specified time period.

[0276] Step 1104: When the number of times the file M is accessed within a specified time period exceeds a preset first number threshold, the file M is determined as a hot file.

[0277] In the above-mentioned embodiment of the present application, the number of times file M is accessed within the specified time period is counted based on the file bitmap of each sub-time period included in the specified time period, and whether file M is a hot file is identified based on the number of accesses, thereby realizing the identification of whether file M is a hot file based on the file bitmap. Since the file bitmap can comprehensively and accurately record the access status of each file in the sub-time period, the result of identifying whether a file is a hot file based on the file bitmap is also relatively more accurate, thereby improving the identification accuracy of hot files.

[0278] If the above-mentioned file access situation identification and hot file identification can be performed by a hot file identification service provided by the electronic device, and the above-mentioned file bitmap is maintained and updated by the file system, then Fig.11 The method shown can be Fig.12 The method shown is implemented as, Fig.12 The main differences from the method shown in Figure 8 are:

[0279] Steps 805 to 806 are omitted, and the storage unit bitmap maintained by the file system is replaced with the file bitmap. Accordingly, the bitmap queried and returned in steps 802 to 803 is replaced from the storage unit bitmap with the file bitmap.

[0280] In step 807, the hot file identification service can directly query from the file bitmap whether the file has been accessed in period i of the specified time period according to the file identifier, and complete the identification of the usage of file M in period i.

[0281] By repeatedly executing Fig.12 In steps 801 to 804 and step 807, the hot file identification service can identify whether the file M has been accessed within the m periods of the specified time period, and obtain the identification results of whether the file M has been accessed within the m periods of the specified time period.

[0282] Furthermore, combined with Fig.9A The structure shown, Fig.12 The method shown can be achieved by, for example Fig.13 The method shown is implemented. Fig. 9B The differences between the methods shown mainly lie in:

[0283] Steps 905 to 906 are omitted, and the storage unit bitmap maintained by the file access status recording module is replaced by the file bitmap. Accordingly, the bitmap queried and returned in steps 902 to 903 is replaced from the storage unit bitmap to the file bitmap;

[0284] In step 907, the hot file identification service can directly query from the file bitmap whether the file has been accessed in period i of the specified time period according to the file identifier, and complete the identification of the usage of file M in period i.

[0285] In the above-mentioned embodiment of the present application, the file bitmap is maintained and updated by the file system, so the file bitmap records the access status of each file more comprehensively and accurately, so the identification of whether a file is a hot file based on the file bitmap is also relatively more accurate.

[0286] In the above embodiments, the storage unit bitmap records whether the storage unit has been accessed within a time period, or the file bitmap records whether the file has been accessed within a time period. In some embodiments provided in the present application, the file bitmap can be expanded to a file access frequency table, which records the number of times each file has been accessed within a specified time period.

[0287] Fig.14 A schematic diagram of the structure of a file access frequency table provided in an embodiment of the present application. Each file identifier may correspond to a frequency field, in other words, each file corresponds to a frequency field for recording the number of times the file is accessed.

[0288] like Fig.14 As shown, if an application accesses a file with a file identifier of 1, the value of the frequency field corresponding to the file identifier 1 in the file access frequency table is increased by 1, for example Fig.14 From 3 to 4.

[0289] The method for updating the file access frequency table in the embodiment of the present application can refer to Figure 4B , the main difference is:

[0290] The storage unit bitmap maintained in the file system is replaced with the file access frequency table. At this time, in step 406, the file system updates the file access frequency table.

[0291] Optionally, when the file system updates the file access frequency table, the frequency field corresponding to the file identifier in the file access frequency table may be updated according to the file identifier in the received access request, specifically by adding 1 to the number of times in the frequency field.

[0292] Optionally, if the file access result is not considered, that is, updating the file access frequency table, step 406 can be executed after step 401, and the execution order between steps 402 to 405 is not restricted; if the file bitmap only records the number of times the file is successfully accessed, then step 406 can be executed after step 404, and the execution order between step 405 is not restricted.

[0293] Similarly, in Figure 5B In step 509, the request sent by the file data reading and writing module to the file access situation recording module is replaced from the bitmap update request to the file access frequency update request, and the file access frequency update request may include: a file identifier;

[0294] exist Figure 5B In step 510, the file access situation recording module may update the file access frequency table according to the file identifier in the file access frequency update request. Specifically, the value of the frequency field corresponding to the file identifier in the file access frequency table may be increased by 1.

[0295] Optionally, in an embodiment of the present application, if the file access result is not considered, that is, updating the file access frequency table, steps 509 to 506 can be executed after step 502, and the execution order between steps 503 to 506 is not restricted; if the file access frequency table only records the number of times the file is successfully accessed, then step 509 can be executed after step 506, and the execution order between step 507 is not restricted.

[0296] Similarly, in Figure 5C In step 609, the file data reading and writing module may also send a file access frequency update request to the file access situation recording module;

[0297] exist Figure 5C In step 610, the file access status recording module may update the file access frequency table according to the file identifier in the file access frequency update request. Specifically, the value of the frequency field corresponding to the file identifier in the file access frequency table may be increased by 1.

[0298] Optionally, if the file access result is not considered, that is, updating the file bitmap, steps 609 to 610 can be executed after step 602, and the execution order between steps 603 to 608 is not restricted; if the file bitmap only records the successfully accessed files as having been accessed, then steps 609 to 610 can be executed after step 606, and the execution order between steps 607 to 608 is not restricted.

[0299] Based on the above file access frequency table, an embodiment of the present application provides a hot file identification method.

[0300] Fig.15is a flow chart of a hotspot file identification method provided in an embodiment of the present application, such as Fig.15 As shown, the method may include:

[0301] Step 1501: Obtain a file access frequency table for a specified time period, where the file access frequency table is used to record the number of times each file in the electronic device is accessed within the specified time period.

[0302] Step 1502: Query the number of times file M is accessed in a specified time period from the file access frequency table.

[0303] Step 1503: Identify whether the file M is a hot file based on the number of times the file M is accessed within the specified time period.

[0304] In the above embodiment of the present application, the number of times each file is accessed in a specified time period is recorded through a file access frequency table. For each file, the number of times the file is accessed can be queried from the file access frequency table, so that whether the file is a hot file can be identified based on the number of times the file is accessed. Since the file access frequency table can accurately record the number of times all files in the electronic device are accessed, the identification of whether a file is a hot file is more accurate.

[0305] If the above hot file identification can be performed by a hot file identification service provided by the electronic device, and the above file access frequency table is maintained and updated by the file system, then Fig.15 The method shown can be specifically Fig.16 The method shown is implemented as, Fig.16 Use steps 1601 to 1604 to replace Fig.12 Steps 801 to 804 in Fig.16 and Fig.12 The differences between the methods shown mainly lie in:

[0306] The file bitmap maintained by the file system is replaced by the file access frequency table.

[0307] In step 1601, the hot file identification service determines the end time of the specified time period;

[0308] In steps 1602 to 1603, the hot file identification service sends a file access frequency table query request to the file system, and the file system returns the file access frequency table to the hot file identification service;

[0309] In step 1604, the file system initializes the file access frequency table, that is, sets the number of times each file has been accessed to 0.

[0310] At this time, in step 807, the hot file identification service can directly query the number of times file M is accessed from the file access frequency table according to the file identifier, so that in step 808, it can be directly determined whether file M is a hot file based on the queried number of times the file is accessed.

[0311] Optionally, in an embodiment of the present application, the file system may set the number of accesses of each file in the file access frequency table to 0 at the initial moment of a specified time period, thereby ensuring that the file system can record the number of accesses of each file within the specified time period.

[0312] Furthermore, combined with Fig.9A The structure shown, Fig.16 The method shown can be specifically carried out by, for example Fig.17 The method shown is implemented. Fig.17 Use steps 1701 to 1704 to replace Fig.13 Steps 901 to 904 in Fig.16 and Fig.13 The differences between the methods shown mainly lie in:

[0313] The file bitmap maintained by the file access status recording module is replaced by the file access frequency table; accordingly,

[0314] In step 1701, the hot file identification service determines the end time of the specified time period;

[0315] In steps 1702 to 1703, the hot file identification service sends a file access frequency table query request to the file access situation recording module of the file system, and the file access situation recording module returns the file access frequency table to the hot file identification service;

[0316] In step 1704, the file system initializes the file access frequency table, that is, sets the number of times each file has been accessed to 0.

[0317] In the above-mentioned embodiment of the present application, the file system maintains and updates the file access frequency table, so that the number of times each file is accessed within a specified time period can be comprehensively and accurately recorded, and the identification of whether a file is a hot file based on the file access frequency table is relatively more accurate.

[0318] An embodiment of the present application also provides an electronic device, including: a processor; a memory; the processor is used to execute the method provided by the embodiment of the present application.

[0319] The embodiment of the present application also provides a computer-readable storage medium, in which a computer program is stored. When the computer-readable storage medium is run on a computer, the computer executes the method provided by the embodiment of the present application.

[0320] The embodiment of the present application also provides a computer program product, which includes a computer program. When the computer program is run on a computer, it enables the computer to execute the method provided by the embodiment of the present application.

[0321] In the embodiments of the present application, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent the existence of A alone, the existence of A and B at the same time, and the existence of B alone. Among them, A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following" and similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b and c can be represented by: a, b, c, a and b, a and c, b and c, or a and b and c, where a, b, c can be single or multiple.

[0322] Those of ordinary skill in the art will appreciate that the various units and algorithm steps described in the embodiments disclosed herein can be implemented in a combination of electronic hardware, computer software, and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0323] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0324] In several embodiments provided in the present application, if any function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory; hereinafter referred to as: ROM), random access memory (Random Access Memory; hereinafter referred to as: RAM), disk or optical disk, and other media that can store program codes.

[0325] The above is only a specific implementation of the present application. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. The protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A hot file identification method, characterized in that: The method is applied to an electronic device, and the method comprises: Obtaining a bitmap of each sub-time period in a specified time period, wherein the bitmap of each sub-time period is used to record whether each file has been accessed in the sub-time period; the sub-time periods constitute the specified time period; Determine whether the target file has been accessed in each sub-time period according to the bitmap of each sub-time period; According to whether the target file has been accessed in each sub-time period, counting the number of times the target file has been accessed in the specified time period; According to the number of times the target file is accessed within the specified time period, it is identified whether the target file is a hot file.

2. The method according to claim 1, characterized in that The step of obtaining a bitmap of each sub-time period in a specified time period includes: At the end of each sub-time period, a bitmap of a file system is obtained as the bitmap of each sub-time period; the file system is located in the electronic device.

3. The method according to claim 2, characterized in that Also includes: When the file system receives data access for a first file, the file system records the first file as having been accessed in a bitmap of the file system.

4. The method according to claim 3, characterized in that After obtaining the bitmap of the file system, the method further includes: The file system initializes a bitmap of the file system.

5. The method according to any one of claims 2 to 4, characterized in that: The bitmap includes a first number of bits, the first number being a total number of file identifiers that the file system can allocate to files; Each of the bits corresponds to a file identifier, and each of the bits is used to record whether the file indicated by the corresponding file identifier has been accessed.

6. The method according to claim 1, characterized in that The electronic device comprises a storage device, wherein the storage device stores files in storage units; The bitmap of each sub-time period is specifically used to record whether each storage unit has been accessed in the sub-time period.

7. The method according to claim 6, characterized in that The determining, according to the bitmap of each sub-time period, whether the target file has been accessed in each sub-time period comprises: Obtaining the storage unit occupied by the target file in the storage device; Obtaining from the bitmap of each sub-time period whether each storage unit occupied by the target file has been accessed in each sub-time period; Whether the target file has been accessed in each sub-time period is determined according to whether each storage unit occupied by the target file has been accessed in each sub-time period.

8. The method according to claim 7, characterized in that The determining whether the target file has been accessed in each sub-time period according to whether each storage unit occupied by the target file has been accessed in each sub-time period comprises: For each of the sub-time periods, when at least one storage unit occupied by the target file has been accessed within the sub-time period, it is determined that the target file has been accessed within the sub-time period.

9. The method according to any one of claims 6 to 8, characterized in that: The step of obtaining a bitmap of each sub-time period in a specified time period includes: At the end of each sub-time period, a bitmap of the file system is obtained as the bitmap of each sub-time period; the file system is located in the electronic device, and the bitmap of the file system is used to record whether each storage unit has been accessed.

10. The method according to claim 9, characterized in that Also includes: When the file system receives a data access for a first file, it determines a storage unit associated with the data access, and records the storage unit associated with the data access as having been accessed in a bitmap of the file system.

11. The method according to claim 9, characterized in that After obtaining the bitmap of the file system, the method further includes: The file system initializes a bitmap of the file system.

12. The method according to any one of claims 6 to 8, characterized in that: The bitmap includes a second number of bits, where the second number is the total number of the storage units included in the storage device; Each of the bits corresponds to a storage unit, and each of the bits is used to record whether the corresponding storage unit has been accessed.

13. The method according to any one of claims 1 to 12, characterized in that: The step of identifying whether the target file is a hot file according to the number of times the target file is accessed within the specified time period includes: When the number of accesses to the target file within the specified time period exceeds a preset threshold, the target file is identified as a hot file.

14. The method according to any one of claims 1 to 13, characterized in that: The method further comprises: Taking each file to be identified as the target file in turn, executing the steps of determining whether the target file has been accessed in each sub-time period, counting the number of times the target file has been accessed in the specified time period, and identifying whether the target file is a hot file, to obtain an identification result of whether each file to be identified is a hot file; A hot file list is generated according to the identification result of whether each file to be identified is a hot file.

15. A hotspot file identification method, characterized in that: The method is applied to an electronic device, and the method comprises: Obtaining an access frequency table for a specified time period, wherein the access frequency table for the specified time period is used to record the number of times each file in the electronic device is accessed within the specified time period; Obtaining the number of times the target file is accessed within the specified time period from the access frequency table; According to the number of times the target file is accessed within the specified time period, it is identified whether the target file is a hot file.

16. The method according to claim 15, characterized in that The step of obtaining the access frequency table for the specified time period includes: At the end time of the specified time period, an access frequency table of the file system is obtained from the file system as the access frequency table of the specified time period.

17. The method according to claim 16, characterized in that Also includes: When the file system receives data access to a first file within the specified time period, the number of times the first file is accessed is increased by 1 in the access frequency table of the file system.

18. The method according to claim 17, characterized in that Also includes: At an initial moment of the specified time period, the file system initializes an access frequency table of the file system.

19. The method according to any one of claims 15 to 18, characterized in that The access frequency table includes: a file identifier and the number of accesses corresponding to the file identifier, wherein the file identifier is used to identify a file and is allocated by the file system to each file.

20. The method according to any one of claims 15 to 18, characterized in that The method further comprises: Taking each file to be identified as the target file in turn, executing the steps of obtaining the number of times the target file is accessed within the specified time period and identifying whether the target file is a hot file, and obtaining an identification result of whether each file to be identified is a hot file; A hot file list is generated according to the identification result of whether each file to be identified is a hot file.

21. An electronic device, characterized in that: include: one or more processors; Memory; One or more computer programs are stored in the memory, and the one or more computer programs include instructions, which, when executed by the processor, enable the electronic device to perform the method according to any one of claims 1 to 20.

22. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which, when executed on a computer, enables the computer to execute the method according to any one of claims 1 to 20.