A multimedia file scanning method, device and terminal equipment

By generating multiple final scan tasks for parallel processing, the problem of low scanning efficiency of service provider multimedia databases in terminal devices is solved, and more efficient file saving and updating is achieved.

CN114647746BActive Publication Date: 2026-01-02BEIJING XIAOMI MOBILE SOFTWARE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011501632.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-17
Publication Date
2026-01-02
Estimated Expiration
2040-12-17

AI Technical Summary

Technical Problem

In existing technologies, when terminal devices maintain their own independent service provider multimedia databases, the multimedia file scanning efficiency is low, and they cannot efficiently save local files to the service provider multimedia database.

Method used

By generating multiple final scan tasks and using multiple scan threads to process these tasks in parallel, the scan results are then inserted into the service provider's multimedia database.

Benefits of technology

It improves the efficiency of multimedia file scanning, reduces scanning time, and optimizes the update process of the service provider's multimedia database.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114647746B_ABST
    Figure CN114647746B_ABST
Patent Text Reader

Abstract

The present disclosure provides a multimedia file scanning method, device and terminal equipment. The multimedia file scanning method provided by the present disclosure is applied to a terminal equipment, and the method comprises: when a multimedia file scanning request for a service provider multimedia database on the equipment is received, determining a target file path set to be scanned by the scanning request; generating a plurality of final scanning tasks according to the target file path set; processing each final scanning task in parallel based on a plurality of scanning threads to obtain a scanning result corresponding to each final scanning task, and inserting the scanning result into the service provider multimedia database; wherein each final scanning task is used to indicate scanning files under a target file path in the target file path set. The multimedia file scanning method, device and terminal equipment provided by the present disclosure can provide scanning efficiency and reduce scanning time.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the field of information technology, and in particular, to a multimedia file scanning method, device and terminal equipment. BACKGROUND

[0002] At present, in order to facilitate the calling of multimedia files, the Android system provides an Android media database to save locally saved multimedia files in the Android media database through scanning, and provides data sources for other applications through the Android media database.

[0003] In order to develop some functions more freely, in addition to the Android media database, some terminal equipment service providers also maintain their own independent service provider multimedia databases in the terminal equipment they produce, and provide data sources for other applications through the service provider multimedia database.

[0004] When the terminal equipment maintains its own independent service provider multimedia database, it also needs to save locally saved multimedia files in the service provider multimedia database through scanning. At this time, how to improve the scanning efficiency becomes the focus of the industry. SUMMARY

[0005] The present disclosure provides a multimedia file scanning method, device and terminal equipment to solve the deficiencies in the related art.

[0006] According to a first aspect of an embodiment of the present disclosure, a multimedia file scanning method is provided, which is applied to a terminal equipment, and the method comprises:

[0007] Upon receiving a multimedia file scanning request for a service provider multimedia database on the equipment, determining a target file path set that needs to be scanned according to the scanning request;

[0008] According to the target file path set, generating a plurality of final scanning tasks; wherein each final scanning task is used to instruct scanning of files under a target file path in the target file path set;

[0009] Based on a plurality of scanning threads, each final scanning task is processed in parallel to obtain a scanning result corresponding to each final scanning task, and the scanning result is inserted into the service provider multimedia database.

[0010] According to a second aspect of an embodiment of the present disclosure, a multimedia file scanning device is provided, which is applied to a terminal equipment, and the device comprises a generating module and a processing module, wherein,

[0011] The generating module is configured to, when receiving a multimedia file scanning request for a service provider multimedia database on the device, determine a target file path set that needs to be scanned by the scanning request.

[0012] The generating module is further configured to generate a plurality of final scanning tasks according to the target file path set, wherein each final scanning task is used to instruct to scan files under a target file path in the target file path set.

[0013] The processing module is configured to process each final scanning task in parallel based on a plurality of scanning threads, obtain a scanning result corresponding to each final scanning task, and insert the scanning result into the service provider multimedia database.

[0014] According to a third aspect of the present disclosure, a terminal device is provided, comprising:

[0015] a processor;

[0016] a memory for storing processor-executable instructions;

[0017] The processor is configured to implement any one of the methods provided in the first aspect of the present disclosure.

[0018] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided, which stores a computer program. The program is executed by a processor to implement the steps in any one of the methods provided in the first aspect of the present disclosure.

