CN116266112A - File processing method, device, equipment and computer readable storage medium - Google Patents

File processing method, device, equipment and computer readable storage medium Download PDF

Info

Publication number
CN116266112A
CN116266112A CN202111544127.6A CN202111544127A CN116266112A CN 116266112 A CN116266112 A CN 116266112A CN 202111544127 A CN202111544127 A CN 202111544127A CN 116266112 A CN116266112 A CN 116266112A
Authority
CN
China
Prior art keywords
module
file
target
route
entry file
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111544127.6A
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.)
China Mobile Communications Group Co Ltd
China Mobile Suzhou Software Technology Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
China Mobile Suzhou Software 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 China Mobile Communications Group Co Ltd, China Mobile Suzhou Software Technology Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN202111544127.6A priority Critical patent/CN116266112A/en
Publication of CN116266112A publication Critical patent/CN116266112A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/35Creation or generation of source code model driven
    • G06F8/355Round-trip engineering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/37Compiler construction; Parser generation
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The embodiment of the application discloses a file processing method, which comprises the following steps: acquiring a processing instruction carrying a module identifier and used for compiling a target module; determining an entry file of a target module corresponding to the module identifier based on the processing instruction through the target object; compiling the file to be compiled of the target module corresponding to the module identifier based on the entry file. The embodiment of the application also discloses a file processing device, equipment and a computer readable storage medium.

Description

