Information processing method, electronic device, chip system, storage medium and program product

By recording and caching logs twice in electronic devices and correcting the first log based on the second log, the problem of incomplete or inaccurate logs is solved, achieving higher log integrity and accuracy, and helping to determine the cause of lost files.

CN121935236APending Publication Date: 2026-04-28HONOR DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HONOR DEVICE CO LTD
Filing Date
2024-10-25
Publication Date
2026-04-28

AI Technical Summary

Technical Problem

Logs stored on electronic devices may be incomplete or inaccurate, making it impossible to accurately determine the cause of file loss.

Method used

The system processes a first file in an electronic device, records a first log and caches a second log, corrects the first log based on the second log, and stores the corrected log in a second database, thus ensuring the integrity and accuracy of the logs.

Benefits of technology

It improves the completeness and accuracy of logs, reduces storage problems caused by incomplete logs, and enables subsequent log collection tools to obtain more complete or accurate logs, helping to determine the cause of lost files.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121935236A_ABST
    Figure CN121935236A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an information processing method, electronic equipment, a chip system, a storage medium and a program product, and relates to the technical field of terminals. The method comprises the steps of performing first processing on a first file; based on first processing on the first file, storing the first log in a first database, and caching a second log; the first log and the second log comprise information related to the first file and / or the first processing, and the first log and the second log comprise preset type information; correcting preset type information in the first log based on the second log, and storing the corrected log in a second database; and / or storing the first log and the second log in a second database. In this way, the log stored in the electronic equipment can be more complete or more accurate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of terminal technology, and in particular to an information processing method, electronic device, chip system, storage medium and program product. Background Technology

[0002] Applications installed on electronic devices can perform various operations on files such as pictures, videos, and documents, including deleting, moving, editing, and renaming. These devices can also store logs to record information about how the applications processed the files, such as processing time, file name, and application package name. This log analysis can then be used to diagnose system problems and optimize system performance.

[0003] However, logs stored on electronic devices may be incomplete or inaccurate. Summary of the Invention

[0004] This application provides an information processing method, an electronic device, a chip system, a storage medium, and a program product, applicable to the field of terminal technology. It helps improve the integrity or accuracy of logs stored in electronic devices.

[0005] In a first aspect, embodiments of this application propose an information processing method applied to an electronic device. The method includes: performing a first processing on a first file; storing a first log in a first database based on the first processing of the first file, and caching a second log; the first log and the second log include information related to the first file and / or the first processing, and the first log and the second log include preset type information; correcting the preset type information in the first log based on the second log, and storing the corrected log in the second database; and / or storing the first log and the second log in the second database.

[0006] In this context, the first file is, for example, the target image mentioned below, and the first process is, for example, deletion in method 600. The first log is, for example, operation log 1 mentioned below, and the second log is, for example, operation record 1 mentioned below. The first database is, for example, database 1 mentioned below, and the second database is, for example, database 2 mentioned below. The preset type information can be, for example, information with low accuracy stored in the logs in the first database, such as package names. The corrected log is, for example, the corrected target operation log mentioned below.

[0007] In the information processing method of this application, the electronic device not only records and stores a first log for the first process, but also caches a second log. That is, the electronic device performs two log entries for the first process. This allows the electronic device to store both the first and second logs, and also to combine the two logs for information correction. In the event of loss of the first log in the first database, the electronic device also stores the corrected log in the second database, and / or the first and second logs. This reduces the possibility of incomplete log storage by the electronic device due to the loss of some logs in the first database. This allows subsequent log collection tools to obtain more complete or accurate logs from the second database.

[0008] In conjunction with the first aspect, in some implementations of the first aspect, the first processing is performed by a first application in an electronic device; caching the second log includes: caching the second log when it is determined that a first condition is met; the first condition includes one or more of the following: the first application belongs to a preset type of application; the first file belongs to a preset type of file; or, the first processing belongs to a preset type of processing method.

[0009] The preset type application can be the preset application in S607 below, such as the application with UID 1000. The application can be APP 1 below. The preset type file can be, for example, an image. The preset type processing method can be the preset operation type below, such as delete, move, and rename. The first condition is similar to the three judgment conditions in S605 to S607 below.

[0010] In this way, the electronic device can cache logs that meet the first condition and correct and supplement logs that meet the first condition in the first database, so that the electronic device does not need to cache all types of logs, thus reducing the power consumption of the electronic device.

[0011] In conjunction with the first aspect, in some implementations of the first aspect, the preset type information in the first log is corrected based on the second log, including: when it is determined that the preset type information in the first log is different from the preset type information in the second log, the preset type information in the first log is replaced with the preset type information in the second log to obtain the corrected log.

[0012] In this way, the electronic device can update the preset type information in the first log to the preset type information in the second log. When the second log is more accurate, the corrected log becomes more accurate.

[0013] In conjunction with the first aspect, in some implementations of the first aspect, the first log includes a first moment when the electronic device performs the first processing, and the second log includes a second moment when the electronic device performs the first processing; the preset type information in the first log is corrected based on the second log, including: when it is determined that the interval between the first moment and the second moment is less than or equal to a preset duration, the preset type information in the first log is corrected based on the second log.

[0014] The first moment can be, for example, the operation time in operation log 1 below, and the second moment can be, for example, the operation time in operation record 1 below. That is, the first moment is the operation time recorded in the first log, and the second moment is the operation time recorded in the second log. The first moment and the second moment may be the same or different.

[0015] In this way, if the interval between the first moment and the second moment is less than or equal to the preset duration, it means that the first log and the second log are logs recorded by the same process, and the electronic device can correct the first log based on the second log.

[0016] In conjunction with the first aspect, in some implementations of the first aspect, the first log includes the first moment when the electronic device performs the first processing, and the second log includes the second moment when the electronic device performs the first processing; storing the second log in the second database includes: storing the first log and the second log in the second database when it is determined that the interval between the first moment and the second moment is greater than a preset duration.

[0017] In this case, if the interval between the first moment and the second moment is greater than the preset duration, it means that the first log and the second log may not be logs recorded for the same process. The electronic device can then determine that the first log and the second log may correspond to different processes, and the electronic device can store both the first log and the second log in the second database.

[0018] Optionally, storing the second log in a second database includes: storing the second log in the second database when the electronic device does not find the target log in the first database. The target log can be understood as a log in which the interval between the recorded operation time and the second moment is less than or equal to a preset duration.

[0019] In other words, the target log corresponds to the same processing as the second log, which is the log of the first processing. Due to various reasons, the first log information may be incorrect, or the first log may be deleted. In such cases, the electronic device cannot retrieve the log corresponding to the second log from the first database. Therefore, the electronic device can store the second log in the second database, making the logs stored in the second database more complete.

[0020] In conjunction with the first aspect, in some implementations of the first aspect, the electronic device includes a first driver and a media provider, the first log is stored through the media provider, and the second log is cached through the first driver.

[0021] In this way, the electronic device can store logs not only through the media provider but also through the kernel-level driver cache. Since the electronic device's processing of the first file is related to the kernel layer, the accuracy of the second log cached by the electronic device through the kernel layer can be higher. Therefore, the electronic device can correct the first log based on the second log cached by the first driver, thereby making the logs stored in the second database more accurate.

[0022] In conjunction with the first aspect, in some implementations of the first aspect, the second log is cached in the first cache; the preset type information in the first log is corrected based on the second log, and the corrected log is stored in the second database; or, the first log and the second log are stored in the second database, including: the media provider obtains the second log from the first cache; the media provider corrects the preset type information in the first log based on the second log, and the corrected log is stored in the second database; and / or, the first log and the second log are stored in the second database.

[0023] In this way, the media provider can store more complete and accurate logs in the second database, making it easier to obtain more complete and accurate logs from the second database later. Based on the obtained logs, problems in system operation can be identified, such as the cause of image loss.

[0024] In conjunction with the first aspect, in some implementations of the first aspect, the first processing is performed by a first application in an electronic device, and the preset type information includes the package name of the installation package of the first application.

[0025] That is, the default type information is, for example, the package name.

[0026] In this way, electronic devices can correct the packet names in the logs stored by the media provider to reduce inaccurate packet names in the logs.

[0027] In conjunction with the first aspect, in some implementations of the first aspect, the first application is the application where the user identifier UID is the first value.

[0028] The first value can be, for example, 1000, and the first application can be a system application.

[0029] In this way, electronic devices can supplement and correct the logs of system applications processing files, which helps to obtain more accurate and complete logs of system applications processing files in the future.