[0019] The technical solutions provided by the embodiments of the present disclosure can include the following beneficial effects:

[0020] As can be seen from the above embodiments, the multimedia file scanning method, device and terminal device provided by the present disclosure, when receiving a multimedia file scanning request for a service provider multimedia database on the device, determines a target file path set that needs to be scanned by the scanning request, and then generates a plurality of final scanning tasks according to the target file path set, so as to process each final scanning task in parallel based on a plurality of scanning threads, obtain a scanning result corresponding to each final scanning task, and insert the scanning result into the service provider multimedia database. Each final scanning task is used to instruct to scan files under a target file path in the target file path set. In this way, by processing the final scanning tasks in parallel through multiple scanning threads, the scanning efficiency can be improved and the scanning time consumption can be reduced.

[0021] It should be understood that the foregoing general description and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure. BRIEF DESCRIPTION OF DRAWINGS

[0022] The accompanying drawings, which are incorporated herein and constitute part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, further serve to explain the principles of the present disclosure.

[0023] Figure 1 is a flow chart of a multimedia file scanning method according to an exemplary embodiment of the present disclosure;

[0024] Figure 2 is a flow chart of another multimedia file scanning method according to an exemplary embodiment of the present disclosure;

[0025] Figure 3 is a flow chart of a multimedia file scanning method according to an exemplary embodiment of the present disclosure;

[0026] Figure 4 is a structural schematic diagram of a multimedia file scanning device according to an exemplary embodiment of the present disclosure;

[0027] Figure 5 is a structural schematic diagram of another multimedia file scanning device according to an exemplary embodiment of the present disclosure;

[0028] Figure 6 is a structural schematic diagram of a terminal device according to an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION

[0029] The exemplary embodiments will be described in detail herein with reference to the attached drawings. When the description below refers to accompanying drawings, unless otherwise noted, the same numbers in different drawings refer to the same or similar elements. The following exemplary embodiments described in the following detailed description are not meant to represent all embodiments consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0030] The present disclosure provides a multimedia file scanning method, device and terminal device to improve the scanning efficiency of multimedia files and reduce the scanning time.

[0031] The multimedia file scanning method and device provided by the present disclosure can be applied to a terminal device. For example, it can be applied to a mobile phone and the like.

[0032] The following specific embodiments are given to illustrate the technical solutions of the present disclosure in detail. The following specific embodiments can be combined with each other, and the same or similar concepts or processes can not be described in some embodiments.

[0033] Figure 1 is a flow chart of a multimedia file scanning method according to an exemplary embodiment of the present disclosure. Please refer to Figure 1The method provided by the embodiment can be applied to a terminal device and can include the following steps.

[0034] In S101, when receiving a multimedia file scanning request for a service provider multimedia database on the device, a target file path set that needs to be scanned by the scanning request is determined.

[0035] It should be noted that in an embodiment, the multimedia file scanning request is generated when it is detected that a photo album application on the device is started or returns to the foreground.

[0036] In another embodiment, the multimedia file scanning request is a multimedia file scanning request for an Android media database on the device, which is generated when it is detected that a file creation notification is reported by a third-party application.

[0037] It should be noted that when a file creation operation is detected, the third-party application reports a file creation notification to the terminal system. Further, the terminal system generates a multimedia file scanning request for the Android media database on the device based on the file creation notification reported by the third-party application, to perform multimedia file scanning based on the multimedia file scanning request for the Android media database on the device, and update the Android media database.

[0038] Further, the terminal system determines the multimedia file scanning request for the Android media database on the device as a multimedia scanning request for the service provider multimedia database on the device, to perform multimedia file scanning based on the multimedia scanning request and update the service provider multimedia database.

[0039] In addition, in still another embodiment, the multimedia file scanning request can be generated when it is detected that a photo album application on the device creates a file.

[0040] Specifically, the state of the photo album application can be listened to, and then when it is detected that the photo album application creates a file (for example, a new picture is generated by editing an original picture), a multimedia file scanning request is generated.

[0041] In addition, the target file path set is a file path that is newly added or deleted in the local file system compared with the service provider multimedia database. The specific implementation principle of determining the target file path set that needs to be scanned by the scanning request will be described in detail in the following embodiments, and will not be described here.

