Project processing methods, devices, electronic equipment, storage media and program products

By automatically inserting web page tags into the entrance HTML file, the problem of low efficiency in manual writing HTML tags in the prior art is solved, and unified management and efficient introduction of external dependency information addresses are realized.

CN113536180BActive Publication Date: 2025-03-21BEIJING DAJIA INTERNET INFORMATION TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202110721889.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-06-28
Publication Date
2025-03-21
Estimated Expiration
2041-06-28

AI Technical Summary

Technical Problem

In the prior art, it is necessary to manually write HTML tags, which makes it less efficient to introduce external dependency information into the entry HTML file and is inconvenient to manage the addresses corresponding to the external dependency information in a unified manner.

Method used

By obtaining the entry file list and configuration file of the web page project, determine the target entry file and insertion location for inserting the web page tag based on the information in the configuration file, and automatically insert the web page tag into the target entry file.

Benefits of technology

It improves the efficiency of introducing external dependency information in the entry file, realizes unified management of external dependency information addresses, and reduces the need to manually write HTML tags.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113536180B_ABST
    Figure CN113536180B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a method, device, electronic device, storage medium and program product for processing a web page project, wherein the method includes obtaining an entry file list and a configuration file for the web page project, determining a target entry file where a web page tag needs to be inserted from the entry file list of the web page project according to exclusion information; determining an insertion position of the web page tag in the target entry file according to location information; inserting the web page tag into the target entry file according to the insertion position, wherein the web page tag is used for the web page project to introduce external dependency information. The present disclosure pre-creates a configuration file for the web page project, and uniformly manages the addresses corresponding to the external dependency information that needs to be introduced into the web page project through the configuration file. After determining the insertion position of the target entry file according to the exclusion information and location information, the web page tag is automatically inserted into the target entry file, without the need to manually write the web page tag, thereby improving the efficiency of the entry file in introducing external dependency information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a method, device, electronic device, computer-readable storage medium, and computer program product for processing a web page project. Background Art

[0002] A web project can contain multiple entry Hypertext Markup Language (HTML) files. The entry HTML file is the first file returned to the user when the user visits the web page. The address in the entry HTML file is used to introduce the external dependency information required by the web project, so as to render a complete and interactive page based on the external dependency information. Currently, it is necessary to manually write HTML tags in the entry HTML file and write the address corresponding to the external dependency information into the HTML tag.

[0003] However, manually writing HTML tags is inefficient, resulting in low efficiency in introducing external dependency information into the entry HTML file. Moreover, when a web page project contains multiple entry HTML files, writing HTML tags for each entry HTML file separately is not convenient for unified management of the addresses corresponding to the external dependency information. Summary of the invention

[0004] The present disclosure provides a method, device, electronic device, computer-readable storage medium and computer program product for processing a web page project, so as to at least solve the problem in the related art that the efficiency of introducing external dependency information into the entry HTML file is low due to the need to manually write HTML tags, and it is not convenient to uniformly manage the addresses corresponding to the external dependency information. The technical solution of the present disclosure is as follows:

[0005] According to a first aspect of an embodiment of the present disclosure, a method for processing a web page project is provided, comprising: obtaining an entry file list and a configuration file of the web page project, the configuration file comprising a web page tag to be inserted into at least one entry file in the entry file list, position information of the web page tag in the corresponding entry file, and exclusion information of the entry file list, the web page tag comprising an address corresponding to external dependency information that needs to be introduced by the web page project, the exclusion information being used to determine, by exclusion, entry files in the entry file list into which the web page tag does not need to be inserted; determining, from the entry file list of the web page project according to the exclusion information, a target entry file into which the web page tag needs to be inserted; determining, according to the position information, an insertion position of the web page tag in the target entry file; and inserting the web page tag into the target entry file according to the insertion position, the web page tag being used for the web page project to introduce the external dependency information.

[0006] Optionally, after obtaining the configuration file of the web page project, the method further includes: reading each tag keyword of the web page tag from the configuration file; and composing the web page tag with the field content corresponding to each tag keyword in the configuration file.

[0007] Optionally, after obtaining the configuration file of the web page project, the method further includes: reading a location keyword of the location information from the configuration file; and using the field content corresponding to the location keyword in the configuration file as the location information.

[0008] Optionally, after obtaining the configuration file of the web page project, the method further includes: reading exclusion keywords of the exclusion information from the configuration file; and using the field content corresponding to the exclusion keywords in the configuration file as the exclusion information.

[0009] Optionally, the field content corresponding to the exclusion keyword in the configuration file includes: identification information of an entry file into which the web page tag does not need to be inserted; determining the target entry file into which the web page tag needs to be inserted from the entry file list of the web page project based on the exclusion information comprises: comparing the identification information in the field content corresponding to the exclusion keyword in the configuration file with the identification information of the entry file of the web page project to obtain a comparison result; and taking the entry file whose identification information is different as indicated by the comparison result as the target entry file.

[0010] Optionally, determining the insertion position of the web page tag in the target entry file according to the position information includes: taking the position represented by the field content corresponding to the position keyword in the configuration file as the insertion position.

[0011] Optionally, inserting the web page tag into the target entry file according to the insertion position includes: inserting the web page tag into the insertion position of the target entry file according to a preset string replacement interface.

[0012] Optionally, inserting the web page tag into the insertion position of the target entry file according to a preset string replacement interface includes: replacing the tail tag at the insertion position in the target entry file with the web page tag according to the string replacement interface.

[0013] Optionally, obtaining the entry file list of the web page project includes: calling a preset hook function to obtain the text of each entry file in the entry file list, and the directory of each entry file in the entry file list in the web page project.

[0014] Optionally, the tag keywords include: tag type keywords, tag attribute keywords and tag content keywords; wherein, the field content corresponding to the tag attribute keywords in the configuration file includes the address, and the field content corresponding to the tag content keywords in the configuration file indicates the operation content of the web page tag in the target entry file.

[0015] According to a second aspect of an embodiment of the present disclosure, a processing device for a web page project is provided, comprising: an acquisition unit, configured to execute acquisition of an entry file list and a configuration file of the web page project, the configuration file comprising a web page tag to be inserted into at least one entry file in the entry file list, position information of the web page tag in the corresponding entry file and exclusion information of the entry file list, the web page tag comprising an address corresponding to external dependency information that needs to be introduced by the web page project, and the exclusion information is used to determine, by exclusion, entry files in the entry file list into which the web page tag does not need to be inserted; a target determination unit, configured to execute determination of a target entry file into which the web page tag needs to be inserted from the entry file list of the web page project according to the exclusion information; a position determination unit, configured to execute determination of an insertion position of the web page tag in the target entry file according to the position information; a tag insertion unit, configured to execute insertion of the web page tag into the target entry file according to the insertion position, the web page tag being used for the web page project to introduce the external dependency information.

[0016] Optionally, the device also includes: a parsing unit, configured to read each tag keyword of the web page tag from the configuration file after the acquisition unit acquires the configuration file of the web page project; and compose the web page tag with the field content corresponding to each tag keyword in the configuration file.

[0017] Optionally, the parsing unit is further configured to read the location keyword of the location information from the configuration file after the acquisition unit acquires the configuration file of the web page project; and use the field content corresponding to the location keyword in the configuration file as the location information.

[0018] Optionally, the parsing unit is further configured to read exclusion keywords of the exclusion information from the configuration file after the acquisition unit acquires the configuration file of the web page project; and use the field content corresponding to the exclusion keyword in the configuration file as the exclusion information.

[0019] Optionally, the field content corresponding to the exclusion keyword in the configuration file includes: identification information of the entry file that does not need to insert the web page tag; the target determination unit includes: an identification comparison unit, configured to compare the identification information in the field content corresponding to the exclusion keyword in the configuration file with the identification information of the entry file of the web page project to obtain a comparison result; a target entry file determination unit, configured to execute the entry file whose identification information is different as indicated by the comparison result as the target entry file.

[0020] Optionally, the position determination unit is configured to execute the position indicated by the field content corresponding to the position keyword in the configuration file as the insertion position.

[0021] Optionally, the tag insertion unit is configured to insert the web page tag into the insertion position of the target entry file according to a preset string replacement interface.

[0022] Optionally, the tag insertion unit is configured to execute, according to the string replacement interface, replacing the tail tag at the insertion position in the target entry file with the web page tag.

[0023] Optionally, the acquisition unit is configured to execute a call to a preset hook function to acquire the text of each entry file in the entry file list, and the directory of each entry file in the entry file list in the web page project.

[0024] Optionally, each tag keyword includes: a tag type keyword, a tag attribute keyword and a tag content keyword; wherein the field content corresponding to the tag attribute keyword in the configuration file includes the address, and the field content corresponding to the tag content keyword in the configuration file represents the operation content of the web page tag in the target entry file. According to a third aspect of an embodiment of the present disclosure, an electronic device is provided, comprising: a processor; a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement the method for processing a web page project as described in the first aspect.

[0025] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided. When instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device can execute the method for processing web page projects as described in the first aspect.

[0026] According to a fifth aspect of an embodiment of the present disclosure, a computer program product is provided, including a computer program, which, when executed by a processor, implements the method for processing a web page project as described in the first aspect.

[0027] The technical solution provided by the embodiments of the present disclosure brings at least the following beneficial effects:

