CN113238737A - Page packaging method and device, electronic equipment and storage medium - Google Patents

Page packaging method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113238737A
CN113238737A CN202110661001.0A CN202110661001A CN113238737A CN 113238737 A CN113238737 A CN 113238737A CN 202110661001 A CN202110661001 A CN 202110661001A CN 113238737 A CN113238737 A CN 113238737A
Authority
CN
China
Prior art keywords
page file
target
packaging
environment variable
program
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
CN202110661001.0A
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.)
Guahao Net Hangzhou Technology Co Ltd
Original Assignee
Guahao Net Hangzhou 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 Guahao Net Hangzhou Technology Co Ltd filed Critical Guahao Net Hangzhou Technology Co Ltd
Priority to CN202110661001.0A priority Critical patent/CN113238737A/en
Publication of CN113238737A publication Critical patent/CN113238737A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/20Software design
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/44Encoding
    • G06F8/443Optimisation
    • G06F8/4434Reducing the memory space required by the program code
    • G06F8/4435Detection or removal of dead or redundant code
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Abstract

The embodiment of the invention discloses a page packaging method, a page packaging device, electronic equipment and a storage medium, wherein the method comprises the following steps: acquiring a current environment variable, and identifying a target environment field in a program to be configured; replacing the target environment field with the current environment variable to generate a page file packaging request; acquiring a target page file corresponding to the current environment variable according to the page file packaging request; and packaging the target page file based on a program packaging tool. According to the technical scheme of the embodiment of the invention, the page files are packaged according to the requirements of the service scene, so that the storage space of the resource package is saved, and the technical effects of improving the performance and the access speed of the internet application are achieved.

Description

Page packaging method and device, electronic equipment and storage medium
Technical Field
The embodiment of the invention relates to a computer software technology, in particular to a page packaging method and device, electronic equipment and a storage medium.
Background
At present, when an internet application is developed, the required code files can be generally imported into a program packaging tool, and the code files are packaged into a final resource package.
When the internet application of the actual service is developed, the same function can be implemented in different service scenes by using different pages, for example: page a is used in scenario a, page B is used in scenario B, and so on. In order to ensure the normal realization of the functions, the page files corresponding to the pages are all imported into a program packaging tool to generate a resource package.
However, in a single service scenario, the resource package contains some redundant codes that are not related to the service scenario. This results in a large amount of storage space occupied by the resource package, which also affects the performance and access speed of the internet application.
Disclosure of Invention
The embodiment of the invention provides a page packaging method, a page packaging device, electronic equipment and a storage medium, which are used for packaging page files according to business scene requirements, further saving the storage space of a resource package and improving the performance and the access speed of internet application.
In a first aspect, an embodiment of the present invention provides a page packaging method, where the method includes:
acquiring a current environment variable, and identifying a target environment field in a program to be configured;
replacing the target environment field with the current environment variable to generate a page file packaging request;
acquiring a target page file corresponding to the current environment variable according to the page file packaging request;
and packaging the target page file based on a program packaging tool.
In a second aspect, an embodiment of the present invention further provides a page packaging apparatus, where the apparatus includes:
the identification module is used for acquiring the current environment variable and identifying a target environment field in the program to be configured;
the request generation module is used for replacing the target environment field with the current environment variable to generate a page file packaging request;
the file acquisition module is used for acquiring a target page file corresponding to the current environment variable according to the page file packaging request;
and the packaging module is used for packaging the target page file based on a program packaging tool.
In a third aspect, an embodiment of the present invention further provides an electronic device, where the electronic device includes:
one or more processors;
a storage device for storing one or more programs,
when the one or more programs are executed by the one or more processors, the one or more processors implement the page packing method according to any of the embodiments of the present invention.
In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the page packing method according to any one of the embodiments of the present invention.
According to the technical scheme of the embodiment of the invention, the current environment variable is obtained, the target environment field in the program to be configured is identified, the target environment field is replaced by the current environment variable, the page file packaging request is generated to obtain the target page file, the target page file corresponding to the current environment variable is obtained according to the page file packaging request, and the target page file is packaged based on the program packaging tool, so that the problem that the resource package occupies a large storage space due to the fact that the redundant page file which is not matched with the current service scene is stored in the resource package is solved, the storage space of the resource package is saved, and the technical effects of improving the performance of internet application and the access speed are achieved.
Drawings
In order to more clearly illustrate the technical solutions of the exemplary embodiments of the present invention, a brief description is given below of the drawings used in describing the embodiments. It should be clear that the described figures are only views of some of the embodiments of the invention to be described, not all, and that for a person skilled in the art, other figures can be derived from these figures without inventive effort.
Fig. 1 is a schematic flowchart of a page packaging method according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of a page packaging method according to a second embodiment of the present invention;
fig. 3 is a schematic flowchart of another page packaging method according to a second embodiment of the present invention;
fig. 4 is a schematic structural diagram of a page packaging apparatus according to a third embodiment of the present invention;
fig. 5 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Example one
Fig. 1 is a flowchart of a page packing method according to an embodiment of the present invention, where the method is applicable to a situation of packing page files during development of internet applications, and the method may be executed by a page packing apparatus, and the apparatus may be implemented in a form of software and/or hardware, where the hardware may be an electronic device, and optionally, the electronic device may be a PC terminal, and the like.
As shown in fig. 1, the method of this embodiment specifically includes the following steps:
and S110, acquiring the current environment variable, and identifying a target environment field in the program to be configured.
The current environment variable may be a variable for measuring a current specific service scenario, and different service scenarios may be identified by different environment variables. The program to be configured may be a program for packaging a pagefile. The target environment field may be a field for representing an environment variable, which is preset in the program to be configured.
Specifically, the current environment variable may be obtained by obtaining the current environment variable input by the user or by an automation script. And aiming at the configuration program to be identified, identifying a target environment field for representing the environment variable for subsequent environment variable configuration.
Because part of the codes in the program to be configured are fixed and unchangeable, when the page file is acquired, the target environment field in the program to be configured needs to be identified and replaced. Optionally, the program to be configured includes a file import field and a file name field, where the file name field includes a target environment field.
The file import field may be a field for importing the pagefile in the program to be identified, and the file name field may be a field for indicating the pagefile.
Specifically, when a file import field and a file name field in the program to be configured are identified, it can be determined that the meaning of the code formed by combining the two fields is to import the target file for subsequent packaging. Further, a target environment field related to the environment variable may be acquired from the file name field.
Illustratively, the file import field may be a field used when importing a file, such as import, and the file name field may be a field similar to file $ env.
Optionally, the current environment variable may be accurately obtained by any one of the following manners:
the method comprises the steps of obtaining a current environment variable input by a user.
Specifically, if the user explicitly knows the current environment variable or knows which service scenario's page file is to be packaged, the user may directly input the current environment variable for subsequent configuration.
And secondly, determining the current environment variable corresponding to the current service scene through the environment recognition script.
The environment identification script may be a pre-written script code program for identifying the service scenario and the environment variable. The current service scenario may be a service scenario corresponding to the current usage. The business scenario and the environment variable may have a correspondence.
Specifically, the execution environment recognition script may determine a current service scenario, and further, according to a correspondence between the service scenario and an environment variable, may determine a current environment variable corresponding to the current service scenario for subsequent configuration.
And S120, replacing the target environment field with the current environment variable to generate a page file packaging request.
The pagefile packaging request may be an instruction or code for packaging the pagefile, and the like.
Specifically, after the current environment variable and the target environment field in the program to be configured are determined, the target environment field may be replaced with the current environment variable, so as to package the page file corresponding to the current environment variable. Furthermore, the replaced program to be configured can be executed, a page file packaging request is generated, so that a page file corresponding to the current environment variable is obtained, and the page file is packaged.
S130, acquiring a target page file corresponding to the current environment variable according to the page file packaging request.
The target page file may be a page file that needs to be packaged, that is, a page file that is needed in a resource package in a current service scenario.
Specifically, when the page file packaging request is received, the page file packaging request may be analyzed, the page file corresponding to the page file packaging request is determined, and the page file is used as a target page file corresponding to the current environment variable for subsequent packaging into the resource package.
And S140, packaging the target page file based on a program packaging tool.
The program packaging tool may be a tool for packaging and compressing the program in the program development process. Alternatively, the program packaging tool may be Webpack (Module packager).
Specifically, after the target page file is determined, the target page file may be packaged into the resource package through a program packaging tool, so that the program in the resource package can adapt to the page configuration of the current service scenario.
It should be noted that, if the program packaging tool is Webpack, the main goal of Webpack is to package JavaScript files together. Furthermore, the resource package file generated after packaging can be used in a browser. Meanwhile, Webpack can also be competent for the work of transforming (transform), packaging (bundle), or wrapping (package) any resource.
It should be noted that the performance and access speed of internet applications (web applications) are related to the size of the resource package. Under the same other conditions, the smaller the resource packet is, the better the application performance is, and the faster the access speed is.
On the basis of the above embodiment, if there is a situation that the current environment variable cannot be obtained, all the page files may be packed into the resource package in order to ensure that the resource package can adapt to the current service scenario.
The method can be specifically realized according to the following steps:
step one, if the current environment variable is not obtained, determining at least one configurable environment variable corresponding to the program to be configured.
The configurable environment variable may be an environment variable corresponding to each service scenario, or may be all environment variables that can be configured.
Specifically, if the current environment variable is not obtained, all the page files corresponding to all the environment variables need to be packed. Therefore, all configurable environment variables which can be configured in the program to be configured are determined, so that the page files corresponding to the environment variables are determined.
And step two, identifying a target environment field in the program to be configured, replacing the target environment field with each configurable environment variable respectively, and generating a page file packaging request.
Specifically, for the configuration program to be identified, a target environment field used for representing an environment variable is identified. Furthermore, the target environment field may be replaced with each configurable environment variable, so as to package the page file corresponding to each configurable environment variable. And executing the replaced program to be configured, generating a page file packaging request to obtain the page files corresponding to the configurable environment variables, and packaging the page files.
And step three, acquiring each target page file corresponding to each configurable environment variable according to the page file packaging request, and packaging each target page file based on a program packaging tool.
Specifically, when the page file packaging request is received, the page file packaging request may be analyzed, and each page file corresponding to the page file packaging request, that is, the page file corresponding to each configurable environment variable, is determined. And then, the page files are used as target page files corresponding to the configurable environment variables, and the target page files are packaged into the resource package through a program packaging tool, so that programs in the resource package can adapt to the page configuration of each service scene.
According to the technical scheme of the embodiment of the invention, the current environment variable is obtained, the target environment field in the program to be configured is identified, the target environment field is replaced by the current environment variable, the page file packaging request is generated to obtain the target page file, the target page file corresponding to the current environment variable is obtained according to the page file packaging request, and the target page file is packaged based on the program packaging tool, so that the problem that the resource package occupies a large storage space due to the fact that the redundant page file which is not matched with the current service scene is stored in the resource package is solved, the storage space of the resource package is saved, and the technical effects of improving the performance of internet application and the access speed are achieved.
Example two
Fig. 2 is a schematic flow chart of a page packaging method according to a second embodiment of the present invention, and in this embodiment, reference may be made to the technical solution of this embodiment for a generation manner of a page file packaging request and an acquisition manner of a target page file on the basis of the foregoing embodiments. The same or corresponding terms as those in the above embodiments are not explained in detail herein.
As shown in fig. 2, the method of this embodiment specifically includes the following steps:
s210, obtaining the current environment variable, and identifying a target environment field in the program to be configured.
And S220, replacing the target environment field with the current environment variable.
And S230, determining the name of the target page file and the storage path of the target page file corresponding to the current environment variable based on the preset corresponding relation between the environment variable and the page file.
The correspondence between the environment variable and the page file may be a one-to-one correspondence, or a one-to-many or many-to-one correspondence. For example: the environment variable A corresponds to the page file X, the environment variable B corresponds to the page files Y and Z, and the environment variable C and the environment variable D are all opposite to the opposite page file R and the like. The target page file name may be a file name of the target page file, and may further include a document format suffix and the like. The target pagefile storage path may be path information for storing the target pagefile, for determining a storage location of the target file.
Specifically, the target page file corresponding to the current environment variable may be determined according to a preset correspondence between the environment variable and the page file, that is, the name of the target page file may be determined, and the storage path of the target page file may also be determined.
S240, generating a page file packaging request based on the current environment variable, the target page file name and the target page file storage path.
Specifically, the page file packaging request including the current environment variable, the name of the target page file, and the storage path of the target page file may be generated according to a preset form of the page file packaging request or a program code.
And S250, analyzing the page file packaging request, and determining a target page file name and a target page file storage path corresponding to the page file packaging request.
Specifically, when the page file packaging request is received, the page file packaging request may be analyzed, and a target page file name and a target page file storage path corresponding to the page file packaging request are determined, so as to obtain a target page file corresponding to the target page file name from the target page file storage path, and use the target page file in subsequent packaging into the resource package.
And S260, acquiring the target page file corresponding to the current environment variable according to the name of the target page file and the storage path of the target page file.
Specifically, the position of the target page file can be determined according to the storage path of the target page file, and then the target page file corresponding to the current environment variable can be obtained according to the name of the target page file.
And S270, packaging the target page file based on a program packaging tool.
As an optional implementation of the foregoing embodiments, fig. 3 is a schematic flow chart of another page packaging method provided in the second embodiment of the present invention. The same or corresponding terms as those in the above embodiments are not explained in detail herein.
Specifically, the initial stage of packaging the resource package through the Webpack can identify the program to be configured. If the file import field and the file name field are identified, the file name field comprises a target environment field, and the current environment variable is obtained, the target environment field in the program to be configured can be replaced by the current environment variable. And acquiring a target page file according to the replaced program to be configured, and packaging the target page file.
Illustratively, if a statement is identified: and (2) import file $ env.js, wherein import can be regarded as a file import field, file $ env.js can be regarded as a file name field, and $ env can be regarded as a target environment field. When the environment variable of a certain service scenario, i.e. the current environment variable, is obtained, the $ env in the statement may be replaced by the current environment variable. For example: the environment variable corresponding to the service scene A is A, and the environment variable corresponding to the service scene B is B. If the page file corresponding to the service scene a needs to be packaged, determining that the current environment variable is a, and replacing $ env in the statement import file $ env.js with a to obtain the statement import file.a.js. Similarly, if the page file corresponding to the service scene B needs to be packaged, the statement import file.b.js can be obtained. Generally, if $ env ═ N, then a statement import file.n.js is obtained, where N is any environment variable. And then, the target page file can be obtained through the statements, and the target page file is packaged into a final resource package.
It should be noted that, in the resource package of the service scene a obtained by the above-mentioned packaging, neither the code file of the file.b nor the page file corresponding to other service scenes occurs, and in the resource package of the service scene B, neither the code file of the file.a nor the page file corresponding to other service scenes occurs. Therefore, different target page files can be packaged according to different service scenes to eliminate the codes of invalid redundant page files, the size of a resource packet corresponding to the final code can be reduced, and the performance of internet application is improved.
The technical scheme of the embodiment of the invention comprises the steps of obtaining a current environment variable, identifying a target environment field in a program to be configured, replacing the target environment field with the current environment variable, further determining a target page file name and a target page file storage path corresponding to the current environment variable based on a preset corresponding relation between the environment variable and a page file so as to obtain and determine the storage position and the name of the target page file, generating a page file packaging request based on the current environment variable, the target page file name and the target page file storage path, analyzing the page file packaging request, determining the target page file name and the target page file storage path corresponding to the page file packaging request, accurately obtaining the target page file, and further obtaining the target page file according to the target page file name and the target page file storage path, the method comprises the steps of obtaining a target page file corresponding to a current environment variable, and packaging the target page file based on a program packaging tool, so that the problems that the page file required by a current service scene is difficult to accurately determine, and a resource package occupies a large storage space are solved, the accurate determination of the target page file is realized, the storage space of the resource package is saved, and the technical effects of improving the performance of internet application and improving the access speed are achieved.
EXAMPLE III
Fig. 4 is a schematic structural diagram of a page packaging apparatus according to a third embodiment of the present invention, where the apparatus includes: an identification module 310, a request generation module 320, a file acquisition module 330, and a packaging module 340.
The identification module 310 is configured to obtain a current environment variable, and identify a target environment field in a program to be configured; a request generating module 320, configured to replace the target environment field with the current environment variable, and generate a page file packaging request; the file obtaining module 330 is configured to obtain a target page file corresponding to the current environment variable according to the page file packaging request; and the packaging module 340 is configured to package the target page file based on a program packaging tool.
Optionally, the identifying module 310 is further configured to obtain a current environment variable input by the user; or, determining a current environment variable corresponding to the current service scene through the environment recognition script.
Optionally, the request generating module 320 is further configured to replace the target environment field with the current environment variable; determining a target page file name and a target page file storage path corresponding to the current environment variable based on a preset corresponding relation between the environment variable and the page file; and generating a page file packaging request based on the current environment variable, the target page file name and the target page file storage path.
Optionally, the file obtaining module 330 is further configured to analyze the page file packaging request, and determine a target page file name and a target page file storage path corresponding to the page file packaging request; and acquiring the target page file corresponding to the current environment variable according to the name of the target page file and the storage path of the target page file.
Optionally, the apparatus further comprises: each page file packaging module is used for determining at least one configurable environment variable corresponding to the program to be configured if the current environment variable is not acquired; identifying a target environment field in the program to be configured, respectively replacing the target environment field with each configurable environment variable, and generating a page file packaging request; and acquiring each target page file corresponding to each configurable environment variable according to the page file packaging request, and packaging each target page file based on the program packaging tool.
Optionally, the program to be configured includes a file import field and a file name field; wherein the file name field comprises a target environment field.
Optionally, the program packaging tool is Webpack.
According to the technical scheme of the embodiment of the invention, the current environment variable is obtained, the target environment field in the program to be configured is identified, the target environment field is replaced by the current environment variable, the page file packaging request is generated to obtain the target page file, the target page file corresponding to the current environment variable is obtained according to the page file packaging request, and the target page file is packaged based on the program packaging tool, so that the problem that the resource package occupies a large storage space due to the fact that the redundant page file which is not matched with the current service scene is stored in the resource package is solved, the storage space of the resource package is saved, and the technical effects of improving the performance of internet application and the access speed are achieved.
The page packing device provided by the embodiment of the invention can execute the page packing method provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method.
It should be noted that, the units and modules included in the apparatus are merely divided according to functional logic, but are not limited to the above division as long as the corresponding functions can be implemented; in addition, specific names of the functional units are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the embodiment of the invention.
Example four
Fig. 5 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention. FIG. 5 illustrates a block diagram of an exemplary electronic device 40 suitable for use in implementing embodiments of the present invention. The electronic device 40 shown in fig. 5 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiment of the present invention.
As shown in fig. 5, electronic device 40 is embodied in the form of a general purpose computing device. The components of electronic device 40 may include, but are not limited to: one or more processors or processing units 401, a system memory 402, and a bus 403 that couples the various system components (including the system memory 402 and the processing unit 401).
Bus 403 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, micro-channel architecture (MAC) bus, enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Electronic device 40 typically includes a variety of computer system readable media. Such media may be any available media that is accessible by electronic device 40 and includes both volatile and nonvolatile media, removable and non-removable media.
The system memory 402 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM)404 and/or cache memory 405. The electronic device 40 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 406 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 5, commonly referred to as a "hard drive"). Although not shown in FIG. 5, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to the bus 403 by one or more data media interfaces. System memory 402 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
A program/utility 408 having a set (at least one) of program modules 407 may be stored, for example, in system memory 402, such program modules 407 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may comprise an implementation of a network environment. Program modules 407 generally perform the functions and/or methods of the described embodiments of the invention.
The electronic device 40 may also communicate with one or more external devices 409 (e.g., keyboard, pointing device, display 410, etc.), with one or more devices that enable a user to interact with the electronic device 40, and/or with any devices (e.g., network card, modem, etc.) that enable the electronic device 40 to communicate with one or more other computing devices. Such communication may be through input/output (I/O) interface 411. Also, the electronic device 40 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the internet) via the network adapter 412. As shown, the network adapter 412 communicates with the other modules of the electronic device 40 over the bus 403. It should be appreciated that although not shown in FIG. 5, other hardware and/or software modules may be used in conjunction with electronic device 40, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
The processing unit 401 executes various functional applications and data processing, for example, implementing a page packing method provided by an embodiment of the present invention, by running a program stored in the system memory 402.
EXAMPLE five
An embodiment of the present invention further provides a storage medium containing computer-executable instructions, where the computer-executable instructions are executed by a computer processor to perform a page packing method, and the method includes:
acquiring a current environment variable, and identifying a target environment field in a program to be configured;
replacing the target environment field with the current environment variable to generate a page file packaging request;
acquiring a target page file corresponding to the current environment variable according to the page file packaging request;
and packaging the target page file based on a program packaging tool.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for embodiments of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (10)