[0030] Secondly, embodiments of this application provide an apparatus, which may be an electronic device, or a chip or chip system within an electronic device. The motion effect execution apparatus may include a processing unit. When the apparatus is an electronic device, the processing unit may be a processor. The apparatus may also include a storage unit, which may be a memory. The storage unit stores instructions, and the processing unit executes the instructions stored in the storage unit to cause the electronic device to implement an information processing method described in the first aspect or any possible implementation of the first aspect. When the apparatus is a chip or chip system within an electronic device, the processing unit may be a processor. The processing unit executes the instructions stored in the storage unit to cause the electronic device to implement an information processing method described in the first aspect or any possible implementation of the first aspect. The storage unit may be a storage unit within the chip (e.g., a register, cache, etc.), or a storage unit located outside the chip within the electronic device (e.g., a read-only memory, random access memory, etc.).

[0031] For example, a processing unit is used to perform first processing on a first file, etc.

[0032] Thirdly, embodiments of this application provide an electronic device including a processor and a memory, the memory for storing code instructions, and the processor for running the code instructions to perform the methods described in the first aspect or any possible implementation of the first aspect.

[0033] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program or instructions that, when executed on a computer, cause the computer to perform the methods described in the first aspect or any possible implementation thereof.

[0034] Fifthly, embodiments of this application provide a computer program product including a computer program, which, when run on a computer, causes the computer to perform the methods described in the first aspect or any possible implementation of the first aspect.

[0035] Sixthly, this application provides a chip or chip system including at least one processor and a communication interface. The communication interface and the at least one processor are interconnected via a circuit. The at least one processor is used to run computer programs or instructions to perform the methods described in the first aspect or any possible implementation of the first aspect. The communication interface in the chip can be an input / output interface, pins, or circuits, etc.

[0036] In one possible implementation, the chip or chip system described above in this application further includes at least one memory storing instructions. The memory can be an internal storage unit of the chip, such as a register or cache, or it can be a storage unit of the chip itself (e.g., read-only memory, random access memory, etc.).

[0037] It should be understood that the second to sixth aspects of this application correspond to the technical solutions of the first aspect of this application, and the beneficial effects achieved by each aspect and the corresponding feasible implementation are similar, and will not be repeated here. Attached Figure Description

[0038] Figure 1 This is a diagram illustrating the percentage of various reasons for image loss.

[0039] Figure 2 This is a schematic diagram of an image processing process.

[0040] Figure 3 This is a flowchart illustrating an operation log storage method.

[0041] Figure 4 This is a schematic diagram of an operation log acquisition process;

[0042] Figure 5 A schematic block diagram of the software architecture of an electronic device provided in an embodiment of this application;

[0043] Figure 6 A flowchart illustrating an information processing method provided in an embodiment of this application;

[0044] Figure 7 This application provides a schematic diagram of the structure of information stored in a first cache according to an embodiment of the present application.

[0045] Figure 8 A flowchart illustrating a method for storing merged operation logs in database 2 using a media provider provided in this embodiment of the application;

[0046] Figure 9 A schematic diagram illustrating the process of a media provider storing merged operation logs provided in this embodiment of the application;

[0047] Figure 10 A schematic block diagram of the hardware architecture of an electronic device provided in an embodiment of this application;

[0048] Figure 11 This is a schematic block diagram of an information processing device provided in an embodiment of this application. Detailed Implementation

[0049] To facilitate a clear description of the technical solutions in the embodiments of this application, some terms and technologies involved in the embodiments of this application will be briefly introduced below:

[0050] 1. Uniform Resource Identifier (URI)

[0051] A URI is a string used to identify a resource. It can be a URL (Uniform Resource Locator) or a URN (Uniform Resource Name). URIs are widely used in web and web technologies for locating and accessing resources.

[0052] 2. Media provider

[0053] It is an important content provider responsible for managing and accessing multimedia files on the device, such as audio, video, and images. The media provider is part of the Android framework, providing a unified way to access and manage media files on the device.

[0054] Media providers can be used to manage media files on a device in a unified manner, and provide a centralized database to store the metadata of media files (such as filename, path, size, type, etc.).

[0055] In addition, the media provider provides an interface that allows applications to access media files stored in a centralized database.

[0056] 3. Process

[0057] It is an independent instance of a program running in the operating system. Each process has its own memory space, data segment, code segment, and system resources (such as file handles, network connections, etc.).

[0058] For example, in the Android operating system, each running application (such as Word or Chrome) typically runs in an independent process, and this process has its own virtual machine instance (such as the Dalvik virtual machine or the Android runtime virtual machine), and is isolated from the processes of other applications to improve the security and stability of the applications, and to prevent the crash or error of one application from affecting other applications.

[0059] An electronic device can run one or more processes, and each process can be assigned a process identifier (PID). The PID, also known as pid, is a unique integer used to identify each process running in the operating system.

[0060] 4. Thread: A thread is a unit of execution within a process. A process can contain one or more threads, which share the process's resources (such as memory and file handles), but each thread has its own stack, registers, and program counter.

[0061] Each thread created in an electronic device can be assigned a thread identifier (TID). A TID, also written as tid, is a unique integer used to identify each thread in a process.

[0062] 5. Relationship between applications, processes, and threads: An application can run in a process, and a process can contain one or more threads.

[0063] 6. User identifier (UID)

[0064] Also known as an application UID, it is a unique integer used to identify a user or group of users. Each application is assigned a unique UID upon installation.

[0065] 7. User-space file system (FUSE)

[0066] FUSE is a technology that allows users to create their own file systems in user space. It enables non-privileged users to implement file systems by writing simple programs without modifying kernel code. FUSE is designed to run in user space and interact with the operating system's file system interface through a kernel module.

[0067] 8. FUSE daemon

[0068] It is a daemon process related to FUSE (Filesystem in Userspace). In the FUSE framework, the userspace file system implementation typically requires a userspace process to handle file system requests; this process can be called a "daemon".

[0069] 9. Virtual file system (VFS) and file system (FS)

[0070] The Virtual File System (VFS) is an abstraction layer in the operating system kernel that provides a unified interface for accessing different types of file systems. It allows applications to access different file systems using the same system calls, without needing to know the underlying implementation details.

[0071] VFS abstracts the specific implementation details of the file system, providing a unified file operation interface for upper-layer applications, such as opening, reading, writing, and closing files.

[0072] A Virtual File System (VFS) typically consists of a set of data structures and interfaces that define the operations that the file system must perform, such as opening, reading, writing, and closing files.

[0073] FS refers to a specific file system implementation, which is responsible for organizing, storing, retrieving, and managing data on storage devices. A file system defines how files and directories are stored on storage media.

[0074] Filesystem (FS) is responsible for storing data on physical media and providing methods for accessing that data. FS can also manage the creation, deletion, modification, and permission settings of files and directories.

[0075] The relationship between VFS and FS

[0076] VFS resides at the upper layer of the operating system kernel, providing a unified interface, while the specific FS implementations reside at the lower layer of VFS, responsible for specific data storage and management.

[0077] Through VFS, the operating system can support multiple file systems and provide a consistent file operation experience, while FS can be used to handle the underlying storage details.

[0078] 10. Other terms

[0079] In the embodiments of this application, terms such as "first" and "second" are used to distinguish identical or similar items with substantially the same function and purpose. For example, "first chip" and "second chip" are used only to distinguish different chips and do not limit their order of execution. Those skilled in the art will understand that terms such as "first" and "second" do not limit the quantity or execution order, and that "first" and "second" do not necessarily imply that they are different.

[0080] It should be noted that, in the embodiments of this application, the terms "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design scheme described as "exemplary" or "for example" in this application should not be construed as being more preferred or advantageous than other embodiments or design schemes. Specifically, the use of terms such as "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.

[0081] In this application embodiment, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one of the following" or 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, or c can represent: a, b, c, ab, a--c, bc, or abc, where a, b, and c can be single or multiple.

[0082] 11. Electronic equipment

[0083] The electronic devices in this application embodiment may include handheld devices with information processing functions, vehicle-mounted devices, etc. For example, some electronic devices include: mobile phones, tablets, PDAs, laptops, mobile internet devices (MIDs), wearable devices, virtual reality (VR) devices, augmented reality (AR) devices, wireless terminals in industrial control, wireless terminals in self-driving, wireless terminals in remote medical surgery, wireless terminals in smart grids, wireless terminals in transportation safety, wireless terminals in smart cities, wireless terminals in smart homes, cellular phones, cordless phones, session initiation protocol (SIP) phones, wireless local loop (WLL) stations, personal digital assistants (PDAs), handheld devices with wireless communication capabilities, computing devices or other processing devices connected to wireless modems, in-vehicle devices, wearable devices, terminal devices in 5G networks, or future evolution of public land mobile communication networks. Terminal devices in a network (PLMN), etc., are not limited to this in the embodiments of this application.