[0028] The processing scheme for web page projects provided by the embodiments of the present disclosure pre-creates a configuration file for the web page project, and the configuration file may include a web page tag to be inserted into at least one entry file in the entry file list of the web page project, the position information of the web page tag in the corresponding entry file, and the exclusion information of the web page tag. Among them, the web page tag includes the address corresponding to the external dependency information that needs to be introduced by the web page project, and the exclusion information is used to determine the entry file in the entry file list that does not need to insert the web page tag by exclusion, and then determine the target entry file that needs to insert the web page tag from the entry file list of the web page project according to the exclusion information, and determine the insertion position of the web page tag in the target entry file according to the position information, and then insert the web page tag into the target entry file according to the insertion position. The web page tag in the target entry file is used for the web page project to introduce external dependency information.

[0029] The embodiment of the present disclosure pre-creates a configuration file for a web page project, and can manage the addresses corresponding to the external dependency information that needs to be introduced into the entry file of the web page project in a unified manner through the configuration file. Moreover, after determining the insertion position of the target entry file based on the exclusion information and the position information, the web page tag is automatically inserted into the target entry file, and there is no need to manually write the web page tag, which improves the efficiency of the entry file introducing external dependency information.

[0030] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.

[0032] Figure 1 The present invention is a flowchart of a method for processing a web page project according to an exemplary embodiment.

[0033] Figure 2 It is a flowchart of a solution for uniformly managing external dependency information of entry HTML files in a web page project according to an exemplary embodiment.

[0034] Figure 3 It is a block diagram of a device for processing a web page project according to an exemplary embodiment.

[0035] Figure 4It is a block diagram of an electronic device for processing a web page project according to an exemplary embodiment.

[0036] Figure 5 It is a block diagram of an electronic device for processing a web page project according to an exemplary embodiment. DETAILED DESCRIPTION

[0037] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.

[0038] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0039] Figure 1 is a flowchart of a method for processing a web page project according to an exemplary embodiment. Figure 1 As shown, the processing method of the web page project may specifically include the following steps.

[0040] In step S11, the entry file list and configuration file of the web page project are obtained.

[0041] In an embodiment of the present disclosure, one or more entry files are included in the entry file list. In practical applications, all entry files in the entry file list need to introduce external dependency information, or some entry files in the entry file list need to introduce external dependency information. The embodiment of the present disclosure can also create a configuration file for the web page project in advance, and the configuration file may include a web page tag to be inserted into at least one entry file in the entry file list of the web page project, the position information of the web page tag in the corresponding entry file, and the exclusion information of the entry file list. Among them, the web page tag contains the address corresponding to the external dependency information that needs to be introduced into the web page project. The exclusion information is used to determine the entry file in the entry file list that does not need to insert the web page tag by exclusion. In other words, no matter how many entry files are included in the entry file list of the web page project, and no matter how much external dependency information needs to be introduced into the entry file, the address corresponding to the external dependency information that needs to be introduced into one or more entry files can be recorded in the configuration file of the web page project. In practical applications, the entry file of the web page project can be an entry HTML file.

[0042] In step S12, the target entry file into which the web page tag needs to be inserted is determined from the entry file list of the web page project according to the exclusion information.

[0043] In the embodiment of the present disclosure, since the exclusion information has the function of determining the entry files in the entry file list that do not need to insert the web page tag, the entry files that do not need to insert the web page tag can be determined from the entry file list according to the exclusion information, and then the entry files in the entry file list other than the entry files that do not need to insert the web page tag are used as the entry files that need to insert the web page tag. The entry file that needs to insert the web page tag is the target entry file.

[0044] In step S13, the insertion position of the web page tag in the target entry file is determined according to the position information.

[0045] In the embodiment of the present disclosure, since the position information has the function of determining the insertion position of the web page tag in the target entry file, the insertion position of the web page tag in the target entry file can be determined according to the position information.

[0046] In step S14, the web page tag is inserted into the target entry file according to the insertion position.

[0047] In the embodiment of the present disclosure, the web page tag is inserted into the insertion position of the target entry file, so that the address corresponding to the required external dependency information is inserted into the target entry file. The web page tag in the target entry file is used for the web page project to introduce external dependency information.

[0048] The processing scheme for web page projects provided by the embodiments of the present disclosure pre-creates a configuration file for the web page project, and the configuration file may include a web page tag to be inserted into at least one entry file in the entry file list of the web page project, the position information of the web page tag in the corresponding entry file, and the exclusion information of the web page tag. Among them, the web page tag includes the address corresponding to the external dependency information that needs to be introduced by the web page project, and the exclusion information is used to determine the entry file in the entry file list that does not need to insert the web page tag by exclusion, and then determine the target entry file that needs to insert the web page tag from the entry file list of the web page project according to the exclusion information, and determine the insertion position of the web page tag in the target entry file according to the position information, and then insert the web page tag into the target entry file according to the insertion position. The web page tag in the target entry file is used for the web page project to introduce external dependency information.