File processing method, device, equipment and computer readable storage medium
Technical Field
The present invention relates to a document processing technology in the field of document processing, and in particular, to a method, an apparatus, a device, and a computer readable storage medium for processing a document.
Background
The modular development is a great trend of continuously increasing the size and complexity of front-end codes, a system structure based on function division is adopted in the related technology, the project is divided into modules, but for large projects, due to the large number of modules, the coupling degree among the modules is high, many developers only care about the modules which are developed by themselves, however, codes of all the modules are compiled every time when parameters of a certain module need to be modified, so that the development efficiency is low.
Disclosure of Invention
In order to solve the above technical problems, it is desirable in the embodiments of the present application to provide a method, an apparatus, a device, and a computer readable storage medium for file processing, which solve the problem of low development efficiency in the related art.
The technical scheme of the application is realized as follows:
a method of file processing, the method comprising:
acquiring a processing instruction carrying a module identifier and used for compiling a target module;
determining an entry file of the target module corresponding to the module identifier based on the processing instruction through the target object;
and compiling the file to be compiled of the target module corresponding to the module identifier based on the entry file.
In the above solution, the determining, by the target object, the entry file of the target module corresponding to the module identifier based on the processing instruction includes:
initializing configuration parameters of a compiler based on the processing instructions;
generating a request carrying a module identifier for acquiring an entry file of the target module based on the configuration parameters;
and determining, by a target object, the entry file of the target module corresponding to the module identification based on the request.
In the above solution, the determining, by the target object, the entry file of the target module corresponding to the module identifier based on the request includes:
acquiring module information of a plurality of functional modules;
transmitting the module information and the request to a second function through a first function;
the portal file is determined based on the request and the module information by the second function.
In the above aspect, the determining, by a second function, the entry file based on the request and the module information includes:
acquiring an entry file corresponding to the module identifier from the module information based on the request through the second function, and storing the entry file in a target virtual module file;
acquiring the target virtual module file based on a main entry file, and acquiring the entry file from the target virtual module file; the main entry file is an initial entry file for compiling a task corresponding to the target module.
In the above scheme, compiling the file to be compiled of the target module corresponding to the module identifier based on the entry file includes:
determining the identification of the file to be compiled based on the entry file and the target dependency relationship table;
and acquiring the file to be compiled based on the identification of the file to be compiled, and compiling the file to be compiled.
In the above scheme, the method further comprises:
receiving an access request; the access request carries an access route;
determining whether the access route exists in a target route table based on the access request;
and setting the access route as the route of the inaccessible page under the condition that the access route is not contained in the target route table.
In the above scheme, the method further comprises:
acquiring the type of the access route under the condition that the access route is in the target route table;
and acquiring page information of the access page corresponding to the access route based on the type.
A document processing apparatus, the apparatus comprising:
the acquisition unit is used for acquiring a processing instruction carrying a module identifier and used for compiling the target module;
the processing unit is used for determining an entry file of the target module corresponding to the module identifier based on the processing instruction through the target object;
and the processing unit is further used for compiling the file to be compiled of the target module corresponding to the module identifier based on the entry file.
A document processing apparatus, the apparatus comprising: a processor, a memory, and a communication bus;
the communication bus is used for realizing communication connection between the processor and the memory;
the processor is configured to execute a file processing program in the memory to implement the steps of:
acquiring a processing instruction carrying a module identifier and used for compiling a target module;
determining an entry file of the target module corresponding to the module identifier based on the processing instruction through the target object;
and compiling the file to be compiled of the target module corresponding to the module identifier based on the entry file.
A computer-readable storage medium storing one or more programs executable by one or more processors to implement the steps of the above-described file processing method.
The file processing method, device, equipment and computer readable storage medium provided by the embodiment of the application acquire a processing instruction carrying a module identifier and used for compiling a target module; determining an entry file of a target module corresponding to the module identifier based on the processing instruction through the target object; compiling a file to be compiled of a target module corresponding to the module identifier based on the entry file; therefore, the entry file of the target module corresponding to the module identifier is determined, and the file to be compiled of the target module corresponding to the module identifier is compiled based on the entry file, so that the designated module can be compiled, and the development efficiency is improved.
Drawings
Fig. 1 is a schematic flow chart of a file processing method according to an embodiment of the present application;
FIG. 2 is a flowchart illustrating another document processing method according to an embodiment of the present disclosure;
FIG. 3 is a schematic diagram of a system frame of a document processing system according to an embodiment of the present disclosure;
fig. 4 is a schematic flow chart of route interception in a file processing system according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a functional module in a file processing method according to an embodiment of the present application;
FIG. 6 is a flowchart illustrating another method for processing a file according to an embodiment of the present disclosure;
FIG. 7 is a schematic structural diagram of a document processing apparatus according to an embodiment of the present disclosure;
fig. 8 is a schematic structural diagram of a document processing apparatus according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application.
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application.
An embodiment of the present application provides a file processing method, applied to a file processing device, as shown in fig. 1, including the following steps:
step 101, obtaining a processing instruction carrying a module identifier and used for compiling the target module.
Wherein the module identifier can uniquely refer to the target module to be compiled. The module identification includes, but is not limited to, a module name.
In the embodiment of the application, the file processing device can detect the input operation of the user and generate the processing instruction carrying the module identifier according to the input operation of the user.
In one possible implementation, when a compiling command is input by a compiling interface of the file processing device, a user may specify a target module to be compiled in the compiling command by a "module=modulename" parameter.
Step 102, determining an entry file of the target module corresponding to the module identification based on the processing instruction through the target object.
Wherein the target object comprises a target plug-in or a target function; the entry file is a file for providing an entry for the call target module.
In the embodiment of the application, through the target object, the entry file corresponding to the module identifier can be determined based on the module identifier in the processing instruction.
And 103, compiling the file to be compiled of the target module corresponding to the module identifier based on the entry file.
In this embodiment of the present application, the file processing device may compile a file to be compiled in a target module according to an entry file of the target module, so that dynamic compilation is implemented according to requirements, that is, when parameters (codes) of which module need to be modified, only the entry file of the module needs to be found, and further, compilation of the file to be compiled of the module is implemented through the entry file of the module, so that when parameters of a certain module need to be modified in a related technology, compilation is often required to be performed on a plurality of modules, thereby reducing development workload and improving development efficiency.
According to the file processing method provided by the embodiment of the application, a processing instruction carrying a module identifier and used for compiling a target module is obtained; determining an entry file of a target module corresponding to the module identifier based on the processing instruction through the target object; compiling a file to be compiled of a target module corresponding to the module identifier based on the entry file; therefore, the entry file of the target module corresponding to the module identifier can be determined, and the file to be compiled of the target module corresponding to the module identifier is compiled based on the entry file, so that the designated module can be compiled, and the development efficiency is improved.
Based on the foregoing embodiments, the embodiments of the present application further provide a file processing method, as shown in fig. 2, where the method includes:
step 201, the file processing device obtains a processing instruction carrying a module identifier for compiling the target module.
Step 202, the file processing device initializes the configuration parameters of the compiler based on the processing instructions.
In the embodiment of the application, the configuration parameters of the compiler can be initialized based on the module identifier in the processing instruction, so that the initialized configuration parameters of the compiler have the module identifier.
In one possible implementation manner, the processing instruction may be read, the configuration parameter constructed at this time in the compiler is initialized, and after the initialization is completed, the value of "npm _config_module" in the configuration parameter is the module identifier of the target module to be compiled in the processing instruction.
Step 203, the file processing device generates a request for acquiring the entry file of the target module, which carries the module identifier, based on the configuration parameters.
In the embodiment of the application, whether the target module has the entry file or not can be determined based on the configuration parameters, and a request for acquiring the entry file of the target module, which carries the module identifier, is generated under the condition that the target module has the entry file.
It should be noted that, the target module refers to a function module to be compiled selected by a user from a plurality of function modules, each function module has an entry file, when it is determined that the entry file does not exist in the target module, it indicates that a module identifier input by the user in a processing instruction is wrong, that is, a wrong module identifier is input, and at this time, alarm information may be generated to remind the user of the error of the module identifier input; the target module may also be a sub-module in a certain function module selected by the user from the plurality of function modules.
In one possible implementation manner, a save path of the target module corresponding to the module identifier may be obtained based on the configuration parameter, and which files are in the target module may be queried through the save path of the target module, so as to determine whether the target module has an entry file, where the save path may be a file storage list of the target module stored in advance. In another possible implementation, after initializing the configuration parameters of the compiler based on the processing instruction, the configuration parameters have a save path of the target module, and whether the target module has an entry file may be determined by traversing the configuration parameters.
Step 204, the file processing device determines, through the target object, an entry file of the target module corresponding to the module identifier based on the request.
In the embodiment of the application, the module information of the target module corresponding to the module identifier can be acquired by the target object according to the request, and the entry file of the target module is determined based on the module information.
Wherein step 204 may be implemented by:
a1, the file processing device acquires module information of a plurality of functional modules.
The module information of the function module refers to information of the function module itself.
In the embodiment of the present application, the file processing device may acquire module information of each of the plurality of functional modules.
a2, the file processing device transmits module information and a request to a second function through the first function.
Wherein the first function may be a function called by the second function; the target object includes a first function and a second function.
In the embodiment of the application, the first function may be called by the second function, so that the first function transmits module information and requests of the plurality of functional modules to the second function. Wherein the first function as a whole is passed as a parameter to the second function.
In one possible implementation, the first function may be a callback function, the second function may be a hook function, and the module information of the plurality of functional modules and a request carrying the module identifier for obtaining the entry file of the target module may be transferred to the hook function through the callback function, so that the hook function may perform some operations based on the incoming callback function to obtain the entry file.
a3, the file processing device determines an entry file based on the request and the module information through a second function.
In this embodiment of the present application, according to the request, the second function may determine module information of the target module corresponding to the module identifier from the module information of the plurality of functional modules, and then determine the entry file from the module information of the target module.
Specifically, the second function is a hook function, the hook function calls a callback function, so that the callback function transfers the callback function to the hook function as a parameter, the hook function determines a request carrying a module identifier for acquiring an entry file of a target module and module information of a plurality of functional modules from the callback function, determines the module information of the target module from the module information of the plurality of functional modules according to the module identifier in the request, and then determines the entry file from the module information of the target module.
In one possible implementation, the hook function may be afterEnvironment hook, where afterEnvironmentHook is one of the hook functions in the weback workflow; weback is a modular packer.
It should be noted that step a3 may also be implemented by step b 1-2:
b1, the file processing device obtains an entry file corresponding to the module identifier from the module information based on the request through a second function, and stores the entry file in the target virtual module file.
Wherein, the target virtual module file refers to a file which can be identified for compiling.
In this embodiment of the present application, through the second function, an entry file corresponding to the module identifier is obtained from the module information based on the request, where the entry file cannot be directly used for compiling, and the entry file needs to be stored in the target virtual module file, so that the entry file is obtained through the target virtual module file during compiling later, and compiling of the target module is achieved based on the entry file.
It should be noted that, in the embodiment of the present application, the second function may also be monitored through the custom plug-in, so as to obtain the target virtual module file from the second function, and store the target virtual module file.
And b2, the file processing equipment acquires the target virtual module file based on the main entry file, and acquires the entry file from the target virtual module file.
The main entry file is an initial entry file for compiling a task corresponding to the target module. The main entry file may specifically refer to a first accessed file when a program item of a task corresponding to a target module is accessed, all instruction functions are distributed from the main entry file, and then the corresponding function modules are found for processing, some initialization works are also performed here, and different function modules can be called according to different requests through the main entry file.
In the embodiment of the application, the request for acquiring the target virtual module file can be generated through the main entry file, the stored target virtual module file is acquired based on the request, and the entry file is determined from the target virtual module.
Step 205, the file processing device determines the identification of the file to be compiled based on the entry file and the target dependency table.
The target dependency relationship table refers to a relationship table for representing the dependency relationship between the entry file and other files; the identification of the file to be compiled can uniquely refer to the file to be compiled.
In the embodiment of the application, according to the entry file, the file processing device may query, from the target dependency table, the identifier of the other files in the target module associated with the entry file, and use the identifier as the identifier of the file to be compiled.
And 206, the file processing equipment acquires the file to be compiled based on the identification of the file to be compiled, and compiles the file to be compiled.
In this embodiment of the present application, a file to be compiled corresponding to an identifier of the file to be compiled may be obtained based on the identifier of the file to be compiled, an entry file is entered in the compiling process, the file to be compiled may be specifically parsed by using a loader, the content of the file to be compiled may be parsed into an Abstract Syntax Tree (AST), and a block file may be generated, thereby implementing compiling of the target module.
Based on the foregoing embodiment, in other embodiments of the present application, the file processing method may further include the following steps:
step 207, the file processing device receives an access request.
The access request carries the access route.
In the embodiment of the application, after compiling the target module is finished, that is, the user may access the compiled file by initiating an access request carrying the access route.
Step 207, the file processing device determines whether the target routing table has an access route or not based on the access request.
The target routing table is pre-stored routing information registered by the user.
In the embodiment of the application, the access route can be matched with the route information in the target route table, and whether the target route table has the route information matched with the access route or not is determined.
Step 208, the file processing device sets the access route as the route of the inaccessible page in the case that the target route table does not have the access route.
In this embodiment of the present application, if the target routing table does not have the access route, it indicates that the access route is illegal, that is, the access route does not have the authority to access the compiled file, and then the access route may be forcedly rewritten into the route of the inaccessible page.
In one possible implementation, the route for the inaccessible page may be a 404 route.
In step 209, the file processing apparatus obtains the type of the access route in the case where the access route is included in the target route table.
The type of the access route also refers to the authority type of the access route; the rights types include, but are not limited to, guest rights, general user rights, and administrator rights.
In the embodiment of the application, if the access route is included in the target route table, that is, the access route is legal, the identifier of the user can be obtained, and the authority type of the access route can be obtained according to the identifier of the user.
Step 210, based on the type, obtaining the target page accessed by the access route.
In the implementation of the application, the authority type of the user can be matched with the authority type in the target routing table, the routing information corresponding to the authority type matched with the authority type of the user in the target routing table is determined, whether the access route exists in the routing information corresponding to the authority type matched with the authority type of the user or not is determined, and if the access route exists, the target page accessed by the access route can be acquired.
Based on the foregoing embodiments, in other embodiments of the present application, the file processing method may be applied to a file processing system, as shown in fig. 3, where the file processing system includes: the above-described file processing method is implemented on the basis of such a system architecture, a framework module, a plurality of functional modules, and a common module (not shown in the common module diagram). Wherein the plurality of functional modules may include: function module a, function module B, function module C, and function module D.
In the embodiment of the application, the whole system architecture can be written by vue and packaged by weback; wherein vue is a set of progressive JavaScript frames for building user interfaces; the framework module is a base of the whole system, manages loading and registering of all functional modules and is responsible for the route interception of the file processing system and the realization of login functions. The method comprises the steps that the realization of the route interception and login functions is the operation executed by a file processing system when a user accesses a compiled file through an access request after compiling is completed; the module name of the function module, the routing sub-module and the state management sub-module in the function module can be obtained by analyzing the entry file (main entry file) of the framework module, and the registration of the routing sub-module and the state management sub-module can be completed by using vue $ store.
The login function is a key function for ensuring the safety of the system, belongs to a global function, is arranged in a frame module in design, is a static route, has higher priority than all routes in the functional module, is not logged in, and cannot be accessed by all pages in the file processing system after compiling is completed; the route interception is a key function of system authority filtering, also belongs to a global function, and adds a global route guard in the framework module to judge the authority of a user and the authority of an access route carried in a user request.
It should be noted that, when designing the route, besides the login route may be set in the frame module, two frame routes need to be reconfigured in the frame module, one is 404 routes, which is used to match all intercepted routes, and one is global matching routes, which is used to direct all inaccessible routes, and all routes that do not meet the interception condition will be redirected to 404 routes.
The specific implementation process of route interception is explained in detail below with reference to fig. 4.
Obtaining access route, determining whether the access route is in the target route table according to the target route table (namely judging whether the access route is registered route registered in the file processing system), and redirecting to 404 route under the condition that the access route is not in the target route table; wherein redirecting to 404 the route refers to forcefully rewriting the access route to a route of 404 pages; under the condition that the access route is determined to be in the target route table, the access route can be matched with a login route (log route) of a login page in the target route table, if the access route is matched with the route of the login page, the access route is determined to be the login route, whether the access route has a historical access record or not is determined (if a token exists, the access route does not have the historical access record), if the access route is the login route and has the historical access record, that is, the user accesses the login page last time, the access route can be jumped to a first page of the file processing system based on the access route, and if the access route is the login route and does not have the historical access record, the access route is adjusted to the login page based on the access route; if the access route is not the login route and the history access record does not exist in the access route, jumping to the login page based on the access route; if the access route is not a login route and the access route has a history access record, the access route is matched with an accessible route with authority in a target route table, whether the access route is the accessible route with authority is determined, if the access route is determined to be the accessible route with authority, page information of an access page corresponding to the designated first route is acquired, if the access route is determined to be not the accessible route with authority, whether the access route is a page without authority is determined based on the target route table, if the access route is determined to be a page without authority, the access page information of an access page corresponding to the designated second route is skipped, if the access route is determined to be a page with authority is determined, page information of an access page corresponding to the designated third route is acquired according to a production environment, or the access page is redirected to 404 to prompt a user without authority.
It should be noted that, the routes in the target routing table may be classified into a route having authority, a route having no authority in the production environment, and a route having no authority in the development environment, that is, the pages having no authority may include two types, the first type is a page having no authority in the production environment, and the second type is a test page in the development environment.
The functional modules are explained in detail below in connection with fig. 5.
The functional modules have complex and specific service functions, and each functional module is kept independent as far as possible, so that the coupling degree between the modules is reduced; each functional module must include an entry file (index. Js) that specifies the smallest granularity of compilable modules for identification registration by the framework module.
As shown in fig. 5, in the functional module, the view sub-module, the method sub-module, the tool sub-module, the state management sub-module, the routing sub-module, the entry file and the component sub-module can be divided by referring to the design concept of Feature First; the method sub-module, the view sub-module and the assembly sub-module can be further divided according to functions, so that searching and positioning of codes are facilitated, a single developer only needs to pay attention to codes of the self-developed modules, a state management sub-module and a routing sub-module in the self-module are maintained, and other functional modules are not affected when the codes are modified.
In addition, in the development process of a large project, some components or methods can be cited by a plurality of functional modules, and all the common contents of the functional modules are extracted through a common module, so that codes are multiplexed to the greatest extent, and the repetition of the codes is reduced. The content of the public module can be divided according to functions, routes can be registered in the public module, the routes in the public module are registered in a development mode of the system, and the routes are not registered in a production mode.
In the embodiment of the present application, a document processing method is also provided, and the document processing method is explained in detail below with reference to fig. 6.
In the traditional compiling process, a 'Normal Module Replace ment Plugin' plug-in is used for allowing different configuration files to be defined for differentiated packaging, but in the mode, a compiling module can only be fully compiled, the compiling performance shown in a large project is poor, in order to compile the appointed module (namely, the dynamic compiling of the split module), the use of the 'Normal Module Replace ment Plugin' plug-in the traditional compiling configuration is deleted firstly, and thus, in the compiling process, a main entry file (a main entry file of the project) of a framework module can be obtained.
In the file processing method provided by the application, as shown in fig. 6, a command carrying a module name of a functional module to be compiled can be input in an interactive operation interface of a file processing device before compiling, when a compiler performs configuration processing, a configuration parameter is initialized by reading the command, a request for acquiring an entry file of a target module carrying a module identifier is generated based on the initialization configuration parameter, an entry file of the target module corresponding to the module identifier is determined based on the request by a hook function, a virtualized module file with the entry file is acquired and stored by monitoring a hook function in the compiler, so that the virtualized module file is acquired based on a main entry file during compiling, the entry file is acquired from the virtualized module file, the file to be compiled is acquired based on the entry file, the file to be compiled is analyzed, a file path and a loader can be analyzed, and finally the file can be analyzed into an abstract syntax tree, and a block file is generated according to the abstract syntax tree.
According to the file processing method provided by the embodiment of the application, the entry file of the target module corresponding to the module identifier is determined, and the file to be compiled of the target module corresponding to the module identifier is compiled based on the entry file, so that the designated module can be compiled, and the development efficiency is improved.
Based on the foregoing embodiments, embodiments of the present application provide a document processing apparatus that may be applied to the document processing method provided in the corresponding embodiment of fig. 1 and 2, and referring to fig. 7, the document processing apparatus 3 may include:
an obtaining unit 31, configured to obtain a processing instruction carrying a module identifier and used for compiling a target module;
a processing unit 32, configured to determine, by the target object, an entry file of the target module corresponding to the module identifier based on the processing instruction;
the processing unit 32 is further configured to compile a file to be compiled of the target module corresponding to the module identifier based on the entry file.
In the embodiment of the present application, the processing unit 32 is further configured to perform the following steps:
initializing configuration parameters of a compiler based on the processing instructions;
generating a request carrying a module identifier for acquiring an entry file of the target module based on the configuration parameters;
and determining an entry file of the target module corresponding to the module identification based on the request through the target object.
In the embodiment of the present application, the processing unit 32 is further configured to perform the following steps:
acquiring module information of a plurality of functional modules;
transmitting the module information and the request to the second function through the first function;
an entry file is determined based on the request and the module information by a second function.
In the embodiment of the present application, the processing unit 32 is further configured to perform the following steps:
acquiring an entry file corresponding to the module identifier from the module information based on the request through a second function, and storing the entry file in a target virtual module file;
acquiring a target virtual module file based on the main entry file, and acquiring an entry file from the target virtual module file; the main entry file is an initial entry file for compiling a task corresponding to the target module.
In the embodiment of the present application, the processing unit 32 is further configured to perform the following steps:
determining the identification of the file to be compiled based on the entry file and the target dependency relationship table;
and acquiring the file to be compiled based on the identification of the file to be compiled, and compiling the file to be compiled.
In the embodiment of the present application, the processing unit 32 is further configured to perform the following steps:
receiving an access request; the access request carries an access route;
determining whether the target routing table has an access route based on the access request;
in the case where the access route is not present in the target route table, the access route is set as the route of the inaccessible page.
In the embodiment of the present application, the processing unit 32 is further configured to perform the following steps:
under the condition that the target routing table is provided with the access route, acquiring the type of the access route;
it should be noted that, in the interaction process between each unit in the embodiment of the present application, reference may be made to an implementation process in the file processing method provided in the embodiment corresponding to fig. 1 and fig. 2, which is not repeated herein.
According to the file processing device provided by the embodiment of the application, the entry file of the target module corresponding to the module identifier is determined, and the file to be compiled of the target module corresponding to the module identifier is compiled based on the entry file, so that the designated module can be compiled, and the development efficiency is improved.
Based on the foregoing embodiments, embodiments of the present application provide a file processing apparatus, which may be applied to the file processing method provided in the corresponding embodiments of fig. 1 and 2, and referring to fig. 8, the file processing apparatus 4 includes: a processor 42, a memory 41 and a communication bus 43, wherein:
a communication bus 43 for enabling a communication connection between the processor 42 and the memory 41;
the processor 42 is configured to execute a file processing program in the memory 41 to implement the following steps:
acquiring a processing instruction carrying a module identifier and used for compiling a target module;
determining an entry file of a target module corresponding to the module identifier based on the processing instruction through the target object;
compiling the file to be compiled of the target module corresponding to the module identifier based on the entry file.
In other embodiments of the present application, the processor 42 is configured to execute a pass-through target object of the file processing program in the memory 41, and determine, based on the processing instruction, an entry file of a target module corresponding to the module identifier, so as to implement the following steps:
initializing configuration parameters of a compiler based on the processing instructions;
generating a request carrying a module identifier for acquiring an entry file of the target module based on the configuration parameters;
and determining an entry file of the target module corresponding to the module identification based on the request through the target object.
In other embodiments of the present application, the processor 42 is configured to execute a pass-through target object of the file handler in the memory 41, determine, based on the request, an entry file of a target module corresponding to the module identifier, to implement the following steps:
acquiring module information of a plurality of functional modules;
transmitting the module information and the request to the second function through the first function;
an entry file is determined based on the request and the module information by a second function.
In other embodiments of the present application, the processor 42 is configured to execute a second function of the file handler in the memory 41 to determine the entry file based on the request and the module information to implement the following steps:
acquiring an entry file corresponding to the module identifier from the module information based on the request through a second function, and storing the entry file in a target virtual module file;
acquiring a target virtual module file based on the main entry file, and acquiring an entry file from the target virtual module file; the main entry file is an initial entry file for compiling a task corresponding to the target module.
In other embodiments of the present application, the processor 42 is configured to execute the entry-based file of the file processing program in the memory 41, and compile the file to be compiled of the target module corresponding to the module identifier, so as to implement the following steps:
determining the identification of the file to be compiled based on the entry file and the target dependency relationship table;
and acquiring the file to be compiled based on the identification of the file to be compiled, and compiling the file to be compiled.
In other embodiments of the present application, the processor 42 is configured to execute a file processing program in the memory 41, and is further configured to implement the following steps:
receiving an access request; the access request carries an access route;
determining whether the target routing table has an access route based on the access request;
in the case where the access route is not present in the target route table, the access route is set as the route of the inaccessible page.
In other embodiments of the present application, the processor 42 is configured to execute a file processing program in the memory 41, and is further configured to implement the following steps:
under the condition that the target routing table is provided with the access route, acquiring the type of the access route;
based on the type, page information of an access page corresponding to the access route is obtained.
It should be noted that, in the embodiment, the specific implementation process of the steps executed by the processor 42 may refer to the implementation process in the file processing method provided in the embodiment corresponding to fig. 1 and fig. 2, which is not described herein again.
According to the file processing equipment provided by the embodiment of the application, the entry file of the target module corresponding to the module identifier is determined, and the file to be compiled of the target module corresponding to the module identifier is compiled based on the entry file, so that the designated module can be compiled, and the development efficiency is improved.
Based on the foregoing embodiments, embodiments of the present application provide a computer-readable storage medium storing one or more programs executable by one or more processors to implement the steps of the file processing method provided by the corresponding embodiments of fig. 1 and 2.
The computer readable storage medium may be a Read Only Memory (ROM), a programmable Read Only Memory (Programmable Read-Only Memory, PROM), an erasable programmable Read Only Memory (Erasable Programmable Read-Only Memory, EPROM), an electrically erasable programmable Read Only Memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), a magnetic random access Memory (Ferromagnetic Random Access Memory, FRAM), a Flash Memory (Flash Memory), a magnetic surface Memory, an optical disk, or a compact disk Read Only Memory (Compact Disc Read-Only Memory, CD-ROM), or the like; but may be various electronic devices such as mobile phones, computers, tablet devices, personal digital assistants, etc., that include one or any combination of the above-mentioned memories.
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 one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The foregoing embodiment numbers of the present application are merely for describing, and do not represent advantages or disadvantages of the embodiments.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk), comprising several instructions for causing a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the method described in the embodiments of the present application.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The foregoing description is only of the preferred embodiments of the present application, and is not intended to limit the scope of the claims, and all equivalent structures or equivalent processes using the descriptions and drawings of the present application, or direct or indirect application in other related technical fields are included in the scope of the claims of the present application.