[0084] By way of example and not limitation, in this embodiment, the electronic device can also be a wearable device. Wearable devices, also known as wearable smart devices, are a general term for devices that utilize wearable technology to intelligently design and develop everyday wearables, such as glasses, gloves, watches, clothing, and shoes. Wearable devices are portable devices that are worn directly on the body or integrated into the user's clothing or accessories. Wearable devices are not merely hardware devices, but also achieve powerful functions through software support, data interaction, and cloud interaction. Broadly speaking, wearable smart devices include those that are feature-rich, large in size, and can achieve complete or partial functions without relying on a smartphone, such as smartwatches or smart glasses, as well as those that focus on a specific type of application function and require the use of other devices such as smartphones, such as various smart bracelets and smart jewelry for vital sign monitoring.

[0085] Furthermore, in this embodiment of the application, the electronic device can also be a terminal device in the Internet of Things (IoT) system. IoT is an important part of the future development of information technology. Its main technical feature is to connect objects to the network through communication technology, thereby realizing an intelligent network of human-machine interconnection and object-to-object interconnection.

[0086] The electronic devices in the embodiments of this application may also be referred to as: terminal equipment, user equipment (UE), mobile station (MS), mobile terminal (MT), access terminal, user unit, user station, mobile station, mobile station, remote station, remote terminal, mobile device, user terminal, terminal, wireless communication equipment, user agent, or user device, etc.

[0087] In this embodiment, the electronic device or various network devices include a hardware layer, an operating system layer running on top of the hardware layer, and an application layer running on top of the operating system layer. The hardware layer includes hardware such as a central processing unit (CPU), a memory management unit (MMU), and memory (also called main memory). The operating system can be any one or more computer operating systems that implement business processing through processes, such as Linux, Unix, Android, iOS, or Windows. The application layer includes applications such as browsers, address books, word processing software, and instant messaging software.

[0088] Electronic devices can have various types of applications installed, such as file management apps, system management apps, camera apps, gallery apps, and social media apps. Applications can also be categorized as system apps and other apps. Other apps can be understood as non-system apps, such as third-party apps.

[0089] System applications, such as those with a UID of 1000, can be applications pre-installed on devices by device manufacturers or operating system developers, such as file management applications and system manager applications. These applications can be understood as part of the operating system.

[0090] Third-party applications can be applications developed by independent developers or companies. Users can download and install this type of application through app stores or other channels, and can also uninstall already installed applications of this type, such as social applications, as needed.

[0091] Regardless of the application type, it may cache or store some images on the electronic device during operation. For example, social applications may cache various images on the electronic device during operation, such as images used during chat; camera applications may store captured images; and file management applications may store images obtained by various applications on the electronic device, such as images downloaded from the cloud or obtained from other devices.

[0092] However, in some scenarios, images stored on electronic devices may be lost unexpectedly. These scenarios may include, but are not limited to, the following:

[0093] Scenario 1: Image loss caused by application image deletion.

[0094] For example, system manager apps can periodically clean up junk files on electronic devices to free up more resources. During this process, the system manager app may delete images from some apps, such as cached images from social media apps or images stored in the gallery app.

[0095] Scenario 2: Image loss caused by camera application dropping images.

[0096] For example, during the operation of a camera application, in response to an input action that triggers the taking of an image, the camera application can take a picture. Normally, the camera application can store the captured image in the gallery application. However, due to anomalies such as camera application lag, the camera application may fail to store the captured image in the gallery application.

[0097] Scenario 3: Image loss during cloud synchronization.

[0098] In other words, during the process of an electronic device transferring images to the cloud, the device may lose some of the images. For example, if an image 1 is stored in a photo library application, it may be lost during the transfer of the image to the cloud due to data transmission anomalies or other reasons.

[0099] Scenario 4: Image loss in third-party applications.

[0100] For example, images managed by the third-party application itself are abnormally lost.

[0101] Scenario 5: Recoverable image loss.

[0102] In other words, electronic devices may cache some of the deleted images, and based on user actions, the electronic device can restore the deleted images.

[0103] Scenario 6: Image loss during Media Transfer Protocol (MTP) transmission.

[0104] Scenario 7: User accidentally deletes an image.

[0105] For example, a user can clean up files on an electronic device using some of the applications installed on the device, which may delete some of the applications' images in the process.

[0106] In addition, there are various other scenarios that may lead to image loss, which will not be listed here.

[0107] Of the various image loss scenarios described above, scenario one typically has a higher probability of occurrence. For example, combining... Figure 1 The probability of image loss in each of the above scenarios can be described as follows: Figure 1 As shown in (a) of the diagram.

[0108] Among these scenarios, the probability of image loss due to application deletion is highest in Scenario 1 (e.g., 43%); in Scenario 2, the probability of image loss due to camera application is 21%; in Scenario 3, the probability of image loss during cloud synchronization is 7%; in Scenario 4, the probability of image loss due to third-party applications is 7%; in Scenario 5, the probability of recoverable image loss is 6%; in Scenario 6, the probability of image loss during MTP transmission is 2%; and in Scenario 7, the probability of image loss due to user error is 4%. Additionally, the probability of image loss due to lack of valid logs, meaning that information related to image loss cannot be determined based on logs, is 4%. The probability of image loss in other unknown scenarios is 6%.

[0109] And such Figure 1 As shown in (b) of the example, in the application deletion scenario 1, the probability of deletion by system applications is approximately 78.26%, while the probability of deletion by non-system applications is approximately 21.74%.

[0110] Therefore, combining Figure 1It can be seen that image deletion by the system application is a major cause of image loss.

[0111] It should be noted that in this embodiment, "image loss" can also be understood as the loss of an image, or the inability to retrieve images that have been stored or managed at a historical time. "Image deletion" can also be understood as the deletion of an image, and is a significant cause of image loss. For the sake of brevity, this will not be elaborated upon further below.

[0112] Besides deleting images, image loss can also occur due to abnormal image movement or renaming. For example, image 'a' managed by application 'a' might be renamed by another application, making it unavailable to application 'a' based on its previous name. Similarly, image 'b' managed by application 'b' might be moved to a different storage location by another application, making it unavailable to application 'b' from its previous storage location. Therefore, both of these operations can lead to image loss.

[0113] To determine the cause of image loss, such as the actions that led to it (deleting, moving, or renaming) and the applications that caused it, and thus to optimize system performance, operation logs stored in the electronic device can be retrieved. These logs can include information about how applications processed the images, such as information indicating the processing type (delete, rename, etc.). For example, operation logs could include logs of image deletion, image renaming, and image moving.

[0114] It should be understood that, in the embodiments of this application, the processing of images by the application can also be referred to as the operation of images by the application, and the following description will use the operation as an example.

[0115] Optionally, the operation log may include, but is not limited to, one or more of the following information: package name, whether permission is granted, operation type, file type, file path, application UID, operation time, trigger behavior interface name, pid, tid, or new path.

[0116] Furthermore, when the operation log includes all the above information, the format of the image deletion operation log can be:

[0117] Package name | Permission required | Operation type | File type | File path | Application UID | Operation time | Trigger behavior interface name | pid | tid | New path.

[0118] For example, the log for deleting an image could be:

[0119] The code snippet shows the application's URL: `com.example.mediaproviderdemo|true|1|1| / storage / emulated / 0 / test / .cache / 19495.jpg|10255|2024-08-29 21:20:36.599|insert|-1|-1|X1`. Here, `com.example.mediaproviderdemo` is the package name of the application deleting the image; "true" indicates that the application has permission to delete the image; operation type 1 indicates deletion; file type 1 indicates the file being deleted is an image; `storage / emulated / 0 / test / .cache / 19495.jpg` is the file path; `10255` is the UID of the application deleting the image; `2024-08-29 21:20:36.599` is the operation time (the time the image was deleted); `insert` is the trigger interface name; `pid` is -1; and `tid` is -1.

[0120] Therefore, if accurate operation logs are available, relevant information about the lost images can be determined, and thus the cause of the image loss can be identified.

[0121] Currently, operation logs can be stored and managed by the media provider. The media provider can manage a database, for example, called database 1, which can store the operation logs.