1. A page packing method is characterized by comprising the following steps:
acquiring a current environment variable, and identifying a target environment field in a program to be configured;
replacing the target environment field with the current environment variable to generate a page file packaging request;
acquiring a target page file corresponding to the current environment variable according to the page file packaging request;
and packaging the target page file based on a program packaging tool.
2. The method of claim 1, wherein obtaining the current environment variable comprises:
acquiring a current environment variable input by a user;
or, determining a current environment variable corresponding to the current service scene through the environment recognition script.
3. The method of claim 1, wherein replacing the target environment field with the current environment variable generates a pagefile packaging request comprising:
replacing the target environment field with the current environment variable;
determining a target page file name and a target page file storage path corresponding to the current environment variable based on a preset corresponding relation between the environment variable and the page file;
and generating a page file packaging request based on the current environment variable, the target page file name and the target page file storage path.
4. The method of claim 3, wherein the obtaining the target page file corresponding to the current environment variable according to the page file packaging request comprises:
analyzing the page file packaging request, and determining a target page file name and a target page file storage path corresponding to the page file packaging request;
and acquiring the target page file corresponding to the current environment variable according to the name of the target page file and the storage path of the target page file.
5. The method of claim 1, further comprising:
if the current environment variable is not acquired, determining at least one configurable environment variable corresponding to the program to be configured;
identifying a target environment field in the program to be configured, respectively replacing the target environment field with each configurable environment variable, and generating a page file packaging request;
and acquiring each target page file corresponding to each configurable environment variable according to the page file packaging request, and packaging each target page file based on the program packaging tool.
6. The method of claim 1, wherein the program to be configured comprises a file import field and a file name field; wherein the file name field comprises a target environment field.
7. The method of claim 1, wherein the program packaging tool is Webpack.
8. A page wrapping apparatus, comprising:
the identification module is used for acquiring the current environment variable and identifying a target environment field in the program to be configured;
the request generation module is used for replacing the target environment field with the current environment variable to generate a page file packaging request;
the file acquisition module is used for acquiring a target page file corresponding to the current environment variable according to the page file packaging request;
and the packaging module is used for packaging the target page file based on a program packaging tool.
9. An electronic device, characterized in that the electronic device comprises:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the page packing method of any of claims 1-7.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the page packing method according to any one of claims 1 to 7.
CN202110661001.0A 2021-06-15 2021-06-15 Page packaging method and device, electronic equipment and storage medium Pending CN113238737A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110661001.0A CN113238737A (en) 2021-06-15 2021-06-15 Page packaging method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110661001.0A CN113238737A (en) 2021-06-15 2021-06-15 Page packaging method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113238737A true CN113238737A (en) 2021-08-10

