CN115658130A - Resource scanning method and device, computer equipment and readable storage medium - Google Patents

Resource scanning method and device, computer equipment and readable storage medium Download PDF

Info

Publication number
CN115658130A
CN115658130A CN202211392754.7A CN202211392754A CN115658130A CN 115658130 A CN115658130 A CN 115658130A CN 202211392754 A CN202211392754 A CN 202211392754A CN 115658130 A CN115658130 A CN 115658130A
Authority
CN
China
Prior art keywords
scanning
file
target
handle
script
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
CN202211392754.7A
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.)
Shenzhen Yishi Huolala Technology Co Ltd
Original Assignee
Shenzhen Yishi Huolala Technology 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 Shenzhen Yishi Huolala Technology Co Ltd filed Critical Shenzhen Yishi Huolala Technology Co Ltd
Priority to CN202211392754.7A priority Critical patent/CN115658130A/en
Publication of CN115658130A publication Critical patent/CN115658130A/en
Pending legal-status Critical Current

Links

Images

Abstract

The application provides a resource scanning method, a resource scanning device, a computer device and a readable storage medium. The method comprises the following steps: executing the scanning script; performing recursive scanning on a target type file quoted in a target item according to the scanning script and the handle matching rule to obtain a handle set text; performing recursive scanning on all target type files in the target project according to the scanning script to obtain a file name set; based on the handle set text and the file name set, a resource scan result is determined. According to the method and the device, the project can be automatically and statically scanned only through the preset matching rule and the preset scanning script, so that resource files of any unused file types in the project can be rapidly and effectively scanned, subsequent developers can conveniently reduce the file size or memory occupation of project products, and the performance of an application system is effectively improved.

Description

Resource scanning method and device, computer equipment and readable storage medium
Technical Field
The present application relates to the field of computer application technologies, and in particular, to a resource scanning method, an apparatus, a computer device, and a readable storage medium.
Background
In computer technology, an application system completes corresponding tasks mainly by referring to different resource files, for example, application system resource files such as picture resources and animation resources which are related to starting a mobile phone application need to be referred to. However, with the update iteration of the service, the application has new functions on-line and old functions off-line continuously. The old function is offline, but the old code and related resources are not deleted in time for various reasons, so that redundant code or useless resources in the application are increased. Not only does the user need more traffic when downloading the application, but also the application system is stuck, unsmooth redundant resources are generated, and the maintenance cost of the subsequent developer is higher and higher.
In the prior art, useless resources or files in a resource system are mainly searched and searched manually, however, the manual searching mode needs workers familiar with services and codes to complete, the workers judge and search the useless resources in the system according to system development experience, application requirements and the like, the technical threshold of the workers is required to be high, the required time cost is also high, and the manual searching mode also has the problem of inaccurate judgment caused by subjectivity. Therefore, a garbage scan method capable of solving the drawbacks is needed.
The foregoing description is provided for general background information and is not admitted to be prior art.
Disclosure of Invention
In view of the above technical problems, the present application provides a resource scanning method, apparatus, computer device and readable storage medium, which can perform static scanning on a project only by a predefined matching rule and scanning script, so as to quickly and effectively scan out resource files of any unused file type in the project.
In order to solve the above technical problem, the present application provides a resource scanning method, including the following steps:
executing a pre-written scanning script;
performing recursive scanning on the target type file quoted in the target item according to the scanning script and the handle matching rule to obtain a handle set text;
performing recursive scanning on all target type files in the target project according to the scanning script to obtain a file name set;
and determining a resource scanning result based on the handle set text and the file name set.
Optionally, the recursively scanning, according to the scanning script and the handle matching rule, a target type file referenced in the target item to obtain a handle set text includes:
recursively scanning the target files of the reference target type files in the target items according to the scanning script to obtain a corresponding target file set;
and performing handle matching on each target file in the target file set based on the handle matching rule to obtain a handle set text.
Optionally, the obtaining, according to the scanning script, a file name set after recursively scanning all the target type files in the target project includes:
recursively scanning all target type files in the target project according to the scanning script;
and intercepting the file name corresponding to each target type file to obtain a file name set.
Optionally, the determining a resource scanning result based on the handle set text and the file name set includes:
matching each file name in the file name set based on the handle set text to obtain a corresponding matching result;
and determining a resource scanning result according to the matching result.
Optionally, the determining a resource scanning result according to the matching result includes:
if any handle file of the handle set text does not contain any file name in the file name set, adding a path corresponding to the handle file to an unused file;
and if any handle file of the handle set text contains any file name in the file name set, adding a path corresponding to the handle file to the used file.
Optionally, if the target file type is a picture type and includes a number, the method further includes:
and adding a path corresponding to the target file which refers to the target type file in the target project into the to-be-confirmed use file.
Optionally, the resource scanning method further includes:
and acquiring script parameters, and compiling a scanning script based on the script parameters.
And determining a corresponding handle matching rule according to the mode of referring to the target file in the target item.
Correspondingly, an embodiment of the present application further provides a resource scanning apparatus, including:
the script execution module is used for executing a pre-written scanning script;
the first scanning module is used for carrying out recursive scanning on a target type file quoted in a target project according to the scanning script and the handle matching rule to obtain a handle set text;
the second scanning module is used for carrying out recursive scanning on all target type files in the target project according to the scanning script to obtain a file name set;
and the result output module is used for determining a resource scanning result based on the handle set text and the file name set.
The present application further proposes a computer device comprising a memory and a processor, the memory storing a computer program, the processor implementing the steps of the resource scanning method according to any one of the above when executing the computer program.
The present application also proposes a computer-readable storage medium having stored thereon a computer program which, when being executed by a processor, carries out the steps of the resource scanning method according to any one of the preceding claims.
The embodiment of the invention has the following beneficial effects:
as described above, the present application provides a resource scanning method, apparatus, computer device, and readable storage medium, where the method includes: firstly, executing a scanning script; then, according to the scanning script and the handle matching rule, carrying out recursive scanning on the target type file quoted in the target item to obtain a handle set text; then, according to the scanning script, carrying out recursive scanning on all target type files in the target project to obtain a file name set; finally, a resource scan result is determined based on the handle set text and the file name set. According to the resource scanning scheme, the project can be automatically and statically scanned only through the preset matching rule and the scanning script, so that resource files of any unused file types in the project can be rapidly and effectively scanned, subsequent developers can conveniently reduce the file size or memory occupation of project products, and the performance of an application system is effectively improved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and together with the description, serve to explain the principles of the application. In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the description of the embodiments will be briefly described below, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a schematic flowchart of a first implementation of a resource scanning method provided in an embodiment of the present application;
fig. 2 is a schematic flowchart of a second implementation manner of a resource scanning method provided in an embodiment of the present application;
fig. 3 is a schematic structural diagram of a resource scanning apparatus according to an embodiment of the present application;
fig. 4 is a block diagram schematically illustrating a structure of a computer device according to an embodiment of the present disclosure.
The implementation, functional features and advantages of the objectives of the present application will be further explained with reference to the accompanying drawings. With the above figures, there are shown specific embodiments of the present application, which will be described in more detail below. These drawings and written description are not intended to limit the scope of the inventive concepts in any manner, but rather to illustrate the inventive concepts to those skilled in the art by reference to specific embodiments.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. The following description refers to the accompanying drawings in which the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising a … …" does not exclude the presence of additional like elements in a process, method, article, or apparatus that comprises the element, and further, components, features, elements, and/or steps that may be similarly named in various embodiments of the application may or may not have the same meaning, unless otherwise specified by its interpretation in the embodiment or by context with further embodiments.
It should be understood that although the terms first, second, third, etc. may be used herein to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope herein. The word "if," as used herein, may be interpreted as "at … …" or "at … …" or "in response to a determination," depending on the context. Also, as used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context indicates otherwise. It will be further understood that the terms "comprises," "comprising," "includes" and/or "including," when used in this specification, specify the presence of stated features, steps, operations, elements, components, items, species, and/or groups, but do not preclude the presence, or addition of one or more other features, steps, operations, elements, components, species, and/or groups thereof. The terms "or," "and/or," "including at least one of the following," and the like, as used herein, are to be construed as inclusive or mean any one or any combination. For example, "includes at least one of: A. b, C "means" any of the following: a; b; c; a and B; a and C; b and C; a and B and C ", further for example," A, B or C "or" A, B and/or C "means" any of the following: a; b; c; a and B; a and C; b and C; a and B and C'. An exception to this definition will occur only when a combination of elements, functions, steps or operations are inherently mutually exclusive in some way.
It should be understood that, although the steps in the flowcharts in the embodiments of the present application are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and may be performed in other orders unless explicitly stated herein. Moreover, at least some of the steps in the figures may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, in different orders, and may be performed alternately or partially with other steps or at least some of the sub-steps or stages of other steps.
The words "if", as used herein, may be interpreted as "at … …" or "at … …" or "in response to a determination" or "in response to a detection", depending on the context. Similarly, the phrases "if determined" or "if detected (a stated condition or event)" may be interpreted as "when determined" or "in response to a determination" or "when detected (a stated condition or event)" or "in response to a detection (a stated condition or event)", depending on the context.
It should be noted that step numbers such as S1 and S2 are used herein for the purpose of more clearly and briefly describing the corresponding contents, and do not constitute a substantial limitation on the sequence, and those skilled in the art may perform S2 first and then S1 in the specific implementation, but these should be within the scope of the present application.
It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
In the following description, suffixes such as "module", "component", or "unit" used to denote elements are used only for the convenience of description of the present application, and have no specific meaning in themselves. Thus, "module", "component" or "unit" may be used mixedly.
The embodiment of the application can be applied to a server, and the server can be an independent server, and can also be a cloud server providing basic cloud computing services such as cloud service, a cloud database, cloud computing, a cloud function, cloud storage, network service, cloud communication, middleware service, domain name service, security service, content Delivery Network (CDN), big data and artificial intelligence platform and the like.
First, an application scenario that can be provided by the present application is introduced, for example, a resource scanning method, an apparatus, a computer device, and a readable storage medium are provided, which can quickly and effectively scan out resource files of any file type that are not used in a project, and facilitate subsequent developers to manage the unused resource files, for example, delete useless resources in the project, reduce the size of project products, and thereby effectively improve the performance of an application system.
Referring to fig. 1, fig. 1 is a flowchart illustrating a resource scanning method according to a first implementation manner of the present application. The resource scanning method may specifically include:
s1, executing a pre-written scanning script.
Specifically, in step S1, a path of a designated item to be scanned is input, and execution of a scan script written in advance is started. The scanning script can be a cross-platform supporting script such as a Shell language script or a Python language script.
Optionally, as shown in fig. 2, in some embodiments, the resource scanning method may further include:
s101, acquiring script parameters and compiling a scanning script based on the script parameters.
S102, determining a corresponding handle matching rule according to the mode of referring to the target file in the target item.
Specifically, before step S1, the resource scanning method of this embodiment may further include writing a scanning script and writing a handle matching rule. Firstly, acquiring corresponding script parameters according to the type of a script writing language, and writing a scanning script of a scanning project according to the script parameters, wherein when a Shell language script is adopted, for example, the script parameters are paths of specified projects needing to be scanned; and then writing a corresponding handle matching rule according to the mode of applying the target file in the specified project.
And S2, carrying out recursive scanning on the target type file quoted in the target item according to the scanning script and the handle matching rule to obtain a handle set text.
Specifically, for step S2, a scanning script is executed, all files that may refer to a target type file in the target item are recursively scanned, based on a handle matching rule, a handle that matches the handle matching rule in each file is additionally written into a handle file, and finally, all handle files are aggregated into a handle aggregation text.
Optionally, in some embodiments, step S2 may specifically include:
s21, recursively scanning a target file of a reference target type file in a target item according to a scanning script to obtain a corresponding target file set;
and S22, based on the handle matching rule, carrying out handle matching on each target file in the target file set to obtain a handle set text.
Specifically, in this embodiment, regarding step S2, first, recursively scan all target files that may be referred to as a target type in the specified target items according to the scan script, for example, if the iOS items are h,. M,. Xib files, so as to obtain a plurality of target files, and aggregate the plurality of target files into one target file set; then, based on a handle matching rule, performing handle matching on each target file in the target file set, and additionally writing a handle matched with the handle matching rule in the target file into a corresponding handle file, for example, if the picture introducing mode is @ 'and < image name =, writing handles of @' and < image name = into the handle file; and finally, aggregating all handle files into a handle aggregate text.
And S3, carrying out recursive scanning on all target type files in the target project according to the scanning script to obtain a file name set.
Specifically, in step S3, all the target type files in the specified target item that meet the current scanning are recursively scanned according to the scanning script, so as to obtain all the target files that match the target type file of the current scanning, and the file name of the matched target files is intercepted, so as to obtain a file name set.
Optionally, in some embodiments, step S3 may specifically include:
s31, recursively scanning all target type files in the target project according to the scanning script;
and S32, intercepting the file name corresponding to each target type file to obtain a file name set.
Specifically, after the scanning script is executed, all the target type files in the specified target project are recursively scanned, and the file name corresponding to each target type file is intercepted, so that a file name set is collected. The file name may be intercepted by extracting the file name of the target type file according to a preset interception rule, which is not specifically limited herein.
And S4, determining a resource scanning result based on the handle set text and the file name set.
Specifically, for step S4, the handle set text obtained in step S2 is mainly matched with the file name set obtained in step S3, so as to output a final resource scanning result.
Optionally, in some embodiments, step S4 may specifically include:
s41, matching each file name in the file name set based on the handle set text to obtain a corresponding matching result;
and S42, determining a resource scanning result according to the matching result.
Specifically, in the handle set text, each file name in the file name set is searched and matched, whether any file name in the file name set can be searched in the handle set text or not is judged, so that a corresponding matching result is obtained, and finally, the resource scanning result of this time is output according to the matching results corresponding to all the file names.
Optionally, in some embodiments, step S42 may specifically include:
if any handle file of the handle set text does not contain any file name in the file name set, adding a path corresponding to the handle file to an unused file;
and if any handle file of the handle set text contains any file name in the file name set, adding a path corresponding to the handle file to the used file.
Specifically, if any handle file in the handle set text does not contain any file name in the file name set, it may be determined that the resource file is not used, and the resource file path corresponding to the handle file is additionally written into the unused text file; if any handle file in the handle set text contains any file name in the file name set, the resource file can be determined to be used, and the resource file path corresponding to the handle file is additionally written into the used text file.
Optionally, in some embodiments, if the target file type is a picture type and includes a number, the resource scanning method further includes:
and S43, adding a path corresponding to the target file which refers to the target type file in the target item into the to-be-confirmed use file.
Specifically, since a large number of pictures may be introduced by using string splicing numbers in the target project to generate an animation effect, if the matched target file type is a picture type and has numbers, it may be determined that the resource file may be used, and the resource file path is additionally written into the text file to be confirmed, so that the subsequent developer may perform secondary confirmation to ensure that the resource file is not mistakenly deleted.
As can be seen, the output outcome of the present embodiment after scanning the specified item includes, but is not limited to: outputting a file containing all the path sets of the unused target type files, outputting a file containing all the path sets of the target type files which are uncertain whether to be used or not, and outputting a file containing all the path sets of the used target type files.
In addition, after the path set is output, traversal can be performed on the basis to effectively manage the resource files, for example, useless resources are deleted based on the files of the path set including all unused target type files, so that the unused resources in the target project can be quickly and accurately deleted, and the size of the project is reduced; or based on the text of the path set containing all the target type files which are uncertain to be used or not, the used pictures are compressed, the size of the project is further reduced, and the performance of the application system is improved.
In a specific embodiment, a specific implementation of the resource scanning method is further provided, and the specific steps are as follows: inputting a specified project path and starting to execute a scanning script; determining a handle matching rule according to the introduction mode of the target file in the project file; recursively scanning all files (such as h, m, xib files in the iOS project) which are possibly referred to a target type, adding handles matched with rules in each file to write into a txt file, and finally obtaining a text containing a handle set; recursively scanning all target type files in the project, intercepting file names, and searching file name character strings in a handle set text; if the file can be found, the file is used, and the file path is additionally written into the use.txt; if the search is not available, the file is not used, and the file path is additionally written into unused. The project possibly adopts character string splicing digits to introduce a plurality of pictures to generate animation effects (such as an iOS project and an android project), so if the project is matched to be of a picture type and carries the digits, the file can be determined to be possibly used, the file path is additionally written into a maybe _ used.
Compared with the prior art, the resource scanning method provided by the embodiment of the application can quickly and effectively scan unused resource files in the designated project only by drawing up the scanning matching rules and the scanning scripts, and the type of the target file is not limited, so that the scanning of all types of resource files can be supported; cross-project scanning is supported, and the cross-project scanning can be supported only by determining a handle matching rule and a target file matching rule; the cross-platform supporting effect is realized by adopting a script supporting the cross-platform (such as Shell language and Python language); because the scheme belongs to static scanning of the designated items, the designated items can be quickly scanned without depending on the operation of the items, and the output products after scanning include but are not limited to files containing unused target file full-path sets, files containing used target file full-path sets and files containing target file full-path sets which may be used; after the path set is output, traversal can be performed on the basis, namely, unused resources in the project can be deleted, and the size of the project is reduced; after the paths are collected, traversal can be performed on the basis, the used pictures are compressed, the size of the project is reduced, and the performance of an application system is improved.
As can be seen from the above, the resource scanning method provided in the embodiment of the present application includes: executing the scanning script; performing recursive scanning on a target type file quoted in a target item according to the scanning script and the handle matching rule to obtain a handle set text; performing recursive scanning on all target type files in the target project according to the scanning script to obtain a file name set; based on the handle set text and the file name set, a resource scan result is determined. According to the resource scanning method, the project can be automatically and statically scanned only through the preset matching rule and the scanning script, so that the resource files of any unused file types in the project can be rapidly and effectively scanned, subsequent developers can conveniently reduce the file size or memory occupation of project products, and the performance of an application system is effectively improved.
Correspondingly, the present application further provides a resource scanning apparatus, please refer to fig. 3, fig. 3 is a schematic structural diagram of the resource scanning apparatus provided in the present application, and specifically, the resource scanning apparatus may include a script execution module 100, a first scanning module 200, a second scanning module 300, and a result output module 400.
The script execution module 100 is configured to execute a pre-programmed scan script.
Specifically, the script execution module 100 inputs a path of a designated item to be scanned, and starts executing a scan script written in advance. The scanning script can be a cross-platform supporting script such as a Shell language script or a Python language script.
Optionally, in some embodiments, the script execution module 100 may further include:
and the script compiling submodule is used for acquiring script parameters and compiling the scanning script based on the script parameters.
And the rule drawing sub-module is used for determining the corresponding handle matching rule according to the mode of referring to the target file in the target project.
The first scanning module 200 is configured to perform recursive scanning on a target type file referenced in a target item according to a scanning script and a handle matching rule, so as to obtain a handle set text.
Specifically, for the first scanning module 200, a scanning script is executed, all files that may refer to a target type file in a target item are recursively scanned, based on a handle matching rule, a handle that matches the handle matching rule in each file is additionally written into a handle file, and finally, all handle files are assembled into a handle assembly text.
Optionally, in some embodiments, the first scanning module 200 may specifically include:
the first scanning submodule is used for recursively scanning a target file of a reference target type file in a target project according to a scanning script to obtain a corresponding target file set;
and the handle matching submodule is used for carrying out handle matching on each target file in the target file set based on the handle matching rule to obtain a handle set text.
The second scanning module 300 is configured to perform recursive scanning on all target type files in the target item according to the scanning script to obtain a file name set.
Specifically, for the second scanning module 300, all the target type files meeting the current scanning in the specified target items are recursively scanned according to the scanning script, so as to obtain all the target files matching the target type files of the current scanning, and the file name of the matched target files is intercepted, so as to obtain the file name set.
Optionally, in some embodiments, the second scanning module 300 may specifically include:
the second scanning submodule is used for recursively scanning all the target type files in the target project according to the scanning script;
and the file name intercepting submodule is used for intercepting the file name corresponding to each target type file to obtain a file name set.
And a result output module 400, configured to determine a resource scanning result based on the handle set text and the file name set.
Specifically, for step S4, the handle set text and the file name set are mainly matched, so as to output a final resource scanning result.
Optionally, in some embodiments, the result output module 400 may specifically include:
the first matching submodule is used for matching each file name in the file name set based on the handle set text to obtain a corresponding matching result;
and the result output submodule is used for determining a resource scanning result according to the matching result.
To sum up, the resource scanning apparatus provided in the embodiment of the present application executes the pre-programmed scanning script through the script execution module 100; performing recursive scanning on a target type file quoted in a target item through the first scanning module 200 according to the scanning script and the handle matching rule to obtain a handle set text; performing recursive scanning on all target type files in the target project through the second scanning module 300 according to the scanning script to obtain a file name set; the resource scan result is determined by the result output module 400 based on the handle set text and the file name set.
Therefore, the resource scanning device of the embodiment of the application can automatically and statically scan the project only through the preset matching rule and the scanning script, so that the resource files of any unused file types in the project can be quickly and effectively scanned, the subsequent developers can conveniently reduce the file size or the memory occupation of the project product, and the performance of the application system can be effectively improved.
Referring to fig. 4, a computer device, which may be a server and whose internal structure may be as shown in fig. 4, is also provided in the embodiment of the present application. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the computer designed processor is used to provide computational and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used for storing data such as resource scanning methods and the like. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a resource scanning method. The resource scanning method comprises the following steps: executing the scanning script; performing recursive scanning on a target type file quoted in a target item according to the scanning script and the handle matching rule to obtain a handle set text; performing recursive scanning on all target type files in the target project according to the scanning script to obtain a file name set; based on the handle set text and the file name set, a resource scan result is determined.
An embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, the computer program, when executed by a processor, implementing a resource scanning method, including the steps of: executing the scanning script; performing recursive scanning on a target type file quoted in a target item according to the scanning script and the handle matching rule to obtain a handle set text; performing recursive scanning on all target type files in the target project according to the scanning script to obtain a file name set; based on the handle set text and the file name set, a resource scan result is determined.
According to the executed resource scanning method, the project can be automatically and statically scanned only through the preset matching rule and the scanning script, so that the resource files of any unused file types in the project can be rapidly and effectively scanned, the subsequent developers can conveniently reduce the file size or the memory occupation of project products, and the performance of an application system is effectively improved.
It is to be understood that the foregoing scenarios are only examples, and do not constitute a limitation on application scenarios of the technical solutions provided in the embodiments of the present application, and the technical solutions of the present application may also be applied to other scenarios. For example, as can be known by those skilled in the art, with the evolution of system architecture and the emergence of new service scenarios, the technical solution provided in the embodiments of the present application is also applicable to similar technical problems.
The above-mentioned serial numbers of the embodiments of the present application are merely for description and do not represent the merits of the embodiments.
The steps in the method of the embodiment of the application can be sequentially adjusted, combined and deleted according to actual needs.
The units in the device of the embodiment of the application can be combined, divided and deleted according to actual needs.
In the present application, the same or similar term concepts, technical solutions and/or application scenario descriptions will be generally described only in detail at the first occurrence, and when the description is repeated later, the detailed description will not be repeated in general for brevity, and when understanding the technical solutions and the like of the present application, reference may be made to the related detailed description before the description for the same or similar term concepts, technical solutions and/or application scenario descriptions and the like which are not described in detail later.
In the present application, each embodiment is described with emphasis, and reference may be made to the description of other embodiments for parts that are not described or illustrated in any embodiment.
All possible combinations of the technical features in the embodiments are not described in the present application for the sake of brevity, but should be considered as the scope of the present application as long as there is no contradiction between the combinations of the technical features.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, a controlled terminal, or a network device) to execute the method of each embodiment of the present application.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. The procedures or functions according to the embodiments of the present application are all or partially generated when the computer program instructions are loaded and executed on a computer. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored on a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (e.g., coaxial cable, fiber optic, digital subscriber line) or wirelessly (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, storage Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid State Disk (SSD)), among others.
The above description is only a preferred embodiment of the present application, and not intended to limit the scope of the present application, and all modifications of equivalent structures and equivalent processes, which are made by the contents of the specification and the drawings of the present application, or which are directly or indirectly applied to other related technical fields, are included in the scope of the present application.