[0122] However, in some cases, such as when manipulating images via URI access, the media provider can obtain complete and relatively accurate operation logs.

[0123] This is because, in the URI access method, applications typically need to call the interface provided by the media provider to perform operations such as deleting, renaming, and moving images. In this way, the media provider can determine the operations performed on images by each application, and thus record the corresponding operation logs and store them in database 1.

[0124] However, in other cases, namely when images are accessed via other methods, the media provider may be more likely to obtain erroneous or incomplete operation logs. This includes situations like image manipulation via file access.

[0125] The file access method can be, for example, the FUSE access method. The FUSE access method can also be called the FUSE file system method, etc. The process of an application manipulating images using the FUSE access method can be as follows: Figure 2 As shown.

[0126] Figure 2 This is a diagram illustrating the process of an application manipulating images. For example... Figure 2 As shown, the process of an application manipulating images through FUSE access involves the interaction between the application (APP), the media provider, VFS, the FUSE driver, and the FS.

[0127] Among them, the APP and media provider can belong to user space, which can also be called user mode; VFS, FUSE driver and FS can belong to kernel space, which can also be called kernel mode.

[0128] The app can send Request1 to the FUSE driver through VFS. Request1 is used to request the processing of the target image, such as deleting, renaming or moving the target image.

[0129] The FUSE driver can wake up the FUSE daemon and instruct it to handle events.

[0130] For example, the FUSE driver can call the pf_create function to instruct the creation of the target image; it can call the pf_unlink function to instruct the deletion of the target image; it can call the pf_access function to instruct the access of the target image; it can call the pf_rename function to instruct the renaming of the target image, etc.

[0131] The FUSE daemon can reside within a media provider. Electronic devices can process target images through the FUSE daemon. During image processing, the target image needs to be accessed via the VFS and FS. The target image accessed via the FS can be cached, for example, in the page cache.

[0132] In addition, the media provider can obtain information such as file path, UID, package name, and operation type to record operation logs.

[0133] However, in this process, the media provider needs to obtain the above information based on the interface provided in kernel mode. But the media provider is set in user mode, which may cause the media provider to obtain inaccurate information. For example, when the UID is 1000, the media provider obtains an inaccurate package name.

[0134] The process by which a media provider acquires and saves the above information can be as follows: Figure 3 As shown.

[0135] Figure 3 A flowchart illustrating a method 300 for saving an operation log for a media provider. (Example) Figure 3As shown, method 300 includes the following steps:

[0136] S301: The FUSE driver wakes up the FUSE daemon process when the APP requests the processing of the target image, and instructs the FUSE daemon process to process the target image.

[0137] For example, in cases where the target image is to be deleted, the FUSE driver can call the pf_unlink(uid, tid) interface to implement the steps in S301.

[0138] S302, the FUSE daemon instructs the media provider (MediaProviderWrapper.cpp) to process the target image.

[0139] For example, in cases where the target image is to be deleted, the FUSE daemon can call the DeleteFile interface to instruct the media provider to delete the target image.

[0140] For example, MediaProviderWrapper.cpp can be used to handle requests from the Java layer.

[0141] S303, MediaProviderWrapper.cpp uses the DeleteFileInternal interface

[0142] The DeleteFileForFuse function is called to instruct MediaProvider.java to delete the target image.

[0143] Furthermore, the media provider can execute S304 based on the call to the DeleteFileForFuse function.

[0144] S304, MediaProvider.java retrieves information, namely package name, UID, pid, and file name.

[0145] S305, MediaProvider.java calls the interface to instruct RecorderMediaBehavior.java to store the retrieved information, that is, to store the operation log.

[0146] For example, MediaProvider.java calls the RecordMediaBehavior interface, instructing RecorderMediaBehavior.java to record (or store) information such as the acquired package name, UID, pid, and file name, for example, storing this information in database 1, etc.

[0147] In this way, the media provider can store the operation logs of processing the target image in database 1.

[0148] However, when the UID is 1000, the package name obtained by the media provider is more likely to be inaccurate or incomplete. This means that even after obtaining the operation logs through the media provider, it may be impossible to accurately determine the relevant information regarding the lost image based on the operation logs.

[0149] For example, such as Figure 4 As shown, Figure 4 This illustrates the process of a log collection tool collecting operation logs from a media provider. This log collection tool, such as Hiview, can collect operation logs from the media provider, analyze the logs, and generate corresponding results reports. These reports allow developers to diagnose problems and optimize system performance. For example, in cases of abnormal image loss, developers can use the results report to determine the cause, facilitating subsequent system performance optimization and reducing the occurrence of abnormal image loss.

[0150] The operation logs collected by the log collection tool are gathered through the media provider. To make it easier to understand, let's first explain how the media provider stores the operation logs.

[0151] Combining the URI access method and file access method (such as FUSE access method) mentioned above, when the APP processes the target image via URI access, the APP needs to call the interfaces provided by the media provider, such as the insert interface for inserting images, the update interface for updating images, and the delete interface for deleting images. Furthermore, based on calling these interfaces, the media provider can obtain information, namely the information included in the operation log, and store the operation log in database 1.

[0152] It should be noted that during the information acquisition process, the media provider needs to interact with the security and privacy module to be authorized to access the required information. For example, the security and privacy module may include a behavior log management service, which is used to grant privacy authorization to the media provider. That is, the behavior log management service can confirm with the app whether it allows the media provider to obtain information related to the app's processing of the target image; this information may be referred to as operation logs or behavior information. For example, a pop-up window may be displayed to confirm with the user whether permission is granted to obtain this behavior information. Alternatively, when the app is installed on the electronic device, it may have already been permanently authorized to access the app's behavior information. Thus, with privacy authorization, the media provider can obtain behavior information, i.e., information in the operation log, and subsequently store the operation log of the app processing the target image in database 1.

[0153] When the app processes the target image via file access, the target image can be processed using steps S301 to S303. Furthermore, the media provider can also obtain information and store the operation log of processing the target image in database 1.

[0154] It should be understood that when an app processes a target image through file access, the media provider also needs to obtain privacy authorization from the behavior record management service before acquiring the information. The process of obtaining privacy authorization is similar to that when an app processes a target image through URI access, as described above, and will not be repeated here.

[0155] In this way, regardless of the access method used to process the target image, the media provider can store the operation log of processing the target image in database 1.

[0156] Based on the above embodiments, the media provider can also periodically store the operation logs in database 1 into database 2. Database 2 can be a database or queue that can permanently store operation logs, and the log collection tool can collect operation logs from database 2.

[0157] Therefore, if the operation logs stored by the media provider contain errors or are incomplete, the operation logs collected by the log collection tool will also contain errors or are incomplete. Furthermore, Database 1 can be understood as a cache with limited storage space. As the number of operation logs stored in Database 1 increases, some of the earliest stored operation logs may be deleted. This could mean that the log collection tool may not be able to obtain all the operation logs. Consequently, it may be unable to determine relevant information regarding the missing images, such as which application's operation caused the image loss, or the reason for the image loss.

[0158] It should be noted that the embodiments in this application use images as an example for illustration. In some possible scenarios, images can also be replaced with other media files, such as videos. This application does not impose specific limitations on this.

[0159] In view of this, this application provides an information processing method. Based on image operations, in addition to storing corresponding operation logs in database 1, the electronic device can also cache operation records through a first drive. In this way, the electronic device can subsequently merge the operation records in the first cache with the operation logs in database 1, and store the merged operation logs in database 2. This allows database 2 to store more complete and accurate operation logs, facilitating the subsequent retrieval of more accurate and comprehensive operation logs from database 2, thereby aiding in determining the cause of image loss.

[0160] Optionally, the operation records cached by the first driver can be preset types of operation records. These preset types of operation records may include one or more of the following: operation records of system applications deleting images, renaming images, or moving images. Based on the above, it can be determined that the application causing image loss is most likely a system application, and image loss is usually caused by deleting, renaming, or moving images. Therefore, the first driver can cache the above preset types of operation logs. This allows the first driver to cache operation records that help determine the cause of image loss. In other words, the first driver does not need to cache all types of operation records, thus reducing the load on the electronic device.

[0161] The following is combined with Figures 5 to 9 The technical solutions of this application and how they solve the aforementioned technical problems are described in detail with specific embodiments. The following specific embodiments can be implemented independently or in combination with each other. Identical or similar concepts or processes may not be described again in some embodiments.

[0162] The embodiments shown in this application can be executed by an electronic device, a chip, chip system, or processor that supports the electronic device in implementing information processing methods, or a logic module or software capable of implementing all or part of the functions of the electronic device. This application does not impose specific limitations in this regard.

