CN114328401A - File scanning method and terminal equipment - Google Patents

File scanning method and terminal equipment Download PDF

Info

Publication number
CN114328401A
CN114328401A CN202011070044.3A CN202011070044A CN114328401A CN 114328401 A CN114328401 A CN 114328401A CN 202011070044 A CN202011070044 A CN 202011070044A CN 114328401 A CN114328401 A CN 114328401A
Authority
CN
China
Prior art keywords
file
external storage
storage device
files
user
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011070044.3A
Other languages
Chinese (zh)
Inventor
朱道建
马明刚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN202011070044.3A priority Critical patent/CN114328401A/en
Publication of CN114328401A publication Critical patent/CN114328401A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application provides a file scanning method and terminal equipment, which are applicable to the technical field of file scanning, and the method comprises the following steps: and when the access of the external storage device is detected, reading a prediction result associated with the external storage device. One or more files are determined from the external storage device based on the prediction. The predicted result is data based on historical usage data analysis of files in the external storage device by the user. One or more files within the external storage device are scanned. After the scanning of one or more files is completed, the remaining unscanned files in the external storage device are scanned. The embodiment of the application can scan files required by a user in time. In a very short time after the external storage device is accessed, the user can use the required file, so that the user experience is greatly improved.

Description

File scanning method and terminal equipment
Technical Field
The application belongs to the technical field of file scanning, and particularly relates to a file scanning method and terminal equipment.
Background
External storage devices (such as optical disks, flash disks, and portable hard disks) are highly portable. The user can store the file in the external storage device, and the external storage device is accessed to the terminal device when the file needs to be used. After detecting the access of the external storage device, the terminal device scans the file of the external storage device and provides services such as browsing and editing of the scanned file for the user.
With the development of technology, the capacity of external storage devices is also increasing. Such as some flash disks with 128 Gigabytes (GB), 256GB or even 512GB capacity are gradually appearing on the market. And some 512GB, 1 Terabyte (TB), 2TB and even 5TB removable hard disks. On one hand, the large-capacity external storage device can store more files and can meet the requirements of more users. On the other hand, because the terminal device has a limited scanning speed for files in the external storage device, when the number of files in the external storage device is large, the scanning time is often long. Therefore, the user needs to wait for a long time to use the files in the external storage device, and the user experience is poor.
Disclosure of Invention
In view of this, embodiments of the present application provide a file scanning method and a terminal device, which can solve the problem in the prior art that a user needs to wait for a long time to use a file because the terminal device has low efficiency in scanning a file in an external storage device.
A first aspect of an embodiment of the present application provides a file scanning method, which is applied to a terminal device including the proximity sensor, and includes:
when detecting that an external storage device is accessed, reading a prediction result related to the external storage device;
determining one or more files from the external storage device according to the prediction result; the prediction result is data obtained by analyzing historical use data of files in the external storage device based on a user;
scanning the one or more files within the external storage device;
after the scanning of the one or more files is completed, scanning the remaining unscanned files in the external storage device.
In the embodiment of the present application, after each access of the external storage device, the terminal device preferentially scans a file (i.e., a file determined according to a prediction result) required by a user, which is predicted after the previous access, by the terminal device. And after the scanning of the files is finished, the scanning of other files in the external storage equipment is continued until the scanning of all the files in the external storage equipment is finished. Therefore, the embodiment of the application can scan the files required by the user in time. In a very short time after the external storage device is accessed, the user can use the required file, so that the user experience is greatly improved.
In a first possible implementation manner of the first aspect, the reading the prediction result associated with the external storage device when the access of the external storage device is detected includes:
when detecting that an external storage device is accessed, identifying whether the external storage device is accessed to the terminal device for the first time;
and if the external storage equipment is not accessed to the terminal equipment for the first time, reading a prediction result associated with the external storage equipment.
In the embodiment of the application, the condition that the external storage device is not accessed for the first time is processed, so that the user can use the required file in a very short time after the external storage device is accessed, and the user use experience is greatly improved.
In a second possible implementation manner of the first aspect, the determining one or more files from the external storage device according to the prediction result includes:
identifying the file type of each file in the external storage equipment;
and screening one or more files of which the file types belong to the file types contained in the prediction result from the external storage equipment.
In the embodiment of the application, the file type is analyzed and predicted in a file type mode, so that the embodiment of the application can determine the habit of the file type of a user. Therefore, the embodiment of the application can better analyze the use habits of the user, so that the prediction is more accurate and reliable.
On the basis of the second possible implementation manner of the first aspect, in a third possible implementation manner of the first aspect, the identifying a file type of each file in the external storage device includes:
acquiring the update time and the file type of each file in the external storage equipment;
and identifying the file type of each file in the external storage equipment according to the updating time and the file type.
In the embodiment of the application, the file types are divided by the updating time and the file types, so that the user use habit evaluation of two dimensions of the updating time and the file types can be realized. Therefore, the embodiment of the application can better analyze the use habits of the user, so that the prediction is more accurate and reliable.
On the basis of the third possible implementation manner of the first aspect, in a fourth possible implementation manner of the first aspect, the identifying, according to the update time and the file type, a file type of each file in the external storage device includes:
determining the updating state of each file in the external storage equipment according to the updating time and a preset time threshold;
and identifying the file type of each file in the external storage equipment according to the updating state and the file type.
In the embodiment of the application, the update states of the files are distinguished according to the update time and the time threshold, so that the update states can be accurately distinguished.
As one embodiment of the present application, a file may be divided into two update states, a "previous" and a "most recent". Wherein "before" means that the difference between the update time of the file and the current time is greater than the duration threshold, and "most recent" means that the difference between the update time of the file and the current time is less than or equal to the duration threshold.
In a fifth possible implementation manner of the first aspect, the determining, according to the prediction result, one or more files from the external storage device includes:
and searching one or more files pointed to by the one or more file addresses from the external storage device.
In the embodiment of the application, the user habit is analyzed in a file address mode of the file in the external storage device, and the prediction result is stored, so that the embodiment of the application can accurately and quickly locate the specific file required by the user. Therefore, the embodiment of the application can better analyze the use habits of the user, so that the prediction is more accurate and reliable, and meanwhile, the speed of preferential scanning can be effectively improved.
In a sixth possible implementation manner of the first aspect, after the determining, according to the prediction result, one or more files from the external storage device, the method further includes:
recording first use data of a user on files in the external storage equipment;
analyzing the first use data to obtain an analysis result;
and updating the prediction result by using the analysis result.
In the embodiment of the application, after the external storage device is accessed each time, the terminal device records the use data of the user to the file in the external storage device in the use process. And meanwhile, the using habit of the user is analyzed according to the using data, the file required by the user next time is predicted, and the prediction result is stored. On this basis, when the external storage device accesses each time (except for first access), the terminal device determines one or more files which need to be scanned preferentially according to the prediction result, and scans the files preferentially. And after the scanning of the files is finished, the scanning of other files in the external storage device is continued. Therefore, the embodiment of the application can scan the files required by the user in time. In the very short time after the external storage device is accessed, the user can use the required file, so that the scanning efficiency of the terminal device on the file in the external storage device is greatly improved, and the user experience is improved.
On the basis of the sixth possible implementation manner of the first aspect, in a seventh possible implementation manner of the first aspect, the first usage data is a second file type of a first file used by the user in the external storage device;
the analyzing the first usage data to obtain an analysis result includes:
acquiring a first file type of a first file used by the user in the external storage device after the external storage device is accessed to the terminal device last time;
acquiring a plurality of category pairs and the distance of each category pair, wherein each category pair consists of two file categories, and the distance value of the category pair is in negative correlation with the correlation degree between the two file categories in the category pair;
screening out a first category pair and all second category pairs from the plurality of category pairs, wherein the first category pair is a category pair consisting of the first file category and the second file category, and the second category pair is a category pair including the first file category and not including the second file category;
decreasing the distance of the first kind of pair and increasing the distance of the second kind of pair;
selecting all third class pairs from the plurality of class pairs, the third class pairs being class pairs including the second file class;
screening the first q types of pairs with the shortest distance from the third type of pairs, wherein q is a positive integer;
and screening all the file types except the second file type from the file types contained in the q types of pairs, and taking all the screened file types as the analysis result.
In the embodiment of the application, the evaluation of two dimensions of the updating time and the file type is realized by analyzing and predicting the file type. And the quantification and the adjustment of the relevancy of the file types are realized by adjusting the type to the distance, so that the self-adaptive learning and adjustment of the use habits of the users are realized. Therefore, the embodiment of the application can better analyze the use habits of the user, so that the prediction is more accurate and reliable.
On the basis of the seventh possible implementation manner of the first aspect, in an eighth possible implementation manner of the first aspect, in the process of decreasing the distance of the first kind of pair and increasing the distance of the second kind of pair:
the distance added for each of the second kind pairs is the same, and the sum of the distances of the plurality of kind pairs is constant.
In the embodiment of the present application, the distance step added for each pair of the second kind is the same, so that each correlation adjustment is fair. And the total distance L is set to be unchanged, so that the balance under the adjustment of the overall correlation degree can be ensured, and the reliability of the adjusted correlation degree can be ensured.
A second aspect of an embodiment of the present application provides a document scanning apparatus, including:
and the result reading module is used for reading the prediction result associated with the external storage device when the access of the external storage device is detected.
And the file determining module is used for determining one or more files from the external storage equipment according to the prediction result, and the prediction result is data obtained by analyzing historical use data of the files in the external storage equipment by a user.
A file scanning module for scanning the one or more files in the external storage device.
And the file scanning module is further used for scanning the remaining unscanned files in the external storage device after the one or more files are scanned.
A third aspect of embodiments of the present application provides a terminal device, where the terminal device includes a memory and a processor, where the memory stores a computer program that is executable on the processor, and the processor executes the computer program to enable the terminal device to implement the steps of the file scanning method according to any one of the first aspect.
A fourth aspect of an embodiment of the present application provides a computer-readable storage medium, including: there is stored a computer program which, when executed by a processor, causes a terminal device to carry out the steps of the file scanning method as defined in any one of the above-mentioned first aspects.
A fifth aspect of embodiments of the present application provides a computer program product, which, when run on a terminal device, causes the terminal device to execute the file scanning method according to any one of the first aspect.
A sixth aspect of embodiments of the present application provides a chip system, where the chip system includes a processor, the processor is coupled with a memory, and the processor executes a computer program stored in the memory to implement the file scanning method according to any one of the first aspect.
The chip system can be a single chip or a chip module composed of a plurality of chips.
It is understood that the beneficial effects of the second to sixth aspects can be seen from the description of the first aspect, and are not described herein again.
Drawings
Fig. 1A is a schematic diagram of a process of scanning a file of an external storage device by a terminal device according to an embodiment of the present application;
fig. 1B is a schematic diagram of a process of scanning a file of an external storage device by a terminal device according to an embodiment of the present application;
FIG. 2 is a flowchart illustrating an implementation of a document scanning method according to an embodiment of the present application;
FIG. 3 is a flowchart illustrating an implementation of a document scanning method according to an embodiment of the present application;
FIG. 4 is a flowchart illustrating an implementation of a document scanning method according to an embodiment of the present application;
FIG. 5 is a schematic diagram of an application scenario provided by an embodiment of the present application;
fig. 6A is a schematic view of an application scenario provided in an embodiment of the present application;
fig. 6B is a schematic diagram of an application scenario provided in an embodiment of the present application;
fig. 6C is a schematic diagram of an application scenario provided in an embodiment of the present application;
FIG. 7 is a graph of category versus distance data in a document scanning method according to an embodiment of the present application;
FIG. 8 is a schematic structural diagram of a document scanning apparatus according to an embodiment of the present application;
fig. 9 is a schematic structural diagram of an electronic device to which a file scanning method provided in an embodiment of the present application is applied;
fig. 10 is a software system architecture diagram of a terminal device according to an embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
For the convenience of understanding, the embodiments of the present application will be briefly described herein:
in practical application, a user can store files in the external storage device, and then access the external storage device to the terminal device when the files need to be used. The terminal device scans files of the external storage device after detecting the access of the external storage device. Referring to fig. 1A, a schematic diagram of a process of scanning a file of an external storage device by a terminal device is shown. The scanning process is essentially that the terminal device reads attribute data of each file in the external storage device, such as attribute data of a thumbnail, a file name, a file size, a file type and a file path (i.e. a file address) of a picture file, and stores the attribute data (i.e. a scanning result) into a local database of the terminal device. And simultaneously, acquiring the attribute data from the database and displaying the attribute data to a user through the terminal equipment. Therefore, in the scanning process, the user can view and use the scanned files in the terminal equipment at any time. However, for the file which is not scanned completely, the file can be viewed and used after the scanning is completed.
With the development of technology, the capacity of the external storage device is larger and larger, and the capacity of storing files is stronger and stronger. However, due to limitations of external storage device hardware, terminal device hardware and software, and connection conditions of the two, the speed of scanning files of the external storage device by the terminal device is limited.
In a related art, the external storage device is scanned in a traversal manner. Namely, the attribute data of each file in the external storage device is traversed, so that the scanning of the files in the external storage device is completed.
The traversal scanning may implement scanning of files in the external storage device, but only sequentially according to the order of folders in which the files are located in the external storage device. When a large number of files are stored in the external storage device, if a user wants to use some of the files, it is often difficult to scan the files needed by the user in a timely manner through the traversal scan. For the user, if the file required by the user is not yet scanned by the traversal scan, the user needs to wait. The whole waiting time is unpredictable, and the real-time scanning condition cannot be known. During this waiting period, the user may attempt to search for the desired file in the external storage device. However, in the case where the desired file is not completely scanned, the user may not be able to view the file. Thereby making the user less aware of the entire waiting process. Finally, in practical application, a user often needs to wait for the terminal device to complete the traversal scanning of the file of the external storage device, and then can normally operate the external storage device and use the file required by the user. In summary, the efficiency of the traversal scanning is low for the user, the user needs to wait for a long time to use the file in the external storage device, and the user experience is poor.
To shorten user waiting time so that a user can use a desired file in a short time when an external storage device is accessed to a terminal device. One alternative is: and abandoning the scanning of some attribute data which takes longer time, and only performing traversal scanning on the attribute data which takes shorter time of the file part. For example, reference may be made to fig. 1B, which is a schematic illustration of the document scanning process in this manner. In contrast to fig. 1A, this approach would discard the scanning of the file thumbnail for pictures and videos. Although the speed of scanning the whole file can be improved in the mode, a large amount of important information is omitted, and file attribute data viewed by a user are not complete. In addition, the method still adopts traversal scanning, so that the file actually required by the user can still be difficult to scan in time. Therefore, the user still needs to wait for a long time to use the files in the external storage device, and the user experience is poor.
In this embodiment of the present application, after the external storage device is accessed each time, the terminal device records the use data of the user for the file in the external storage device. And meanwhile, the using habit of the user is analyzed according to the using data, and the file required by the user next time is predicted and recorded. On the basis, when the external storage device accesses each time (except for first access), the terminal device preferentially scans the predicted files required by the user after the previous access. And after the scanning of the files is finished, the scanning of other files in the external storage equipment is continued until the scanning of all the files in the external storage equipment is finished.
The method comprises the steps of recording the use data of a file by a user every time, predicting the file required by the user next time based on the use data, and preferentially scanning the predicted file at the previous time during each scanning. Therefore, the embodiment of the application can scan the files required by the user in time. In a very short time after the external storage device is accessed, the user can use the required file, so that the user experience is greatly improved.
Meanwhile, some terms and concepts that may be involved in the embodiments of the present application are described below:
the file type: i.e. the type of file, including video, audio, pictures, documents, etc. In some embodiments, the file type may be determined by the file format. Common video formats include, for example: mp4, avi, mkv, mov, rmvb, and the like. Common audio formats include: mp3, wav, and wma, etc. Common picture formats include: jpg, gif, png, bmp, etc. Common document formats include: txt, doc, xls, ppt, pdf, html, etc. When the format of the file is read, the file type can be determined. In some embodiments of the present application, the file types are divided into: video, audio, pictures, documents, and others, 5 in total. Wherein "other" includes all types other than video, audio, pictures, and documents.
The file types are as follows: in some embodiments of the present application, to enable prediction of user habits, files are classified into different categories (i.e., file categories). In prediction, a single file type is taken as an evaluation unit to judge the file type which is possibly used by a user next time. The dividing method of the file types is not limited too much here, and can be set by technical personnel according to actual requirements. For example, the file type may be set as a file type, in which case the file type and the file type are the same concept.
In some optional embodiments of the present application, the file may be classified according to two dimensions, namely, a file type and an update time, of the file, so as to implement analysis on usage habits of a user on the two dimensions, namely, the file type and the update time. For example, a duration threshold may be set and the difference between the file update time and the current time may be calculated each time the external storage device is accessed. And dividing the file into two updating states of latest updating and previous updating (hereinafter referred to as 'latest' and 'previous') according to the difference value and the size of the time length threshold. If the difference is greater than the time length threshold, updating the time length threshold; and if the difference is less than or equal to the time length threshold, the updating is latest. And finally, combining the update state and the file type to obtain the file type. As an alternative embodiment of the present application, when combining, some or all of the file types may be selected for permutation and combination. For example, assuming that there are M types of file types, M types of file types may be selected for permutation and combination. Accordingly, 2m file types can be obtained. As an alternative embodiment of the present application, there may be an option to not analyze the remaining M-M file types that are not participating in the permutation combination. In this case, if the user uses the M-M file types for actual operation, recording may not be performed. Wherein M is a positive integer greater than 1, and M belongs to [1, M ]. The specific size of m can be set by a technician according to actual needs, and is not limited herein.
As another alternative embodiment of the present application, the remaining file types not participating in permutation and combination can also be regarded as separate M-M file types on the basis of permutation and combination performed in the previous embodiment. In this case, 2M + (M-M) ═ M + M file types can be obtained.
To illustrate with an example, suppose the file types are divided into: video, audio, pictures, documents, and others, 5 in total. And 4 file types of video, audio, pictures and documents are selected as analysis objects. At this time, the file types and the update states are arranged and combined to obtain: recent video, recent audio, recent picture, recent document, previous video, previous audio, previous picture, and previous document, for a total of 8 file categories. And if the remaining file types which do not participate in the permutation and combination are also used as the independent file types. At this time, "other" is not combined and may be a single file type. It is thus possible to obtain: recent video, recent audio, recent picture, recent document, previous video, previous audio, previous picture, previous document, and others, for a total of 9 file categories.
The usage data: the method refers to relevant data when a user uses files in an external storage device in a terminal device, such as used files, and file types and update time of the files. The use data is used for analyzing the use habit of the user so as to predict the file required to be used by the user when the external storage device is accessed next time. Therefore, the content actually contained in the usage data is determined according to the prediction method actually adopted. For example, in some embodiments, it is assumed that the prediction method requires all files used by the user, as well as the file types of those files. The usage data may only contain all used files and the file types of the files after each access of the external storage device by the user, and the update time of the files may not be contained at this time. For another example, in other embodiments, it is assumed that the prediction method only requires the file type and the update time of the first used file after the user accesses 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 the user accesses the external storage device. But may not contain data related to files used by the second or third user. The usage data can be selectively stored in a local database of the terminal device, or can be selectively deleted after only temporarily caching the usage data and analyzing the usage data.
An external storage device: the method and the device do not limit the types of the external storage equipment too much, and can be determined according to actual application scenarios. For example, it may be a flash disk, a memory card, a floppy disk, a hard disk (including a removable hard disk), or an optical disk, or it may be another type of external storage device. For convenience of explanation, in the following embodiments of the present application, "file" refers to "file in external storage device", unless otherwise specified.
The external storage device is accessed into the terminal device: according to different types of the external storage device and the terminal device, the access mode of the external storage device can have certain difference. Therefore, the specific access mode needs to be determined according to the actual application scenario. For example, when the external storage device is a flash disk and the terminal device is a device (e.g., a computer) having a flash disk insertion port. Access at this time means that the flash disk is inserted into a port of the terminal device. When the external storage device is a mobile hard disk, access refers to connecting the hard disk with the terminal device by means of a data line or the like. When the external storage device is an optical disc, accessing means to place the optical disc into the optical drive of the terminal device.
The external storage device is disconnected with the terminal device: is a concept as opposed to "external storage device access terminal device". Depending on the type of external storage device and the access method, there may be some differences in the manner of disconnection. For example, when the access mode is insertion, the disconnection mode is extraction. When the connection mode is the connection through the data line, the disconnection mode is the disconnection of the data line. When the access mode is to place the optical disc into the optical drive of the terminal equipment, the disconnection mode is to eject the optical disc for the terminal equipment.
The use process of the terminal device to the external storage device (hereinafter referred to as use process): the process is that the external storage device disconnects from the terminal device as the end point starting from the access terminal device. In practical application, the time from the access of the external storage device to the start of the file scanning of the external storage device is very short. Before scanning the file, the user cannot use the file in the external storage device. Therefore, the starting point of the usage process may be that the terminal device starts to scan files of the external storage device.
In the using process, a user may operate the files in the external storage device at any time, and the content, the quantity and the time of the operated files are difficult to predict. In the embodiment of the application, for each use process, the terminal device records corresponding use data. And the use data is analyzed to predict the files needed by the user in the next use process.
Update time of file: also referred to as the modification date, refers to the time when the file was last updated in the external storage device. Wherein the update operation includes but is not limited to such as: modifying file content, modifying file format, writing files to external storage devices, etc. When there are multiple update operations, the update time refers to the time of the latest update operation.
The file scanning method provided by the embodiment of the application can be applied to terminal devices such as mobile phones, computers (including tablet computers, notebook computers and desktop computers), televisions and wearable devices, and the terminal devices are the execution main bodies of the file scanning method provided by the embodiment of the application.
In addition, the embodiment of the application does not excessively limit the types of the operating systems of the terminal devices. In theory, the technical scheme of the embodiment of the application can be applied to any operating system. The operating system of the application can thus be determined according to the actual terminal device situation. For example, an android system, a hongmeng system, a Windows system, or a Linux system.
For explaining the technical scheme of the application, the external storage device access terminal device is divided into a first access and an nth access according to the time sequence of accessing a single external storage device to the terminal device, wherein n is greater than or equal to 2. And are explained in this order by specific examples.
Fig. 2 shows a flowchart of an implementation of a file scanning method provided in an embodiment of the present application, which is detailed as follows:
the user can select the external storage device to be used according to the requirement, and the external storage device is accessed to the terminal device.
After detecting that the external storage device is accessed, the terminal device identifies whether the external storage device is accessed for the first time. When the access is the first time, the first phase is entered. And entering the second stage when the access is not the first access. The method for identifying whether the external storage equipment is accessed for the first time is not limited too much in the embodiment of the application, and the method can be set by a technician according to the self-setting.
In addition, as an optional embodiment of the present application, if the terminal device runs in the android system. The terminal device sends a mount broadcast after detecting the access of the external storage device to inform an application program and the like that the external storage device has been accessed.
As an optional way for identifying whether the external storage device is accessed for the first time in the present application, in the embodiment of the present application, the unique identifier of the external storage device may be recorded after the external storage device is accessed every time. On the basis, the terminal device acquires the unique identifier of the external storage device after detecting the access of the external storage device, and judges whether the unique identifier is recorded. If the unique identifier is not recorded in the terminal device, it indicates that the current external storage device has not been accessed to the terminal device. That is, the external storage device is first accessed to the terminal device. Otherwise, if the unique identifier has been recorded in the terminal device, it indicates that the external storage device has been accessed to the terminal device before. The embodiment of the present application does not limit the type of the unique identifier, and can be set by a technician. For example, the Universal Unique Identifier (UUID) of the external storage device may be used.
And in the first stage, the external storage equipment is accessed into the terminal equipment for the first time.
For the case that the external storage device is the first access terminal device, the two operations, operation 11 and operation 12, are included in the time sequence of occurrence:
operation 11: and scanning the files of the external storage equipment.
When the external storage device is first accessed, the user has not used the external storage device in the terminal device theoretically before. At this time, the usage data of the external storage device by the user cannot be acquired, and thus it is difficult to predict the usage habit of the user on the external storage device. Based on this practical situation, in the embodiment of the present application, a default method for scanning a file of an external storage device is preset, and when detecting that the external storage device is accessed for the first time, the default method is used for scanning the file. The embodiment of the present application does not limit the default method too much, and the technical staff can set the method according to the actual situation. For example, traversal scanning may be used as a default method, or the order of different file types may be preset, and the default method is set to perform file scanning in sequence according to the order of the file types.
Operation 12: the terminal equipment records the use data of the user on the files, analyzes the use habit of the user based on the use data and predicts the files required by the user next time.
After the external storage device is accessed, the terminal device scans the file of the external storage device and starts to record the usage data of the file in the external storage device (the usage data recorded at this time may also be referred to as first usage data) for analysis. Corresponding to the two operations of recording and analyzing the usage data, the operation 12 can also be divided into two operations a and b:
and a, operating a, recording the use data of the file by the user by the terminal equipment.
The content contained in the use data is determined according to a prediction method of a file required by a user next time. Therefore, in the embodiment of the present application, a technician is required to set the prediction method to be used in advance and set the content of the usage data corresponding to the acquisition requirement.
As an alternative embodiment of the present application, during each usage, the recording of usage data is divided into two possible cases:
case 1, the usage data that needs to be recorded may be throughout the usage process. For example, the usage data is set to all files and file types used by the user during the usage process. At this time, since it is not possible to predict when the user will use what files, usage data recording is required for the entire usage process. The recording of the usage data is not completed until the external storage device is disconnected from the terminal device.
Case 2, the usage data to be recorded, will only exist in part of the usage process. For example, the usage data is set as: after the external storage device is accessed, the user uses the file type and the update time of the file for the first time. At this time, if the user uses one file, the terminal device can record the usage data. After that, the operation of the file by the user does not affect the recording of the use data.
As can be seen from the above description of cases 1 and 2, there may be a difference in the operation occurrence period of the usage data distance depending on the content of the usage data. The operation of predicting the file required by the user next time is an operation based on the recorded use data. Therefore, in the embodiment of the present application, according to different prediction methods, the prediction operation on the next file required by the user may be performed during the use process or after the use process is finished.
As an alternative embodiment of the present application, it may be configured that: and after the process that the terminal equipment uses the external storage equipment is finished, analyzing the use data, and predicting the file required by the user next time.
And b, analyzing the use habits of the user based on the use data, and predicting the next required file of the user.
On the basis of obtaining the use data, the embodiment of the application utilizes a preset prediction method to process the use data, so that the use habits of the user are analyzed, and a corresponding prediction result is obtained. The embodiment of the present application does not excessively limit a specific prediction method, and can be set by a technician according to actual requirements.
In addition, on the basis that one or more files can be determined by using the prediction result, the content included in the prediction result may have a certain difference according to the prediction method. For example, in some alternative embodiments, the prediction result may be one or more specific file addresses (hereinafter, referred to as file addresses) in the external storage device, and at this time, the terminal device may precisely locate one or more files in the external storage device according to the file addresses. In other alternative embodiments, the prediction result may also be data such as update time, file type or file type. At this time, the terminal device may screen one or more files from the external storage device according to the prediction result and the attribute of the file. Therefore, the content of the prediction result is not limited too much in the embodiment of the application, and can be determined according to the actually set prediction method.
In some optional embodiments of the present application, the following several optional prediction methods are provided:
the prediction method 1: and recording the file type of the file used by the user firstly in the process, and predicting the file type required by the user next time. The prediction result is a single file type. On this basis, the terminal device will preferentially scan all files in the external storage device under the file type after the external storage device is accessed next time.
The prediction method 2: the preset file type division rule is as follows: the file update status and the arrangement of the file types combine the results, such as recent video, recent audio, recent picture, recent document, previous video, previous audio, previous picture, and previous document.
And recording the file type and the updating time of the file used by the user firstly in the using process, and identifying the file type of the file based on the file type and the updating time. And predicting the file type as the file type of the file required by the user next time. The predicted result is a file type. On this basis, after the external storage device is accessed next time, the terminal device will scan the file type and the update time of each file in the external storage device first, and identify the file type of each file. And then scanning all the files under the file type.
The prediction method 3: and recording all files used by the user in the using process, screening out the files with the highest using times, and predicting the file types of the files as the file types required by the user next time. The predicted result is one or more file types (the user may use only one type of file, and there may be only one file type). On this basis, the terminal device will preferentially scan all files in the external storage device under the file type after the external storage device is accessed next time. The number of the files to be screened can be set by a technician, and the number is not limited too much. For example, the value may be set to any one of 1 to 1000, or may be other values.
Considering that the usage habits of users on files have certain regularity, the usage frequency of the users is often higher than that of other unnecessary files for the actually required files. Therefore, by screening out the files with the highest use frequency of the user and recording the corresponding file types, the use habits of the user can be analyzed, and the effective prediction of the file types required by the user can be realized.
The prediction method 4: and recording all files used by the user in the using process, screening out the files with the highest using times, and predicting the file addresses of the files as the file addresses of the files required by the user next time. At this time, the prediction result is one or more file addresses. On the basis, after the external storage device is accessed next time, the terminal device can scan the addresses in the external storage device preferentially, so that the files can be scanned preferentially. This prediction method is the same principle as the above prediction method 3, and therefore, the description of the above prediction method 3 can be referred to. But the prediction method does not adopt the file type but adopts a specific file address, so the fineness is higher. More accurate file positioning can be achieved at this time. Compared with the prediction method 3, the file data which can be found theoretically can be reduced.
In practical applications, a skilled person may select any one of the 4 prediction methods as the prediction method preset in the embodiment of the present application, and may also use other methods besides the 4 prediction methods as the prediction method preset in the embodiment of the present application. The embodiments of the present application are not limited to a few.
After the prediction of the file required by the user next time is completed, the embodiment of the application stores the prediction result locally in the terminal device.
As an alternative to identifying whether the external storage device is first accessed in the present application. In the embodiment of the application, after the terminal device is accessed to the external storage device each time, the terminal device analyzes the usage data of the user and stores the prediction result obtained by analysis locally. Therefore, theoretically, except for the first access, when the external storage device is accessed each time, a prediction result corresponding to the external storage device exists in the terminal device. Based on this situation, in the embodiment of the present application, after the external storage device is accessed, the prediction result corresponding to the external storage device may be searched. If the access request is found, the access request is not the first access. Otherwise, if the user can not find the access object, the access object is indicated to be accessed for the first time.
And in the second stage, the external storage equipment is accessed for the nth time, and n is not less than 2 at the moment. (stage one can be considered as the case where n ═ 1)
For the case that the external storage device is not the first access terminal device, the operations 21 and 22 are also included in the time sequence of occurrence:
operation 21: and scanning the files of the external storage equipment.
For the situation that the external storage device is not accessed for the first time, the terminal device stores the prediction result of the terminal device on the file required by the user after the external storage device is accessed for the last time. Referring to fig. 3, the embodiment of the present application performs the following operations S101-S103:
s101, reading a prediction result associated with the external storage device, and determining one or more files needing to be scanned preferentially according to the prediction result.
The terminal equipment analyzes and predicts the use habits of the user after the external storage equipment is accessed every time, and locally stores the prediction result. Therefore, theoretically, the terminal device can read the locally stored prediction result every time the external storage device is accessed (except for the first access). On the basis, the embodiment of the application analyzes the prediction result to determine the file which needs to be preferentially scanned at this time.
As can be seen from the description of operation b in stage one, there are many possible contents contained in the prediction result. Therefore, in the embodiment of the present application, there may be various implementation manners for determining the file according to the prediction result corresponding to the prediction result of different contents. For example, the following may be the case:
1. if the prediction result is one or more file addresses. At this time, the corresponding files are directly searched in the external storage device according to the file addresses.
2. If the predicted result is a directly readable attribute such as file type or update time. At this time, the terminal device needs to scan the attributes and file addresses of all files in the external storage device, and then screen out one or more files corresponding to the prediction result according to the prediction result and the scanned attributes. And according to the file addresses of the files, the specific files are quickly positioned.
For example, assume that the prediction is of file type: and (6) video. At this time, the terminal device scans the file types and file addresses of all files in the external storage device, and filters out all video files. And then according to the file addresses of the video files, quickly positioning the video files and carrying out preferential scanning.
It should be noted that in practical applications, the attributes of the address, the file type, and the update time of the file are all attribute data that can be scanned very quickly by the terminal device. It can be known from actual measurement that the terminal device takes a very short time to scan the attributes such as the addresses, file types, and update times of all files in the external storage device (for user perception, the time consumption is very short, and the user basically cannot perceive the difference caused by the time consumption). And therefore does not substantially affect overall document scanning efficiency.
3. If the prediction result is a compound attribute which cannot be directly read, such as a file type. First, the basic attributes required for dividing the composite attributes are preset in the embodiment of the present application, for example, it is assumed that the file types are divided according to the update status and the file type of the file. At this time, the basic attributes corresponding to the categories include: update time and file type.
On the basis of setting the basic attributes required by the composite attribute, the terminal device will first scan the basic attributes and file addresses of all files in the external storage device (if the basic attributes already include file addresses, only the basic attributes need to be scanned). And screening one or more files corresponding to the prediction result according to the basic attributes and the prediction result. And according to the file addresses of the files, the specific files are quickly positioned. The embodiment of the application provides two optional file screening methods:
a. and the terminal equipment determines the composite attribute corresponding to each file according to the scanned basic attribute. And screening out one or more corresponding files according to the prediction result and the composite attribute of each file. For example, assuming a composite attribute is a file type, the required base attributes include a file type and an update time. At this time, the terminal device determines the file type of each file according to the file type and the update time of each file. And screening all files of which the file types are the file types in the prediction result. If the file type of the prediction result is assumed to be the latest video, all files belonging to the latest video are screened out in the embodiment of the present application.
b. And decomposing the compound attribute in the prediction result into one or more corresponding basic attributes, matching the basic attributes of the scanned files based on the basic attributes, and screening one or more successfully matched files. For example, assuming a composite attribute is a file type, the required base attributes include a file type and an update time. At this time, the terminal device decomposes the composite attribute in the prediction result into a corresponding file type and update time, and performs attribute matching on each file according to the decomposed file type and update time. For example, it is assumed that the time length threshold for the two update states of "latest" and "past" is set to be half an hour, and the file type of the prediction result is the latest video. At this time, the embodiment of the application can match all the files, and all the files with update time within half an hour of the current time and with the file types of videos are screened out.
In practical applications, a technician may select any one of the above document screening methods for document screening, or may design or select another method for document screening by himself, which is not limited herein.
S102, scanning the one or more files in the external storage device.
S103, after the one or more files are scanned, scanning the remaining unscanned files in the external storage device.
After all the files required to be preferentially screened are determined, the embodiment of the present application performs attribute data scanning on the files in the external storage device. After the scanning of the files is completed, the terminal device continues to scan other files in the external storage device.
Wherein for the attributes that have been scanned in the process of determining to filter the files preferentially in S101, no further scanning of the attribute data is required. For example, it is assumed that the file address, the file type, and the update time of each file have been scanned in S101. At this time in S102 and S103, it is not necessary to scan these several attribute data of the file any more, but the scanning of the attribute data such as the file name, the file size, and the thumbnail image continues.
Operation 22: recording the use data of the user on the files, analyzing the use habit of the user based on the use data, and predicting the files required by the user next time. Operation 22 may also be divided into two operations, usage data recording and usage data analysis:
after the external storage device is accessed, the terminal device scans the file of the external storage device and starts to record the usage data of the file in the external storage device (the usage data recorded at this time may also be referred to as first usage data) for analysis. The specific operation details, principle, and beneficial effects of operation 22 can all refer to the related descriptions of operation 12, which are not repeated herein. Meanwhile, after the prediction of the file required by the user next time is completed, the embodiment of the present application stores the prediction result locally in the terminal device (the prediction result at this time may also be referred to as an analysis result).
When the prediction result is stored, if the history prediction result corresponding to the external storage device is stored in the terminal device. The embodiment of the present application stores the latest prediction result generated at present, covering the historical prediction result. Therefore, only one latest prediction result exists for a single external storage device in the terminal device. Namely, the existing prediction result is updated by using the currently obtained analysis result.
It should be noted that, when n is different, the prediction methods adopted by the terminal devices may be different. Namely, a plurality of sets of prediction methods can be set in the terminal equipment at the same time, and the corresponding used prediction methods are set for different n values. For example, the prediction method a may be adopted when n is set to 1 (i.e., when the external storage device is first accessed). When n is 2, the prediction method B is used. And when n is greater than 2, adopting a prediction method C.
In the embodiment of the application, after the external storage device is accessed each time, the terminal device records the use data of the user to the file in the external storage device in the use process. And meanwhile, the using habit of the user is analyzed according to the using data, the file required by the user next time is predicted, and the prediction result is stored. On this basis, when the external storage device accesses each time (except for first access), the terminal device determines one or more files which need to be scanned preferentially according to the prediction result, and scans the files preferentially. And after the scanning of the files is finished, the scanning of other files in the external storage device is continued. Therefore, the embodiment of the application can scan the files required by the user in time. In the very short time after the external storage device is accessed, the user can use the required file, so that the scanning efficiency of the terminal device on the file in the external storage device is greatly improved, and the user experience is improved.
The embodiments shown in fig. 2 and 3 are illustrated by way of example, and reference may be made to fig. 4. In the embodiment of the application, the terminal device is an intelligent television, and the terminal device operating system is an android system. The intelligent television is provided with a scanning process for scanning files of an external storage device. Meanwhile, a local database used for storing a prediction result and a unique identifier corresponding to the external storage device and a file information database used for storing a real-time scanning result are arranged in the intelligent television. In addition, when a user opens a folder containing scanned pictures or videos, thumbnails of the pictures and the videos are synchronously displayed in the display interface, so that the user can browse and use the files conveniently. The external storage device is a mobile hard disk.
On this basis, in this example, the process of scanning the file of the external storage device by the smart television is as follows:
after detecting that the external storage device is accessed, the operating system of the terminal device sends a mounting broadcast to inform an application program and the like that the external storage device is accessed to the smart television.
The terminal device obtains the unique identifier of the external storage device and matches the unique identifier stored in the local database to judge whether the external storage device is accessed for the first time. And if the unique identifier of the external storage equipment is matched, determining that the external storage equipment is not accessed for the first time. If the unique identifier of the external storage device is not matched, the external storage device is judged to be accessed for the first time.
And if the external storage equipment is accessed for the first time, the terminal equipment starts a scanning process and performs file traversal scanning on the external storage equipment according to the sequence of the folders. And the scanning result is synchronously stored in a file information database in real time.
If the external storage device is not accessed for the first time, the corresponding prediction result of the external storage device is searched from the local database.
Starting the scanning process, and transmitting the prediction result as a parameter into the scanning process.
And the scanning process preferentially scans the file corresponding to the prediction result and then traverses other files. And the scanning result is synchronously stored in a file information database in real time.
The user can browse the scanned file by operating the terminal equipment. And responding to the operation of the user, the terminal equipment acquires the scanning result from the file information database and displays the scanning result to the user through the display interface. When a user opens a folder containing scanned pictures or videos, the terminal equipment synchronously displays thumbnails of the pictures and the videos in the display interface.
And the terminal equipment records the use data of the file by the user to a local database.
And the terminal equipment analyzes the use data in the local database by using a preset prediction method to obtain a prediction result of a file required to be used by the user next time. And updating the corresponding prediction result of the external storage equipment in the local database by using the prediction result obtained at this time.
The embodiments shown in fig. 2 to 4 are supplemented by the following points:
1. in view of user privacy concerns, the user may be requested for permission before recording user usage data.
The user privacy data is considered to be the data used by the user for the files in the external storage device. In order to ensure the privacy security of the user, in the embodiment of the present application, the usage data is recorded before the operations 12 and 22. The terminal device will first request the user for the usage right to the usage data. And operations 12 and 22 are performed only after the user agrees to the terminal device usage right.
The method for requesting the use permission from the user is not limited too much in the embodiment of the application, and can be set by a technician according to the method. For example, in some optional embodiments, the terminal device may request the permission from the user in the form of a popup after detecting the access of the external storage device. And operations 12 and 22 are performed only after the user approves the request. The benefits of this are:
(1) and when the operation 11 and the operation 21 are executed to scan the file of the external storage device, the user is requested to use the permission in the form of the popup window, the time for the user to check the content of the popup window is multiplexed, and the available time for scanning the file can be increased more friendly. For the user, the process of viewing the popup content is better than the process of purely waiting for scanning, and the user perception effect is better. Thereby improving the user experience.
Among other things, to better protect user privacy. In the embodiment of the present application, if the user finally selects to reject the usage right of the terminal device, the terminal device may select to terminate the existing scanning process first, and delete the scanned data. And then the file scanning is carried out on the external storage equipment again.
(2) And requesting the user in a popup mode, wherein the user can use the file in the external storage device which is difficult to use before closing the popup. So theoretically no usage data will appear before the pop-up is closed. So that the recording of the user usage data can be complete. And the situation that the user starts recording the usage data without agreeing to the usage right does not occur. So that the user privacy data can be better protected.
As an example for illustration, reference may be made to fig. 5. The terminal device is now a handset. After the mobile phone detects that the external storage device is accessed, a pop-up window is popped up as shown in fig. 5. The popup window is provided with prompt words to inform the user that the mobile phone needs the use permission of the data. If the user agrees, the user can click on 'agreement', otherwise, if the user disagrees, the user can click on 'rejection'. If the user clicks "agree," the handset will begin to perform either operation 12 or operation 22.
2. The embodiments shown in fig. 2-4 may be added to the underlying scanning logic of the terminal device operating system.
In the embodiment of the present application, the schemes in the embodiments shown in fig. 2 to fig. 4 may be added to the underlying scanning logic of the terminal device operating system. Because the bottom scan logic of the operating system has higher authority and can be triggered by the operating system in time. Therefore, the terminal device can more efficiently scan the files of the external storage device.
In addition, the solutions shown in fig. 2 to 4 can also be applied to some document management and scanning applications. Such as a third-party file manager in the android system and third-party file search software in the Windows system. The specific setting can be set by technicians according to actual requirements. And are not intended to be unduly limited herein.
3. In the scanning process, a user can check the scanned file at any time. According to the different situations of the actual terminal equipment, at least two possible scenes of a scene a and a scene b are included:
the scene a and the terminal equipment file management interface can be preloaded with files, and the files which are preferentially scanned belong to the preloaded files. At this time, the terminal device displays the thumbnail of the file scanned preferentially while scanning the file preferentially. Thereby realizing the effect of 'access and display'.
As an example for illustration, reference may be made to fig. 6A. In this case, the terminal device is a mobile phone, and fig. 6A shows a main file management interface (i.e., the first interface after the file manager is opened) of the mobile phone when the external storage device is accessed. In the embodiment of the application, after the mobile phone accesses the external storage device, some pictures in the external storage device are preloaded to the file management main interface. So that the user can quickly preview and use the picture. On the basis, if the file corresponding to the prediction result contains the picture. At this time, the embodiment of the present application will preferentially scan the pictures in the external storage device, and pre-load the scanned pictures into the file management host interface. Therefore, the effect of accessing and displaying pictures in the external storage device is realized. For the user, the user can view and use the required picture in a very short time without waiting for the completion of the file scanning of the external storage device. Therefore, the scanning efficiency is greatly improved, the waiting time of a user is greatly shortened, and the use experience of the user is improved.
In order to test the effect of the embodiment of the present application on file scanning, the test conditions are set as follows:
the external storage device is a mobile hard disk with 2TB capacity, and the external storage device is filled with media files such as video, audio and pictures. The terminal equipment is an intelligent television. And the smart television preloads the picture thumbnail in the external storage device on the resource management interface, which can refer to fig. 6B. On the basis, the tester is used as a user to use the file in the mobile hard disk in the smart television and prefers to use the picture in the file.
In an actual test, if traversal scanning is adopted, the total time consumed for loading pictures on the resource management interface is about 8 minutes. However, if the embodiment shown in fig. 2 to 4 is used for processing, the user does not access the mobile hard disk for the first time. The intelligent television can realize the preferential scanning of the preference pictures of the testers within hundreds of milliseconds, and the thumbnails are displayed in the resource management interface. Therefore, the scanning time of the user sensing file can be shortened to a hundred millisecond level, the user can view and use the required picture without waiting for scanning, and the user experience is greatly improved.
And b, directly operating the terminal equipment by the user after the user accesses the external storage equipment, and automatically opening the folder to search the file. At this time, if the user finds the files which are preferentially scanned, the files can be directly displayed in the folder for the user to browse and use.
For the media file with the thumbnail which is preferentially scanned, if the terminal device is provided with the icon viewing file, the thumbnail of the file can be directly loaded for display when the user opens the folder. At this point, previewing of the media file content may be greatly facilitated.
As an example for illustration, reference may be made to fig. 6C. The terminal device is assumed to be a mobile phone. The picture of intelligent bracelet and intelligent wrist-watch is stored to the external storage equipment, and the picture of intelligent bracelet and intelligent wrist-watch is the file of priority scanning. Wherein the folder storage path of the picture of intelligent bracelet and intelligent wrist-watch is: smart device folder-wearable device folder-bracelet and watch folder.
In this example, after the mobile phone is connected to the external storage device, the pictures of the smart band and the smart watch are preferentially scanned. The user can click and open in the mobile phone in sequence: smart device folder-wearable device folder-bracelet and watch folder. After opening bracelet and wrist-watch folder, the picture thumbnail of intelligent bracelet and intelligent wrist-watch can be shown automatically to the cell-phone, as figure 6C.
Because the whole process of searching and opening the folder needs a certain time, in the example, the mobile phone can finish scanning the pictures of the smart bracelet and the smart watch by multiplexing the time. Therefore, for the user, the mobile phone can directly operate the external storage device when detecting the external storage device, open the corresponding folder and view the pictures of the smart band and the smart watch. The user can hardly sense the scanning operation in the whole process, and the scanning is not required to wait. Therefore, efficient scanning can be realized, the scanning waiting time of a user is shortened, and the use experience of the user is improved.
The entire process, in which scenario b occurs, is almost unsmooth to the user. Generally, at least one second is required in the process from the time when the external storage device accesses the terminal device to the time when the user opens the file management interface of the external storage device in the terminal device to the time when the user opens the folder in the interface. For example, a flash disk is inserted into a computer, a file manager interface (e.g., "my computer" or "computer" interface) is opened in the computer, and then a folder of an external storage device is opened from the interface. This process typically takes at least one second. Experiments prove that the method of the embodiment of the application can realize the preferential scanning of the files within hundreds of milliseconds according to the difference of the number of the files which are preferentially scanned. Therefore, it is a process that is basically imperceptible to the user, and is also "waiting for scanning". So that no jamming condition occurs.
It should be noted that there is no logical conflict between scenario a and scenario b described above. Therefore, in practical applications, the scene a and the scene b may exist simultaneously. At the moment, the user can check the thumbnail of the required file on the resource management main interface, and can directly open the corresponding folder to check and use the required file.
4. A specific prediction method.
In order to analyze the use habits of the user and predict the file required by the user next time, the embodiment of the application provides an optional specific prediction method. The details are as follows:
before prediction: before the external storage device accesses the terminal device, parameter setting is performed in advance.
In the embodiment of the application, a duration threshold value is preset, and the file is divided into two updating states of 'previous' and 'latest'. Wherein "before" means that the difference between the update time of the file and the current time is greater than the duration threshold, and "most recent" means that the difference between the update time of the file and the current time is less than or equal to the duration threshold. Therefore, the update state of the file is an attribute which dynamically changes with time. Meanwhile, m file types are selected for being combined with the updating state to obtain a plurality of file types serving as analysis objects. Wherein m is a positive integer, and the specific values of the duration threshold and m can be set by a technician according to actual requirements. For example, in some alternative embodiments, 4 file types of video, audio, picture and document may be selected to be combined with the update status, and the following results are obtained: recent video, recent audio, recent picture, recent document, previous video, previous audio, previous picture, and previous document, for a total of 8 file categories to be analyzed. In some alternative embodiments, the duration threshold may be set to any value between 1 and 4 days.
On the basis of setting the file types, the file types are subjected to pairwise repetition combination (combination with repetition) to obtain H (2, m) type pairs. Wherein H (2, m) ═ m +1 × m ÷ 2. For example, when m is 8, H (2, 8) 9 × 8 ÷ 2 ═ 36 pairs of species can be obtained.
In the embodiment of the present application, a distance of correlation between two document types is defined as l, which may also be referred to as a distance l between a pair of types consisting of two document types. Where the distance l is inversely related to the degree of correlation. I.e. the closer the distance i is, the higher the relevance between the two file categories. Conversely, when the distance l is about large, the farther between the two file types, the lower the correlation.
The initial value of the distance l between the two file types in each type pair is a constant a, wherein a is a positive number. The total distance L of the correlations between the H (2, m) pairs of species is H (2, m) × a × (m +1) × m ÷ 2. And the value of the total distance L of the correlation degree is constant in the process that the user uses the external storage equipment.
Under the condition that the external storage device is accessed into the terminal device twice, the file types of the first file used by the user in the two using processes are as follows: a first file type and a second file type. For example, during the current usage, the file that the user first uses belongs to file category 1. In the latter use, the file that the user first used belongs to file category 2. The file type 1 and the file type 2 are the first file type and the second file type. It can be seen that, in the embodiment of the present application, the first file category and the second file category are only a relative concept named after each other according to the occurrence time sequence. For a single file type a, the file type a is a second file type compared with a file type b to which a file used by a user firstly belongs in the previous use process. In contrast, in the next using process, the file type c to which the file used by the user first belongs, and the file type a is the first file type.
On the basis of the above setting, the intimacy p is defined as: a close step of the distance between the first file type and the second file type. I.e. the step size of the single correlation increase between two file categories.
Defining the degree of sparseness q as: a step size of a distance between the first file type and the second file type. I.e. the step size of the single correlation reduction between two file categories.
Wherein p and q are both positive numbers less than a, and p ═ m-1) q. The specific values of p and q can be set by the skilled person, for example, when a is 1, p is 0.07 and q is 0.01.
(II) before prediction: and recording the use data in the use process, namely recording the file type of the file used by the user for the first time.
In practical applications, it is found that when a user uses an external storage device, the usage has a certain personal habit, and the habit has a certain rule to follow. In the two adjacent using processes, the relevancy between the two file types used by the user for the first time is improved compared with other types. For example, when a user uses a file for the first time in the previous use process, the file belongs to the file type a, and the file for the first time in the later use process belongs to the file type B. At this time, it is stated that the file type a and the file type B are both file types required by the user in two use processes, so that the correlation between the file type a and the file type B is improved in terms of user requirements. Based on this principle, in the embodiment of the present application, in each use process, the terminal device records the file type (i.e., the usage data) to which the file used by the user for the first time belongs.
(III) prediction process: two operations are included for updating the distance of the category pair and determining the category of the file based on the distance of the category pair.
Distance of update category pair:
when the file type (namely, the second file type) to which the file used for the first time by the user in the process of using the file for the first time by the user belongs is recorded, the terminal device reads the file type (namely, the first file type) to which the file stored locally, used for the first time by the user in the process of using the file for the first time by the user belongs and the distance between each type pair.
For the external storage device to access the terminal device for the first time, there is no corresponding first file type, and the distance between each type pair is a. In this case, the skilled person may perform prediction by using any one of the prediction methods 1 to 4, or may perform prediction by using other prediction methods, which is not limited herein. However, in the embodiment of the present application, it is required to store the file type to which the file used by the user for the first time belongs in the use process. And record that the distance of each class pair is still a.
For the external storage device not accessing the terminal device for the first time, there is a corresponding first file type at this time. In this case, the distance between the second file type and the first file type is decreased by the affinity p, and the distances between the first file type and other file types are both increased by the sparseness q (i.e., the distance between the pair of the first type is decreased, and the cluster of the pair of the second type is increased), so as to update the distances between the pairs of the respective types. The distance between the type pair composed of the second file type and the first file type is: the distance of the previous recording decreases the intimacy p.
For the 2 nd access terminal device of the external storage device, the distance of each category pair recorded last time is a. The 3 rd access of the external storage device to the terminal device is based on the distance obtained by processing the use data after the external storage device is accessed to the terminal device for the 2 nd time. The nth access of the external storage device to the terminal device is based on a distance obtained by processing usage data after the nth-1 access of the external storage device to the terminal device. And so on.
For example, suppose a user uses a file of a file type a for the first time during the usage process and uses a file of a file type C for the first time during the previous usage process (i.e. the second file type is file type a and the first file type is file type C). At this time, the embodiment of the present application decreases the distances between the file type a and the file type C by the affinity p, and increases the distances between the file type C and other file types by the sparseness q. The distance corresponding to the type pair consisting of the file type A and the file type C is as follows: the distance of the previous recording decreases the intimacy p. For example, for the 2 nd access terminal device of the external storage device, the distance corresponding to the class pair consisting of the file class a and the file class C at this time is: a-p. The distances between file type C and other file types are: a + q.
Determining the file type according to the distance of the type pair:
as an alternative embodiment of the present application, after the current distance update of the category pair is completed, the present application embodiment searches all category pairs (i.e. the third category pair) including the second document category, and filters out the category pair with the shortest distance. And finally, storing another file type out of the second file type in the type pair as a prediction result.
As another alternative embodiment of the present application, after the current distance between the category pairs is updated, the present application may search all category pairs including the second document category and select a plurality of category pairs with the shortest distance from the category pairs. And finally, storing the other file type out of the second file type in the types as a prediction result. At this time, the prediction result includes one or more sorted file types.
Accordingly, when one or more files are determined based on the prediction result. If the predicted result includes a plurality of sorted file types, the first sorted file type can be taken according to the sorting order, and the corresponding file under the file type can be searched from the external storage device. And if the file is found, taking the found file as the file which is preferentially scanned. And if the file cannot be searched, repeatedly selecting the first sorted file type according to the sorting sequence, and searching the corresponding file under the file type from the external storage equipment. Until the file is found, or all the file types in the prediction result are found.
For example, assume that the second file type is file type a and the first file type is file type C. After the update, there are 4 types of pairs including file type A, as follows:
species pair 1: file type a-file type a, distance l being 1.
Species pair 2: file type a-file type B, distance l is 0.5.
Species pair 3: file type a-file type C, distance l is 0.7.
Species pair 4: file type a-file type D, distance l is 0.8.
When only one type pair with the shortest distance is selected, the shortest distance is 0.5 of the type pair 2, and the file type B is stored as the prediction result. (if the shortest distance is the case when the class pair is 1, the other file type is the same as the second file type and can be used as the prediction result)
When the selection is set to select only a plurality of types of pairs having the shortest distance, for example, 2 types of pairs having the shortest distance are set. In this case, the shortest distance is the type pair 2 and the type pair 3, and thus the file type B and the file type C are stored together as the prediction result.
In the embodiment of the application, the evaluation of two dimensions of the updating time and the file type is realized by analyzing and predicting the file type. Therefore, the embodiment of the application can better analyze the use habits of the user, so that the prediction is more accurate and reliable.
The prediction method in the embodiment of the present application is illustrated as an example:
suppose there are 8 types of documents to be analyzed, which are: recent video, recent picture, recent audio, recent document, previous video, previous picture, previous audio, and previous document. For convenience of explanation, the latest video, the latest picture, the latest audio, the latest document, the past video, the past picture, the past audio, and the past document will be hereinafter simply referred to as x1, x2, x3, x4, x5, x6, x7, and x 8.
In this case, the document types are repeatedly combined two by two to obtain 36 kinds of pairs of x-x, x-x and x-x. Each pair of distances L is set to an initial value of 1, with a total distance L of 36, p of 0.07 and q of 0.01.
The external storage device is accessed to the terminal device for 11 times, and in the previous 10-time use process, the file types of the files used by the user for the first time are set as follows in sequence: x2, x1, x2, x6, x1, x4, x5, x2, x1 and x2 (here are 10 file types set at random in the experiment, theoretically without regularity).
Reference may now be made to the table in fig. 7.
When the external storage device first accesses the terminal device, the distance of each type pair that the terminal device can read is 1. I.e., the data in the "1 st readable distance" column in fig. 7. After determining the file used by the user, the terminal device identifies that the file belongs to the latest picture x2 according to the update time, the file type and the set time threshold of the file. But since there is no "previous usage" at this time. Therefore, the terminal device does not modify the distance of each type pair at this time, and the distance of the type pair is the data in the "2 nd readable distance" column, and is still 1.
When the external storage device accesses the terminal device 2 nd time, the distances of the pairs of the types that the terminal device can read are the data in the column of "readable distance 2 nd time" in fig. 7. After determining the file used by the user, the terminal device identifies that the file belongs to the latest video x1 according to the update time, the file type and the set time threshold of the file. Since x2 was last, the distance p between the pair of species x1-x2 is reduced to 0.07, and the distance q between the other pair of species containing x2 is increased to 0.01. The obtained distance of the updated category pair is the data in the "3 rd time readable distance" column in fig. 7, and is locally stored, so that the terminal device can read and use the data when the external storage device accesses the terminal device for the 3 rd time.
When the external storage device accesses the terminal device for the 3 rd time, the distances of the pairs of the types stored in the previous time, which can be read by the terminal device, are data in the column of "readable distance for the 3 rd time" in fig. 7. After determining the file used by the user, the terminal device identifies that the file belongs to the latest picture x2 according to the update time, the file type and the set time threshold of the file. Since x1 was last, the distance between the species pair x1-x2 is reduced by 0.07, and the distances between other species pairs including x2 are increased by 0.01. And the obtained distance of the updated type pair is the data in the '4 th time readable distance' column, and the data are locally stored so that the terminal equipment can be read and used when the external storage equipment accesses the terminal equipment for the 4 th time.
When the external storage device accesses the terminal device 4 th time, the distances of the pairs of the types stored in the previous time that the terminal device can read are the data in the column of "readable distance 4 th time" in fig. 7. After determining the file used by the user, the terminal device identifies that the file belongs to the previous picture x6 according to the update time, the file type and the set time threshold of the file. Since x2 was last, the distance between the species pair x2-x6 is reduced by 0.07, and the distances between other species pairs including x2 are increased by 0.01. And the obtained distance of the updated type pair is the data in the 'readable distance for the 5 th time' column, and the data are locally stored so that the terminal equipment can be read and used when the external storage equipment accesses the terminal equipment for the 5 th time.
By analogy with the above operation, the distances of the various pairs of categories in the first 10 use process can be updated. The distances of the type pairs which can be read in the next using process are the distances of all the type pairs which are stored after updating in the previous using process. For example, for the 11 th access terminal device of the external storage device, even if the user does not use the file, at this time, the terminal device may read the distance of each type pair updated by the terminal device after the 10 th access terminal device of the external storage device. Reference may be made to the data in the "11 th readable distance" column in fig. 7.
After the distance updating of each category pair is completed, the terminal device predicts the category of the file to which the file required by the user next time belongs based on the distance of each category pair after the updating.
For the 2 nd access terminal device of the external storage device, after obtaining the data in the column of "3 rd readable distance" in fig. 7, all the class pairs containing x1 are found out, and the class pair with the shortest distance is selected out from the class pairs. Finally, another file type outside x1 in the type pair is stored as a prediction result. Referring to the data in the column "3 rd readable distance" in FIG. 7, the type pair containing x1 and having the shortest distance of 0.93 is: x1-x 2. Therefore, the prediction result at this time is the latest picture x 2.
Based on the data in fig. 7, according to the above operation, the prediction results of the files required by the user in the 3 rd to 11 th usage processes in the 11 th usage processes are respectively: recent picture x2, recent video x1, recent video x1, recent picture x2, recent video x1, recent document x4, previous video x5, recent picture x2, and recent video x 1.
In addition, in each use process, the terminal device stores the file type of the first-time used file in the current use process, the file type serving as the prediction result and the updated distance of each type pair locally. For example, for the 10 th access terminal device of the external storage device, the file type to which the first-time-use file belongs is stored: recent picture x2, file type as prediction result: the latest video x1, and the data in the "11 th readable distance" column in fig. 7 are local to the terminal device.
In the embodiment of the application, the evaluation of two dimensions of the updating time and the file type is realized by analyzing and predicting the file type. Therefore, the embodiment of the application can better analyze the use habits of the user, so that the prediction is more accurate and reliable. Meanwhile, the file type required by the user each time is predicted, and the file under the predicted file type is preferentially scanned, so that the time for the user to wait for scanning can be greatly shortened, and the file scanning efficiency is improved.
Fig. 8 shows a schematic structural diagram of a document scanning apparatus provided in the embodiment of the present application, corresponding to the document scanning method described in the above embodiment, and only the relevant parts of the embodiment of the present application are shown for convenience of description.
Referring to fig. 8, the document scanning apparatus includes:
and the result reading module 81 is configured to read the prediction result associated with the external storage device when the access of the external storage device is detected.
And the file determining module 82 is used for determining one or more files from the external storage device according to a prediction result, wherein the prediction result is data obtained by analyzing historical use data of the files in the external storage device by a user.
A file scanning module 83 for scanning one or more files in the external storage device.
The file scanning module 83 is further configured to scan remaining unscanned files in the external storage device after one or more files are scanned.
As an alternative embodiment of the present application, the result reading module 81 is further configured to:
and when the access of the external storage equipment is detected, identifying whether the external storage equipment is accessed to the terminal equipment for the first time.
And if the external storage equipment is not the first access terminal equipment, reading a prediction result associated with the external storage equipment.
As an alternative embodiment of the present application, the file determining module 82 is further configured to:
the file type of each file in the external storage device is identified.
And screening one or more files of which the file types belong to the file types contained in the prediction result from the external storage device.
As an alternative embodiment of the present application, identifying a file type of each file in the external storage device includes:
and acquiring the update time and the file type of each file in the external storage device.
And identifying the file type of each file in the external storage equipment according to the updating time and the file type.
As an alternative embodiment of the present application, identifying the file type of each file in the external storage device according to the update time and the file type includes:
and determining the updating state of each file in the external storage equipment according to the updating time and a preset time threshold.
And identifying the file type of each file in the external storage equipment according to the updating state and the file type.
As an optional embodiment of the present application, the predicting result includes one or more file addresses, and the determining one or more files from the external storage device according to the predicting result includes:
one or more files pointed to by the one or more file addresses are looked up from the external storage device.
As an optional embodiment of the present application, the document scanning apparatus further includes:
the data recording module is used for recording first use data of the file in the external storage equipment by a user.
And the prediction module is used for analyzing the first use data to obtain an analysis result.
And the result storage module is used for updating the prediction result by using the analysis result.
As an alternative embodiment of the present application, the prediction module includes:
the category acquiring module is configured to acquire a first file category of a first file used by a user in an external storage device after the external storage device last accesses a terminal device.
The distance obtaining module is used for obtaining a plurality of types of pairs and the distance of each type of pair, wherein each type of pair consists of two file types, and the distance value of each type of pair is in negative correlation with the correlation degree between the two file types in each type of pair.
The first category pair screening module is used for screening out a first category pair and all second category pairs from a plurality of category pairs, wherein the first category pair is a category pair consisting of a first file category and a second file category, and the second category pair is a category pair which contains the first file category and does not contain the second file category.
And the distance adjusting module is used for reducing the distance of the first kind of pairs and increasing the distance of the second kind of pairs.
And the second class pair screening module is used for screening all third class pairs from the plurality of class pairs, and the third class pairs are class pairs containing the second file class.
And the third class pair screening module is used for screening the first q class pairs with the shortest distance from the third class pair, wherein q is a positive integer.
And the result generation module is used for screening all the file types except the second file type from the file types contained in the q types of pairs, and taking all the screened file types as analysis results.
As an alternative embodiment of the present application, in decreasing the distance of the first kind of pairs and increasing the distance of the second kind of pairs:
the distance added is the same for each second type pair and the sum of the distances of the plurality of type pairs is constant.
The process of implementing each function by each module in the document scanning device provided in the embodiment of the present application may specifically refer to the description of the embodiments shown in fig. 2 to fig. 7 and other related method embodiments, and is not repeated here.
It should be noted that, for the information interaction, execution process, and other contents between the above-mentioned devices/units, the specific functions and technical effects thereof are based on the same concept as those of the embodiment of the method of the present application, and specific reference may be made to the part of the embodiment of the method, which is not described herein again.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It should also be understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
As used in this specification and the appended claims, the term "if" may be interpreted contextually as "when", "upon" or "in response to" determining "or" in response to detecting ". Similarly, the phrase "if it is determined" or "if a [ described condition or event ] is detected" may be interpreted contextually to mean "upon determining" or "in response to determining" or "upon detecting [ described condition or event ]" or "in response to detecting [ described condition or event ]".
Furthermore, in the description of the present application and the appended claims, the terms "first," "second," "third," and the like are used for distinguishing between descriptions and not necessarily for describing or implying relative importance. It will also be understood that, although the terms first, second, etc. may be used herein to describe various elements in some embodiments of the application, these elements should not be limited by these terms. These terms are only 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 various described embodiments. The first table and the second table are both tables, but they are not the same table.
Reference throughout this specification to "one embodiment" or "some embodiments," or the like, means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," or the like, in various places throughout this specification are not necessarily all referring to the same embodiment, but rather "one or more but not all embodiments" unless specifically stated otherwise. The terms "comprising," "including," "having," and variations thereof mean "including, but not limited to," unless expressly specified otherwise.
The file scanning method provided by the embodiment of the application can be applied to terminal devices such as a mobile phone, a tablet personal computer, a wearable device, a vehicle-mounted device, an Augmented Reality (AR)/Virtual Reality (VR) device, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a Personal Digital Assistant (PDA), and the like, and the embodiment of the application does not limit the specific type of the terminal device at all.
For example, the terminal device Personal Digital Assistant (PDA) device, a handheld device with wireless communication function, a computing device or other processing device connected to a wireless modem, a vehicle mounted device, a car networking terminal, a computer, a laptop computer, a handheld communication device, a handheld computing device, a satellite radio device, a wireless modem card, a Set Top Box (STB), a Customer Premises Equipment (CPE), and/or other devices for communicating over a wireless system, as well as next generation communication systems, e.g., a terminal device in a 5G Network or a terminal device in a future evolved Public Land Mobile Network (PLMN) Network, etc.
By way of example and not limitation, when the terminal device is a wearable device, the wearable device may also be a generic term for intelligently designing daily wearing by applying wearable technology, developing wearable devices, such as glasses, gloves, watches, clothing, shoes, and the like. A wearable device is a portable device that is worn directly on the body or integrated into the clothing or accessories of the user. The wearable device is not only a hardware device, but also realizes powerful functions through software support, data interaction and cloud interaction. The generalized wearable intelligent device has the advantages that the generalized wearable intelligent device is complete in function and large in size, can realize complete or partial functions without depending on a smart phone, such as a smart watch or smart glasses, and only is concentrated on a certain application function, and needs to be matched with other devices such as the smart phone for use, such as various smart bracelets for monitoring physical signs, smart jewelry and the like.
Hereinafter, taking the terminal device as a mobile phone as an example, fig. 9 shows a schematic structural diagram of the electronic device 100.
The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a charging interface 130, a charging management module 131, a power management module 141, a battery 142, an antenna, a wireless communication module 150, a display screen 160, and keys 170, etc.
It is to be understood that the illustrated structure of the embodiment of the present invention does not specifically limit the electronic device 100. In other embodiments of the present application, electronic device 100 may include more or fewer components than shown, or some components may be combined, some components may be split, or a different arrangement of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
Processor 110 may include one or more processing units, such as: the processor 110 may include an Application Processor (AP), a modem processor, a Graphics Processing Unit (GPU), an Image Signal Processor (ISP), a controller, a memory, a video codec, a Digital Signal Processor (DSP), a baseband processor, and/or a Neural-Network Processing Unit (NPU), etc. The different processing units may be separate devices or may be integrated into one or more processors. The controller may be, among other things, a neural center and a command center of the electronic device 100. The controller can generate an operation control signal according to the instruction operation code and the timing signal to complete the control of instruction fetching and instruction execution.
A memory may also be provided in processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may hold instructions or data that have just been used or recycled by the processor 110. If the processor 110 needs to reuse the instruction or data, it can be called directly from the memory. Avoiding repeated accesses reduces the latency of the processor 110, thereby increasing the efficiency of the system.
The processor 110 may operate the file scanning method provided by the embodiment of the present application, so as to improve file scanning efficiency, shorten user waiting time, and improve user experience. The processor 110 may include different devices, for example, when the CPU and the GPU are integrated, the CPU and the GPU may cooperate to execute the file scanning method provided in the embodiment of the present application, for example, part of the algorithm in the file scanning method is executed by the CPU, and another part of the algorithm is executed by the GPU, so as to obtain faster processing efficiency.
The display screen 160 is used to display images, video, and the like. The display screen 160 includes a display panel. The display panel may adopt a Liquid Crystal Display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (active-matrix organic light-emitting diode, AMOLED), a flexible light-emitting diode (FLED), a miniature, a Micro-oeld, a quantum dot light-emitting diode (QLED), and the like. In some embodiments, the electronic device 100 may include 1 or N display screens 160, with N being a positive integer greater than 1. The display screen 160 may be used to display information input by or provided to the user as well as various Graphical User Interfaces (GUIs). For example, the display screen 160 may display thumbnails of scanned files, other attribute data, and the like, and may also display the contents of the files. As another example, the display screen 160 may display a graphical user interface. Wherein the graphical user interface includes a status bar, a concealable navigation bar, a time and weather widget, and an icon of an application, such as a browser icon. The status bar includes the name of the operator (e.g., china mobile), the mobile network (e.g., 4G), the time and the remaining power. The navigation bar includes a back key icon, a home key icon, and a forward key icon. Further, it is understood that in some embodiments, a Bluetooth icon, a Wi-Fi icon, an add-on icon, etc. may also be included in the status bar. It will also be appreciated that in other embodiments, a Dock bar may also be included in the graphical user interface, and that a commonly used application icon may be included in the Dock bar, etc. When the processor detects a touch event of a finger (or a stylus, etc.) of a user with respect to an application icon, in response to the touch event, a user interface of an application corresponding to the application icon is opened and displayed on the display screen 160.
In the embodiment of the present application, the display screen 160 may be an integrated flexible display screen, or a spliced display screen formed by two rigid screens and a flexible screen located between the two rigid screens may be adopted. After the processor 110 runs the file scanning method provided by the embodiment of the present application, the processor 110 may control an external audio output device to switch the output audio signal.
The internal memory 121 may be used to store computer-executable program code, which includes instructions. The processor 110 executes various functional applications of the electronic device 100 and data processing by executing instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Wherein the storage program area may store an operating system, codes of application programs (such as a camera application, a WeChat application, etc.), and the like. The storage data area may store data created during use of the electronic device 100 (e.g., images, videos, etc. captured by a camera application), and the like.
The internal memory 121 may further store one or more computer programs 1210 corresponding to the file scanning method provided in the embodiment of the present application. The one or more computer programs 1210 are stored in the memory 121 and configured to be executed by the one or more processors 110, and the one or more computer programs 1210 include instructions that can be used to perform the steps in the respective embodiments of fig. 2 to 7, and when the codes of the file scanning method stored in the internal memory 121 are executed by the processors 110, the processors 110 can control the terminal device to perform the processing of the data related to the file scanning, such as the file priority scanning.
In addition, the internal memory 121 may include a high-speed random access memory, and may further include a nonvolatile memory, such as at least one magnetic disk storage device, a flash memory device, a universal flash memory (UFS), and the like.
Of course, the code of the file scanning method provided in the embodiment of the present application may also be stored in the external memory. In this case, the processor 110 may execute the code of the file scanning method stored in the external memory through the external memory interface 120, and the processor 110 may control the terminal device to perform the file scanning process. In addition, the external memory interface 120 may be used to access an external storage device.
The wireless communication function of the electronic device 100 may be implemented by an antenna, the wireless communication module 150, a modem processor, a baseband processor, and the like.
The antenna is used for transmitting and receiving electromagnetic wave signals. Each antenna in the electronic device 100 may be used to cover a single or multiple communication bands. In other embodiments, the antenna may be used in conjunction with a tuning switch.
The modem processor may include a modulator and a demodulator. The modulator is used for modulating a low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used for demodulating the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then passes the demodulated low frequency baseband signal to a baseband processor for processing. The low frequency baseband signal is processed by the baseband processor and then transferred to the application processor. The application processor outputs a sound signal through an audio device (not limited to the speaker 170A, the receiver 170B, etc.) or displays an image or video through the display screen 160. In some embodiments, the modem processor may be a stand-alone device. In other embodiments, the modem processor may be provided in the same device as the mobile communication module 150 or other functional modules, independent of the processor 110.
The wireless communication module 150 may provide a solution for wireless communication applied to the electronic device 100, including Wireless Local Area Networks (WLANs) (e.g., wireless fidelity (Wi-Fi) networks), bluetooth (bluetooth, BT), Global Navigation Satellite System (GNSS), Frequency Modulation (FM), Near Field Communication (NFC), Infrared (IR), and the like. The wireless communication module 150 may be one or more devices integrating at least one communication processing module. The wireless communication module 150 receives electromagnetic waves via the antenna 2, performs frequency modulation and filtering processing on electromagnetic wave signals, and transmits the processed signals to the processor 110. The wireless communication module 150 may also receive a signal to be transmitted from the processor 110, perform frequency modulation and amplification on the signal, and convert the signal into electromagnetic waves through the antenna 2 to radiate the electromagnetic waves. In this embodiment, the wireless communication module 150 may be used to access the access point device, and send and receive messages to other terminal devices.
It should be understood that in practical applications, the electronic device 100 may include more or less components than those shown in fig. 1A, and the embodiment of the present application is not limited thereto. The illustrated electronic device 100 is merely an example, and the electronic device 100 may have more or fewer components than shown in the figures, may combine two or more components, or may have a different configuration of components. The various components shown in the figures 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.
The software system of the terminal device may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the invention takes an Android system with a layered architecture as an example, and exemplarily illustrates a software structure of a terminal device. Fig. 10 is a block diagram of a software configuration of a terminal device according to an embodiment of the present invention.
The layered architecture divides the software into several layers, each layer having a clear role and division of labor. The layers communicate with each other through a software interface. In some embodiments, the Android system is divided into four layers, an application layer, an application framework layer, an Android runtime (Android runtime) and system library, and a kernel layer from top to bottom.
The application layer may include a series of application packages.
As shown in fig. 10, the application package may include phone, camera, gallery, calendar, talk, map, navigation, WLAN, bluetooth, music, video, short message, etc. applications.
The application framework layer provides an Application Programming Interface (API) and a programming framework for the application program of the application layer. The application framework layer includes a number of predefined functions.
As shown in FIG. 10, the application framework layers may include a window manager, content provider, view system, phone manager, resource manager, notification manager, and the like.
The window manager is used for managing window programs. The window manager can obtain the size of the display screen, judge whether a status bar exists, lock the screen, intercept the screen and the like.
The content provider is used to store and retrieve data and make it accessible to applications. The data may include video, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
The view system includes visual controls such as controls to display text, controls to display pictures, and the like. The view system may be used to build applications. The display interface may be composed of one or more views. For example, the display interface including the short message notification icon may include a view for displaying text and a view for displaying pictures.
The telephone manager is used for providing a communication function of the terminal equipment. Such as management of call status (including on, off, etc.).
The resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, and the like.
The notification manager enables the application to display notification information in the status bar, can be used to convey notification-type messages, can disappear automatically after a short dwell, and does not require user interaction. Such as a notification manager used to inform download completion, message alerts, etc. The notification manager may also be a notification that appears in the form of a chart or scroll bar text at the top status bar of the system, such as a notification of a background running application, or a notification that appears on the screen in the form of a dialog window. For example, text information is prompted in the status bar, a prompt tone is given, the terminal device vibrates, an indicator light flickers, and the like.
The Android Runtime comprises a core library and a virtual machine. The Android runtime is responsible for scheduling and managing an Android system.
The core library comprises two parts: one part is a function which needs to be called by java language, and the other part is a core library of android.
The application layer and the application framework layer run in a virtual machine. And executing java files of the application program layer and the application program framework layer into a binary file by the virtual machine. The virtual machine is used for performing the functions of object life cycle management, stack management, thread management, safety and exception management, garbage collection and the like.
The system library may include a plurality of functional modules. For example: surface managers (surface managers), Media Libraries (Media Libraries), three-dimensional graphics processing Libraries (e.g., OpenGL ES), 2D graphics engines (e.g., SGL), and the like.
The surface manager is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications.
The media library supports a variety of commonly used audio, video format playback and recording, and still image files, among others. The media library may support a variety of audio-video encoding formats, such as: MPEG4, H.164, MP3, AAC, AMR, JPG, PNG, etc.
The three-dimensional graphic processing library is used for realizing three-dimensional graphic drawing, image rendering, synthesis, layer processing and the like.
The 2D graphics engine is a drawing engine for 2D drawing.
The kernel layer is a layer between hardware and software. The inner core layer at least comprises a display driver, a camera driver, an audio driver and a sensor driver.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The embodiment of the present application further provides a terminal device, where the terminal device includes at least one memory, at least one processor, and a computer program that is stored in the at least one memory and is executable on the at least one processor, and when the processor executes the computer program, the terminal device is enabled to implement the steps in any of the method embodiments.
The embodiments of the present application further provide a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the computer program implements the steps in the above-mentioned method embodiments.
The embodiments of the present application provide a computer program product, which when running on a terminal device, enables the terminal device to implement the steps in the above method embodiments when executed.
An embodiment of the present application further provides a chip system, where the chip system includes a processor, the processor is coupled with the memory, and the processor executes a computer program stored in the memory to implement the steps in the above method embodiments.
The integrated modules/units, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. Based on such understanding, all or part of the flow in the method of the embodiments described above can be realized by a computer program, which can be stored in a computer-readable storage medium and can realize the steps of the embodiments of the methods described above when the computer program is executed by a processor. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable storage medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application, and are intended to be included within the scope of the present application.
Finally, it should be noted that: the above description is only an embodiment of the present application, but the scope of the present application is not limited thereto, and any changes or substitutions within the technical scope of the present disclosure should be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (12)