Claims (10)

1. A method of processing a document, the method comprising:
acquiring a processing instruction carrying a module identifier and used for compiling a target module;
determining an entry file of the target module corresponding to the module identifier based on the processing instruction through the target object;
and compiling the file to be compiled of the target module corresponding to the module identifier based on the entry file.
2. The method of claim 1, wherein the determining, by the target object, an entry file of the target module corresponding to the module identification based on the processing instructions, comprises:
initializing configuration parameters of a compiler based on the processing instructions;
generating a request carrying a module identifier for acquiring an entry file of the target module based on the configuration parameters;
and determining, by a target object, the entry file of the target module corresponding to the module identification based on the request.
3. The method of claim 2, wherein the determining, by a target object, the entry file of the target module corresponding to the module identification based on the request comprises:
acquiring module information of a plurality of functional modules;
transmitting the module information and the request to a second function through a first function;
the portal file is determined based on the request and the module information by the second function.
4. A method according to claim 3, wherein said determining, by a second function, said entry file based on said request and said module information, comprises:
acquiring an entry file corresponding to the module identifier from the module information based on the request through the second function, and storing the entry file in a target virtual module file;
acquiring the target virtual module file based on a main entry file, and acquiring the entry file from the target virtual module file; the main entry file is an initial entry file for compiling a task corresponding to the target module.
5. The method according to claim 1, wherein compiling the file to be compiled of the target module corresponding to the module identifier based on the entry file comprises:
determining the identification of the file to be compiled based on the entry file and the target dependency relationship table;
and acquiring the file to be compiled based on the identification of the file to be compiled, and compiling the file to be compiled.
6. The method according to claim 1, wherein the method further comprises:
receiving an access request; the access request carries an access route;
determining whether the access route exists in a target route table based on the access request;
and setting the access route as the route of the inaccessible page under the condition that the access route is not contained in the target route table.
7. The method of claim 6, wherein the method further comprises:
acquiring the type of the access route under the condition that the access route is in the target route table;
and acquiring page information of the access page corresponding to the access route based on the type.
8. A document processing apparatus, the apparatus comprising:
the acquisition unit is used for acquiring a processing instruction carrying a module identifier and used for compiling the target module;
the processing unit is used for determining an entry file of the target module corresponding to the module identifier based on the processing instruction through the target object;
and the processing unit is further used for compiling the file to be compiled of the target module corresponding to the module identifier based on the entry file.
9. A document processing apparatus, the apparatus comprising: a processor, a memory, and a communication bus;
the communication bus is used for realizing communication connection between the processor and the memory;
the processor is configured to execute a file processing program in the memory to implement the steps of:
acquiring a processing instruction carrying a module identifier and used for compiling a target module;
determining an entry file of the target module corresponding to the module identifier based on the processing instruction through the target object;
and compiling the file to be compiled of the target module corresponding to the module identifier based on the entry file.
10. A computer-readable storage medium storing one or more programs executable by one or more processors to implement the steps of the file processing method of any of claims 1 to 7.
CN202111544127.6A 2021-12-16 2021-12-16 File processing method, device, equipment and computer readable storage medium Pending CN116266112A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111544127.6A CN116266112A (en) 2021-12-16 2021-12-16 File processing method, device, equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111544127.6A CN116266112A (en) 2021-12-16 2021-12-16 File processing method, device, equipment and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN116266112A true CN116266112A (en) 2023-06-20