[0163] The embodiments of this application are described below using an electronic device as an example. The specific form and number of devices shown are merely examples and should not be construed as limiting the implementation of the methods provided in this application.

[0164] To facilitate understanding, the following will be combined with... Figure 5 Taking the layered architecture of the Android system as an example, this paper illustrates the software architecture of an electronic device.

[0165] Among them, the software system of electronic devices can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture.

[0166] A layered architecture divides software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into five layers, from top to bottom: the application layer, the Java framework layer, the system runtime and system libraries, and the kernel layer.

[0167] 1. Application Layer

[0168] The application layer can include a series of application packages. For example... Figure 5 As shown, an application package can include system applications and other applications.

[0169] System applications can be applications with a UID of 1000, such as system manager applications, file management applications, etc.

[0170] Other applications can be applications with a UID greater than 1000. Other applications can include third-party applications such as social applications, short video applications, and shopping applications, as well as camera applications and gallery applications.

[0171] 2. Java framework layer, also known as application framework (FWK) layer.

[0172] The Java framework layer provides application programming interfaces (APIs) and programming frameworks for applications in the application layer. The Java framework layer includes some predefined functions. For example... Figure 5 As shown, the Java framework layer can include media providers, security and privacy modules, etc.

[0173] A media provider can be understood as an important content provider that can be used to acquire and store operation logs in database 1.

[0174] Furthermore, the media provider can read information cached in the first cache and parse the information to obtain operation records of a preset type. It can also merge these preset type operation records with the operation logs in database 1, for example, by correcting the operation logs in database 1 and storing the corrected operation logs in database 2; and / or, if a corresponding operation log is missing in database 1, the operation record is stored in database 2.

[0175] The media provider can also configure the FUSE daemon.

[0176] The security and privacy module can authorize media providers to obtain application behavior information and then store operation logs based on that behavior information.

[0177] It should be understood that the process by which the security and privacy module can authorize media providers is described above and will not be repeated here.

[0178] 3. System runtime and system libraries

[0179] The system runtime includes core libraries and a virtual machine. The system runtime is responsible for scheduling and managing the Android system.

[0180] The core library consists of two parts: one part is the functionalities that need to be called by the Java language, and the other part is the Android core library.

[0181] The application layer and application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.

[0182] System libraries can include multiple functional modules. For example: surface manager, service manager, media libraries, 3D graphics processing libraries (e.g., OpenGL ES), 2D graphics engines (e.g., SGL), etc.

[0183] The Surface Manager manages the display subsystem and provides fusion of 2D and 3D layers for multiple applications.

[0184] The media library supports playback and recording of various common audio and video formats, as well as still image files. It supports multiple audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG. The media library includes an audio manager and a media player service.

[0185] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.

[0186] A 2D graphics engine is a graphics engine for 2D drawing.

[0187] 4. Kernel layer (also known as Linux Kernel)

[0188] The kernel layer is the layer between hardware and software. It drives the hardware, enabling it to function. The kernel layer includes the primary driver, display driver, screen driver, graphics processing unit (GPU) driver, FUSE driver, and more.

[0189] The FUSE driver can be a built-in FUSE driver, meaning it's compiled directly into the kernel rather than being a loadable module. This allows the FUSE driver to be used immediately upon operating system startup.

[0190] The built-in FUSE driver can wake up the FUSE daemon based on the media provider's instructions, so that the FUSE daemon and the media provider can process the target image; and it can also instruct the first driver on various operation events on the target image, such as, but not limited to: deleting the target image, creating the target image, inserting the target image, editing the target image, renaming the target image, and moving the target image.

[0191] The first driver can determine whether the operation record corresponding to the event indicated by the built-in FUSE driver is a preset type of operation record based on the built-in FUSE driver's indication. If so, the first driver can create a first thread and encapsulate the preset type of operation record to obtain information 1. Then, information 1 can be written to the first cache through the first thread. By determining whether the operation record corresponding to the event indicated by the built-in FUSE driver is a preset type of operation record, the first driver can filter the preset type of operation record so that the first cache caches the information obtained by encapsulating the preset type of operation record.

[0192] It should be understood that in the embodiments of this application, creating a first thread can also be replaced by starting a first thread, and the first thread can be one or more threads. This application does not make specific limitations in this regard.

[0193] Understandable, Figure 5 The illustrated software architecture does not constitute a specific limitation on the electronic device. In other embodiments of this application, the electronic device may include more or fewer software modules than illustrated, and the electronic device may also include more or fewer layers than illustrated.

[0194] It should be understood that Figure 5 The names of the software modules or layers included in the illustrated software structure do not constitute a specific limitation on the electronic device.

[0195] based on Figure 5 The software framework shown below, in conjunction with Figure 6 Taking APP 1 as an example, which processes the target image, and APP 1 processes the target image by deleting the target image, the process of information processing method is explained in detail.

[0196] Figure 6 This is a flowchart illustrating an information processing method 600 provided in an embodiment of this application. Figure 6 As shown, method 600 includes the following steps:

[0197] S601, APP 1 instructs the media provider to delete the target image.

[0198] S602, the media provider, based on the instructions of APP 1, instructs the built-in FUSE to delete the target image.

[0199] In this way, the built-in FUSE wakes up the FUSE daemon and instructs it to perform event 1, which is the event that deletes the target image. This allows the FUSE daemon to delete the target image.

[0200] In addition, the FUSE daemon is set up in the media provider. Based on the deletion of the target image, such as by calling the DeleteFileForFuse interface, the media provider can obtain information about the deletion of the target image by APP 1, such as the package name of APP 1, whether APP 1 has operation permissions, the file operation type of the target image (i.e., deletion), the file type of the target image, the file path, the UID of APP 1, the time of deletion of the target image, the interface name called to delete the target image, pid and tid, etc.

[0201] S603. Based on the information obtained by APP 1 to delete the target image, store the operation log 1 of APP 1 deleting the target image in database 1, and record the operation log 1 in queue 1.

[0202] Queue 1 can be understood as a queue that can record one or more operation logs obtained from database 1.

[0203] For example, for each operation log stored in database 1, the media provider can write one operation log to queue 1.

[0204] The format of Operation Log 1 can be, for example:

[0205] Package name | Permission required | File operation type | File type | File path | Application UID | File operation time | Trigger behavior interface name | pid | tid | New path.

[0206] Thus, operation log 1 can include information about APP 1 deleting the target image.

[0207] In addition to waking up the FUSE daemon, the built-in FUSE can also perform the following steps.

[0208] S604, the built-in FUSE indicates event 1 to the first driver, which is the event of deleting the target image.

[0209] For example, the built-in FUSE can indicate event 1 to the first driver by calling the fuse_vendor_hook interface.

[0210] It's understandable that the kernel might not be able to directly call external driver interfaces, meaning the built-in FUSE compiled into the kernel might not be able to directly call the first driver. Therefore, based on the Vendor Hook mechanism in the Android operating system, the first region can register a fuse_vendor_hook interface so that the built-in FUSE can call this interface. The fuse_vendor_hook interface can be understood as a vendor_hook interface related to FUSE.

[0211] S605, the first driver determines whether the file operation type for deleting the target image belongs to the preset operation type.

[0212] File operation types can include one or more of the following: delete, create, move, insert, copy, paste, edit, or rename. Preset operation types can include one or more of the following: delete, move, or rename.

[0213] Thus, the operation types in the preset operation types are those that may cause image loss.

[0214] If the file operation type for deleting the target image does not belong to the preset operation type, this process ends.

[0215] If the file operation type for deleting the target image is a preset operation type, execute steps S606 and thereafter.

[0216] S606, the first driver determines whether the target image belongs to a preset type file.

[0217] File types can include, for example, documents, images, videos, and audio. Preset file types can include, for example, images.

[0218] Furthermore, file type can also be determined by file extension. Therefore, a preset file type can also be understood as a preset extension. S606 can then be implemented in the following ways: determine whether the extension of the target image belongs to a preset extension; or, determine whether the extension of the target image belongs to whitelist 1, where whitelist 1 can be understood as a queue or information recording preset extensions.

[0219] If the target image does not belong to the preset file type, this process ends. That is, the first driver does not retrieve operation records for files other than the preset file type.

[0220] If the target image is a file of a preset type, proceed with steps S607 and thereafter.

[0221] S607, First Driver determines whether APP 1 belongs to the preset application.

[0222] The preset application may include, for example, one or more applications.