1. A file scanning method is applied to terminal equipment and comprises the following steps:
when detecting that an external storage device is accessed, reading a prediction result related to the external storage device;
determining one or more files from the external storage device according to the prediction result; the prediction result is data obtained by analyzing historical use data of files in the external storage device based on a user;
scanning the one or more files within the external storage device;
after the scanning of the one or more files is completed, scanning the remaining unscanned files in the external storage device.
2. The method of claim 1, wherein reading the prediction associated with the external storage device when the access of the external storage device is detected comprises:
when detecting that an external storage device is accessed, identifying whether the external storage device is accessed to the terminal device for the first time;
and if the external storage equipment is not accessed to the terminal equipment for the first time, reading a prediction result associated with the external storage equipment.
3. The method of claim 1, wherein the prediction includes a file type, and wherein determining one or more files from the external storage device based on the prediction comprises:
identifying the file type of each file in the external storage equipment;
and screening one or more files of which the file types belong to the file types contained in the prediction result from the external storage equipment.
4. The method of claim 3, wherein the identifying the file type of each file in the external storage device comprises:
acquiring the update time and the file type of each file in the external storage equipment;
and identifying the file type of each file in the external storage equipment according to the updating time and the file type.
5. The method of claim 4, wherein identifying the file type of each file in the external storage device according to the update time and the file type comprises:
determining the updating state of each file in the external storage equipment according to the updating time and a preset time threshold;
and identifying the file type of each file in the external storage equipment according to the updating state and the file type.
6. The method of claim 1, wherein the prediction result includes one or more file addresses, and wherein determining one or more files from the external storage device according to the prediction result comprises:
and searching one or more files pointed to by the one or more file addresses from the external storage device.
7. The method according to any one of claims 1 to 5, further comprising, after determining one or more files from the external storage device according to the prediction result:
recording first use data of a user on files in the external storage equipment;
analyzing the first use data to obtain an analysis result;
and updating the prediction result by using the analysis result.
8. The file scanning method according to claim 7, characterized in that said first usage data is a second file type of a first file used by said user in said external storage device;
the analyzing the first usage data to obtain an analysis result includes:
acquiring a first file type of a first file used by the user in the external storage device after the external storage device is accessed to the terminal device last time;
acquiring a plurality of category pairs and the distance of each category pair, wherein each category pair consists of two file categories, and the distance value of the category pair is in negative correlation with the correlation degree between the two file categories in the category pair;
screening out a first category pair and all second category pairs from the plurality of category pairs, wherein the first category pair is a category pair consisting of the first file category and the second file category, and the second category pair is a category pair including the first file category and not including the second file category;
decreasing the distance of the first kind of pair and increasing the distance of the second kind of pair;
selecting all third class pairs from the plurality of class pairs, the third class pairs being class pairs including the second file class;
screening the first q types of pairs with the shortest distance from the third type of pairs, wherein q is a positive integer;
and screening all the file types except the second file type from the file types contained in the q types of pairs, and taking all the screened file types as the analysis result.
9. The document scanning method according to claim 8, wherein in said decreasing the distance of the first kind of pair and increasing the distance of the second kind of pair:
the distance added for each of the second kind pairs is the same, and the sum of the distances of the plurality of kind pairs is constant.
10. A terminal device, characterized in that the terminal device comprises a memory, a processor, the memory having stored thereon a computer program being executable on the processor, the processor implementing the steps of the method according to any of the claims 1 to 9 when executing the computer program.
11. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 9.
12. A chip system, comprising a processor coupled to a memory, the processor executing a computer program stored in the memory to implement the file scanning method of any of claims 1 to 9.
CN202011070044.3A 2020-09-30 2020-09-30 File scanning method and terminal equipment Pending CN114328401A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011070044.3A CN114328401A (en) 2020-09-30 2020-09-30 File scanning method and terminal equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011070044.3A CN114328401A (en) 2020-09-30 2020-09-30 File scanning method and terminal equipment

