Document scanning methods and terminal devices
By reading the prediction results from the external storage device in the terminal device and prioritizing the scanning of important files based on user usage data, the problem of low scanning efficiency of the terminal device is solved, enabling fast access to files in the external storage device and improving the user experience.
Patent Information
- Application Number
- CN202011070044.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-30
- Publication Date
- 2025-11-14
- Estimated Expiration
- 2040-09-30
AI Technical Summary
In existing technologies, terminal devices have low efficiency in scanning files on external storage devices, resulting in users having to wait a long time before they can access the files, leading to a poor user experience.
When an external storage device is detected, its associated prediction results are read, and files that need to be scanned are determined based on the user's historical usage data. These files are scanned first, and then the remaining files are scanned until all files are scanned.
The required files can be accessed very quickly after the external storage device is connected, greatly improving the user experience and scanning efficiency.
Smart Images

Figure CN114328401B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of document scanning technology, and in particular relates to document scanning methods and terminal equipment. Background Technology
[0002] External storage devices (such as optical discs, USB flash drives, and portable hard drives) are highly portable. Users can store files on external storage devices and then connect them to the terminal device when needed. After detecting the connection of the external storage device, the terminal device will scan the files on the external storage device and provide users with services such as browsing and editing the scanned files.
[0003] With technological advancements, the capacity of external storage devices is increasing. For example, 128-gigabyte (GB), 256GB, and even 512GB USB flash drives are gradually appearing on the market, along with 512GB, 1-terabyte (TB), 2TB, and even 5TB portable hard drives. On the one hand, large-capacity external storage devices can store more files, meeting the needs of more users. However, on the other hand, due to the limited scanning speed of terminal devices, when there are many files on the external storage device, the scanning time often becomes long. This results in users having to wait a considerable amount of time before accessing the files on the external storage device, leading to a poor user experience. Summary of the Invention
[0004] In view of this, embodiments of this application provide a file scanning method and a terminal device, which can solve the problem that the terminal device has low efficiency in scanning files in external storage devices in the prior art, causing users to have to wait a long time before they can use the files.
[0005] A first aspect of this application provides a document scanning method applied to a terminal device including the proximity sensor, comprising:
[0006] When an external storage device is detected to be connected, the prediction result associated with the external storage device is read.
[0007] One or more files are determined from the external storage device based on the prediction results; the prediction results are data obtained by analyzing the user's historical usage data of files in the external storage device.
[0008] Scan the one or more files in the external storage device;
[0009] After scanning one or more files, the remaining unscanned files in the external storage device are scanned.
[0010] In this embodiment, each time an external storage device is connected, the terminal device prioritizes scanning the files predicted by the user based on the previous connection (i.e., the files determined according to the prediction results). After completing the scanning of these files, it continues to scan other files on the external storage device until all files on the external storage device have been scanned. This allows this embodiment to scan the files needed by the user in a timely manner. The user can access the required files within a very short time after the external storage device is connected, thus greatly improving the user experience.
[0011] In a first possible implementation of the first aspect, reading the prediction result associated with the external storage device when the external storage device is detected to be connected includes:
[0012] When an external storage device is detected to be connected, it is determined whether the external storage device is being connected to the terminal device for the first time.
[0013] If the external storage device is not being connected to the terminal device for the first time, then the prediction result associated with the external storage device is read.
[0014] In this embodiment, the case of non-first-time access to the external storage device is processed, so that the user can access the required files in a very short time after the external storage device is accessed, thereby greatly improving the user experience.
[0015] In a second possible implementation of the first aspect, the prediction result includes file types, and determining one or more files from the external storage device based on the prediction result includes:
[0016] Identify the file types of each file in the external storage device;
[0017] Select one or more files from the external storage device whose file types belong to the file types included in the prediction results.
[0018] In this embodiment, analysis and prediction are performed based on file type, enabling the determination of user file type habits. Therefore, this embodiment can better analyze user habits, making predictions more accurate and reliable.
[0019] Based on the second possible implementation of the first aspect, in the third possible implementation of the first aspect, identifying the file types of each file in the external storage device includes:
[0020] Obtain the update time and file type of each file in the external storage device;
[0021] Based on the update time and the file type, the file type of each file in the external storage device is identified.
[0022] In this embodiment, file types are categorized by update time and file type, thus enabling the assessment of user habits across both update time and file type dimensions. Therefore, this embodiment can better analyze user habits, leading to more accurate and reliable predictions.
[0023] Based on the third possible implementation of the first aspect, in the fourth possible implementation of the first aspect, identifying the file type of each file in the external storage device according to the update time and the file type includes:
[0024] The update status of each file in the external storage device is determined based on the update time and the preset duration threshold.
[0025] Based on the update status and the file type, identify the file type of each file in the external storage device.
[0026] In this embodiment of the application, the update status of a file is distinguished based on the update time and duration threshold, which can achieve accurate differentiation of the update status.
[0027] As an embodiment of this application, a file can be divided into two update states: "previous" and "recent". "Previous" refers to a file whose update time is greater than a duration threshold than the current time, while "recent" refers to a file whose update time is less than or equal to the current time.
[0028] In a fifth possible implementation of the first aspect, the prediction result includes one or more file addresses, and determining one or more files from the external storage device based on the prediction result includes:
[0029] Locate one or more files pointed to by the one or more file addresses from the external storage device.
[0030] In this embodiment, user habits are analyzed by examining the file addresses of files on external storage devices, and the prediction results are stored. This allows the embodiment to accurately and quickly locate the specific file required by the user. Therefore, this embodiment can better analyze user habits, making predictions more accurate and reliable, while effectively improving the speed of priority scanning.
[0031] In a sixth possible implementation of the first aspect, after determining one or more files from the external storage device based on the prediction result, the method further includes:
[0032] Record the user's first usage data of files in the external storage device;
[0033] The first set of data was analyzed to obtain the analysis results;
[0034] The prediction results are updated using the analysis results.
[0035] In this embodiment, each time the external storage device is connected, the terminal device records the user's usage data of files on the external storage device during use. Simultaneously, it analyzes the user's usage habits based on the data, predicts the files the user will need next, and stores the prediction results. Based on this, each time the external storage device is connected (except for the initial connection), the terminal device determines one or more files to be scanned first based on the prediction results and scans these first. After completing the scanning of these files, it continues scanning other files on the external storage device. Therefore, this embodiment can scan the files needed by the user in a timely manner. The user can access the required files within a very short time after the external storage device is connected, thereby greatly improving the scanning efficiency of the terminal device on the files on the external storage device and enhancing the user experience.
[0036] Based on the sixth possible implementation of the first aspect, in the seventh possible implementation of the first aspect, the first usage data is the second file type of the first file used by the user on the external storage device;
[0037] The analysis of the first used data to obtain the analysis results includes:
[0038] After the terminal device is connected to the external storage device once, obtain the first file type of the first file used by the user on the external storage device;
[0039] Obtain multiple category pairs and the distance between each category pair, wherein each category pair consists of two file categories, and the distance value of the category pair is negatively correlated with the correlation between the two file categories within the category pair;
[0040] From the plurality of category pairs, a first category pair and all second category pairs are selected, wherein the first category pair is a category pair consisting of the first file type and the second file type, and the second category pair is a category pair that includes the first file type but does not include the second file type;
[0041] Decrease the distance between the first type pairs and increase the distance between the second type pairs;
[0042] Filter out all third type pairs from the plurality of type pairs, wherein the third type pairs are type pairs that contain the second file type;
[0043] From the third type of pairs, select the q pairs of pairs with the shortest distance, where q is a positive integer;
[0044] From the file types included in the q type pairs, all file types other than the second file type are filtered out, and all the filtered file types are used as the analysis result.
[0045] In this embodiment, analysis and prediction are performed based on file type, achieving evaluation across two dimensions: update time and file type. Furthermore, by adjusting the distance between file types, the relevance of file types is quantified and adjusted, thereby enabling adaptive learning and adjustment based on user habits. Therefore, this embodiment can better analyze user habits, making predictions more accurate and reliable.
[0046] Based on the seventh possible implementation of the first aspect, in the eighth possible implementation of the first aspect, during the process of decreasing the distance of the first type pair and increasing the distance of the second type pair:
[0047] The distance increase is the same for each of the second type pairs, and the sum of the distances of the multiple type pairs remains unchanged.
[0048] In this embodiment, the distance increment for each second type pair is the same, ensuring fairness in each relevance adjustment. Keeping the total distance L constant guarantees balance under the overall relevance adjustment, thus ensuring the reliability of the adjusted relevance.
[0049] A second aspect of this application provides a document scanning apparatus, which includes:
[0050] The result reading module is used to read the prediction result associated with the external storage device when the external storage device is detected to be connected.
[0051] The file determination module is used to determine one or more files from the external storage device based on the prediction results, wherein the prediction results are data obtained by analyzing the user's historical usage data of files in the external storage device.
[0052] The file scanning module is used to scan one or more files in the external storage device.
[0053] The file scanning module is also used to scan the remaining unscanned files in the external storage device after the scanning of the one or more files is completed.
[0054] A third aspect of this application provides a terminal device, the terminal device including a memory and a processor, the memory storing a computer program executable on the processor, and the processor executing the computer program causing the terminal device to implement the steps of the file scanning method as described in any of the first aspects above.
[0055] A fourth aspect of this application provides a computer-readable storage medium, comprising: storing a computer program, wherein when executed by a processor, the computer program causes a terminal device to implement the steps of the file scanning method as described in any of the first aspects above.
[0056] A fifth aspect of this application provides a computer program product that, when run on a terminal device, causes the terminal device to execute the file scanning method described in any of the first aspects above.
[0057] A sixth aspect of this application provides a chip system including a processor coupled to a memory, the processor executing a computer program stored in the memory to implement the file scanning method described in any of the first aspects above.
[0058] The chip system can be a single chip or a chip module composed of multiple chips.
[0059] It is understood that the beneficial effects of the second to sixth aspects mentioned above can be found in the relevant descriptions in the first aspect mentioned above, and will not be repeated here. Attached Figure Description
[0060] Figure 1A This is a schematic diagram of the process of a terminal device scanning files on an external storage device according to an embodiment of this application;
[0061] Figure 1B This is a schematic diagram of the process of a terminal device scanning files on an external storage device according to an embodiment of this application;
[0062] Figure 2 This is a flowchart illustrating the implementation of a document scanning method provided in an embodiment of this application;
[0063] Figure 3 This is a flowchart illustrating the implementation of a document scanning method provided in an embodiment of this application;
[0064] Figure 4 This is a flowchart illustrating the implementation of a document scanning method provided in an embodiment of this application;
[0065] Figure 5 This is a schematic diagram of an application scenario provided by an embodiment of this application;
[0066] Figure 6A This is a schematic diagram of an application scenario provided by an embodiment of this application;
[0067] Figure 6B This is a schematic diagram of an application scenario provided by an embodiment of this application;
[0068] Figure 6C This is a schematic diagram of an application scenario provided by an embodiment of this application;
[0069] Figure 7 This is a type-to-distance data map in a document scanning method provided in an embodiment of this application;
[0070] Figure 8 This is a schematic diagram of the structure of the document scanning device provided in the embodiments of this application;
[0071] Figure 9 This is a schematic diagram of the structure of an electronic device to which the document scanning method provided in one embodiment of this application is applicable;
[0072] Figure 10 This is a software system architecture diagram of a terminal device provided in an embodiment of this application. Detailed Implementation
[0073] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.
[0074] To facilitate understanding of this application, the embodiments of this application will be briefly described below:
[0075] In practical applications, users can store files on external storage devices and connect them to the terminal device when needed. Upon detecting the connection of the external storage device, the terminal device will scan the external storage device for files. (See reference...) Figure 1A This diagram illustrates the scanning process of files on an external storage device by a terminal device. Essentially, the scanning process involves the terminal device reading the attribute data of each file on the external storage device, such as thumbnails, filenames, file sizes, file types, and file paths (i.e., file addresses) for image files, and storing this attribute data (i.e., the scan results) in the terminal device's local database. Simultaneously, this attribute data is retrieved from the database and displayed to the user through the terminal device. Therefore, during the scanning process, the user can view and use scanned files at any time on the terminal device. However, for files that are not yet fully scanned, the user must wait until the scan is complete before viewing and using them.
[0076] With the development of technology, the capacity of external storage devices is getting larger and larger, and their ability to store files is getting stronger and stronger. However, due to limitations in the hardware of external storage devices, the hardware and software of terminal devices, and the connection between the two, the speed at which terminal devices can scan files on external storage devices is relatively limited.
[0077] In one related technology, the scanning method for external storage devices is traversal scanning. That is, traversing the attribute data of each file in the external storage device to complete the scanning of files within the external storage device.
[0078] While traversal scanning can scan files on external storage devices, it only scans sequentially according to the folder order within the device. When a large number of files are stored on the external storage device, a traversal scan often fails to find the desired file in a timely manner if the user wants to access specific files. For the user, if the traversal scan hasn't found the desired file, they must wait indefinitely. The entire waiting time is unpredictable, and the real-time scanning status is unknown. During this waiting period, the user can try to find the desired file on the external storage device, but if the file hasn't been scanned completely, they won't be able to see it. This results in a poor user experience regarding the entire waiting process. Ultimately, in practical applications, users often have to wait for the terminal device to complete the traversal scan of the external storage device before they can operate the external storage device and access the files they need. In summary, traversal scanning is inefficient for users, requires a long waiting time, and leads to a poor user experience.
[0079] To shorten user wait time and allow users to access required files within a short period after connecting an external storage device to the terminal device, one possible approach is to omit scanning some time-consuming attribute data and only perform traversal scanning on the less time-consuming attribute data of the file. For example, one could refer to... Figure 1B This is a diagram illustrating the file scanning process in this method. (And...) Figure 1A In contrast, this method skips scanning file thumbnails for images and videos. While this improves overall file scanning speed, it misses a significant amount of important information, resulting in incomplete file attribute data for the user. Furthermore, this method still uses a traversal scan, so the files the user actually needs may not be scanned promptly. This forces users to wait a considerable amount of time before accessing files on external storage devices, leading to a poor user experience.
[0080] In this embodiment, each time the external storage device is connected, the terminal device records the user's usage data for files on the external storage device. Simultaneously, it analyzes the user's usage habits based on this data, predicting and recording the files the user will need next. Based on this, each time the external storage device is connected (except for the initial connection), the terminal device prioritizes scanning the files predicted for the user's needs after the previous connection. After completing the scanning of these files, it continues scanning other files on the external storage device until all files on the external storage device have been scanned.
[0081] By recording each user's file usage data and predicting the files the user will need next based on that data, and prioritizing the scanning of previously predicted files during each scan, this embodiment of the application can promptly scan for the files the user needs. Users can access the required files very quickly after the external storage device is connected, thus greatly improving the user experience.
[0082] Meanwhile, some terms and concepts that may be involved in the embodiments of this application are explained as follows:
[0083] File type: This refers to the type of file, including video, audio, images, and documents. In some embodiments, the file type can be determined by the file format. For example, common video formats include mp4, avi, mkv, mov, and rmvb. Common audio formats include mp3, wav, and wma. Common image formats include jpg, gif, png, and bmp. Common document formats include txt, doc, xls, ppt, pdf, and html. When the file format is read, the file type can be determined. In some embodiments of this application, file types are divided into five categories: video, audio, images, documents, and others. "Others" includes all types other than video, audio, images, and documents.
[0084] File Categories: In some embodiments of this application, files are categorized into different types (i.e., file categories) to predict user habits. During prediction, a single file category is used as the evaluation unit to determine the file types the user is likely to use next. The method of classifying file categories is not limited here and can be set by technical personnel according to actual needs. For example, file category can be set as file type; in this case, file category and file type are the same concept.
[0085] In some optional embodiments of this application, files can be categorized by combining two dimensions: file type and update time, to analyze user habits regarding file type and update time. For example, a duration threshold can be set, and the difference between the file update time and the current time can be calculated each time an external storage device is connected. The file is then categorized into two update states ("recently updated" and "previous updated") based on the difference and the duration threshold. If the difference is greater than the duration threshold, it is considered a previous update; if the difference is less than or equal to the duration threshold, it is considered a recent update. Finally, the update state and file type are combined to obtain the file category. As an optional embodiment of this application, some or all file types can be selected for permutation and combination. For example, assuming there are M file types, m of them can be selected for permutation and combination, resulting in 2m file categories. As an optional embodiment of this application, the remaining Mm file types that are not included in the permutation and combination can be left unanalyzed. If the user uses these Mm file types in actual operation, they do not need to be recorded. Where M is a positive integer greater than 1, and m∈[1,M]. The specific size of m can be set by technical personnel according to actual needs, and is not limited here.
[0086] As another optional embodiment of this application, based on the permutations and combinations in the previous embodiment, the remaining file types that did not participate in the permutations and combinations can also be treated as separate Mm file types. In this case, 2m + (Mm) = M + m file types can be obtained.
[0087] Let's illustrate this with an example. Suppose we categorize file types into five types: video, audio, image, document, and others. We then select four of these—video, audio, image, and document—as our analysis objects. Combining these file types with their update status yields eight file categories: recent video, recent audio, recent image, recent document, previous video, previous audio, previous image, and previous document. However, if we also consider the remaining file types that weren't combined as separate categories, "other" can be treated as a single file category. Therefore, we would have nine file categories: recent video, recent audio, recent image, recent document, previous video, previous audio, previous image, previous document, and others.
[0088] Usage data refers to data related to a user's use of files on an external storage device within a terminal device. This includes information such as the files used, their file types, and update times. Usage data is used to analyze user habits and predict the files the user will use the next time the external storage device is accessed. Therefore, the actual content of the usage data depends on the prediction method used. For example, in some embodiments, if the prediction method requires all files used by the user and their file types, the usage data may only include the files used by the user after each access to the external storage device, excluding their update times. In other embodiments, if the prediction method only requires the file type and update time of the first file used by the user after accessing the external storage device, the usage data may only include the file type and update time of the first file used by the user after accessing the external storage device, excluding data related to the second or third used files. The usage data can be stored in a local database on the terminal device or temporarily cached and deleted after analysis.
[0089] External storage device: This application does not impose excessive limitations on the type of external storage device, which can be determined according to the actual application scenario. For example, it can be a USB flash drive, memory card, floppy disk, hard disk (including portable hard disk), or optical disk, or other types of external storage devices. In addition, for ease of explanation, in the following embodiments of this application, unless otherwise specified, "file" refers to "files in external storage devices".
[0090] Connecting External Storage Devices to Terminal Devices: The connection method for external storage devices can vary depending on the type of external storage device and the terminal device. Therefore, the specific connection method needs to be determined based on the actual application scenario. For example, when the external storage device is a USB flash drive and the terminal device is a device with a USB flash drive port (such as a computer), connection means inserting the USB flash drive into the terminal device's port. When the external storage device is a portable hard drive, connection means connecting the hard drive to the terminal device via a data cable or similar means. When the external storage device is an optical disc, connection means inserting the optical disc into the terminal device's optical drive.
[0091] Disconnecting an external storage device from a terminal device: This is the opposite of "connecting an external storage device to a terminal device." The method of disconnection can vary depending on the type of external storage device and the connection method. For example, if the connection method is insertion, the disconnection method is removal. If the connection method is via a data cable, the disconnection method is disconnecting the data cable. If the connection method is inserting a CD into the terminal device's CD drive, the disconnection method is ejecting the CD from the terminal device.
[0092] The process of a terminal device using an external storage device (hereinafter referred to as the usage process) is the process that begins when the external storage device is connected to the terminal device and ends when the external storage device is disconnected from the terminal device. In practical applications, the time from the connection of the external storage device to the start of file scanning on the external storage device is extremely short. Furthermore, the user cannot access the files on the external storage device before the file scanning begins. Therefore, the starting point of the usage process can also be the moment when the terminal device begins scanning the external storage device.
[0093] During use, users may access files on external storage devices at any time, and the content, quantity, and timing of these operations are unpredictable. In this embodiment, the terminal device records usage data for each usage session and analyzes this data to predict the files the user will need in the next session.
[0094] File update time: Also known as modification date, this refers to the time when a file was last updated on an external storage device. Update operations include, but are not limited to, modifying file content, modifying file format, and writing files to external storage devices. When multiple update operations occur, the update time refers to the time of the most recent update operation.
[0095] The document scanning method provided in this application embodiment can be applied to terminal devices such as mobile phones, computers (including tablets, laptops and desktops), televisions and wearable devices. In this case, the terminal device is the execution subject of the document scanning method provided in this application embodiment. This application embodiment does not impose any restrictions on the specific type of terminal device.
[0096] Furthermore, this application does not impose excessive limitations on the operating system type of the terminal device. Theoretically, the technical solutions of this application can be applied to any operating system. Therefore, the operating system to be applied can be determined according to the actual terminal device. For example, it can be Android, HarmonyOS, Windows, or Linux.
[0097] To illustrate the technical solution described in this application, the following will divide the access of external storage devices to terminal devices into the first access and the nth access, where n≥2, according to the time sequence of a single external storage device accessing the terminal device. Specific embodiments will then be used to illustrate the process in this order.
[0098] Figure 2 A flowchart illustrating the implementation of the file scanning method provided in this application is shown below, and is described in detail below:
[0099] Users can select the external storage device they need and connect it to the terminal device.
[0100] After detecting the access of an external storage device, the terminal device will identify whether the external storage device is being accessed for the first time. If it is the first access, it will proceed to stage one. If it is not the first access, it will proceed to stage two. This application embodiment does not impose excessive limitations on the method for identifying whether the external storage device is being accessed for the first time; it can be set by those skilled in the art.
[0101] Additionally, as an optional embodiment of this application, if the terminal device is running the Android system, the terminal device will send a mount broadcast after detecting the access of an external storage device to inform applications, etc., that the external storage device has been accessed.
[0102] As an optional method for identifying whether an external storage device is being accessed for the first time in this application, this embodiment can be configured to record the unique identifier of the external storage device each time it is accessed. Based on this, the terminal device, upon detecting the access of the external storage device, will obtain the unique identifier of the external storage device and determine whether the unique identifier has been recorded before. If the unique identifier has not been recorded in the terminal device, it means that the external storage device has not yet been accessed by the terminal device. That is, this is the first time the external storage device has been accessed by the terminal device. Conversely, if the unique identifier has been recorded in the terminal device, it means that the external storage device has been accessed by the terminal device before. This embodiment does not limit the type of unique identifier, which can be set by those skilled in the art. For example, it can be a universally unique identifier (UUID) for the external storage device.
[0103] Phase 1: The external storage device is the first time it is connected to the terminal device.
[0104] When the external storage device is being connected to the terminal device for the first time, in chronological order, this will include two types of operations: Operation 11 and Operation 12.
[0105] Operation 11: Perform a file scan on the external storage device.
[0106] When an external storage device is connected for the first time, theoretically, the user has not used the external storage device on the terminal device before. Therefore, it is impossible to obtain user usage data for the external storage device at this time, making it difficult to predict the user's usage habits. Based on this reality, this application embodiment pre-sets a default method for scanning files on the external storage device, and uses this default method to perform file scanning when the external storage device is detected to be connected for the first time. This application embodiment does not impose many limitations on the default method, which can be set by those skilled in the art according to actual needs. For example, a traversal scan can be used as the default method, or a pre-set order of different file types can be configured, and the default method can be set to scan files sequentially according to file type order.
[0107] Operation 12: The terminal device records the user's file usage data and analyzes the user's usage habits based on the data to predict the user's next file needs.
[0108] After the external storage device is connected, the terminal device scans the files on the external storage device and simultaneously begins recording and analyzing the user's usage data (which can also be called the first usage data). Corresponding to the two operations of recording and analyzing usage data, operation 12 can also be divided into two operations: operation a and operation b.
[0109] Operation a: The terminal device records the user's file usage data.
[0110] Since the content of the usage data needs to be determined based on the prediction method for the user's next file requirement, in this embodiment of the application, technicians need to pre-set the prediction method to be used and the corresponding usage data content to be collected.
[0111] As an optional embodiment of this application, the recording of usage data during each use is divided into two possible cases:
[0112] Scenario 1: The usage data to be recorded may be continuous throughout the entire usage process. For example, the usage data may be defined as all files and file types used by the user during this usage session. In this case, since it is impossible to predict when the user will use which files, usage data needs to be recorded for the entire usage process. The recording of usage data is only completed when the external storage device is disconnected from the terminal device.
[0113] Scenario 2: The usage data to be recorded only exists during a portion of the usage process. For example, the usage data can be defined as: the file type and update time of the first file used by the user after the external storage device is connected. If the user uses a file at this point, the terminal device can record the usage data. Subsequent user operations on the file will not affect the recording of the usage data.
[0114] As explained above regarding scenarios 1 and 2, the time period for the operation related to the usage data may vary depending on the content of the usage data. The prediction of the user's next file request is based on the recorded usage data. Therefore, in this embodiment, depending on the prediction method, the prediction of the user's next file request can occur either during or after the usage process.
[0115] As an optional embodiment of this application, it can be configured to analyze the usage data after the terminal device finishes using the external storage device, and predict the files that the user will need next.
[0116] Operation b: Analyze user habits based on usage data to predict the files the user will need next.
[0117] Based on the obtained usage data, this application embodiment will use a preset prediction method to process the usage data, realize the analysis of user usage habits, and obtain corresponding prediction results. This application embodiment does not impose excessive limitations on the specific prediction method, which can be set by technicians according to actual needs.
[0118] Furthermore, while the prediction results can identify one or more files, the content of these results can vary depending on the prediction method used. For example, in some optional embodiments, the prediction result may be one or more specific file addresses on an external storage device (hereinafter referred to as file addresses). In this case, the terminal device can accurately locate one or more files on the external storage device based on the file addresses. In other optional embodiments, the prediction result may also be data such as update time, file type, or file category. In this case, the terminal device can filter out one or more files on the external storage device based on the prediction result and file attributes. Therefore, this application does not impose excessive limitations on the content of the prediction results, which can be determined according to the actual prediction method used.
[0119] In some optional embodiments of this application, the following optional prediction methods are provided:
[0120] Prediction Method 1: Record the file type of the first file the user uses during this process, and predict the file type the user will need next. The prediction result will then be a single file type. Based on this, the next time the external storage device is connected, the terminal device will prioritize scanning all files of that file type on the external storage device.
[0121] Prediction Method 2: Pre-set the file category classification rules as: the permutation and combination results of file update status and file type, such as recent video, recent audio, recent picture, recent document, previous video, previous audio, previous picture and previous document.
[0122] The system records the file type and update time of the first file used by the user during this usage session, and identifies the file category based on the file type and update time. This file category is then used to predict the file category of the next file the user will need. At this point, the predicted file category is determined. Based on this, the next time the external storage device is connected, the terminal device will first scan the file type and update time of each file on the external storage device and identify the file category of each file. Then, it will scan all files under that file category.
[0123] Prediction Method 3: Record all files used by the user during this usage session, filter out the most frequently used files, and predict the file types of these files as the file types the user will need next time. The prediction result will then be one or more file types (the user may have only used one type of file, in which case only one file type will be predicted). Based on this, the next time the external storage device is connected, the terminal device will prioritize scanning all files of that file type on the external storage device. The specific number of files to be filtered can be set by the technical staff and is not limited here. For example, it can be set to any value between 1 and 1000, or other values.
[0124] Considering that users' file usage habits tend to follow certain patterns, they often use the files they actually need more frequently than other, less needed files. Therefore, by identifying the most frequently used files and recording their corresponding file types, we can analyze user habits and effectively predict the types of files users need.
[0125] Prediction Method 4: Record all files used by the user during this usage session, filter out the most frequently used files, and predict the file addresses of these files as the file addresses of the files the user will need next. The prediction result will then be one or more file addresses. Based on this, the terminal device will prioritize scanning these addresses on the external storage device the next time it is connected, thus achieving priority scanning of these files. This prediction method is based on the same principle as Prediction Method 3 above, so please refer to the explanation of Prediction Method 3. However, this prediction method does not use file type but specific file addresses, thus achieving higher precision. This allows for more accurate file location. Compared to Prediction Method 3, theoretically, the number of file data that can be found will be reduced.
[0126] In practical applications, technicians may select any one of the above four prediction methods as the preset prediction method in the embodiments of this application, or may use other methods besides the above four prediction methods as the preset prediction method in the embodiments of this application. The embodiments of this application do not impose excessive limitations.
[0127] After predicting the file the user will need next, this embodiment of the application stores the prediction result locally on the terminal device.
[0128] As another optional method for identifying whether an external storage device is being accessed for the first time in this application, considering that in this embodiment, the terminal device analyzes the user's usage data each time an external storage device is accessed and stores the resulting prediction results locally, theoretically, except for the initial access, the terminal device will have the corresponding prediction results for the external storage device each time it is accessed. Based on this, this embodiment can search for the corresponding prediction results for the external storage device after it is accessed. If found, it indicates that it is not the first access. Conversely, if not found, it indicates that it is the first access.
[0129] Phase 2: The external storage device is connected for the nth time, where n ≥ 2. (Phase 1 can be considered as the case where n = 1)
[0130] If the external storage device is not being connected to the terminal device for the first time, then according to the chronological order of occurrence, this will also include two types of operations: Operation 21 and Operation 22.
[0131] Operation 21: Perform a file scan on the external storage device.
[0132] For cases where the external storage device is not being used for the first time, the terminal device will store the predicted file type for the user after the last connection. (Reference) Figure 3 At this time, the embodiments of this application will perform the following operations S101-S103:
[0133] S101, read the prediction results associated with the external storage device, and determine one or more files that need to be scanned first based on the prediction results.
[0134] Since the terminal device analyzes and predicts user habits each time an external storage device is connected, and stores the prediction results locally, theoretically, the terminal device can read the locally stored prediction results every time an external storage device is connected (except for the first connection). Based on this, the embodiments of this application will analyze the prediction results to determine the files that need to be scanned first.
[0135] As described in the explanation of operation b within stage one, the prediction result may contain various contents. Therefore, in this embodiment, the operation of determining the file based on the prediction result, corresponding to different contents, may also have multiple implementation methods. For example, the following situations may exist:
[0136] 1. If the prediction result is one or more file addresses, you can directly search for the corresponding files on the external storage device based on these file addresses.
[0137] 2. If the prediction result is a directly readable attribute such as file type or update time, the terminal device needs to first scan all files on the external storage device for these attributes and file addresses. Then, based on the prediction result and the scanned attributes, it filters out one or more files corresponding to the prediction result. Finally, based on the file addresses of these files, it quickly locates the specific file.
[0138] For example, suppose the predicted file type is "video". The terminal device will then scan all files on the external storage device for their file types and addresses, filtering out all video files. Based on the file addresses of these video files, it will quickly locate the video files and prioritize their scanning.
[0139] It should be noted that in practical applications, file attributes such as address, file type, and update time are all attributes that the terminal device can scan very quickly. Actual testing shows that scanning the address, file type, and update time of all files on external storage devices takes an extremely short time (to the user's perception, this time is so short that the user can barely perceive the difference). Therefore, it has virtually no impact on the overall file scanning efficiency.
[0140] 3. If the prediction result is a composite attribute such as file type that cannot be directly read, this application embodiment will first pre-set the basic attributes required to classify these composite attributes. For example, it is assumed that the file types are classified according to the file's update status and file type. In this case, the basic attributes corresponding to the type include: update time and file type.
[0141] After setting the basic attributes required for the composite attribute, the terminal device first scans all files on the external storage device for these basic attributes and file addresses (if the basic attributes already contain the file address, only the basic attributes need to be scanned). Then, based on these basic attributes and the prediction results, it filters out one or more files corresponding to the prediction results. And based on the file addresses of these files, it quickly locates the specific file. This application provides two optional file filtering methods:
[0142] a. The terminal device determines the composite attributes corresponding to each file based on the scanned basic attributes. Then, based on the prediction results and the composite attributes of each file, it filters out one or more corresponding files. For example, assuming the composite attribute is file type, the required basic attributes include file type and update time. In this case, the terminal device will determine the file type to which each file belongs based on its file type and update time. Then, it filters out all files whose file type matches the file type in the prediction results. For example, assuming the predicted file type is recent video, this embodiment of the application will filter out all files belonging to recent video.
[0143] b. Decompose the composite attribute in the prediction result into one or more corresponding basic attributes, and then match the basic attributes of each scanned file based on these basic attributes to filter out one or more files that successfully match. For example, assuming the composite attribute is file type, the required basic attributes include file type and update time. In this case, the terminal device will decompose the composite attribute in the prediction result into the corresponding file type and update time, and then perform attribute matching on each file based on the decomposed file type and update time. For example, assuming the duration threshold for the "recent" and "previous" update states is set to half an hour, and the predicted file type is recent video, this embodiment will match each file and filter out all files whose update time is within half an hour of the current time and whose file type is video.
[0144] In practical applications, technicians can choose any of the above-mentioned document filtering methods to filter documents, or they can design or choose other methods to filter documents. No further restrictions are imposed here.
[0145] S102, scan the one or more files in the external storage device.
[0146] S103: After scanning the one or more files, scan the remaining unscanned files in the external storage device.
[0147] After identifying all files that need to be prioritized for filtering, this embodiment of the application first scans the attribute data of these files on the external storage device. After completing the scan of these files, the terminal device then continues to scan other files on the external storage device.
[0148] For attributes already scanned during the process of determining priority files in S101, there is no need to scan the attribute data again. For example, suppose S101 has already scanned the file address, file type, and update time of each file. In this case, S102 and S103 do not need to scan these attribute data of the files again, but instead continue to scan attribute data such as file name, file size, and thumbnail.
[0149] Operation 22: Record user file usage data and analyze user habits based on this data to predict the files the user will need next. Operation 22 can also be divided into two operations: usage data recording and usage data analysis.
[0150] After the external storage device is connected, the terminal device scans the files on the external storage device and simultaneously begins recording the user's usage data for the files on the external storage device (this recorded usage data can also be referred to as the first usage data), and then analyzes it. The specific operational details, principles, and beneficial effects of operation 22 can be found in the relevant description of operation 12, and will not be repeated here. Furthermore, after predicting the files the user will need next, this embodiment of the application stores the prediction results locally on the terminal device (this prediction result can also be referred to as the analysis result).
[0151] In this embodiment, when storing prediction results, if the terminal device already stores historical prediction results corresponding to the external storage device, the latest prediction result generated will be used to overwrite the historical prediction results. This ensures that for a single external storage device, the terminal device will only have one latest prediction result. In other words, the existing prediction results are updated using the currently obtained analysis results.
[0152] It should be specifically noted that the prediction method used by the terminal device can differ depending on the value of n. That is, multiple prediction methods can be set simultaneously within the terminal device, with the corresponding prediction method assigned to different values of n. For example, prediction method A can be used when n=1 (i.e., when the external storage device is first connected). Prediction method B can be used when n=2. Prediction method C can be used when n>2.
[0153] In this embodiment, each time the external storage device is connected, the terminal device records the user's usage data of files on the external storage device during use. Simultaneously, it analyzes the user's usage habits based on the data, predicts the files the user will need next, and stores the prediction results. Based on this, each time the external storage device is connected (except for the initial connection), the terminal device determines one or more files to be scanned first based on the prediction results and scans these first. After completing the scanning of these files, it continues scanning other files on the external storage device. Therefore, this embodiment can scan the files needed by the user in a timely manner. The user can access the required files within a very short time after the external storage device is connected, thereby greatly improving the scanning efficiency of the terminal device on the files on the external storage device and enhancing the user experience.
[0154] Take an example Figure 2 and Figure 3 The illustrated embodiments are provided as examples and can be referred to for further information. Figure 4 In this embodiment, the terminal device is a smart TV, and the operating system of the terminal device is Android. The smart TV has a scanning process for scanning files on an external storage device. Simultaneously, the smart TV has a local database for storing the predicted results and unique identifiers corresponding to the external storage device, and a file information database for storing real-time scan results. Furthermore, when the user opens a folder containing scanned images or videos, the smart TV synchronously displays thumbnails of the images and videos on the display interface to facilitate browsing and use of the files. The external storage device is a portable hard drive.
[0155] Based on this, the process of a smart TV scanning files on an external storage device in this example is as follows:
[0156] After detecting the connection of an external storage device, the terminal device's operating system sends a mount broadcast to inform applications and other devices that the external storage device has been connected to the smart TV.
[0157] The terminal device obtains the unique identifier of the external storage device and matches it with the unique identifiers already stored in the local database to determine whether the external storage device is being accessed for the first time. If a match is found, the external storage device is determined to be accessed for the first time. If no match is found, the external storage device is determined to be accessed for the first time.
[0158] If this is the first time the external storage device has been connected, the terminal device will initiate a scanning process, performing a file traversal scan of the external storage device according to the folder order. During this process, the scan results will be synchronously stored in the file information database in real time.
[0159] If this is not the first time the external storage device has been connected, the prediction result corresponding to the external storage device will be retrieved from the local database.
[0160] Start the scanning process and pass the prediction results as parameters into the scanning process.
[0161] The scanning process prioritizes scanning the files corresponding to the predicted results, and then iterates through other files. The scan results are simultaneously stored in a file information database in real time.
[0162] Users can browse scanned files by operating the terminal device. In response to user actions, the terminal device retrieves the scan results from the file information database and displays them to the user through the interface. Specifically, when the user opens a folder containing scanned images or videos, the terminal device will simultaneously display thumbnails of the images and videos on the interface.
[0163] The terminal device records the user's file usage data to a local database.
[0164] The terminal device analyzes usage data in the local database using a preset prediction method to obtain a prediction of the files the user will need next. It then uses this prediction result to update the prediction result for external storage devices in the local database.
[0165] right Figures 2 to 4 Several additional notes regarding the illustrated embodiment:
[0166] 1. Considering user privacy issues, permission should be requested from the user before recording user usage data.
[0167] Considering that user data regarding files stored on external storage devices constitutes user privacy data, to protect user privacy and security, in this embodiment, before recording the usage data in operations 12 and 22, the terminal device will first request permission from the user to access the usage data. Operations 12 and 22 will only be executed after the user agrees to grant the terminal device permission.
[0168] In this application, the embodiments do not impose excessive limitations on the method of requesting user permissions, which can be set by technical personnel as needed. For example, in some optional embodiments, the terminal device may request permissions from the user in the form of a pop-up window after detecting the access of an external storage device. Operations 12 and 22 will only be executed after the user agrees to the request. The advantage of this approach is that:
[0169] (1) While performing operations 11 and 21 to scan files on the external storage device, a pop-up window requests access permission from the user. This reuses the time the user spends viewing the pop-up window content, which can more user-friendly increase the available time for file scanning. For the user, the process of viewing the pop-up window content is more visually appealing than simply waiting for the scan, thus improving the user experience.
[0170] To better protect user privacy, in this embodiment, if the user ultimately chooses to deny access to the terminal device, the terminal device can choose to first terminate the existing scanning process and delete the scanned data, and then rescan the external storage device for files.
[0171] (2) By requesting access to files on external storage devices via a pop-up window, users are unlikely to access these files until the pop-up is closed. Therefore, theoretically, no usage data will appear before the pop-up is closed. This ensures complete and accurate recording of user usage data and prevents the recording of usage data without the user's consent. This provides better protection for user privacy.
[0172] For example, you can refer to the following example. Figure 5 At this point, the terminal device is a mobile phone. After detecting the external storage device connected, the mobile phone will... Figure 5 As shown, a pop-up window will appear. This window will display a message informing the user that the phone requires data access permissions. The user can click "Agree" to agree, or click "Deny" to disagree. If the user clicks "Agree," the phone will begin executing either operation 12 or operation 22.
[0173] 2. Figures 2 to 4 The illustrated embodiment can be added to the underlying scanning logic of the terminal device's operating system.
[0174] In the embodiments of this application, it can be Figures 2 to 4 The solution in the illustrated embodiment is added to the underlying scanning logic of the terminal device's operating system. Since the operating system's underlying scanning logic has higher privileges and can be triggered by the operating system in a timely manner, the terminal device can now perform file scanning on external storage devices more efficiently.
[0175] in addition, Figures 2 to 4 The solution illustrated can also be applied to some file management and scanning applications. For example, third-party file managers in Android systems and third-party file search software in Windows systems. Specific configurations can be made by technicians according to actual needs. No further limitations are imposed here.
[0176] 3. During the scanning process, users can view the scanned files at any time. Depending on the actual terminal device, this includes at least two possible scenarios: scenario a and scenario b.
[0177] Scenario a: The terminal device's file management interface preloads some files, and the files scanned first are also preloaded files. In this case, the terminal device will display thumbnails of the first scanned files while simultaneously scanning the first files. This achieves the effect of "displaying upon access".
[0178] For example, you can refer to the following example. Figure 6A At this time, the terminal device is a mobile phone. Figure 6A This refers to the main file management interface of the phone (the first screen after opening the file manager) when an external storage device is connected. In this embodiment, the phone preloads some images from the external storage device to the main file management interface after connection, allowing users to quickly preview and use the images. Furthermore, if the predicted file contains images, this embodiment prioritizes scanning the images on the external storage device and preloads the scanned images into the main file management interface. This achieves the effect of "displaying images upon connection" for images on the external storage device. For users, there's no need to wait for the external storage device scan to complete; they can view and use the desired images in a very short time. Therefore, scanning efficiency is greatly improved, significantly reducing user waiting time and enhancing the user experience.
[0179] To test the document scanning effect of the embodiments of this application, the test conditions were set as follows:
[0180] The external storage device is a 2TB portable hard drive, filled with media files including videos, audio, and images. The terminal device is a smart TV. The smart TV pre-loads thumbnails of images from the external storage device into its resource management interface; see reference for details. Figure 6B Based on this, testers, acting as users, used files stored on an external hard drive within a smart TV and preferred to use the images within.
[0181] In actual testing, if a traversal scan is used, the total time to load images in the resource management interface is approximately 8 minutes. However, if a... Figures 2 to 4 The illustrated embodiment processes data when the user has previously connected the external hard drive. The smart TV can prioritize scanning the tester's preferred images within hundreds of milliseconds and display thumbnails within the resource management interface. Therefore, the user-perceived file scanning time can be reduced to the hundreds of milliseconds level, meaning users can view and use the desired images almost instantly, significantly improving the user experience.
[0182] Scenario b: After connecting an external storage device, the user directly operates the terminal device to open folders and search for files. In this case, if the user is looking for files that have already been scanned, the files can be directly displayed in the folder for the user to browse and use.
[0183] For media files that are prioritized for scanning, if the terminal device is configured to view files as icons, the file thumbnails can be directly loaded and displayed when the user opens the folder. This greatly facilitates previewing the content of media files.
[0184] For example, you can refer to the following example. Figure 6C Assume the terminal device is a mobile phone. External storage devices contain images of smart bracelets and smartwatches, with these images being the first files scanned. The folder path for the smart bracelet and smartwatch images is: Smart Devices Folder - Wearable Devices Folder - Bracelet and Watch Folder.
[0185] In this example, after connecting an external storage device, the phone will prioritize scanning images of smart bands and smartwatches. Users can open the following folders on their phones: Smart Devices Folder - Wearable Devices Folder - Smart Bands and Watches Folder. After opening the Smart Bands and Watches folder, the phone will automatically display thumbnails of the smart bands and smartwatches, such as... Figure 6C .
[0186] Since the process of finding and opening the folder takes time, in this example, the phone can reuse this time to scan the images from the smart bracelet and smartwatch. Therefore, the user can directly operate the external storage device as soon as the phone detects it, opening the corresponding folder and viewing the images from the smart bracelet and smartwatch. The user is almost unaware of the scanning process and doesn't need to wait for it to complete. This achieves efficient scanning, reduces user waiting time, and improves the user experience.
[0187] The entire process in scenario b is virtually smooth for the user. This is because the process from connecting the external storage device to the terminal device, to the user opening the file management interface for the external storage device on the terminal device, and then opening a folder within that interface, typically takes at least one second. For example, inserting a USB drive into a computer, opening a file manager interface (such as "My Computer" or "Computer"), and then opening a folder on the external storage device typically takes at least one second. Experiments have shown that, depending on the number of files prioritized for scanning, the method in this embodiment can achieve priority scanning of files within hundreds of milliseconds. Therefore, the user is essentially unaware of the scanning process and "does not need to wait for the scan." Consequently, there is no lag.
[0188] It should be noted that there is no logical conflict between scenario a and scenario b. Therefore, in practical applications, scenario a and scenario b can coexist. In this case, the user can both view thumbnails of the required files on the main resource management interface and directly open the corresponding folder to view and use the required files.
[0189] 4. A specific prediction method.
[0190] To analyze user habits and predict the files a user will use next, this application provides an optional prediction method. Details are as follows:
[0191] (a) Pre-prediction: Before the external storage device is connected to the terminal device, the parameters are set in advance.
[0192] In this embodiment, a duration threshold is preset, and files are divided into two update states: "previous" and "recent." "Previous" means the difference between the file's update time and the current time is greater than the duration threshold, while "recent" means the difference is less than or equal to the duration threshold. Therefore, the update state of a file is a dynamically changing attribute over time. This embodiment also selects m file types to combine with the update states to obtain multiple file categories for analysis. Here, m is a positive integer, and the specific values of the duration threshold and m can be set by technicians according to actual needs. For example, in some optional embodiments, four file types—video, audio, image, and document—can be selected and combined with the update states to obtain: recent video, recent audio, recent image, recent document, previous video, previous audio, previous image, and previous document, a total of eight file categories to be analyzed. In some optional embodiments, the duration threshold can be set to any value between 1 and 4 days.
[0193] After setting the file types, perform pairwise combinations with repetition to obtain H(2, m) type pairs. Here, H(2, m) = (m+1) × m ÷ 2. For example, when m = 8, we can obtain H(2, 8) = 9 × 8 ÷ 2 = 36 type pairs.
[0194] In this embodiment, the relevance distance between two file types is defined as l, which can also be called the distance l between the two file types forming a category pair. The distance l is negatively correlated with the relevance. That is, the smaller the distance l, the closer the two file types are, and the higher the relevance. Conversely, the larger the distance l, the farther apart the two file types are, and the lower the relevance.
[0195] Let the initial value of the distance *l* between two file types within each category pair be a constant, where *a* is a positive number. Then the total relevance distance *L* between H(2, m) category pairs is = H(2, m) × a = a × (m+1) × m ÷ 2. Furthermore, the total relevance distance *L* remains constant while the user is using the external storage device.
[0196] In the case of two consecutive accesses of the external storage device to the terminal device, the file types of the first file used by the user in each of the two uses are, in order: first file type and second file type. For example, in the current use, the first file used by the user belongs to file type 1. In the next use, the first file used by the user belongs to file type 2. At this time, file type 1 and file type 2 are the first file type and the second file type. Therefore, in this embodiment, the first file type and the second file type are only relative concepts named according to the order of occurrence. For a single file type 'a', relative to the file type 'b' to which the first file used by the user in the previous use, file type 'a' is the second file type. However, relative to the file type 'c' to which the first file used by the user in the next use, file type 'a' is the first file type.
[0197] Based on the above settings, the affinity p is defined as: the proximity step size between the first file type and the second file type. That is, the step size of a single increase in the relevance between the two file types.
[0198] The alienation degree q is defined as the alienation step size between the first file type and the second file type. That is, the step size by which the relevance between the two file types decreases in a single step.
[0199] Where p and q are both positive numbers less than a, p = (m-1)q. The specific values of p and q can be set by the technicians themselves. For example, when a = 1, p = 0.07 and q = 0.01 can be set.
[0200] (ii) Before prediction: Record the usage data during the usage process, that is, record the file type of the first file used by the user.
[0201] In practical applications, it has been found that users have certain personal habits when using external storage devices, and these habits follow certain patterns. In two consecutive uses, the relevance between the first two file types used by the user is higher compared to other file types. For example, if the first file used in a previous use is of file type A, and the first file used in a subsequent use is of file type B, this indicates that both file types A and B are file types needed by the user in both uses. Therefore, from the user's perspective, the relevance between file types A and B is higher. Based on this principle, in this embodiment, the terminal device records the file type (i.e., usage data) of the first file used by the user in each use.
[0202] (iii) Prediction process: This includes two operations: updating the distance between category pairs and determining the file category based on the distance between category pairs.
[0203] Update the distance between species pairs:
[0204] When the terminal device records the file type of the first file used by the user in the current usage (i.e., the second file type), it will read the file type of the first file used by the user in the previous usage (i.e., the first file type) and the distance between each type pair from the local storage.
[0205] When an external storage device is first connected to a terminal device, there is no corresponding first file type, and the distance between each type pair is 'a'. In this case, technicians can use any one of the prediction methods 1 to 4 described above, or other prediction methods, without limitation. However, this embodiment requires storing the file type of the first file used by the user during this usage process, and recording that the distance between each type pair remains 'a'.
[0206] For external storage devices not being accessed for the first time by the terminal device, there is a corresponding first file type. In this case, the embodiments of this application reduce the proximity *p* between the second file type and the first file type, and increase the distance *q* between the first file type and all other file types (i.e., reduce the distance between first type pairs and increase the clustering of second type pairs) to update the distance of each type pair. At this time, the distance between the type pairs formed by the second file type and the first file type is: the distance recorded previously minus proximity *p*.
[0207] For the second time the external storage device connects to the terminal device, the distance for each type of pair recorded in the previous connection is 'a'. For the third time the external storage device connects to the terminal device, the distance is obtained by processing the usage data after the second connection. For the nth time the external storage device connects to the terminal device, the distance is obtained by processing the usage data after the (n-1)th connection. And so on.
[0208] To illustrate with an example, suppose the first file used by a user in this usage session belongs to file type A, and the first file used in the previous usage session belongs to file type C (i.e., the second file type is file type A, and the first file type is file type C). In this embodiment, the distance between file type A and file type C is reduced by proximity p, while the distance between file type C and all other file types is increased by distance q. The distance between the category pairs consisting of file type A and file type C is now: the distance recorded previously minus proximity p. For example, for the second access of an external storage device to the terminal device, the distance between the category pairs consisting of file type A and file type C is now ap. The distance between file type C and all other file types is a+q.
[0209] Determine the file type based on the distance between type pairs:
[0210] As an optional embodiment of this application, after updating the distance between the current category pairs, this embodiment searches for all category pairs containing the second file type (i.e., the third category pairs) and selects the category pair with the shortest distance. Finally, the other file type in that category pair, besides the second file type, is stored as the prediction result.
[0211] As another optional embodiment of this application, after updating the distance between the current category pairs, this embodiment of the application searches for all category pairs containing the second file type and selects the multiple category pairs with the shortest distance. Finally, the other file type in these category pairs besides the second file type is stored as the prediction result. At this time, the prediction result contains one or more sorted file types.
[0212] Accordingly, when determining one or more files based on the prediction results, if the prediction results contain multiple sorted file types, the first file type in the sorted order is selected, and the corresponding file for that file type is searched from the external storage device. If the file is found, it is used as the priority file to be scanned. If the file is not found, the first file type in the sorted order is selected again without repetition, and the corresponding file for that file type is searched from the external storage device. This process continues until the file is found, or all file types in the prediction results have been searched.
[0213] For example, suppose the second file type is file type A, and the first file type is file type C. After this update, there are 4 type pairs containing file type A, as follows:
[0214] Category pair 1: File category A - File category A, distance l=1.
[0215] Category pair 2: File category A - File category B, distance l = 0.5.
[0216] Category pair 3: File category A - File category C, distance l = 0.7.
[0217] Category pair 4: File category A - File category D, distance l = 0.8.
[0218] When the setting is to filter only the category pair with the shortest distance, the shortest distance is 0.5 of category pair 2. Therefore, file category B will be stored as the prediction result. (If the shortest distance is a category pair like category pair 1, then the other file category is the same as the second file category, and it can also be used as the prediction result.)
[0219] When the setting is to filter only the shortest pairs of categories, for example, the two shortest pairs of categories, then the shortest distance is between category pair 2 and category pair 3. Therefore, file category B and file category C will be stored together as the prediction result.
[0220] In this embodiment, analysis and prediction are performed based on file type, achieving evaluation across two dimensions: update time and file type. Therefore, this embodiment can better analyze user habits, making predictions more accurate and reliable.
[0221] The prediction method in the embodiments of this application will be illustrated by an example:
[0222] Suppose there are 8 types of files to be analyzed: recent videos, recent images, recent audio, recent documents, previous videos, previous images, previous audio, and previous documents. For ease of explanation, these will be referred to as x1, x2, x3, x4, x5, x6, x7, and x8.
[0223] At this point, pairwise repetition of file types yields 36 pairs: x1-x1, x1-x2, x1-x3, x1-x4, x1-x5, x1-x6, x1-x7, x1-x8, x2-x2, x2-x3, x2-x4, x2-x5, x2-x6, x2-x7, x2-x8, x3-x3, x3-x4, x3-x5, x3-x6, x3-x7, x3-x8, x4-x4, x4-x5, x4-x6, x4-x7, x4-x8, x5-x5, x5-x6, x5-x7, x5-x8, x6-x6, x6-x7, x6-x8, x7-x7, x7-x8, and x8-x8. The initial value of the distance l between each type is set to 1, the total distance L=36, p=0.07, and q=0.01.
[0224] The external storage device was connected to the terminal device 11 times. During the first 10 uses, the file types of the first file used by the user were set to be: x2, x1, x2, x6, x1, x4, x5, x2, x1 and x2 (these are 10 file types randomly set in the experiment and theoretically have no regularity).
[0225] This can be referenced at this time. Figure 7 The table in the document.
[0226] When an external storage device is first connected to a terminal device, the distance between all pairs of types that the terminal device can read is 1. Figure 7 The data in the "First Readable Distance" column. After the terminal device determines the file used by the user, it identifies the file as belonging to the most recently viewed image x2 based on the file's update time, file type, and set duration threshold. However, since there is no "previous usage process" at this time, the terminal device will not modify the distance of each category pair. At this time, the distance of the category pair is the data in the "Second Readable Distance" column, which is still 1.
[0227] When the external storage device is connected to the terminal device for the second time, the distance between each type of pair that the terminal device can read is... Figure 7 The data in the "Second Readable Distance" column. After determining the file used by the user, the terminal device identifies the file as belonging to the most recent video x1 based on the file's update time, file type, and set duration threshold. Since the previous one was x2, the distance between category pairs x1 and x2 is reduced by p = 0.07, and the distances of other category pairs containing x2 are increased by q = 0.01. The resulting updated distance between category pairs is... Figure 7 The data in the "3rd Readable Distance" column is stored locally so that the terminal device can read and use it when the external storage device is connected to the terminal device for the third time.
[0228] When the external storage device is connected to the terminal device for the third time, the distance between each type of pair that the terminal device can read from the previous storage is called the distance between the external storage device and the terminal device. Figure 7 The data in the "3rd Readable Distance" column is as follows: After identifying the file used by the user, the terminal device determines that the file belongs to the most recent image x2 based on the file's update time, file type, and a set duration threshold. Since the previous one was x1, the distance between the category pair x1 and x2 is reduced by 0.07, and the distances of other category pairs containing x2 are increased by 0.01. The resulting updated distances of the category pairs are the data in the "4th Readable Distance" column, which is stored locally for the terminal device to read and use when the external storage device is accessed for the fourth time.
[0229] When the external storage device is connected to the terminal device for the fourth time, the distance between each type of pair that the terminal device can read from the previous storage is called the distance between the external storage device and the terminal device. Figure 7 The data in the "4th Readable Distance" column is as follows: After identifying the file used by the user, the terminal device determines that the file belongs to the previous image x6 based on the file's update time, file type, and set duration threshold. Since the previous distance was x2, the distance between the category pairs x2 and x6 is reduced by 0.07, and the distances of other category pairs containing x2 are increased by 0.01. The resulting updated distances of the category pairs are the data in the "5th Readable Distance" column, which is stored locally for the terminal device to read and use when the external storage device is accessed for the 5th time.
[0230] Following the same method described above, the distances of each type pair can be updated within the first 10 usage cycles. The distances of type pairs readable in each current usage cycle are the distances of each type pair stored after the update in the previous usage cycle. For example, for the 11th time the external storage device is connected to the terminal device, even if the user is not using any files, the terminal device can still read the distances of each type pair updated by the terminal device after the 10th time the external storage device was connected. (See reference...) Figure 7 The data in the "11th Readable Distance" column.
[0231] After each update of the distance between each type pair, the terminal device will also predict the file type of the file the user needs next based on the distance between each type pair after the update.
[0232] For the second time an external storage device connects to a terminal device, after obtaining... Figure 7After processing the data in the "Third Readable Distance" column, the system will search for all category pairs containing x1 and then select the category pair with the shortest distance. Finally, the other file category besides x1 in that category pair will be stored as the prediction result. (Reference) Figure 7 The data in the "3rd Readable Distance" column shows that the category pair containing x1 with the shortest distance of 0.93 is x1-x2. Therefore, the prediction result at this time is the nearest image x2.
[0233] based on Figure 7 The data, processed according to the above operations, yields the following prediction results for the files required by the user during the 3rd to 11th usage sessions out of 11 usage sessions: recent images x2, recent videos x1, recent videos x1, recent images x2, recent videos x1, recent documents x4, previous videos x5, recent images x2, and recent videos x1.
[0234] In addition, during each use, the terminal device locally stores the file type of the first file used in that use, the file type used as the prediction result, and the updated distances between each type pair. For example, for the 10th time an external storage device is connected to the terminal device, the following will be stored: the file type of the first file used: recent images x2, the file type used as the prediction result: recent videos x1, and... Figure 7 The data in the "11th Readable Distance" column is sent to the local terminal device.
[0235] In this embodiment, analysis and prediction are performed based on file type, achieving evaluation across two dimensions: update time and file type. Therefore, this embodiment can better analyze user habits, making predictions more accurate and reliable. Simultaneously, predicting the types of files the user needs each time and prioritizing scanning files within the predicted categories can significantly shorten user waiting time and improve file scanning efficiency.
[0236] Corresponding to the file scanning method described in the above embodiments, Figure 8 A schematic diagram of the document scanning device provided in the embodiments of this application is shown. For ease of explanation, only the parts related to the embodiments of this application are shown.
[0237] Reference Figure 8 The document scanning device includes:
[0238] The result reading module 81 is used to read the prediction results associated with the external storage device when the external storage device is detected to be connected.
[0239] The file determination module 82 is used to determine one or more files from the external storage device based on the prediction results, which are data obtained by analyzing the user's historical usage data of files in the external storage device.
[0240] The file scanning module 83 is used to scan one or more files in an external storage device.
[0241] The file scanning module 83 is also used to scan the remaining unscanned files in the external storage device after scanning one or more files.
[0242] As an optional embodiment of this application, the result reading module 81 is further configured to:
[0243] When an external storage device is detected to be connected, it is determined whether the external storage device is the first time the terminal device has been connected.
[0244] If the external storage device is not being connected to the terminal device for the first time, then read the prediction results associated with the external storage device.
[0245] As an optional embodiment of this application, the document determination module 82 is further configured to:
[0246] Identify the file types of each file in the external storage device.
[0247] Filter out one or more files from external storage devices whose file types belong to the file types included in the prediction results.
[0248] As an optional embodiment of this application, identifying the file types of various files in the external storage device includes:
[0249] Get the update time and file type of each file in the external storage device.
[0250] Identify the file type of each file on the external storage device based on the update time and file type.
[0251] As an optional embodiment of this application, the file type of each file in the external storage device is identified based on the update time and file type, including:
[0252] The update status of each file in the external storage device is determined based on the update time and a preset duration threshold.
[0253] Identify the file type of each file on the external storage device based on its update status and file type.
[0254] As an optional embodiment of this application, the prediction result includes one or more file addresses, and one or more files are determined from the external storage device based on the prediction result, including:
[0255] Locate one or more files pointed to by one or more file addresses from an external storage device.
[0256] As an optional embodiment of this application, the document scanning device further includes:
[0257] The data logging module is used to record the user's first usage data of files on the external storage device.
[0258] The prediction module is used to analyze the initial data and obtain the analysis results.
[0259] The results storage module is used to update the prediction results using the analysis results.
[0260] As an optional embodiment of this application, the prediction module includes:
[0261] The category acquisition module is used to acquire the first file category of the first file used by the user on the external storage device after the terminal device is connected once.
[0262] The distance acquisition module is used to obtain multiple category pairs and the distance between each category pair. Each category pair consists of two file categories, and the distance value of the category pair is negatively correlated with the correlation between the two file categories within the category pair.
[0263] The first category pair filtering module is used to filter out the first category pair and all the second category pairs from multiple category pairs. The first category pair is a category pair consisting of a first file type and a second file type, and the second category pair is a category pair that contains the first file type but does not contain the second file type.
[0264] The distance adjustment module is used to decrease the distance between the first type of pairs and increase the distance between the second type of pairs.
[0265] The second category pair filtering module is used to filter out all third category pairs from multiple category pairs. The third category pairs are category pairs that contain the second file category.
[0266] The third category pair filtering module is used to filter out the top q category pairs with the shortest distance from the third category pairs, where q is a positive integer.
[0267] The results generation module is used to filter out all file types other than the second file type from the file types contained in the q type pairs, and use all the filtered file types as the analysis results.
[0268] As an optional embodiment of this application, in the process of reducing the distance of the first type pair and increasing the distance of the second type pair:
[0269] The distance increase is the same for each second-class pair, and the sum of the distances for multiple class pairs remains unchanged.
[0270] The process by which each module in the document scanning device provided in this application implements its respective function can be specifically referred to the foregoing. Figures 2 to 7 The descriptions of the embodiments shown and other related method embodiments are not repeated here.
[0271] It should be noted that the information interaction and execution process between the above-mentioned devices / units are based on the same concept as the method embodiments of this application. For details on their specific functions and technical effects, please refer to the method embodiments section, and they will not be repeated here.
[0272] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0273] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.
[0274] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0275] As used in this application specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if detected [the described condition or event]" may be interpreted, depending on the context, as meaning "once determined," "in response to determination," "once detected [the described condition or event]," or "in response to detection [the described condition or event]."
[0276] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only for distinguishing descriptions and should not be construed as indicating or implying relative importance. It should also be understood that although the terms "first," "second," etc., are used in the text to describe various elements in some embodiments of this application, these elements should not be limited by these terms. These terms are merely used to distinguish one element from another. For example, a first table may be named a second table, and similarly, a second table may be named a first table, without departing from the scope of the various described embodiments. Both the first table and the second table are tables, but they are not the same table.
[0277] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0278] The document scanning method provided in this application can be applied to terminal devices such as mobile phones, tablets, wearable devices, in-vehicle devices, augmented reality (AR) / virtual reality (VR) devices, laptops, ultra-mobile personal computers (UMPCs), netbooks, and personal digital assistants (PDAs). This application does not impose any restrictions on the specific type of terminal device.
[0279] For example, the terminal device may be a Personal Digital Assistant (PDA) device, a handheld device with wireless communication capabilities, a computing device or other processing device connected to a wireless modem, an in-vehicle device, a vehicle-to-everything (V2X) terminal, a computer, a laptop computer, a handheld communication device, a handheld computing device, a satellite wireless device, a wireless modem card, a set-top box (STB), a customer premises equipment (CPE), and / or other devices used for communication over a wireless system, as well as next-generation communication systems, such as terminal devices in 5G networks or terminal devices in future evolved Public Land Mobile Network (PLMN) networks.
[0280] As an example and not a limitation, when the terminal device is a wearable device, the term "wearable device" can also refer to any device that utilizes wearable technology to intelligently design and develop everyday wearables, such as glasses, gloves, watches, clothing, and shoes. Wearable devices are portable devices worn directly on the body or integrated into a user's clothing or accessories. Wearable devices are not merely hardware devices; they achieve powerful functions through software support, data interaction, and cloud interaction. Broadly defined, wearable smart devices include those with comprehensive functions, large sizes, and the ability to perform complete or partial functions without relying on a smartphone, such as smartwatches or smart glasses, as well as those focused on a specific application function that require interaction with other devices such as smartphones, such as various smart bracelets and smart jewelry for vital sign monitoring.
[0281] The following text uses a mobile phone as an example of a terminal device. Figure 9 A schematic diagram of the structure of the electronic device 100 is shown.
[0282] Electronic device 100 may include processor 110, external memory interface 120, internal memory 121, charging interface 130, charging management module 131, power management module 141, battery 142, antenna, wireless communication module 150, display screen 160, and buttons 170, etc.
[0283] It is understood that the structures illustrated in the embodiments of the present invention do not constitute a specific limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0284] Processor 110 may include one or more processing units, such as application processors (APs), modem processors, graphics processing units (GPUs), image signal processors (ISPs), controllers, memory, video codecs, digital signal processors (DSPs), baseband processors, and / or neural network processing units (NPUs). Different processing units may be independent devices or integrated into one or more processors. The controller may serve as the central nervous system and command center of electronic device 100. The controller can generate operation control signals based on instruction opcodes and timing signals to control instruction fetching and execution.
[0285] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0286] The processor 110 can run the file scanning method provided in the embodiments of this application to improve file scanning efficiency, shorten user waiting time, and enhance user experience. The processor 110 may include different devices. For example, when integrating a CPU and a GPU, the CPU and GPU can cooperate to execute the file scanning method provided in the embodiments of this application. For instance, some algorithms in the file scanning method are executed by the CPU, and other algorithms are executed by the GPU to achieve faster processing efficiency.
[0287] Display screen 160 is used to display images, videos, etc. Display screen 160 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a miniature LED, a microLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, electronic device 100 may include one or N displays screens 160, where N is a positive integer greater than 1. Display screen 160 can be used to display information input by the user or information provided to the user, as well as various graphical user interfaces (GUIs). For example, display screen 160 can display thumbnails and other attribute data of scanned documents, or display document content. As another example, display screen 160 can display a graphical user interface. The graphical user interface (GUI) includes a status bar, a hideable navigation bar, a time and weather widget, and application icons, such as browser icons. The status bar includes the carrier name (e.g., China Mobile), mobile network (e.g., 4G), time, and remaining battery power. The navigation bar includes a back button icon, a home button icon, and a forward button icon. Furthermore, it is understood that in some embodiments, the status bar may also include Bluetooth icons, Wi-Fi icons, and external device icons. It is also understood that in other embodiments, the GUI may include a Dock bar, which may include frequently used application icons. When the processor detects a touch event from a user's finger (or stylus, etc.) on an application icon, in response to the touch event, it opens the user interface of the application corresponding to that application icon and displays the application's user interface on the display screen 160.
[0288] In this embodiment, the display screen 160 can be a single flexible display screen, or it can be a spliced display screen composed of two rigid screens and a flexible screen located between the two rigid screens. When the processor 110 runs the file scanning method provided in this embodiment, the processor 110 can control the external audio output device to switch the output audio signal.
[0289] Internal memory 121 can be used to store computer executable program code, which includes instructions. Processor 110 executes various functional applications and data processing of electronic device 100 by running the instructions stored in internal memory 121. Internal memory 121 may include a program storage area and a data storage area. The program storage area can store the operating system, application code (such as camera applications, WeChat applications, etc.), etc. The data storage area can store data created during the use of electronic device 100 (such as images and videos captured by camera applications, etc.).
[0290] The internal memory 121 may also store one or more computer programs 1210 corresponding to the file scanning method provided in this application embodiment. The one or more computer programs 1210 are stored in the aforementioned memory 121 and configured to be executed by the one or more processors 110. The one or more computer programs 1210 include instructions that can be used to perform actions such as... Figures 2 to 7 In the corresponding embodiments, when the code of the file scanning method stored in the internal memory 121 is run by the processor 110, the processor 110 can control the terminal device to process file scanning related data, such as file priority scanning.
[0291] In addition, the internal memory 121 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.
[0292] Of course, the code for the file scanning method provided in this embodiment can also be stored in external memory. In this case, the processor 110 can run the code for the file scanning method stored in external memory through the external memory interface 120, and the processor 110 can control the terminal device to perform file scanning processing. In addition, the external memory interface 120 can also be used to connect to an external storage device.
[0293] The wireless communication function of electronic device 100 can be implemented through an antenna, wireless communication module 150, modem processor, and baseband processor.
[0294] Antennas are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover one or more communication frequency bands. In some other embodiments, the antenna can be used in conjunction with a tuning switch.
[0295] The modem processor may include a modulator and a demodulator. The modulator modulates the low-frequency baseband signal to be transmitted into a mid-to-high frequency signal. The demodulator demodulates the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After processing by the baseband processor, the low-frequency baseband signal is transmitted to the application processor. The application processor outputs sound signals through audio devices (not limited to speaker 170A, receiver 170B, etc.) or displays images or videos through the display screen 160. In some embodiments, the modem processor may be a separate device. In other embodiments, the modem processor may be independent of the processor 110 and may be housed in the same device as the wireless communication module 150 or other functional modules.
[0296] The wireless communication module 150 can provide solutions for wireless communication applications on the electronic device 100, including wireless local area networks (WLANs) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies. The wireless communication module 150 can be one or more devices integrating at least one communication processing module. The wireless communication module 150 receives electromagnetic waves via antenna 2, performs frequency modulation and filtering of the electromagnetic wave signals, and sends the processed signal to processor 110. The wireless communication module 150 can also receive signals to be transmitted from processor 110, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via antenna 2. In this embodiment, the wireless communication module 150 can be used to access access point devices and send and receive messages to and from other terminal devices.
[0297] It should be understood that, in practical applications, electronic device 100 may include more than Figure 1A The number of more or fewer components shown is not limited in the embodiments of this application. The illustrated electronic device 100 is merely an example, 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 different component configurations. The various components shown in the figure 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.
[0298] The software system of a terminal device can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This embodiment of the invention uses the layered architecture Android system as an example to illustrate the software structure of the terminal device. Figure 10 This is a software structure block diagram of a terminal device according to an embodiment of the present invention.
[0299] A layered architecture divides software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer, the application framework layer, the Android runtime and system libraries, and the kernel layer.
[0300] The application layer can include a series of application packages.
[0301] like Figure 10 As shown, the application package may include applications such as phone, camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, and SMS.
[0302] The application framework layer provides application programming interfaces (APIs) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions.
[0303] like Figure 10 As shown, the application framework layer may include a window manager, content provider, view system, phone manager, resource manager, notification manager, etc.
[0304] The window manager is used to manage windowed applications. It can retrieve screen size, determine the presence of a status bar, lock the screen, and capture screenshots, among other things.
[0305] Content providers store and retrieve data, making that data accessible to applications. This data may include videos, images, audio, made and received phone calls, browsing history and bookmarks, phone books, etc.
[0306] A view system includes visual controls, such as controls for displaying text and controls for displaying images. View systems can be used to build applications. A display interface can consist of one or more views. For example, a display interface including a text notification icon could include views for displaying text and views for displaying images.
[0307] A phone manager is used to provide communication functions for terminal devices. For example, it manages call status (including connection, hang-up, etc.).
[0308] The file explorer provides applications with various resources, such as localized strings, icons, images, layout files, video files, and more.
[0309] The notification manager allows applications to display notifications in the status bar. These notifications can be used to deliver informational messages and can disappear automatically after a short pause, requiring no user interaction. For example, the notification manager can be used to notify users of download completion or message alerts. The notification manager can also display notifications as icons or scrolling text in the top status bar, such as notifications from background applications, or as dialog boxes on the screen. Examples include displaying text messages in the status bar, emitting sounds, vibrating the device, and flashing indicator lights.
[0310] The Android Runtime consists of core libraries and a virtual machine. The Android runtime is responsible for the scheduling and management of the Android system.
[0311] The core library consists of two parts: one part is the functionalities that need to be called by the Java language, and the other part is the Android core library.
[0312] The application layer and application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.
[0313] System libraries can include multiple functional modules. For example: surface manager, media libraries, 3D graphics processing libraries (e.g., OpenGL ES), 2D graphics engines (e.g., SGL), etc.
[0314] The Surface Manager is used to manage the display subsystem and provides the blending of 2D and 3D layers for multiple applications.
[0315] The media library supports playback and recording of various common audio and video formats, as well as still image files. It supports multiple audio and video encoding formats, such as MPEG4, H.164, MP3, AAC, AMR, JPG, and PNG.
[0316] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0317] A 2D graphics engine is a graphics engine for 2D drawing.
[0318] The kernel layer is the layer between hardware and software. The kernel layer contains at least the display driver, camera driver, audio driver, and sensor driver.
[0319] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0320] This application also provides a terminal device, which includes at least one memory, at least one processor, and a computer program stored in the at least one memory and executable on the at least one processor. When the processor executes the computer program, it causes the terminal device to implement the steps in any of the above method embodiments.
[0321] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps described in the various method embodiments above.
[0322] This application provides a computer program product that, when run on a terminal device, enables the terminal device to implement the steps described in the various method embodiments.
[0323] This application also provides a chip system, which includes a processor coupled to a memory. The processor executes a computer program stored in the memory to implement the steps in the various method embodiments described above.
[0324] If the integrated module / unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable storage medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium, etc.
[0325] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0326] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0327] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0328] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
[0329] Finally, it should be noted that the above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A document scanning method, characterized in that, Applied to terminal devices, including: When an external storage device is detected to be connected, the prediction result associated with the external storage device is read; the prediction result includes the file type. Based on the prediction results, one or more files are identified from the external storage device as priority scan files, including: identifying the file types of each file in the external storage device; selecting one or more files from the external storage device whose file types belong to the file types included in the prediction results as priority scan files; the prediction results are data obtained based on the analysis of the user's historical usage data of files in the external storage device; Scan the one or more files that are prioritized for scanning within the external storage device; After the priority scan of one or more files is completed, the remaining unscanned files in the external storage device are scanned.
2. The document scanning method according to claim 1, characterized in that, The step of reading the prediction result associated with the external storage device when an external storage device is detected to be connected includes: When an external storage device is detected to be connected, it is determined whether the external storage device is being connected to the terminal device for the first time. If the external storage device is not being connected to the terminal device for the first time, then the prediction result associated with the external storage device is read.
3. The document scanning method according to claim 1, characterized in that, The identification of file types for each file in the external storage device includes: Obtain the update time and file type of each file in the external storage device; Based on the update time and the file type, the file type of each file in the external storage device is identified.
4. The document scanning method according to claim 3, characterized in that, The step of identifying the file type of each file in the external storage device based on the update time and the file type includes: The update status of each file in the external storage device is determined based on the update time and the preset duration threshold. Based on the update status and the file type, identify the file type of each file in the external storage device.
5. The document scanning method according to claim 1, characterized in that, The prediction result contains one or more file addresses, and the step of determining one or more files to be scanned preferentially from the external storage device based on the prediction result includes: The external storage device is used to locate one or more files pointed to by one or more file addresses as one or more files to be scanned first.
6. The document scanning method according to any one of claims 1 to 4, characterized in that, After determining one or more files to be scanned preferentially from the external storage device based on the prediction result, the method further includes: Record the user's first usage data of files in the external storage device; The first set of data was analyzed to obtain the analysis results; The prediction results are updated using the analysis results.
7. The document scanning method according to claim 6, characterized in that, The first usage data is the second file type of the first file used by the user on the external storage device; The analysis of the first used data to obtain the analysis results includes: After the terminal device is connected to the external storage device once, obtain the first file type of the first file used by the user on the external storage device; Obtain multiple category pairs and the distance between each category pair, wherein each category pair consists of two file categories, and the distance value of the category pair is negatively correlated with the correlation between the two file categories within the category pair; From the plurality of category pairs, a first category pair and all second category pairs are selected, wherein the first category pair is a category pair consisting of the first file type and the second file type, and the second category pair is a category pair that includes the first file type but does not include the second file type; Decrease the distance between the first type pairs and increase the distance between the second type pairs; Filter out all third type pairs from the plurality of type pairs, wherein the third type pairs are type pairs that contain the second file type; From the third type of pairs, select the q pairs of pairs with the shortest distance, where q is a positive integer; From the file types included in the q type pairs, all file types other than the second file type are filtered out, and all the filtered file types are used as the analysis result.
8. The document scanning method according to claim 7, characterized in that, During the process of decreasing the distance between the first type pair and increasing the distance between the second type pair: The distance increase is the same for each of the second type pairs, and the sum of the distances of the multiple type pairs remains unchanged.
9. A terminal device, characterized in that, The terminal device includes a memory and a processor. The memory stores a computer program that can run on the processor. When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 8.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 8.
11. A chip system, characterized in that, The chip system includes a processor coupled to a memory, the processor executing a computer program stored in the memory to implement the file scanning method as described in any one of claims 1 to 8.
Citation Information
Patent Citations
File push list generation method and file push list generation device
CN105049952A
File recommendation method, device, storage medium and intelligent terminal
CN109240991A
Method and device for scanning the contents of a storage medium
CN1811959A