[0223] Alternatively, S607 can be implemented in any of the following ways.

[0224] Method 1: Determine if APP 1 is on the whitelist.

[0225] Among them, whitelist 2 can record information used to indicate preset applications, such as the name of each application in the preset applications, the package name of each application in the preset applications, etc.

[0226] Method 2: Determine whether the UID of APP 1 belongs to the preset UID.

[0227] The preset UID can include one or more UIDs, which are used to indicate a preset application. For example, the preset UID can be 1000. As described above, in the image loss scenario, the system application deleting the image (UID 1000) is a significant cause of the image loss. Therefore, the first driver can filter the system application's operations on the target image to more accurately and completely store the operation logs of the system application's operations on the target image in database 2, thereby facilitating the determination of the cause of the image loss.

[0228] If APP 1 is not a preset application, this process ends. That is, the first driver does not obtain operation records for applications other than preset applications.

[0229] If APP 1 is a default application, execute S608.

[0230] It should be noted that S605, S606, and S607 are the three conditional statements for the first driver to execute S608. S605, S606, and S607 can be executed in any order, or they can be executed in parallel. If one or more of the conditional statements result in a negative result, the process ends; if all three result in a positive result, S608 is executed. This application does not impose specific limitations on this.

[0231] It should also be noted that in some possible implementations, one or more of S605, S606, or S607 may be optional, allowing the first driver to record more types of operation records. For the sake of brevity, these will not be elaborated upon here.

[0232] S608, First Driver obtains APP 1's operation log for deleting target image 1.

[0233] It should be understood that, in the embodiments of this application, the operation log can be understood as information related to the APP's processing of the target image. Furthermore, the information included in the operation log may differ depending on the APP's operations on the target image.

[0234] For example, if the processing of the target image is deletion, the operation record may include: package name, PID, UID, and the filename of the target image. Then, operation record 1 may include: the package name of APP 1, the operation time, PID, UID, and the filename of the target image.

[0235] When the processing of the target image involves renaming or moving it, the operation log may include one or more of the following: package name, pid, uid, the filename of the target image before renaming, and the filename of the target image after renaming.

[0236] Alternatively, if the target image is moved, in addition to the above information, the operation log may also include: the file path before the move and the file path after the move.

[0237] S609, The first driver starts the queue worker. Starting the queue worker can also be understood as the first driver creating the first thread. The first thread can be understood as a newly started thread, meaning that subsequent steps executed by the first driver can be executed through the first thread.

[0238] It should be understood that prior to S609, the steps to be executed could be performed by threads other than the first thread. Because these other threads (the threads executing the built-in FUSE steps) have spinlocks, if subsequent steps are executed based on that thread, the media provider may be unable to read data from the first buffer correctly, as described below.

[0239] S610, the first driver encapsulates operation record 1 through the first thread and obtains information 1.

[0240] The encapsulated operation record 1 can include an encapsulated message header and a message body. Since the purpose of encapsulating operation record 1 is to cache operation record 1 in the first buffer, the encapsulated message header can also be understood as the encapsulated ring buffer header, and the first buffer can be understood as the ring buffer.

[0241] S611, the first driver writes information 1 into the first cache through the first thread.

[0242] The first cache can be understood as a circular cache, that is, a cache that is repeatedly overwritten. For example, as the amount of information cached in the first cache increases, such as when the amount of cached information reaches the maximum amount of data that the first cache can cache, as more data is written to the first cache, the earliest cached data in the first cache will be deleted.

[0243] The structure of information 1 cached in the first cache can be, for example, as follows: Figure 7 As shown. Message 1 may include a header, a control section, and a message section.

[0244] The header, also known as the message header or ring buffer header, is typically used to store metadata related to the message. This metadata helps the receiver correctly interpret and process the message. For example, the header may include: a length (len) field, which carries the byte length of message 1, and the len field can occupy 2 bits; a padding field, used to pad message 1 to meet specific format requirements, and the pad field can occupy 2 bits; a pid field, which carries the PID, and the pid field can occupy 4 bits; a tid field, which carries the tid, and the tid field can occupy 4 bits; and seconds (sec) and nanoseconds (nsec) fields, which can be understood as current time fields, and the seconds (sec) and nanoseconds (nsec) fields can each occupy 4 bits.

[0245] The control section, also known as the message control (msg ctrl) section, can include a UID field and an opcode field. The UID field carries the UID, which can occupy 4 bits; the opcode field carries information indicating the operation type, such as indicating deletion, renaming, or moving operations, and can also occupy 4 bits.

[0246] Depending on the type of operation, that is, the information carried by the opcode field, the information included in the message part may differ.

[0247] When the operation type is deletion, the message portion can include a package name field and a file name field. When the operation type is rename or move, the message portion can include: a package name field, the old file name (the file name before the move or rename), and the new file name (the file name after the move or rename). The length of the message portion in bytes is the difference between the length of the len field and 28. The package name field can, for example, carry the package name.

[0248] It should be understood that Figure 7The byte length of information 1 and the number of bits occupied by each field shown are merely examples, and the values ​​can be replaced with others, which do not constitute a limitation on the embodiments of this application.

[0249] The first driver writing information 1 to the first cache may include: determining whether the first cache is full of data; if not, it means that data can continue to be written to the first cache, then information 1 is written to the first cache, and the write position in the first cache is updated. If it is determined that the first cache is full of data, the earliest written part of the information in the first cache needs to be deleted to free up the storage space in the first cache, and then information 1 is written to the first cache.

[0250] S612, When writing data to the first cache, the first driver also wakes up the wait queue to indicate to the media provider that it can read the cached information 1 in the first cache.

[0251] It should be noted that, in order to ensure that the media provider can read data from the first buffer and the first driver can write data to the first buffer without conflict, the first thread can set a mutex lock to prevent the media provider from reading data from the first buffer and the first driver from writing data to the first buffer from occurring simultaneously. Since other threads (threads executing the built-in FUSE steps) have set spinlocks, to prevent system crashes and for the proper functioning of this process, the first driver creates a new thread to execute the step of writing data to the first buffer.

[0252] It should be understood that the wait queue can be a queue for the first driver to control whether the media provider can read information from the first cache. When the first driver wakes up the wait queue, the media provider can read information from the first cache. Since the first driver has written new information, namely information 1, to the first cache, the first driver needs to instruct the media provider to read information from the first cache; therefore, the first driver can wake up the wait queue.

[0253] It should be noted that S613 to S616 can be steps that the media provider executes continuously in a loop. That is, the media provider can continuously read information from the first cache through the media provider.

[0254] S613, Media Provider reads device node 1.

[0255] It should be noted that device node 1, or file node, can be understood as a node provided by the first driver. Device node 1 may include interfaces for reading information from the first cache and interfaces for writing information to the first cache. The media provider, by reading device node 1, can call the first driver to read information from the first cache through the interface for reading information from the first cache within device node 1.

[0256] For example, device node 1 can be represented as / dev / file_deleted, etc. The interface for reading information from the first buffer can be, for example, the logger read interface, and the interface for writing information to the first buffer can be, for example, the logger write interface. That is, the media provider can call the logger read interface to read information from the first buffer; the first thread can call the logger write interface to write information to the first buffer.

[0257] In addition, to improve the data security of cached information in the first cache, device node 1 can be set to permission 1, which allows only modules that meet preset conditions to read information in the first cache.

[0258] For example, permission 1 can be a preset group, such as rw-rv-r-1 root media_rw, making device node 1 belong to the preset group. Only modules in the same group as device node 1 can read information from the first cache. To enable the media provider to read information from the first cache, the preset group can be the group to which the media provider belongs. In this way, while allowing the media provider to read information from the first cache, other modules can be restricted from reading information from the first cache, resulting in higher data security for the cached information in the first cache.

[0259] S614. The media provider determines whether the first cache is empty. That is, it determines whether there is information in the first cache that the media provider has not read.

[0260] If the first cache is empty, S615 can be executed, which is the media provider blocking the waiting queue.

[0261] If the first cache is not empty, S616 can be executed, that is, the media provider reads information from the first cache, such as information 1.

[0262] It should be understood that a media provider can have a separate task, and the waiting queue can be understood as such a task. This task is used to read information from the first buffer. If the first buffer is not empty, this task can read information from it. When the first buffer is empty, i.e., there is no information to read, when the media provider calls the interface to read information from the first buffer, it will block the waiting queue, preventing the media provider from continuously reading information from the first buffer.