Family

ID=86743213

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111544127.6A Pending CN116266112A (en) 2021-12-16 2021-12-16 File processing method, device, equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN116266112A (en)

Similar Documents

Publication Publication Date Title
CN106559438B (en) Program uploading method and device based on target network platform
CN107943485B (en) Patch compiling platform and patch compiling method
CN110941528B (en) Log buried point setting method, device and system based on fault
US11113050B2 (en) Application architecture generation
CN111949899B (en) Service integration method and service platform
CN113885849B (en) Application development method and device based on industrial internet platform and terminal equipment
CN107015904B (en) Stack protection method and device
CN111240684B (en) Cutting method and device of JS codes, medium and electronic equipment
EP3447635A1 (en) Application architecture generation
CN111459499A (en) Program compiling method and device, computer storage medium and electronic equipment
CN112328219A (en) Service access processing method, device and system and computer equipment
CN114968807A (en) Code detection method and device, electronic equipment and readable storage medium
CN113127098A (en) Micro-service architecture-based application program creating method and related equipment
Tang et al. Xdebloat: Towards automated feature-oriented app debloating
CN103810096A (en) Hybrid program analysis method and system
CN112527459B (en) Log analysis method and device based on Kubernetes cluster
CN111158667B (en) Code injection method and device, electronic equipment and storage medium
CN111782239A (en) Software packaging and source code version information acquisition method, device and storage medium
CN111352631A (en) Interface compatibility detection method and device
CN115794214A (en) Application module metadata management method, device, storage medium and device
CN116680003A (en) Front-end plug-in system
CN116266112A (en) File processing method, device, equipment and computer readable storage medium
CN106778270B (en) Malicious application detection method and system
CN111475148A (en) Third-party dependent library isolation method and device, electronic equipment and storage medium
CN114791884A (en) Test environment construction method and device, storage medium and electronic 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