[0042] In S102, a plurality of final scanning tasks are generated according to the target file path set, wherein each final scanning task is used to instruct to scan a file under a target file path in the target file path set.

[0043] Specifically, for each target file path, it can be packaged into a final scanning task, which carries the target file path and is used to indicate scanning the files under the target file path. The specific implementation principle and implementation process of the packaging can refer to the description in the related art, which will not be described here.

[0044] It should be noted that when generating a final scanning task based on a target file path, if the files under the target file path are newly added files, a final scanning task of the type of newly added is generated, and if the files under the target file path are deleted files, a final scanning task of the type of deleted is generated.

[0045] S103, based on multiple scanning threads, processing each final scanning task in parallel to obtain a scanning result corresponding to each final scanning task, and inserting the scanning result into the service provider multimedia database.

[0046] For example, in an embodiment, the number of scanning threads is 4, that is, 4 final scanning tasks can be processed simultaneously at a time.

[0047] In addition, when inserting the scanning result into the service provider multimedia database, a batch processing method can be used to insert the scanning result into the service provider multimedia database.

[0048] Optionally, in a possible implementation, if several final scanning tasks carry the same file path, when processing the final scanning tasks, the several final scanning tasks can be processed by merging, that is, only one final scanning task can be retained. In this way, resources can be saved, the scanning efficiency can be further improved, and the scanning time can be reduced.

[0049] The method provided in this embodiment, when receiving a multimedia file scanning request for a service provider multimedia database on the device, determines a target file path set required to be scanned by the scanning request, and then generates multiple final scanning tasks according to the target file path set, so as to process each final scanning task in parallel based on multiple scanning threads to obtain a scanning result corresponding to each final scanning task, and insert the scanning result into the service provider multimedia database. Each final scanning task is used to indicate scanning the files under a target file path in the target file path set. In this way, by processing the final scanning tasks in parallel through multiple scanning threads, the scanning efficiency can be improved, and the scanning time can be reduced.

[0050] Figure 2 is a flowchart of another multimedia file scanning method according to an exemplary embodiment of the present disclosure. Please refer to Figure 2On the basis of the above-mentioned embodiments, the method provided in the embodiment can include the following steps.

[0051] S201, according to the identification information, find the processing strategy corresponding to the identification information from the pre-set correspondence between the identification information and the processing strategy; wherein the processing strategy includes a candidate file path set determination strategy.

[0052] Specifically, in the embodiment, the scanning request carries identification information, which is used to identify the triggering scenario of the scanning request. For example, when the scanning request is generated when it is detected that the photo application on the device is started or returned to the foreground, the identification information carried by the scanning request can be Y. When the scanning request is a multimedia file scanning request for the Android media database on the device generated when it is detected that the third-party application reports a file creation notification, the identification information carried by the scanning request can be Z. When the scanning request is generated when it is detected that the photo application on the device creates a file, the identification information carried by the scanning request can be X.

[0053] It should be noted that when the scanning request is a multimedia file scanning request for the Android media database on the device generated when it is detected that the third-party application reports a file creation notification, or when the scanning request is generated when it is detected that the photo application on the device creates a file, the scanning request also carries a file path (the file path can be a file path corresponding to a newly created file).

[0054] In addition, the pre-set correspondence between the identification information and the processing strategy is set according to actual needs, and the specific content of the embodiment is not limited.

[0055] For example, in an embodiment, when the identification information is Z or X, the corresponding candidate file path set determination strategy can be: obtaining all file paths under the file path carried by the scanning request from the local file system, and determining the obtained file paths as the candidate file path set.

[0056] For another example, in another embodiment, when the identification information is Y, the corresponding candidate file path set determination strategy can be: determining all file paths in the local file system as the candidate file path set.

[0057] Of course, in still another embodiment, when the identification information is Y, the corresponding candidate file path set determination strategy can be: determining all file paths corresponding to a specified third-party application (the specified third-party application is set according to actual needs, for example, it can be QQ, WeChat, etc.) existing in the local file system (the file path corresponding to the third-party application refers to a file path used to store data generated by the third-party application) and all file paths under a specified file path obtained from the local file system as the candidate file path set; wherein the specified file path can be the current file path of the service provider multimedia database and / or the newly added file path of the Android media database.