[0263] Afterwards, the media provider can read information from the first cache after the waiting queue is woken up by the first driver. That is, the media provider may block the waiting queue before the first driver writes information 1 into the first cache; then after the first driver executes S612, that is, wakes up the waiting queue, the media provider can execute S616, that is, the media provider reads information 1 from the first cache.

[0264] It should be noted that if the first cache is empty, it can also be understood that pointer 1, which indicates the location of writing data, and pointer 2, which indicates the location of reading data, point to the same location, which means that there is no unread information in the first cache.

[0265] After the first driver writes information 1 to the first cache, the position pointed to by pointer 1 changes. If pointer 1 and pointer 2 point to different positions, it means that there is unread information in the first cache.

[0266] S617, The media provider parses information 1 and obtains operation record 1.

[0267] S618, The media provider records operation record 1 in queue 2.

[0268] Queue 2 can be understood as a queue that can record one or more operation records retrieved from the first cache.

[0269] For example, the media provider writes an operation record to queue 2 for each operation record retrieved from the first cache.

[0270] S619. The media provider periodically merges the operation logs in queue 1 with the operation records in queue 2 to obtain the merged operation logs, and stores the merged operation logs in database 2.

[0271] The periodicity can be based on a first duration, such as 24 hours or 10 hours. Every first duration, the media provider merges the operation logs in queue 1 with the operation records in queue 2. After each merge, the media provider clears both the operation logs in queue 1 and the operation records in queue 2.

[0272] In one possible implementation, the merged operation log includes all operation logs in queue 1 and all operation records in queue 2.

[0273] In other words, the media provider stores all operation logs in queue 1 and all operation records in queue 2 in database 2.

[0274] In another possible implementation, S619 can be implemented as follows: Select operation logs and operation records corresponding to the same operation in queue 1 and queue 2 to obtain target operation logs and target operation records. Each target operation record corresponds one-to-one with the target operation log, and the operation time recorded in the target operation record is less than or equal to the operation time recorded in the corresponding target operation log. Correct the preset type information in the corresponding target operation log based on the preset type information in the target operation record to obtain the corrected target operation log. Store the corrected target operation log, the logs in queue 1 excluding the target operation log, and the operation records in queue 2 excluding the target operation record in database 2. The merged operation log then includes: the corrected target operation log, the logs in queue 1 excluding the target operation log, and the records in queue 2 excluding the target operation record.

[0275] It should be understood that if the operation time recorded in the target operation record is less than or equal to the operation time recorded in the corresponding target operation log, it means that the target operation record and the corresponding target operation log correspond to the same operation, such as both corresponding to the operation of deleting the target image.

[0276] For example, the media provider can determine whether operation log 1 and operation record 1 correspond to the same operation based on the operation time recorded in operation log 1 and operation record 1. If the operation time in operation log 1 and the operation time recorded in operation record 1 are less than or equal to a preset duration, it means that operation log 1 and operation record 1 correspond to the same operation; otherwise, it means that operation log 1 and operation record 1 correspond to different operations. In this way, the media provider can determine the operation logs and operation records corresponding to the same operation in queue 1 and queue 2, and obtain the target operation log and target operation record. The number of target operation logs and target operation records is equal, and this number can be 0 or a positive integer.

[0277] The preset type information is, for example, the package name. Based on the preset type information in the target operation record, the preset type information in the corresponding target operation log is corrected. For example, the preset type information in the corresponding target operation log can be replaced with the preset type information in the target operation record. For instance, replacing the package name in the corresponding target operation log with the package name in the target operation record will result in the corrected target operation log being the target operation log with the replaced package name.

[0278] Optionally, the operation records in queue 2 can be in the following format.

[0279] The format of the operation record corresponding to the deletion of the target image can be:

[0280] Package name | File name | Operation time | UID | pid | tid.

[0281] The operation log for renaming or moving a target image can be in the following format:

[0282] Package name | Old file name | New file name | Operation time | UID | pid | tid.

[0283] In this way, subsequent log collection tools can collect operation logs from database 2, and the collected operation logs are more accurate and more complete.

[0284] It should be understood that the process by which the media provider merges and corrects the operation logs in queue 1 with the operation records in queue 2 can also be called log aggregation. Furthermore, operation record 1 can also be called maintenance log, etc., and this application does not specifically limit it to that.

[0285] Building upon method 600, the media provider may include RecorderMediaBehavior.java, MediaRecordInfoManager.java, and FileOpLogReaderThread.java. RecorderMediaBehavior.java, MediaRecordInfoManager.java, and FileOpLogReaderThread.java can each be used to execute different steps performed by the media provider. For example, RecorderMediaBehavior.java, MergeRecordInfoManager.java, and FileOpLogReaderThread.java can, through method 800, store the merged operation log in database 2.

[0286] Figure 8 This is a flowchart illustrating a method 800 provided in this application embodiment for a media provider to store merged operation logs in database 2. For example... Figure 8 As shown, method 800 includes the following steps:

[0287] S801, FileOpLogReaderThread.java, reads information from the first buffer in a loop.

[0288] It should be understood that the implementation of S801 is similar to the implementation of S613 to S616, and can be referred to the description above, which will not be repeated here.

[0289] S802, FileOpLogReaderThread.java instructs MergeRecordInfoManager.java to read information 1.

[0290] For example, FileOpLogReaderThread.java can indicate the information to be read to MergeRecordInfoManager.java by calling the adFileOpLogEntry interface.

[0291] S803 and MergeRecordInfoManager.java process information 1, such as parsing information 1 to obtain operation record 1; and record operation record 1 in queue 2.

[0292] It should be understood that the implementation of S803 is similar to that of S61 and S618, as described above, and will not be repeated here.

[0293] S804, RecorderMediaBehavior.java stores operation log 1 in database 1.

[0294] S805, RecorderMediaBehavior.java directs Operation Log 1 to MergeRecordInfoManager.java.

[0295] In other words, RecorderMediaBehavior.java stores operation logs for various image operations in database 1, and also sends the stored operation logs to MergeRecordInfoManager.java.

[0296] For example, RecorderMediaBehavior.java can call the addInternalRecord interface to indicate Operation Log 1 to MergeRecordInfoManager.java.

[0297] S806, MergeRecordInfoManager.java records operation log 1 in queue 1.

[0298] It should be understood that S804 to S806 can be executed before S801 to S803, after S801 to S803, or in parallel with S801 to S803. This application does not make any specific limitations in this regard.

[0299] It should also be understood that the implementation methods of S804 to S806 are similar to those of S603, and can be referred to the description above, so they will not be repeated here. S807, MergeRecordInfoManager.java periodically merges the operation logs in queue 1 with the operation records in queue 2, and saves the merged operation logs in database 2.

[0300] It should be understood that the implementation of S807 is similar to that of S619, as described above, and will not be repeated here.

[0301] As can be seen from method 800, the media provider stores the merged operation log in database 2, which includes... Figure 9 The four processes shown are: reading information from the first cache; parsing the read information to obtain operation records; merging the operation records in queue 2 with the operation logs in queue 1 to obtain the merged operation logs; and storing the merged operation logs in database 2.

[0302] It should be understood that the sequence numbers in the above embodiments do not imply the order of execution. The execution order of each process should be determined by its function and internal logic.

[0303] The animation execution method of the embodiments of this application has been described above. The apparatus for executing the above method provided in the embodiments of this application is described below. Those skilled in the art will understand that the methods and apparatus can be combined and referenced with each other, and the related apparatus provided in the embodiments of this application can execute the steps in the above list sorting method.

[0304] To facilitate understanding this solution, we will first combine... Figure 10 The hardware structure of electronic device 1000 is described.

[0305] Figure 10 This is a schematic diagram of the structure of the electronic device 1000 provided in an embodiment of this application. Figure 10 As shown, the electronic device 1000 may include a processor 1010, an external memory interface 1020, an internal memory 1021, a universal serial bus (USB) interface 1030, a charging management module 1040, a power management module 1041, a battery 1042, an antenna 1, an antenna 2, a mobile communication module 1050, a wireless communication module 1060, an audio module 1070, a sensor module 1080, buttons 1090, an indicator 1092, a camera 1093, and a display screen 1094, etc.

[0306] The audio module 1070 may include, but is not limited to, a speaker, a receiver, a microphone, and a headphone jack. The speaker can be used to play recording prompt tones.

[0307] The sensor module 1080 may include, but is not limited to, one or more of the following sensors: pressure sensor, gyroscope sensor, barometric pressure sensor, magnetic sensor, accelerometer, distance sensor, proximity sensor, fingerprint sensor, temperature sensor, touch sensor, ambient light sensor, and bone conduction sensor, etc.