Claims (10)

1. A resource scanning method is characterized by comprising the following steps:
executing a pre-written scanning script;
performing recursive scanning on the target type file quoted in the target item according to the scanning script and the handle matching rule to obtain a handle set text;
performing recursive scanning on all target type files in the target project according to the scanning script to obtain a file name set;
and determining a resource scanning result based on the handle set text and the file name set.
2. The resource scanning method according to claim 1, wherein the recursively scanning the target type files referenced in the target item according to the scanning script and the handle matching rule to obtain a handle set text comprises:
recursively scanning the target files of the reference target type files in the target items according to the scanning script to obtain a corresponding target file set;
and based on the handle matching rule, carrying out handle matching on each target file in the target file set to obtain a handle set text.
3. The resource scanning method according to claim 1, wherein said recursively scanning all target type files in a target project according to the scanning script to obtain a file name set comprises:
recursively scanning all target type files in the target project according to the scanning script;
and intercepting the file name corresponding to each target type file to obtain a file name set.
4. The method according to claim 1, wherein said determining a resource scanning result based on the handle set text and the file name set comprises:
matching each file name in the file name set based on the handle set text to obtain a corresponding matching result;
and determining a resource scanning result according to the matching result.
5. The resource scanning method according to claim 4, wherein said determining a resource scanning result according to the matching result comprises:
if any handle file of the handle set text does not contain any file name in the file name set, adding a path corresponding to the handle file to an unused file;
and if any handle file of the handle set text contains any file name in the file name set, adding a path corresponding to the handle file to the used file.
6. The resource scanning method of claim 1, wherein if the target file type is a picture type and contains numbers, the method further comprises:
and adding a path corresponding to the target file which refers to the target type file in the target project into the to-be-confirmed use file.
7. The resource scanning method according to any one of claims 1 to 6, further comprising:
and acquiring script parameters, and compiling a scanning script based on the script parameters.
And determining a corresponding handle matching rule according to the mode of referring to the target file in the target item.
8. An apparatus for resource scanning, comprising:
the script execution module is used for executing a pre-written scanning script;
the first scanning module is used for carrying out recursive scanning on a target type file quoted in a target project according to the scanning script and the handle matching rule to obtain a handle set text;
the second scanning module is used for carrying out recursive scanning on all target type files in the target project according to the scanning script to obtain a file name set;
and the result output module is used for determining a resource scanning result based on the handle set text and the file name set.
9. A computer device comprising a memory and a processor, the memory storing a computer program, wherein the processor when executing the computer program performs the steps of the resource scanning method according to any of claims 1 to 7.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the resource scanning method according to any one of claims 1 to 7.
CN202211392754.7A 2022-11-08 2022-11-08 Resource scanning method and device, computer equipment and readable storage medium Pending CN115658130A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211392754.7A CN115658130A (en) 2022-11-08 2022-11-08 Resource scanning method and device, computer equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211392754.7A CN115658130A (en) 2022-11-08 2022-11-08 Resource scanning method and device, computer equipment and readable storage medium

Publications (1)

Publication Number Publication Date
CN115658130A true CN115658130A (en) 2023-01-31

Family

ID=85016687

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211392754.7A Pending CN115658130A (en) 2022-11-08 2022-11-08 Resource scanning method and device, computer equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN115658130A (en)

Similar Documents

Publication Publication Date Title
CN109814854B (en) Project framework generation method, device, computer equipment and storage medium
CN111563220A (en) Business website project construction method and device, computer equipment and storage medium
US10261772B2 (en) Method and device for generating image file
CN109359194B (en) Method and apparatus for predicting information categories
CN111324619A (en) Object updating method, device, equipment and storage medium in micro service system
US11494552B2 (en) System and method for implementing smart business intelligence testing tools
CN105094857A (en) Method and system used for loading applications
CN110505289B (en) File downloading method and device, computer readable medium and wireless communication equipment
CN117009248A (en) Machine learning model testing method and device, electronic equipment and storage medium
CN113468446B (en) Method, system and equipment for supporting identification of third party two-dimensional code data
US8615744B2 (en) Methods and system for managing assets in programming code translation
CN116071590A (en) Model training method, system, computer device and storage medium
CN115658130A (en) Resource scanning method and device, computer equipment and readable storage medium
US9996799B2 (en) Migrating a legacy system by inferring context-sensitive business rules from legacy source code
CN115390944A (en) Algorithm service calling method and device, electronic equipment and storage medium
CN113821249A (en) Project development configuration method and device, electronic equipment and readable storage medium
CN112417259B (en) Media resource processing method, device, equipment and storage medium
CN112130860A (en) JSON object analysis method and device, electronic device and storage medium
CN111158654A (en) Algorithm calling method, device, server and storage medium
CN112799797A (en) Task management method and device
CN116501365B (en) Resource calling method, device and equipment based on algorithm platform
CN113760921A (en) Method and device for creating dictionary value
CN117454038A (en) Page detection method and device
CN112394909A (en) Operation instruction generation method, device, equipment and storage medium based on cloud function
CN114924809A (en) Streaming micro-service loading verification method based on DEX file class

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