[0049] The embodiment of the present disclosure pre-creates a configuration file for a web page project, and can manage the addresses corresponding to the external dependency information that needs to be introduced into the entry file of the web page project in a unified manner through the configuration file. Moreover, after determining the insertion position of the target entry file based on the exclusion information and the position information, the web page tag is automatically inserted into the target entry file, and there is no need to manually write the web page tag, which improves the efficiency of the entry file introducing external dependency information.

[0050] In an exemplary embodiment of the present disclosure, the configuration file may include tag keywords of web page tags, exclusion keywords of exclusion information, location keywords of location information, etc. Among them, the tag keywords are used to parse and obtain web page tags. The exclusion keywords are used to determine the exclusion information. The location keywords are used to determine the location information.

[0051] In actual applications, if the entry file list of a web project contains 5 entry HTML files, a unified configuration file can be created for the web project. The unified configuration file can contain 5 or less entry HTML files to be inserted into the web page tags, the location information of the web page tags, and the exclusion information of the entry file list. According to the format of the web page tags inserted into the entry HTML file, the tag keywords of the web page tags in the configuration file can include tag type keywords (type), tag attribute keywords (attrs), and tag content keywords (inner). Among them, the field content corresponding to the tag type keyword in the configuration file is the specific type of the web page tag, such as the "script" type, and the field content corresponding to the tag content keyword in the configuration file is the operation content of the web page tag in the entry HTML file, such as "console.log(\'load script\')". The tag attribute keyword may contain multiple field contents, so an object structure can be used to identify the tag attribute keyword, wherein the key of the object is the attribute name, and the value of the object is the attribute value. For example, a tag keyword is shown below:

[0052]

[0053] In an exemplary embodiment of the present disclosure, after obtaining the configuration file of the web page project, each tag keyword of the web page tag can be read from the configuration file, and then the field content corresponding to each tag keyword in the configuration file can be used to form a web page tag. For example, the tag keywords in the above example can be parsed into web page tags according to the parsing rules. The parsing rules may include a string corresponding to a tag type keyword, a string corresponding to a tag attribute keyword, and a string corresponding to a tag content keyword, etc. That is, based on the string corresponding to the tag type keyword, the string corresponding to the tag attribute keyword, and the string corresponding to the tag content keyword, it can be determined which contents in the tag keywords are tag type keywords, which contents are tag attribute keywords, and which contents are tag content keywords, etc.

[0054] In an exemplary embodiment of the present disclosure, in addition to the above-mentioned web page tags, the configuration file may also include exclusion information of the entry file list, and the exclusion information of the entry file list may indicate identification information that does not need to introduce external dependency information in the web page project. For example, the exclusion information of the entry file list may be "exclude: 'package1, package2'". Among them, "package1" and "package2" are the names of entry HTML files that do not need to introduce external dependency information. In other words, in the web page project, all entry HTML files except those named "package1" and "package2" can introduce external dependency information.

[0055] In an exemplary embodiment of the present disclosure, after obtaining the configuration file of the web page project, it is necessary to determine which entry HTML file or files of the web page project need to introduce external dependency information. Therefore, the exclusion keyword of the exclusion information can be read from the configuration file, and the field content corresponding to the exclusion keyword in the configuration file is used as the exclusion information. The field content corresponding to the exclusion keyword in the configuration file may contain the identification information of the entry file that does not need to insert the web page tag. For example, if the field content corresponding to the exclusion keyword of the exclusion information of the entry file list read is "package1", it means that the entry HTML file with the identification information "package1" does not need to introduce external dependency information, then all other entry HTML files in the web page project except the entry HTML file named "package1" need to introduce external dependency information. In actual applications, when determining the target entry file that needs to insert the web page tag from the entry file list of the web page project according to the exclusion information, the identification information in the field content corresponding to the exclusion keyword in the configuration file can be compared with the identification information of the entry file of the web page project to obtain a comparison result, and the entry file with different identification information indicated by the comparison result is used as the target entry file. That is, it is determined whether the identification information of the current entry HTML file is the same as the identification information in the field content corresponding to the exclusion keyword in the configuration file. If the identification information of the current entry HTML file is not the same as the identification information in the field content corresponding to the exclusion keyword in the configuration file, it is determined that the current entry HTML file is the target entry file. If the identification information of the current entry HTML file is the same as the identification information in the field content corresponding to the exclusion keyword in the configuration file, it is determined that the current entry HTML file is not the target entry file.

[0056] In an exemplary embodiment of the present disclosure, in addition to the exclusion information of the web page tag and the entry file list, the configuration file may also include position information, which may indicate the specific insertion position of the web page tag in the entry HTML file. For example, the position information may be "position: 'head'". Among them, "head" indicates that the specific insertion position of the web page tag in the entry HTML file is the head of the entry HTML file.

