CN107766048B - Page compiling method and device - Google Patents

Page compiling method and device Download PDF

Info

Publication number
CN107766048B
CN107766048B CN201710992538.9A CN201710992538A CN107766048B CN 107766048 B CN107766048 B CN 107766048B CN 201710992538 A CN201710992538 A CN 201710992538A CN 107766048 B CN107766048 B CN 107766048B
Authority
CN
China
Prior art keywords
file
program set
page
compiler
compiling
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710992538.9A
Other languages
Chinese (zh)
Other versions
CN107766048A (en
Inventor
苗传伟
刘强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Inspur General Software Co Ltd
Original Assignee
Inspur General Software 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 Inspur General Software Co Ltd filed Critical Inspur General Software Co Ltd
Priority to CN201710992538.9A priority Critical patent/CN107766048B/en
Publication of CN107766048A publication Critical patent/CN107766048A/en
Application granted granted Critical
Publication of CN107766048B publication Critical patent/CN107766048B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/44Encoding
    • G06F8/447Target code generation
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Stored Programmes (AREA)
  • Devices For Executing Special Programs (AREA)

Abstract

The invention provides a page compiling method and a page compiling device, wherein the method comprises the following steps: constructing a list to be confirmed, wherein the list to be confirmed comprises at least one compilation program set file to be confirmed, and the at least one compilation program set file to be confirmed is included in a program set file under an executable file directory; defining a compiler; utilizing the compiler to quote a program set file corresponding to a page to be compiled in a program set file under the executable file directory, wherein the quoted program set file is not included in the list to be confirmed; and compiling the page to be compiled by utilizing the compiler and the referenced program set file. Therefore, the scheme provided by the invention can accelerate the page compiling speed.

Description

Page compiling method and device
Technical Field
The invention relates to the technical field of computers, in particular to a page compiling method and device.
Background
With the development of computer technology, interfaces displayed in various application programs or browsed interfaces need to be compiled.
At present, in the process of page compilation, all program set files in an executable file directory of an application program are automatically referred, and then a page to be compiled is compiled by using all the referred program set files. Because all assembly files under the executable file directory are referenced, a compilation error due to stack overflow may occur. And since all assembly files under the executable file directory are referenced, the page compilation speed is slow.
Disclosure of Invention
The embodiment of the invention provides a page compiling method and device, which can accelerate page compiling speed.
In a first aspect, an embodiment of the present invention provides a page compiling method, where the method includes:
constructing a list to be confirmed, wherein the list to be confirmed comprises at least one compilation program set file to be confirmed, and the at least one compilation program set file to be confirmed is included in a program set file under an executable file directory;
defining a compiler;
utilizing the compiler to quote a program set file corresponding to a page to be compiled in a program set file under the executable file directory, wherein the quoted program set file is not included in the list to be confirmed;
and compiling the page to be compiled by utilizing the compiler and the referenced program set file.
Preferably, the first and second electrodes are formed of a metal,
after compiling the page to be compiled using the compiler and the referenced assembly file, further comprising:
a1: judging whether the page to be compiled passes compiling or not;
a2: when the compiling of the page to be compiled is judged not to pass, determining a program set file lacking in the page to be compiled, and removing the determined program set file from the list to be confirmed;
a3: using the compiler, referencing a last referenced assembly file and referencing an assembly file removed from the list to be confirmed in assembly files under the executable file directory;
a4: compiling the page to be compiled by using the compiler and the currently referenced assembly file, and executing A1.
Preferably, the first and second electrodes are formed of a metal,
the constructing of the list to be confirmed includes:
executing for each of the assembly files under the executable file directory,
judging whether the current program set file is a program set file of a page base class file type,
and when judging that the current program set file is not the program set file of the page base class file type, determining that the current program set file is the program set file to be confirmed to participate in compiling, and adding the current program set file to the list to be confirmed.
Preferably, the first and second electrodes are formed of a metal,
the assembly file of the page base class file type comprises: there are classes inherited from the assembly file of "system.
Preferably, the first and second electrodes are formed of a metal,
the definition compiler includes:
determining an original compiler corresponding to the page to be compiled;
inheriting the original compiler;
and rewriting at least one compiling method in the inherited original compiler to form the compiler, wherein each compiling method corresponds to one application scene respectively.
Preferably, the first and second electrodes are formed of a metal,
and when the page to be compiled is a WEB page, the original compiler corresponding to the WEB page is an ASP.
Preferably, the first and second electrodes are formed of a metal,
the at least one compilation method includes: at least one or more of a compiling method of compiling with at least one DOM file, a compiling method of compiling with at least one text file, and a compiling method of compiling with at least one source program file.
Preferably, the first and second electrodes are formed of a metal,
after defining the compiler, before the using the compiler to refer to the assembly file corresponding to the page to be compiled in the assembly file under the executable file directory, further comprising:
replacing the original compiler with the formed compiler.
In a second aspect, an embodiment of the present invention provides a page compiling apparatus, where the apparatus includes:
the device comprises a building module, a judging module and a judging module, wherein the building module is used for building a list to be confirmed, the list to be confirmed comprises at least one compilation program set file to be confirmed, and the at least one compilation program set file to be confirmed is included in a program set file under an executable file directory;
a definition module for defining a compiler;
a reference module, configured to reference, by using the compiler defined by the definition module, a program set file corresponding to a page to be compiled in a program set file in the executable file directory, where the referenced program set file is not included in the list to be confirmed, which is constructed by the construction module;
and the compiling module is used for compiling the page to be compiled by utilizing the compiler defined by the definition module and the program set file referred by the reference module.
Preferably, the first and second electrodes are formed of a metal,
further comprising: a judgment module;
the judging module is used for executing the steps A1 to A4:
a1: judging whether the page to be compiled passes compiling or not;
a2: when the compiling of the page to be compiled is judged not to pass, determining a program set file lacking in the page to be compiled, and removing the determined program set file from the list to be confirmed;
a3: using the compiler, referencing a last referenced assembly file and referencing an assembly file removed from the list to be confirmed in assembly files under the executable file directory;
a4: compiling the page to be compiled by using the compiler and the currently referenced assembly file, and executing A1.
Preferably, the first and second electrodes are formed of a metal,
the building module is configured to execute each program set file in the executable file directory, determine whether the current program set file is a program set file of a page base class file type, determine that the current program set file is a program set file to be confirmed to participate in compilation when it is determined that the current program set file is not a program set file of a page base class file type, and add the current program set file to the list to be confirmed.
Preferably, the first and second electrodes are formed of a metal,
the definition module comprises: an inheritance sub-module and a rewrite sub-module;
the inheritance sub-module is used for determining an original compiler corresponding to the page to be compiled; inheriting the original compiler;
the rewriting submodule is used for rewriting at least one compiling method in an original compiler inherited by the inheritance submodule to form the compiler, wherein each compiling method corresponds to an application scene.
Preferably, the first and second electrodes are formed of a metal,
and when the page to be compiled is a WEB page, the inheritance sub-module determines that an original compiler corresponding to the WEB page is an ASP.
Preferably, the first and second electrodes are formed of a metal,
the at least one compiling method rewritten by the rewriting sub-module includes: at least one or more of a compiling method of compiling with at least one DOM file, a compiling method of compiling with at least one text file, and a compiling method of compiling with at least one source program file.
Preferably, the first and second electrodes are formed of a metal,
further comprising: a replacement module;
and the replacing module is used for replacing the original compiler by using the compiler formed by the rewriting submodule.
The embodiment of the invention provides a page compiling method and device. And then, a defined compiler refers to a program set file corresponding to a page to be compiled in a program set file under an executable file directory, wherein the referred program set file is not included in the list to be confirmed. And finally, compiling the page to be compiled by utilizing the compiler and the referenced program set file. Therefore, when the program set file corresponding to the page to be compiled is referred to in the executable file directory, each program set file to be confirmed to participate in the compiling is filtered by using the list to be confirmed, and the program set file corresponding to the page to be compiled is not required to be referred to in all the program set files in the executable file directory, so that the page compiling speed can be increased by the scheme provided by the embodiment of the invention.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a flowchart illustrating a page compiling method according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a page compiling method according to another embodiment of the present invention;
fig. 3 is a hardware structure diagram of a device in which a page compiling apparatus according to an embodiment of the present invention is located;
fig. 4 is a schematic structural diagram of a page compiling apparatus according to an embodiment of the present invention;
FIG. 5 is a schematic structural diagram of a page compiling apparatus including a determining module according to an embodiment of the present invention;
FIG. 6 is a schematic structural diagram of a page compiling apparatus including an inheritance sub-module and a rewrite sub-module according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a page compiling apparatus including a replacement module according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer and more complete, the technical solutions in the embodiments of the present invention will be described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention, and based on the embodiments of the present invention, all other embodiments obtained by a person of ordinary skill in the art without creative efforts belong to the scope of the present invention.
As shown in fig. 1, an embodiment of the present invention provides a page compiling method, which may include the following steps:
step 101: constructing a list to be confirmed, wherein the list to be confirmed comprises at least one compilation program set file to be confirmed, and the at least one compilation program set file to be confirmed is included in a program set file under an executable file directory;
step 102: defining a compiler;
step 103: utilizing the compiler to quote a program set file corresponding to a page to be compiled in a program set file under the executable file directory, wherein the quoted program set file is not included in the list to be confirmed;
step 104: and compiling the page to be compiled by utilizing the compiler and the referenced program set file.
According to the embodiment shown in fig. 1, a list to be confirmed is first constructed, and the constructed list to be confirmed includes each compiled program set file to be confirmed, wherein each compiled program set file to be confirmed is included in a program set file under an executable file directory. And then, a defined compiler refers to a program set file corresponding to a page to be compiled in a program set file under an executable file directory, wherein the referred program set file is not included in the list to be confirmed. And finally, compiling the page to be compiled by utilizing the compiler and the referenced program set file. Therefore, when the program set file corresponding to the page to be compiled is referred to in the executable file directory, each program set file to be confirmed to participate in the compiling is filtered by using the list to be confirmed, and the program set file corresponding to the page to be compiled is not required to be referred to in all the program set files in the executable file directory, so that the page compiling speed can be increased by the scheme provided by the embodiment of the invention.
In one embodiment of the invention, when the executable file directory is a bin directory, the assembly file under the executable file directory is a file suffixed with ". dll".
In an embodiment of the present invention, after the compiling the page to be compiled by using the compiler and the referenced assembly file in step 104 in the flowchart shown in fig. 1 further includes:
a1: judging whether the page to be compiled passes compiling or not;
a2: when the compiling of the page to be compiled is judged not to pass, determining a program set file lacking in the page to be compiled, and removing the determined program set file from the list to be confirmed;
a3: using the compiler, referencing a last referenced assembly file and referencing an assembly file removed from the list to be confirmed in assembly files under the executable file directory;
a4: compiling the page to be compiled by using the compiler and the currently referenced assembly file, and executing A1.
In this embodiment, since there is a case that the page to be compiled is not compiled, after the page to be compiled is compiled by using the compiler and the referenced assembly file, it needs to be further determined whether the page to be compiled is compiled to pass or not.
And when the compiling of the page to be compiled is judged to pass, the compiling of the page to be compiled is completed.
When the compiling of the page to be compiled is judged not to pass, the introduced program set file is not complete and can not meet the compiling requirement of the page to be compiled, so that the program set file lacking in the page to be compiled is required to be determined. The method for determining the program set file lacking in the page to be compiled may be: and acquiring a program set file list corresponding to the page to be compiled, wherein the program set file list comprises all program set file names corresponding to the page to be compiled. And comparing the program set file list with the referenced program set file, determining the program set file which exists in the program set file list but is not referenced as a program set file lacking in the page to be compiled, and removing the determined program set file from the list to be confirmed so as to be referenced by the compiler. After the determined program set file is removed from the list to be confirmed, the compiler is used for quoting the program set file quoted last time and quoting the program set file removed from the list to be confirmed in the program set file under the executable file directory, the compiler and the currently quoted program set file are used for compiling the page to be compiled, whether the page to be compiled is compiled to pass or not is continuously judged, and when the page to be compiled is judged not to pass, the process is repeated until the compiling is passed.
Taking the page a to be compiled as an example, after the compiler and the referenced program set files "program set file 1, program set file 2, and program set file 3" are used to compile the page a to be compiled, it is determined that the page a to be compiled cannot be compiled. It is determined that the page a to be compiled lacks the assembly file 4, and the assembly file 4 is removed from the list to be confirmed. The last referenced assembly files "assembly file 1, assembly file 2 and assembly file 3" and the assembly file 4 that is removed from the list to be confirmed are referenced in the assembly files under the executable file directory bin directory by a compiler. Compiling the page A to be compiled by using a compiler and a currently cited program set file, namely a program set file 1, a program set file 2, a program set file 3 and a program set file 4, judging whether the page A to be compiled passes compiling or not, and when judging that the page A to be compiled passes compiling, indicating that the page A to be compiled is finished.
According to the above embodiment, after the page to be compiled is compiled by using the compiler and the referenced assembly file, it needs to further determine whether the page to be compiled passes the compiling process. And when judging that the page to be compiled is not compiled, referring to the program set file lacking in the page to be compiled and the program set file referred last time. And compiling the page to be compiled by using the currently quoted program set file until the page to be compiled is compiled to pass, so that the page to be compiled is successfully compiled.
In an embodiment of the present invention, the building the to-be-confirmed list involved in step 101 in the flowchart shown in fig. 1 may include:
executing for each of the assembly files under the executable file directory,
judging whether the current program set file is a program set file of a page base class file type,
and when judging that the current program set file is not the program set file of the page base class file type, determining that the current program set file is the program set file to be confirmed to participate in compiling, and adding the current program set file to the list to be confirmed.
In this embodiment, since the assembly file of the page base class file type is an assembly file that may need to be referred to in the compiling process, the list to be confirmed may be constructed according to the page base class file type. Each assembly file included in the list to be confirmed is an assembly file which is temporarily considered not to be involved in compilation.
Taking an existing assembly file 1 and an assembly file 2 in an executable file directory as an example, if the assembly file 1 is judged to be an assembly file of a page base class file type, the assembly file 1 is explained to be an assembly file which may need to be referred in a compiling process, and the assembly file 1 is not added into a list to be confirmed. And if the program set file 2 is judged not to be the program set file of the page base class file type, the program set file 2 is the program set file which is temporarily considered not to be compiled, and the program set file 2 is added into the list to be confirmed.
According to the embodiment, the program set file in the executable file directory is filtered by judging whether the program set file is the program set file of the page base class file type. And adding the assembly file which is not the page base class file type into the list to be confirmed so that the assembly file included in the list to be confirmed is not referenced when the assembly file corresponding to the page to be compiled is referenced, and therefore, the range of referencing the assembly file can be reduced.
In an embodiment of the present invention, the assembly file of the page base class file type referred to in the previous embodiment may include: there are classes inherited from the assembly file of "system.
According to the above embodiment, the program file of the page base class file type can be selected according to the business requirement as at least one of the program set file having the class inherited from the "system. Therefore, the service applicability is strong.
In an embodiment of the present invention, step 102 in the flowchart shown in fig. 1 defines that the compiler may include:
determining an original compiler corresponding to the page to be compiled;
inheriting the original compiler;
and rewriting at least one compiling method in the inherited original compiler to form the compiler, wherein each compiling method corresponds to one application scene respectively.
In this embodiment, at least one rewritten compiling method may be determined according to the service requirement, but it should be noted that each compiling method corresponds to one application scenario respectively.
According to the embodiment, each rewritten compiling method corresponds to one application scene, so that the service applicability of the compiler is strong.
In an embodiment of the present invention, when the page to be compiled is a WEB page, an original compiler corresponding to the WEB page is a default compiler of asp.
In this embodiment, when the page to be compiled is a WEB page, the original compiler corresponding to the WEB page is a default compiler "CSharpCodeProvider" of asp.
In one embodiment of the present invention, the at least one compilation method that is rewritten in the inherited original compiler may include: at least one or more of a compiling method of compiling with at least one DOM file, a compiling method of compiling with at least one text file, and a compiling method of compiling with at least one source program file.
In this embodiment, the compiling method for compiling by using at least one DOM file may be "compileassembyfrmdom". The compiling method for compiling using the at least one text file may be 'compileassembyfrmfile'. The compiling method for compiling using the at least one source program file may be "compileassembyfrom source".
According to the above embodiment, the rewritten compiling method may include at least one or more of a compiling method of compiling using at least one DOM file, a compiling method of compiling using at least one text file, and a compiling method of compiling using at least one source program file. Therefore, the service applicability is strong.
In an embodiment of the present invention, after the step 102 in the flowchart shown in fig. 1 defines a compiler, before the step 104 in the flowchart shown in fig. 1 uses the compiler to refer to a assembly file corresponding to a page to be compiled in an assembly file under the executable file directory, the method may further include:
replacing the original compiler with the formed compiler.
In the embodiment, the configuration file of the original compiler is modified, and the configuration file of the original compiler is replaced by the formed compiler.
For example, when the original compiler is the default compiler of asp.net, the configuration file of the default compiler of asp.net is replaced with the formed compiler.
According to the above embodiment, the formed compiler is used to replace the original compiler to execute the assembly file corresponding to the reference page to be compiled which can be directly under the executable file directory, and the referenced assembly file is not included in the list to be confirmed at this time. So that the compiling efficiency can be improved.
Net is taken as an example below, the page to be compiled is a WEB page, and the application program corresponding to the WEB page is asp. Explaining the page compilation method, as shown in fig. 2, the page compilation method may include the following steps:
step 201: and sequentially selecting one program set file as the current program set file from the program set files in the executable file directory.
In this step, the executable file directory is a bin directory, and the bin directory includes the assembly file 1 to the assembly file 10.
Step 202: judging whether the current program set file is a program set file of a page base class file type, if so, executing step 204; otherwise, step 203 is executed.
In this step, the assembly file of the page base class file type includes: there are classes inherited from the assembly file of "system.
Taking the current program set file as the program set file 1 as an example, if the program set file 1 is determined to be a program set file with a class inherited from "system.
Next, taking the current assembly file as the assembly file 2 as an example, if it is determined that the assembly file 2 is not an assembly file having a class inherited from "system.
Step 203: and determining that the current program set file is the program set file to be confirmed to participate in compilation, and adding the current program set file to a list to be confirmed.
In this step, the assembly file 2 is added to the list to be confirmed. And both the assembly file 6 and the assembly file 7 are added to the list to be confirmed.
In this step, the list to be confirmed may be an XML file. And the step can be realized by the following codes:
<?xml version="1.0"encoding="utf-8"?>
<Assemblys>
< Assembly name ═ Prod set 2.dll "/>
< Assembly name ═ Prod set 6.dll "/>
< Assembly name ═ Prod set 7.dll "/>
</Assemblys>
Step 204: judging whether the current program set file is the last program set file, if so, executing the step 205; otherwise, step 201 is performed.
Step 205: and determining an original compiler corresponding to the page to be compiled.
In this step, it is determined that the original compiler corresponding to the "WEB page" of the page to be compiled is the default compiler "CSharpCodeProvider" of asp.
Step 206: inherit the original compiler.
In this step, it can be realized by the following codes:
public class CSharpCodeProviderWithReducedReferences:
CSharpCodeProvider
step 207: and rewriting at least one compiling method in the inherited original compiler to form the compiler, wherein each compiling method corresponds to one application scene respectively.
In this step, the compilation method "compileassembyffromdom" compiled with at least one DOM file is rewritten in the inherited original compiler. A compiling method 'compileassembyfrmfile' for compiling using at least one text file. A compiling method 'CompleAssemblyFromSource' for compiling by using at least one source program file.
In this step, it can be realized by the following codes:
Figure GDA0002590900780000121
Figure GDA0002590900780000131
the method comprises the steps of identifying each compilation program set file to be confirmed from a list to be confirmed in an XML format through 'reduce references', and confirming that the compilation program set file is a program set file which is temporarily considered not to be compiled.
Step 208: replacing the original compiler with the formed compiler.
In this step, the configuration file of the original compiler is modified, and the configuration file of the original compiler is replaced with the formed compiler. Alternative methods may be: and searching all configuration files named as 'web.config' under the deployment directory of the ASP.NET program, and setting the compiler configuration items in the configuration files as the formed compiler.
In this step, it can be realized by the following codes:
Figure GDA0002590900780000132
Figure GDA0002590900780000141
step 209: and utilizing a compiler to quote a program set file corresponding to the page to be compiled in a program set file under the executable file directory, wherein the quoted program set file is not included in the list to be confirmed.
In this step, the compiler refers to the album files "album file 1 and album file 3" corresponding to the WEB page in the album file under the bin directory. Wherein, neither the "assembly file 1 nor the assembly file 3" is included in the list to be confirmed.
Step 210: and compiling the page to be compiled by utilizing the compiler and the referenced program set file.
In this step, the WEB page is compiled using the compiler and the referenced program set files "program set file 1 and program set file 3".
Step 211: judging whether the page to be compiled passes the compiling, if so, ending the current flow; otherwise, step 212 is performed.
In this step, it is determined that the WEB page compilation has failed, and step 212 is performed.
Step 212: determining the program set files lacking in the pages to be compiled, and removing the determined program set files from the list to be confirmed.
In this step, the program set file 2 lacking in the WEB page is determined, and the program set file 2 is removed from the list to be confirmed.
Step 213: and using the compiler to reference the program set file referenced last time in the program set files under the executable file directory and to reference the program set file removed from the list to be confirmed.
In this step, using the compiler, the assembly file "assembly file 1 and assembly file 3" referred last and the assembly file 2 removed from the list to be confirmed are referred to in the assembly files under the bin directory.
Step 214: the page to be compiled is compiled using the compiler and the currently referenced assembly file and executed 211.
In this step, the WEB page is compiled using the compiler and the currently referenced assembly files "assembly file 1, assembly file 2, and assembly file 3", and step 212 is performed. In step 212, if the WEB page compilation is determined to pass, it is determined that the WEB page compilation is complete.
As shown in fig. 3 and 4, an embodiment of the present invention provides a page compiling apparatus. The device embodiments may be implemented by software, or by hardware, or by a combination of hardware and software. From a hardware level, as shown in fig. 3, a hardware structure diagram of a device in which a page compiling apparatus according to an embodiment of the present invention is located is shown, where the device in the embodiment may generally include other hardware, such as a forwarding chip responsible for processing a packet, in addition to the processor, the memory, the network interface, and the nonvolatile memory shown in fig. 3. Taking a software implementation as an example, as shown in fig. 4, as a logical apparatus, the apparatus is formed by reading a corresponding computer program instruction in a non-volatile memory into a memory by a CPU of a device in which the apparatus is located and running the computer program instruction. The page compiling apparatus provided in this embodiment includes:
a building module 401, configured to build a list to be confirmed, where the list to be confirmed includes at least one compiled assembly file to be confirmed, and the at least one compiled assembly file to be confirmed is included in an assembly file in an executable file directory;
a definition module 402 for defining a compiler;
a reference module 403, configured to reference, by using the compiler defined by the defining module 402, a program set file corresponding to a page to be compiled in a program set file under the executable file directory, where the referenced program set file is not included in the list to be confirmed constructed by the constructing module 401;
a compiling module 404, configured to compile the page to be compiled by using the compiler defined by the defining module 402 and the assembly file referred by the referring module 403.
According to the embodiment shown in fig. 4, a to-be-confirmed list is first constructed by using a construction module, and the constructed to-be-confirmed list includes each to-be-confirmed participating compiling program set file, wherein each to-be-confirmed participating compiling program set file is included in a program set file under an executable file directory. And then, a compiler defined by the definition module is used for referencing a program set file corresponding to the page to be compiled in a program set file under the executable file directory through the reference module, wherein the referenced program set file is not included in the list to be confirmed. And finally, compiling the page to be compiled by using the compiler defined by the definition module and the program set file quoted by the quote module through the compiling module. Therefore, when the program set file corresponding to the page to be compiled is referred to in the executable file directory, each program set file to be confirmed to participate in the compiling is filtered by using the list to be confirmed, and the program set file corresponding to the page to be compiled is not required to be referred to in all the program set files in the executable file directory, so that the page compiling speed can be increased by the scheme provided by the embodiment of the invention.
In an embodiment of the present invention, as shown in fig. 5, the page compiling apparatus may further include: a judging module 501;
the determining module 501 is configured to execute steps a1 to a 4:
a1: judging whether the page to be compiled passes compiling or not;
a2: when the compiling of the page to be compiled is judged not to pass, determining a program set file lacking in the page to be compiled, and removing the determined program set file from the list to be confirmed;
a3: using the compiler, referencing a last referenced assembly file and referencing an assembly file removed from the list to be confirmed in assembly files under the executable file directory;
a4: compiling the page to be compiled by using the compiler and the currently referenced assembly file, and executing A1.
In an embodiment of the present invention, the constructing module 101 is configured to execute each program set file in the executable file directory, determine whether the current program set file is a program set file of a page base class file type, determine that the current program set file is a program set file to be confirmed to participate in compiling when it is determined that the current program set file is not a program set file of a page base class file type, and add the current program set file to the list to be confirmed.
In an embodiment of the present invention, the assembly file of the page base class file type related to the building module 101 includes: there are classes inherited from the assembly file of "system.
In an embodiment of the present invention, as shown in fig. 6, the defining module 402 may include: an inheritance sub-module 601 and an overwrite sub-module 602;
the inheritance sub-module 601 is configured to determine an original compiler corresponding to the page to be compiled; inheriting the original compiler;
the rewriting sub-module 602 is configured to rewrite at least one compiling method in the original compiler inherited by the inheriting sub-module 601 to form the compiler, where each compiling method corresponds to an application scenario.
In an embodiment of the present invention, when the page to be compiled is a WEB page, the inheritance sub-module 601 determines that an original compiler corresponding to the WEB page is an asp.
In an embodiment of the present invention, the at least one compiling method rewritten by the rewriting sub-module 602 includes: at least one or more of a compiling method of compiling with at least one DOM file, a compiling method of compiling with at least one text file, and a compiling method of compiling with at least one source program file.
In an embodiment of the present invention, as shown in fig. 7, the page compiling apparatus may further include: a replacement module 701;
the replacing module 701 is configured to replace the original compiler with the compiler formed by the rewriting sub-module 602.
In one embodiment of the present invention, a readable medium is provided, the readable medium including: and executing instructions, wherein when the processor of the storage controller executes the executing instructions, the storage controller executes any one of the page compiling methods.
In one embodiment of the present invention, there is provided a memory controller including: a processor, a memory, and a bus; the memory is used for storing execution instructions; the processor and the memory are connected through the bus; when the storage controller is running, the processor executes the execution instructions stored in the memory to cause the storage controller to execute any one of the page compilation methods.
Because the information interaction, execution process, and other contents between the units in the device are based on the same concept as the method embodiment of the present invention, specific contents may refer to the description in the method embodiment of the present invention, and are not described herein again.
In summary, the embodiments of the present invention can at least achieve the following beneficial effects:
1. in the embodiment of the invention, firstly, a list to be confirmed is constructed, and the constructed list to be confirmed comprises all compilation program set files to be confirmed, wherein all compilation program set files to be confirmed are included in the program set files in the executable file directory. And then, a defined compiler refers to a program set file corresponding to a page to be compiled in a program set file under an executable file directory, wherein the referred program set file is not included in the list to be confirmed. And finally, compiling the page to be compiled by utilizing the compiler and the referenced program set file. Therefore, when the program set file corresponding to the page to be compiled is referred to in the executable file directory, each program set file to be confirmed to participate in the compiling is filtered by using the list to be confirmed, and the program set file corresponding to the page to be compiled is not required to be referred to in all the program set files in the executable file directory, so that the page compiling speed can be increased by the scheme provided by the embodiment of the invention.
2. In the embodiment of the present invention, after the page to be compiled is compiled by using the compiler and the referenced assembly file, it is further necessary to determine whether the page to be compiled passes compilation. And when judging that the page to be compiled is not compiled, referring to the program set file lacking in the page to be compiled and the program set file referred last time. And compiling the page to be compiled by using the currently quoted program set file until the page to be compiled is compiled to pass, so that the page to be compiled is successfully compiled.
3. In the embodiment of the invention, the program set file in the executable file directory is filtered by judging whether the program set file is the program set file of the page base class file type. And adding the assembly file which is not the page base class file type into the list to be confirmed so that the assembly file included in the list to be confirmed is not referenced when the assembly file corresponding to the page to be compiled is referenced, and therefore, the range of referencing the assembly file can be reduced.
4. In the embodiment of the present invention, the program file of the page base class file type may be selected according to the service requirement, and the selected program file may be at least one of a program set file with a class inherited from "system. Therefore, the service applicability is strong.
5. In the embodiment of the invention, each rewritten compiling method corresponds to one application scene, so that the service applicability of the compiler is strong.
6. In an embodiment of the present invention, the rewritten compiling method may include at least one or more of a compiling method of compiling using at least one DOM file, a compiling method of compiling using at least one text file, and a compiling method of compiling using at least one source program file. Therefore, the service applicability is strong.
7. In the embodiment of the invention, the formed compiler is used for replacing the original compiler so as to execute the program set file which can be directly under the executable file directory and corresponds to the reference page to be compiled, and the referenced program set file is not included in the list to be confirmed at the moment. So that the compiling efficiency can be improved.
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 a" does not exclude the presence of other similar elements in a process, method, article, or apparatus that comprises the element.
Those of ordinary skill in the art will understand that: all or part of the steps for realizing the method embodiments can be completed by hardware related to program instructions, the program can be stored in a computer readable storage medium, and the program executes the steps comprising the method embodiments when executed; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it is to be noted that: the above description is only a preferred embodiment of the present invention, and is only used to illustrate the technical solutions of the present invention, and not to limit the protection 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 (8)

1. A method for page compilation, comprising:
constructing a list to be confirmed, wherein the list to be confirmed comprises at least one compilation program set file to be confirmed, and the at least one compilation program set file to be confirmed is included in a program set file under an executable file directory;
defining a compiler;
utilizing the compiler to quote a program set file corresponding to a page to be compiled in a program set file under the executable file directory, wherein the quoted program set file is not included in the list to be confirmed;
compiling the page to be compiled by utilizing the compiler and the referenced program set file;
after compiling the page to be compiled using the compiler and the referenced assembly file, further comprising:
a1: judging whether the page to be compiled passes compiling or not;
a2: when the compiling of the page to be compiled is judged not to pass, determining a program set file lacking in the page to be compiled, and removing the determined program set file from the list to be confirmed;
a3: using the compiler, referencing a last referenced assembly file and referencing an assembly file removed from the list to be confirmed in assembly files under the executable file directory;
a4: compiling the page to be compiled by using the compiler and the currently referenced assembly file, and executing A1.
2. The method of claim 1,
the constructing of the list to be confirmed includes:
executing for each of the assembly files under the executable file directory,
judging whether the current program set file is a program set file of a page base class file type,
and when judging that the current program set file is not the program set file of the page base class file type, determining that the current program set file is the program set file to be confirmed to participate in compiling, and adding the current program set file to the list to be confirmed.
3. The method of claim 2,
the assembly file of the page base class file type comprises: there are classes inherited from the assembly file of "system.
4. The method of claim 1,
the definition compiler includes:
determining an original compiler corresponding to the page to be compiled;
inheriting the original compiler;
and rewriting at least one compiling method in the inherited original compiler to form the compiler, wherein each compiling method corresponds to one application scene respectively.
5. The method of claim 4,
when the page to be compiled is a WEB page, an original compiler corresponding to the WEB page is an ASP.NET default compiler;
and/or the presence of a gas in the gas,
the at least one compilation method includes: at least one or more of a compiling method for compiling by using at least one DOM file, a compiling method for compiling by using at least one text file, and a compiling method for compiling by using at least one source program file;
and/or the presence of a gas in the gas,
after defining the compiler, before the using the compiler to refer to the assembly file corresponding to the page to be compiled in the assembly file under the executable file directory, further comprising:
replacing the original compiler with the formed compiler.
6. A page compilation apparatus, comprising:
the device comprises a building module, a judging module and a judging module, wherein the building module is used for building a list to be confirmed, the list to be confirmed comprises at least one compilation program set file to be confirmed, and the at least one compilation program set file to be confirmed is included in a program set file under an executable file directory;
a definition module for defining a compiler;
a reference module, configured to reference, by using the compiler defined by the definition module, a program set file corresponding to a page to be compiled in a program set file in the executable file directory, where the referenced program set file is not included in the list to be confirmed, which is constructed by the construction module;
the compiling module is used for compiling the page to be compiled by utilizing the compiler defined by the definition module and the program set file referred by the reference module;
further comprising: a judgment module;
the judging module is used for executing the steps A1 to A4:
a1: judging whether the page to be compiled passes compiling or not;
a2: when the compiling of the page to be compiled is judged not to pass, determining a program set file lacking in the page to be compiled, and removing the determined program set file from the list to be confirmed;
a3: using the compiler, referencing a last referenced assembly file and referencing an assembly file removed from the list to be confirmed in assembly files under the executable file directory;
a4: compiling the page to be compiled by using the compiler and the currently referenced program set file, and executing A1;
and/or the presence of a gas in the gas,
the building module is configured to execute each program set file in the executable file directory, determine whether the current program set file is a program set file of a page base class file type, determine that the current program set file is a program set file to be confirmed to participate in compilation when it is determined that the current program set file is not a program set file of a page base class file type, and add the current program set file to the list to be confirmed.
7. The apparatus of claim 6,
the definition module comprises: an inheritance sub-module and a rewrite sub-module;
the inheritance sub-module is used for determining an original compiler corresponding to the page to be compiled; inheriting the original compiler;
the rewriting submodule is used for rewriting at least one compiling method in an original compiler inherited by the inheritance submodule to form the compiler, wherein each compiling method corresponds to an application scene.
8. The apparatus of claim 7,
when the page to be compiled is a WEB page, the inheritance sub-module determines that an original compiler corresponding to the WEB page is an ASP.NET default compiler;
and/or the presence of a gas in the gas,
the at least one compiling method rewritten by the rewriting sub-module includes: at least one or more of a compiling method for compiling by using at least one DOM file, a compiling method for compiling by using at least one text file, and a compiling method for compiling by using at least one source program file;
and/or the presence of a gas in the gas,
further comprising: a replacement module;
and the replacing module is used for replacing the original compiler by using the compiler formed by the rewriting submodule.
CN201710992538.9A 2017-10-23 2017-10-23 Page compiling method and device Active CN107766048B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710992538.9A CN107766048B (en) 2017-10-23 2017-10-23 Page compiling method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710992538.9A CN107766048B (en) 2017-10-23 2017-10-23 Page compiling method and device

Publications (2)

Publication Number Publication Date
CN107766048A CN107766048A (en) 2018-03-06
CN107766048B true CN107766048B (en) 2020-09-15

Family

ID=61269039

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710992538.9A Active CN107766048B (en) 2017-10-23 2017-10-23 Page compiling method and device

Country Status (1)

Country Link
CN (1) CN107766048B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111488140B (en) * 2019-01-29 2023-10-27 杭州海康威视数字技术股份有限公司 Method, device and computer equipment for supporting multiple programming libraries in multiple programming languages
CN111209005B (en) * 2020-01-06 2021-07-23 腾讯科技(深圳)有限公司 Method and apparatus for compiling program file, and computer-readable storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH1049359A (en) * 1996-08-02 1998-02-20 Nec Corp Display device for list of recompiled program in program development
CN101697135A (en) * 2009-10-28 2010-04-21 北京东方网力科技有限公司 Method and device for compiling program
CN103955361A (en) * 2014-03-28 2014-07-30 世纪禾光科技发展(北京)有限公司 Modular development and publishing system for automatic compiling and establishing of web front-end codes
CN106598828A (en) * 2015-10-14 2017-04-26 阿里巴巴集团控股有限公司 Method and device for determining invalid class in source code
CN107273176A (en) * 2016-04-08 2017-10-20 上海思立微电子科技有限公司 The Compilation Method and device of a kind of adaptive hardware framework

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH1049359A (en) * 1996-08-02 1998-02-20 Nec Corp Display device for list of recompiled program in program development
CN101697135A (en) * 2009-10-28 2010-04-21 北京东方网力科技有限公司 Method and device for compiling program
CN103955361A (en) * 2014-03-28 2014-07-30 世纪禾光科技发展(北京)有限公司 Modular development and publishing system for automatic compiling and establishing of web front-end codes
CN106598828A (en) * 2015-10-14 2017-04-26 阿里巴巴集团控股有限公司 Method and device for determining invalid class in source code
CN107273176A (en) * 2016-04-08 2017-10-20 上海思立微电子科技有限公司 The Compilation Method and device of a kind of adaptive hardware framework

Also Published As

Publication number Publication date
CN107766048A (en) 2018-03-06

Similar Documents

Publication Publication Date Title
JP6581710B2 (en) System and method for supporting object-oriented script tools
JP4880191B2 (en) System and method for supporting non-native XML within native XML of word processing documents
WO2012092117A2 (en) Converting desktop applications to web applications
US8312048B2 (en) Database application navigation
US8209662B2 (en) Application retargeting
CN108874379B (en) Page processing method and device
CN107766048B (en) Page compiling method and device
US9286083B2 (en) Satisfying missing dependencies on a running system
JP2006520973A (en) System and method for determining when an EJB compiler needs to be run
CN107168719A (en) Application program running method and device, terminal and computer readable storage medium
WO2011080070A1 (en) Melding of mediation flow service component architecture (sca) components
CN107391099B (en) Resource preprocessing method and device
CN110554867B (en) Application processing method and device
CN109426497B (en) Data embedding method, device, system and storage medium
CN108241671B (en) Service processing method and system and storage medium
CN114527979A (en) Method and system for generating multi-end form interactive page
CN111610908B (en) Method for generating frame diagram, computer equipment and readable storage medium
US20080184204A1 (en) Dynamic validation using reflection
CN106886420B (en) Program code management device and method and program code manager
CN111737964A (en) Form dynamic processing method, equipment and medium
CN112473145A (en) Data processing method and device based on game engine
CN110825450B (en) APP configuration modification method and device, electronic equipment and storage medium
CN113342398B (en) Environment variable configuration method, device, equipment and storage medium
CN118245137B (en) Method, system, equipment and medium for managing data object
US7743076B2 (en) Extensible action sequences coordinating independently created components

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
TA01 Transfer of patent application right

Effective date of registration: 20200819

Address after: 250100 Ji'nan high tech Zone, Shandong, No. 1036 wave road

Applicant after: INSPUR GENERAL SOFTWARE Co.,Ltd.

Address before: 250100, No. 2877, fairway, Sun Town, Ji'nan hi tech Zone, Shandong

Applicant before: SHANDONG INSPUR GENESOFT INFORMATION TECHNOLOGY Co.,Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant