File processing method, electronic device and storage medium

By using file monitoring process grouping and batch sending file paths to GRPC thread pool in Windows operating system, the problem of delay in search request response is solved, and more efficient search request processing is achieved.

CN118349519BActive Publication Date: 2025-03-04HONOR DEVICE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410311808.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-03-18
Publication Date
2025-03-04
Estimated Expiration
2044-03-18

AI Technical Summary

Technical Problem

In the Windows operating system, in the face of a large number of files and frequent file changes, the search request response delay of the smart search function has increased significantly, resulting in the user interface displaying load animations for a long time.

Method used

The file monitoring process uses serial method to send file paths to the GRPC thread pool in batches to ensure that the GRPC thread pool will not be fully occupied. Even if a search request is received during the file processing process, the search request does not need to be queued and the search request is processed first.

Benefits of technology

It avoids search response delays due to large number of files and frequent changes, improves search request processing efficiency and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118349519B_ABST
    Figure CN118349519B_ABST
Patent Text Reader

Abstract

The present application discloses a file processing method, an electronic device and a storage medium, which belongs to the field of terminal technology. The file processing method is applied to an electronic device, including: scanning a disk of the electronic device through a file monitoring process to obtain multiple file paths; grouping multiple file paths through the file monitoring process to obtain multiple groups of file paths, each group of file paths contains at least one file path; using a serial method through the file monitoring process, sending multiple groups of file paths in batches to a cross-language communication thread pool, the cross-language communication thread pool is used to communicate between file monitoring processes and file compression packages written in different computer languages; when each group of file paths is received through the cross-language communication thread pool, a group of file paths is read from the cross-language communication thread pool through the file compression package.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] Currently, faced with the situation of a large number of files and frequent file changes in the Windows operating system, the smart search function on the system faces a challenge: the response delay of the search request increases significantly, causing the user interface to display the loading animation for a long time.

[0003] This is because the number of threads for processing files is limited. When a large number of files need to be processed, new search requests need to wait in line and cannot be processed in time. This resource limitation ultimately leads to response delays for search requests, affecting the user experience. Summary of the invention

[0004] The present application provides a file processing method, an electronic device and a storage medium. The file processing method can send the file paths to the GRPC thread pool in batches in a serial manner through the file monitoring process. After the file compression package takes out a group of file paths from the GRPC thread pool, the file monitoring process executes and sends the next group of file paths to the GRPC thread pool. In this way, the GRPC thread pool will not be full. Even if the GRPC thread pool receives a search request during the file processing process, the search request does not need to wait in line, and the search request can be processed first, avoiding search response delays caused by a large number of files and frequent changes, and improving the processing efficiency of search requests.

[0005] The technical solution is as follows:

[0006] The first aspect of the present application provides a file processing method, which is applied to an electronic device, comprising:

[0007] Scanning the disk of the electronic device through a file monitoring process to obtain multiple file paths;

[0008] The plurality of file paths are grouped by the file monitoring process to obtain a plurality of groups of file paths, each group of file paths including at least one file path;

[0009] The file monitoring process adopts a serial mode to send the multiple groups of file paths in batches to a cross-language communication thread pool, wherein the cross-language communication thread pool is used for communication between the file monitoring process and the file compression package written in different computer languages;

[0010] When each set of file paths is received by the cross-language communication thread pool, the set of file paths is read from the cross-language communication thread pool through the file compression package.

[0011] By adopting the above-mentioned file processing method, when the file monitoring process sends multiple file paths to the underlying file compression package, the multiple file paths are grouped to obtain multiple groups of file paths, and the multiple groups of file paths are sent in batches in a serial manner to the communication intermediary: the GRPC thread pool. After each group of file paths is sent, the file compression package reads the group of file paths from the cross-language communication thread pool, and repeats the execution of sending the next group of file paths to the GRPC thread pool until all the file paths scanned this time are sent and processed, thereby optimizing the file processing process and ensuring the continuity of file path transmission and processing.

[0012] Since the file monitoring process uses a serial method to send file paths to the GRPC thread pool in groups and batches, after the file compression package takes out a group of file paths from the GRPC thread pool, the file monitoring process executes and sends the next group of file paths to the GRPC thread pool. In this way, the GRPC thread pool will not be full. Even if the GRPC thread pool receives a search request during the file processing process, the search request does not need to wait in line, and the search request can be processed first, avoiding search response delays caused by a large number of files and frequent changes, and improving the processing efficiency of search requests.

[0013] According to the first aspect, or any implementation of the first aspect above, after reading the set of file paths from the cross-language communication thread pool through the file compression package, the method further includes:

[0014] Returning a first response message to the cross-language communication thread pool through the file compression package, where the first response message is used to indicate that the file compression package successfully reads the set of file paths;

[0015] When the first response message is received through the cross-language communication thread pool, a second response message is returned to the file monitoring process through the cross-language communication thread pool, where the second response message is used to instruct the file monitoring process to send the next set of file paths to the cross-language communication thread pool.

[0016] In this implementation, through the above response mechanism, when the file monitoring process receives the second response message from the GRPC thread pool, it indicates that the previous set of file paths has been successfully processed. At this time, the file monitoring process will continue to send the next set of file paths to the thread pool, and then repeat the above file processing steps until all file paths are sent out and processed. This can ensure the order and effectiveness of file processing and avoid delays in search requests due to thread resource limitations.

[0017] According to the first aspect, or any implementation of the first aspect above, the method further includes:

[0018] When the file monitoring process receives the second response message, sending the next set of file paths to the cross-language communication thread pool through the file monitoring process; or

[0019] When the file monitoring process waits for a preset period of time and still has not received the second response message, the next set of file paths is sent to the cross-language communication thread pool, and the waiting starting point of the file monitoring process is the successful sending of the set of file paths.

[0020] In this implementation, when the file monitoring process receives the second response message from the GRPC thread pool, it indicates that the previous set of file paths has been successfully processed. At this point, the file monitoring process will continue to send the next set of file paths to the thread pool, and then repeat the above file processing steps until all file paths are sent out and processed, thereby optimizing the file processing and search efficiency of the entire system.

[0021] In addition, the above implementation method also adds a timeout processing mechanism to ensure that even when communication delays or other problems occur, that is, the file monitoring process does not receive the second response message after waiting for a preset period of time, the file monitoring process can continue to work, and the file processing and search process will not stagnate, thereby improving the robustness and processing efficiency of the entire system.

[0022] According to the first aspect, or any implementation of the first aspect above, before returning the second response message to the file monitoring process through the cross-language communication thread pool, the method further includes:

[0023] A release operation is performed on threads where a group of file paths that have been read are located through the cross-language communication thread pool.

[0024] By releasing the thread promptly after it completes its task, the system can maintain high responsiveness and avoid delays caused by long-term thread resource occupation. This is especially important in environments that process large numbers of files and frequent changes, which can reduce the delay in returning search results and improve user experience.

[0025] According to the first aspect, or any implementation of the first aspect above, scanning the disk of the electronic device through the file monitoring process to obtain multiple file paths includes at least one of the following:

[0026] In the case where a file change log is generated on the disk of the electronic device, scanning the file change log by the file monitoring process to obtain the multiple file paths;

[0027] In the case where the search application is installed for the first time on the electronic device, scanning the disk of the electronic device through the file monitoring process to obtain the multiple file paths;

[0028] When the electronic device changes from a closed state to an open state, scanning the disk of the electronic device through the file monitoring process to obtain the multiple file paths;

[0029] When the search application starts to run, the disk of the electronic device is scanned by the file monitoring process to obtain the multiple file paths.

[0030] The different scanning disk triggering methods provided in the examples of this application are adopted to ensure that the file monitoring process can effectively update and maintain the file path information under various conditions, thereby supporting efficient search and index building processes.

[0031] According to the first aspect, or any implementation of the first aspect above, generating the file change log on the disk of the electronic device includes:

[0032] In response to a file change operation of a user, the file change log corresponding to the file change operation is generated on the disk, and the file change operation includes at least one of the following: creating, modifying, and deleting.

[0033] In the example of this application, each change to a file on the Windows operating system (for example, creation, deletion, modification) will generate a USN log on the disk. In this implementation, by recording these file change operations, the file monitoring process can accurately track the state changes of the file system, thereby ensuring that the search application can access the latest file information.

[0034] According to the first aspect, or any implementation of the first aspect above, grouping the multiple file paths by the file monitoring process to obtain multiple groups of file paths includes:

[0035] Determining a grouping basis through the file monitoring process, wherein the grouping basis includes at least one of the following: a total number of file paths, a file type of files on the file path, a size of files on the file path, a change time of files on the file path, and a user-specified priority;

[0036] The multiple file paths are grouped according to the grouping basis through the file monitoring process to obtain the multiple groups of file paths.

[0037] In this implementation, a method for grouping multiple file paths according to grouping criteria, for example, file paths can be grouped according to file type or size to improve processing efficiency or give priority to certain types of files, which helps to optimize file processing processes, manage large numbers of files, and improve the efficiency of search and index construction.

[0038] According to the first aspect, or any implementation of the first aspect above, the grouping is based on the total number of the file paths;

[0039] The step of grouping the plurality of file paths by the file monitoring process according to the grouping basis to obtain the plurality of groups of file paths includes:

[0040] According to the current power consumption and / or performance of the electronic device, determining the number of file paths that can be included in each group of file paths through the file monitoring process;

[0041] According to the number of file paths that each group of file paths can contain and the total number of file paths, the multiple file paths are grouped through the file monitoring process to obtain the multiple groups of file paths.

[0042] In this implementation, the file monitoring process groups the file paths according to the number of file paths that can be included in each group and the total number of file paths as determined above. This ensures that the number of file paths in each group does not exceed the limit that the electronic device can efficiently process, and can also dynamically adjust the grouping of file paths according to the real-time status of the device, thereby optimizing file processing efficiency under different workloads and power conditions.

[0043] According to the first aspect, or any implementation of the first aspect above, after reading the set of file paths from the cross-language communication thread pool through the file compression package, the method further includes:

[0044] Reading a file on each file path in the set of file paths through the file compression package;

[0045] Analyze the files on each file path through the file compression package to obtain analysis results;

[0046] Constructing corresponding index keywords for the files on each file path based on the analysis result through the file compression package;

[0047] A file index library is generated according to the files on each file path and the corresponding index keywords.

[0048] In this implementation, the file compression package generates a file index library based on the files on each file path and the corresponding index keywords. When the file compression package receives a search request forwarded by the GRPC thread pool, the search result corresponding to the search request is searched from the file index library, which can improve the efficiency of file search and access.

[0049] According to the first aspect, or any implementation of the first aspect above, the method further includes:

[0050] In the case where a search request is received during the processing of the plurality of groups of file paths, suspending the processing operation of the plurality of groups of file paths in response to the search request;

[0051] Parsing the search keyword carried in the search request;

[0052] Searching the file index library generated by the file compression package for an index keyword matching the search keyword and the file corresponding to the index keyword to obtain a first search result;

[0053] The first search result is displayed.

[0054] In this implementation, when a search request is received during the processing of multiple groups of file paths, the search request is directly responded to by notifying the file monitoring process to terminate the processing of the multiple groups of file paths to ensure that the search operation starts immediately, prioritizes the search request and displays the first search result without being affected by the current file processing status.

[0055] According to the first aspect, or any implementation of the first aspect above, after displaying the first search result, the method further includes:

[0056] Continue to execute the processing operation on the multiple groups of file paths;

[0057] After the processing operations of the plurality of groups of file paths are completed, re-executing the search request to obtain a second search result;

[0058] The second search result is displayed.

[0059] In this implementation, after displaying the first search result, the system will continue the previous processing operation on multiple groups of file paths. Once the processing operation of the file path is completed, the search request is automatically re-executed to reflect the latest file status. No additional input from the user is required. After the system automatically re-executes the search request, the second search result is displayed, providing the user with the latest file information and improving the user experience.

[0060] According to the first aspect, or any implementation of the first aspect above, after the processing operation of the multiple groups of file paths is completed, re-executing the search request to obtain a second search result includes:

[0061] After the processing operations of the plurality of groups of file paths are completed, a prompt message is issued, wherein the prompt message is used to prompt the user to re-execute the search request;

[0062] In response to a re-triggering operation on the search request, the search request is re-executed to obtain a second search result.

[0063] In this implementation, after the file path processing is completed, the system will output a prompt message to ask the user whether he wants to re-execute the search request. If the user agrees, the search request is re-executed and the updated second search result is displayed to provide the user with the latest file information. Asking the user for his opinion can avoid unnecessary re-search operations when the user does not want to re-execute the search request.

[0064] In a second aspect of the present application, a file processing device is provided, which is applied to an electronic device, comprising:

[0065] A scanning module, used to scan the disk of the electronic device through a file monitoring process to obtain multiple file paths;

[0066] A grouping module, used for grouping the multiple file paths through the file monitoring process to obtain multiple groups of file paths, each group of file paths including at least one file path;

[0067] A sending module, used to send the plurality of groups of file paths in batches to a cross-language communication thread pool in a serial manner through the file monitoring process, wherein the cross-language communication thread pool is used to communicate between the file monitoring process and the file compression package written in different computer languages;

[0068] The reading module is used to read the set of file paths from the cross-language communication thread pool through the file compression package each time a set of file paths is received through the cross-language communication thread pool.

[0069] The second aspect and any implementation of the second aspect correspond to the first aspect and any implementation of the first aspect respectively. The technical effects corresponding to the second aspect and any implementation of the second aspect can refer to the technical effects corresponding to the above-mentioned first aspect and any implementation of the first aspect, which will not be repeated here.

[0070] According to a third aspect, an electronic device is provided, comprising a module / unit for executing the first aspect or any one of the methods in the first aspect.

[0071] In a fourth aspect, an electronic device is provided, comprising one or more processors and a memory;

[0072] The memory is coupled to one or more processors, and the memory is used to store computer program code, wherein the computer program code includes computer instructions, and the one or more processors call the computer instructions to enable the electronic device to execute the first aspect or any one of the methods in the first aspect.

[0073] In a fifth aspect, a chip system is provided, which is applied to an electronic device, and the chip system includes one or more processors, and the processor is used to call computer instructions so that the electronic device executes the first aspect or any one of the methods in the first aspect.

[0074] In a sixth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the processor executes the first aspect or any one of the methods in the first aspect.

[0075] In a seventh aspect, a computer program product is provided, the computer program product comprising: a computer program code, when the computer program code is executed by an electronic device, the electronic device executes the first aspect or any one of the methods in the first aspect.

[0076] The present application provides a file processing method. When a file monitoring process sends multiple file paths to an underlying file compression package, the multiple file paths are grouped to obtain multiple groups of file paths, and the multiple groups of file paths are sent in batches in a serial manner to a communication intermediary: a GRPC thread pool. After each group of file paths is sent, the file compression package reads the group of file paths from the cross-language communication thread pool, and the file monitoring process repeats the execution of sending the next group of file paths to the GRPC thread pool until all the file paths scanned this time are sent and processed, thereby optimizing the file processing process and ensuring the continuity of file path transmission and processing.

[0077] Since the file monitoring process uses a serial method to send file paths to the GRPC thread pool in groups and batches, after the file compression package takes out a group of file paths from the GRPC thread pool, the file monitoring process executes and sends the next group of file paths to the GRPC thread pool. In this way, the GRPC thread pool will not be full. Even if the GRPC thread pool receives a search request during the file processing process, the search request does not need to wait in line, and the search request can be processed first, avoiding search response delays caused by a large number of files and frequent changes, and improving the processing efficiency of search requests.

[0078] Through the above technical solution, since the electronic device at least has all the beneficial effects of the file processing method, they will not be described in detail here. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0080] Figure 2 is a schematic diagram of an optional file processing flow provided in an embodiment of the present application;

[0081] Figure 3 is a schematic diagram of an optional file processing flow provided in an embodiment of the present application;

[0082] Figure 4 is a schematic diagram of an optional file processing flow provided in an embodiment of the present application;

[0083] Figure 5a This is a schematic diagram of a triggering flow of a file monitoring process scanning a file path provided by an embodiment of the present application;

[0084] Figure 5b This is another triggering flow diagram of a file monitoring process scanning a file path provided by an embodiment of the present application;

[0085] Figure 5c This is another triggering flow diagram of a file monitoring process scanning a file path provided by an embodiment of the present application;

[0086] Figure 5d This is another triggering flow diagram of a file monitoring process scanning a file path provided in an embodiment of the present application;

[0087] Figure 6a is a schematic diagram of another search interface provided in an embodiment of the present application;

[0088] Figure 6b is a schematic diagram of another wake-up search interface provided in an embodiment of the present application;

[0089] Figure 6c is a schematic diagram of another wake-up search interface provided in an embodiment of the present application;

[0090] Figure 6d This is a schematic diagram of another wake-up search interface provided in an embodiment of the present application.

[0091] Figure 7 It is a flowchart of an optional processing search request provided in an embodiment of the present application. DETAILED DESCRIPTION

[0092] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below in conjunction with the accompanying drawings.

[0093] It should be understood that the "multiple" mentioned in this application refers to two or more. In the description of this application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in this article is just a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone.

[0094] In addition, in order to facilitate the clear description of the technical solution of the present application, the words "first", "second", etc. are used to distinguish the same items or similar items with basically the same functions and effects. The terms "first" and "second", etc. in the description and claims of the embodiments of the present application are used to distinguish different objects, rather than to describe the specific order of objects. For example, the first target object and the second target object, etc. are used to distinguish different target objects, rather than to describe the specific order of target objects.

[0095] In the embodiments of the present application, the words "exemplarily" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplarily" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplarily" or "for example" is intended to present related concepts in a specific way.

[0096] In the description of the embodiments of the present application, unless otherwise specified, the meaning of "multiple" refers to two or more than two. For example, multiple processing units refer to two or more processing units; multiple systems refer to two or more systems.

[0097] First, some terms in the embodiments of the present application are explained to facilitate understanding by those skilled in the art.

[0098] The file monitoring process refers to the process running in the operating system, which can monitor the changes of files in real time, such as file creation, modification, deletion, etc. In the Windows operating system, Process Monitor provides powerful monitoring and filtering functions, which can record the file system, registry and process / thread activities in detail.

[0099] A disk is a computer storage device that uses magnetic materials to store and remember data. This includes files, programs, and system data. When you save or open a file on your computer, you are actually reading and writing data on the disk. The speed and capacity of the disk directly affect the performance and storage capacity of the computer. The data on the disk is retained even after a power outage. Disk usually refers to a hard disk, but it can also refer to other magnetic storage devices such as floppy disks.

[0100] A hard disk consists of one or more platters that are coated with magnetic material to record binary data. Each platter is divided into many tracks, which are divided into sectors, which are the basic units of data storage on a hard disk.

[0101] The Windows API (commonly referred to as WinAPI) is a core set of interfaces provided by Microsoft's Windows operating system. It consists of a series of functions, messages, and data structures that allow programmers to create and manage windows in the Windows operating system, as well as implement other functions that interact with the operating system. For example, using WinAPI, developers can create windows, respond to user input, display text and images, and so on.

[0102] Jar (Java Archive) package is a compressed package that packages Java class files, metadata, and resources (such as text, images, etc.). It is based on the ZIP file format and has a .jar extension. Jar files allow developers to easily distribute and deploy Java applications and libraries because they can contain all the components of an application; Jar files also support cross-platform use because Java is a cross-platform language.

[0103] GRPC is a high-performance, open source remote procedure call (RPC) framework provided by Google. It is designed specifically for mobile applications and HTTP / 2 and can be used in multiple programming languages ​​​​such as C, Java, Go, and Python. GRPC uses HTTP / 2 as a transport layer protocol and provides a method to design API interfaces for managing and configuring network devices.

[0104] In simple terms, GRPC allows programs written in different languages ​​to communicate with each other. It uses a technology called ProtoBuf (Protocol Buffers) to define interfaces and data structures, so that cross-language code can be generated, making communication between services more efficient and reliable.

[0105] Update Sequence Number Journal (USN Journal, USN Journal) is a feature of NTFS, or Change Journal, that maintains a record of changes that have been made to a volume.

[0106] The New Technology File System (NTFS) is a disk format supported by the Windows NT kernel operating system series, which is specially designed for network and disk quota, file encryption and other management security features. It provides long file names, data protection and recovery, can achieve security through directory and file permissions, and supports spanning partitions. Among them, Windows NT is a network operating system series for workstations, network servers and mainframe computers, and its "NT" means "New Technology".

[0107] The above is a brief introduction to the nouns involved in the embodiments of the present application, which will not be repeated below.

[0108] See also Figure 1 , Figure 1 A schematic diagram of the structure of an electronic device 100 provided in an embodiment of the present application. Optionally, the electronic device 100 can be referred to as a terminal, or a terminal device, and the specific product form of the electronic device 100 can be an intelligent terminal, such as a mobile phone, a tablet computer, a wearable device, an augmented reality / virtual reality device, a laptop computer, a vehicle-mounted device, a personal assistant (PDA), and other electronic devices with a file processing function. Specifically, the functional modules involved in the present application can be deployed on the DSP chip of the relevant device, and specifically can be an application program or software therein. A file processing function can be implemented through software installation or upgrade, and through the call and coordination of hardware.

[0109] It should be understood that Figure 1 The electronic device 100 shown is only one example of an electronic device, and the electronic device 100 may have more or fewer components than shown in the figure, may combine two or more components, or may have a different configuration of components. Figure 1 The various components shown in the EMBODIMENTS 2000 may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and / or application specific integrated circuits.

[0110] 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 sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. Among them, the sensor module 180 may include a pressure sensor, a gyroscope sensor, an acceleration sensor, a temperature sensor, a motion sensor, an air pressure sensor, a magnetic sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, etc.

[0111] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor and / or a neural network processing unit (NPU), etc. Among them, different processing units may be independent devices or integrated in one or more processors.

[0112] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.

[0113] A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory.

[0114] The USB interface 130 is an interface that complies with USB standard specifications, and specifically may be a Mini USB interface, a Micro USB interface, a USB Type C interface, or the like.

[0115] The charging management module 140 is used to receive charging input from a charger. The charger can be a wireless charger or a wired charger. While the charging management module 140 is charging the battery 142, it can also power the electronic device through the power management module 141. The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and powers the processor 110, the internal memory 121, the external memory, the display screen 194, the camera 193, and the wireless communication module 160.

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

[0117] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of the antennas.

[0118] The mobile communication module 150 may provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc.

[0119] The wireless communication module 160 can provide wireless communication solutions for application in 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 technology (NFC), infrared technology (IR), etc.

[0120] 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, so that electronic device 100 can communicate with the network and other devices through wireless communication technology.

[0121] The electronic device 100 implements display functions through a GPU, a display screen 194, and an application processor, etc. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.

[0122] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. In some embodiments, the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.

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

[0124] The ISP is used to process data fed back by the camera 193. For example, when taking a photo, the shutter is opened, and light is transmitted to the camera photosensitive element through the lens, and the light signal is converted into an electrical signal. The camera photosensitive element transmits the electrical signal to the ISP for processing and converts it into an image visible to the naked eye.

[0125] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal oxide semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.

[0126] Among them, the camera 193 can be located in the edge area of ​​the electronic device, can be an under-screen camera, or can be a liftable camera. The camera 193 can include a rear camera, and can also include a rear camera. The embodiment of the present application does not limit the specific position and form of the camera 193. The electronic device 100 can include cameras of one or more focal lengths. For example, cameras of different focal lengths can include a telephoto camera, a wide-angle camera, an ultra-wide-angle camera, or a panoramic camera.

[0127] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 via the external memory interface 120 to implement a data storage function.

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

[0129] The electronic device 100 can implement audio functions such as music playing and recording through the audio module 170 and the application processor.

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

[0131] The touch sensor is also called a "touch panel". The touch sensor can be set on the display screen 194. The touch sensor and the display screen 194 form a touch screen, also called a "touch screen". The touch sensor is used to detect a touch operation acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194.

[0132] The pressure sensor is used to sense the pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor can be arranged on the display screen 194. The electronic device 100 can also calculate the touch position according to the detection signal of the pressure sensor.

[0133] The gyro sensor may be used to determine the motion posture of the electronic device 100. In some embodiments, the angular velocity of the electronic device 100 around three axes (ie, x, y, and z axes) may be determined by the gyro sensor.

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

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

[0136] An embodiment of the present application provides a file processing method, which can be applied to electronic devices.

[0137] The file processing method scans the disk of an electronic device through a file monitoring process to obtain multiple file paths; groups the multiple file paths through the file monitoring process to obtain multiple groups of file paths, each group of file paths contains at least one file path; uses the file monitoring process in a serial manner to send the multiple groups of file paths in batches to a cross-language communication thread pool, the cross-language communication thread pool is used for communication between the file monitoring process and the file compression package written in different computer languages; and reads a group of file paths from the cross-language communication thread pool through the file compression package when each group of file paths is received through the cross-language communication thread pool.

[0138] Exemplarily, electronic devices may include mobile phones, tablet computers, smart watches, laptop computers, virtual-reality fusion devices, super mobile personal computers, smart TVs, smart screens, high-definition TVs, smart speakers, smart projectors, etc. The embodiments of the present application may be applied, but not limited to, to various scenarios that require optimization of file path transmission and processing procedures and improvement of the response speed of search requests.

[0139] In one example, the electronic device in the example of the present application is applicable to the Windows operating system, and the file monitoring process may be a process written in C++. The file monitoring process uses the Windows API to scan the disk of the electronic device and obtain the file paths of all files.

[0140] In one example, the file compression package may specifically be a Java program package (jar package), and the jar package is specifically written in the Java language.

[0141] In one implementation scenario, taking the search application running on an electronic device (such as a laptop) as an example, when the user installs the "Smart Search" application for the first time and agrees to the relevant agreement, a file monitoring process will start working (process started), that is, the file monitoring process uses the application programming interface WinAPI to scan the disk on the laptop, obtain multiple file paths, and use the GRPC thread pool as a communication intermediary to send the file path information to the system's underlying jar package.

[0142] In order to avoid the problem of a large amount of file path information being sent at the same time, resulting in a long waiting time for search requests, in this application example, Figure 2 As shown, S201, a disk of an electronic device is scanned through a file monitoring process to obtain multiple file paths. Then, S202, the multiple file paths are grouped through the file monitoring process to obtain multiple groups of file paths. The grouping helps to execute subsequent batch sending.

[0143] After group processing, the file monitoring process uses serial mode to send multiple groups of file paths in batches to the cross-language communication GRPC thread pool. The GRPC thread pool acts as a communication intermediary, allowing file monitoring processes and file compression packages written in different programming languages ​​to communicate with each other.

[0144] It is understandable that the file monitoring process uses a serial method to send multiple groups of file paths to the GRPC thread pool in batches, which means that the file monitoring process only sends one group of file paths to the GRPC thread pool at a time, and will not send multiple batches or groups of file paths at the same time. Instead, it will wait for the current batch of file paths to be processed and confirmed before sending the next batch of file paths. This method is similar to a queuing system, where each task is executed in sequence, and the next task starts after the previous task is completed.

[0145] For example Figure 2 As shown, in S203, the file monitoring process first sends the first set of file paths to the GRPC thread pool. In S204, the jar package reads the first set of file paths from the GRPC thread pool.

[0146] In addition, Figure 2 As shown, S205, after the file monitoring process sends the first set of file paths to the GRPC thread pool, the file monitoring process can also wait for a preset time (for example, 10 seconds) to receive a response message from the GRPC thread pool. If no response message is received within the preset time, it is determined that the waiting timeout has occurred, and step S207 is also executed to send the second set of file paths (the next set of file paths) to the GRPC thread pool.

[0147] In the example of this application, a timeout limit mechanism can also be set in the file monitoring process. When the timeout limit mechanism is set, even if no confirmation message / response message is received within the timeout, the file monitoring process will automatically continue to send the next set of file paths to the GRPC thread pool. In this way, even if there is a problem in the processing of certain file paths, it will not block the workflow of the entire system.

[0148] It should be noted that the execution order of the above steps S204 and S205 is not specific, and they can be executed simultaneously, or S205 can be executed first and then S204, or S204 can be executed first and then S205.

[0149] That is, the file monitoring process will wait for a batch of file path information to be processed by the jar package and receive a confirmation message before sending the next set of file path information. At any given point in time, only one file transfer task is in progress.

[0150] This ensures that the file paths are sent and processed in order, avoiding confusion or resource competition caused by processing too many file paths at the same time. In this way, even when a large number of file paths need to be processed, the thread pool will not be full. When the "Smart Search" application generates a new search request, the search request can be processed first without waiting in line, which will not cause delays in the response of the search request.

[0151] For example, taking the file monitoring process as a process written in C++ and the file compression package as a jar package as an example, the cross-language communication thread pool is the GRPC thread pool. After receiving each set of file paths, the thread pool can send a notification message to the jar package. After receiving the notification message, the jar package will read these file paths from the thread pool, perform file analysis on the files on the file path, and build a file index, so that the files can be quickly found by the search application, making the search fast and accurate.