[0057] In an exemplary embodiment of the present disclosure, after obtaining the configuration file of the web page project, the location keyword of the location information is read from the configuration file, and the field content corresponding to the location keyword in the configuration file is used as the location information. Continuing with the above example, the location information may be "position: 'head'". Among them, the location keyword is "position" and the location information is "head". When determining the insertion position of the web page tag in the target entry file based on the location information, the position indicated by the field content corresponding to the location keyword in the configuration file may be used as the insertion position. For example, if the field content corresponding to the location keyword in the configuration file is "head", the insertion position is the head of the target entry HTML file. If the field content corresponding to the location keyword in the configuration file is "end", the insertion position is the end of the target entry HTML file.

[0058] In an exemplary embodiment of the present disclosure, when inserting a web page tag into a target entry file according to an insertion position, the web page tag can be inserted into the insertion position of the target entry file according to a preset string replacement interface. In actual applications, the tail tag at the insertion position in the target entry file is replaced with the web page tag according to the string replacement interface, thereby realizing automatic insertion of the web page tag into the target entry file.

[0059] In an exemplary embodiment of the present disclosure, when obtaining the entry file list of the web page project, a preset hook function can be called to obtain the text of each entry file in the entry file list and the directory of each entry file in the web page project. That is, the entry file list can contain the text of the entry file and the directory of the entry file.

[0060] In an exemplary embodiment of the present disclosure, since a web page project includes multiple entry HTML files, and one entry HTML file can also introduce multiple external dependency information. Therefore, multiple sets of web page tags, exclusion information, and location information can be recorded in the configuration file in the form of an array. For example, the configuration file of a web page project is:

[0061]

[0062] The content in the above “content” can be multiple web page tags, that is, multiple external dependency information can be introduced into one entry HTML file.

[0063] Based on the above description of the embodiment of a method for processing a web page project, a solution for uniformly managing the external dependency information of the entry HTML file in the web page project is introduced below. Figure 2 As shown, the solution for uniformly managing the external dependency information of the entry HTML file in the web page project can include two parts. One part can be to abstract the external dependency information of the entry HTML file into a configuration file. The other part can be to automatically insert HTML tag data (which can be understood as a web page tag) into each entry HTML file that needs to introduce external dependency information according to the configuration file.

[0064] When abstracting external dependency information into a configuration file, the format of HTML tag data can be analyzed first. HTML tag data can be composed of the following parts: tag type (including tag type keywords and corresponding field content), tag attributes (including tag attribute keywords and corresponding field content) and tag content (including tag content keywords and corresponding field content). In addition, the configuration file also needs to include two fields, for example, the field "position" is used to determine the position of the entry HTML file where the HTML tag data is inserted. The field "exclude" is used to determine which entry HTML files do not need to introduce external dependency information. By abstracting the external dependency information of the entry HTML file of the web page project into a configuration file, unified management of external dependency information is achieved. Each external dependency information can be directly read from the configuration file, and there is no need to read each entry HTML file separately, which improves the convenience of managing external dependency information. Moreover, when multiple entry HTML files need to introduce the same external dependency information, there is no need to write the same HTML tag data for multiple entry HTML files separately, which reduces the workload of editing code and improves work efficiency. In addition, which entry HTML files do not introduce external dependency information and where to insert HTML tag data in the entry HTML file can be adjusted in the configuration file, which realizes flexible configuration of external dependency information.

[0065] In actual applications, the web project can be packaged using a preset packaging tool. The preset packaging tool can be webpack, which is a module packager. The main goal of webpack is to package JavaScript (a lightweight, interpreted or just-in-time compiled high-level programming language with function priority) files together, and the packaged files are used in the browser. And use html-webpack-plugin (a plug-in in webpack for generating and managing entry HTML files) to generate the entry HTML file. In addition, html-webpack-plugin also provides a lifecycle hook function, which can obtain the text and directory of the entry HTML file. When automatically inserting HTML tag data into the entry HTML file according to the configuration file, first read the configuration file, and judge whether the entry HTML file in the current directory needs to introduce external dependency information according to the value of the field "exclude" in the configuration file. If the name of the entry HTML file in the current directory is in the value of the field "exclude", the current directory is skipped and no external dependency information is introduced into the entry HTML file in the current directory. If the name of the entry HTML file in the current directory is not in the value of the field "exclude", the external dependency information is introduced into the entry HTML file in the current directory. Then, the tag type, tag attributes, and tag content in the configuration file are parsed into a complete HTML tag data. And, according to the value of the field "position" in the configuration file, the specific insertion position of the HTML tag data in the entry HTML file is determined. When inserting HTML tag data, the string replacement interface provided by JavaScript, such as String.prototype.replace, can be used to replace the tail tag at the specific insertion position with the HTML tag data, so that the HTML tag data is automatically inserted into the entry HTML file. There is no need to manually modify the HTML code in the entry HTML file, which reduces the risk caused by human operational errors and improves the security of the entry HTML file introducing external dependency information.