[0308] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device 1000. In other embodiments of this application, the electronic device 1000 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0309] Processor 1010 may include one or more processing units, such as: application processor (AP), modem, graphics processing unit (GPU), image signal processor (ISP), controller, video codec, digital signal processor (DSP), baseband processor, and / or neural network processing unit (NPU), etc. Optionally, processor 1010 may also include memory for storing instructions and data. The different processing units may be independent devices or integrated into one or more processors.

[0310] For example, processor 1010 may execute the steps in methods 600 and 800 above.

[0311] The wireless communication function of the electronic device 1000 can be implemented through antenna 1, antenna 2, mobile communication module 1050, wireless communication module 1060, modem processor, and baseband processor.

[0312] Electronic device 1000 implements display functions through a GPU, a display screen 1094, and an application processor. The GPU is a microprocessor for image processing, connecting the display screen 1094 and the application processor. The GPU performs mathematical and geometric calculations and is used for graphics rendering. Processor 1010 may include one or more GPUs, which execute program instructions to generate or modify display information.

[0313] The display screen 1094 is used to display images, videos, etc. In some embodiments, the electronic device 1000 may include one or N display screens 1094, where N is a positive integer greater than 1.

[0314] The external memory interface 1020 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 1000. The internal memory 1021 can be used to store computer executable program code, which includes instructions.

[0315] Figure 11 This is a schematic block diagram of an information processing device 1100 provided in an embodiment of this application. The device 1100 includes a processor 1101, a communication interface 1102, and a memory 1103. The processor 1101, communication interface 1102, and memory 1103 communicate with each other via internal connection paths. The memory 1103 stores instructions, and the processor 1101 executes the instructions stored in the memory 1103. The communication interface 1102 can be used to send signals to other devices (e.g., the processor 1101 or a touchscreen of an electronic device) and to receive signals from other devices (e.g., the memory 1103). Exemplarily, the communication interface 1102 reads instructions stored in the memory 1103 and sends the instructions to the processor 1101.

[0316] It should be understood that the device 1100 may specifically be an electronic device as described in the above embodiments, and may be used to execute the various steps and / or processes corresponding to the electronic device in the above method embodiments. Optionally, the memory 1103 may include read-only memory and random access memory, and provide instructions and data to the processor. A portion of the memory may also include non-volatile random access memory. For example, the memory may also store device type information. The processor 1101 may be used to execute instructions stored in the memory, and when the processor 1101 executes instructions stored in the memory, the processor 1101 is used to execute the various steps and / or processes of the above method embodiments.

[0317] It should be understood that, in the embodiments of this application, the processor may be a central processing unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc.

[0318] In implementation, each step of the above method can be completed by integrated logic circuits in the processor's hardware or by instructions in software. The steps of the method disclosed in the embodiments of this application can be directly manifested as execution by a hardware processor, or as a combination of hardware and software modules within the processor. The software modules can reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. This storage medium is located in memory, and the processor executes the instructions in the memory, combining them with its hardware to complete the steps of the above method. To avoid repetition, detailed descriptions are omitted here.

[0319] The information processing method provided in this application can be applied to electronic devices with communication functions. Electronic devices include terminal devices, and the specific device form of the terminal device can be referred to the above-described related descriptions, which will not be repeated here.

[0320] This application provides an electronic device, which includes a processor and a memory; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory, causing the electronic device to perform the above-described method.

[0321] This application provides a chip. The chip includes a processor, which calls a computer program in memory to execute the technical solutions in the above embodiments. Its implementation principle and technical effects are similar to those in the related embodiments described above, and will not be repeated here.

[0322] This application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program. When the computer program is executed by a processor, it implements the methods described above. The methods described in the above embodiments can be implemented wholly or partially by software, hardware, firmware, or any combination thereof. If implemented in software, the functionality can be stored as one or more instructions or code on or transmitted over the computer-readable medium. The computer-readable medium can include computer storage media and communication media, and can also include any medium that can transfer a computer program from one place to another. The storage medium can be any target medium accessible by a computer.

[0323] In one possible implementation, a computer-readable medium may include RAM, ROM, compact disc read-only memory (CD-ROM) or other optical disc storage, disk storage or other magnetic storage devices, or any other medium targeted to carry or to store the required program code in the form of instructions or data structures, and accessible by a computer. Furthermore, any connection is appropriately referred to as a computer-readable medium. For example, if software is transmitted from a website, server, or other remote source using coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave, then coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are included in the definition of medium. As used herein, disks and optical discs include optical discs, laser discs, optical discs, Digital Versatile Discs (DVDs), floppy disks, and Blu-ray discs, where disks typically reproduce data magnetically, while optical discs optically reproduce data using lasers. Combinations of the above should also be included within the scope of computer-readable media.

[0324] This application provides a computer program product, which includes a computer program that, when run, causes a computer to perform the above-described method.

[0325] This application describes embodiments of methods, apparatus (systems), and computer program products according to embodiments of this application with reference to flowchart illustrations and / or block diagrams. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processing unit of a general-purpose computer, special-purpose computer, embedded processor, or other programmable device to produce a machine, such that the instructions, which execute via the processing unit of the computer or other programmable data processing device, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0326] The above specific embodiments further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made on the basis of the technical solution of the present invention should be included within the scope of protection of the present invention.

Claims

1. An information processing method, characterized in that, Applied to electronic devices, the method includes: Perform the first processing on the first file; Based on the first processing of the first file, a first log is stored in a first database, and a second log is cached; the first log and the second log include information related to the first file and / or the first processing, and the first log and the second log include preset type information; The preset type information in the first log is corrected based on the second log, and the corrected log is stored in the second database; and / or, the first log and the second log are stored in the second database.

2. The method according to claim 1, characterized in that, The first process is performed by a first application in the electronic device; The cached second log includes: If the first condition is met, cache the second log. The first condition includes one or more of the following: The first application belongs to the preset type of application; The first file belongs to a preset type file; or, The first processing method belongs to the preset type processing method.

3. The method according to claim 1 or 2, characterized in that, The step of correcting the preset type information in the first log based on the second log includes: If the preset type information in the first log is different from the preset type information in the second log, the preset type information in the first log is replaced with the preset type information in the second log to obtain the corrected log.

4. The method according to any one of claims 1 to 3, characterized in that, The first log includes the first moment when the electronic device performs the first processing, and the second log includes the second moment when the electronic device performs the first processing; The step of correcting the preset type information in the first log based on the second log includes: If the interval between the first time point and the second time point is less than or equal to a preset duration, the preset type information in the first log is corrected based on the second log.

5. The method according to any one of claims 1 to 4, characterized in that, The first log includes the first moment when the electronic device performs the first processing, and the second log includes the second moment when the electronic device performs the first processing; The step of storing the second log in the second database includes: If it is determined that the interval between the first time point and the second time point is greater than a preset duration, the first log and the second log are stored in the second database.

6. The method according to any one of claims 1 to 5, characterized in that, The electronic device includes a first driver and a media provider, wherein the first log is stored through the media provider and the second log is cached through the first driver.

7. The method according to claim 6, characterized in that, The second log is cached in the first cache; The preset type information in the first log is corrected based on the second log, and the corrected log is stored in the second database; Alternatively, the first log and the second log can be stored in the second database, including: The media provider retrieves the second log from the first cache; The media provider corrects the preset type information in the first log based on the second log and stores the corrected log in the second database; and / or stores the first log and the second log in the second database.

8. The method according to any one of claims 1 to 7, characterized in that, The first processing is performed by a first application in the electronic device, and the preset type information includes the package name of the installation package of the first application.

9. The method according to claim 8, characterized in that, The first application is the application whose user identifier (UID) is the first value.

10. An electronic device, characterized in that, The electronic device includes: one or more processors and a memory; the memory is coupled to the one or more processors, the memory being used to store computer program code, the computer program code including computer instructions, and the one or more processors invoking the computer instructions to cause the electronic device to perform the method as described in any one of claims 1 to 9.

11. A chip system, characterized in that, The chip system is applied to an electronic device, the chip system including one or more processors, the one or more processors being used to invoke computer instructions to cause the electronic device to perform the method as described in any one of claims 1 to 9.

12. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes computer instructions that, when executed on an electronic device, cause the electronic device to perform the method as described in any one of claims 1 to 9.

13. A computer program product, characterized in that, The computer program product includes computer program code that, when run on an electronic device, causes the electronic device to perform the method as described in any one of claims 1 to 9.