Data processing method and apparatus, and electronic device
Patent Information
- Application Number
- PCT/CN2025/121304
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2025-03-27
- Filing Date
- 2025-09-15
- Publication Date
- 2026-10-01
Smart Images

Figure CN2025121304_01102026_PF_FP_ABST
Abstract
Description
Data processing methods, apparatus and electronic equipment
[0001] This application claims priority to Chinese Patent Application No. 202510378162.7, filed on March 27, 2025, entitled "Method, Apparatus and Electronic Device for Data Processing", the entire contents of which are incorporated herein by reference. Technical Field
[0002] This application relates to electronic device technology, and more specifically, to a method, apparatus and electronic device for data processing. Background Technology
[0003] Users can process data in the form of files, audio, video, and images through electronic devices. This data is usually processed in applications, and the speed at which this data is opened affects the efficiency of data processing.
[0004] Therefore, improving data processing efficiency to enhance user experience is an urgent problem to be solved. Summary of the Invention
[0005] This application provides a data processing method, apparatus, and electronic device. The method can improve data processing efficiency, thereby enhancing the user experience.
[0006] In a first aspect, a data processing method is provided, which is applied to an electronic device. The method includes: determining a first data from N data based on data information of N data, wherein the data information includes one or more of the following: data type, data size, historical update time, and historical usage frequency, wherein N is a positive integer greater than or equal to 1; preloading the first data to obtain a first loading result; and displaying a display interface of the first data based on the first loading result in response to user input of the first data.
[0007] For example, the data can be files, audio, video, images, etc.
[0008] Based on the above scheme, electronic devices can filter out the data that needs to be preloaded and parse the data in advance before the user opens it to obtain the loading result. This allows the electronic device to immediately display the data's interface (which may include the data's content) when the user opens the data, thereby shortening the data opening time, improving data processing efficiency, and enhancing the user experience.
[0009] In conjunction with the first aspect, in some implementations of the first aspect, the electronic device includes a first acceleration application for displaying the first data; wherein, before preloading the first data to obtain a first loading result, the method further includes: launching the first acceleration application in the background of the electronic device.
[0010] Based on the above solution, if an acceleration application is registered on the electronic device, it can be hidden in the background and then launched before data parsing, so as not to affect the user's operation in the foreground of the electronic device.
[0011] In conjunction with the first aspect, in some implementations of the first aspect, the preloading of the first data to obtain a first loading result includes: obtaining a handle to the first data; and preloading the first data according to the handle to obtain the first loading result.
[0012] For example, taking file data as an example, the handle of the first data can be a file handle.
[0013] Based on the above solution, by sharing file handles, applications can quickly identify files that need to be preloaded and parse them in advance, thus shortening file opening time while ensuring the security of user data.
[0014] In conjunction with the first aspect, in some implementations of the first aspect, before determining the first data from the N data based on the data information of the N data, the method further includes: determining L data from the M data based on the data information of the M data, where M is a positive integer greater than or equal to 1, and L is a positive integer less than or equal to M; wherein, determining the first data from the N data based on the data information of the N data includes: determining P data from the N data based on the data information of the N data, where P is a positive integer less than or equal to N; and determining the first data from the N data when the L data does not include the first data and the P data includes the first data.
[0015] Based on the above scheme, it can be determined whether the first data is preloaded data by comparing the data lists. P data points can be understood as the first data list, and L data points as the original data list. By comparing the first data list and the original data list, it can be determined that the first data is in the first data list but not in the original data list, thus confirming that the first data is preloaded data.
[0016] In conjunction with the first aspect, in some implementations of the first aspect, before determining the first data from the N data based on the data information of the N data, the method further includes: preloading the second data in the L data to obtain a second loading result; the method further includes: canceling the preloading of the second data when the P data do not include the second data.
[0017] Based on the above scheme, the L data points can be understood as the original data list, and the second data point in the L data points is the data that originally needed to be preloaded. The specific data included in the data list can change continuously. By comparing the new data list with the original data list, the data that is no longer in the new data list is the data that needs to be de-preloaded. De-preloading the second data point can free up electronic device memory and reduce memory usage.
[0018] In conjunction with the first aspect, in some implementations of the first aspect, before determining the first data from the N data based on the data information of the N data, the method further includes: determining that a triggering event has been detected, the triggering event including one or more of the following: the local device downloads or receives data through an application, the local device obtains data from other devices, data is created through the local device, data is modified through the local device, and the local device is powered on.
[0019] Based on the above scheme, the triggering event can be any situation where data changes. Whenever a triggering event occurs, data that needs to be preloaded can be selected from one or more data sets.
[0020] In conjunction with the first aspect, in some implementations of the first aspect, the historical usage frequency of the P data is greater than or equal to a preset usage frequency threshold; or the data size of the P data is greater than or equal to a preset data size threshold; or the time difference between the historical update time and the current time of the P data is less than or equal to a preset time difference threshold.
[0021] Based on the above schemes, P data points can be filtered and arranged according to historical usage frequency. The higher the historical usage frequency, the higher the priority of the data, placing it at the top of the list for priority preloading of frequently used data. Alternatively, P data points can be filtered and arranged according to data size. Again, the larger the data size, the higher the priority of the data, placing it at the top of the list for priority preloading of larger data. Alternatively, P data points can be filtered and arranged according to historical update time. The smaller the time interval between the historical update time and the current time, the higher the priority of the data, placing it at the top of the list for priority loading of the most recently updated data.
[0022] In conjunction with the first aspect, in some implementations of the first aspect, the first preload result is the display interface of the first data.
[0023] For example, the display interface of the first data can be the content of the first data. Taking file data as an example, the display interface of the first data can be the content of the file.
[0024] Based on the above solution, the first data can be preloaded before the user triggers the electronic device to display the first data interface, resulting in a first preloaded result. This first preloaded result can be either the display interface of the first data or intermediate data used to obtain the display interface. When the first preloaded result is intermediate data, the speed of opening the data can be improved to some extent. When the first preloaded result is the display interface of the first data, the electronic device can immediately display the data interface when the user triggers the operation to open the data, further improving the speed of opening the data.
[0025] Secondly, a data processing apparatus is provided, comprising: an accelerated decision engine for determining first data from N data based on data information of N data, the data information including one or more of data type, data size, historical update time, and historical usage frequency, wherein N is a positive integer greater than or equal to 1; a first accelerated application for preloading the first data to obtain a first loading result; and the first accelerated application for displaying a display interface of the first data in response to user input of the first data, based on the first loading result.
[0026] In conjunction with the second aspect, in some implementations of the second aspect, the device also includes an accelerated application management module for launching the first accelerated application in the background of the device.
[0027] In conjunction with the second aspect, in some implementations of the second aspect, the device also includes a cross-process file handle management module for obtaining the handle of the first data; the first acceleration application is specifically used to preload the first data according to the handle of the first data to obtain the first loading result.
[0028] In conjunction with the second aspect, in some implementations of the second aspect, the device further includes an information acquisition module, used to determine L data points from the M data points based on the data information of the M data points, where M is a positive integer greater than or equal to 1, and L is a positive integer less than or equal to M; the information acquisition module is specifically used to determine P data points from the N data points based on the data information of the N data points, where P is a positive integer less than or equal to N; the accelerated decision engine is specifically used to determine the first data point from the N data points when the L data points do not include the first data point and the P data points include the first data point.
[0029] In conjunction with the second aspect, in some implementations of the second aspect, the first acceleration application is further configured to preload the second data among the L data to obtain a second loading result; and to cancel the preloading of the second data if the P data do not include the second data.
[0030] In conjunction with the second aspect, in some implementations of the second aspect, the information acquisition module is also used to determine that a triggering event has been detected, the triggering event including one or more of the following: the local device downloads or receives data through an application, the local device obtains data from other devices, data is created through the local device, data is modified through the local device, and the local device is powered on.
[0031] In conjunction with the second aspect, in some implementations of the second aspect, the historical usage frequency of the P data is greater than or equal to a preset usage frequency threshold; or the data size of the P data is greater than or equal to a preset data size threshold; or the time difference between the historical update time and the current time of the P data is less than or equal to a preset time difference threshold.
[0032] In conjunction with the second aspect, in some implementations of the second aspect, the first preload result is the display interface of the first data.
[0033] Thirdly, an electronic device is provided, comprising: one or more processors; one or more memories; the one or more memories storing one or more computer programs, the one or more computer programs including instructions that, when executed by the one or more processors, cause the electronic device to perform the methods of the first aspect and any possible implementation thereof.
[0034] Fourthly, a data processing apparatus is provided, comprising: a processor coupled to a memory for storing a computer program, the processor for running the computer program, such that the data processing apparatus performs the method described in the first aspect and any possible implementation thereof.
[0035] In conjunction with the fourth aspect, some implementations of the fourth aspect also include one or more of the memory and the transceiver, the transceiver being used to receive and / or transmit signals.
[0036] Fifthly, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a computer, causes the computer to perform the data processing method described in the first aspect and any of the methods achievable in the first aspect.
[0037] In a sixth aspect, a computer program product containing instructions is provided, which, when run on a computer, causes the computer to perform the data processing method described in the first aspect and any of the data processing methods achievable in the first aspect.
[0038] In a seventh aspect, a chip is provided, the chip including a processor and a data interface, the processor reading instructions stored in a memory through the data interface to execute the data processing method described in the first aspect and any of the data processing methods achievable in the first aspect.
[0039] In conjunction with the seventh aspect, in one possible implementation, the processor is coupled to the memory via an interface.
[0040] In conjunction with the seventh aspect, in one possible implementation, the chip system further includes a memory in which computer programs or computer instructions are stored. Attached Figure Description
[0041] Figure 1 is a schematic diagram of the structure of an electronic device.
[0042] Figure 2 is a software structure block diagram of the electronic device provided in an embodiment of this application.
[0043] Figure 3 is a schematic diagram of a pre-loaded file provided in an embodiment of this application.
[0044] Figure 4 is a schematic diagram of a system architecture provided in an embodiment of this application.
[0045] Figure 5 is a schematic diagram of a scenario provided by an embodiment of this application.
[0046] Figure 6 is a schematic flowchart of a data processing method provided in an embodiment of this application.
[0047] Figure 7 is a schematic flowchart of a data processing method provided in an embodiment of this application.
[0048] Figure 8 is a schematic diagram of a specific implementation process provided in an embodiment of this application.
[0049] Figure 9 is a schematic flowchart of a data processing method provided in an embodiment of this application.
[0050] Figure 10 is a schematic block diagram of a data processing apparatus provided in an embodiment of this application. Detailed Implementation
[0051] The technical solutions in this application will now be described with reference to the accompanying drawings.
[0052] The terminology used in the following embodiments is for the purpose of describing particular embodiments only and is not intended to be limiting of this application. As used in the specification and appended claims of this application, the singular expressions “a,” “an,” “the,” “the,” “the,” and “this” are intended to also include expressions such as “one or more,” unless the context clearly indicates otherwise. It should also be understood that in the following embodiments of this application, “at least one” and “one or more” refer to one, two, or more than two. The term “and / or” is used to describe the relationship between related objects, indicating that three relationships may exist; for example, A and / or B can indicate: 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 be represented as: a, b, c, a and b, a and c, b and c, or a, b, and c, where a, b, and c can be a single or multiple.
[0053] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0054] The following describes an electronic device, a user interface for such an electronic device, and embodiments for using such an electronic device. In some embodiments, the electronic device may be a portable electronic device that also includes other functions such as a personal digital assistant and / or music player, such as a mobile phone, tablet computer, wearable electronic device with wireless communication capabilities (such as a smartwatch), etc. Exemplary embodiments of the portable electronic device include, but are not limited to, those equipped with Harmony. Alternatively, it could be a portable electronic device with another operating system. The aforementioned portable electronic device could also be other portable electronic devices, such as laptops. It should also be understood that in some other embodiments, the aforementioned electronic device may not be a portable electronic device, but rather a desktop computer.
[0055] For example, Figure 1 shows a schematic diagram of the structure of an electronic device 100. The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, a sensor module 180, buttons 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an accelerometer sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0056] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 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.
[0057] Processor 110 may include one or more processing units, such as: application processor (AP), modem processor, graphics processing unit (GPU), image signal processor (ISP), controller, memory, video codec, digital signal processor (DSP), baseband processor, and / or neural network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0058] The controller can be the nerve center and command center of the electronic device 100. The controller can generate operation control signals according to the instruction opcode and timing signals to complete the control of fetching and executing instructions.
[0059] The processor 110 may also include a memory for storing instructions and data.
[0060] In some embodiments, the processor 110 may include one or more interfaces. Interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0061] The wireless communication function of electronic device 100 can be realized through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor, etc.
[0062] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals.
[0063] The mobile communication module 150 can provide solutions for wireless communication, including 2G / 3G / 4G / 5G, applied to the electronic device 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc.
[0064] A modem processor may include a modulator and a demodulator. The modulator modulates the low-frequency baseband signal to be transmitted into a mid-to-high frequency signal. The demodulator demodulates the received electromagnetic wave signal into a low-frequency baseband signal.
[0065] The wireless communication module 160 can provide solutions for wireless communication applications on the electronic device 100, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR) technology, etc.
[0066] In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, enabling electronic device 100 to communicate with networks and other devices via wireless communication technology. The wireless communication technology may include Global System for Mobile Communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Time-Division Code Division Multiple Access (TD-CDMA), Long Term Evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technologies, etc. The GNSS may include the Global Positioning System (GPS), the Global Navigation Satellite System (GLONASS), the BeiDou Navigation Satellite System (BDS), the Quasi-Zenith Satellite System (QZSS), and / or satellite-based augmentation systems (SBAS).
[0067] Electronic device 100 implements display functions through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. Processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.
[0068] Display screen 194 is used to display images, videos, etc. Display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a MiniLED, a MicroLED, a Micro-OLED, a quantum dot light-emitting diode (QLED), etc.
[0069] Electronic device 100 can perform shooting functions through ISP, camera 193, video codec, GPU, display 194 and application processor.
[0070] The ISP is used to process the data fed back by the camera 193.
[0071] Camera 193 is used to capture still images or videos.
[0072] A digital signal processor is used to process digital signals. In addition to processing digital image signals, it can also process other digital signals.
[0073] Video codecs are used to compress or decompress digital video.
[0074] NPU stands for Neural-Network (NN) Computing Processor. By drawing inspiration from the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it can quickly process input information and continuously learn on its own.
[0075] The external storage interface 120 can be used to connect an external storage card, such as a Micro SD card, to expand the storage capacity of the electronic device 100.
[0076] Internal memory 121 can be used to store computer executable program code, which includes instructions.
[0077] Electronic device 100 can implement audio functions through audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, and application processor.
[0078] The audio module 170 is used to convert digital audio information into analog audio signal output, and also to convert analog audio input into digital audio signal.
[0079] The loudspeaker 170A, also known as a "loudspeaker", is used to convert audio electrical signals into sound signals.
[0080] The receiver 170B, also known as the "earpiece", is used to convert audio electrical signals into sound signals.
[0081] Microphone 170C is used to convert sound signals into electrical signals.
[0082] The pressure sensor 180A is used to sense pressure signals and can convert pressure signals into electrical signals.
[0083] The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can utilize the characteristics of the collected fingerprints to achieve fingerprint unlocking, accessing application locks, taking photos with fingerprints, answering calls with fingerprints, etc.
[0084] The 180K touch sensor is also known as a "touch panel".
[0085] Figure 2 is a software structure block diagram of an electronic device 100 according to an embodiment of this application. The layered architecture divides the software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, [the following is omitted as the text is incomplete and requires further context]. The system is divided into four layers, from top to bottom: the application layer, the application framework layer, the system library layer, and the kernel layer. The application layer can include a series of application packages.
[0086] As shown in Figure 2, the application layer can include camera, settings, skin modules, user interface (UI), and third-party applications. Third-party applications can include gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, and SMS.
[0087] The application framework layer provides application programming interfaces (APIs) and programming frameworks for applications in the application layer. The application framework layer may include some predefined functions.
[0088] As shown in Figure 2, the application framework layer may include a window manager, content provider, view system, phone manager, resource manager, notification manager, etc.
[0089] The window manager is used to manage windowed applications. It can obtain the screen size, determine if a status bar is present, lock the screen, and capture screenshots. The content provider stores and retrieves data, making this data accessible to applications. This data may include videos, images, audio, made and received phone calls, browsing history and bookmarks, phone books, etc.
[0090] A view system includes visual controls, such as controls for displaying text and controls for displaying images. View systems can be used to build applications. A display interface can consist of one or more views.
[0091] The phone manager is used to provide communication functions for electronic device 100. For example, it manages call status (including connection and disconnection).
[0092] The file explorer provides applications with various resources, such as localized strings, icons, images, layout files, video files, and more.
[0093] The notification manager allows applications to display notifications in the status bar. These notifications can be used to deliver informational messages and can disappear automatically after a short pause, requiring no user interaction. For example, the notification manager can be used to notify users of completed downloads or message alerts. The notification manager can also display notifications as icons or scrolling text in the top status bar, such as notifications from background applications, or as dialog boxes on the screen. Examples include displaying text messages in the status bar, emitting sounds, vibrating electronic devices, and flashing indicator lights.
[0094] System libraries can include multiple functional modules. For example: surface manager, media libraries, 3D graphics processing libraries (e.g., OpenGL ES), 2D graphics engines (e.g., SGL), etc.
[0095] The Surface Manager is used to manage the display subsystem and provides the blending of 2D and 3D layers for multiple applications.
[0096] 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.
[0097] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0098] A 2D graphics engine is a graphics engine for 2D drawing.
[0099] In addition, the system library may also include status monitoring service modules, such as a physical status recognition module for analyzing and recognizing user gestures; and a sensor service module for monitoring sensor data uploaded by various sensors at the hardware layer to determine the physical status of the electronic device 100.
[0100] The kernel layer is the layer between hardware and software. The kernel layer contains at least the display driver, camera driver, audio driver, and sensor driver.
[0101] The hardware layer can include various types of sensors, such as those shown in Figure 1.
[0102] Based on the electronic devices described in Figures 1 and 2 above, in the embodiments of this application, the electronic device can be a personal computer, tablet computer, smart screen, mobile terminal, or other electronic device that can run applications and support data processing functions such as files, videos, audio, and images.
[0103] Today, users can process data such as files, images, audio, and video through various electronic devices. Taking files as an example, when users open files on electronic devices, they often have to wait for a period of time, and the larger the file, the slower the opening speed, which affects the user's file processing experience.
[0104] To shorten the user's waiting time during file opening, Figure 3 illustrates a method of preloading files, where files on the disk are cached in memory. When application process 1 opens a file, it can read the file directly from memory instead of from the disk, thus reducing the application's file reading time and shortening the user's waiting time during file opening.
[0105] Even with the method of pre-caching files from disk to memory, when an application opens the file, it still needs to parse and display the file content. The process of waiting for the file to open is only complete when the content is displayed to the user. Parsing the file content still takes a significant amount of time, and pre-caching the file in memory does not reduce the time required for the electronic device to parse the file content. Furthermore, after caching, the application cannot use the cached file until it starts. However, in reality, users may launch applications by opening files, meaning that application launch and file reading on an electronic device may be a continuous process without any intermediate steps for the application to pre-read the file.
[0106] Based on this, embodiments of this application provide a data processing method, apparatus, and electronic device. Taking file data processing as an example, by sensing changes in the file, the device pushes files that the user might open to the acceleration application, allowing the acceleration application to pre-parse the file content (pre-load the file). When the user opens the file, the electronic device can directly display the file content, saving the time required for the file parsing process. Simultaneously, to ensure the security of user data, the acceleration application can be pre-parsed by sharing the file handle. Furthermore, if the acceleration application is not running, it can be hidden and launched in the background, allowing the file content to be pre-parsed without affecting the user's foreground operations.
[0107] The following will use a document as an example to introduce the data processing method provided in the embodiments of this application.
[0108] Figure 4 illustrates a system architecture diagram provided in an embodiment of this application. This system architecture can be applied to electronic devices such as personal computers, tablets, and mobile terminals. The system architecture includes a system acceleration service module, a task management module, a process management module, a file management module, a detection module, and a memory management module. The main steps in the data processing method provided in this embodiment can be executed by the system acceleration service module. The functions of each module are described below.
[0109] For example, the system acceleration service module includes an information acquisition module, an acceleration application management module, a cross-process file handle management module, an acceleration decision engine, and a maintainability design (design for X, DFX) module.
[0110] The information collection module determines whether file changes have occurred and generates a file list when changes occur. This list includes files selected by the information collection module based on the collected file information that need to be preloaded. These files can be prioritized. The information collection module can then send this file list to the acceleration decision engine. The information collection module can also determine file changes through the file management module and / or the detection module. When changes occur, the file management module and / or the information collection module can notify the information collection module. The file management module can subscribe to and / or push various types of files, including but not limited to recently opened files, while the detection module can detect whether files have changed.
[0111] The accelerated decision engine can determine whether files need to be preloaded based on a list of files. Specifically, the accelerated decision engine includes a recommendation engine and a rejection engine. The recommendation engine manages recommended files, i.e., files that need to be preloaded; the rejection engine manages rejected files, i.e., files that are no longer required to be preloaded.
[0112] After receiving a file list from the information collection module, the accelerated decision engine compares it with the original recommended file list. Files no longer in the list are added to the discard list, and files in the discard list will no longer be preloaded. Newly added files are added to the recommended file list, and files in the recommended list will be preloaded. When a new file is added, the accelerated decision engine determines that it needs to be preloaded. The accelerated decision engine can send newly added files or files no longer in the list to the cross-process file handle management module. The accelerated decision engine can also detect the current system memory usage and application memory consumption through the memory management module, and can stop preloading files or actively discard files when memory is insufficient.
[0113] The cross-process file handle management module is used to open or close files and obtain file handles. For example, when opening a newly added file in the file list, the module obtains the file handle and sends it to the acceleration application management module through the acceleration decision engine; or when closing a file that is no longer in the file list, the module obtains the file handle and sends it to the acceleration application management module through the acceleration decision engine.
[0114] The Accelerated Application Management module manages accelerated applications and is responsible for inter-process communication with these applications. When the acceleration decision engine determines that files need to be preloaded, it notifies the Accelerated Application Management module, which can then determine whether the accelerated application is running through the process management module. When an accelerated application is not running but files need to be preloaded, the Accelerated Application Management module calls the process management module to hide and launch the accelerated application in the background. While the accelerated application is hidden and launched in the background, it can be managed through the task management module. For example, a notification can be displayed near the accelerated application to indicate that it is accelerating or that its files are being preloaded. The Accelerated Application Management module can send file handles to the accelerated application so that it can determine which files need to be preloaded or which files need to be canceled from preloading.
[0115] The DFX module is used to collect statistics on accelerated applications, preloaded files (acceleration files), accelerated memory usage, accelerated hit rate, and other measurement information.
[0116] In addition, the system acceleration service module provides a variety of interfaces, including the native application programming interface (NAPI) and the native development kit (NDK) interface.
[0117] The NAPI interface is used to enable interaction between ArkTS (Ark TypeScript) / TS (TypeScript) / JS (JavaScript) and C / C++.
[0118] The NDK interface can specifically include interfaces that implement four functions. First, it can be called by third-party application programs or system applications to register as an accelerated application or to unregister as an accelerated application. Second, it can notify the accelerated application of files that need to be preloaded or files that need to be unpreloaded. Third, it can be used by the accelerated application management module to determine the status of the accelerated application and whether files can be preloaded. Fourth, after a file is preloaded, if the user subsequently opens the file, this interface can notify the accelerated application management module of the acceleration hit notification, so as to statistically analyze the hit rate of file opening accelerated using the data processing method provided in this application embodiment.
[0119] The system acceleration service module also provides an inner application programming interface (inner_api). Through the inner_api interface, the system acceleration service module can send information about the accelerated application and preloaded files to the task manager, so that the task manager can display a prompt to remind the user of the application being accelerated.
[0120] It should be noted that the division of the modules in the system architecture shown in Figure 3 is only an exemplary division in terms of logic or function, and this application does not limit it.
[0121] In the data processing method provided in this application embodiment, when a file change is determined by the system acceleration service module, a file list is generated and recommended to the acceleration application so that the acceleration application can preload the files and parse the file content in advance. To ensure security, the system acceleration service module opens the file that needs to be preloaded by sharing a file handle, and shares the file handle with the acceleration application through inter-process communication so that the acceleration application can parse the file content in advance. Furthermore, in scenarios where the user may open the file (e.g., when a file change occurs), the acceleration application is first launched in the background and the file content is parsed in advance to shorten the time it takes to open the file and improve the user experience.
[0122] Figure 5 illustrates a scenario provided by an embodiment of this application. This scenario primarily includes a user and an electronic device (e.g., a personal computer), and demonstrates a process for improving file opening speed.
[0123] For example, the first step is that the user starts the electronic device, and the electronic device activates the acceleration service, meaning the electronic device will use the data processing method provided in this application embodiment to improve the speed of opening files. The second step is that the electronic device begins to predict and preload files, that is, the electronic device predicts the files the user will open and preloads these files. The third step is that the user opens a file and edits it in the foreground, and the electronic device immediately displays the file content in response. That is, when the user opens a preloaded file, since the file content has been parsed in advance, the electronic device will immediately display the file content. The fourth step is that the user closes the file in the foreground, indicating that the file has been edited, and the electronic device will continue to predict and preload files. It can be understood that when the electronic device displays file content in the foreground, it means the user is editing the file, and to avoid interfering with the user's editing operation, the electronic device can pause the acceleration service; when the electronic device closes the file in the foreground, it can continue the acceleration service. The fifth step is that the user closes the electronic device or disables the acceleration service, and the electronic device disables the acceleration service and releases memory.
[0124] It is understood that the acceleration service provided by the electronic device in this application embodiment will be applicable to acceleration scenarios, and can also be understood as scenarios in which the user may open files, including various scenarios where files change.
[0125] For example, downloading or receiving files from an application.
[0126] For example, receiving files via email or downloading files via a browser.
[0127] For example, obtaining files from other electronic devices.
[0128] For example, copying and pasting files across devices, and unzipping files through the file management module.
[0129] For example, create a new file on the local electronic device.
[0130] For example, save as a file within the application, or create and save a new file within the application.
[0131] For example, the file content is changed on the local electronic device.
[0132] For example, you can edit and save a previously used file within the application.
[0133] For example, an electronic device is powered on.
[0134] For example, files that were used by an electronic device before it was last shut down may still be used by the user after the device is turned on again.
[0135] The data processing method provided in the embodiments of this application will be described in detail below with reference to the accompanying drawings.
[0136] Figure 6 shows a schematic flowchart of a data processing method provided in an embodiment of this application. This method can be applied to the system architecture shown in Figure 4. The method will be described in detail below.
[0137] S601, when a trigger event is detected, file list 1 is generated, which includes file 1.
[0138] For example, a triggering event can be an event that causes a file change. Triggering events are used to trigger the acceleration service. Triggering events include, but are not limited to, one of the following: powering on an electronic device, changing file content on the local electronic device, creating a new file on the local electronic device, obtaining a file from another electronic device, downloading or receiving a file from an application, etc.
[0139] For example, when the file management module and / or detection module detects a triggering event, they notify the system acceleration service module.
[0140] For example, the system acceleration service module can filter out the files that need to be preloaded based on the file information. The files that need to be preloaded can be arranged according to a certain priority, thus obtaining file list 1.
[0141] In one implementation, the file information includes the file type, and the system acceleration service module filters out the files that need to be preloaded based on the file type.
[0142] For example, when the acceleration application is a document editing application, document files (with the extension .doc or .docx), spreadsheet files (with the extension .xlxs), presentation files (with the extension .ppt), and compressed files (with the extension .rar or .zip) can be filtered as files that need to be preloaded.
[0143] For example, when the acceleration application is an audio and video editing application, video files (with extensions such as .mp4 or .asf), audio files (with extensions such as .mp3 or .wav), and image files (with extensions such as .jpg or .png) can be filtered as files that need to be preloaded.
[0144] Understandably, the system acceleration service module may select different files to preload based on file type depending on the type of application being accelerated.
[0145] It is understandable that the system acceleration service module includes an NDK interface, which third-party applications or system applications can use to register as accelerated applications.
[0146] In one implementation, the file information includes the file size, and the system acceleration service module filters out the files that need to be preloaded based on the file size.
[0147] For example, a preset file size threshold can be set. When the file size is smaller than the preset threshold, the time required to open the file is relatively short even without preloading. To save power, smaller files do not need to be preloaded. Files with a size greater than or equal to the preset threshold are files that need to be preloaded.
[0148] In one implementation, the file information includes the file's historical update time, and the system acceleration service module filters out the files that need to be preloaded based on the time difference between the file's historical update time and the current time.
[0149] For example, the file's historical update time includes, but is not limited to, the file's creation time, modification time, and opening time. By setting a preset time difference threshold, if the time difference between the file's historical update time and the current time is less than or equal to the preset time difference threshold, it indicates that the file is a file recently used by the user and belongs to the file that needs to be preloaded.
[0150] In one implementation, the file information includes the file's historical usage frequency, and the system acceleration service module filters out the files that need to be preloaded based on the file's historical usage frequency.
[0151] For example, a preset usage frequency threshold can be set. If the historical usage frequency of a file is greater than or equal to the preset usage frequency threshold, it means that the file is a file that users use frequently and belongs to the pre-loaded files.
[0152] In one implementation, the system acceleration service module can determine the order of each file in the file list based on the file type.
[0153] For example, the higher the match between the file type and the type of the accelerated application, the higher the priority of the file, and the higher it will be in the file list. Files with higher priority will be parsed first.
[0154] In one implementation, the system acceleration service module can determine the order of each file in the file list based on the file size.
[0155] For example, the larger the file, the longer it takes to parse the file content, the higher its priority, and the higher it is in the file list. Files with higher priority will be parsed first.
[0156] In one implementation, the system acceleration service module can determine the order of each file in the file list based on the file's historical update time.
[0157] For example, file history update times include, but are not limited to, file creation time, file modification time, and file opening time. The closer a file's history update time is to the current time, the higher its priority, the higher it appears in the file list, and the higher the priority of parsing file content will be.
[0158] In one implementation, the system acceleration service module can determine the order of each file in the file list based on the historical usage frequency of the files.
[0159] For example, the more frequently a file is used in the past, the more likely the user is to use that file, the higher its priority, and the higher it appears in the file list. Files with higher priority will be parsed first.
[0160] For example, a file list can be generated each time a trigger event is detected, and the specific files included in the generated file list may change each time. Comparing the new file list with the original recommended file list, newly added files are those that need to be preloaded, requiring the application to pre-parse their content. Files no longer in the new file list are those that no longer need to be pre-loaded, and the application does not need to pre-parse their content. For the above two situations, there may be two implementation methods, including steps S602 and S605. This application embodiment does not limit the specific execution order of these two implementation methods. The two implementation methods are described in detail below.
[0161] In one implementation, S602, the newly added file 1 is determined by comparing file list 1 with the original recommended file list.
[0162] For example, the system acceleration service module compares file list 1 with the original recommended file list and determines that file 1 was not included in the original recommended file list, but is included in the newly generated file list 1, meaning file 1 is a newly added file. When a newly added file exists, the system acceleration service module determines that the newly added file 1 is a file that needs to be preloaded, that is, it determines that acceleration service needs to be provided.
[0163] For example, when the system acceleration service module determines that acceleration services need to be provided, depending on whether the acceleration application has been started, there are two situations as shown in steps S603 and S604:
[0164] Optionally, S603, when the acceleration application is not started, the background hidden launches the acceleration application and opens file 1 to obtain the file handle of file 1.
[0165] For example, "accelerator application not started" can be understood as the accelerator application not running in the background. For the accelerator application to parse file content in advance, it needs to be started first. To avoid launching the accelerator application interfering with the user's current operations on the electronic device, it can be hidden and launched in the background first, allowing the accelerator application to preload files.
[0166] For example, while the acceleration application is hidden in the background of the electronic device, the system acceleration service module can open file 1 that needs to be preloaded and obtain the file handle of file 1. Here, the file handle can be understood as a file identifier. In the data processing method provided in this application embodiment, the acceleration application can use the file handle to perform operations such as reading, writing, and locating the file.
[0167] Optionally, S604, when the acceleration application starts, opens file 1 and obtains the file handle of file 1.
[0168] For example, when the acceleration application has been started, the system acceleration service module can open file 1 that needs to be preloaded and obtain the file handle of file 1.
[0169] S605 sends the file handle of file 1 to the acceleration application, and the acceleration application preloads file 1.
[0170] For example, there is a correspondence between file handles and files. When the acceleration application obtains the file handle of file 1, it can determine that the file that needs to be preloaded is file 1, thereby enabling the early parsing of the content of file 1.
[0171] It is understandable that the file handle of the same file can be different for different processes. The data processing method provided in this application embodiment allows the system acceleration service module to preload the corresponding file by sharing the file handle, thereby improving file opening speed while ensuring the security of user data.
[0172] In one implementation, S606, by comparing file list 1 with the original recommended file list, it is determined that the original recommended file list includes file 2, but file list 1 does not include file 2.
[0173] For example, the system acceleration service module compares file list 1 with the original recommended file list and determines that file 2 is included in the original recommended file list, but not in file list 1. That is, file 2 was originally a file that needed to be preloaded, but is not currently a preloaded file, and therefore does not require acceleration service.
[0174] S607, close file 2 and send the file handle of file 2 to the acceleration application.
[0175] For example, the acceleration application in step S607 may be the same as or different from the acceleration application in step S605.
[0176] S608, accelerate application to stop preloading file 2.
[0177] For example, after determining that file 2 no longer needs to be preloaded, the system service acceleration module first closes file 2 and sends the file handle of file 2 to the acceleration application. The acceleration application, which had previously preloaded file 2, can determine that file 2 is the file that needs to be unpreloaded after receiving the file handle.
[0178] Understandably, the system acceleration service module disables files that do not need to be preloaded and causes the acceleration application to also cancel the preloading of the file by sharing the file handle, thus freeing up memory while ensuring the security of user data.
[0179] During the above process, when a trigger event is detected, a file list 1 is generated, which includes at least one file that needs to be preloaded. The system acceleration service module compares file list 1 with the original recommendation list to determine newly added files that need to be preloaded, and files that need to be de-preloaded. For newly added files that need to be preloaded, the system acceleration service module opens the file and shares its file handle with the acceleration application, allowing the acceleration application to parse the file content in advance. For files that need to be de-preloaded, the system acceleration service module closes the file and shares its file handle with the acceleration application, allowing the acceleration application to cancel the preloading of that file.
[0180] It should be noted that the above process is only an example. In reality, there may be multiple scenarios each time a triggering event occurs. Several possible scenarios are described below.
[0181] In one implementation, by comparing the file list 1 generated in step S601 above with the original recommended file list, it is determined that there are files that need to be preloaded, but no files that need to be deprecated.
[0182] In one implementation, by comparing the file list 1 generated in step S601 above with the original recommended file list, it is determined that there are no files that need to be preloaded, but there are files that need to be canceled from preloading.
[0183] In one implementation, after a trigger event occurs, a file list 1 is first generated. By comparing file list 1 with the original recommended file list, it is determined that the newly added file 1 is a file that needs to be preloaded. The system acceleration service module opens file 1 and shares the file handle of file 1 (e.g., file handle 1) with acceleration application 1. Acceleration application 1 pre-parses the content of file 1. As time goes by, file 1 remains unchanged for an extended period. When the trigger event occurs again, a file list 2 is generated. By comparing file list 2 with file list 1 (equivalent to the original recommended file list), it is determined that file 1 is not in file list 2. The system acceleration service module closes file 1 and shares the file handle of file 1 (e.g., file handle 2) with acceleration application 1. Acceleration application 1 then cancels the pre-parsing of the content of file 1.
[0184] Although the processes are different, the file handles of the same file may be different. However, in the example above, file handle 1 and file handle 2 are for the same file 1 and the same process of the same acceleration application 1, so file handle 1 and file handle 2 can be the same.
[0185] In one implementation, the electronic device includes multiple acceleration applications, which may need to preload the same file. When the same file needs to be pre-parsed by different acceleration applications, the system acceleration service module opens the file and shares the file handle with each of the different acceleration applications, allowing them to pre-parse the same file. The file handles obtained by the different acceleration applications for the same file can be different.
[0186] For example, the electronic device includes acceleration application 1 and acceleration application 2, both of which are document editing applications. The system acceleration service module determines that file 1 needs to be preloaded. After opening file 1, it obtains the file handle of file 1. The system acceleration service module shares the file handle of file 1 (e.g., file handle 1) with acceleration application 1 and shares the file handle of file 1 (e.g., file handle 2) with acceleration application 2. Acceleration application 1 uses file handle 1 to determine that the preloaded file is file 1, and acceleration application 2 uses file handle 2 to determine that the preloaded file is file 1. File handle 1 and file handle 2 can be different. Of course, if acceleration application 1 and acceleration application 2 are not yet started, they need to be hidden in the background and then brought back up.
[0187] Figure 7 shows a schematic flowchart of a data processing method provided in an embodiment of this application. This method can be applied to the system architecture shown in Figure 4, involving the interaction between various functional modules. The method will be described in detail below.
[0188] S701, the file management module and / or detection module determine that the file has changed.
[0189] For example, a change in a file can be understood as a triggering event, including but not limited to turning on an electronic device, changing the file content on the local electronic device, creating a new file on the local electronic device, obtaining a file from another electronic device, or downloading or receiving a file from an application.
[0190] S702, the file management module and / or detection module send notification information 1, and correspondingly, the information collection module receives notification information 1.
[0191] S703, the information collection module generates file list 1 based on notification information 1.
[0192] For example, the information acquisition module registers trigger events (i.e., file change events) with the file management module and / or detection module. When a trigger event occurs, the file management module and / or detection module notify the information acquisition module. When a file change occurs, the information acquisition module generates a file list 1. File list 1 includes files that need to be preloaded, selected by the information acquisition module based on the acquired file information, and these files can be arranged according to a certain priority.
[0193] In one implementation, the file information includes the file type, and the information collection module filters out the files that need to be preloaded based on the file type.
[0194] In another implementation, the file information includes the file size, and the information collection module filters out the files that need to be preloaded based on the file size.
[0195] In one implementation, the information collection module can determine the order of each file in the file list based on the file type.
[0196] In another implementation, the information collection module can determine the order of each file in the file list based on the file size.
[0197] S704, the information acquisition module sends file list 1, and correspondingly, the acceleration decision engine receives file list 1.
[0198] For example, each time a trigger event is detected, the information collection module can generate a file list, and the specific files included in the generated file list will change each time. Comparing the new file list with the original recommended file list, newly added files are those that need to be pre-loaded, requiring the application to pre-parse their content. Files no longer in the new file list are those that no longer need to be pre-loaded, and the application does not need to pre-parse their content. For the above two situations, there may be two implementation methods, including steps S705 and S714. This application embodiment does not limit the specific execution order of these two implementation methods.
[0199] In one implementation, S705, the accelerated decision engine determines the new file 1 by comparing file list 1 with the original recommended file list.
[0200] For example, the acceleration decision engine can determine whether a file needs to be loaded based on a list of files. Specifically, the acceleration decision engine includes a recommendation engine and a rejection engine. The recommendation engine is responsible for managing recommended files, i.e., files that need to be preloaded; the rejection engine is responsible for managing rejected files, i.e., files that are canceled from preloading.
[0201] For example, after receiving file list 1 from the information collection module, the accelerated decision engine compares it with the original recommended file list. File 1, newly added to the file list, is then added to the recommended file list, and the files in the recommended file list will be preloaded. When a new file is added, the accelerated decision engine determines that files need to be preloaded.
[0202] S706, the accelerated decision engine sends notification information 2, and correspondingly, the accelerated application management module receives notification information 2.
[0203] For example, when the acceleration decision engine determines that there is a new file, that is, when it determines that acceleration services need to be provided, it can send notification message 2 to notify the corresponding module to provide acceleration services.
[0204] Optionally, notification information 2 may include file 1 that needs to be preloaded.
[0205] S707, the accelerated application management module determines whether the accelerated application should be started based on notification information 2 through the cross-process management module.
[0206] For example, the accelerated application management module can determine which files need to be preloaded based on notification information 2 from the accelerated decision engine. Before preloading the files, the accelerated application management module needs to determine whether the accelerated application is running.
[0207] Optionally, the accelerated application management module can determine which applications are accelerated applications through the NDK interface, and determine whether the accelerated applications are started through the process management module.
[0208] S708: When the acceleration application is not started, the acceleration application management module calls the process management module to hide and launch the acceleration application in the background.
[0209] For example, when the acceleration application is not running, but files need to be preloaded for it, the acceleration application management module calls the process management module to hide and launch the acceleration application in the background. Furthermore, while the acceleration application is hidden and launched in the background, it can be managed through the task management module. For instance, a notification can be displayed near the acceleration application to indicate that it is accelerating or that its files are being preloaded.
[0210] Understandably, hiding the acceleration application in the background can prevent the foreground launch of the acceleration application from affecting the user's current operation on the electronic device.
[0211] S709, the accelerated decision engine sends notification information 2, and correspondingly, the cross-process file handle management module receives notification information 2.
[0212] Optionally, notification information 2 may include file 1 that needs to be preloaded.
[0213] S710, the cross-process file handle management module opens file 1 and obtains the file handle of file 1.
[0214] For example, after receiving notification information 2 from the acceleration decision engine, the cross-process file handle management module can open file 1 that needs to be preloaded and obtain the file handle of file 1.
[0215] S711, the cross-process file handle management module sends the file handle of file 1, and correspondingly, the acceleration decision engine receives the file handle of file 1.
[0216] S712, the accelerated decision engine sends the file handle of file 1, and correspondingly, the accelerated application management module receives the file handle of file 1.
[0217] For example, the cross-process file handle management module forwards the file handle of file 1 to the accelerated application management module through the accelerated decision engine.
[0218] S713, the accelerated application management module sends the file handle of file 1 to the accelerated application.
[0219] For example, the accelerated application management module is responsible for inter-process communication with the accelerated application. When file 1 needs to be preloaded, the file handle of file 1 can be sent to the accelerated application so that the accelerated application can preload file 1, thereby enabling the early parsing of the content of file 1.
[0220] Understandably, sharing file handles allows applications to preload relevant files, improving file opening speed while ensuring the security of user data.
[0221] In one implementation, S714, the accelerated decision engine determines, by comparing file list 1 with the original recommended file list, that the original recommended file list includes file 2, while file list 1 does not include file 2.
[0222] For example, after receiving file list 1 from the information collection module, the accelerated decision engine can compare it with the original recommended file list. File 2, which is no longer in the file list, will be added to the eliminated file list, and files in the eliminated file list will not be loaded.
[0223] Optionally, the acceleration decision engine can also detect the current system memory usage and application memory consumption through the memory management module, and can stop preloading files or actively discard files when memory is insufficient.
[0224] S715, the accelerated decision engine sends notification information 3, and correspondingly, the cross-process file handle management module receives notification information 3.
[0225] For example, when the acceleration decision engine determines that there are files to be eliminated, that is, when it determines that there are files that need to be canceled from preloading, it can send notification message 3 to notify the corresponding module to cancel the preloading of the file.
[0226] Optionally, notification information 3 includes file 2.
[0227] S716, the cross-process file handle management module closes file 2 and obtains the file handle of file 2.
[0228] For example, after receiving notification information 3 from the acceleration decision engine, the cross-process file management module can close the preloaded file 2 and obtain the file handle of file 2.
[0229] S717, the cross-process file handle management module sends the file handle of file 2, and correspondingly, the acceleration decision engine receives the file handle of file 2.
[0230] S718, the accelerated decision engine sends the file handle of file 2, and correspondingly, the accelerated application management module receives the file handle of file 2.
[0231] For example, the cross-process file handle management module forwards the file handle of file 2 to the accelerated application management module through the accelerated decision engine.
[0232] S719, the accelerated application management module sends the file handle of file 2 to the accelerated application.
[0233] For example, the acceleration application management module is responsible for inter-process communication with the acceleration application. When file 2 needs to be canceled from preloading, the file handle of file 2 can be sent to the acceleration application so that the acceleration application can cancel the preloading of file 2.
[0234] It is understandable that the data processing method shown in Figure 7 is only an example. In practice, there may be multiple situations each time a triggering event occurs. For specific possible implementation methods, please refer to the above. To avoid redundancy, it will not be repeated here.
[0235] For ease of understanding, Figure 8 shows a schematic diagram of a specific implementation process provided by an embodiment of this application.
[0236] For example, upon detecting a trigger event and before the acceleration application is started, the acceleration application management module first calls the process management module to launch acceleration application 1 from a hidden background window. The process management module then calls the task management module to display a notification near the acceleration application, indicating to the user that the application is being accelerated. Furthermore, the acceleration application management module sends the file handle of file 1, which needs to be preloaded, to acceleration application 1 via inter-process communication. Acceleration application 1, while launched from the background, pre-parses the content of file 1. When the user opens file 1 using acceleration application 1, acceleration application 1 is launched in the foreground and directly displays the content of file 1. When the user closes acceleration application 1 from the foreground, the next round of acceleration service will begin.
[0237] Figure 9 shows a schematic flowchart of a data processing method provided in an embodiment of this application. This method can be applied to the system architecture shown in Figure 4. The method will be described in detail below.
[0238] S901, based on the data information of N data, determine the first data from the N data. The data information includes at least one or more of the following: data type, data size, historical update time, and historical usage frequency, where N is a positive integer greater than or equal to 1.
[0239] For example, the data in the embodiments of this application includes, but is not limited to, one of the following: files, audio, video, images, etc.
[0240] Optionally, taking file data as an example, the data information can be file information, which includes one or more of the following: file type, file size, historical update time, and historical usage frequency.
[0241] For example, the information collection module in the system acceleration service module selects at least one piece of data from N pieces of data based on the data information, such as the first piece of data.
[0242] Optionally, the system acceleration service module can arrange one or more filtered data items into a first data list according to a certain priority. For example, the file list 1 mentioned above.
[0243] Optionally, the information collection module filters out at least one file based on the file information and generates a file list.
[0244] In one implementation, when a trigger event occurs, the information collection module can generate a first data list.
[0245] For example, before determining the first data from the N data based on the data information of the N data, it is determined that a triggering event has been detected. The triggering event includes one or more of the following: the local device downloads or receives data through an application, the local device obtains data from other devices, data is created through the local device, data is modified through the local device, and the local device is powered on.
[0246] In other words, the aforementioned triggering event can be a situation where data changes.
[0247] For example, when the file management module and / or detection module determine that a triggering event has been detected, they can notify the information acquisition module so that the acquisition module can determine a first data list based on the data information.
[0248] In one implementation, one or more data items in the first data list are obtained by filtering according to certain conditions and arranged in a certain priority order.
[0249] For example, the first data list includes one or more data items, and the historical usage frequency of the one or more data items is greater than or equal to a preset usage frequency threshold. At least one data item in the first data list is arranged in a first order, and the at least one data item includes a first data item and a second data item, wherein the first data item is located at a first position in the first data list, the second data item is located at a second position in the first data list, the historical usage frequency of the first data item is greater than the historical usage frequency of the second data item, and the priority of the first position is higher than the priority of the second position.
[0250] In other words, at least one piece of data in the first data list can be arranged according to its historical usage frequency. The higher the historical usage frequency, the higher the priority of the data, and it will be placed at the beginning of the first data list so that data with high usage frequency can be preloaded first.
[0251] For example, the first data list includes one or more data items, and the size of the one or more data items is greater than or equal to a preset data size threshold. At least one data item in the first data list is arranged in a first order, and the at least one data item includes a first data item and a second data item, wherein the first data item is located at a first position in the first data list, and the second data item is located at a second position in the first data list. The size of the first data item is greater than the size of the second data item, and the priority of the first position is higher than the priority of the second position.
[0252] In other words, at least one piece of data in the first data list can be arranged according to its size. The larger the data size, the higher the priority of the data, and it will be placed at the beginning of the first data list so that larger data can be preloaded first.
[0253] For example, the first data list includes one or more data items, and the data type of the one or more data items matches the type of the accelerated application function program with a degree greater than or equal to a preset matching threshold. At least one data item in the first data list is arranged in a first order, and the at least one data item includes first data and second data, wherein the first data is located in a first position in the first data list, and the second data is located in a second position in the first data list. The matching degree between the data type of the first data and the type of the accelerated application is higher than the matching degree between the data type of the second data and the type of the accelerated application, and the priority of the first position is higher than the priority of the second position.
[0254] In other words, at least one piece of data in the first data list can be arranged according to the degree of matching or correlation between the data type and the type of the accelerated application. The higher the degree of matching, the higher the priority of the data, and it will be placed at the beginning of the first data list so as to preload data with a more matching type.
[0255] For example, the first data list includes one or more data, and the time difference between the historical update time of the one or more data and the current time of the historical update time of at least one data in the first data list is less than or equal to a preset time difference threshold. The at least one data in the first data list is arranged in a first order, and the at least one data includes first data and second data. The first data is located in the first position of the first data list, and the second data is located in the second position of the first data list. The time difference between the historical update time of the first data and the current time is a first value, and the time difference between the historical update time of the second data and the current time is a second value. The first value is less than the second value, and the priority of the first position is higher than the priority of the second position.
[0256] In other words, at least one piece of data in the first data can be sorted according to the difference between the historical update time and the current time. The smaller the difference, the higher the priority of the data, and it will be placed at the beginning of the first data list so that the data recently used by the user can be preloaded.
[0257] For example, the first data could be file 1 as described above.
[0258] In one implementation, it can be determined whether the first data is preloaded data by comparing the data list.
[0259] For example, before determining the first data from N data based on the data information of N data, L data can be determined from M data based on the data information of M data, where M is a positive integer greater than or equal to 1, and L is a positive integer less than or equal to M. More specifically, P data can be determined from N data based on the data information of N data, where P is a positive integer less than or equal to N; if the first data is not included in the L data and the first data is included in the P data, the first data is determined from the N data.
[0260] In the above, P data points can be understood as the first data list, and L data points can be understood as the original data list. By comparing the first data list and the original data list, it is determined that the first data point is in the first data list, but not in the original data list, thus identifying the first data point as preloaded data.
[0261] Optionally, the original data list is the original recommended file list mentioned above. Each time a trigger event is detected, the information collection module generates a file list, and the specific files included in the generated file list change each time. By comparing the new file recommendation list with the original file recommendation list, the newly added files are those that need to be pre-loaded, requiring the application to parse their content in advance. The information collection module sends the generated first data list to the acceleration decision engine. The acceleration decision engine determines that the first data list is the newly added data, i.e., the pre-loaded data, by comparing the first data list with the original data list.
[0262] For example, before determining the first data from N data points based on the data information of N data points, the second data from L data points is preloaded to obtain the second loading result. If the second data is not included in the P data points, the preloading of the second data is canceled.
[0263] For example, the second data could be file 2 as described above.
[0264] Optionally, the original data list is the original recommended file list mentioned above. Each time a trigger event is detected, the information collection module generates a file list, and the specific files included in the generated file list change each time. By comparing the new file list with the original recommended file list, files no longer in the new recommended file list are those that need to be de-preloaded. The information collection module sends the generated first data list to the accelerated decision engine. The accelerated decision engine, by comparing the first data list with the original data list, determines that the second data is data not in the first data list. If the second data is data that originally needed to be pre-loaded, then the pre-loading of the second data needs to be canceled.
[0265] S902, preload the first data to obtain the first loading result.
[0266] Optionally, one or more acceleration applications can be registered on the electronic device. If the acceleration application is not started, it needs to be hidden and launched in the background before parsing the data.
[0267] For example, the electronic device includes a first acceleration application, which is used to display a display interface for first data. Before preloading the first data and obtaining the first loading result, the first acceleration application needs to be launched in the background of the electronic device.
[0268] Optionally, when the acceleration decision engine determines that the newly added first data is preloaded data, it can notify the acceleration application through the acceleration application manager. When the acceleration application is not running, it can be hidden and launched in the background through the process management module.
[0269] In one implementation, taking file data as an example, the application can be accelerated to parse the first data in advance and obtain the first loading result by sharing the file handle.
[0270] For example, obtain the handle of the first data; preload the first data according to the handle of the first data to obtain the first loading result.
[0271] Optionally, taking file data as an example, the handle of the first data can be the file handle of file 1 as described above. The cross-process file handle management module receives file 1 from the acceleration decision engine, opens file 1, and obtains the file handle of file 1. The cross-process file handle management module sends the file handle of file 1 to the acceleration application management module through the acceleration decision engine. The acceleration application management module sends the file handle of file 1 to the first acceleration application (such as acceleration application 1 as described above) through inter-process communication. Acceleration application 1 determines that file 1 is a preloaded file based on the file handle of file 1, and parses file 1 in advance to obtain the specific content of file 1.
[0272] For example, for second data that needs to be unloaded, a handle to the second data can be obtained; the preloading of the second data can be unloaded based on the handle of the second data.
[0273] Optionally, taking file data as an example, the handle of the second data can be the file handle of file 2 as described above. The cross-process file handle management module receives file 2 from the acceleration decision engine, closes file 2, and obtains the file handle of file 2. The cross-process file handle management module sends the file handle of file 2 to the acceleration application management module through the acceleration decision engine. The acceleration application management module sends the file handle of file 2 to the first acceleration application (such as acceleration application 1 as described above) through inter-process communication. Acceleration application 1 determines that file 2 is a file to be canceled from preloading based on the file handle of file 2, thereby canceling the pre-parsing of file 2.
[0274] As can be seen, by sharing file handles, applications can be accelerated to preload or cancel the preloading of corresponding files, which improves file opening speed while ensuring the security of user data.
[0275] S903, in response to the user's input of the first data, displays the display interface of the first data according to the first loading result.
[0276] Optionally, the first preload result can be a display interface of the first data.
[0277] For example, the display interface of the first data can be the content of the first data. Taking file data as an example, the display interface of the first data can be the content of the file.
[0278] As can be seen, if the electronic device anticipates that the user may open the first data before the user performs the operation of opening the first data, it can parse the first data in advance so that the electronic device can immediately display the display interface of the first data when the user opens it, thus shortening the time required to open the data.
[0279] The data processing method provided in this application accelerates the push of data that a user might open by sensing changes in the data, allowing the accelerated application to parse the data content in advance. When the user opens the data, the electronic device can directly display the data content (e.g., the data display interface), saving the time required for the data parsing process. Simultaneously, to ensure the security of user data, a file handle can be shared with the accelerated application, enabling the accelerated application to parse the corresponding content in advance. Furthermore, if the accelerated application is not running, it can be hidden and launched in the background, parsing the data content in advance without affecting the user's foreground operations.
[0280] Figure 10 is a schematic block diagram of a data processing apparatus according to an embodiment of this application. The data processing apparatus 1000 shown in Figure 10 may include a processor 1010, a transceiver 1020, and a memory 1030. The processor 1010, transceiver 1020, and memory 1030 are connected via internal interconnection paths. The memory 1030 is used to store instructions, and the processor 1010 is used to execute the instructions stored in the memory 1030 to receive / send some parameters via the transceiver 1020. Optionally, the memory 1030 may be coupled to the processor 1010 via an interface or integrated with the processor 1010.
[0281] In implementation, each step of the above method can be completed by the integrated logic circuitry of the hardware in the processor 1010 or by instructions in software form. The method disclosed in the embodiments of this application can be directly implemented by the hardware processor, or by a combination of hardware and software modules in 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 1030, and the processor 1010 reads the information in memory 1030 and, in conjunction with its hardware, completes the steps of the above method. To avoid repetition, detailed descriptions are not provided here.
[0282] It should also be understood that, in embodiments of this application, the memory may include read-only memory and random access memory, and provides instructions and data to the processor. A portion of the processor may also include non-volatile random access memory. For example, the processor may also store device type information.
[0283] This application provides a computer program product that, when run on a device, causes the device to execute the technical solutions described in the above embodiments. Its implementation principle and technical effects are similar to those of the related embodiments described above, and will not be repeated here.
[0284] This application provides a readable storage medium containing instructions that, when executed on a device, cause the device to perform the technical solutions described in the above embodiments. The implementation principle and technical effects are similar and will not be repeated here.
[0285] This application provides a chip for executing instructions. When the chip is running, it executes the technical solutions described in the above embodiments. Its implementation principle and technical effects are similar and will not be repeated here.
[0286] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the embodiments of this application.
[0287] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the above-described device and unit (module) can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0288] In the several embodiments provided in this application, it should be understood that the disclosed devices, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0289] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0290] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0291] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, essentially or in other words, the parts that contribute to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0292] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method of data processing, characterized by, The method is applied to an electronic device, and the method includes: Based on the data information of N data, a first data is determined from the N data. The data information includes one or more of the following: data type, data size, historical update time, and historical usage frequency, where N is a positive integer greater than or equal to 1. The first data is preloaded to obtain the first loading result; In response to the user's input of the first data, the display interface of the first data is displayed according to the first loading result.
2. The method of claim 1, wherein, The electronic device includes a first acceleration application, which is used to display the display interface of the first data; Before preloading the first data to obtain the first loading result, the method further includes: The first acceleration application is launched in the background of the electronic device.
3. The method of claim 2, wherein, The step of preloading the first data to obtain the first loading result includes: Obtain the handle of the first data; The first data is preloaded based on the handle of the first data to obtain the first loading result.
4. The method according to any one of claims 1 to 3, characterized in that, Before determining the first data from the N data based on the data information of the N data, the method further includes: Based on the data information of M data points, determine L data points from the M data points, where M is a positive integer greater than or equal to 1, and L is a positive integer less than or equal to M; The step of determining the first data from the N data based on the data information of the N data includes: Based on the data information of the N data, determine P data from the N data, where P is a positive integer less than or equal to N; If the first data is not included in the L data and the first data is included in the P data, the first data is determined from the N data.
5. The method of claim 4, wherein, Before determining the first data from the N data based on the data information of the N data, the method further includes: The second data among the L data is preloaded to obtain the second loading result; The method further includes: In the case that the P data do not include the second data, Cancel preloading of the second data.
6. The method according to any one of claims 1 to 5, characterized in that, Before determining the first data from the N data based on the data information of the N data, the method further includes: A triggering event has been detected, and the triggering event includes one or more of the following: This device downloads or receives data through an application, obtains data from other devices, creates new data, modifies data, and powers on.
7. The method according to claim 4 or 5, characterized in that, The historical usage frequency of the P data points is greater than or equal to a preset usage frequency threshold; or The size of the P data items is greater than or equal to a preset data size threshold; or The time difference between the historical update time and the current time of the P data is less than or equal to a preset time difference threshold.
8. The method according to any one of claims 1 to 7, characterized in that, The first preload result is the display interface of the first data.
9. An electronic device, comprising: include: One or more processors; One or more memory units; The one or more memories store one or more computer programs, the one or more computer programs including instructions that, when executed by the one or more processors, cause the electronic device to perform the method of any one of claims 1 to 8.
10. An apparatus for data processing, characterized by include: A processor coupled to a memory for storing a computer program, the processor for running the computer program such that the data processing apparatus performs the method as described in any one of claims 1 to 8.
11. The apparatus for data processing of claim 10, wherein, It also includes one or more of the memory and transceiver, the transceiver being used to receive and / or transmit signals.
12. A computer-readable storage medium, characterized in that, It stores a computer program that, when executed by a computer, causes the computer to perform the method as described in any one of claims 1 to 8.
13. A computer program product comprising instructions, characterized in that, When the computer program product is run on a computer, it causes the computer to perform the method as described in any one of claims 1 to 8.
14. A chip, characterized by The chip includes a processor and a data interface, wherein the processor reads instructions stored in the memory through the data interface to execute the method as described in any one of claims 1 to 8.