CN114647746A - Multimedia file scanning method and device and terminal equipment - Google Patents

Multimedia file scanning method and device and terminal equipment Download PDF

Info

Publication number
CN114647746A
CN114647746A CN202011501632.8A CN202011501632A CN114647746A CN 114647746 A CN114647746 A CN 114647746A CN 202011501632 A CN202011501632 A CN 202011501632A CN 114647746 A CN114647746 A CN 114647746A
Authority
CN
China
Prior art keywords
scanning
file path
path set
processing
multimedia
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
CN202011501632.8A
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.)
Beijing Xiaomi Mobile Software Co Ltd
Original Assignee
Beijing Xiaomi Mobile Software 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 Beijing Xiaomi Mobile Software Co Ltd filed Critical Beijing Xiaomi Mobile Software Co Ltd
Priority to CN202011501632.8A priority Critical patent/CN114647746A/en
Publication of CN114647746A publication Critical patent/CN114647746A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/40Information retrieval; Database structures therefor; File system structures therefor of multimedia data, e.g. slideshows comprising image and additional audio data
    • G06F16/41Indexing; Data structures therefor; Storage structures
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N1/00Scanning, transmission or reproduction of documents or the like, e.g. facsimile transmission; Details thereof
    • H04N1/04Scanning arrangements, i.e. arrangements for the displacement of active reading or reproducing elements relative to the original or reproducing medium, or vice versa

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Signal Processing (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The disclosure provides a multimedia file scanning method, a multimedia file scanning device and terminal equipment. The method for scanning the multimedia file is applied to terminal equipment and comprises the following steps: when a multimedia file scanning request aiming at a service provider multimedia database on the equipment is received, determining a target file path set required 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; and each final scanning task is used for indicating to scan the file under one target file path in the target file path set. The multimedia file scanning method, the multimedia file scanning device and the terminal equipment can improve scanning efficiency and reduce scanning time.

Description

Multimedia file scanning method and device and terminal equipment
Technical Field
The present disclosure relates to the field of information technologies, and in particular, to a method and an apparatus for scanning a multimedia file, and a terminal device.
Background
At present, in order to facilitate the multimedia file to be called, an android system provides an android media database, so that the locally stored multimedia file is stored in the android media database in a scanning manner, and a data source is provided for other applications through the android media database.
In order to develop some functions more freely, besides the android media database, some terminal device servers maintain their own independent server multimedia database in the terminal devices produced by the terminal device servers, and provide data sources for other applications through the server multimedia database.
When the terminal device maintains its own independent multimedia database of the service provider, it also needs to store the locally stored multimedia file in the multimedia database of the service provider by scanning. In this case, how to improve the scanning efficiency becomes a focus of attention in the industry.
Disclosure of Invention
The present disclosure provides a multimedia file scanning method, apparatus and terminal device to solve the deficiencies in the related art.
According to a first aspect of the embodiments of the present disclosure, a multimedia file scanning method is provided, where the method is applied to a terminal device, and the method includes:
when a multimedia file scanning request aiming at a service provider multimedia database on the equipment is received, determining a target file path set required to be scanned by the scanning request;
generating a plurality of final scanning tasks according to the target file path set; each final scanning task is used for indicating to scan the files under one target file path in the target file path set;
and 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.
According to a second aspect of the embodiments of the present disclosure, a multimedia file scanner apparatus is provided, the apparatus being applied to a terminal device, the apparatus including a generation module and a processing module, wherein,
the generation module is used for determining a target file path set required to be scanned by a scanning request when the scanning request of a multimedia file of a service provider multimedia database on the equipment is received;
the generating module is further configured to generate a plurality of final scanning tasks according to the target file path set; each final scanning task is used for indicating to scan the file under one target file path in the target file path set;
and the processing module is used for 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.
According to a third aspect of the present disclosure, a terminal device is provided, including:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to implement the method of any one of the aspects presented in the first aspect of the present disclosure.
According to a fourth aspect of the present disclosure, a computer-readable storage medium is proposed, on which a computer program is stored, which program, when being executed by a processor, carries out the steps of any of the methods presented in the first aspect of the present disclosure
The technical scheme provided by the embodiment of the disclosure can have the following beneficial effects:
as can be seen from the foregoing embodiments, according to the multimedia file scanning method, apparatus, and terminal device provided by the present disclosure, when a multimedia file scanning request for a multimedia database of a service provider on the device is received, a target file path set that needs to be scanned by the scanning request is determined, and then a plurality of final scanning tasks are generated according to the target file path set, so that each final scanning task is processed in parallel based on a plurality of scanning threads, a scanning result corresponding to each final scanning task is obtained, and the scanning result is inserted into the multimedia database of the service provider. And each final scanning task is used for indicating to scan the file under one target file path in the target file path set. Therefore, the final scanning task is processed in parallel through multiple scanning threads, the scanning efficiency can be improved, and the scanning time is reduced.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.
FIG. 1 is a flow chart diagram illustrating a method of scanning a multimedia file according to an exemplary embodiment of the present disclosure;
FIG. 2 is a flow chart diagram illustrating another method of multimedia file scanning according to an exemplary embodiment of the present disclosure;
FIG. 3 is a flow chart diagram illustrating a method of multimedia file scanning according to an exemplary embodiment of the present disclosure;
FIG. 4 is a schematic block diagram of a multimedia file scanning apparatus according to an exemplary embodiment of the present disclosure;
FIG. 5 is a schematic block diagram of another multimedia file scanning apparatus shown in accordance with an exemplary embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of a terminal device shown in accordance with an exemplary embodiment of the present disclosure.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the disclosure, as detailed in the appended claims.
The disclosure provides a multimedia file scanning method, a multimedia file scanning device and terminal equipment, which are used for improving the scanning efficiency of multimedia files and reducing the scanning time.
The method and the device for scanning the multimedia file can be applied to terminal equipment. For example, it can be applied to a mobile phone or the like.
Several specific examples are given below to illustrate the technical solution of the present disclosure in detail. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments.
Fig. 1 is a flow chart illustrating a multimedia file scanning method according to an exemplary embodiment of the present disclosure. Referring to fig. 1, the method provided in this embodiment is applied to a terminal device, and the method may include:
s101, when a multimedia file scanning request aiming at a service provider multimedia database on the equipment is received, determining a target file path set required to be scanned by the scanning request.
It should be noted that, in an embodiment, the multimedia file scanning request is generated when it is detected that the album application on the device is started or returns to the foreground.
In another embodiment, the multimedia file scanning request is a multimedia file scanning request for an android media database on the device generated when a file creation notification reported by a third-party application is detected.
It should be noted that, when detecting a file creation operation, the third-party application reports a file creation notification to the terminal system, and 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, so as to scan a multimedia file based on the multimedia file scanning request for the android media database on the device, and update the android media database.
Further, the terminal system determines the multimedia file scanning request for the android media database on the device as a multimedia scanning request for a service provider multimedia database on the device, so as to scan the multimedia file based on the multimedia scanning request and update the service provider multimedia database.
Further, in yet another embodiment, the multimedia file scan request may be generated upon detecting that an album application on the device creates a file.
Specifically, the state of the album application may be monitored, and then when it is monitored that the album application creates a file (for example, a user edits an original picture to generate a new picture), a multimedia file scanning request may be generated.
In addition, the set of target file paths are file paths that have been added or deleted by the local file system as compared to the service provider multimedia database. The specific implementation principle of determining the target file path set required to be scanned by the scan request will be described in detail in the following embodiments, and will not be described herein again.
S102, generating a plurality of final scanning tasks according to the target file path set; and each final scanning task is used for indicating to scan the file under one target file path in the target file path set.
Specifically, each target file path may be packaged into a final scan job, where the final scan job carries the target file path and is used to instruct to scan a file under the target file path. For the specific implementation principle and implementation process of the package, reference may be made to the description in the related art, and details are not described herein.
It should be noted that, when a final scan task is generated based on a target file path, if a file under the target file path is a newly added file, a type of the final scan task is generated as the newly added final scan task, and if a file under the target file path is a deleted file, a type of the final scan task is generated as the deleted final scan task.
S103, 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.
For example, in one embodiment, the number of scan threads is 4, i.e., 4 final scan tasks can be processed simultaneously at one time.
In addition, when the scanning result is inserted into the service provider multimedia database, the scanning result can be inserted into the service provider multimedia database in a batch processing mode.
Optionally, in a possible implementation manner, if the file paths carried by the several final scanning tasks are the same, when the final scanning task is processed, the several final scanning tasks may be merged, that is, only one of the final scanning tasks is reserved. Therefore, resources can be saved, the scanning efficiency is further improved, and the scanning time is reduced.
In the method provided by this embodiment, when a multimedia file scanning request for a multimedia database of a service provider on the device is received, a target file path set that needs to be scanned by the scanning request is determined, and then a plurality of final scanning tasks are generated according to the target file path set, so that each final scanning task is processed in parallel based on a plurality of scanning threads, a scanning result corresponding to each final scanning task is obtained, and the scanning result is inserted into the multimedia database of the service provider. And each final scanning task is used for indicating to scan the file under one target file path in the target file path set. Therefore, the final scanning task is processed in parallel through multiple scanning threads, the scanning efficiency can be improved, and the scanning time can be reduced.
FIG. 2 is a flow chart illustrating another method of multimedia file scanning according to an exemplary embodiment of the present disclosure. Referring to fig. 2, in the method provided in this embodiment, on the basis of the foregoing embodiment, the scan request carries identification information; the determining a target file path set that needs to be scanned by the scanning request, and generating a plurality of final scanning tasks according to the target file path set may include:
s201, searching a processing strategy corresponding to the identification information from a preset corresponding relation between the identification information and the processing strategy according to the identification information; wherein the processing policy comprises a candidate file path set determination policy.
Specifically, in this embodiment, the scanning request carries identification information, which is used to identify a trigger scenario of the scanning request. For example, when the scan request is generated when it is detected that the album application on the present device is started or returned to the foreground, the identification information carried by the scan request may be Y. When the scanning request is a multimedia file scanning request for an android media database on the device, which is generated when a file creation notification reported by a third-party application is detected, the identification information carried by the scanning request may be Z. When the scan request is generated when detecting that the album application on the device creates a file, the identification information carried by the scan request may be X.
It should be noted that, when the scan request is a multimedia file scan request for an android media database on the device generated when a file creation notification reported by a third-party application is detected, or when the scan request is a scan request generated when an album application on the device is detected to create a file, the scan request also carries a file path (the file path may be a file path corresponding to a newly created file).
In addition, the preset correspondence between the identification information and the processing policy is set according to actual needs, and in this embodiment, specific contents thereof are not limited.
For example, in an embodiment, when the identification information is Z or X, the candidate file path set determination policy corresponding to the identification information may be: and acquiring all file paths under the file path carried by the scanning request from a local file system, and determining the acquired file paths as a candidate file path set.
For another example, in another embodiment, when the identification information is Y, the candidate file path set determination policy corresponding to the identification information may be: and determining all file paths in the local file system as a candidate file path set.
Of course, in another embodiment, when the identification information is Y, the candidate file path set determination policy corresponding to the identification information may be: determining all file paths (the file path corresponding to the third-party application refers to a file path for storing data generated by the third-party application) corresponding to a specified third-party application (the specified third-party application is set according to actual needs, and can be QQ, WeChat and the like, for example) existing in the local file system and all file paths under the specified file path acquired from the local file system as a candidate file path set; the specified file path can be a current existing file path of a multimedia database of a service provider and/or a newly added file path of an android media database.
S202, determining a strategy based on the candidate file path set, and determining the candidate file path set corresponding to the scanning request.
For example, in an embodiment, the identification information carried by the scanning information is Y, and at this time, based on the candidate file path determination policy given in the second example above, the candidate file path set corresponding to the scanning request may be determined according to the following method:
(1) and judging whether a storage space (used for storing data generated by the third-party application) corresponding to the third-party application exists in the local file system or not aiming at any specified third-party application, and if so, determining all file paths in the local file system under the storage space as first candidate file paths.
(2) And aiming at any current existing file path of the multimedia database of the service provider, acquiring all file paths under the file path from a local file system, and determining the acquired file paths as second candidate file paths.
(3) And aiming at the newly added file path of the android media database, acquiring all file paths under the file path from a local file system, and determining the acquired file path as a third candidate file path.
(4) Determining a set of first, second, and third candidate file paths as a set of candidate file paths.
S203, comparing the current existing file path in the multimedia database of the service provider with the candidate file path set, determining a locally added or deleted target file path set, and generating the final scanning task based on the target file path set.
In a specific implementation, the file path that currently exists in the multimedia database of the service provider may be compared with the candidate file path set to determine which paths in the candidate file path set are locally added target file paths, and to determine which paths in the file paths that currently exist in the multimedia database of the service provider are locally deleted target file paths.
In the method provided by this embodiment, when a scanning request carries identification information, a processing policy corresponding to the identification information is searched from a preset correspondence between the identification information and the processing policy according to the identification information, and then a policy is determined based on the candidate file path set in the processing policy, and a candidate file path set corresponding to the scanning request is determined, so that a file path that currently exists in the service provider multimedia database is compared with the candidate file path set, a locally added or deleted target file path set is determined, and the final scanning task is generated based on the target file path set. Therefore, a plurality of final scanning tasks can be processed in parallel subsequently based on a plurality of parallel execution scanning threads, the scanning efficiency can be improved, and the scanning time can be reduced.
Optionally, in a possible implementation manner of the present disclosure, the determining a locally added or deleted target file path set, and generating the final scanning task based on the target file path set includes:
and executing and determining a locally added or deleted target file path set in parallel based on a plurality of processing threads, and generating the final scanning task based on the target file path set.
It should be noted that, referring to the foregoing description, when determining a locally added or deleted file path, it is necessary to compare a file path currently existing in the multimedia database of the service provider with file paths in the candidate file path set one by one to determine which paths are locally added target file paths in the candidate file path set, and determine which paths are locally deleted target file paths in currently existing file paths in the multimedia data path on the service.
In this embodiment, when performing one-to-one comparison, determining a locally added or deleted target file path set, and generating the final scanning task based on the target file path set, the process may be executed in parallel based on multiple processing threads. Thus, the efficiency can be further improved and the time can be shortened.
Optionally, in a possible implementation manner of the present disclosure, the processing policy further includes a grouping policy; after determining the candidate file path set corresponding to the scan request, the method further includes:
dividing the set of candidate file paths into at least one group based on the grouping policy;
for each packet, generating an intermediate scanning task based on the packet;
the step of determining a locally added or deleted target file path set by adopting a plurality of processing threads to execute in parallel and generating the final scanning task based on the target file path set comprises the following steps:
processing each intermediate scanning task in parallel by adopting a plurality of processing threads; the process of processing the intermediate scanning task comprises the steps of comparing the current existing file path in the service provider multimedia database with the packet carried by the intermediate scanning task, determining a locally added or deleted target file path set, and generating the final scanning task based on the target file path set.
Specifically, the grouping policy is set according to actual needs, and in this embodiment, the grouping policy is not limited.
For example, in an embodiment, when the identification information of the scan request is X or Z, the corresponding packet policy is: dividing the candidate file path set into a group; when the identification information of the scan request is Y and the candidate file path determination policy is the case given in the second example described above, the corresponding grouping policy may be: the first candidate file path is divided into a group, the second candidate file path is divided into a group, the file path corresponding to the video in the third candidate file path is divided into a group, the file path corresponding to the picture in the third candidate file path is divided into a group, namely, the candidate file set is divided into four groups according to the method.
In particular implementations, for each packet, the packet may be encapsulated as an intermediate scanning task. For the specific implementation principle of the package, reference may be made to the description in the foregoing embodiments, and details are not described here.
In addition, in this embodiment, when the step of determining the locally added or deleted target file path set is executed in parallel by using a plurality of processing threads, and the final scanning task is generated based on the target file path set, each intermediate scanning task may be processed in parallel by using a plurality of processing threads. The process of processing the intermediate scanning task comprises the steps of comparing the current existing file path in the service provider multimedia database with the packet carried by the intermediate scanning task, determining a locally added or deleted target file path set, and generating the final scanning task based on the target file path set.
For example, in an embodiment, the candidate file path set includes 50 file paths in total, and in this embodiment, the 50 file paths may be divided into two groups to obtain two intermediate scanning tasks, and then the two intermediate scanning tasks are processed in parallel. Thus, frequent scheduling procedures can be avoided, and scheduling pressure can be reduced.
In the method provided by this embodiment, the candidate file path set is divided into at least one group, and then for each group, an intermediate scanning task is generated based on the group. Therefore, the intermediate scanning tasks can be processed in parallel by adopting a plurality of processing threads, so that the efficiency can be improved, and the scheduling pressure can be reduced.
It should be noted that, in an embodiment, in processing the scanning tasks (which may include the final scanning task and the intermediate scanning task), the priority of the scanning tasks may be determined first, and the scanning tasks are processed in parallel according to the order from high to low in the priority.
In a specific implementation, the priority of the scanning task may be determined based on the generation time of the scanning task, the size of the file corresponding to the file path carried by the scanning task, and the like.
In the method provided by this embodiment, before processing a scan task, the priority of each scan task is determined, and when processing the scan task, the scan task is processed based on the priority. In this way, certain tasks may be guaranteed to execute preferentially.
A more specific example is given below for a detailed description of the technical solution of the present disclosure:
fig. 3 is a flow chart illustrating a method of multimedia file scanning according to an exemplary embodiment of the present disclosure. Referring to fig. 3, the method provided in this embodiment may include:
s301, when a multimedia file scanning request aiming at a service provider multimedia database on the equipment is received, packaging the scanning request into an original scanning task; wherein the original scanning task carries identification information.
For a specific implementation principle of encapsulating the scan request into the original scan task, reference may be made to the description in the related art, and details are not described here.
S302, searching a processing strategy corresponding to the identification information from a preset corresponding relation between the identification information and the processing strategy according to the identification information carried by the original scanning task; wherein the processing policy comprises a candidate file path determination policy and a grouping policy.
S303, determining a strategy based on the candidate file path set, and determining the candidate file path set corresponding to the scanning request.
S304, dividing the candidate file path set into at least one group based on the grouping strategy.
S305, for each packet, an intermediate scanning job is generated based on the packet.
S306, processing the intermediate scanning task in parallel based on a plurality of processing threads; the process of processing the intermediate scanning task comprises the steps of comparing the existing file path in the multimedia database of the service provider on the device with the packet carried by the intermediate scanning task, determining a locally added or deleted target file path set, and generating a final scanning task based on the target file path set.
For example, in one embodiment, the number of processing threads is 2, i.e., two intermediate scan tasks can be processed simultaneously.
S307, 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.
For example, in one embodiment, the number of scan threads may be 4. I.e. 4 final scanning jobs can be processed simultaneously.
For the specific implementation principle and implementation process of each step, reference may be made to the description in the foregoing embodiments, and details are not described here.
The method provided by the embodiment can improve the scanning efficiency and reduce the scanning time by processing the intermediate scanning task and the final scanning task in parallel.
Corresponding to the embodiment of the multimedia file scanning method, the disclosure also provides an embodiment of a multimedia file scanning device.
Fig. 4 is a schematic structural diagram of a multimedia file scanning apparatus according to an exemplary embodiment of the present disclosure. Referring to fig. 4, the apparatus provided in this embodiment is applied to a terminal device, and the apparatus includes a generating module 410 and a processing module 420, wherein,
the generating module 410 is configured to, when a multimedia file scanning request for a service provider multimedia database on the device is received, determine a target file path set that needs to be scanned by the scanning request;
the generating module 410 is further configured to generate a plurality of final scanning tasks according to the target file path set; each final scanning task is used for indicating to scan the file under one target file path in the target file path set;
the processing module 420 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.
The apparatus provided in this embodiment may be used to implement the technical solution of the embodiment shown in fig. 1, and the implementation principle and the technical effect are similar, which are not described herein again.
Fig. 5 is a schematic structural diagram of another multimedia file scanning apparatus shown in the present disclosure according to an exemplary embodiment. Referring to fig. 5, on the basis of the foregoing embodiment, in the apparatus provided in this embodiment, the scan request carries identification information, and the generating module 410 may include a searching unit 411, a determining unit 412, and a processing unit 413, wherein,
the searching unit 411 is configured to search, according to the identifier information, a processing policy corresponding to the identifier information from a correspondence between preset identifier information and processing policy; the processing strategy comprises a candidate file path set determination rule;
the determining unit 412 is configured to determine a candidate file path set corresponding to the scan request based on the candidate file path set determination rule;
the processing unit 413 is configured to compare a currently existing file path in the service provider multimedia database with the candidate file path set, determine a locally added or deleted target file path set, and generate the final scanning task based on the target file path set.
Further, the processing unit 413 is specifically configured to perform, based on multiple processing threads, a step of searching for a locally added or deleted target file path set from the candidate file path set in parallel, and generate the final scanning task based on the target file path set.
Further, the processing policy further comprises a grouping policy; the determining 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 policy, and generate, for each group, an intermediate scanning task based on the group;
the processing unit 413 is specifically configured to employ multiple processing threads to process each intermediate scanning task in parallel; the process of processing the intermediate scanning task comprises the steps of comparing the current existing file path in the service provider multimedia database with the packet carried by the intermediate scanning task, determining a locally added or deleted target file path set, and generating the final scanning task based on the target file path set.
Further, the multimedia file scanning request is generated when detecting that an album application of the device is started or returns to the foreground;
and/or the presence of a gas in the gas,
the multimedia file scanning request is a multimedia file scanning request which is generated when a file creation notification reported by a third-party application is detected and aims at an android media database on the device;
and/or the multimedia file scanning request is generated when detecting that an album application on the equipment creates a file.
With regard to the apparatus in the above embodiments, the specific manner in which each module performs operations has been described in detail in the embodiments of the related method, and will not be described in detail here.
For the device embodiments, since they substantially correspond to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described embodiments of the apparatus are merely illustrative, wherein the modules described as separate parts may or may not be physically separate, and the parts displayed as modules may or may not be physical modules, may be located in one place, or may be distributed on a plurality of network modules. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of the disclosure. One of ordinary skill in the art can understand and implement it without inventive effort.
An embodiment of the present disclosure further provides a terminal device, including:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to implement the method of any of the above embodiments.
Embodiments of the present disclosure also provide a computer-readable storage medium on which a computer program is stored, which when executed by a processor implements the method of any of the above embodiments.
Fig. 6 is a schematic structural diagram of a terminal device shown in accordance with an exemplary embodiment of the present disclosure. For example, the terminal device 600 may be a mobile phone or the like.
Referring to fig. 6, the terminal device 600 may include one or more of the following components: processing component 602, memory 604, power component 606, multimedia component 608, audio component 610, input/output (I/O) interface 612, sensor component 614, and communication component 616.
The processing component 602 generally controls overall operations of the terminal device 600, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing component 602 may include one or more processors 620 to execute instructions to perform all or a portion of the steps of the methods described above. Further, the processing component 602 can include one or more modules that facilitate interaction between the processing component 602 and other components. For example, the processing component 602 can include a multimedia module to facilitate interaction between the multimedia component 608 and the processing component 602.
The memory 604 is configured to store various types of data to support operation at the terminal device 600. Examples of such data include instructions for any application or method operating on the terminal device 600, contact data, phonebook data, messages, pictures, videos, etc. The memory 604 may be implemented by any type or combination of volatile and non-volatile memory devices 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 memory, flash memory, magnetic or optical disks.
The power supply component 606 provides power to the various components of the terminal device 600. The power components 606 may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for the terminal device 600.
The multimedia component 608 comprises a screen providing an output interface between the terminal device 600 and a user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 1308 includes a front facing camera and/or a rear facing camera. The front camera and/or the rear camera may receive external multimedia data when the terminal device 600 is in an operation mode, such as a photographing mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 610 is configured to output and/or input audio signals. For example, the audio component 610 includes a Microphone (MIC) configured to receive an external audio signal 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 signal may further be stored in the memory 604 or transmitted via the communication component 616. In some embodiments, audio component 610 further includes a speaker for outputting audio signals.
The I/O interface 612 provides an interface between the processing component 602 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor component 614 includes one or more sensors for providing various aspects of status assessment for the terminal device 600. For example, the sensor component 614 may detect an open/closed state of the terminal device 600, relative positioning of components such as a display and 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, orientation or acceleration/deceleration of the terminal device 600, and a change in temperature of the terminal device 600. The sensor assembly 614 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 614 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 614 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 616 is configured to facilitate communications between the terminal device 600 and other devices in a wired or wireless manner. The terminal device 600 may 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 exemplary embodiment, the communication component 616 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 616 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the terminal device 600 may 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 components for performing the methods described in any of the above embodiments.
In an exemplary embodiment, a non-transitory computer-readable storage medium comprising instructions, such as a memory comprising instructions, executable by a processor to perform the above-described method is also provided. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (10)

1. A multimedia file scanning method is applied to a terminal device, and is characterized by comprising the following steps:
when a multimedia file scanning request aiming at a multimedia database of a service provider on the equipment is received, determining a target file path set which needs to be scanned by the scanning request;
generating a plurality of final scanning tasks according to the target file path set; each final scanning task is used for indicating to scan the file under one target file path in the target file path set;
and 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.
2. The method of claim 1, wherein the scan request carries identification information; the determining a target file path set required to be scanned by the scanning request and generating a plurality of final scanning tasks according to the target file path set include:
according to the identification information, searching a processing strategy corresponding to the identification information from a preset corresponding relation between the identification information and the processing strategy; wherein the processing policy comprises a candidate file path set determination policy;
determining a strategy based on the candidate file path set, and determining a candidate file path set corresponding to the scanning request;
and comparing the current existing file path in the service provider multimedia database with the candidate file path set, determining a locally added or deleted target file path set, and generating the final scanning task based on the target file path set.
3. The method of claim 2, wherein determining a set of locally added or deleted target file paths and generating the final scan job based on the set of target file paths comprises:
and executing and determining a locally added or deleted target file path set in parallel based on a plurality of processing threads, and generating the final scanning task based on the target file path set.
4. The method of claim 3, wherein the processing policy further comprises a grouping policy; after determining the candidate file path set corresponding to the scan request, the method further includes:
dividing the set of candidate file paths into at least one group based on the grouping policy;
for each packet, generating an intermediate scanning task based on the packet;
the step of determining a locally added or deleted target file path set by adopting a plurality of processing threads to execute in parallel and generating the final scanning task based on the target file path set comprises the following steps:
processing each intermediate scanning task in parallel by adopting a plurality of processing threads; the process of processing the intermediate scanning task comprises the steps of comparing the current existing file path in the service provider multimedia database with the packet carried by the intermediate scanning task, determining a locally added or deleted target file path set, and generating the final scanning task based on the target file path set.
5. The method of claim 1, wherein the multimedia file scan request is generated upon detecting that an album application on the device is started or returned to the foreground;
and/or the presence of a gas in the gas,
the multimedia file scanning request is a multimedia file scanning request which is generated when a file creation notification reported by a third-party application is detected and aims at an android media database on the device;
and/or the presence of a gas in the gas,
the multimedia file scanning request is generated when detecting that an album application on the equipment creates a file.
6. The method of claim 1 or 4, further comprising:
before processing the scanning tasks, determining the priority of each scanning task;
a process for processing a scan job, comprising:
and processing the scanning task according to the priority.
7. A multimedia file scanner device, which is applied to a terminal device, comprises a generation module and a processing module, wherein,
the generation module is used for determining a target file path set required to be scanned by a scanning request when the scanning request of a multimedia file of a service provider multimedia database on the equipment is received;
the generating module is further configured to generate a plurality of final scanning tasks according to the target file path set; each final scanning task is used for indicating to scan the file under one target file path in the target file path set;
and the processing module is used for 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.
8. The apparatus of claim 7, wherein the scan request carries identification information; the generating module comprises a searching unit, a determining unit and a processing unit, wherein,
the searching unit is used for searching a processing strategy corresponding to the identification information from the preset corresponding relation between the identification information and the processing strategy according to the identification information; wherein the processing policy comprises a candidate file path set determination rule;
the determining unit is configured to determine a candidate file path set corresponding to the scanning request based on the candidate file path set determination rule;
and the processing unit is used for comparing the current existing file path in the multimedia database of the service provider with the candidate file path set, determining a locally added or deleted target file path set, and generating the final scanning task based on the target file path set.
9. A terminal device, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to implement the method of any one of claims 1 to 6.
10. A computer-readable storage medium, on which a computer program is stored, which program, when being executed by a processor, is adapted to carry out the method of any one of claims 1 to 6.
CN202011501632.8A 2020-12-17 2020-12-17 Multimedia file scanning method and device and terminal equipment Pending CN114647746A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011501632.8A CN114647746A (en) 2020-12-17 2020-12-17 Multimedia file scanning method and device and terminal equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011501632.8A CN114647746A (en) 2020-12-17 2020-12-17 Multimedia file scanning method and device and terminal equipment

Publications (1)

Publication Number Publication Date
CN114647746A true CN114647746A (en) 2022-06-21

Family

ID=81989865

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011501632.8A Pending CN114647746A (en) 2020-12-17 2020-12-17 Multimedia file scanning method and device and terminal equipment

Country Status (1)

Country Link
CN (1) CN114647746A (en)

Similar Documents

Publication Publication Date Title
CN107370772B (en) account login method and device and computer readable storage medium
CN104462296B (en) File management method and device and terminal
CN106547547B (en) data acquisition method and device
EP3239858A1 (en) Method and apparatus for searching resource
CN106339260B (en) Task allocation method and device based on Jenkins platform
CN107402767B (en) Method and device for displaying push message
CN109684112B (en) Program file operation method, device, terminal and storage medium
CN110704030A (en) Interface configuration information generation method and device, electronic equipment and storage medium
CN106506808B (en) Method and device for prompting communication message
CN107463419B (en) Application restarting method and device and computer readable storage medium
CN107885464B (en) Data storage method, device and computer readable storage medium
CN112883073B (en) Data screening method, device, equipment, readable storage medium and product
CN114430370B (en) Method, device, equipment and storage medium for determining network slice
CN105873154B (en) Network access method and device
CN114647746A (en) Multimedia file scanning method and device and terminal equipment
CN110457084B (en) Loading method and device
CN108811080B (en) Method, device and storage medium for cell registration
CN111724398A (en) Image display method and device
CN111625329A (en) Task allocation method and device, electronic equipment, server and storage medium
CN110311968B (en) Method and device for loading file in streaming mode and intelligent equipment
US20210092742A1 (en) Method and device for accessing 5g network, and non-transitory computer readable storage medium
CN110995767B (en) Request processing method and device
CN111241134B (en) Data processing method and device
CN111625251B (en) Method and device for processing application instance
CN115002227B (en) User access request response method, storage medium 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