Family

ID=77139822

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110661001.0A Pending CN113238737A (en) 2021-06-15 2021-06-15 Page packaging method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113238737A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113778956A (en) * 2021-09-15 2021-12-10 京东科技信息技术有限公司 Resource processing method and device, electronic equipment and computer readable medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018177260A1 (en) * 2017-03-28 2018-10-04 腾讯科技(深圳)有限公司 Application development method and tool, device, and storage medium thereof
CN110609966A (en) * 2018-05-29 2019-12-24 阿里巴巴集团控股有限公司 Page display method, device and equipment
CN110989978A (en) * 2019-11-06 2020-04-10 北京达佳互联信息技术有限公司 Page packaging method and device, electronic equipment and storage medium
CN111159615A (en) * 2019-12-31 2020-05-15 北大方正集团有限公司 Webpage processing method and device
CN112612448A (en) * 2020-12-16 2021-04-06 平安普惠企业管理有限公司 Front-end internationalized multi-page packaging method and device and computer equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018177260A1 (en) * 2017-03-28 2018-10-04 腾讯科技(深圳)有限公司 Application development method and tool, device, and storage medium thereof
CN110609966A (en) * 2018-05-29 2019-12-24 阿里巴巴集团控股有限公司 Page display method, device and equipment
CN110989978A (en) * 2019-11-06 2020-04-10 北京达佳互联信息技术有限公司 Page packaging method and device, electronic equipment and storage medium
CN111159615A (en) * 2019-12-31 2020-05-15 北大方正集团有限公司 Webpage processing method and device
CN112612448A (en) * 2020-12-16 2021-04-06 平安普惠企业管理有限公司 Front-end internationalized multi-page packaging method and device and computer equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
沈顺天: "《微信小程序实战》", 31 October 2020 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113778956A (en) * 2021-09-15 2021-12-10 京东科技信息技术有限公司 Resource processing method and device, electronic equipment and computer readable medium

Similar Documents

Publication Publication Date Title
US8719791B1 (en) Display of aggregated stack traces in a source code viewer
CN111090628A (en) Data processing method and device, storage medium and electronic equipment
CN107315729B (en) Data processing method, medium, device and computing equipment for chart
CN111221572B (en) Method, device, medium and equipment for automatically adapting to running environment
CN110769002A (en) LabVIEW-based message analysis method, system, electronic device and medium
CN112363753A (en) Data verification method and device, electronic equipment and storage medium
CN109739524A (en) A kind of generation method, device, electronic equipment and the storage medium of software installation packet
CN113204345A (en) Page generation method and device, electronic equipment and storage medium
CN110704325B (en) Data processing method and device, computer storage medium and electronic equipment
CN111241180A (en) Information processing method, device, equipment and storage medium
CN113238737A (en) Page packaging method and device, electronic equipment and storage medium
CN110659210A (en) Information acquisition method and device, electronic equipment and storage medium
US20140137083A1 (en) Instrumenting computer program code by merging template and target code methods
CN112379967B (en) Simulator detection method, device, equipment and medium
CN114219643A (en) Transaction calling method, device, equipment and storage medium
CN109062797B (en) Method and device for generating information
CN114528509A (en) Page display processing method and device, electronic equipment and storage medium
CN110753136B (en) Domain name resolution method, device, equipment and storage medium
CN113377376A (en) Data packet generation method, data packet generation device, electronic device, and storage medium
CN113885998A (en) Page rendering method and device, electronic equipment and storage medium
CN112364268A (en) Resource acquisition method and device, electronic equipment and storage medium
CN113760696A (en) Program problem positioning method and device, electronic equipment and storage medium
CN114443042A (en) Service arrangement execution method based on rule engine and related equipment
CN112966671A (en) Contract detection method and device, electronic equipment and storage medium
CN112748930B (en) Compilation detection method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20210810

RJ01 Rejection of invention patent application after publication