[0058] S202, determining the candidate file path set corresponding to the scanning request based on the candidate file path set determination strategy.

[0059] For example, in an embodiment, the identification information carried by the scanning information is Y, at this time, based on the candidate file path determination strategy given in the second example above, the candidate file path set corresponding to the scanning request can be determined according to the following method:

[0060] (1) For any specified third-party application, it is judged whether the storage space (used to store data generated by the third-party application) corresponding to the third-party application exists in the local file system, if it exists, all file paths in the local file system under the storage space are determined as the first candidate file path.

[0061] (2) For any file path currently existing in the service provider multimedia database, all file paths under the file path are obtained from the local file system, and the obtained file paths are determined as the second candidate file path.

[0062] (3) For the file path newly added by the Android media database, all file paths under the file path are obtained from the local file system, and the obtained file paths are determined as the third candidate file path.

[0063] (4) The set of the first candidate file path, the second candidate file path and the third candidate file path is determined as the candidate file path set.

[0064] S203, comparing the file path currently existing in the service provider multimedia database with the candidate file path set to determine the target file path set newly added or deleted in the local, and generating the final scanning task based on the target file path set.

[0065] In a specific implementation, the existing file paths in the service provider multimedia database can be compared with the candidate file path set to determine which paths in the candidate file path set are target file paths that are newly added locally and which paths in the existing file paths in the service provider multimedia database are target file paths that are deleted locally.

[0066] The method provided in this embodiment can, when the scanning request carries identification information, find a processing strategy corresponding to the identification information from a pre-set correspondence between identification information and processing strategies, and then determine a candidate file path set corresponding to the scanning request based on the candidate file path set in the processing strategy, so as to compare the existing file paths in the service provider multimedia database with the candidate file path set, determine a target file path set that is newly added or deleted locally, and generate the final scanning task based on the target file path set. In this way, multiple final scanning tasks can be processed in parallel based on multiple scanning threads executed in parallel, the scanning efficiency can be improved, and the scanning time can be reduced.

[0067] Optionally, in a possible implementation of the present disclosure, the method further includes:

[0068] The steps of determining the target file path set that is newly added or deleted locally and generating the final scanning task based on the target file path set are executed in parallel based on multiple processing threads.

[0069] It should be noted that, as described above, when the file paths that are newly added or deleted locally are determined, the existing file paths in the service provider multimedia database need to be compared with the file paths in the candidate file path set one by one to determine which paths in the candidate file path set are target file paths that are newly added locally and which paths in the existing file paths in the service provider multimedia database are target file paths that are deleted locally.

[0070] In this embodiment, when the comparison is performed to determine the target file path set that is newly added or deleted locally and generate the final scanning task based on the target file path set, this process can be executed in parallel based on multiple processing threads. In this way, the efficiency can be further improved, and the time can be shortened.

[0071] Optionally, in a possible implementation of the present disclosure, the processing strategy further includes a grouping strategy, and after the candidate file path set corresponding to the scanning request is determined, the method further includes:

[0072] divide the candidate file path set into at least one group based on the grouping policy;

[0073] For each group, generate an intermediate scanning task based on the group;

[0074] The step of executing in parallel using multiple processing threads to determine the target file path set that is newly added or deleted locally and generate the final scanning task based on the target file path set comprises:

[0075] Each intermediate scanning task is processed in parallel using multiple processing threads; wherein the process of processing the intermediate scanning task comprises comparing the file paths that currently exist in the service provider multimedia database with the group carried by the intermediate scanning task, determining the target file path set that is newly added or deleted locally, and generating the final scanning task based on the target file path set.

[0076] Specifically, the grouping policy is set according to actual needs, and in this embodiment, the grouping policy is not limited.

[0077] For example, in an embodiment, when the identification information of the scanning request is X or Z, the corresponding grouping policy is to divide the candidate file path set into one group; when the identification information of the scanning request is Y and the candidate file path determination policy is the case given in the second example above, the corresponding grouping policy can be to divide the first candidate file path into one group, divide the second candidate file path into one group, divide the file path corresponding to the video in the third candidate file path into one group, and divide the file path corresponding to the picture in the third candidate file path into one group, i.e., divide the candidate file set into four groups according to the above method.