[0066] Figure 3 The block diagram of a device for processing a web page project according to an exemplary embodiment is shown. The device may specifically include the following units.

[0067] The acquisition unit 31 is configured to execute acquisition of an entry file list and a configuration file of a web page project, wherein the configuration file includes a web page tag to be inserted into at least one entry file in the entry file list, position information of the web page tag in the corresponding entry file, and exclusion information of the entry file list, wherein the web page tag includes an address corresponding to external dependency information to be introduced by the web page project, and the exclusion information is used to determine, by exclusion, an entry file in the entry file list into which the web page tag does not need to be inserted;

[0068] A target determination unit 32 is configured to determine a target entry file to be inserted into the web page tag from the entry file list of the web page project according to the exclusion information;

[0069] A position determination unit 33 is configured to determine the insertion position of the web page tag in the target entry file according to the position information;

[0070] The tag insertion unit 34 is configured to insert the web page tag into the target entry file according to the insertion position, and the web page tag is used for the web page project to introduce the external dependency information.

[0071] In an exemplary embodiment of the present disclosure, the device further includes:

[0072] The parsing unit is configured to read each tag keyword of the web page tag from the configuration file after the acquisition unit 31 acquires the configuration file of the web page project; and compose the web page tag with the field content corresponding to each tag keyword in the configuration file.

[0073] In an exemplary embodiment of the present disclosure, the parsing unit is further configured to read the location keyword of the location information from the configuration file after the acquisition unit 31 acquires the configuration file of the web page project; and use the field content corresponding to the location keyword in the configuration file as the location information.

[0074] In an exemplary embodiment of the present disclosure, the parsing unit is also configured to execute, after the acquisition unit 31 acquires the configuration file of the web page project, reading the exclusion keywords of the exclusion information from the configuration file; and using the field content corresponding to the exclusion keywords in the configuration file as the exclusion information.

[0075] In an exemplary embodiment of the present disclosure, the field content corresponding to the exclusion keyword in the configuration file includes: identification information of the entry file that does not need to be inserted into the web page tag;

[0076] The target determination unit 32 includes:

[0077] an identification comparison unit, configured to compare identification information in the field content corresponding to the exclusion keyword in the configuration file with identification information in the entry file of the web page project to obtain a comparison result;

[0078] The target entry file determination unit is configured to execute the entry file whose identification information is different as indicated by the comparison result as the target entry file.

[0079] In an exemplary embodiment of the present disclosure, the position determination unit 33 is configured to execute the position represented by the field content corresponding to the position keyword in the configuration file as the insertion position.

[0080] In an exemplary embodiment of the present disclosure, the tag inserting unit 34 is configured to insert the web page tag into the insertion position of the target entry file according to a preset string replacement interface.

[0081] In an exemplary embodiment of the present disclosure, the tag insertion unit 34 is configured to execute, according to the string replacement interface, replacing the tail tag at the insertion position in the target entry file with the web page tag.

[0082] In an exemplary embodiment of the present disclosure, the acquisition unit 31 is configured to execute a call to a preset hook function to obtain the text of each entry file in the entry file list, and the directory of each entry file in the entry file list in the web page project.

[0083] In an exemplary embodiment of the present disclosure, the tag keywords include: tag type keywords, tag attribute keywords, and tag content keywords;

[0084] Among them, the field content corresponding to the tag attribute keyword in the configuration file includes the address, and the field content corresponding to the tag content keyword in the configuration file represents the operation content of the web page tag in the target entry file.

[0085] Regarding the device in the above embodiment, the specific manner in which each unit performs the operation has been described in detail in the embodiment of the method, and will not be elaborated here.

[0086] Figure 4 4 is a block diagram of a processing electronic device 400 for a web page project according to an exemplary embodiment. For example, the electronic device 400 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0087] Reference Figure 4 , the electronic device 400 may include one or more of the following components: a processing component 402 , a memory 404 , a power component 406 , a multimedia component 408 , an audio component 410 , an input / output (I / O) interface 412 , a sensor component 414 , and a communication component 416 .

[0088] The processing component 402 generally controls the overall operation of the electronic device 400, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 402 may include one or more processors 420 to execute instructions to complete all or part of the steps of the processing method of the above-mentioned web page project. In addition, the processing component 402 may include one or more modules to facilitate the interaction between the processing component 402 and other components. For example, the processing component 402 may include a multimedia module to facilitate the interaction between the multimedia component 408 and the processing component 402.

[0089] The memory 404 is configured to store various types of data to support operations on the electronic device 400. Examples of such data include instructions for any application or method operating on the electronic device 400, contact data, phone book data, messages, images, videos, etc. The memory 404 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0090] The power supply component 406 provides power to the various components of the electronic device 400. The power supply component 406 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 400.

[0091] The multimedia component 408 includes a screen that provides an output interface between the electronic device 400 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 408 includes a front camera and / or a rear camera. When the electronic device 400 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and the rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.