[0152] It is understandable that sending files directly from the file monitoring process to the jar package may seem more direct, but when processing a large number of files or high-frequency file updates, it may cause excessive pressure on the jar package processing, affecting the response time and stability of the system. Using the GRPC thread pool as a communication intermediary can handle it more smoothly, ensuring the efficiency and reliability of the search service.

[0153] In this application example, the GRPC thread pool can control the number of file processing tasks to avoid sending too many requests to the jar package at the same time, which will cause the jar package to be unable to process. The GRPC thread pool can also dynamically adjust the number of threads according to the current system load.

[0154] In addition, the GRPC thread pool can also provide a task queue to process the sending and receiving of file information in a certain order (such as first-in, first-out). If an error occurs during file transfer or processing, the GRPC thread pool can help isolate the problem and prevent one error from affecting the entire system. The GRPC thread pool can cache threads, avoiding the overhead of frequent thread creation and destruction, thereby improving performance.

[0155] In this application example, when the file monitoring process sends multiple file paths to the underlying jar package, the multiple file paths are first grouped to obtain multiple groups of file paths, and then the multiple groups of file paths are sent in batches in a serial manner to the communication intermediary: the GRPC thread pool. After each group of file paths is sent, the jar package reads the group of file paths from the cross-language communication thread pool, and the file monitoring process repeats the execution of sending the next group of file paths to the GRPC thread pool until all the file paths scanned this time are sent and processed, thereby optimizing the file processing process and ensuring the continuity of file path transmission and processing.

[0156] Since the file monitoring process uses a serial method, the file paths are sent to the GRPC thread pool in groups and batches. After the file compression package takes out a group of file paths from the GRPC thread pool and returns a response message, the file monitoring process executes and sends the next group of file paths to the GRPC thread pool.

[0157] In this way, the GRPC thread pool will not be full. Even if the GRPC thread pool receives a search request during the file processing process, there is no need for the search request to wait in queue. The search request can be processed first, avoiding search response delays caused by a large number of files and frequent changes, thereby improving the processing efficiency of search requests.

[0158] The following combination Figure 3 The file processing flow diagram shown in FIG. 1 describes in detail how the system responds after the jar package successfully reads a set of file paths from the GRPC thread pool to ensure the continuity of the file path sending process.

[0159] Since the GRPC thread pool is the communication intermediary between the jar package and the file monitoring process, returning a response message to the file monitoring process through the jar package can also be implemented through the GRPC thread pool. The specific implementation method is:

[0160] S300, after the jar package has processed the first set of file paths (the previous set of file paths), it will send a confirmation message, i.e., the first response message, to the GRPC thread pool. This message indicates that the file compression package has been successfully received and is ready to process this set of file paths.

[0161] S302, after the jar package sends the first response message, the GRPC thread pool sends a second response message to the file monitoring process.

[0162] The above example process of this application adopts a locking mechanism. After sending a set of file paths, the process in the GRPC thread pool will lock and wait for the jar package to return the first response message of successful processing before releasing the lock. And send a second response message to the file monitoring process. This message informs the file monitoring process that the first set of file paths has been successfully processed and now the second set of file paths (the next set of file paths) can be sent. This ensures the order and effectiveness of file processing and avoids delays in search requests due to thread resource limitations.

[0163] Through this response mechanism, when the file monitoring process receives the second response message from the GRPC thread pool, it indicates that the previous set of file paths has been successfully processed. At this time, the file monitoring process will continue to send the next set of file paths to the thread pool, and then repeat the above file processing steps until all file paths are sent out and processed, thereby optimizing the file processing and search efficiency of the entire system.

[0164] In the example of this application, in order to achieve the continuity of the file processing process, a timeout processing mechanism is also added. If the file monitoring process starts waiting from successfully sending a set of file paths, and still does not receive the second response message after waiting for a preset period of time (for example, 10 seconds, 15 seconds), it will assume that the previous set of file paths has been processed or encountered a problem.

[0165] Then, the file monitoring process will continue to send the next set of file paths to the GRPC thread pool, and the jar package will read and process the next set of file paths to maintain the continuity of the file path sending and processing process.

[0166] The above implementation adopts a timeout processing mechanism to ensure that even when communication delays or other problems occur, that is, the file monitoring process does not receive the second response message after waiting for a preset period of time, the file monitoring process can continue to work, and the file processing and search process will not stagnate, thereby improving the robustness and processing efficiency of the entire system.

[0167] In one example, if Figure 4 As shown in the file processing flow diagram, before the GRPC thread pool sends a second response message to the file monitoring process, it needs to execute a key step: S301, performing a release operation on the thread where a set of file paths that have been read are located.

[0168] This step ensures that the threads in the GRPC thread pool that are responsible for a set of file paths that have been read are managed. Releasing a thread means informing the system that the thread has completed its task and can be reallocated to a new task, which improves thread utilization and overall system efficiency.

[0169] By releasing the thread promptly after it completes its task, the system can maintain high responsiveness and avoid delays caused by long-term thread resource occupation. This is especially important in environments that process large numbers of files and frequent changes, which can reduce the delay in returning search results and improve user experience.

[0170] In one example, the triggering method for the file monitoring process to start scanning the file path includes at least one of the following:

[0171] File change log: Figure 5a As shown, when file change logs are generated on the disk of the electronic device, the file monitoring process scans these logs to obtain the file path. This allows the system to track the addition, deletion or modification of files.

[0172] Installing the search application for the first time: Figure 5b As shown, when it is detected that the search application is installed on the electronic device for the first time, the file monitoring process will perform a full scan to collect the paths of all files.

[0173] Electronic device turned on (off state changed to on state): Figure 5c As shown, each time the electronic device is detected to be turned on from an off state, the file monitoring process may scan the disk to update its record of the file path.

[0174] Search application running: Figure 5d As shown, when the search application is detected to start running, the file monitoring process will also scan the disk to ensure that the search function can access the latest file path information.

[0175] By adopting the different scanning disk triggering methods provided in the examples of this application, the file monitoring process can effectively update and maintain the file path information under various conditions, thereby supporting efficient search and index building processes.

[0176] For example, every time the computer is turned on or the user opens a search application, the file monitoring process will start and scan all the files on the disk, but this time it will use a serial method to send the file path information in groups.

[0177] That is, the file monitoring process will wait for the first batch of file path information to be processed by the jar package and indexed, and will send the next batch of file path information only after receiving a response message. This ensures that even if a search request is received during the file processing process, there will be no delay due to waiting in line for the file processing process.

[0178] In the example of this application, each file change operation on the Windows operating system (for example, new creation, deletion, modification) will generate a USN log on the disk. It should be noted that the above-mentioned first installation of the search application, the activation of the electronic device, and the operation of the search application may also generate a USN log on the hard disk in the form of a file change operation, but it is not limited to this. However, it will be displayed on the disk. In this way, the file monitoring process can parse the full path of the changed file by reading the USN log, and then send the scanned file path to the jar package through the GRPC thread pool.

[0179] In an example that can be implemented, a file change log, such as an update sequence number log (USN log), is generated on a disk of an electronic device, which can record at least one of the following change operations performed by a user on a file on the electronic device:

[0180] When a user creates a new file on the disk, the system records this event in the USN journal.

[0181] If a user changes the contents of an existing file, this change is also recorded in the USN journal.

[0182] When a user deletes a file, the operation is also recorded in the USN log.

[0183] By recording these file change operations, the file monitoring process can accurately track the status changes of the file system, thereby ensuring that the search application can access the latest file information. The real-time update mechanism and the use of logging in the above example help maintain the accuracy of the file index and improve search efficiency.