[0078] In a specific implementation, for each group, the group can be encapsulated as an intermediate scanning task. For specific implementation principles of encapsulation, reference can be made to the description in the foregoing embodiments, which will not be described here again.

[0079] In addition, in this embodiment, when the step of executing in parallel using multiple processing threads to determine the target file path set that is newly added or deleted locally and generate the final scanning task based on the target file path set is performed, each intermediate scanning task can be processed in parallel using multiple processing threads. Wherein the process of processing the intermediate scanning task comprises comparing the file paths that currently exist in the service provider multimedia database with the group carried by the intermediate scanning task, determining the target file path set that is newly added or deleted locally, and generating the final scanning task based on the target file path set.

[0080] For example, in an embodiment, the candidate file path set contains 50 file paths, and in this embodiment, the 50 file paths can be divided into two groups to obtain two intermediate scanning tasks, and then the two intermediate scanning tasks are processed in parallel. In this way, frequent scheduling processes can be avoided, and scheduling pressure can be reduced.

[0081] The method provided in this embodiment divides the candidate file path set into at least one group, and then generates an intermediate scanning task based on each group. In this way, multiple processing threads can be used to process the intermediate scanning tasks in parallel, which not only improves efficiency but also reduces scheduling pressure.

[0082] It should be noted that in an embodiment, when processing a scanning task (which can include a final scanning task and an intermediate scanning task), the priority of the scanning task can be determined first, and the scanning tasks are processed in parallel based on the order from high to low according to the priority.

[0083] When implemented, the priority of the scanning task can be determined based on the time when the scanning task is generated, the size of the file corresponding to the file path carried by the scanning task, etc. In this embodiment, it is not limited, for example, in an embodiment, when the time when the scanning task is generated is earlier, a higher priority can be assigned to the scanning task.

[0084] The method provided in this embodiment determines the priority of each scanning task before processing the scanning task, and then processes the scanning task based on the priority when processing the scanning task. In this way, certain tasks can be executed in priority.

[0085] A more specific embodiment is given below to introduce the technical solutions of the disclosure in detail:

[0086] Figure 3 is a flowchart of a multimedia file scanning method according to an exemplary embodiment of the disclosure. Please refer to Figure 3 The method provided in this embodiment can include:

[0087] S301, when receiving a multimedia file scanning request for a service provider multimedia database on the device, encapsulating the scanning request into an original scanning task; wherein the original scanning task carries identification information.

[0088] The specific implementation principle of encapsulating the scanning request into the original scanning task can be referred to the description in the related art, which will not be repeated here.

[0089] S302, according to the identification information carried by the original scanning task, finding the processing strategy corresponding to the identification information from the pre-set correspondence between the identification information and the processing strategy; wherein the processing strategy includes a candidate file path determination strategy and a grouping strategy.

[0090] S303, determine a strategy based on the candidate file path set, and determine the candidate file path set corresponding to the scan request.

[0091] S304, divide the candidate file path set into at least one group based on the grouping strategy.

[0092] S305, for each group, generate an intermediate scan task based on the group.

[0093] S306, process the intermediate scan tasks in parallel based on multiple processing threads; wherein the process of processing the intermediate scan tasks includes comparing the file paths currently existing in the service provider multimedia database on the device with the group carried by the intermediate scan task, determining a target file path set newly added or deleted locally, and generating a final scan task based on the target file path set.

[0094] For example, in an embodiment, the number of processing threads is 2, that is, two intermediate scan tasks can be processed simultaneously.

[0095] S307, process each final scan task in parallel based on multiple scan threads, obtain the scan result corresponding to each final scan task, and insert the scan result into the service provider multimedia database.

[0096] For example, in an embodiment, the number of scan threads can be 4, that is, four final scan tasks can be processed simultaneously.

[0097] The specific implementation principles and implementation processes of the above steps can be referred to the description in the foregoing embodiments, which will not be repeated here.

[0098] The method provided in the embodiment can improve the scanning efficiency and reduce the scanning time by processing the intermediate scan tasks and the final scan tasks in parallel.

[0099] Corresponding to the foregoing embodiments of the multimedia file scanning method, the disclosure also provides embodiments of a multimedia file scanning device.