[0092] The audio component 410 is configured to output and / or input audio signals. For example, the audio component 410 includes a microphone (MIC), and when the electronic device 400 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 404 or sent via the communication component 416. In some embodiments, the audio component 410 also includes a speaker for outputting audio signals.

[0093] I / O interface 412 provides an interface between processing component 402 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.

[0094] The sensor assembly 414 includes one or more sensors for providing various aspects of status assessment for the electronic device 400. For example, the sensor assembly 414 can detect the open / closed state of the electronic device 400, the relative positioning of the components, such as the display and keypad of the electronic device 400, and the sensor assembly 414 can also detect the position change of the electronic device 400 or a component of the electronic device 400, the presence or absence of contact between the user and the electronic device 400, the orientation or acceleration / deceleration of the electronic device 400, and the temperature change of the electronic device 400. The sensor assembly 414 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 414 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 414 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0095] The communication component 416 is configured to facilitate wired or wireless communication between the electronic device 400 and other devices. The electronic device 400 can access a wireless network based on a communication standard, such as WiFi, a carrier network (such as 2G, 3G, 4G or 5G), or a combination thereof. In an exemplary embodiment, the communication component 416 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 416 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0096] In an exemplary embodiment, the electronic device 400 can be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to execute the processing method of the above-mentioned web page project.

[0097] In an exemplary embodiment, a computer-readable storage medium including instructions is also provided, such as a memory 404 including instructions, and the above instructions can be executed by the processor 420 of the electronic device 400 to complete the above-mentioned web page project processing method. Optionally, the computer-readable storage medium can be a non-temporary computer-readable storage medium, for example, the non-temporary computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0098] In an exemplary embodiment, a computer program product is also provided, the computer program product includes a computer program, the computer program can be executed by the processor 420 of the electronic device 400 to complete the above-mentioned web page project processing method. Optionally, the computer program can be stored in a computer-readable storage medium of the electronic device 400, and the computer-readable storage medium can be a non-temporary computer-readable storage medium, for example, the non-temporary computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0099] Figure 5 is a block diagram of an electronic device 500 for processing a web page project according to an exemplary embodiment. For example, the electronic device 500 may be provided as a server. Figure 5, the electronic device 500 includes a processing component 522, which further includes one or more processors, and a memory resource represented by a memory 532 for storing instructions executable by the processing component 522, such as an application. The application stored in the memory 532 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 522 is configured to execute instructions to perform the above-mentioned web-side project processing method.

[0100] The electronic device 500 may also include a power supply component 526 configured to perform power management of the electronic device 500, a wired or wireless network interface 550 configured to connect the electronic device 500 to a network, and an input / output (I / O) interface 558. The electronic device 500 may operate based on an operating system stored in the memory 532, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™ or the like.

[0101] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.

[0102] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A method for processing a web page project, characterized in that: include: Obtain an entry file list and a configuration file for a web page project, wherein the configuration file includes a web page tag to be inserted into at least one entry file in the entry file list, position information of the web page tag in the corresponding entry file, and exclusion information of the entry file list, wherein the web page tag includes an address corresponding to external dependency information that needs to be introduced by the web page project, the position information is used to indicate a specific insertion position of the web page tag in the entry file, and the exclusion information is used to determine, by exclusion, an entry file in the entry file list into which the web page tag does not need to be inserted; Determine, from the entry file list of the web page project according to the exclusion information, a target entry file into which the web page tag needs to be inserted; Determine the insertion position of the web page tag in the target entry file according to the position information; The web page tag is inserted into the target entry file according to the insertion position, and the web page tag is used for the web page project to introduce the external dependency information.

2. The method according to claim 1, characterized in that After obtaining the configuration file of the web page project, the method further includes: Reading each tag keyword of the web page tag from the configuration file; The web page tag is formed by using the field contents corresponding to each tag keyword in the configuration file.

3. The method according to claim 1, characterized in that After obtaining the configuration file of the web page project, the method further includes: Reading a location keyword of the location information from the configuration file; The field content corresponding to the location keyword in the configuration file is used as the location information.

4. The method according to claim 1, characterized in that: After obtaining the configuration file of the web page project, the method further includes: Reading exclusion keywords of the exclusion information from the configuration file; The field content corresponding to the exclusion keyword in the configuration file is used as the exclusion information.

5. The method according to claim 4, characterized in that The field content corresponding to the exclusion keyword in the configuration file includes: identification information of the entry file that does not need to be inserted into the web page tag; The step of determining, from the entry file list of the web page project according to the exclusion information, a target entry file into which the web page tag needs to be inserted comprises: Compare the identification information of the exclusion keyword in the field content corresponding to the configuration file with the identification information of the entry file of the web page project to obtain a comparison result; The entry file whose identification information is different as indicated by the comparison result is used as the target entry file.