[0184] It is understandable that before sending multiple file paths serially, or during the process of sending multiple file paths serially, the multiple file paths are usually grouped or batched according to grouping basis, grouping standard or factors, and the multiple groups of file paths are sent serially or in batches.

[0185] In one example, the file monitoring process first determines the basis for grouping file paths. For example, at least one or more of the following factors: the total number of file paths, the type of files on the file path (for example, files of the same type may be grouped together), the size of the files on the file path (for example, large files may be sent separately, while small files may be packaged together), the change time of the files on the file path (the most recently modified files may be sent first), and the priority specified by the user. After that, the file monitoring process will group the file paths according to these bases to obtain multiple groups of file paths.

[0186] The above method of grouping multiple file paths according to the grouping criteria can, for example, group file paths according to file type or size to improve processing efficiency or give priority to certain types of files, which helps to optimize the file processing process, manage a large number of files, and improve the efficiency of search and index construction.

[0187] In one possible implementation example, the file monitoring process detects the current power consumption and performance of the electronic device by real-time monitoring of indicators such as CPU usage, memory usage, battery power, and temperature. Based on the monitored data, the file monitoring process calculates the maximum number of file paths that can be included in each group of file paths. Of course, this number may change depending on the performance and power consumption of the device.

[0188] Afterwards, the file monitoring process groups the file paths according to the number of file paths that can be included in each group and the total number of file paths as determined above. This ensures that the number of file paths in each group does not exceed the limit that the electronic device can efficiently process, and can also dynamically adjust the grouping of file paths according to the real-time status of the device, thereby optimizing file processing efficiency under different workloads and power conditions.

[0189] As an optional example, after reading a set of file paths from the GRPC thread pool each time through the jar package, the jar package reads the files on each file path. Next, the jar package analyzes the files on each file path. For example, the above analysis may include but is not limited to: identifying the file type, content, structure, metadata, etc., to obtain detailed analysis results. Based on the analysis results, the jar package constructs corresponding index keywords for the files on each file path. For example, it can be a concise representation of the analyzed file content, structure, etc. for fast retrieval.

[0190] Finally, the jar package generates a file index library based on the files on each file path and the corresponding index keywords. When the jar package receives a search request forwarded by the GRPC thread pool, it searches the file index library for the search result corresponding to the search request, which can improve the efficiency of file search and access.

[0191] Before describing the technical solution for processing search requests in the embodiment of the present application, the awakening method of the search interface in the embodiment of the present application is first described in conjunction with the accompanying drawings. For example, the search interface can be awakened through the system global entrance, desktop entrance, function recommendation page, application embedded entrance, application floating entrance, etc. The user enters the search keyword in the "search input box" displayed on the search interface to trigger the search request. The desktop entrance can include, for example, the creation assistant card, global search, desktop card and other entrances.

[0192] Figure 6a The schematic diagram shows triggering the awakening search interface through the system global entrance. For example, in the system global entrance, such as the display desktop of a computer, the user can use a shortcut, for example, by clicking a preset shortcut key (such as Win+Shift+Z, etc.), or by clicking a shortcut button on the device, or a voice input entrance to trigger the awakening of the search interface. Figure 6a In the search interface shown, the user enters a search keyword in the search input box 602 displayed on the search interface to trigger a search request, or can also trigger the search interface by breath awakening, fingerprint recognition, gesture recognition, facial recognition, etc.

[0193] For example, in response to detecting a user's voice input operation, the search application (such as smart search, search assistant) uses the detected voice input content as the search keyword input by the user, and the voice input content may be, for example, "employment documents". Alternatively, in response to detecting a user's text input operation in the search input box 602, the search application uses the detected text input content as the search keyword input by the user, and the text input content may be, for example, "resignation certificate document".

[0194] Figure 6b-6dSchematically shows how to trigger wakeup through desktop entry Figure 6a The search interface shown. The desktop portal may include, for example, desktop shortcut options, a preset function recommendation page, and an application embedded portal.

[0195] like Figure 6b As shown, the search interface can be triggered by a desktop shortcut option (such as a smart search floating ball 603). After the user clicks the smart search floating ball 603 and a smart search icon 604 appears, the user only needs to place the mouse arrow on the icon 604 to trigger the wake-up operation without clicking. Figure 6a The search interface shown.

[0196] Figure 6c The schematic diagram shows triggering video generation by means of a function recommendation page (also called a recommendation card) in the computer manager, for example, triggering the wake-up through the smart search page 605. Figure 6a The search interface shown. Figure 6d The schematic diagram shows triggering video generation by means of an application embedded portal in the control center (computer manager sidebar), for example, triggering wake-up by smart search embedded portal 606. Figure 6a The search interface shown.

[0197] In the example of this application, as an optional implementation scenario: during the process of the file monitoring process sending file path information to the jar package, if a search command or search request from the user is received, the system will notify the file monitoring process to terminate the processing of multiple groups of file paths, and give priority to this search request, and continue to process the scanned file after the search request is processed.

[0198] The advantage of this is that users can search without waiting for the full scan to complete, although this may mean that the search results are not the most complete. To improve this problem, the system can remind users to refresh the search results after the full scan is completed to ensure the completeness of the search.

[0199] In one implementation, Figure 7 A schematic diagram of processing a search request is shown, and the processing of the search request includes: S701, when a user performs a search operation through a search application running on an electronic device, that is, inputs a search keyword of the desired content on the search interface, S702, the search interface receives and parses the search request, and in response to the search request, the system immediately terminates the processing operation of multiple groups of file paths, for example, S703, the file monitoring process is terminated and waits for the search request to be processed. This ensures that the search operation starts immediately, the search request is processed first, and the first search result is displayed, which is not affected by the current file processing status.

[0200] Exemplarily, at S704, the search interface process parses the search keyword carried in the search request. At S705 and S706, the search interface process sends the search request carrying the search keyword to the jar package through the GRPC thread pool. At S707, the search keyword carried in the search request is parsed through the jar package, and the index keyword matching the search keyword is searched in the file index library pre-generated in the jar package (for example, semantically identical or semantically similar means matching).

[0201] Then, the jar package will search for files corresponding to these index keywords in the file index library. Once a matching file is found, a first search result will be generated, and S608 will be executed to return the first search result to the user interface process. S709 will display the first search result to the user on the user interface.

[0202] By changing the sending method of file path information and optimizing the processing order of search requests, the response speed of the search application and the user experience are improved. In addition, the above example also uses the file index library generated by the file compression package during the file processing process to improve the search efficiency.

[0203] In an optional example of the present application, after displaying the first search result, the Windows operating system will continue the previous processing operations on multiple groups of file paths. The continued processing operations include but are not limited to: the file monitoring process continues to scan and read multiple file paths from the hard disk, the file monitoring process continues to group and process multiple file paths to obtain multiple groups of file paths, the file monitoring process continues to send a group of file paths to the GRPC thread pool, the jar package continues to take a group of file paths from the GRPC thread pool, the jar package continues to send a first response message to the GRPC thread pool, the GRPC thread pool continues to release the thread where the read group of file paths are located, the GRPC thread pool continues to send a second response message to the file monitoring process, the jar package continues to analyze and build index keywords for files on each file path, and so on.

[0204] Once the file path processing operation is completed, the search request can be automatically re-executed to reflect the latest file status. Without the need for additional user input, the system automatically re-executes the search request and displays the second search result to provide the user with the latest file information. This process improves the user experience because it reduces the number of operations required by the user while ensuring the real-time and accuracy of the search results.

[0205] In another optional example of the present application, after completing the file path processing, the system will output a prompt message, asking the user whether he wants to re-execute the search request, and a "Confirm" button and a "Reject" button may be presented in the display box of the prompt message.

[0206] If the user disagrees, the search request will not be re-executed. If the user agrees, the system responds to the user's re-triggering operation on the search request, such as clicking a "confirm" button, re-executes the search request, and displays the updated second search results to provide the user with the latest file information.

[0207] The above processing method is because during the processing of the file path, especially after a long file processing operation, new files may be added or existing files may be updated, so that the user can obtain the latest search results.

[0208] By optimizing the way file information is sent and the priority of processing search requests, the search efficiency and user experience are improved. This is especially suitable for scenarios where a large number of files need to be processed and files change frequently, ensuring that users can quickly find the files they need when they need them.

[0209] The present application also provides a file processing device embodiment, which can be implemented by software, hardware or a combination of both to form part or all of a computer device, which can be Figure 1 The electronic device shown. The file processing device is applied to the electronic device, including:

[0210] A scanning module, used to scan the disk of the electronic device through a file monitoring process to obtain multiple file paths;

[0211] A grouping module, used to group multiple file paths through a file monitoring process to obtain multiple groups of file paths, each group of file paths containing at least one file path;

[0212] A sending module, used to send multiple groups of file paths in batches to a cross-language communication thread pool in a serial manner through a file monitoring process, and the cross-language communication thread pool is used for communication between file monitoring processes and file compression packages written in different computer languages;

[0213] The reading module is used to read a group of file paths from the cross-language communication thread pool through a file compression package each time a group of file paths is received through the cross-language communication thread pool.

[0214] In an optional example of the present application, the device further includes:

[0215] A first return module returns a first response message to the cross-language communication thread pool through a file compression package, where the first response message is used to indicate that the file compression package successfully reads a set of file paths;

[0216] The second return module returns a second response message to the file monitoring process through the cross-language communication thread pool when the first response message is received through the cross-language communication thread pool. The second response message is used to instruct the file monitoring process to send the next set of file paths to the cross-language communication thread pool.

[0217] In an optional example of the present application, the device further includes:

[0218] A continue sending module is used to send the next set of file paths to the cross-language communication thread pool through the file monitoring process when the file monitoring process receives the second response message; or to send the next set of file paths to the cross-language communication thread pool when the file monitoring process waits for a preset time and still does not receive the second response message. The waiting starting point of the file monitoring process is the successful sending of a set of file paths.

[0219] In an optional example of the present application, the device further includes:

[0220] The release module is used to perform a release operation on threads where a group of file paths that have been read are located through a cross-language communication thread pool.

[0221] In an optional example of the present application, the scanning module includes at least one of the following:

[0222] A first scanning unit is used to scan the file change log through a file monitoring process to obtain multiple file paths when a file change log is generated on a disk of the electronic device;

[0223] A second scanning unit is used to scan the disk of the electronic device through a file monitoring process to obtain multiple file paths when the search application is installed for the first time on the electronic device;

[0224] A third scanning unit is used to scan the disk of the electronic device through a file monitoring process to obtain multiple file paths when the electronic device changes from a closed state to an open state;

[0225] The fourth scanning unit is used to scan the disk of the electronic device through the file monitoring process to obtain multiple file paths when the search application starts to run.

[0226] In an optional example of the present application, the device further includes:

[0227] The first generating module is used to generate a file change log corresponding to the file change operation on the disk in response to the user's file change operation, and the file change operation includes at least one of the following: create, modify, and delete.

[0228] In an optional example of the present application, the grouping module includes:

[0229] A determination unit, configured to determine a grouping basis through a file monitoring process, wherein the grouping basis includes at least one of the following: a total number of file paths, a file type of files on the file path, a size of files on the file path, a change time of files on the file path, and a user-specified priority;

[0230] The grouping unit is used to group multiple file paths according to the grouping basis through the file monitoring process to obtain multiple groups of file paths.

[0231] In an optional example of the present application, the grouping basis is the total number of file paths; the grouping unit includes:

[0232] a determination subunit, configured to determine the number of file paths that can be included in each group of file paths through a file monitoring process according to the current power consumption and / or performance of the electronic device;

[0233] The grouping subunit is used to group multiple file paths through a file monitoring process according to the number of file paths that each group of file paths can contain and the total number of file paths, so as to obtain multiple groups of file paths.

[0234] In an optional example of the present application, the device further includes:

[0235] A reading module, used for reading files on each file path in a set of file paths through a file compression package;

[0236] An analysis module is used to analyze the files on each file path through the file compression package to obtain the analysis results;

[0237] A construction module is used to construct corresponding index keywords for each file on the file path based on the analysis result through the file compression package;

[0238] The second generating module is used to generate a file index library according to the files on each file path and the corresponding index keywords.

[0239] In an optional example of the present application, the device further includes:

[0240] an abort module, configured to abort the processing operation on the multiple groups of file paths in response to a search request when a search request is received during the processing of the multiple groups of file paths;

[0241] A parsing module, used to parse the search keywords carried in the search request;

[0242] A search module, used to search for an index keyword matching the search keyword and a file corresponding to the index keyword in a file index library generated by the file compression package, and obtain a first search result;

[0243] The first display module is used to display the first search result.

[0244] In an optional example of the present application, the device further includes:

[0245] A continuing processing module is used to continue to execute processing operations on multiple groups of file paths;

[0246] A re-search module, used for re-executing the search request after the processing operation of the multiple groups of file paths is completed, to obtain a second search result;

[0247] The second display module is used to display the second search result.

[0248] In an optional example of the present application, the re-search module includes:

[0249] A prompt unit, used for sending a prompt message after the processing operation of the plurality of groups of file paths is completed, the prompt message being used for prompting to re-execute the search request;

[0250] The re-search unit is used to re-execute the search request in response to the re-triggering operation on the search request to obtain a second search result.

[0251] It is understandable that the file processing device embodiment and any implementation thereof correspond to the file processing method embodiment and any implementation thereof, respectively. The technical effects corresponding to the file processing device embodiment and any implementation thereof can refer to the technical effects corresponding to the above-mentioned file processing method embodiment and any implementation thereof, which will not be described in detail here.

[0252] It should be noted that: the file processing device provided in the above embodiment is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0253] The functional units and modules in the above embodiments may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit, and the above integrated units may be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the embodiments of the present application.

[0254] The file processing device and the file processing method provided in the above embodiments belong to the same concept. The specific working process of the units and modules in the above embodiments and the technical effects brought about can be found in the method embodiment part and will not be repeated here.

[0255] An embodiment of the present application further provides an electronic device, the electronic device comprising one or more processors and a memory;

[0256] The memory is coupled to one or more processors, and the memory is used to store computer program codes. The computer program codes include computer instructions. One or more processors call the computer instructions to enable the electronic device to execute the file processing method shown above.

[0257] The electronic device may be a mobile phone, a smart screen, a tablet computer, a wearable electronic device, an in-vehicle electronic device, an augmented reality (AR) device, a virtual reality (VR) device, a laptop computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), a projector, or a communication device such as a server, a storage device, a base station, or a smart car, etc. The embodiments of the present application do not impose any restrictions on the specific types of electronic devices.