[0100] Figure 4 is a structural schematic diagram of a multimedia file scanning device according to an exemplary embodiment of the disclosure. Please refer to Figure 4 The device provided in the embodiment is applied to a terminal device, and the device includes a generation module 410 and a processing module 420, wherein,

[0101] The generation module 410 is configured to, when receiving a multimedia file scanning request for a service provider multimedia database on the device, determine a target file path set to be scanned by the scanning request.

[0102] The generating module 410 is further configured to generate a plurality of final scanning tasks according to the target file path set; each of the final scanning tasks is used to instruct scanning files under a target file path in the target file path set.

[0103] The processing module 420 is configured to process each of the final scanning tasks in parallel based on a plurality of scanning threads, obtain a scanning result corresponding to each of the final scanning tasks, and insert the scanning result into the service provider multimedia database.

[0104] The apparatus provided in the embodiment can be used to execute the method provided in the embodiment. Figure 1 The technical solutions of the illustrated embodiments have similar implementation principles and technical effects, which will not be described herein.

[0105] Figure 5 FIG. 4 is a structural schematic diagram of another multimedia file scanning apparatus according to an example embodiment of the present disclosure. Please refer to Figure 5 On the basis of the above-mentioned embodiment, the apparatus provided in the embodiment carries the identification information in the scanning request, and the generating module 410 can include a searching unit 411, a determining unit 412, and a processing unit 413, wherein

[0106] The searching unit 411 is configured to search, according to the identification information, a processing strategy corresponding to the identification information from a pre-set correspondence between identification information and processing strategies; the processing strategy includes a candidate file path set determination rule.

[0107] The determining unit 412 is configured to determine a candidate file path set corresponding to the scanning request based on the candidate file path set determination rule.

[0108] The processing unit 413 is configured to compare a file path currently existing in the service provider multimedia database with the candidate file path set, determine a target file path set of local new or deleted files, and generate the final scanning tasks based on the target file path set.

[0109] Further, the processing unit 413 is specifically configured to perform, in parallel based on a plurality of processing threads, the steps of searching the target file path set of local new or deleted files from the candidate file path set, and generating the final scanning tasks based on the target file path set.

[0110] Further, the processing strategy further includes a grouping strategy; the determination unit 412 is further configured to, after determining the candidate file path set corresponding to the scanning request, divide the candidate file path set into at least one group based on the grouping strategy, and for each group, generate an intermediate scanning task based on the group;

[0111] The processing unit 413 is specifically configured to process each intermediate scanning task in parallel by using multiple processing threads; wherein the process of processing the intermediate scanning task includes comparing the file paths currently existing in the service provider multimedia database with the group carried by the intermediate scanning task, determining a target file path set newly added or deleted locally, and generating the final scanning task based on the target file path set.

[0112] Further, the multimedia file scanning request is generated when it is detected that the photo album application of the device is started or returned to the foreground;

[0113] And / or,

[0114] The multimedia file scanning request is a multimedia file scanning request for an Android media database on the device, and is generated when a file creation notification reported by a third-party application is detected.

[0115] And / or, the multimedia file scanning request is generated when it is detected that the photo album application on the device creates a file.

[0116] As to the apparatus in the above-described embodiments, the specific manner in which various modules perform operations has been described in detail in the embodiments of the methods, and will not be described in detail here.

[0117] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts are described with reference to the parts of the method embodiments. The device embodiments described above are merely illustrative, wherein the modules described as separate components can or can not be physically separated, and the components shown as modules can or can not be physical modules, i.e., they can be located in one place or distributed on multiple network modules. According to actual needs, some or all of the modules can be selected to achieve the purposes of the present disclosure. Those skilled in the art can understand and implement it without creative labor.

[0118] Embodiments of the present disclosure also propose a terminal device, comprising:

[0119] a processor;

[0120] a memory for storing processor-executable instructions;

[0121] The processor is configured to implement the method in any of the above embodiments.

[0122] The present disclosure also provides a computer readable storage medium, having stored thereon a computer program, which when executed by a processor, implements the method in any of the above embodiments.

[0123] Figure 6 is a structural schematic diagram of a terminal device according to an exemplary embodiment of the present disclosure. For example, the terminal device 600 can be a mobile phone or the like.

[0124] Referring to Figure 6 , the terminal device 600 can include one or more of the following components: a processing component 602, a memory 604, a power supply component 606, a multimedia component 608, an audio component 610, an input / output (I / O) interface 612, a sensor component 614, and a communication component 616.

[0125] The processing component 602 usually controls overall operations of the terminal device 600, such as operations associated with displaying, making phone calls, data communications, camera operations and recording operations. The processing component 602 can include one or more processors 620 to execute instructions to complete all or part of steps of the above methods. In addition, the processing component 602 can include one or more modules to facilitate the interaction between the processing component 602 and other components. For example, the processing component 602 can include a multimedia module to facilitate the interaction between the multimedia component 608 and the processing component 602.

[0126] The memory 604 is configured to store various types of data to support operations of the terminal device 600. Examples of these data include instructions for any application or method operating on the terminal device 600, contact data, phonebook data, messages, pictures, videos, and the like. The memory 604 can be implemented by any type of volatile or non-volatile storage devices or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk or optical disk.

[0127] The power supply component 606 provides power for various components of the terminal device 600. The power supply component 606 can include a power supply management system, one or more power supplies, and other components associated with generating, managing and distributing power for the terminal device 600.

[0128] The multimedia component 608 includes a screen providing an output interface between the terminal device 600 and a user. In some embodiments, the screen can include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen can be implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touch, slide and gesture on the touch panel. The touch sensor can not only sense a boundary of a touching or sliding action, but also detect duration and pressure related to the touching or sliding action. In some embodiments, the multimedia component 1308 includes a front camera and / or a rear camera. When the terminal device 600 is in an operation mode, such as a shooting mode or a video mode, the front camera and / or the rear camera can receive external multimedia data. Each of the front camera and the rear camera can be a fixed optical lens system or have a focal length and optical zoom capability.

[0129] The audio component 610 is configured to output and / or input audio signals. For example, the audio component 610 includes a microphone (MIC) that is configured to receive external audio signals when the terminal device 600 is in an operation mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals can be further stored in the memory 604 or transmitted via the communication component 616. In some embodiments, the audio component 610 also includes a speaker for outputting audio signals.

[0130] The I / O interface 612 provides an interface between the processing component 602 and peripheral interface modules, which can be a keypad, a click wheel, buttons, and the like. The buttons can include, but are not limited to, a home button, a volume button, a start button, and a lock button.

[0131] The sensor component 614 includes one or more sensors to provide various state assessments for the terminal device 600. For example, the sensor component 614 can detect an open / closed state of the terminal device 600, relative positioning of components, such as a display and a keypad of the terminal device 600, a change in position of the terminal device 600 or a component of the terminal device 600, presence or absence of user contact with the terminal device 600, an orientation or acceleration / deceleration of the terminal device 600, and a temperature change of the terminal device 600. The sensor component 614 can include a proximity sensor configured to detect presence of a nearby object without any physical touch. The sensor component 614 can further include a light sensor such as a CMOS or CCD image sensor for use in an imaging application. In some embodiments, the sensor component 614 can further include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0132] The communication component 616 is configured to facilitate wired or wireless communication between the terminal device 600 and other devices. The terminal device 600 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, 4G LTE, 5G NR, or a combination thereof. In an example embodiment, the communication component 616 receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel. In an example embodiment, the communication component 616 further includes a Near Field Communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on Radio Frequency Identification (RFID) techniques, infrared data association (IrDA) techniques, ultra-wideband (UWB) techniques, Bluetooth (BT) techniques, and other techniques.

[0133] In an example embodiment, the terminal device 600 can be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, micro-controllers, microprocessors, or other electronic elements, for performing the methods described in any one of the above embodiments.

[0134] In an example embodiment, a non-transitory computer-readable storage medium including instructions, such as a memory including instructions, is also provided, which can be executed by a processor to complete the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disc, and an optical data storage device, etc.

[0135] Other embodiments of the present disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the features disclosed herein. The present disclosure is intended to cover any variations, uses, or adaptations of the present disclosure following, in general, the principles of the present disclosure and including such features to the extent that they are not disclosed in the prior art. The specification and examples are to be regarded as illustrative only, and the true scope and spirit of the present disclosure are indicated by the following claims.