6. The method according to claim 3, characterized in that Determining the insertion position of the web page tag in the target entry file according to the position information includes: The position indicated by the field content corresponding to the position keyword in the configuration file is used as the insertion position.

7. The method according to claim 1, characterized in that The step of inserting the web page tag into the target entry file according to the insertion position includes: The web page tag is inserted into the insertion position of the target entry file according to a preset string replacement interface.

8. The method according to claim 7, characterized in that The step of inserting the web page tag into the insertion position of the target entry file according to a preset string replacement interface includes: According to the string replacement interface, the tail tag at the insertion position in the target entry file is replaced with the web page tag.

9. The method according to claim 1, characterized in that: The step of obtaining the entry file list of the web page project includes: The preset hook function is called to obtain the text of each entry file in the entry file list and the directory of each entry file in the entry file list in the web page project.

10. The method according to claim 2, characterized in that The tag keywords include: tag type keywords, tag attribute keywords and tag content keywords; Among them, the field content corresponding to the tag attribute keyword in the configuration file includes the address, and the field content corresponding to the tag content keyword in the configuration file represents the operation content of the web page tag in the target entry file.

11. A device for processing a web page project, characterized in that: include: an acquisition unit, configured to execute acquisition of an entry file list and a configuration file of a web page project, wherein the configuration file includes a web page tag to be inserted into at least one entry file in the entry file list, position information of the web page tag in the corresponding entry file, and exclusion information of the entry file list, wherein the web page tag includes an address corresponding to external dependency information to be introduced by the web page project, the position information is used to indicate a specific insertion position of the web page tag in the entry file, and the exclusion information is used to determine, by exclusion, an entry file in the entry file list into which the web page tag does not need to be inserted; A target determination unit is configured to determine a target entry file that needs to be inserted into the web page tag from the entry file list of the web page project according to the exclusion information; A position determination unit, configured to determine an insertion position of the web page tag in the target entry file according to the position information; The tag insertion unit is configured to insert the web page tag into the target entry file according to the insertion position, and the web page tag is used for the web page project to introduce the external dependency information.

12. The device according to claim 11, characterized in that The device also includes: The parsing unit is configured to read each tag keyword of the web page tag from the configuration file after the acquisition unit acquires the configuration file of the web page project; and compose the web page tag with the field content corresponding to each tag keyword in the configuration file.

13. The device according to claim 12, characterized in that The parsing unit is further configured to read the location keyword of the location information from the configuration file after the acquisition unit acquires the configuration file of the web page project; and use the field content corresponding to the location keyword in the configuration file as the location information.

14. The device according to claim 12 or 13, characterized in that The parsing unit is further configured to read exclusion keywords of the exclusion information from the configuration file after the acquisition unit acquires the configuration file of the web page project; and use the field content corresponding to the exclusion keyword in the configuration file as the exclusion information.

15. The device according to claim 14, characterized in that The field content corresponding to the exclusion keyword in the configuration file includes: identification information of the entry file that does not need to be inserted into the web page tag; The target determination unit comprises: an identification comparison unit, configured to compare identification information in the field content corresponding to the exclusion keyword in the configuration file with identification information in the entry file of the web page project to obtain a comparison result; The target entry file determination unit is configured to execute the entry file whose identification information is different as indicated by the comparison result as the target entry file.

16. The device according to claim 13, characterized in that The position determination unit is configured to use the position indicated by the field content corresponding to the position keyword in the configuration file as the insertion position.

17. The device according to claim 11, characterized in that The tag insertion unit is configured to insert the web page tag into the insertion position of the target entry file according to a preset string replacement interface.

18. The device according to claim 17, characterized in that The tag insertion unit is configured to execute, according to the string replacement interface, replacing the tail tag at the insertion position in the target entry file with the web page tag.

19. The device according to claim 11, characterized in that The acquisition unit is configured to execute a call to a preset hook function to acquire the text of each entry file in the entry file list and the directory of each entry file in the entry file list in the web page project.

20. The device according to claim 12, characterized in that The tag keywords include: tag type keywords, tag attribute keywords and tag content keywords; Among them, the field content corresponding to the tag attribute keyword in the configuration file includes the address, and the field content corresponding to the tag content keyword in the configuration file represents the operation content of the web page tag in the target entry file.

21. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; Wherein, the processor is configured to execute the instructions to implement the processing method of the web page project as described in any one of claims 1 to 10.

22. A computer-readable storage medium, characterized in that: When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the method for processing a web page project as described in any one of claims 1 to 10.

23. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, it implements the method for processing a web page project as described in any one of claims 1 to 10.

Citation Information

Patent Citations

  • File catalog recognition method and device

    CN107766351A

  • Project framework construction method and device, computer equipment and storage medium

    CN110647320A

  • Plug-in processing method and device for live channel, equipment and storage medium

    CN111913761A