[0258] An embodiment of the present application also provides a computer-readable storage medium, in which computer instructions are stored; when the computer-readable storage medium is run on an electronic device, the electronic device executes the file processing method shown above.

[0259] The above-mentioned computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the above-mentioned computer instructions may be transmitted from one website, computer, server or data center to another website, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The above-mentioned computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that includes one or more available media integrated therein. The above-mentioned available media may be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium, or a semiconductor medium (e.g., a solid state drive (SSD)), etc.

[0260] The embodiment of the present application also provides a computer program product including computer instructions, which, when executed on an electronic device, enables the electronic device to execute the file processing method shown above.

[0261] The computer storage medium and computer program product provided in the above-mentioned embodiments of the present application are used to execute the method provided above. Therefore, the beneficial effects that can be achieved can refer to the corresponding beneficial effects of the method provided above, and will not be repeated here.

[0262] In the above embodiments, it can also be implemented in whole or in part by software, hardware, firmware or any combination thereof. When software is used for implementation, it can be implemented in whole or in part in the form of a computer program product. The above computer program product includes one or more computer instructions. When the above computer instructions are loaded and executed on a computer, the above process or function according to the embodiment of the present application is generated in whole or in part. The above computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable device. The above computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the above computer instructions can be transmitted from a website site, computer, server or data center by wired (such as: coaxial cable, optical fiber, data subscriber line (Digital Subscriber Line, DSL)) or wireless (such as: infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The above computer-readable storage medium can be any available medium that a computer can access, or a data storage device such as a server, data center, etc. that includes one or more available media integration. The above-mentioned available media can be magnetic media (such as floppy disks, hard disks, magnetic tapes), optical media (such as digital versatile disks (DVD)) or semiconductor media (such as solid-state drives (SSD)), etc.

[0263] The above are optional embodiments provided for the present application and are not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the technical scope disclosed in the present application shall be included in the protection scope of the present application.

[0264] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A file processing method, characterized in that: Used in electronic equipment, including: Scanning the disk of the electronic device through a file monitoring process to obtain multiple file paths; The plurality of file paths are grouped by the file monitoring process to obtain a plurality of groups of file paths, each group of file paths including at least one file path; The file monitoring process adopts a serial mode to send the multiple groups of file paths in batches to a cross-language communication thread pool, wherein the cross-language communication thread pool is used for communication between the file monitoring process and the file compression package written in different computer languages; When each set of file paths is received by the cross-language communication thread pool, the set of file paths is read from the cross-language communication thread pool through the file compression package.

2. The method according to claim 1, characterized in that After reading the set of file paths from the cross-language communication thread pool through the file compression package, the method further includes: Returning a first response message to the cross-language communication thread pool through the file compression package, where the first response message is used to indicate that the file compression package successfully reads the set of file paths; When the first response message is received through the cross-language communication thread pool, a second response message is returned to the file monitoring process through the cross-language communication thread pool, where the second response message is used to instruct the file monitoring process to send the next set of file paths to the cross-language communication thread pool.

3. The method according to claim 2, characterized in that The method further comprises: When the file monitoring process receives the second response message, sending the next set of file paths to the cross-language communication thread pool through the file monitoring process; or When the file monitoring process waits for a preset period of time and still has not received the second response message, the next set of file paths is sent to the cross-language communication thread pool, and the waiting starting point of the file monitoring process is the successful sending of a set of file paths.

4. The method according to claim 2, characterized in that Before returning the second response message to the file monitoring process through the cross-language communication thread pool, the method further includes: A release operation is performed on threads where a group of file paths that have been read are located through the cross-language communication thread pool.

5. The method according to claim 1, characterized in that The scanning of the disk of the electronic device by the file monitoring process to obtain multiple file paths includes at least one of the following: In the case where a file change log is generated on the disk of the electronic device, scanning the file change log by the file monitoring process to obtain the multiple file paths; In the case where the search application is installed for the first time on the electronic device, scanning the disk of the electronic device through the file monitoring process to obtain the multiple file paths; When the electronic device changes from a closed state to an open state, scanning the disk of the electronic device through the file monitoring process to obtain the multiple file paths; When the search application starts to run, the file monitoring process scans the disk of the electronic device to obtain the multiple file paths.

6. The method according to claim 5, characterized in that Generating the file change log on the disk of the electronic device includes: In response to a file change operation of a user, the file change log corresponding to the file change operation is generated on the disk, and the file change operation includes at least one of the following: creating, modifying, and deleting.

7. The method according to claim 1, characterized in that The step of grouping the multiple file paths through the file monitoring process to obtain multiple groups of file paths includes: Determining a grouping basis through the file monitoring process, wherein the grouping basis includes at least one of the following: a total number of file paths, a file type of files on the file path, a size of files on the file path, a change time of files on the file path, and a user-specified priority; The multiple file paths are grouped according to the grouping basis through the file monitoring process to obtain the multiple groups of file paths.

8. The method according to claim 7, characterized in that The grouping basis is the total number of the file paths; The step of grouping the plurality of file paths by the file monitoring process according to the grouping basis to obtain the plurality of groups of file paths includes: According to the current power consumption and / or performance of the electronic device, determining the number of file paths that can be included in each group of file paths through the file monitoring process; According to the number of file paths that each group of file paths can contain and the total number of file paths, the multiple file paths are grouped through the file monitoring process to obtain the multiple groups of file paths.

9. The method according to claim 1, characterized in that After reading the set of file paths from the cross-language communication thread pool through the file compression package, the method further includes: Reading a file on each file path in the set of file paths through the file compression package; Analyze the files on each file path through the file compression package to obtain analysis results; Constructing corresponding index keywords for the files on each file path based on the analysis result through the file compression package; A file index library is generated according to the files on each file path and the corresponding index keywords.

10. The method according to any one of claims 1 to 9, characterized in that The method further comprises: In the case where a search request is received during the processing of the plurality of groups of file paths, suspending the processing operation of the plurality of groups of file paths in response to the search request; Parsing the search keyword carried in the search request; Searching the file index library generated by the file compression package for an index keyword matching the search keyword and a file corresponding to the index keyword to obtain a first search result; The first search result is displayed.

11. The method according to claim 10, characterized in that After displaying the first search result, the method further includes: Continue to execute the processing operation on the multiple groups of file paths; After the processing operations of the plurality of groups of file paths are completed, re-executing the search request to obtain a second search result; The second search result is displayed.

12. The method according to claim 11, characterized in that After the processing operations on the multiple groups of file paths are completed, re-executing the search request to obtain a second search result includes: After the processing operations of the plurality of groups of file paths are completed, a prompt message is issued, wherein the prompt message is used to prompt the user to re-execute the search request; In response to a re-triggering operation on the search request, the search request is re-executed to obtain a second search result.

13. An electronic device, characterized in that: The electronic device includes: one or more processors, and a memory; The memory is coupled to the one or more processors, and the memory is used to store computer program codes, wherein the computer program codes include computer instructions, and the one or more processors call the computer instructions to enable the electronic device to perform the method according to any one of claims 1 to 12.

14. A computer-readable storage medium, characterized in that: The computer-readable storage medium comprises instructions, which, when executed on an electronic device, enable the electronic device to perform the method as claimed in any one of claims 1 to 12.

Citation Information

Patent Citations

  • Industrial high-resolution data rapid cluster storage search system and method

    CN111898003A

  • Data processing method and device, storage medium and electronic equipment

    CN114372069A