CN112084747A - Resource management method and device, electronic equipment and storage medium - Google Patents

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

Info

Publication number
CN112084747A
CN112084747A CN202010982892.5A CN202010982892A CN112084747A CN 112084747 A CN112084747 A CN 112084747A CN 202010982892 A CN202010982892 A CN 202010982892A CN 112084747 A CN112084747 A CN 112084747A
Authority
CN
China
Prior art keywords
resource
file
path information
resource file
full path
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.)
Granted
Application number
CN202010982892.5A
Other languages
Chinese (zh)
Other versions
CN112084747B (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.)
Ruiting Network Technology Shanghai Co ltd
Original Assignee
Ruiting Network Technology Shanghai 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 Ruiting Network Technology Shanghai Co ltd filed Critical Ruiting Network Technology Shanghai Co ltd
Priority to CN202010982892.5A priority Critical patent/CN112084747B/en
Publication of CN112084747A publication Critical patent/CN112084747A/en
Application granted granted Critical
Publication of CN112084747B publication Critical patent/CN112084747B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/12Use of codes for handling textual entities
    • G06F40/151Transformation
    • 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/11File system administration, e.g. details of archiving or snapshots
    • G06F16/116Details of conversion of file system types or formats
    • 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
    • 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/164File meta data generation
    • G06F16/166File name conversion

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Human Computer Interaction (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Library & Information Science (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides a resource management method, a resource management device, electronic equipment and a storage medium. The method comprises the following steps: in the encoding stage of the target project, scanning each resource file in a resource file directory corresponding to the target project to obtain the resource type of each resource file; for each resource file, responding to the resource type of the resource file being in the first target format, converting the resource file into a second target format, acquiring full path information of the converted resource file in the second target format, and adding a statement aiming at the resource file in the second target format in a total configuration file according to the full path information; and responding to the condition that the resource type of the resource file is not in the first target format, acquiring full path information of the resource file, and adding a statement aiming at the resource file in the total configuration file according to the full path information. Therefore, the accuracy of the declaration process can be improved while the manual operation is avoided, and the total volume of the target project is reduced.

Description

Resource management method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a resource management method and apparatus, an electronic device, and a storage medium.
Background
Flutter manages third party dependent packages using the configuration file pubspec. The Flutter application may contain code and assets (which may be referred to as resources). Common types of assets include static data (e.g., JSON files), configuration files, icons, and pictures (JPEG, WebP, GIF, animated WebP/GIF, PNG, BMP, and WBMP), among others. As with package management, Flutter may also use pubspec.yaml files to manage the resources needed by the application.
However, in the existing Flutter project, resources such as pictures and fonts need to be added to the project master configuration file pubspec. In addition, the picture resources such as PNG, JEPG and the like are added, and meanwhile, the picture is not compressed and converted, so that the target project occupies more storage space.
Disclosure of Invention
The embodiment of the invention provides a resource management method and device, electronic equipment and a storage medium, and aims to solve the problems that the existing manual resource adding process is complicated and easy to make mistakes, and the resources occupy more storage space due to the fact that pictures are not compressed and converted.
In order to solve the technical problem, the invention is realized as follows:
in a first aspect, an embodiment of the present invention provides a resource management method, including:
in the encoding stage of a target project, scanning each resource file in a resource file directory corresponding to the target project to obtain the resource type of each resource file;
for each resource file, responding to the resource type of the resource file being in a first target format, converting the resource file into a second target format, acquiring full path information of the converted resource file in the second target format, and adding a statement aiming at the resource file in the second target format in the total configuration file according to the full path information;
responding to the fact that the resource type of the resource file is not in the first target format, acquiring full path information of the resource file, and adding a statement aiming at the resource file in the total configuration file according to the full path information;
wherein, the statement includes the full path information, and the resource file of the second target format is smaller than the resource file of the first target format.
Optionally, the step of scanning each resource file in the resource file directory corresponding to the target project to obtain the resource type of each resource file includes:
scanning a path of each resource file in a resource file directory corresponding to the target project to obtain full path information of each resource file, wherein the full path information comprises an access path of the resource file, a file name of the resource file and a file suffix name of the resource file;
and acquiring the resource type of each resource file according to the file suffix name of the resource file.
Optionally, the step of obtaining the full path information of the resource file in the second target format includes:
acquiring full path information of the resource file in the first target format and a file suffix name matched with the second target format;
and replacing the file suffix name in the full path information of the picture resource in the first target format by the file suffix name matched with the second target format, and taking the replaced full path information as the full path information of the resource file in the second target format.
Optionally, the step of adding a declaration for the resource file in the total configuration file according to the full path information includes:
replacing the path fields of the specified hierarchy in the full path information by file wildcards according to the hierarchy of each path field in the initial full path information of the resource file to obtain the final full path information of the resource file;
and adding a statement aiming at the resource file in the total configuration file according to the final full path information of the resource file.
Optionally, the first target format includes at least one of a PNG picture format, a JPEG picture format, and a GIF picture format, and the second target format includes a WebP picture format.
Optionally, the method further comprises:
aiming at any at least one resource file, generating a resource identifier of the resource file according to the full path information of the resource file, wherein the data length of the resource identifier is smaller than that of the full path information;
and writing the resource identifier into a resource reference file of the target project, and establishing a mapping relation between the full path information and the resource identifier in the resource reference file.
Optionally, the method further comprises:
replacing the full path information by the resource identifier in the code file of the target project according to the resource identifier contained in the resource reference file and the mapping relation between the full path information and the resource identifier;
and in the compiling and executing process of the target project, searching full path information corresponding to the resource identifier through the resource reference file according to the resource identifier in the code file, and calling the resource file according to the full path information.
Optionally, the target project is a Flutter project, and the total configuration file is a pubspec.
In a second aspect, an embodiment of the present invention provides a resource management apparatus, including:
the resource type acquisition module is used for scanning each resource file in a resource file directory corresponding to a target project in an encoding stage of the target project to acquire the resource type of each resource file;
a first resource declaration module, configured to, for each resource file, respond to that a resource type of the resource file is in a first target format, convert the resource file into a second target format, obtain full path information of the converted resource file in the second target format, and add a declaration for the resource file in the second target format in the total configuration file according to the full path information;
a second resource declaration module, configured to, in response to that a resource type of the resource file is not in the first target format, obtain full path information of the resource file, and add a declaration for the resource file in the total configuration file according to the full path information;
wherein, the statement includes the full path information, and the resource file of the second target format is smaller than the resource file of the first target format.
Optionally, the resource type obtaining module includes:
the path scanning submodule is used for scanning the path of each resource file in the resource file directory corresponding to the target project to obtain the full path information of each resource file, wherein the full path information comprises the access path of the resource file, the file name of the resource file and the file suffix name of the resource file;
and the resource type obtaining submodule is used for obtaining the resource type of each resource file according to the file suffix name of the resource file.
Optionally, the first resource declaration module includes:
the path construction information acquisition submodule is used for acquiring full path information of the resource file in the first target format and a file suffix name matched with the second target format;
and the full path information acquisition submodule is used for replacing the file suffix name in the full path information of the picture resource in the first target format by the file suffix name matched with the second target format, and taking the replaced full path information as the full path information of the resource file in the second target format.
Optionally, the second resource declaration module includes:
the full path information processing submodule is used for replacing the path fields of the specified levels in the full path information through file wildcards according to the levels of all the path fields in the initial full path information of the resource file to obtain the final full path information of the resource file;
and the resource declaration sub-module is used for adding a declaration aiming at the resource file in the total configuration file according to the final full path information of the resource file.
Optionally, the first target format includes at least one of a PNG picture format, a JPEG picture format, and a GIF picture format, and the second target format includes a WebP picture format.
Optionally, the apparatus further comprises:
a resource identifier generating module, configured to generate, for any at least one resource file, a resource identifier for the resource file according to full path information of the resource file, where a data length of the resource identifier is smaller than a data length of the full path information;
and the resource reference file generation module is used for writing the resource identifier into the resource reference file of the target project and establishing the mapping relation between the full path information and the resource identifier in the resource reference file.
Optionally, the apparatus further comprises:
a full path replacement module, configured to replace, according to a resource identifier included in the resource reference file and a mapping relationship between the full path information and the resource identifier, the full path information in the code file of the target item by the resource identifier;
and the resource file calling module is used for searching the full path information corresponding to the resource identifier through the resource reference file according to the resource identifier in the code file in the compiling and executing process of the target project and calling the resource file according to the full path information.
Optionally, the target project is a Flutter project, and the total configuration file is a pubspec.
In a third aspect, an embodiment of the present invention additionally provides an electronic device, including: memory, a processor and a computer program stored on the memory and executable on the processor, the computer program, when executed by the processor, implementing the steps of the resource management method according to the first aspect.
In a fourth aspect, the embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when executed by a processor, the computer program implements the steps of the resource management method according to the first aspect.
In the embodiment of the invention, the total volume of the target project is reduced by automatically declaring the resource file into the total configuration file and automatically processing the resource file with larger volume for the resource files such as PNG and JPEG in the declaration process into a format with larger volume.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments of the present invention will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained based on these drawings without inventive labor.
FIG. 1 is a flow chart of the steps of a method for resource management in an embodiment of the present invention;
FIG. 2 is a flow chart of the steps of another resource management method in an embodiment of the present invention;
FIG. 3 is a flow diagram of a resource management process in an embodiment of the invention;
FIG. 4 is a schematic structural diagram of a resource management apparatus according to an embodiment of the present invention;
FIG. 5 is a schematic structural diagram of another resource management apparatus in an embodiment of the present invention;
fig. 6 is a schematic diagram of a hardware structure of an electronic device in the embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, a flowchart illustrating steps of a resource management method according to an embodiment of the present invention is shown.
Step 110, in the encoding stage of a target project, scanning each resource file in a resource file directory corresponding to the target project to obtain the resource type of each resource file;
step 120, for each resource file, in response to that the resource type of the resource file is in a first target format, converting the resource file into a second target format, acquiring full path information of the converted resource file in the second target format, and adding a statement for the resource file in the second target format in the total configuration file according to the full path information;
step 130, in response to that the resource type of the resource file is not the first target format, acquiring full path information of the resource file, and adding a statement for the resource file in the total configuration file according to the full path information; wherein, the statement includes the full path information, and the resource file of the second target format is smaller than the resource file of the first target format.
In the embodiment of the invention, in order to avoid the technical problems that the operation of manually adding resources is complicated and error is easy to occur, and the volume of the resources is large in the construction process of the code engineering, so that the project occupies a large space, the paths of all the resource files required by the target engineering can be automatically and sequentially scanned in the coding stage of the target engineering, and the full path statements of all the resource files, namely the statements including the full path information of the resource files, are automatically and one by one added in the total configuration files of the target engineering in the past. In addition, in the process of adding the full path declaration of the resource file in the total configuration file, the resource file of the specified resource type can be dynamically converted according to the resource type of the resource file, the resource file is converted into a format with a smaller volume, and then the declaration is added in the total configuration file based on the converted resource file.
Specifically, for any target project, in an encoding stage of the target project, scanning each resource file under a resource file directory corresponding to the target project, acquiring a resource type of each resource file, converting the resource file into a second target format if the resource type of the resource file is in a first target format, acquiring full path information of the converted resource file in the second target format, and adding a statement for the resource file in the second target format in the total configuration file according to the full path information; if the resource type of the resource file is not the first target format, acquiring full path information of the resource file, and adding a statement aiming at the resource file in the total configuration file according to the full path information; wherein, the statement includes the full path information, and the resource file of the second target format is smaller than the resource file of the first target format.
The target project may be any available code development platform, code project or code project created in a code development tool, and the like, for example, the target project may be a Flutter project/Flutter project, Android project/Android project, iOS project/iOS project, and the like. Among them, Flutter is a cross-platform solution introduced by Google.
In addition, both the first target format that needs to be format-converted for data compression and the second target format that is a target of data compression processing can be set by user according to requirements, which is not limited in the embodiment of the present invention. Moreover, in order to ensure that the volume of the resource file of the target project after the conversion processing is reduced, the resource file of the second target format after the conversion may be set to be smaller than the resource file of the first target format before the conversion, and the first target format may be set to be a resource type of the resource file with a larger volume, and specifically, the self-defined setting may be performed according to the requirement, which is not limited in the embodiment of the present invention. In practical application, resource file directories corresponding to different target projects can be set by self-definition according to requirements, and the embodiment of the invention is not limited.
The type of the resource file corresponding to the target project can also be set by self-definition according to a specific application scenario, and the embodiment of the present invention is not limited. For example, resource files may include static data (e.g., JSON files), configuration files, icon resources, and picture resources (JPEG, WebP, GIF, animated WebP/GIF, PNG, BMP, and WBMP), font resources, and so forth.
Taking Flutter as an example, the storage directory recommended for the picture resource is as follows: the assets/images. In addition, the volume of the picture resources such as PNG, JEPG, etc. in the picture resources is generally large, so the first target format may be set to include the picture formats such as PNG, JEPG, etc.
Then for the above-mentioned storage catalog of picture resources: for the fact that assets/images sequentially contain three picture resources, if a file of a first picture resource picture1 is all referred to as ajh _ fbbd _ icon _ jg.png, that is, the file is in the PNG format, the file can be converted into a second target format to obtain a resource file picture1 'in the second target format, at this time, the first picture resource in a corresponding directory is replaced by a resource file picture 1' in the second target format, and in the process of converting the resource file, because the format of the file is changed, the full path information of the file is also changed correspondingly, so when a statement is added in a total configuration file, the statement of the resource file picture1 'in the second target format needs to be added instead of the statement of the picture resource picture1, and then the full path information of the converted picture resource picture 1' in the second target format needs to be obtained. For example, after the picture resource picture1 is converted into a picture resource, by scanning the directory: obtaining the full path information of the picture resource picture 1' under the assets/images; alternatively, before the picture resource picture1 is converted, the list may be scanned: the path of the picture resource picture1 under the assets/images obtains the full path information of the picture resource picture1, and further, according to the change situation of the file path in the conversion process, the full path information of the picture1 is adaptively adjusted to obtain the full path information of the picture resource picture 1', and the like.
If the resource type of the second picture resource picture2 of the storage directory of the picture resource is not in the first target format, the full path information of the second picture resource picture2 can be directly obtained without converting the resource type of the second picture resource picture2, so as to add a statement for the picture resource picture2 in the total configuration file.
In the embodiment of the present invention, the resource type of each resource file in the resource file directory may be obtained by any available method, which is not limited in this embodiment of the present invention. For example, the resource type of each resource file may be identified by a file identification model, or may be confirmed by reading a suffix name of each resource file, and so on.
In addition, in the embodiment of the present invention, the full path information of the resource file (including the converted resource file and the unconverted resource file) may be obtained in any available manner, and the embodiment of the present invention is also not limited. For example, the Dart annotation technique may be utilized to automatically scan and acquire the full path information of each resource file in sequence at the encoding stage. The full path information refers to path information from a root directory, and a file or a folder can be uniquely located by using the full path information.
In addition, in the resource file conversion process, the resource conversion may be completed in any available manner according to the different first target format and the second target format, and the embodiment of the present invention is not limited thereto. For example, in the case where the first target format is a picture format such as PNG, JPEG, GIF, or the like, and the second target format is a WebP format, the conversion of the resource file may be completed by a cwebp tool derived from Google, or the like. The WebP is an image technology newly introduced by Google, can effectively compress a webpage picture, does not influence the compatibility and the actual definition of the picture format, and further accelerates the downloading speed of the whole webpage, and the technology can also be used in a mobile terminal.
For example, in the case that the total configuration file is pubspec.yaml, the code for generating the full path information by splicing the file path and the name may be as follows:
Figure BDA0002688186990000091
Figure BDA0002688186990000101
for the picture resource picture1 described above, the format of the declaration automatically added to the pubspec.
assets:
-assets/images/ajh_fbbd_icon_jg.webp
If the resources added to the general configuration file are converted into a second target format (such as a picture resource type in a WebP format) for the specified requirement, declarations are added to the general configuration file in a WebP new format, and other types such as non-specified pictures or characters and the like are not converted.
If the generation is not carried out in an automatic mode, and the mode of manually adding the declaration in the prior art is still adopted, then each new resource file needs to be manually written in a line according to the above format, and when the total amount of the resource files is huge, the resource files become complex and easy to make mistakes.
Referring to fig. 2, in an embodiment of the present invention, the step 110 may further include:
step 111, scanning a path of each resource file in a resource file directory corresponding to the target project to obtain full path information of each resource file, where the full path information includes an access path of the resource file, a file name of the resource file, and a file suffix name of the resource file;
and step 112, acquiring the resource type of each resource file according to the file suffix name of the resource file.
As described above, the full path information refers to path information from the root directory, and one file or folder can be uniquely located using the full path information. Suppose that the full path information of a resource file is: and (2) assets/images/ajh _ fbbd _ icon _ jg. png, wherein the assets/images/' can be understood as an access path of the resource file, the ' ajh _ fbbd _ icon _ jg ' is the file name of the resource file, and the ' png ' is the file suffix name of the resource file. Among them, the file suffix name is also called file extension (filename extension), which is a mechanism used by the operating system to mark the file type. Therefore, in the embodiment of the present invention, in order to quickly and accurately obtain the resource type of each resource file, the resource type of the corresponding resource file may be determined by the file suffix of the resource file.
Correspondingly, the process of acquiring the full path information of the resource file in the second target format may specifically include:
step 121, acquiring full path information of the resource file in the first target format and a file suffix name matched with the second target format;
and step 122, replacing the file suffix name in the full path information of the picture resource in the first target format by the file suffix name matched with the second target format, and taking the replaced full path information as the full path information of the resource file in the second target format.
As described above, if the full path information of the corresponding resource file is already acquired when the resource type is acquired, and the storage location of the resource file before and after the conversion is generally not changed, and the file name will not change, only the file suffix name will change, then for the resource file under the file directory that needs format conversion, the full path information of the resource file after conversion may not be acquired again after the file conversion is completed, and directly based on the acquired full path information of the resource file in the first target format before conversion and the file suffix name matched with the second target format, replacing a file suffix name in the full path information of the picture resource of the first target format by a file suffix name matching the second target format, and the replaced full path information is used as the full path information of the resource file in the second target format.
For example, assuming that the full path information of a resource file in a PNG format is assets/images/ajh _ fbbd _ icon _ jg.png, and the second target format is a webp format, the resource file after being converted may be converted into a webp format, and the suffix name of the resource file is the webp, and at this time, in order to obtain the full path information of the converted resource file, the file suffix name in the assets/images/ajh _ fbbd _ icon _ jg.png may be directly passed through the webp, so that the assets/images/ajh _ fbbd _ icon _ jg.webp is the full path information of the converted resource file in the second target format.
Optionally, in this embodiment of the present invention, the process of adding a statement for the resource file in the total configuration file according to the full path information specifically may include:
step S1, according to the hierarchy of each path field in the initial full path information of the resource file, replacing the path field of the specified hierarchy in the full path information by a file wildcard to obtain the final full path information of the resource file;
step S2, adding a statement for the resource file in the total configuration file according to the final full path information of the resource file.
In practical applications, there may be a case where any number of files in a certain folder are accessed simultaneously, or a certain folder is directly accessed, so as to perform a unified operation (e.g., unified modification, unified deletion, unified reading, etc.) on a plurality of files simultaneously, or when a folder or a file is searched, it may be used to replace one or more real characters, and when the real characters are not known or a complete name is not easy to input, wildcards are often used to replace one or more real characters. In practical application, the full path information of the resource files can be accurately located to the corresponding resource files, if the full path information of each resource file is directly declared in the total configuration file, if any multiple files under a certain folder need to be accessed simultaneously or a certain folder needs to be directly accessed, the codes for executing the same operation need to be repeatedly written for each resource file, and the length of the codes is increased and the time is consumed.
Therefore, in the embodiment of the present invention, in order to meet the above requirement, when configuring each resource file in a total configuration file, according to the hierarchy of each path field in the initial full path information of the resource file, the path field of a specified hierarchy in the full path information may be replaced by a file wildcard to obtain the final full path information of the resource file, and then the final full path information of the resource file adds a statement for the resource file in the total configuration file. The designated hierarchy can be set by self-definition according to requirements, and the embodiment of the invention is not limited. For example, a hierarchy may be set that specifies a hierarchy as the hierarchy at which the file name of the resource file is located, and so on.
Of course, in the embodiment of the present invention, a part of characters (for example, a designated character or a character indicating a position) in a path field of a designated hierarchy in the full path information may be replaced by a file wildcard, or a character or the like at a designated position in the full path information may be replaced by a file wildcard, and the designated position, the designated character, or the like may be set by a user according to a specific application scenario and a requirement, which is not limited in the embodiment of the present invention. Moreover, the file wildcards can be set by self according to requirements, and the embodiment of the invention is not limited.
For example, if the file wildcard is "", the initial full path information of a certain resource file is assets/images/ajh _ fbbd _ icon _ jg. webp, and if the last three-digit characters in the file name are replaced by the file wildcard, the final full path information for writing into the total configuration file can be obtained as assets/images/ajh _ fbbd _ icon. At this time, the file in the webp format, in which the front part of the file name under the assets/images/path is "ajh _ fbbd _ icon" and the last three bits are arbitrary characters, can be accessed through the path.
Optionally, in an embodiment of the present invention, the first target format includes at least one of a PNG picture format, a JPEG picture format, and a GIF picture format, and the second target format includes a WebP picture format.
As described above, in the embodiment of the present invention, the resource file in the specified first target format can be dynamically converted into the WebP format with a smaller size through the cwebp tool, and then the declaration is added to the pubspec. Then the cwebp conversion tool environment needs to be installed in the compiling computer in order to complete the format conversion. In the embodiment of the present invention, the cwebp conversion tool environment may be installed in the codec computer in any available manner, and the embodiment of the present invention is not limited thereto.
For example, the cwebp translation tool environment may be installed in the compiled computer by:
await shell.run('cwebp -q 100 ajh_fbbd_icon_jg.png -o ajh_fbbd_icon_jg.webp');
in the Dart code, a process is started to perform unified processing, ajh _ fbbd _ icon _ jg.png is an example of a read resource file, and in the embodiment of the present invention, an interactive call of a local environment may be completed by calling a system Shell command and the like.
Referring to fig. 2, in the embodiment of the present invention, the method may further include:
step 140, for any at least one resource file, generating a resource identifier of the resource file according to the full path information of the resource file, where the data length of the resource identifier is smaller than the data length of the full path information.
Step 150, writing the resource identifier into a resource reference file of the target project, and establishing a mapping relationship between the full path information and the resource identifier in the resource reference file.
As described above, in practical applications, the full path information includes information such as an access path, a file name, and a suffix name, and thus it is apparent that the data length of the full path information of a resource file is generally large, and since the root path of a certain resource file has many hierarchical levels, the full path information is more complicated, the possibility of a code spelling error in the encoding stage is high, and the code is also complicated.
Therefore, in the embodiment of the present invention, in order to reduce the possibility of errors in the full path spelling, so that the code is more concise, a uniform resource reference file may be generated, where the resource reference file includes at least one resource identifier of the resource file, and the resource identifier may be relatively more concise than the full path information, that is, the data length of the resource identifier is smaller than the data length of the full path information, and when a corresponding resource file is subsequently referred, the resource file may be referred to through the resource identifier of the corresponding resource file.
Specifically, for any at least one resource file, a resource identifier of the resource file may be generated according to the full path information of the resource file, where the data length of the resource identifier is smaller than the data length of the full path information. And writing the resource identifier into a resource reference file of the target project, and establishing a mapping relation between the full path information and the resource identifier in the resource reference file.
The resource identifier may be generated for each resource file in the resource file directory corresponding to the target project, or the resource identifier may be generated for only a part of the resource files, which may be specifically set by user-definition according to requirements, and the embodiment of the present invention is not limited. In addition, the naming strategy of the resource identifier can also be set by self-definition according to the requirement, and the embodiment of the invention is not limited.
For example, the resource identifier may be capitalized by the file name of the resource file. For example, for the above-mentioned full path information as-sets/images/ajh _ FBBD _ ICON _ JG, webp, the resource identifier of the corresponding resource file can be obtained as AJH _ FBBD _ ICON _ JG. Then in the code file in the target project its resource identification can be used directly at the location where the resource file is used. In the case that the resource reference file is r.g.dart, the resource reference file of the target project may be generated by the following code segments, and the resource identifier of the resource file may be generated.
Figure BDA0002688186990000151
The above is a global resource reference file, and the resource identifier is formed by capitalizing the resource file name. The resource identifier can be used directly at the location of use, as follows for the code writing change when displaying a picture,
the original code is: asset ('assets/images/ajh _ fbbd _ icon _ jg.webp');
the method comprises the following steps: asset (ajkr. ajh _ FBBD _ ICON _ JG);
the resource identifier can be a globally unique alias of a corresponding resource file, and spelling errors can be effectively prevented by replacing spelling of full-path information, such as assets/images/ajh _ FBBD _ ICON _ JG, with an automatically generated resource identifier, such as ajkr.
When the target project is executed subsequently, the full path information corresponding to each resource identifier in the target project can be searched through the mapping relation between the resource identifier and the full path information contained in the resource reference file, and then the corresponding resource file can be called from the resource file directory according to the corresponding full path information.
In addition, in the embodiment of the present invention, resource files (including resource files that do not need to be subjected to format conversion, resource files that need to be subjected to format conversion and are subjected to conversion, and the like) may also be transferred to a resource reference file according to requirements, and the corresponding resource files are directly read from the resource reference file and applied, which is not limited in the embodiment of the present invention.
Referring to fig. 2, in the embodiment of the present invention, the method may further include:
step 160, replacing the full path information by the resource identifier in the code file of the target project according to the resource identifier contained in the resource reference file and the mapping relationship between the full path information and the resource identifier;
step 170, in the compiling execution process of the target project, according to the resource identifier in the code file, searching the full path information corresponding to the resource identifier through the resource reference file, and calling the resource file according to the full path information.
After the resource reference file is obtained, in order to improve the simplicity of the code of the target project, the full path information corresponding to the resource identifier may be replaced in the code file of the target project by the resource identifier according to the resource identifier included in the resource reference file and the mapping relationship between the full path information and the resource identifier. In addition, in the encoding process of the target item, the full path information corresponding to the resource identifier can be directly replaced according to the resource identifier contained in the resource reference file.
For example, we bp may be replaced by the above-described resource identification ajkr. ajh _ FBBD _ ICON _ JG, spelling/images/ajh _ FBBD _ ICON _ JG of full path information in the code file of the target item, and so on.
In the compiling and executing process of the target item, the full path information corresponding to the resource identifier can be searched for through the resource reference file according to the resource identifier in the code file, and the resource file can be called according to the full path information.
Optionally, in an embodiment of the present invention, the target project is a Flutter project, and the total configuration file is a pubspec.
In the embodiment of the invention, the convenience of resource management can be improved by automatically declaring the resources into the pubspec. Moreover, the picture files such as PNG, JPEG and the like can be automatically processed into WebP in the declaration process, so that the total volume of the project is reduced. In addition, a resource reference file can be generated, and the way of identifying resources in the resource reference file which are referenced in the project replaces the spelling of all-path information at all places, so that the possibility of errors of all-path spelling is reduced, and the code is more concise.
In the embodiment of the present invention, each resource file in the resource file directory may be sequentially read, and then the above steps may be sequentially performed for each resource file, so as to convert the resource file in the first target format into the resource file in the second target format, declare the converted resource file in the second target format into the total configuration file, and simultaneously write the resource identifier of the converted resource file in the second target format into the resource reference file, and directly declare the resource files of other resource types except the first target format into the total configuration file, and simultaneously write the resource identifiers of the resource files of other resource types except the first target format into the resource reference file, until the last resource file in the resource file directory is traversed and processed. Fig. 3 is a flow chart illustrating a resource management process. Where pubspec.yaml is the total configuration file and r.g.dart is the resource reference file.
Referring to fig. 4, a schematic structural diagram of a resource management apparatus in the embodiment of the present invention is shown.
The resource management device of the embodiment of the invention comprises: a resource type acquisition module 210, a first resource declaration module 220, and a second resource declaration module 230.
The functions of the modules and the interaction relationship between the modules are described in detail below.
A resource type obtaining module 210, configured to scan each resource file in a resource file directory corresponding to a target project during an encoding stage of the target project, and obtain a resource type of each resource file;
a first resource declaration module 220, configured to, for each resource file, respond to that the resource type of the resource file is in a first target format, convert the resource file into a second target format, obtain full path information of the converted resource file in the second target format, and add a declaration for the resource file in the second target format in the total configuration file according to the full path information;
a second resource declaration module 230, configured to, in response to that the resource type of the resource file is not the first target format, obtain full path information of the resource file, and add a declaration for the resource file in the total configuration file according to the full path information;
wherein, the statement includes the full path information, and the resource file of the second target format is smaller than the resource file of the first target format.
Referring to fig. 5, in the embodiment of the present invention, the resource type obtaining module 210 further includes:
a path scanning submodule 211, configured to scan a path of each resource file in a resource file directory corresponding to the target project, to obtain full path information of each resource file, where the full path information includes an access path of the resource file, a file name of the resource file, and a file suffix name of the resource file;
the resource type obtaining sub-module 212 is configured to obtain a resource type of each resource file according to the file suffix name of the resource file.
Optionally, in this embodiment of the present invention, the first resource declaration module 220 further includes:
the path construction information acquisition submodule is used for acquiring full path information of the resource file in the first target format and a file suffix name matched with the second target format;
and the full path information acquisition submodule is used for replacing the file suffix name in the full path information of the picture resource in the first target format by the file suffix name matched with the second target format, and taking the replaced full path information as the full path information of the resource file in the second target format.
Optionally, in this embodiment of the present invention, the second resource declaration module 230 may further include:
the full path information processing submodule is used for replacing the path fields of the specified levels in the full path information through file wildcards according to the levels of all the path fields in the initial full path information of the resource file to obtain the final full path information of the resource file;
and the resource declaration sub-module is used for adding a declaration aiming at the resource file in the total configuration file according to the final full path information of the resource file.
Optionally, the first target format includes at least one of a PNG picture format, a JPEG picture format, and a GIF picture format, and the second target format includes a WebP picture format.
Referring to fig. 5, in an embodiment of the present invention, the apparatus may further include:
a resource identifier generating module 240, configured to generate, for any at least one resource file, a resource identifier of the resource file according to full path information of the resource file, where a data length of the resource identifier is smaller than a data length of the full path information;
and a resource reference file generating module 250, configured to write the resource identifier into a resource reference file of the target project, and establish a mapping relationship between the full path information and the resource identifier in the resource reference file.
Referring to fig. 5, in an embodiment of the present invention, the apparatus may further include:
a full path replacing module 260, configured to replace, according to a resource identifier included in the resource reference file and a mapping relationship between the full path information and the resource identifier, the full path information in the code file of the target item by the resource identifier;
and a resource file calling module 270, configured to, in the compiling execution process of the target item, search, according to the resource identifier in the code file, full path information corresponding to the resource identifier through the resource reference file, and call a resource file according to the full path information.
Optionally, the target project is a Flutter project, and the total configuration file is a pubspec.
The resource management device provided in the embodiment of the present invention can implement each process implemented in the method embodiments of fig. 1 to fig. 2, and is not described herein again to avoid repetition.
Preferably, an embodiment of the present invention further provides an electronic device, including: the processor, the memory, and the computer program stored in the memory and capable of running on the processor, when executed by the processor, implement the processes of the above-mentioned resource management method embodiments, and can achieve the same technical effects, and in order to avoid repetition, details are not described here again.
The embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when being executed by a processor, the computer program implements each process of the embodiment of the resource management method, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here. The computer-readable storage medium may be a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk.
Fig. 6 is a schematic diagram of a hardware structure of an electronic device implementing various embodiments of the present invention.
The electronic device 500 includes, but is not limited to: a radio frequency unit 501, a network module 502, an audio output unit 503, an input unit 504, a sensor 505, a display unit 506, a user input unit 507, an interface unit 508, a memory 509, a processor 510, and a power supply 511. Those skilled in the art will appreciate that the electronic device configuration shown in fig. 6 does not constitute a limitation of the electronic device, and that the electronic device may include more or fewer components than shown, or some components may be combined, or a different arrangement of components. In the embodiment of the present invention, the electronic device includes, but is not limited to, a mobile phone, a tablet computer, a notebook computer, a palm computer, a vehicle-mounted terminal, a wearable device, a pedometer, and the like.
It should be understood that, in the embodiment of the present invention, the radio frequency unit 501 may be used for receiving and sending signals during a message sending and receiving process or a call process, and specifically, receives downlink data from a base station and then processes the received downlink data to the processor 510; in addition, the uplink data is transmitted to the base station. In general, radio frequency unit 501 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like. In addition, the radio frequency unit 501 can also communicate with a network and other devices through a wireless communication system.
The electronic device provides wireless broadband internet access to the user via the network module 502, such as assisting the user in sending and receiving e-mails, browsing web pages, and accessing streaming media.
The audio output unit 503 may convert audio data received by the radio frequency unit 501 or the network module 502 or stored in the memory 509 into an audio signal and output as sound. Also, the audio output unit 503 may also provide audio output related to a specific function performed by the electronic apparatus 500 (e.g., a call signal reception sound, a message reception sound, etc.). The audio output unit 503 includes a speaker, a buzzer, a receiver, and the like.
The input unit 504 is used to receive an audio or video signal. The input Unit 504 may include a Graphics Processing Unit (GPU) 5041 and a microphone 5042, and the Graphics processor 5041 processes image data of a still picture or video obtained by an image capturing device (e.g., a camera) in a video capturing mode or an image capturing mode. The processed image frames may be displayed on the display unit 506. The image frames processed by the graphic processor 5041 may be stored in the memory 509 (or other storage medium) or transmitted via the radio frequency unit 501 or the network module 502. The microphone 5042 may receive sounds and may be capable of processing such sounds into audio data. The processed audio data may be converted into a format output transmittable to a mobile communication base station via the radio frequency unit 501 in case of the phone call mode.
The electronic device 500 also includes at least one sensor 505, such as light sensors, motion sensors, and other sensors. Specifically, the light sensor includes an ambient light sensor that can adjust the brightness of the display panel 5061 according to the brightness of ambient light, and a proximity sensor that can turn off the display panel 5061 and/or a backlight when the electronic device 500 is moved to the ear. As one type of motion sensor, an accelerometer sensor can detect the magnitude of acceleration in each direction (generally three axes), detect the magnitude and direction of gravity when stationary, and can be used to identify the posture of an electronic device (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), and vibration identification related functions (such as pedometer, tapping); the sensors 505 may also include fingerprint sensors, pressure sensors, iris sensors, molecular sensors, gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., which are not described in detail herein.
The display unit 506 is used to display information input by the user or information provided to the user. The Display unit 506 may include a Display panel 5061, and the Display panel 5061 may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like.
The user input unit 507 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the electronic device. Specifically, the user input unit 507 includes a touch panel 5071 and other input devices 5072. Touch panel 5071, also referred to as a touch screen, may collect touch operations by a user on or near it (e.g., operations by a user on or near touch panel 5071 using a finger, stylus, or any suitable object or attachment). The touch panel 5071 may include two parts of a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 510, and receives and executes commands sent by the processor 510. In addition, the touch panel 5071 may be implemented in various types such as a resistive type, a capacitive type, an infrared ray, and a surface acoustic wave. In addition to the touch panel 5071, the user input unit 507 may include other input devices 5072. In particular, other input devices 5072 may include, but are not limited to, a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which are not described in detail herein.
Further, the touch panel 5071 may be overlaid on the display panel 5061, and when the touch panel 5071 detects a touch operation thereon or nearby, the touch operation is transmitted to the processor 510 to determine the type of the touch event, and then the processor 510 provides a corresponding visual output on the display panel 5061 according to the type of the touch event. Although in fig. 6, the touch panel 5071 and the display panel 5061 are two independent components to implement the input and output functions of the electronic device, in some embodiments, the touch panel 5071 and the display panel 5061 may be integrated to implement the input and output functions of the electronic device, and is not limited herein.
The interface unit 508 is an interface for connecting an external device to the electronic apparatus 500. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device having an identification module, an audio input/output (I/O) port, a video I/O port, an earphone port, and the like. The interface unit 508 may be used to receive input (e.g., data information, power, etc.) from external devices and transmit the received input to one or more elements within the electronic apparatus 500 or may be used to transmit data between the electronic apparatus 500 and external devices.
The memory 509 may be used to store software programs as well as various data. The memory 509 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the cellular phone, and the like. Further, the memory 509 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device.
The processor 510 is a control center of the electronic device, connects various parts of the whole electronic device by using various interfaces and lines, performs various functions of the electronic device and processes data by running or executing software programs and/or modules stored in the memory 509 and calling data stored in the memory 509, thereby performing overall monitoring of the electronic device. Processor 510 may include one or more processing units; preferably, the processor 510 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into processor 510.
The electronic device 500 may further include a power supply 511 (e.g., a battery) for supplying power to various components, and preferably, the power supply 511 may be logically connected to the processor 510 via a power management system, so as to implement functions of managing charging, discharging, and power consumption via the power management system.
In addition, the electronic device 500 includes some functional modules that are not shown, and are not described in detail herein.
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 an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
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 invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
While the present invention has been described with reference to the embodiments shown in the drawings, the present invention is not limited to the embodiments, which are illustrative and not restrictive, and it will be apparent to those skilled in the art that various changes and modifications can be made therein without departing from the spirit and scope of the invention as defined in the appended claims.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a U disk, a removable hard disk, a ROM, a RAM, a magnetic disk, or an optical disk.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (11)

1. A method for resource management, comprising:
in the encoding stage of a target project, scanning each resource file in a resource file directory corresponding to the target project to obtain the resource type of each resource file;
for each resource file, responding to the resource type of the resource file being in a first target format, converting the resource file into a second target format, acquiring full path information of the converted resource file in the second target format, and adding a statement aiming at the resource file in the second target format in the total configuration file according to the full path information;
responding to the fact that the resource type of the resource file is not in the first target format, acquiring full path information of the resource file, and adding a statement aiming at the resource file in the total configuration file according to the full path information;
wherein, the statement includes the full path information, and the resource file of the second target format is smaller than the resource file of the first target format.
2. The method according to claim 1, wherein the step of scanning each resource file in the resource file directory corresponding to the target project to obtain the resource type of each resource file comprises:
scanning a path of each resource file in a resource file directory corresponding to the target project to obtain full path information of each resource file, wherein the full path information comprises an access path of the resource file, a file name of the resource file and a file suffix name of the resource file;
and acquiring the resource type of each resource file according to the file suffix name of the resource file.
3. The method according to claim 2, wherein the step of obtaining the full path information of the resource file in the second target format comprises:
acquiring full path information of the resource file in the first target format and a file suffix name matched with the second target format;
and replacing the file suffix name in the full path information of the picture resource in the first target format by the file suffix name matched with the second target format, and taking the replaced full path information as the full path information of the resource file in the second target format.
4. A method according to any of claims 1-3, wherein the step of adding a statement for the resource file in the global configuration file based on the full path information comprises:
replacing the path fields of the specified hierarchy in the full path information by file wildcards according to the hierarchy of each path field in the initial full path information of the resource file to obtain the final full path information of the resource file;
and adding a statement aiming at the resource file in the total configuration file according to the final full path information of the resource file.
5. The method of any of claims 1-3, wherein the first target format comprises at least one of a PNG picture format, a JPEG picture format, and a GIF picture format, and wherein the second target format comprises a WebP picture format.
6. The method according to any one of claims 1-3, further comprising:
aiming at any at least one resource file, generating a resource identifier of the resource file according to the full path information of the resource file, wherein the data length of the resource identifier is smaller than that of the full path information;
and writing the resource identifier into a resource reference file of the target project, and establishing a mapping relation between the full path information and the resource identifier in the resource reference file.
7. The method of claim 6, further comprising:
replacing the full path information by the resource identifier in the code file of the target project according to the resource identifier contained in the resource reference file and the mapping relation between the full path information and the resource identifier;
and in the compiling and executing process of the target project, searching full path information corresponding to the resource identifier through the resource reference file according to the resource identifier in the code file, and calling the resource file according to the full path information.
8. The method according to any of claims 1-3, wherein the target project is a Flutter project and the total configuration file is a pubspec.
9. A resource management apparatus, comprising:
the resource type acquisition module is used for scanning each resource file in a resource file directory corresponding to a target project in an encoding stage of the target project to acquire the resource type of each resource file;
a first resource declaration module, configured to, for each resource file, respond to that a resource type of the resource file is in a first target format, convert the resource file into a second target format, obtain full path information of the converted resource file in the second target format, and add a declaration for the resource file in the second target format in the total configuration file according to the full path information;
a second resource declaration module, configured to, in response to that a resource type of the resource file is not in the first target format, obtain full path information of the resource file, and add a declaration for the resource file in the total configuration file according to the full path information;
wherein, the statement includes the full path information, and the resource file of the second target format is smaller than the resource file of the first target format.
10. An electronic device, comprising: memory, processor and computer program stored on the memory and executable on the processor, which computer program, when executed by the processor, carries out the steps of the resource management method according to any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that a computer program is stored thereon, which computer program, when being executed by a processor, carries out the steps of the resource management method according to any one of claims 1 to 8.
CN202010982892.5A 2020-09-17 2020-09-17 Resource management method and device, electronic equipment and storage medium Active CN112084747B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010982892.5A CN112084747B (en) 2020-09-17 2020-09-17 Resource management method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010982892.5A CN112084747B (en) 2020-09-17 2020-09-17 Resource management method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112084747A true CN112084747A (en) 2020-12-15
CN112084747B CN112084747B (en) 2024-02-02

Family

ID=73737310

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010982892.5A Active CN112084747B (en) 2020-09-17 2020-09-17 Resource management method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112084747B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112817913A (en) * 2021-04-19 2021-05-18 浙江华创视讯科技有限公司 Data transmission method and device, electronic equipment and storage medium
CN113986376A (en) * 2021-10-25 2022-01-28 土巴兔集团股份有限公司 Resource file updating method based on Flutter platform and related equipment thereof
CN114489639A (en) * 2021-12-22 2022-05-13 北京达佳互联信息技术有限公司 File generation method, device, equipment and storage medium
WO2023174040A1 (en) * 2022-03-17 2023-09-21 华为技术有限公司 Picture processing method and related device
CN117112500A (en) * 2023-10-17 2023-11-24 天津市天河计算机技术有限公司 Resource management method, device, equipment and storage medium

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017219526A1 (en) * 2016-06-23 2017-12-28 乐视控股(北京)有限公司 Method for using graphic file format and storage device
CN108829378A (en) * 2018-05-24 2018-11-16 北京顺丰同城科技有限公司 A kind of development approach of application software, device and electronic equipment
CN108846118A (en) * 2018-06-27 2018-11-20 成都优易数据有限公司 A kind of implementation method of intelligent adaptation multi-data source
CN109621406A (en) * 2018-12-06 2019-04-16 网易(杭州)网络有限公司 A kind of generation method and device of configuration file
CN109739600A (en) * 2018-12-26 2019-05-10 网易传媒科技(北京)有限公司 Data processing method, medium, device and calculating equipment
US20190310835A1 (en) * 2017-03-28 2019-10-10 Tencent Technology (Shenzhen) Company Limited Application development method, tool, and device, and storage medium
CN110990023A (en) * 2019-12-16 2020-04-10 上海钧正网络科技有限公司 aar file dependency uploading method and device, storage medium and electronic equipment
CN111459465A (en) * 2020-03-27 2020-07-28 北京五八信息技术有限公司 Method and device for generating Flutter engineering file
CN111538502A (en) * 2020-03-27 2020-08-14 北京达佳互联信息技术有限公司 Installation package processing method and device, electronic equipment and storage medium

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017219526A1 (en) * 2016-06-23 2017-12-28 乐视控股(北京)有限公司 Method for using graphic file format and storage device
US20190310835A1 (en) * 2017-03-28 2019-10-10 Tencent Technology (Shenzhen) Company Limited Application development method, tool, and device, and storage medium
CN108829378A (en) * 2018-05-24 2018-11-16 北京顺丰同城科技有限公司 A kind of development approach of application software, device and electronic equipment
CN108846118A (en) * 2018-06-27 2018-11-20 成都优易数据有限公司 A kind of implementation method of intelligent adaptation multi-data source
CN109621406A (en) * 2018-12-06 2019-04-16 网易(杭州)网络有限公司 A kind of generation method and device of configuration file
CN109739600A (en) * 2018-12-26 2019-05-10 网易传媒科技(北京)有限公司 Data processing method, medium, device and calculating equipment
CN110990023A (en) * 2019-12-16 2020-04-10 上海钧正网络科技有限公司 aar file dependency uploading method and device, storage medium and electronic equipment
CN111459465A (en) * 2020-03-27 2020-07-28 北京五八信息技术有限公司 Method and device for generating Flutter engineering file
CN111538502A (en) * 2020-03-27 2020-08-14 北京达佳互联信息技术有限公司 Installation package processing method and device, electronic equipment and storage medium

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
GREGPENG: "【Flutter学习】Flutter工程目录介绍、资源管理、不同分辨率图片、添加依赖 - gregpeng - 博客园 (cnblogs.com)", 《HTTPS://WWW.CNBLOGS.COM/GREGPENG/P/10934330.HTML》, pages 1 - 8 *
MR_TIGERCHOU: "Flutter系列之图片的声明和使用", 《HTTPS://BLOG.CSDN.NET/SHVING/ARTICLE/DETAILS/107732994》, pages 1 - 6 *
俞小怡;金玉玲;常艳;: "机构知识库开源软件Dspace的开发策略研究", 现代情报, no. 06, pages 140 - 142 *

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112817913A (en) * 2021-04-19 2021-05-18 浙江华创视讯科技有限公司 Data transmission method and device, electronic equipment and storage medium
CN112817913B (en) * 2021-04-19 2021-07-09 浙江华创视讯科技有限公司 Data transmission method and device, electronic equipment and storage medium
CN113986376A (en) * 2021-10-25 2022-01-28 土巴兔集团股份有限公司 Resource file updating method based on Flutter platform and related equipment thereof
CN114489639A (en) * 2021-12-22 2022-05-13 北京达佳互联信息技术有限公司 File generation method, device, equipment and storage medium
WO2023174040A1 (en) * 2022-03-17 2023-09-21 华为技术有限公司 Picture processing method and related device
CN117112500A (en) * 2023-10-17 2023-11-24 天津市天河计算机技术有限公司 Resource management method, device, equipment and storage medium
CN117112500B (en) * 2023-10-17 2024-01-26 天津市天河计算机技术有限公司 Resource management method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN112084747B (en) 2024-02-02

Similar Documents

Publication Publication Date Title
CN112084747B (en) Resource management method and device, electronic equipment and storage medium
CN109917995B (en) Object processing method and terminal equipment
CN109885257B (en) Disk file reading and writing method and device
US11658932B2 (en) Message sending method and terminal device
CN111381992B (en) Crash log processing method and device, electronic equipment and storage medium
CN110035181B (en) Method and terminal for setting theme of quick application card
CN110020293B (en) Multimedia data display method, device and storage medium
CN111723002A (en) Code debugging method and device, electronic equipment and storage medium
CN111399819B (en) Data generation method, device, electronic equipment and storage medium
CN110908750B (en) Screen capturing method and electronic equipment
CN109063079B (en) Webpage labeling method and electronic equipment
CN109117037B (en) Image processing method and terminal equipment
CN105335434B (en) Log management method and device and electronic equipment
CN111130995B (en) Image control method, electronic device, and storage medium
CN113407169A (en) Software development method and device
CN106230919B (en) File uploading method and device
CN111163227B (en) Sharing method and electronic equipment
CN109871324B (en) Control operation method and device
CN109889568B (en) Data export method, server and system
CN112433721B (en) Application modularization processing method and device, electronic equipment and storage medium
CN115904367A (en) Front-end scaffold processing method and device, electronic equipment and storage medium
CN111049989B (en) Image display method and electronic equipment
CN109918340B (en) File processing method and terminal equipment
CN109753204B (en) Text processing method and mobile terminal
CN109413276B (en) Information display method and terminal equipment

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