CN111459887B - Resource screening method and device, electronic equipment and storage medium - Google Patents

Resource screening method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN111459887B
CN111459887B CN202010235118.8A CN202010235118A CN111459887B CN 111459887 B CN111459887 B CN 111459887B CN 202010235118 A CN202010235118 A CN 202010235118A CN 111459887 B CN111459887 B CN 111459887B
Authority
CN
China
Prior art keywords
resource
code
file
name
resource file
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.)
Active
Application number
CN202010235118.8A
Other languages
Chinese (zh)
Other versions
CN111459887A (en
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 Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and 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 Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202010235118.8A priority Critical patent/CN111459887B/en
Publication of CN111459887A publication Critical patent/CN111459887A/en
Application granted granted Critical
Publication of CN111459887B publication Critical patent/CN111459887B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/14Details of searching files based on file metadata
    • G06F16/148File search processing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • G06F16/162Delete operations
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/20Software design
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

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

Abstract

The application discloses a resource screening method, a resource screening device, electronic equipment and a storage medium, and relates to the field of resource management. The specific implementation scheme is as follows: acquiring at least one resource code and at least one resource file; for each resource file in the at least one resource file, determining that the resource file is a useless resource if the at least one resource code does not use the resource file; and for the first resource code in the at least one resource code, if the name of the resource in the first resource code is different from the name of the folder in which the resource file is located, determining that the resource file is not used by the first resource code. The embodiment of the application can improve the accuracy of screening the useless resources.

Description

Resource screening method and device, electronic equipment and storage medium
Technical Field
The present application relates to the field of data processing, and in particular, to the field of resource management.
Background
In general, in application development engineering, a large number of resource files, such as pictures, animations, text, audio, etc., for presentation to a user are used. With the developer modifying the application, some resource files in the application may have not been used, but are still stored in the engineering file library. The redundant resource files increase the data volume of the engineering file library and influence various performance indexes of engineering development. The prior art lacks a method for accurately screening out unused resource files.
Disclosure of Invention
The embodiment of the application provides a resource screening method, which comprises the following steps:
acquiring at least one resource code and at least one resource file;
for each resource file in the at least one resource file, determining that the resource file is a useless resource if the at least one resource code does not use the resource file; and for the first resource code in the at least one resource code, if the name of the resource in the first resource code is different from the name of the folder in which the resource file is located, determining that the resource file is not used by the first resource code.
The embodiment of the application also provides a resource screening device, which comprises:
the first acquisition module is used for acquiring at least one resource code and at least one resource file;
the determining module is used for determining that the resource file is a useless resource for each resource file in the at least one resource file under the condition that the at least one resource code does not use the resource file; and for the first resource code in the at least one resource code, if the name of the resource in the first resource code is different from the name of the folder in which the resource file is located, determining that the resource file is not used by the first resource code.
The embodiment of the application also provides electronic equipment, which comprises:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein, the liquid crystal display device comprises a liquid crystal display device,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform any one of the resource screening methods of the embodiments of the present application.
The embodiment of the application also provides a non-transitory computer readable storage medium storing computer instructions for causing a computer to execute any one of the resource screening methods of the embodiment of the application.
One embodiment of the above application has the following advantages or benefits: the embodiment of the application realizes the screening of useless resources by determining whether the resource file is used by the resource code. In determining whether the resource file is used by the resource code, if the name of the resource in the first resource code is different from the name of the folder in which the resource file is located, it is determined that the resource file is not used by the first resource code. Even though the resource name in the first resource code may be different from the name of the actually used resource file, whether the resource file is used by the first resource code can be accurately determined, and the accuracy of screening the useless resource is improved.
Other effects of the above alternative will be described below in connection with specific embodiments.
Drawings
The drawings are included to provide a better understanding of the present application and are not to be construed as limiting the application. Wherein:
FIG. 1 is a schematic flow chart diagram of a resource screening method according to an embodiment of the application;
FIG. 2 is a schematic flow chart of a resource screening method according to another embodiment of the application;
FIG. 3 is a schematic diagram of a resource screening method according to yet another embodiment of the present application;
FIG. 4 is a schematic diagram of an interactive interface in a resource screening method according to yet another embodiment of the present application;
FIG. 5 is a schematic diagram of a resource screening apparatus according to an embodiment of the present application;
FIG. 6 is a schematic diagram of a resource screening apparatus according to another embodiment of the present application;
FIG. 7 is a block diagram of an electronic device for implementing a resource screening method of an embodiment of the present application.
Detailed Description
Exemplary embodiments of the present application will now be described with reference to the accompanying drawings, in which various details of the embodiments of the present application are included to facilitate understanding, and are to be considered merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the application. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
In an engineering file library for storing various types of files of an application development engineering, redundant resources include, but are not limited to, unused resource files and/or duplicate resource files. One way to screen for unused resource files is: and determining whether the resource file is used by the code according to whether the code contains the name of the resource file, so as to screen out unused resource files.
However, the resource name used in the code may not coincide with the name of the resource file used, depending on factors such as the work habit of the developer, the demands of different development stages, and the like. For example, for a resource file with a suffix jpg, png, tif or other picture type, the developer may drag the resource file into the engineering file library. And automatically generating a folder with the same name as the resource file in the engineering file library, so that the folder contains the resource file. In the code, the name of the folder is used to be associated with the resource file in the folder, so that the code can call the resource file. However, some developers rename automatically generated folders in engineering file libraries, resulting in inconsistent names in code and names of the actually used resource files. Based on this, by identifying whether the name of the resource file is contained in the code, it is not possible to accurately determine whether the resource file is used by the code.
FIG. 1 is a schematic flow chart of a resource screening method according to an embodiment of the present application. The method comprises the following steps:
step S11, at least one resource code and at least one resource file are acquired;
step S12, for each resource file in at least one resource file, determining the resource file as a useless resource under the condition that the at least one resource file is not used by the at least one resource code; and for the first resource code in the at least one resource code, if the name of the resource in the first resource code is different from the name of the folder in which the resource file is located, determining that the resource file is not used by the first resource code.
The embodiment of the application realizes the screening of useless resources by determining whether the resource file is used by the resource code. In determining whether the resource file is used by the resource code, if the name of the resource in the first resource code is different from the name of the folder in which the resource file is located, it is determined that the resource file is not used by the first resource code. Even though the resource name in the first resource code may be different from the name of the actually used resource file, whether the resource file is used by the first resource code can be accurately determined, and the accuracy of screening the useless resource is improved.
In the embodiment of the application, the resource file comprises various files, such as pictures, characters, video, audio and the like, which can be directly called out to be displayed to a user when the application program runs. The type of resource file may be generally represented by a named suffix of the resource file, such as jpg, png, gif, json, etc. The resource code is code for calling a resource file. In the engineering file library, codes of each part of processes of the application program can be saved by using a plurality of code files. The engineering file library comprises a plurality of code files, and each code file comprises a plurality of codes including resource codes.
For example, the at least one resource code and the at least one resource file may be obtained according to a screening condition and/or an exclusion condition entered by a user. For example, in the resource screening method, further comprising: screening conditions and exclusion conditions entered by a user are obtained. Accordingly, step S11 includes: at least one resource code and at least one resource file that meet the screening criteria and are outside of the exclusion criteria are obtained.
According to the above-mentioned exemplary embodiment, the scope of the resource file and the resource code to be screened can be limited according to the requirement of the user, so that the efficiency of resource screening is improved.
The screening conditions may include an engineering file path to be screened, a resource file path to be screened, a code file path to be screened, and the like. If a file is stored under these paths, the file is acquired. The screening conditions may also include specifying a resource file type and/or specifying a code file type. Accordingly, a specified type of resource file and code file may be obtained.
The exclusion condition may include a resource file path blacklist, a code file path blacklist, and the like. The resource file path blacklist may include a plurality of resource file deposit paths. The code file path blacklist may include a plurality of code file deposit paths. If the path of deposit of a file is not in these blacklists, the file may be obtained.
For example, the user may be allowed to enter a plurality of screening conditions and a plurality of exclusion conditions. In step S11, the resource files and the code files that meet the screening conditions and are not in the exclusion conditions are obtained first, and then the resource codes are found out from the code files.
In particular implementations, the obtained resource files may be traversed to determine whether each resource file is used by at least one resource code, thereby determining whether the resource file is a non-useful resource. The embodiment of the application also provides another mode for determining whether the resource file is useless, so that the screening efficiency can be improved. As an example, referring to fig. 2, for each resource file in the at least one resource file, in the case that the at least one resource code does not use the resource file, determining that the resource file is a useless resource may include:
step S121, establishing a resource file set to be screened, wherein the resource file set to be screened comprises at least one resource file;
step S122, traversing each resource code in the at least one resource code;
step S123, deleting the resource files from the resource file set to be screened under the condition that the traversed resource codes use the resource files in the resource file set to be screened;
and step S124, after traversing each resource code, determining the residual resource files in the resource file set to be screened as useless resources.
This exemplary embodiment will be described with reference to fig. 3 by taking the resource codes 1 to 5 and the resource file A, B, C as examples. Firstly, establishing a resource file set to be screened comprising a resource file A, a resource file B and a resource file C, and traversing the resource codes 1 to 5. Judging whether the traversed resource codes use the resource files in the resource file set to be screened or not, and deleting the resource files from the resource file set to be screened if a certain resource file is used; then, judging whether the next resource code uses the remaining resource files in the resource file set to be screened; and after the last resource code is traversed, marking the residual resource files in the resource file set to be screened as useless resources. For example, the resource code 1 is used to compare with the resource files a through C, respectively, to determine whether the resource code 1 is used in one of the resource files. If the resource code 1 uses the resource file C, deleting the resource file C from the resource file set to be screened, and at the moment, remaining resource files A and B in the resource file set to be screened. For resource code 2, only the comparison with resource file A and resource file B is needed. Until the resource code 5 is traversed, if the resource file B is not used by any resource code, the resource file B is still in the set of resource files to be screened, which means that the resource file B is not used by any resource file, so the resource file B can be determined as a useless resource.
In the application development engineering, the number of the resource codes is far more than that of the resource files, and one traversed resource code is compared with a plurality of resource files, so that compared with the comparison of one traversed resource file with a plurality of resource codes, the use relation of the resource codes on the resource files can be searched faster, the comparison of the used resource files is finished in time, and the subsequent times of comparing the resource codes with the resource files are greatly reduced.
In one embodiment, the first resource code may be any one of the resource codes. That is, for each obtained resource code, it is determined whether a certain resource code is used for a certain resource file, and the name of the resource in the resource code may be compared with the name of the folder in which the resource file is located. If the name of the resource in the resource code is the same as the name of the folder in which the resource file is located, determining that the resource file is used by the resource code, and if the name of the resource in the resource code is different from the name of the folder in which the resource file is located, determining that the resource file is not used by the resource code.
In another embodiment, for each of the at least one resource code, the resource code is determined to be the first resource code if the resource name in the resource code is different from the name of the resource file. Specifically, whether a certain resource code is used to a certain resource file is determined, the name of the resource in the resource code can be compared with the name of the resource file, and if the name of the resource in the resource code is the same as the name of the resource file, the resource file is determined to be used by the resource code; if the resource name in the resource code is different from the name of the resource file, the resource code is determined to be the first resource code, and the resource name in the first resource code is further compared with the name of the folder in which the resource file is located. If the resource name in the first resource code is the same as the name of the folder in which a certain resource file is located, determining that the first resource code uses the resource file, and if the resource name in the first resource code is different from the name of the folder in which the resource file is located, determining that the first resource code does not use the resource file.
When a case occurs in which the resource name in the resource code is different from the name of the resource file, one possible reason is that: the resource code uses the resource file, but the name of the folder in which the resource file is located is modified, and the resource name in the resource code is the name of the folder and is different from the name of the resource file. If it is determined directly that the resource file is not being used by the resource code, it may result in the resource file eventually being misinterpreted as a useless resource. According to the method and the device for screening the useless resources, accuracy of screening the useless resources can be improved through twice comparison, names of folders where all the resource files are located do not need to be read, and efficiency of screening the resources is improved.
Referring to fig. 3, taking the resource code 1 as an example, determining whether the resource code 1 uses a resource file in the set of resource files to be screened, the name of the resource in the resource code 1 may be compared with the name of the resource file a. If the two are the same, then resource code 1 is considered to use resource file A. If the two are different, the problem that the resource names in the resource codes are inconsistent with the names of the actually used resource files is caused, and the resource codes 1 cannot be determined to not use the resource file A, the resource names of the resource codes 1 are further compared with the names of the folders in which the resource files A are located, and if the two are identical, the resource codes 1 are considered to use the resource file A. If the two are different, it may be determined that resource code 1 does not use resource file A. It is possible to determine whether the resource code 1 uses the resource file B and the resource file C in the same way.
In addition, determining whether resource code 1 is to be used with a resource file in the collection of resource files to be screened, the name of each resource file in the collection may also be compared to resource code 1. If the resource name in the resource code 1 is different from the name of each resource file, the resource name in the resource code 1 is compared with the name of the folder in which each resource file is located, so as to accurately determine whether the resource code 1 uses one of the resource files.
In one embodiment, the first resource code is a resource code containing a specified resource name. To increase the efficiency of screening resources, a specified resource name may also be entered by the user. For example, if the user determines that the folder name where some resource files are located is modified to a specified resource name, it is highly likely that the first resource code containing the specified resource name contains a resource name different from the name of the actually used resource file. Therefore, by comparing the resource name in the first resource code with the name of the resource file, it is not possible to accurately determine whether the first resource code uses the resource file. In view of this, for a first resource code, it may be determined whether the first resource code uses the resource file by comparing the resource name in the first resource code (i.e., the specified resource name) with the name of the folder in which the resource file is located. If the resource name in the first resource code is the same as the name of the folder in which the resource file is located, it may be determined that the first resource code uses the resource file.
According to the embodiment, the first resource code with the problem of inconsistent names is determined by using the designated resource names, and whether the resource file is used or not is determined by comparing the resource names with the folder names of the resource files in the first resource code, so that the accuracy of judging whether the resource file is used by the resource code is improved.
Alternatively, for the second resource code of the acquired at least one resource code, for example, the second resource code that does not contain the specified resource name, the resource name in the second resource code may be regarded as the same as the name of the actually used resource file. Therefore, by comparing the resource name in the second resource code with the name of the resource file, it can be accurately determined whether the second resource code uses the resource file. In view of this, for the second resource code, it may be determined whether the second resource code uses the resource file by comparing the resource name in the second resource code with the name of the resource file. If the resource name in the second resource code is different from the name of the resource file, it is determined that the second resource code does not use the resource file.
In the alternative mode, for the second resource code, a mode of comparing the resource name with the name of the resource file is adopted to determine whether the second resource code uses a certain resource file, the names of folders where all the resource files are positioned do not need to be read, and the efficiency of judging whether the resource code uses the resource file is improved.
If the user does not input the designated resource name, it can be considered that folders of all the resource files acquired according to various conditions have not been modified, and whether the resource code uses the resource name is determined by comparing the resource name in the resource code with the name of the resource file.
In order to improve the accuracy of screening the resource, if the user does not input the designated resource name, the resource name in the resource code and the name of the folder where the resource file is located can be compared to determine whether the resource code uses the resource name. Or comparing the resource name in the resource code with the name of the resource file, and if the two are different, comparing the resource name in the resource code with the name of the folder in which the resource file is located to accurately determine whether the resource code uses the resource name.
Illustratively, determining whether the resource name in the resource code is the same as the name of the folder in which the resource file is located, or determining whether the resource name in the resource code is the same as the name of the resource file, may be implemented using a string matching algorithm.
An application example of the embodiment of the present application is provided below. The application process of the resource screening method can comprise the following stages:
stage one, condition setting stage: screening conditions and/or exclusion conditions entered by the user are obtained.
The screening conditions may include an engineering file path to be screened, a resource file path to be screened, a code file path to be screened, a specified resource file type, a specified code file type, and the like. The exclusion condition may include a resource file path blacklist, a code file path blacklist, and the like. Illustratively, the user may enter the screening conditions and the exclusion conditions through an interactive interface as shown in FIG. 4. When the user clicks on the start, the next step is entered.
Stage two, a file acquisition stage:
1. and acquiring all resource files which meet the screening conditions and are outside the exclusion conditions according to the screening conditions and the exclusion conditions input by the user, and forming a resource file set to be screened.
Illustratively, if the user inputs the project file path to be screened, all resource files under the project file path to be screened are acquired to form a resource file set to be screened. If the user inputs the project file path to be screened and the designated resource file type, all resource files belonging to the designated resource file type under the project file path to be screened are acquired to form a resource file set to be screened. If the user inputs the resource file path blacklist, acquiring resource files which meet other screening conditions and are stored outside the resource file path blacklist, and forming a resource file set to be screened.
2. And acquiring all code files which meet the screening conditions and are outside the exclusion conditions according to the screening conditions and the exclusion conditions input by the user, and forming a code file set.
Illustratively, if the user enters the project file path, all code files under the project file path are acquired, forming a code file set. If the user inputs the engineering file path and the appointed code file type, all code files belonging to the appointed code file type under the engineering file path are acquired to form a code file set. If the user inputs the code file path blacklist, code files which meet other screening conditions and are stored outside the code file path blacklist are acquired to form a code file set.
3. Generating cache data for each resource file in the resource file set to be screened, generating ciphertext of each resource file through a summarization algorithm, and forming a resource data set for screening repeated resources.
Step three, resource file screening:
1. traversing the resource codes in the code file set. And for the traversed resource codes, checking whether the resource codes use the resource files in the resource file set to be screened through a character string matching algorithm, and if so, deleting the resource files from the resource file set to be screened. And (5) traversing to obtain a set of resource files to be screened, namely an unused set of resource files.
2. Comparing ciphertext of each resource file in the resource data set, and screening out repeated ciphertext to obtain corresponding repeated resource files. For example, if there are N ciphertexts that are identical, then the corresponding N resource files are duplicated on behalf of each other. The N repeated resource files may be presented to the user, who processes the repeated resource files.
Stage four, output stage: useless resources including unused resource files and duplicate resource files are output to the user.
Illustratively, the garbage list is output through the interactive interface shown in fig. 4. The user may handle the unwanted resources, such as deletion or movement, as desired.
Referring to fig. 5, an embodiment of the present application further provides a resource screening apparatus 500, including:
a first obtaining module 510, configured to obtain at least one resource code and at least one resource file;
a determining module 520, configured to determine, for each resource file in the at least one resource file, that the resource file is a useless resource if the at least one resource code does not use the resource file; and for the first resource code in the at least one resource code, if the name of the resource in the first resource code is different from the name of the folder in which the resource file is located, determining that the resource file is not used by the first resource code.
For example, referring to fig. 6, the determining module 520 may include:
a set establishing unit 610, configured to establish a set of resource files to be screened, where the set of resource files to be screened includes at least one resource file;
a resource code traversing unit 620 for traversing each of the at least one resource code;
a resource file deleting unit 630, configured to delete a resource file from the resource file set to be screened when the traversed resource code has a resource file in the resource file set to be screened;
and the useless resource determining unit 640 is configured to determine that the resource files remaining in the resource file set to be screened are useless resources after traversing each resource code.
For each of the at least one resource code, the resource code is determined as the first resource code, for example, if the resource name in the resource code is different from the name of the resource file.
Illustratively, the first resource code is a resource code containing a specified resource name.
For example, for a second resource code of the at least one resource code, if the resource name in the first resource code is different from the name of the resource file, it is determined that the second resource code does not use the resource file.
Illustratively, the resource screening apparatus further comprises:
the second acquisition module is used for acquiring screening conditions and exclusion conditions input by a user;
the first acquisition module includes:
and the acquisition unit is used for acquiring at least one resource code and at least one resource file which meet the screening condition and are outside the exclusion condition.
The functions of each module in each device of the embodiments of the present application may be referred to the corresponding descriptions in the above methods, and are not described herein again.
According to an embodiment of the present application, the present application also provides an electronic device and a readable storage medium.
As shown in fig. 7, a block diagram of an electronic device of a resource screening method according to an embodiment of the present application. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the applications described and/or claimed herein.
As shown in fig. 7, the electronic device includes: one or more processors 901, memory 902, and interfaces for connecting the components, including high-speed interfaces and low-speed interfaces. The various components are interconnected using different buses and may be mounted on a common motherboard or in other manners as desired. The processor may process instructions executing within the electronic device, including instructions stored in or on memory to display graphical information of the GUI on an external input/output device, such as a display device coupled to the interface. In other embodiments, multiple processors and/or multiple buses may be used, if desired, along with multiple memories and multiple memories. Also, multiple electronic devices may be connected, each providing a portion of the necessary operations (e.g., as a server array, a set of blade servers, or a multiprocessor system). In fig. 7, a processor 901 is taken as an example.
Memory 902 is a non-transitory computer readable storage medium provided by the present application. The memory stores instructions executable by the at least one processor to cause the at least one processor to perform the resource screening method provided by the present application. The non-transitory computer readable storage medium of the present application stores computer instructions for causing a computer to execute the resource screening method provided by the present application.
The memory 902 is used as a non-transitory computer readable storage medium for storing non-transitory software programs, non-transitory computer executable programs, and modules, such as program instructions/modules (e.g., the first acquisition module 510 and the determination module 520 shown in fig. 5) corresponding to the resource screening method according to the embodiment of the present application. The processor 901 executes various functional applications of the server and data processing, i.e., implements the resource screening method in the above-described method embodiments, by running non-transitory software programs, instructions, and modules stored in the memory 902.
The memory 902 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, at least one application program required for a function; the storage data area may store data created according to the use of the electronic device of the resource screening method, etc. In addition, the memory 902 may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, the memory 902 optionally includes memory remotely located relative to the processor 901, which may be connected to the electronic device of the resource screening method via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The electronic device of the resource screening method may further include: an input device 903 and an output device 904. The processor 901, memory 902, input devices 903, and output devices 904 may be connected by a bus or other means, for example in fig. 7.
The input device 903 may receive input numeric or character information and generate key signal inputs related to user settings and function control of the electronic device of the resource screening method, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, a pointer stick, one or more mouse buttons, a track ball, a joystick, or the like. The output means 904 may include a display device, auxiliary lighting means (e.g., LEDs), tactile feedback means (e.g., vibration motors), and the like. The display device may include, but is not limited to, a Liquid Crystal Display (LCD), a Light Emitting Diode (LED) display, and a plasma display. In some implementations, the display device may be a touch screen.
Various implementations of the systems and techniques described here can be realized in digital electronic circuitry, integrated circuitry, application specific ASIC (application specific integrated circuit), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
These computing programs (also referred to as programs, software applications, or code) include machine instructions for a programmable processor, and may be implemented in a high-level procedural and/or object-oriented programming language, and/or in assembly/machine language. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus, and/or device (e.g., magnetic discs, optical disks, memory, programmable Logic Devices (PLDs)) used to provide machine instructions and/or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal used to provide machine instructions and/or data to a programmable processor.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and pointing device (e.g., a mouse or trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), and the internet.
The computer system may include a client and a server. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other.
According to the technical scheme of the embodiment of the application, the screening of useless resources is realized by determining whether the resource file is used by the resource code. In determining whether the resource file is used by the resource code, if the name of the resource in the first resource code is different from the name of the folder in which the resource file is located, it is determined that the resource file is not used by the first resource code. Even though the resource name in the first resource code may be different from the name of the actually used resource file, whether the resource file is used by the first resource code can be accurately determined, and the accuracy of screening the useless resource is improved. And the range of the screened resource file and the resource code can be limited according to the requirements of the user, so that the efficiency of resource screening is improved. Optionally, the traversed resource code is compared with a plurality of resource files, so that the use relation of the resource code to the resource files can be found more quickly, the comparison of the used resource files is finished in time, the subsequent times of comparing the resource code with the resource files are greatly reduced, and the screening efficiency is improved. Optionally, by two comparison, the accuracy of screening the useless resources can be improved, the names of folders in which all the resource files are located do not need to be read, and the efficiency of screening the resources is improved. And determining a first resource code with the problem of inconsistent names by using the designated resource names, and determining whether to use the resource file by comparing the resource names with the folder names of the resource files for the first resource code, thereby improving the accuracy of judging whether the resource file is used by the resource code. For the second resource code, a mode of comparing the resource name with the name of the resource file is adopted to determine whether the second resource code uses a certain resource file, the names of folders where all the resource files are located do not need to be read, and the efficiency of judging whether the resource code uses the resource file is improved.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present application may be performed in parallel, sequentially, or in a different order, so long as the desired results of the technical solution disclosed in the present application can be achieved, and are not limited herein.
The above embodiments do not limit the scope of the present application. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present application should be included in the scope of the present application.

Claims (12)

1. A method of resource screening, comprising:
acquiring at least one resource code and at least one resource file;
for each resource file in the at least one resource file, determining that the resource file is a useless resource if the at least one resource code does not use the resource file; wherein, for a first resource code in the at least one resource code, if the resource name in the first resource code is different from the name of the folder in which the resource file is located, determining that the resource file is not used by the first resource code;
wherein said determining, for each of said at least one resource file, that said resource file is a non-useful resource if said at least one resource file is not used by said at least one resource code comprises:
establishing a resource file set to be screened, wherein the resource file set to be screened comprises the at least one resource file;
traversing each of the at least one resource code;
deleting the resource file from the resource file set to be screened under the condition that the traversed resource code has the resource file in the resource file set to be screened;
and after traversing each resource code, determining the remaining resource files in the resource file set to be screened as useless resources.
2. The method of claim 1, wherein for each of the at least one resource code, if a resource name in the resource code is different from a name of the resource file, the resource code is determined to be a first resource code.
3. The method of claim 1, wherein the first resource code is a resource code containing a specified resource name.
4. A method according to claim 3, wherein for a second resource code of the at least one resource code, if the resource name in the second resource code is different from the name of the resource file, determining that the second resource code does not use the resource file; wherein the second resource code is a resource code that does not include the specified resource name.
5. The method according to claim 1, wherein the method further comprises: acquiring screening conditions and exclusion conditions input by a user;
the obtaining at least one resource code and at least one resource file includes:
and acquiring at least one resource code and at least one resource file which meet the screening condition and are outside the exclusion condition.
6. A resource screening apparatus, comprising:
the first acquisition module is used for acquiring at least one resource code and at least one resource file;
a determining module, configured to determine, for each resource file in the at least one resource file, that the resource file is a useless resource if the at least one resource code does not use the resource file; wherein, for a first resource code in the at least one resource code, if the resource name in the first resource code is different from the name of the folder in which the resource file is located, determining that the resource file is not used by the first resource code;
wherein the determining module comprises:
the system comprises a set establishing unit, a resource file searching unit and a resource file searching unit, wherein the set establishing unit is used for establishing a resource file set to be screened, and the resource file set to be screened contains at least one resource file;
a resource code traversing unit configured to traverse each of the at least one resource code;
the resource file deleting unit is used for deleting the resource file from the resource file set to be screened under the condition that the traversed resource code uses the resource file in the resource file set to be screened;
and the useless resource determining unit is used for determining the resource files remained in the resource file set to be screened as useless resources after the resource codes are traversed.
7. The apparatus of claim 6, wherein for each of the at least one resource code, if a resource name in the resource code is different from a name of the resource file, the resource code is determined to be a first resource code.
8. The apparatus of claim 6, wherein the first resource code is a resource code containing a specified resource name.
9. The apparatus of claim 6, wherein for a second resource code of the at least one resource code, if a resource name in the first resource code is different from a name of the resource file, determining that the second resource code does not use the resource file.
10. The apparatus of claim 6, wherein the apparatus further comprises:
the second acquisition module is used for acquiring screening conditions and exclusion conditions input by a user;
the first acquisition module includes:
and the acquisition unit is used for acquiring at least one resource code and at least one resource file which meet the screening condition and are outside the exclusion condition.
11. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein, the liquid crystal display device comprises a liquid crystal display device,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-5.
12. A non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method of any one of claims 1-5.
CN202010235118.8A 2020-03-30 2020-03-30 Resource screening method and device, electronic equipment and storage medium Active CN111459887B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010235118.8A CN111459887B (en) 2020-03-30 2020-03-30 Resource screening method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010235118.8A CN111459887B (en) 2020-03-30 2020-03-30 Resource screening method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111459887A CN111459887A (en) 2020-07-28
CN111459887B true CN111459887B (en) 2023-08-11

Family

ID=71680221

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010235118.8A Active CN111459887B (en) 2020-03-30 2020-03-30 Resource screening method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111459887B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104484484A (en) * 2015-01-08 2015-04-01 北京奇虎科技有限公司 Method and device for removing cache file
EP3070622A1 (en) * 2015-03-16 2016-09-21 Palantir Technologies, Inc. Interactive user interfaces for location-based data analysis
CN106599151A (en) * 2016-12-07 2017-04-26 Tcl集团股份有限公司 Method and system for parallel cleaning of Android engineering useless resources
CN106599167A (en) * 2016-12-09 2017-04-26 郑州云海信息技术有限公司 System and method capable of supporting incremental upgrading of database
CN110716804A (en) * 2019-09-02 2020-01-21 平安普惠企业管理有限公司 Method and device for automatically deleting useless resources, storage medium and electronic equipment

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9063938B2 (en) * 2012-03-30 2015-06-23 Commvault Systems, Inc. Search filtered file system using secondary storage, including multi-dimensional indexing and searching of archived files
FR3021769B1 (en) * 2014-05-27 2016-07-01 Thales Sa DEVICE AND METHOD FOR GENERATING AT LEAST ONE COMPUTER FILE FOR PRODUCING A GRAPHICAL INTERFACE OF ELECTRONIC EQUIPMENT, AND ASSOCIATED COMPUTER PROGRAM PRODUCT
JP6700554B2 (en) * 2016-07-28 2020-05-27 富士通株式会社 Distributed processing management method, distributed processing management program, and distributed processing management device
US11030248B2 (en) * 2018-04-18 2021-06-08 Palantir Technologies Inc. Resource dependency system and graphical user interface

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104484484A (en) * 2015-01-08 2015-04-01 北京奇虎科技有限公司 Method and device for removing cache file
EP3070622A1 (en) * 2015-03-16 2016-09-21 Palantir Technologies, Inc. Interactive user interfaces for location-based data analysis
CN106599151A (en) * 2016-12-07 2017-04-26 Tcl集团股份有限公司 Method and system for parallel cleaning of Android engineering useless resources
CN106599167A (en) * 2016-12-09 2017-04-26 郑州云海信息技术有限公司 System and method capable of supporting incremental upgrading of database
CN110716804A (en) * 2019-09-02 2020-01-21 平安普惠企业管理有限公司 Method and device for automatically deleting useless resources, storage medium and electronic equipment

Also Published As

Publication number Publication date
CN111459887A (en) 2020-07-28

Similar Documents

Publication Publication Date Title
WO2018072634A1 (en) Application processing method and device
CN111639027B (en) Test method and device and electronic equipment
JP2021174516A (en) Knowledge graph construction method, device, electronic equipment, storage medium, and computer program
CN111752843A (en) Method, device, electronic equipment and readable storage medium for determining influence surface
CN111582375A (en) Data enhancement strategy searching method, device, equipment and storage medium
US20210133217A1 (en) Method and apparatus for importing data into graph database, electronic device and medium
CN111966633A (en) Method, device, electronic equipment and medium for inquiring child nodes under directory
US20210216212A1 (en) Method and apparatus for processing data
CN110619002A (en) Data processing method, device and storage medium
CN111913808A (en) Task allocation method, device, equipment and storage medium
CN111475164A (en) Component dependency relationship detection method and device and electronic equipment
CN112163143B (en) Page switching method, device, equipment and storage medium
EP3889770A1 (en) Mini program material processing method and apparatus, electronic device, and medium
CN110909390B (en) Task auditing method and device, electronic equipment and storage medium
CN111177479A (en) Method and device for acquiring feature vectors of nodes in relational network graph
CN111459887B (en) Resource screening method and device, electronic equipment and storage medium
US20210248486A1 (en) Method, apparatus, device and storage medium for customizing personalized rules for entities
CN111680508B (en) Text processing method and device
CN111026438B (en) Method, device, equipment and medium for extracting small program package and page key information
CN111767444B (en) Page feature construction method, device, equipment and storage medium
CN111723318B (en) Page data processing method, device, equipment and storage medium
CN111639116B (en) Data access connection session protection method and device
CN111506499B (en) Method and device for detecting availability of parameters in applet and electronic equipment
CN114661274A (en) Method and device for generating intelligent contract
CN112148279A (en) Log information processing method and device, electronic equipment and storage medium

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
GR01 Patent grant
GR01 Patent grant