[0136] It should be understood that the present disclosure is not limited to the precise structures described and shown in the drawings, and that various modifications and changes can be made to the embodiments without departing from the scope of the present disclosure. The scope of the present disclosure is limited only by the claims that follow.

Claims

1. A method for scanning multimedia files, characterized in that, The method is applied to a terminal device, and the method includes: Upon receiving a multimedia file scanning request for the service provider's multimedia database on this device, the set of target file paths to be scanned by the scanning request is determined; the scanning request carries identification information to identify the triggering scenario of the scanning request. Based on the identification information, a processing strategy corresponding to the identification information is searched from a pre-set correspondence between identification information and processing strategies; wherein, the processing strategy includes a candidate file path set determination strategy; Based on the candidate file path set determination strategy, the candidate file path set corresponding to the scan request is determined; The existing file paths in the service provider's multimedia database are compared with the candidate file path set to determine the target file path set that has been added or deleted locally, and a final scan task is generated based on the target file path set; wherein each of the final scan tasks is used to instruct the scanning of files under one target file path in the target file path set; Each final scan task is processed in parallel by multiple scan threads to obtain the scan result corresponding to each final scan task, and the scan result is inserted into the service provider's multimedia database.

2. The method according to claim 1, characterized in that, The step of determining the set of target file paths that have been added or deleted locally, and generating the final scan task based on the set of target file paths, includes: The steps involve determining the set of target file paths that have been added or deleted locally by multiple processing threads in parallel, and generating the final scan task based on the set of target file paths.

3. The method according to claim 2, characterized in that, The processing strategy also includes a grouping strategy; after determining the set of candidate file paths corresponding to the scan request, the method further includes: Based on the grouping strategy, the candidate file path set is divided into at least one group; For each group, an intermediate scan task is generated based on that group; The step of determining the set of target file paths that have been added or deleted locally by executing multiple processing threads in parallel, and generating the final scan task based on the set of target file paths, includes: Each intermediate scan task is processed in parallel using multiple processing threads. The process of processing the intermediate scan task includes comparing the file paths that currently exist in the service provider's multimedia database with the groups carried by the intermediate scan task to determine the set of target file paths that have been added or deleted locally, and generating the final scan task based on the set of target file paths.

4. The method according to claim 1, characterized in that, The multimedia file scanning request is generated when the photo app on this device is detected to be launched or returned to the foreground. And / or, The multimedia file scanning request is a multimedia file scanning request against the Android media database on this device, generated when a file creation notification reported by a third-party application is detected. And / or, The multimedia file scan request is generated when a file is detected being created by the photo app on this device.

5. The method according to claim 1 or 4, characterized in that, The method further includes: Before processing scanning tasks, determine the priority of each scanning task; The process of handling a scanning task includes: The scanning task is processed according to the stated priority.

6. A multimedia file scanning device, characterized in that, The device is applied to a terminal device, and the device includes a generation module and a processing module, wherein... The generation module is used to determine the set of target file paths that the scanning request needs to scan when it receives a multimedia file scanning request for the service provider's multimedia database on this device; the scanning request carries identification information to identify the triggering scenario of the scanning request. The generation module is further configured to generate multiple final scan tasks based on the target file path set; wherein each final scan task is configured to instruct scanning of files under a target file path in the target file path set; The processing module is used to process each final scan task in parallel based on multiple scan threads, obtain the scan result corresponding to each final scan task, and insert the scan result into the service provider's multimedia database; The generation module includes a search unit, a determination unit, and a processing unit, wherein... The search unit is used to search for the processing strategy corresponding to the identification information from a pre-set correspondence between identification information and processing strategies, based on the identification information; wherein, the processing strategy includes a rule for determining the candidate file path set; The determining unit is used to determine the set of candidate file paths corresponding to the scan request based on the candidate file path set determination rules. The processing unit is used to compare the file paths currently existing in the service provider's multimedia database with the candidate file path set, determine the target file path set that has been added or deleted locally, and generate the final scanning task based on the target file path set.

7. A terminal device, characterized in that, include: processor; Memory used to store processor-executable instructions; The processor is configured to implement the method of any one of claims 1 to 5.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method of any one of claims 1 to 5.

Citation Information

Patent Citations

  • Scanning method and scanning system for local media files

    CN104536961A

  • File scanning method and device, computer readable storage medium and terminal

    CN110688344A