Publications (1)

Publication Number Publication Date
CN114328401A true CN114328401A (en) 2022-04-12

Family

ID=81032301

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011070044.3A Pending CN114328401A (en) 2020-09-30 2020-09-30 File scanning method and terminal equipment

Country Status (1)

Country Link
CN (1) CN114328401A (en)

Similar Documents

Publication Publication Date Title
WO2020238356A1 (en) Interface display method and apparatus, terminal, and storage medium
WO2022100221A1 (en) Retrieval processing method and apparatus, and storage medium
CN111596998A (en) Page processing method of ink screen and terminal
CN114138139B (en) Application card management method, electronic device and medium
CN114020197B (en) Cross-application message processing method, electronic device and readable storage medium
CN111935353B (en) Mobile terminal and short message display method thereof
CN111695004B (en) Application information processing method, device, computer equipment and storage medium
CN115098449B (en) File cleaning method and electronic equipment
CN114077529B (en) Log uploading method and device, electronic equipment and computer readable storage medium
CN114328401A (en) File scanning method and terminal equipment
CN116089368B (en) File searching method and related device
CN116108282B (en) Training method of information recommendation model, information recommendation method and equipment
CN115220851B (en) Operation guidance method, electronic device and readable storage medium
CN116743908B (en) Wallpaper display method and related device
CN114490442B (en) File fragment adjusting method and electronic equipment
WO2023061298A1 (en) Picture backup system and method, and device
CN115061758B (en) Application display method, terminal, electronic device and storage medium
CN117131240B (en) Service recommendation method, electronic device and computer readable storage medium
WO2023020339A1 (en) Interface display method and electronic device
CN114463730B (en) Page identification method and terminal equipment
WO2024037346A1 (en) Page management method and electronic device
WO2023231645A1 (en) Search method and apparatus, electronic device, and readable storage medium
WO2024067167A1 (en) Application data management method, and device, product and medium
CN115981573A (en) Data management method, electronic device and computer readable and writable storage medium
CN115905673A (en) Service recommendation method and electronic device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination