CN114416641A - File data processing method and device, electronic equipment and storage medium - Google Patents

File data processing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN114416641A
CN114416641A CN202111677990.9A CN202111677990A CN114416641A CN 114416641 A CN114416641 A CN 114416641A CN 202111677990 A CN202111677990 A CN 202111677990A CN 114416641 A CN114416641 A CN 114416641A
Authority
CN
China
Prior art keywords
file
resource
target
application program
information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111677990.9A
Other languages
Chinese (zh)
Inventor
弓晓东
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing 58 Information Technology Co Ltd
Original Assignee
Beijing 58 Information 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 58 Information Technology Co Ltd filed Critical Beijing 58 Information Technology Co Ltd
Priority to CN202111677990.9A priority Critical patent/CN114416641A/en
Publication of CN114416641A publication Critical patent/CN114416641A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/11File system administration, e.g. details of archiving or snapshots
    • 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/17Details of further file system functions
    • G06F16/178Techniques for file synchronisation in file systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • G06F9/4451User profiles; Roaming

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)
  • Software Systems (AREA)
  • Human Computer Interaction (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention provides a file data processing method, a file data processing device, electronic equipment and a storage medium, wherein the method comprises the following steps: in the process of managing the static resources of the application program, a resource file directory corresponding to the application program and a current resource management file can be acquired, when a file adjustment operation for the resource file exists, file information corresponding to the file adjustment operation can be acquired in response to the file adjustment operation for the resource file in the resource file directory, then the current resource management file is updated according to the file information to generate a target resource management file, and resource information updating is performed on other data files corresponding to the application program according to the target resource management file to obtain a corresponding target data file.

Description

File data processing method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a method for processing file data, an apparatus for processing file data, an electronic device, and a computer-readable storage medium.
Background
With the development of the internet industry, information provided by an application program is gradually enriched, and the data content displayed by the application program is also enriched. In the process of developing an application program, some static resources, including JavaScript script files, Cascading Style Sheets (CSS) resources or pictures, need to be linked. For example, when developing a Flutter application, it is often necessary to add a corresponding static resource, and for the used static resource, it is necessary to declare first and then refer to the static resource through a path of the resource. However, when static resources are modified, there are problems that modification is inconvenient, resource files are easily not found, and resource files are too many to manage easily.
Disclosure of Invention
The embodiment of the invention provides a file data processing method, a file data processing device, electronic equipment and a computer readable storage medium, and aims to solve or partially solve the problem that when a resource file changes in an application development process, the resource file cannot be found or cannot be updated synchronously due to too many resource files.
The embodiment of the invention discloses a file data processing method, which comprises the following steps:
acquiring a resource file directory corresponding to an application program and a current resource management file;
responding to a file adjustment operation aiming at the resource files in the resource file directory, and acquiring file information corresponding to the file adjustment operation;
updating the current resource management file according to the file information to generate a target resource management file corresponding to the application program;
and updating the resource information of the data file corresponding to the application program according to the target resource management file to obtain a target data file corresponding to the application program.
Optionally, the file information includes a file path, and the obtaining, in response to a file adjustment operation for a resource file in the resource file directory, file information corresponding to the file modification operation includes:
in response to a file modification operation for a resource file in the resource file directory, determining a target resource file corresponding to the file modification operation and modification information corresponding to the file modification operation;
and determining a target file path corresponding to the target resource file according to the modification information.
Optionally, the determining, according to the modification information, a target file path corresponding to the target resource file includes:
if the modification information represents that the file name of the target resource file is modified, acquiring the modified target file name of the target resource file, and determining a target file path corresponding to the target resource file based on the target file name;
and if the modification information represents that the file path modification is carried out on the target resource file, acquiring a target file path corresponding to the target resource file.
Optionally, the file information includes a file path, and the obtaining, in response to a file adjustment operation for a resource file in the resource file directory, file information corresponding to the file modification operation includes:
responding to a file replacement operation aiming at the resource files in the resource file directory, determining an initial resource file and a target resource file corresponding to the file replacement operation, replacing the initial resource file with the target resource file in the resource file directory, and acquiring a target file path corresponding to the target resource file.
Optionally, the file information includes a file path, and the obtaining, in response to a file adjustment operation for a resource file in the resource file directory, file information corresponding to the file modification operation includes:
and responding to a file deletion operation aiming at the resource files in the resource file directory, determining a target resource file corresponding to the file deletion operation, deleting the target resource file in the resource file directory, and acquiring a target file path corresponding to the target resource file.
Optionally, the updating the current resource management file according to the file information to generate a target resource management file corresponding to the application program includes:
searching a static resource identifier corresponding to the target resource file from the current resource management file, and acquiring an original file path corresponding to the static resource identifier;
and replacing the original file path with the target file path to update the current resource management file, and generating a target resource management file corresponding to the application program.
Optionally, the data file includes a code file, and the updating resource information of the data file corresponding to the application program according to the target resource management file to obtain the target data file corresponding to the application program includes:
in the process of editing the application program, searching a resource reference code corresponding to the static resource identifier from a current code file corresponding to the application program, wherein the resource reference code comprises an original file path of the target resource file;
and replacing the original file path with the target file path to update the current code file, and generating a target code file corresponding to the application program.
Optionally, the data file includes a configuration file, and the updating resource information of the data file corresponding to the application program according to the target resource management file to obtain the target data file corresponding to the application program includes:
in the process of editing the application program, searching resource declaration information corresponding to the static resource identifier from a current configuration file corresponding to the application program, wherein the resource declaration information comprises an original file path of the target resource file;
and replacing the original file path with the target file path to update the current configuration file, and generating a target configuration file corresponding to the application program.
Optionally, before the obtaining the resource file directory corresponding to the application program and the current resource management file, the method further includes:
in response to a code editing operation for an application program, obtaining source code data corresponding to the code editing operation, the source code data including a resource reference code;
traversing the source code data, extracting an initial file path corresponding to the resource reference code, and creating a static resource identifier corresponding to the resource reference code;
and constructing a current resource management file corresponding to the application program by adopting the static resource identifier and the initial file path corresponding to the static resource identifier.
The embodiment of the invention also discloses a file data processing device, which comprises:
the management file acquisition module is used for acquiring a resource file directory corresponding to the application program and a current resource management file;
the file information acquisition module is used for responding to file adjustment operation aiming at the resource files in the resource file directory and acquiring file information corresponding to the file adjustment operation;
the management file updating module is used for updating the current resource management file according to the file information and generating a target resource management file corresponding to the application program;
and the data file updating module is used for updating the resource information of the data file corresponding to the application program according to the target resource management file to obtain the target data file corresponding to the application program.
Optionally, the file information includes a file path, and the file information obtaining module includes:
the modification information determining submodule is used for responding to a file modification operation aiming at the resource files in the resource file directory, and determining a target resource file corresponding to the file modification operation and modification information corresponding to the file modification operation;
and the file path determining submodule is used for determining a target file path corresponding to the target resource file according to the modification information.
Optionally, the file path determining sub-module is specifically configured to:
if the modification information represents that the file name of the target resource file is modified, acquiring the modified target file name of the target resource file, and determining a target file path corresponding to the target resource file based on the target file name;
and if the modification information represents that the file path modification is carried out on the target resource file, acquiring a target file path corresponding to the target resource file.
Optionally, the file information includes a file path, and the file information obtaining module includes:
and the file replacement submodule is used for responding to a file replacement operation aiming at the resource file in the resource file directory, determining an initial resource file and a target resource file corresponding to the file replacement operation, replacing the initial resource file with the target resource file in the resource file directory, and acquiring a target file path corresponding to the target resource file.
Optionally, the file information includes a file path, and the file information obtaining module includes:
and the file deleting submodule is used for responding to a file deleting operation aiming at the resource files in the resource file directory, determining a target resource file corresponding to the file deleting operation, deleting the target resource file in the resource file directory and acquiring a target file path corresponding to the target resource file.
Optionally, the management file updating module includes:
a file path obtaining sub-module, configured to search a static resource identifier corresponding to the target resource file from the current resource management file, and obtain an original file path corresponding to the static resource identifier;
and the management file updating submodule is used for replacing the original file path with the target file path to update the current resource management file and generate a target resource management file corresponding to the application program.
Optionally, the data file includes a code file, and the data file updating module includes:
a source code determining submodule, configured to search, in a process of editing the application program, a resource reference code corresponding to the static resource identifier from a current code file corresponding to the application program, where the resource reference code includes an original file path of the target resource file;
and the code file updating submodule is used for replacing the original file path with the target file path to update the current code file and generate a target code file corresponding to the application program.
Optionally, the data file includes a configuration file, and the data file updating module includes:
a statement information search sub-module, configured to search, in a process of editing the application program, resource statement information corresponding to the static resource identifier from a current configuration file corresponding to the application program, where the resource statement information includes an original file path of the target resource file;
and the configuration file generation submodule is used for replacing the original file path with the target file path to update the current configuration file and generate a target configuration file corresponding to the application program.
Optionally, the apparatus further comprises:
the code editing module is used for responding to code editing operation aiming at an application program and acquiring source code data corresponding to the code editing operation, wherein the source code data comprises a resource reference code;
the resource identifier creating module is used for traversing the source code data, extracting an initial file path corresponding to the resource reference code and creating a static resource identifier corresponding to the resource reference code;
and the management file generation module is used for constructing a current resource management file corresponding to the application program by adopting the static resource identifier and the initial file path corresponding to the static resource identifier.
The embodiment of the invention also discloses electronic equipment which comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory finish mutual communication through the communication bus;
the memory is used for storing a computer program;
the processor is configured to implement the method according to the embodiment of the present invention when executing the program stored in the memory.
Also disclosed is a computer-readable storage medium having instructions stored thereon, which, when executed by one or more processors, cause the processors to perform a method according to an embodiment of the invention.
The embodiment of the invention has the following advantages:
in the embodiment of the invention, in the process of managing the static resource of the application program, by acquiring the resource file directory corresponding to the application program and the current resource management file, when the file adjustment operation for the resource file exists, the file information corresponding to the file adjustment operation can be acquired in response to the file adjustment operation for the resource file in the resource file directory, then the current resource management file is updated according to the file information to generate the target resource management file, and the resource information of other data files corresponding to the application program is updated according to the target resource management file to obtain the corresponding target data file, so that in the development process of the application program, developers can reduce the attention to the change of the static resource themselves, manage the change of the resource file through the resource management file, the method and the device realize one-stop static resource management, improve the convenience of static resource management, and synchronously update other data files corresponding to the application program through the resource management file when the static resource changes, thereby ensuring the consistency of the static resource in the application program.
Drawings
FIG. 1 is a flowchart illustrating steps of a method for processing document data according to an embodiment of the present invention;
fig. 2 is a block diagram of a file data processing apparatus provided in an embodiment of the present invention;
FIG. 3 is a block diagram of an electronic device provided in an embodiment of the invention;
fig. 4 is a schematic diagram of a computer-readable storage medium provided in an embodiment of the present invention.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in further detail below.
As an example, in the development process of the application program, in order to enrich the content of the application program presentation, the developer may link some static resources including JavaScript script files, Cascading Style Sheets (CSS) resources or pictures, etc. in the development process to enrich the presentation of the application program. Flutter is an SDK (Software Development Kit) that can be used to construct a cross-platform application, and developers can run on android and IOS platforms by writing a code, and often need to add corresponding static resources when developing Flutter applications, and for the used static resources, declares the static resources first and then refers to the static resources through the path of the resources. However, when static resources are modified, there are problems that modification is inconvenient, resource files are easily not found, and resource files are too many to manage easily.
In view of the above, one of the core invention points of the embodiment of the present invention is to construct a resource management file corresponding to a static resource of an application program, record resource information corresponding to each static resource in the resource management file, and simultaneously update the resource information in the resource management file synchronously with the change of the static resource in the development process of the application program, so as to implement one-stop resource management, thereby not only improving the convenience of static resource management, but also ensuring the consistency of the static resource in the application program by updating other data files corresponding to the application program synchronously with the resource management file when the static resource changes.
Specifically, referring to fig. 1, a flowchart illustrating steps of a file data processing method provided in an embodiment of the present invention is shown, which may specifically include the following steps:
step 101, acquiring a resource file directory corresponding to an application program and a current resource management file;
optionally, for the development of the application program, it may include a code file, a configuration file, a resource file, and the like, where the code file may include source code required for the application program to run; the configuration file can comprise information for declaring related contents required by the application program to run, such as declarations of running parameters, declarations of static resource files and the like; the resource files can include static resource files required by the running process of the application program, including JavaScript script files, cascading style sheet resources or pictures and the like. For example, when a static resource needs to be used, a developer needs to declare in a configuration file and then fill in the full path of the resource file at the source code using the picture, so as to realize the use of the static resource. In the process, when the resource file needs to be added or the file name of the resource file needs to be modified, the source code and the configuration file need to be modified, on one hand, modifying the name of the resource file may result in that the source code using the resource file cannot find the corresponding resource file, on the other hand, the number of the resource files is large, management is not easy, and great work difficulty is brought to developers.
In contrast, in the development process of the application program, a resource management file for managing the static resource file related to the application program may be constructed, and the related information of the static resource file, including the file name, the file path, and the like of the static resource file, may be recorded by the resource management file.
In a specific implementation, in a development process of an application program, in response to a code editing operation for the application program, source code data corresponding to the code editing operation may be acquired, where the source code data includes a resource reference code, the source code data is traversed, an initial file path corresponding to the resource reference code is extracted, a static resource identifier corresponding to the resource reference code is created, and a current resource management file corresponding to the application program is constructed by using the static resource identifier and the initial file path corresponding to the static resource identifier. Specifically, for a source code, which may include a resource reference code that references a related static resource file, in the process of editing the source code, a developer may construct a related plug-in to detect the type of the code, identify all resource reference codes, extract an initial file path of a static resource corresponding to the resource reference code, then create a resource management file corresponding to an application program, generate a static resource identifier corresponding to each resource reference code in the resource management file, and then construct a resource management file corresponding to the application program according to a correspondence between the static resource identifier and the initial file path. Each static resource identifier in the resource management file corresponds to a unique resource path of a static resource, for example, the static resource identifier (i) corresponds to the static resource a, the static resource identifier (ii) corresponds to the static resource B, and the like, which is not limited in the present invention.
After the corresponding resource management file is constructed, developers can further construct corresponding resource management plug-ins (such as idea plug-ins) to monitor changes of static resources in the development process, and when the static resources change, the resource management file can be updated so as to synchronously update contents related to the static resource file in each data file corresponding to the application program. Specifically, in the development process, the corresponding resource management plug-in may be operated, and the resource file directory corresponding to the application program may be monitored by the resource management plug-in, and when operations such as file creation, deletion, replacement, modification and the like occur, the resource management file may be updated.
Step 102, responding to a file adjustment operation aiming at a resource file in the resource file directory, and acquiring file information corresponding to the file adjustment operation;
in the embodiment of the present invention, the application program may correspond to a resource file directory, and all static resource files required by the application program during running, such as an assets directory, may be stored in the resource file directory. When the static resource file in the resource file directory changes, the corresponding file information can be acquired, and the resource management file is updated. The file adjustment operation for the resource file may include a file modification operation, a file replacement operation, a file deletion operation, and the like, and since the use of the data file (code file, configuration file, and the like) of the application program for the resource file is generally to refer to a corresponding file path, the file information may be a file path, and when the file information changes, the file path after the change of the resource file may be determined, and the file path in the resource management file may be updated.
In a specific implementation, for a file modification operation, a target resource file corresponding to the file modification operation and modification information corresponding to the file modification operation may be determined in response to the file modification operation for a resource file in a resource file directory, and then a target file path corresponding to the target resource file may be determined according to the modification information. If the modification information represents that the file name of the target resource file is modified, the name of the target file after the modification of the target resource file is obtained, and a target file path corresponding to the target resource file is determined based on the name of the target file; and if the modification information represents that the file path modification is carried out on the target resource file, acquiring a target file path corresponding to the target resource file. For the file path, it may be composed of the file name of the resource file, the folder in which the resource file is located, for example, "assets/images/getx 1. png", etc., for the file path modification, the resource file may be moved to another folder for the developer; for the modification of the file name, when the file name of the resource file changes, the corresponding file path also changes, for example, "assets/images/getx 1. png" changes to "assets/images/getx 2. png" or the like, so that when the file path of the resource file changes or the file name changes, the changed target file path can be determined, so as to update the original file path of the corresponding resource file recorded in the resource management file, and maintain the consistency of the file path between the resource management file and each static resource file.
For the file replacement operation, in response to a file replacement operation for a resource file in a resource file directory, an initial resource file and a target resource file corresponding to the file replacement operation are determined, the initial resource file is replaced by the target resource file in the resource file directory, and a target file path corresponding to the target resource file is obtained. Specifically, if a certain resource file in the resource file directory is replaced, a target file path of the target resource file after replacement is obtained, for example, the picture resource getx1 located in the same file path is replaced with getx2, and a target file path "assets/images/getx 2. png" corresponding to getx2 can be obtained, so that when the resource file is replaced, the original file path of the corresponding resource file recorded in the resource management file can be updated through the target file path of the target resource file after replacement, and consistency of the file paths between the resource management file and each static resource file is maintained.
For the file deletion operation, in response to a file deletion operation for a resource file in the resource file directory, a target resource file corresponding to the file deletion operation is determined, the target resource file is deleted in the resource file directory, and a target file path corresponding to the target resource file is acquired. Specifically, if the corresponding resource file is deleted in the resource file directory, the target file path of the deleted resource file may be obtained, so as to delete the corresponding content in the resource management file, and ensure the consistency of the file path between the resource management file and each static resource file.
By monitoring the resource file directory corresponding to the application program, when the resource file in the directory is modified, replaced, deleted and the like, the changed file path of the resource file can be determined in real time, so that the file path recorded in the resource management file can be updated.
103, updating the current resource management file according to the file information to generate a target resource management file corresponding to the application program;
in the resource management file, each static resource identifier corresponds to a unique file path of the static resource file, the static resource identifier corresponding to the target resource file can be searched from the current resource management file, the original file path corresponding to the static resource identifier is obtained, then the original file path is replaced by the target file path to update the current resource management file, and the target resource management file corresponding to the application program is generated, so that in the development process of the application program, developers can reduce the attention to the change of the static resource, and the change of the resource file is managed through the resource management file, so that one-stop static resource management is realized.
And 104, updating the resource information of the data file corresponding to the application program according to the target resource management file to obtain a target data file corresponding to the application program.
For the application program, the configuration file is configured with a statement of the static resource file, the code file has references to the static resource file, and the code file corresponds to the file path of the static resource file, so that after the resource management file is updated, the file paths of the corresponding static resource files in the configuration file and the code file can be updated according to the file path of the static resource file recorded by the resource management file, so as to ensure the consistency of the file paths of the same static resource file in each data file in the application program. Optionally, the resource management file includes a static resource identifier and a file path corresponding to the static resource file, the code file includes a resource reference code and a file path of the static resource file to be referred to, and the configuration file includes resource declaration information and a file path of the declared static resource file, so that the static resource identifier corresponds to the resource reference code, and the static resource identifier corresponds to the resource declaration information one to one, and thus the file paths of the corresponding static resource files in the code file and the configuration file can be synchronized according to the resource management file through the correspondence between the static resource identifier and the resource reference code, and the static resource identifier and the resource declaration information.
The resource reference code may be a code for referring to the relevant static resource file in the code file, how to use the resource file, and the like, and the resource declaration information may be information for declaring the relevant static resource file in the configuration file, such as what type of file the resource file is.
Specifically, in the process of editing the application program, a resource reference code corresponding to the static resource identifier is searched from a current code file corresponding to the application program, the resource reference code includes an original file path of the target resource file, and then the original file path is replaced with the target file path to update the current code file, so as to generate a target code file corresponding to the application program. And searching resource declaration information corresponding to the static resource identifier from a current configuration file corresponding to the application program, wherein the resource declaration information comprises an original file path of the target resource file, replacing the original file path with the target file path to update the current configuration file, and generating the target configuration file corresponding to the application program, so that when the static resource changes, other data files corresponding to the application program can be synchronously updated through the resource management file, and the consistency of the static resource in the application program is ensured.
In the embodiment of the invention, in the process of managing the static resource of the application program, by acquiring the resource file directory corresponding to the application program and the current resource management file, when the file adjustment operation for the resource file exists, the file information corresponding to the file adjustment operation can be acquired in response to the file adjustment operation for the resource file in the resource file directory, then the current resource management file is updated according to the file information to generate the target resource management file, and the resource information of other data files corresponding to the application program is updated according to the target resource management file to obtain the corresponding target data file, so that in the development process of the application program, developers can reduce the attention to the change of the static resource themselves, manage the change of the resource file through the resource management file, the method and the device realize one-stop static resource management, improve the convenience of static resource management, and synchronously update other data files corresponding to the application program through the resource management file when the static resource changes, thereby ensuring the consistency of the static resource in the application program.
It should be noted that, for simplicity of description, the method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the illustrated order of acts, as some steps may occur in other orders or concurrently in accordance with the embodiments of the present invention. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred and that no particular act is required to implement the invention.
Referring to fig. 2, a block diagram of a structure of a file data processing apparatus provided in the embodiment of the present invention is shown, and specifically, the structure may include the following modules:
a management file obtaining module 201, configured to obtain a resource file directory corresponding to the application program and a current resource management file;
a file information obtaining module 202, configured to respond to a file adjustment operation for a resource file in the resource file directory, and obtain file information corresponding to the file adjustment operation;
a management file updating module 203, configured to update the current resource management file according to the file information, and generate a target resource management file corresponding to the application program;
and the data file updating module 204 is configured to update the resource information of the data file corresponding to the application program according to the target resource management file, and obtain a target data file corresponding to the application program.
In an optional embodiment, the file information includes a file path, and the file information obtaining module 202 includes:
the modification information determining submodule is used for responding to a file modification operation aiming at the resource files in the resource file directory, and determining a target resource file corresponding to the file modification operation and modification information corresponding to the file modification operation;
and the file path determining submodule is used for determining a target file path corresponding to the target resource file according to the modification information.
In an optional embodiment, the file path determining sub-module is specifically configured to:
if the modification information represents that the file name of the target resource file is modified, acquiring the modified target file name of the target resource file, and determining a target file path corresponding to the target resource file based on the target file name;
and if the modification information represents that the file path modification is carried out on the target resource file, acquiring a target file path corresponding to the target resource file.
In an optional embodiment, the file information includes a file path, and the file information obtaining module 202 includes:
and the file replacement submodule is used for responding to a file replacement operation aiming at the resource file in the resource file directory, determining an initial resource file and a target resource file corresponding to the file replacement operation, replacing the initial resource file with the target resource file in the resource file directory, and acquiring a target file path corresponding to the target resource file.
In an optional embodiment, the file information includes a file path, and the file information obtaining module 202 includes:
and the file deleting submodule is used for responding to a file deleting operation aiming at the resource files in the resource file directory, determining a target resource file corresponding to the file deleting operation, deleting the target resource file in the resource file directory and acquiring a target file path corresponding to the target resource file.
In an alternative embodiment, the management file updating module 203 comprises:
a file path obtaining sub-module, configured to search a static resource identifier corresponding to the target resource file from the current resource management file, and obtain an original file path corresponding to the static resource identifier;
and the management file updating submodule is used for replacing the original file path with the target file path to update the current resource management file and generate a target resource management file corresponding to the application program.
In an alternative embodiment, the data file comprises a code file, and the data file updating module 204 comprises:
a source code determining submodule, configured to search, in a process of editing the application program, a resource reference code corresponding to the static resource identifier from a current code file corresponding to the application program, where the resource reference code includes an original file path of the target resource file;
and the code file updating submodule is used for replacing the original file path with the target file path to update the current code file and generate a target code file corresponding to the application program.
In an alternative embodiment, the data file includes a configuration file, and the data file updating module 204 includes:
a statement information search sub-module, configured to search, in a process of editing the application program, resource statement information corresponding to the static resource identifier from a current configuration file corresponding to the application program, where the resource statement information includes an original file path of the target resource file;
and the configuration file generation submodule is used for replacing the original file path with the target file path to update the current configuration file and generate a target configuration file corresponding to the application program.
In an alternative embodiment, the apparatus further comprises:
the code editing module is used for responding to code editing operation aiming at an application program and acquiring source code data corresponding to the code editing operation, wherein the source code data comprises a resource reference code;
the resource identifier creating module is used for traversing the source code data, extracting an initial file path corresponding to the resource reference code and creating a static resource identifier corresponding to the resource reference code;
and the management file generation module is used for constructing a current resource management file corresponding to the application program by adopting the static resource identifier and the initial file path corresponding to the static resource identifier.
For the device embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
In addition, an electronic device is further provided in the embodiments of the present invention, as shown in fig. 3, and includes a processor 301, a communication interface 302, a memory 303, and a communication bus 304, where the processor 301, the communication interface 302, and the memory 303 complete mutual communication through the communication bus 304,
a memory 303 for storing a computer program;
the processor 301, when executing the program stored in the memory 303, implements the following steps:
acquiring a resource file directory corresponding to an application program and a current resource management file;
responding to a file adjustment operation aiming at the resource files in the resource file directory, and acquiring file information corresponding to the file adjustment operation;
updating the current resource management file according to the file information to generate a target resource management file corresponding to the application program;
and updating the resource information of the data file corresponding to the application program according to the target resource management file to obtain a target data file corresponding to the application program.
In an optional embodiment, the file information includes a file path, and the obtaining, in response to a file adjustment operation for a resource file in the resource file directory, file information corresponding to the file modification operation includes:
in response to a file modification operation for a resource file in the resource file directory, determining a target resource file corresponding to the file modification operation and modification information corresponding to the file modification operation;
and determining a target file path corresponding to the target resource file according to the modification information.
In an optional embodiment, the determining, according to the modification information, a target file path corresponding to the target resource file includes:
if the modification information represents that the file name of the target resource file is modified, acquiring the modified target file name of the target resource file, and determining a target file path corresponding to the target resource file based on the target file name;
and if the modification information represents that the file path modification is carried out on the target resource file, acquiring a target file path corresponding to the target resource file.
In an optional embodiment, the file information includes a file path, and the obtaining, in response to a file adjustment operation for a resource file in the resource file directory, file information corresponding to the file modification operation includes:
responding to a file replacement operation aiming at the resource files in the resource file directory, determining an initial resource file and a target resource file corresponding to the file replacement operation, replacing the initial resource file with the target resource file in the resource file directory, and acquiring a target file path corresponding to the target resource file.
In an optional embodiment, the file information includes a file path, and the obtaining, in response to a file adjustment operation for a resource file in the resource file directory, file information corresponding to the file modification operation includes:
and responding to a file deletion operation aiming at the resource files in the resource file directory, determining a target resource file corresponding to the file deletion operation, deleting the target resource file in the resource file directory, and acquiring a target file path corresponding to the target resource file.
In an optional embodiment, the updating the current resource management file according to the file information and generating a target resource management file corresponding to the application program include:
searching a static resource identifier corresponding to the target resource file from the current resource management file, and acquiring an original file path corresponding to the static resource identifier;
and replacing the original file path with the target file path to update the current resource management file, and generating a target resource management file corresponding to the application program.
In an optional embodiment, the data file includes a code file, and the updating resource information of the data file corresponding to the application program according to the target resource management file to obtain the target data file corresponding to the application program includes:
in the process of editing the application program, searching a resource reference code corresponding to the static resource identifier from a current code file corresponding to the application program, wherein the resource reference code comprises an original file path of the target resource file;
and replacing the original file path with the target file path to update the current code file, and generating a target code file corresponding to the application program.
In an optional embodiment, the data file includes a configuration file, and the updating resource information of the data file corresponding to the application program according to the target resource management file to obtain the target data file corresponding to the application program includes:
in the process of editing the application program, searching resource declaration information corresponding to the static resource identifier from a current configuration file corresponding to the application program, wherein the resource declaration information comprises an original file path of the target resource file;
and replacing the original file path with the target file path to update the current configuration file, and generating a target configuration file corresponding to the application program.
In an optional embodiment, before the obtaining the resource file directory corresponding to the application program and the current resource management file, the method further includes:
in response to a code editing operation for an application program, obtaining source code data corresponding to the code editing operation, the source code data including a resource reference code;
traversing the source code data, extracting an initial file path corresponding to the resource reference code, and creating a static resource identifier corresponding to the resource reference code;
and constructing a current resource management file corresponding to the application program by adopting the static resource identifier and the initial file path corresponding to the static resource identifier.
The communication bus mentioned in the above terminal may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the terminal and other equipment.
The Memory may include a Random Access Memory (RAM) or a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the Integrated Circuit may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, or a discrete hardware component.
As shown in fig. 4, in another embodiment provided by the present invention, a computer-readable storage medium 401 is further provided, which stores instructions that, when executed on a computer, cause the computer to execute the processing method of file data described in the above embodiment.
In still another embodiment provided by the present invention, a computer program product containing instructions is also provided, which when run on a computer, causes the computer to execute the processing method of file data described in the above embodiments.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, 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 identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (12)

1. A method for processing file data is characterized by comprising the following steps:
acquiring a resource file directory corresponding to an application program and a current resource management file;
responding to a file adjustment operation aiming at the resource files in the resource file directory, and acquiring file information corresponding to the file adjustment operation;
updating the current resource management file according to the file information to generate a target resource management file corresponding to the application program;
and updating the resource information of the data file corresponding to the application program according to the target resource management file to obtain a target data file corresponding to the application program.
2. The method of claim 1, wherein the file information comprises a file path, and wherein the obtaining the file information corresponding to the file modification operation in response to the file adjustment operation for the resource file in the resource file directory comprises:
in response to a file modification operation for a resource file in the resource file directory, determining a target resource file corresponding to the file modification operation and modification information corresponding to the file modification operation;
and determining a target file path corresponding to the target resource file according to the modification information.
3. The method according to claim 2, wherein the determining a target file path corresponding to the target resource file according to the modification information includes:
if the modification information represents that the file name of the target resource file is modified, acquiring the modified target file name of the target resource file, and determining a target file path corresponding to the target resource file based on the target file name;
and if the modification information represents that the file path modification is carried out on the target resource file, acquiring a target file path corresponding to the target resource file.
4. The method of claim 1, wherein the file information comprises a file path, and wherein the obtaining the file information corresponding to the file modification operation in response to the file adjustment operation for the resource file in the resource file directory comprises:
responding to a file replacement operation aiming at the resource files in the resource file directory, determining an initial resource file and a target resource file corresponding to the file replacement operation, replacing the initial resource file with the target resource file in the resource file directory, and acquiring a target file path corresponding to the target resource file.
5. The method of claim 1, wherein the file information comprises a file path, and wherein the obtaining the file information corresponding to the file modification operation in response to the file adjustment operation for the resource file in the resource file directory comprises:
and responding to a file deletion operation aiming at the resource files in the resource file directory, determining a target resource file corresponding to the file deletion operation, deleting the target resource file in the resource file directory, and acquiring a target file path corresponding to the target resource file.
6. The method according to claim 2, 3, 4 or 5, wherein the updating the current resource management file according to the file information and generating the target resource management file corresponding to the application program comprises:
searching a static resource identifier corresponding to the target resource file from the current resource management file, and acquiring an original file path corresponding to the static resource identifier;
and replacing the original file path with the target file path to update the current resource management file, and generating a target resource management file corresponding to the application program.
7. The method according to claim 6, wherein the data file includes a code file, and the updating the resource information of the data file corresponding to the application program according to the target resource management file to obtain the target data file corresponding to the application program includes:
in the process of editing the application program, searching a resource reference code corresponding to the static resource identifier from a current code file corresponding to the application program, wherein the resource reference code comprises an original file path of the target resource file;
and replacing the original file path with the target file path to update the current code file, and generating a target code file corresponding to the application program.
8. The method according to claim 6, wherein the data file includes a configuration file, and the updating the resource information of the data file corresponding to the application program according to the target resource management file to obtain the target data file corresponding to the application program includes:
in the process of editing the application program, searching resource declaration information corresponding to the static resource identifier from a current configuration file corresponding to the application program, wherein the resource declaration information comprises an original file path of the target resource file;
and replacing the original file path with the target file path to update the current configuration file, and generating a target configuration file corresponding to the application program.
9. The method of claim 1, wherein prior to obtaining the resource file directory corresponding to the application and the current resource management file, the method further comprises:
in response to a code editing operation for an application program, obtaining source code data corresponding to the code editing operation, the source code data including a resource reference code;
traversing the source code data, extracting an initial file path corresponding to the resource reference code, and creating a static resource identifier corresponding to the resource reference code;
and constructing a current resource management file corresponding to the application program by adopting the static resource identifier and the initial file path corresponding to the static resource identifier.
10. An apparatus for processing document data, comprising:
the management file acquisition module is used for acquiring a resource file directory corresponding to the application program and a current resource management file;
the file information acquisition module is used for responding to file adjustment operation aiming at the resource files in the resource file directory and acquiring file information corresponding to the file adjustment operation;
the management file updating module is used for updating the current resource management file according to the file information and generating a target resource management file corresponding to the application program;
and the data file updating module is used for updating the resource information of the data file corresponding to the application program according to the target resource management file to obtain the target data file corresponding to the application program.
11. An electronic device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;
the memory is used for storing a computer program;
the processor, when executing a program stored on the memory, implementing the method of any of claims 1-9.
12. A computer-readable storage medium having stored thereon instructions, which when executed by one or more processors, cause the processors to perform the method of any one of claims 1-9.
CN202111677990.9A 2021-12-31 2021-12-31 File data processing method and device, electronic equipment and storage medium Pending CN114416641A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111677990.9A CN114416641A (en) 2021-12-31 2021-12-31 File data processing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111677990.9A CN114416641A (en) 2021-12-31 2021-12-31 File data processing method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114416641A true CN114416641A (en) 2022-04-29

Family

ID=81272319

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111677990.9A Pending CN114416641A (en) 2021-12-31 2021-12-31 File data processing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114416641A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107992557A (en) * 2017-11-28 2018-05-04 平安养老保险股份有限公司 Static resource update method, device, storage medium and computer equipment
CN111258503A (en) * 2020-01-15 2020-06-09 广州广哈通信股份有限公司 Management method and device of CIROS file system
CN113114515A (en) * 2021-05-12 2021-07-13 北京字节跳动网络技术有限公司 Resource file configuration method and device
US20210342327A1 (en) * 2020-04-30 2021-11-04 EMC IP Holding Company LLC Method, device, and computer program product for information processing

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107992557A (en) * 2017-11-28 2018-05-04 平安养老保险股份有限公司 Static resource update method, device, storage medium and computer equipment
CN111258503A (en) * 2020-01-15 2020-06-09 广州广哈通信股份有限公司 Management method and device of CIROS file system
US20210342327A1 (en) * 2020-04-30 2021-11-04 EMC IP Holding Company LLC Method, device, and computer program product for information processing
CN113114515A (en) * 2021-05-12 2021-07-13 北京字节跳动网络技术有限公司 Resource file configuration method and device

Similar Documents

Publication Publication Date Title
US10621211B2 (en) Language tag management on international data storage
US10565293B2 (en) Synchronizing DOM element references
US9864736B2 (en) Information processing apparatus, control method, and recording medium
CN107783766B (en) Method and device for cleaning files of application program
WO2020211236A1 (en) Read-write conflict resolution method and apparatus employing b+ tree and storage medium
CN103678487A (en) Method and device for generating web page snapshot
JP2018116496A (en) Difference detection device and program
US20190384463A1 (en) User interface development
CN110781091A (en) Application program testing method and device, electronic equipment and storage medium
CN111984264B (en) Static library generation method and device
CN112257005A (en) Form component generation method and device
CN111176901A (en) HDFS deleted file recovery method, terminal device and storage medium
JP2014219708A (en) Information processing device, information processing method, and program
CN114416641A (en) File data processing method and device, electronic equipment and storage medium
CN114170044A (en) Automatic declaring method, device, storage medium and electronic equipment
JP6336919B2 (en) Source code review method and system
CN110309315B (en) Template file generation method and device, computer readable medium and electronic equipment
CN112540820A (en) User interface updating method and device and electronic equipment
CN112130860A (en) JSON object analysis method and device, electronic device and storage medium
CN110888643A (en) Page processing method and device
CN113408250B (en) Project file processing method and device
JP5398077B2 (en) Importance determination method, storage system, and program for data stored in storage device
US20240061762A1 (en) On-demand contextual trace log generation
CN116483324A (en) Multi-terminal parallel development method, device, equipment, medium and product of low-code platform
CN115034182A (en) Page rendering 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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20220429