CN113536180A - Item processing method, item processing device, electronic equipment, storage medium and program product - Google Patents

Item processing method, item processing device, electronic equipment, storage medium and program product Download PDF

Info

Publication number
CN113536180A
CN113536180A CN202110721889.2A CN202110721889A CN113536180A CN 113536180 A CN113536180 A CN 113536180A CN 202110721889 A CN202110721889 A CN 202110721889A CN 113536180 A CN113536180 A CN 113536180A
Authority
CN
China
Prior art keywords
webpage
file
information
entry file
entry
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
CN202110721889.2A
Other languages
Chinese (zh)
Inventor
周吾南
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Dajia Internet Information Technology Co Ltd
Original Assignee
Beijing Dajia Internet Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Dajia Internet Information Technology Co Ltd filed Critical Beijing Dajia Internet Information Technology Co Ltd
Priority to CN202110721889.2A priority Critical patent/CN113536180A/en
Publication of CN113536180A publication Critical patent/CN113536180A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • G06F16/986Document structures and storage, e.g. HTML extensions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • G06F16/972Access to data in other repository systems, e.g. legacy data or dynamic Web page generation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The disclosure relates to a processing method, a device, electronic equipment, a storage medium and a program product of a webpage end project, wherein the method comprises the steps of obtaining an entry file list and a configuration file of the webpage end project, and determining a target entry file needing to be inserted with a webpage label from the entry file list of the webpage end project according to exclusion information; determining the insertion position of the webpage label in the target entry file according to the position information; and inserting the webpage tag into the target entry file according to the insertion position, wherein the webpage tag is used for introducing external dependency information for the webpage end item. The method comprises the steps of creating a configuration file for a webpage end project in advance, and managing addresses corresponding to external dependence information needing to be introduced into the webpage end project in a unified mode through the configuration file. After the inserting position of the target entry file is determined according to the exclusion information and the position information, the webpage label is automatically inserted into the target entry file, the webpage label does not need to be written manually, and the efficiency of introducing external dependency information into the entry file is improved.

Description

Item processing method, item processing device, electronic equipment, storage medium and program product
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method and an apparatus for processing a web page end project, an electronic device, a computer-readable storage medium, and a computer program product.
Background
The web page side items may contain a plurality of portal hypertext Markup Language (HTML) files. The portal HTML file is the first file returned to the user when the user accesses the web page. The address in the entry HTML file is used for introducing external dependency information required by the webpage end project, so that a complete and interactive page is rendered according to the external dependency information. At present, an HTML tag needs to be written in an entry HTML file manually, and an address corresponding to external dependency information is written in the HTML tag.
However, manually writing HTML tags is inefficient, resulting in inefficient introduction of external dependency information into the portal HTML file. Moreover, when the web page end item includes a plurality of entry HTML files, writing an HTML tag for each entry HTML file, respectively, is inconvenient for uniform management of addresses corresponding to external dependency information.
Disclosure of Invention
The disclosure provides a processing method and device for webpage end items, electronic equipment, a computer readable storage medium and a computer program product, which are used for at least solving the problems that the efficiency of introducing external dependency information into an entry HTML file is low and unified management of addresses corresponding to the external dependency information is inconvenient, which are caused by the fact that an HTML tag needs to be written manually in the related art. The technical scheme of the disclosure is as follows:
according to a first aspect of the embodiments of the present disclosure, a method for processing a webpage end item is provided, including: acquiring an entry file list and a configuration file of a webpage end item, wherein the configuration file comprises a webpage label to be inserted into at least one entry file in the entry file list, position information of the webpage label in the corresponding entry file and exclusion information of the entry file list, the webpage label comprises an address corresponding to external dependency information which needs to be introduced into the webpage end item, and the exclusion information is used for determining the entry file which does not need to be inserted into the webpage label in the entry file list in an exclusion manner; determining a target entry file into which the webpage label needs to be inserted from an entry file list of the webpage end item according to the exclusion information; determining the insertion position of the webpage label in the target entry file according to the position information; and inserting the webpage tag into the target entry file according to the inserting position, wherein the webpage tag is used for leading the webpage end item into the external dependency information.
Optionally, after the obtaining the configuration file of the webpage end item, the method further includes: reading each label keyword of the webpage label from the configuration file; and forming the webpage label by the corresponding field content of each label keyword in the configuration file.
Optionally, after the obtaining the configuration file of the webpage end item, the method further includes: reading the position key words of the position information from the configuration file; and taking the corresponding field content of the position keyword in the configuration file as the position information.
Optionally, after the obtaining the configuration file of the webpage end item, the method further includes: reading exclusion keywords of the exclusion information from the configuration file; and taking the corresponding field content of the exclusion keyword in the configuration file as the exclusion information.
Optionally, the corresponding field content of the excluded keyword in the configuration file includes: identification information of an entry file which does not need to be inserted into the webpage label; determining a target entry file into which the webpage tag needs to be inserted from an entry file list of the webpage end item according to the exclusion information, wherein the determining comprises the following steps: comparing the identification information of the excluded keywords in the corresponding field content in the configuration file with the identification information of the entry file of the webpage end project to obtain a comparison result; and taking the entry file with different identification information represented by the comparison result as the target entry file.
Optionally, the determining, according to the location information, an insertion location of the webpage tag in the target entry file includes: and taking the position represented by the corresponding field content of the position keyword in the configuration file as the insertion position.
Optionally, the inserting the webpage tag into the target entry file according to the inserting position includes: and inserting the webpage label into the insertion position of the target entry file according to a preset character string replacing interface.
Optionally, the inserting the webpage tag into the insertion position of the target entry file according to a preset character string replacing interface includes: replacing the tail label at the insertion position in the target entry file with the webpage label according to the character string replacement interface.
Optionally, the obtaining an entry file list of the webpage end item includes: and 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 webpage end project.
Optionally, each of the tag keywords includes: a tag type keyword, a tag attribute keyword and a tag content keyword; the field content corresponding to the tag attribute keyword in the configuration file comprises the address, and the field content corresponding to the tag content keyword in the configuration file represents the operation content of the webpage tag in the target entry file.
According to a second aspect of the embodiments of the present disclosure, there is provided a device for processing a web page end item, including: the device comprises an acquisition unit, a configuration unit and a processing unit, wherein the acquisition unit is configured to execute acquisition of an entry file list and a configuration file of a webpage end item, the configuration file comprises a webpage label to be inserted into at least one entry file in the entry file list, position information of the webpage label in a corresponding entry file and exclusion information of the entry file list, the webpage label comprises an address corresponding to external dependency information which needs to be introduced into the webpage end item, and the exclusion information is used for determining the entry file which does not need to be inserted into the webpage label in the entry file list in an exclusion manner; the target determining unit is configured to determine a target entry file needing to be inserted with the webpage label from the entry file list of the webpage end item according to the exclusion information; a position determining unit configured to perform determining an insertion position of the webpage tag in the target entry file according to the position information; and the label inserting unit is configured to insert the webpage label into the target entry file according to the inserting position, wherein the webpage label is used for leading the webpage end item into the external dependency information.
Optionally, the apparatus further comprises: the analysis unit is configured to read each tag keyword of the webpage tag from the configuration file after the acquisition unit acquires the configuration file of the webpage end item; and forming the webpage label by the corresponding field content of each label keyword in the configuration file.
Optionally, the parsing unit is further configured to perform, after the obtaining unit obtains a configuration file of a web page end item, reading a location keyword of the location information from the configuration file; and taking the corresponding field content of the position keyword in the configuration file as the position information.
Optionally, the parsing unit is further configured to perform, after the obtaining unit obtains the configuration file of the webpage end item, reading an exclusion keyword of the exclusion information from the configuration file; and taking the corresponding field content of the exclusion keyword in the configuration file as the exclusion information.
Optionally, the corresponding field content of the excluded keyword in the configuration file includes: identification information of an entry file which does not need to be inserted into the webpage label; the target determination unit includes: the identification comparison unit is configured to compare the identification information of the excluded keyword in the corresponding field content in the configuration file with the identification information of the entry file of the webpage end item to obtain a comparison result; a target entry file determination unit configured to perform an entry file in which the comparison result indicates that the identification information is not the same as the target entry file.
Optionally, the location determining unit is configured to perform, as the insertion location, a location represented by a corresponding field content in the configuration file of the location keyword.
Optionally, the tag inserting unit is configured to perform inserting the webpage tag into the inserting position of the target entry file according to a preset character string replacing interface.
Optionally, the tag insertion unit is configured to execute replacing the tail tag at the insertion position in the target entry file with the web tag according to the character string replacement interface.
Optionally, the obtaining unit is configured to execute calling a preset hook function to obtain a text of each entry file in the entry file list and a directory of each entry file in the entry file list in the web page end item.
Optionally, each of the tag keywords includes: a tag type keyword, a tag attribute keyword and a tag content keyword; the field content corresponding to the tag attribute keyword in the configuration file comprises the address, and the field content corresponding to the tag content keyword in the configuration file represents the operation content of the webpage tag in the target entry file. According to a third aspect of the embodiments of the present disclosure, there is provided an electronic apparatus including: a processor; a memory for storing the processor-executable instructions; wherein the processor is configured to execute the instructions to implement the method for processing the webpage end item according to the first aspect.
According to a fourth aspect of the embodiments of the present disclosure, there is provided a computer-readable storage medium, wherein instructions of the computer-readable storage medium, when executed by a processor of an electronic device, enable the electronic device to perform the method for processing a webpage-side item according to the first aspect.
According to a fifth aspect of embodiments of the present disclosure, there is provided a computer program product, comprising a computer program, which when executed by a processor, implements the processing method of the web-end item according to the first aspect.
The technical scheme provided by the embodiment of the disclosure at least brings the following beneficial effects:
according to the processing scheme of the webpage end item, the configuration file is created for the webpage end item in advance, and the configuration file can contain the webpage label to be inserted into at least one entry file in the entry file list of the webpage end item, the position information of the webpage label in the corresponding entry file and the exclusion information of the webpage label. The webpage tags comprise addresses corresponding to external dependency information required to be introduced by webpage end items, the exclusion information is used for determining the entry files which do not need to be inserted with the webpage tags in the entry file list in an exclusion mode, then the target entry files which need to be inserted with the webpage tags are determined from the entry file list of the webpage end items according to the exclusion information, the insertion positions of the webpage tags in the target entry files are determined according to the position information, and then the webpage tags are inserted into the target entry files according to the insertion positions. And the webpage label in the target entry file is used for introducing external dependency information for the webpage end item.
The embodiment of the disclosure creates the configuration file for the webpage end project in advance, and can uniformly manage the address corresponding to the external dependency information required to be introduced into the entry file of the webpage end project through the configuration file. And after the insertion position of the target entry file is determined according to the exclusion information and the position information, the webpage label is automatically inserted into the target entry file, the webpage label does not need to be written manually, and the efficiency of introducing external dependency information into the entry file is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the disclosure and are not to be construed as limiting the disclosure.
FIG. 1 is a flowchart illustrating steps of a method for processing a web page end item in accordance with an exemplary embodiment.
Fig. 2 is a flowchart illustrating a scheme for uniformly managing external dependency information of an entry HTML file in a web page end item according to an exemplary embodiment.
Fig. 3 is a block diagram illustrating a processing device of a web page end item according to an example embodiment.
FIG. 4 is a block diagram illustrating electronic equipment for processing a web page end item in accordance with an exemplary embodiment.
FIG. 5 is a block diagram illustrating an electronic device for processing a web page side item in accordance with an exemplary embodiment.
Detailed Description
In order to make the technical solutions of the present disclosure better understood by those of ordinary skill in the art, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the above-described drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the disclosure described herein are capable of operation in sequences other than those illustrated or otherwise described herein. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
Fig. 1 is a flowchart illustrating steps of a method for processing a web page end item according to an exemplary embodiment, where as shown in fig. 1, the method for processing the web page end item may specifically include the following steps.
In step S11, an entry file list and a configuration file of the web page side item are acquired.
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 disclosure may also create a configuration file for the web page end item in advance, where the configuration file may include a web page tag to be inserted into at least one entry file in an entry file list of the web page end item, location information of the web page tag in a corresponding entry file, and exclusion information of the entry file list. The webpage label comprises an address corresponding to external dependency information which needs to be introduced by a webpage end item. The exclusion information is used for determining the entry files which do not need to insert the webpage tags in the entry file list in an exclusion mode. That is, no matter how many entry files are included in the entry file list of the web page end item, and no matter how many pieces of external dependency information need to be introduced into the entry files, addresses corresponding to the external dependency information that one or more entry files need to be introduced can be recorded in the configuration file of the web page end item. In practical applications, the entry file of the webpage end item may be an entry HTML file.
In step S12, a target entry file to which a netpage tag needs to be inserted is determined from the entry file list of the netpage terminal item according to the exclusion information.
In the embodiment of the present disclosure, since the exclusion information has an effect of determining the entry file that does not need to insert the webpage tag in the entry file list, the entry file that does not need to insert the webpage tag may be determined from the entry file list according to the exclusion information, and then the entry file in the entry file list other than the entry file that does not need to insert the webpage tag is used as the entry file that needs to insert the webpage tag. The portal file into which the webpage tag needs to be inserted is the target portal file.
In step S13, the insertion position of the netpage tag in the target entry file is determined according to the position information.
In the embodiment of the present disclosure, since the location information has a role of determining the insertion location of the webpage tag in the target portal file, the insertion location of the webpage tag in the target portal file can be determined according to the location information.
In step S14, the netpage tag is inserted into the target entry file according to the insertion position.
In the embodiment of the disclosure, the webpage tag is inserted into the insertion position of the target entry file, and thus, the target entry file is inserted with the address corresponding to the required external dependency information. And the webpage label in the target entry file is used for introducing external dependency information for the webpage end item.
According to the processing scheme of the webpage end item, the configuration file is created for the webpage end item in advance, and the configuration file can contain the webpage label to be inserted into at least one entry file in the entry file list of the webpage end item, the position information of the webpage label in the corresponding entry file and the exclusion information of the webpage label. The webpage tags comprise addresses corresponding to external dependency information required to be introduced by webpage end items, the exclusion information is used for determining the entry files which do not need to be inserted with the webpage tags in the entry file list in an exclusion mode, then the target entry files which need to be inserted with the webpage tags are determined from the entry file list of the webpage end items according to the exclusion information, the insertion positions of the webpage tags in the target entry files are determined according to the position information, and then the webpage tags are inserted into the target entry files according to the insertion positions. And the webpage label in the target entry file is used for introducing external dependency information for the webpage end item.
The embodiment of the disclosure creates the configuration file for the webpage end project in advance, and can uniformly manage the address corresponding to the external dependency information required to be introduced into the entry file of the webpage end project through the configuration file. And after the insertion position of the target entry file is determined according to the exclusion information and the position information, the webpage label is automatically inserted into the target entry file, the webpage label does not need to be written manually, and the efficiency of introducing external dependency information into the entry file is improved.
In an exemplary embodiment of the present disclosure, the profile may contain a tag keyword of a web tag, an exclusion keyword of exclusion information, a location keyword of location information, and the like. And the label key words are used for analyzing to obtain the webpage labels. The exclusion key is used to determine exclusion information. The location key is used to determine location information.
In practical application, if the entry file list of the web page end item includes 5 entry HTML files, a unified configuration file may be created for the web page end item, and the unified configuration file may include 5 or less than 5 entry HTML files to be inserted, location information of the web page tag, and exclusion information of the entry file list. The tag keywords of the web tags in the configuration file may include a tag type keyword (type), a tag attribute keyword (attrs), and a tag content keyword (inner) according to the format of the web tags inserted into the portal HTML file. The field content corresponding to the tag type keyword in the configuration file is a specific type of the web tag, such as a "script" type, and the field content corresponding to the tag content keyword in the configuration file is an operation content of the web tag in an entry HTML file, such as "console. The tag attribute key may contain a plurality of field contents, so that the tag attribute key may be identified by using an object structure, where a key of an object is an attribute name and a value of the object is an attribute value. For example, a certain tag keyword is as follows:
Figure BDA0003136791820000071
in an exemplary embodiment of the disclosure, after the configuration file of the web page end item is obtained, each tag keyword of the web page tag may be read from the configuration file, and then, the corresponding field content of each tag keyword in the configuration file forms the web page tag. For example, the tag keywords in the above example can be parsed into web page tags according to the parsing rule. The parsing rule may include a character string corresponding to a tag type keyword, a character string corresponding to a tag attribute keyword, a character string corresponding to a tag content keyword, and the like. That is, it can be determined which contents in the tag keywords are the tag type keywords, which contents are the tag attribute keywords, and which contents are the tag content keywords, etc. according to the character strings corresponding to the tag type keywords, the character strings corresponding to the tag attribute keywords, and the character strings corresponding to the tag content keywords.
In an exemplary embodiment of the present disclosure, in addition to the above-mentioned webpage tag, the configuration file may further include exclusion information of a portal file list, where the exclusion information of the portal file list may indicate identification information that does not require to introduce external dependency information in the webpage end item. For example, the exclusion information of the entry file list may be "excede: 'package 1, package 2'. Here, "package 1" and "package 2" are both names of entry HTML files that do not require the introduction of external dependency information. That is, the portal HTML files other than the names "package 1" and "package 2" in the netpage end item can introduce external dependency information.
In an exemplary embodiment of the present disclosure, after obtaining the configuration file of the web page end item, it needs to determine which entry HTML file or entry HTML files of the web page end item need to introduce the external dependency information. Therefore, the exclusion keyword for obtaining the exclusion information can be read from the configuration file, and the corresponding field content of the exclusion keyword in the configuration file is taken as the exclusion information. For example, if the field content corresponding to the exclusion keyword of the exclusion information of the read portal file list is "package 1", it indicates that the portal HTML file with the identification information of "package 1" does not need to introduce the external dependency information, and the portal HTML files other than the portal HTML file named "package 1" in the web page end item all need to introduce the external dependency information. In practical application, when a target entry file needing to be inserted with a web tag is determined from an entry file list of a web end item according to exclusion information, identification information of the exclusion keyword in corresponding field content in a configuration file can be compared with identification information of the entry file of the web end item to obtain a comparison result, and the entry file with different identification information represented by the comparison result is used as the target entry file. That is, it is determined whether the identification information of the current portal HTML file is the same as the identification information of the exclusion keyword in the corresponding field content in the configuration file, and if the identification information of the current portal HTML file is not the same as the identification information of the exclusion keyword in the corresponding field content in the configuration file, it is determined that the current portal HTML file is the target portal file. And if the identification information of the current portal HTML file is the same as the identification information of the corresponding field content of the exclusion keyword in the configuration file, determining that the current portal HTML file is not the target portal file.
In an exemplary embodiment of the present disclosure, the configuration file may include, in addition to the exclusion information of the above-mentioned web page tag and the portal file list, position information, which may indicate a specific insertion position of the web page tag in the portal HTML file. For example, the position information may be "position: 'head'. Wherein "head" indicates that the specific insertion position of the webpage tag in the portal HTML file is the head of the portal HTML file.
In an exemplary embodiment of the disclosure, after a configuration file of a webpage end item is acquired, a location keyword of location information is read from the configuration file, and the corresponding field content of the location keyword in the configuration file is used as the location information. In the above example, the position information may be "position: 'head'. The position keyword is "position" and the position information is "head". When the insertion position of the webpage label in the target entry file is determined according to the position information, the position represented by the corresponding field content of the position keyword in the configuration file can 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 location is the head of the target entry HTML file. And if the corresponding field content of the position keyword in the configuration file is 'end', the insertion position is the tail part of the target entry HTML file.
In an exemplary embodiment of the present disclosure, when the webpage tag is inserted into the target portal file according to the insertion position, the webpage tag may be inserted into the insertion position of the target portal file according to a preset character string replacement interface. In practical application, the tail label inserted into the position in the target entry file is replaced by the webpage label according to the character string replacement interface, so that the webpage label is automatically inserted into the target entry file.
In an exemplary embodiment of the present disclosure, when obtaining the entry file list of the web page end item, a preset hook function may be called to obtain a text of each entry file in the entry file list and a directory of each entry file in the entry file list in the web page end item. That is, the entry file list may include the text of the entry file and the directory of the entry file.
In an exemplary embodiment of the disclosure, since a plurality of portal HTML files are included in the webpage end item, moreover, one portal HTML file can also introduce a plurality of external dependency information. Accordingly, a plurality of sets of the web tag, the exclusion information, and the location information may be recorded in the configuration file in the form of an array. For example, the configuration file of a certain web page end item is:
Figure BDA0003136791820000091
the content in the above "content" may be a plurality of web page tags, that is, a plurality of external dependency information may be introduced into one entry HTML file.
Based on the above description about the embodiment of the processing method of the web page end item, a scheme for uniformly managing external dependency information of the entry HTML file in the web page end item is described below. As shown in fig. 2, the scheme for uniformly managing external dependency information of an entry HTML file in a web page end item may include two parts of content. A portion of the content may be abstracted into a configuration file from external dependency information of the portal HTML file. Another part of the content may be to automatically insert HTML tag data (which may be understood as a kind of web tag) into each entry HTML file that needs to introduce external dependency information according to a configuration file.
When abstracting the external dependency information into a configuration file, the format of the HTML tag data may be analyzed first. HTML tag data may consist of the following parts: a tag type (containing a tag type keyword and corresponding field content), a tag attribute (containing a tag attribute keyword and corresponding field content), and a tag content (containing a tag content keyword and corresponding field content). Also, two fields, e.g., the field "position", need to be included in the configuration file to determine where the HTML tag data is inserted into the portal HTML file. The field "include" is used to determine which entry HTML files do not require the introduction of external dependency information. By abstracting the external dependency information of the HTML file of the entry of the webpage end item into the configuration file, the unified management of the external dependency information is realized. The external dependency information can be directly read from the configuration file without reading the HTML file of each entry, so that the convenience of managing the external dependency information is improved. Moreover, when the same external dependency information needs to be introduced into the plurality of entry HTML files, the same HTML tag data does not need to be written for the plurality of entry HTML files, so that the workload of code editing is reduced, and the working efficiency is improved. And moreover, the method can adjust which entry HTML files do not introduce external dependency information in the configuration files, and insert HTML tag data in which position of the entry HTML files, so that flexible configuration of the external dependency information is realized.
In practical application, a preset packing tool can be used for packing the webpage end items, the preset packing tool can be webpack, and the webpack is a module packer. The main goal of webpack is to package JavaScript (a lightweight, interpreted or just-in-time high-level programming language with function precedence) files together, with the packaged files for use in a browser. And generates an entry HTML file using HTML-webpack-plugin (a plug-in for generating and managing an entry HTML file in webpack). Furthermore, HTML-webpack-plug also provides a lifecycle hooking function that can get the text and directory of the entry HTML file. When HTML tag data is automatically inserted into an entry HTML file according to a configuration file, the configuration file is read first, and whether the entry HTML file in the current directory needs to introduce external dependency information is judged according to the value of a field 'include' in the configuration file. And if the name of the entry HTML file under the current directory is in the value of the field 'exception', skipping the current directory without introducing external dependency information into the entry HTML file under the current directory. If the name of the entry HTML file under the current directory is not in the value of the field "exception", then external dependency information is introduced for the entry HTML file under the current directory. Then, the tag type, tag attribute and tag content in the configuration file are parsed into a complete HTML tag data. And, according to the value of field "position" in the configuration file, confirm the particular insertion position of HTML tag data in the HTML file of the entry. When the HTML tag data is inserted, the tail tag of a specific insertion position can be replaced by the HTML tag data through a character string replacement interface provided by JavaScript, such as string.
Fig. 3 is a block diagram illustrating a processing device of a web page end item according to an example embodiment. The apparatus may specifically include the following units.
The acquiring unit 31 is configured to perform acquiring an entry file list and a configuration file of a web page end item, where the configuration file includes a web page tag to be inserted into at least one entry file in the entry file list, location information of the web page tag in a corresponding entry file, and exclusion information of the entry file list, the web page tag includes an address corresponding to external dependency information that needs to be introduced into the web page end item, and the exclusion information is used to determine, in an exclusion manner, an entry file that does not need to be inserted into the web page tag in the entry file list;
a target determining unit 32, configured to determine a target entry file into which the webpage tag needs to be inserted from the entry file list of the webpage end item according to the exclusion information;
a location determining unit 33 configured to perform determining an insertion location of the webpage tag in the target entry file according to the location information;
a tag inserting unit 34 configured to perform inserting the web tag into the target entry file according to the inserting position, where the web tag is used for the web end item to introduce the external dependency information.
In an exemplary embodiment of the present disclosure, the apparatus further includes:
the analysis unit is configured to read each tag keyword of the webpage tag from the configuration file after the acquisition unit 31 acquires the configuration file of the webpage end item; and forming the webpage label by the corresponding field content of each label keyword in the configuration file.
In an exemplary embodiment of the disclosure, the parsing unit is further configured to perform, after the obtaining unit 31 obtains a configuration file of a webpage end item, reading a location keyword of the location information from the configuration file; and taking the corresponding field content of the position keyword in the configuration file as the position information.
In an exemplary embodiment of the disclosure, the parsing unit is further configured to perform, after the obtaining unit 31 obtains a configuration file of a webpage end item, reading an exclusion keyword of the exclusion information from the configuration file; and taking the corresponding field content of the exclusion keyword in the configuration file as the exclusion information.
In an exemplary embodiment of the disclosure, the corresponding field content of the exclusion keyword in the configuration file includes: identification information of an entry file which does not need to be inserted into the webpage label;
the target determination unit 32 includes:
the identification comparison unit is configured to compare the identification information of the excluded keyword in the corresponding field content in the configuration file with the identification information of the entry file of the webpage end item to obtain a comparison result;
a target entry file determination unit configured to perform an entry file in which the comparison result indicates that the identification information is not the same as the target entry file.
In an exemplary embodiment of the disclosure, the location determining unit 33 is configured to perform, as the insertion location, a location represented by a corresponding field content in the configuration file of the location keyword.
In an exemplary embodiment of the present disclosure, the tag inserting unit 34 is configured to perform inserting the webpage tag into the insertion position of the target entry file according to a preset character string replacement interface.
In an exemplary embodiment of the disclosure, the tag inserting unit 34 is configured to replace the tail tag at the inserting position in the target entry file with the web tag according to the character string replacing interface.
In an exemplary embodiment of the disclosure, the obtaining unit 31 is configured to execute a preset hook function to obtain a text of each entry file in the entry file list and a directory of each entry file in the entry file list in the web page end item.
In an exemplary embodiment of the present disclosure, each of the tag keywords includes: a tag type keyword, a tag attribute keyword and a tag content keyword;
the field content corresponding to the tag attribute keyword in the configuration file comprises the address, and the field content corresponding to the tag content keyword in the configuration file represents the operation content of the webpage tag in the target entry file.
With regard to the apparatus in the above-described embodiment, the specific manner in which each unit performs the operation has been described in detail in the embodiment related to the method, and will not be described in detail here.
FIG. 4 is a block diagram illustrating an electronic device 400 for processing web-site items, according to an example 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, an exercise device, a personal digital assistant, and the like.
Referring to fig. 4, 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 interface for input/output (I/O) 412, a sensor component 414, and a communication component 416.
The processing component 402 generally controls overall operation of the electronic device 400, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing component 402 may include one or more processors 420 to execute instructions to perform all or a portion of the steps of the method for processing the web page end item described above. Further, the processing component 402 can include one or more modules that facilitate interaction between the processing component 402 and other components. For example, the processing component 402 can include a multimedia module to facilitate interaction between the multimedia component 408 and the processing component 402.
The memory 404 is configured to store various types of data to support operations at the electronic device 400. Examples of such data include instructions for any application or method operating on the electronic device 400, contact data, phonebook data, messages, images, videos, and so forth. The memory 404 may be implemented by any type or combination of volatile or non-volatile memory devices 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 or optical disks.
The power supply component 406 provides power to the various components of the electronic device 400. Power components 406 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for electronic device 400.
The multimedia component 408 comprises a screen providing an output interface between the electronic device 400 and a 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 an input signal from a 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 boundary of a 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 facing camera and/or a rear facing camera. The front camera and/or the rear camera may receive external multimedia data when the electronic device 400 is in an operating mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 410 is configured to output and/or input audio signals. For example, the audio component 410 includes a Microphone (MIC) configured to receive external audio signals when the electronic device 400 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may further be stored in the memory 404 or transmitted via the communication component 416. In some embodiments, audio component 410 also includes a speaker for outputting audio signals.
The I/O interface 412 provides an interface between the processing component 402 and peripheral interface modules, which may be 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.
The sensor component 414 includes one or more sensors for providing various aspects of status assessment for the electronic device 400. For example, the sensor assembly 414 may detect an open/closed state of the electronic device 400, the relative positioning of components, such as a display and keypad of the electronic device 400, the sensor assembly 414 may also detect a change in the position of the electronic device 400 or a component of the electronic device 400, the presence or absence of user contact with the electronic device 400, orientation or acceleration/deceleration of the electronic device 400, and a change in the temperature of the electronic device 400. The sensor assembly 414 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 414 may also include a light 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.
The communication component 416 is configured to facilitate wired or wireless communication between the electronic device 400 and other devices. The electronic device 400 may 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 broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 416 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the electronic device 400 may 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, micro-controllers, microprocessors or other electronic components for performing the processing method of the above-described web page side item.
In an exemplary embodiment, a computer-readable storage medium comprising instructions, such as the memory 404 comprising instructions, which are executable by the processor 420 of the electronic device 400 to perform the method for processing the webpage-side item is also provided. Alternatively, the computer readable storage medium may be a non-transitory computer readable storage medium, for example, which may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
In an exemplary embodiment, a computer program product is also provided, which includes a computer program executable by the processor 420 of the electronic device 400 to perform the above-mentioned processing method of the web page end item. Alternatively, the computer program may be stored in a computer readable storage medium of the electronic device 400, which may be a non-transitory computer readable storage medium, for example, ROM, Random Access Memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, and the like.
FIG. 5 is a block diagram illustrating an electronic device 500 for processing a web-site item, according to an example embodiment. For example, the electronic device 500 may be provided as a server. Referring to fig. 5, electronic device 500 includes a processing component 522 that further includes one or more processors and memory resources, represented by memory 532, for storing instructions, such as applications, that are executable by processing component 522. The application programs stored in memory 532 may include one or more modules that each correspond to a set of instructions. Further, the processing component 522 is configured to execute instructions to perform the above-described method for processing a webpage-side item.
The electronic device 500 may also include a power 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 memory 532, such as Windows Server, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, or the like.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements 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 (10)

1. A method for processing a webpage end project is characterized by comprising the following steps:
acquiring an entry file list and a configuration file of a webpage end item, wherein the configuration file comprises a webpage label to be inserted into at least one entry file in the entry file list, position information of the webpage label in the corresponding entry file and exclusion information of the entry file list, the webpage label comprises an address corresponding to external dependency information which needs to be introduced into the webpage end item, and the exclusion information is used for determining the entry file which does not need to be inserted into the webpage label in the entry file list in an exclusion manner;
determining a target entry file into which the webpage label needs to be inserted from an entry file list of the webpage end item according to the exclusion information;
determining the insertion position of the webpage label in the target entry file according to the position information;
and inserting the webpage tag into the target entry file according to the inserting position, wherein the webpage tag is used for leading the webpage end item into the external dependency information.
2. The method of claim 1, wherein after the obtaining the configuration file of the webpage end item, the method further comprises:
reading each label keyword of the webpage label from the configuration file;
and forming the webpage label by the corresponding field content of each label keyword in the configuration file.
3. The method of claim 1, wherein after the obtaining the configuration file of the webpage end item, the method further comprises:
reading the position key words of the position information from the configuration file;
and taking the corresponding field content of the position keyword in the configuration file as the position information.
4. The method of claim 1, wherein after the obtaining the configuration file of the webpage end item, the method further comprises:
reading exclusion keywords of the exclusion information from the configuration file;
and taking the corresponding field content of the exclusion keyword in the configuration file as the exclusion information.
5. The method according to claim 4, wherein the excluding keywords corresponding to the field contents in the configuration file comprises: identification information of an entry file which does not need to be inserted into the webpage label;
determining a target entry file into which the webpage tag needs to be inserted from an entry file list of the webpage end item according to the exclusion information, wherein the determining comprises the following steps:
comparing the identification information of the excluded keywords in the corresponding field content in the configuration file with the identification information of the entry file of the webpage end project to obtain a comparison result;
and taking the entry file with different identification information represented by the comparison result as the target entry file.
6. The method of claim 3, wherein said determining an insertion location of said netpage tag in said target entry file based on said location information comprises:
and taking the position represented by the corresponding field content of the position keyword in the configuration file as the insertion position.
7. A device for processing a web page end item, comprising:
the device comprises an acquisition unit, a configuration unit and a processing unit, wherein the acquisition unit is configured to execute acquisition of an entry file list and a configuration file of a webpage end item, the configuration file comprises a webpage label to be inserted into at least one entry file in the entry file list, position information of the webpage label in a corresponding entry file and exclusion information of the entry file list, the webpage label comprises an address corresponding to external dependency information which needs to be introduced into the webpage end item, and the exclusion information is used for determining the entry file which does not need to be inserted into the webpage label in the entry file list in an exclusion manner;
the target determining unit is configured to determine a target entry file needing to be inserted with the webpage label from the entry file list of the webpage end item according to the exclusion information;
a position determining unit configured to perform determining an insertion position of the webpage tag in the target entry file according to the position information;
and the label inserting unit is configured to insert the webpage label into the target entry file according to the inserting position, wherein the webpage label is used for leading the webpage end item into the external dependency information.
8. An electronic device, comprising:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the method for processing the webpage end item according to any one of claims 1 to 6.
9. A computer-readable storage medium, wherein instructions in the computer-readable storage medium, when executed by a processor of an electronic device, enable the electronic device to perform the method for processing a netpage end item according to any one of claims 1 to 6.
10. A computer program product comprising a computer program, characterized in that the computer program, when being executed by a processor, implements a method of processing a netpage end item according to any one of claims 1 to 6.
CN202110721889.2A 2021-06-28 2021-06-28 Item processing method, item processing device, electronic equipment, storage medium and program product Pending CN113536180A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110721889.2A CN113536180A (en) 2021-06-28 2021-06-28 Item processing method, item processing device, electronic equipment, storage medium and program product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110721889.2A CN113536180A (en) 2021-06-28 2021-06-28 Item processing method, item processing device, electronic equipment, storage medium and program product

Publications (1)

Publication Number Publication Date
CN113536180A true CN113536180A (en) 2021-10-22

Family

ID=78126150

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110721889.2A Pending CN113536180A (en) 2021-06-28 2021-06-28 Item processing method, item processing device, electronic equipment, storage medium and program product

Country Status (1)

Country Link
CN (1) CN113536180A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114817804A (en) * 2022-03-31 2022-07-29 北京达佳互联信息技术有限公司 Webpage generation method and device, electronic equipment and storage medium

Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104050418A (en) * 2013-03-13 2014-09-17 阿里巴巴集团控股有限公司 Method and device for realizing safety print of text background of web browser
CN106020901A (en) * 2016-05-30 2016-10-12 青岛海信电器股份有限公司 Application entry configuration method and terminal
CN107545062A (en) * 2017-09-05 2018-01-05 北京小度信息科技有限公司 Entrance recalls method, apparatus, storage medium and electronic equipment
CN107577509A (en) * 2017-08-28 2018-01-12 深圳市金立通信设备有限公司 A kind of method, terminal and computer-readable recording medium for loading application interface
CN107766351A (en) * 2016-08-16 2018-03-06 腾讯科技(深圳)有限公司 The recognition methods of file directory and device
CN109783752A (en) * 2018-12-14 2019-05-21 深圳壹账通智能科技有限公司 Page loading method and device, electronic equipment and computer readable storage medium
CN110647320A (en) * 2019-08-14 2020-01-03 平安普惠企业管理有限公司 Project framework construction method and device, computer equipment and storage medium
CN110659253A (en) * 2019-09-03 2020-01-07 北京达佳互联信息技术有限公司 File packaging method and device, electronic equipment and medium
CN110795666A (en) * 2019-10-18 2020-02-14 腾讯科技(深圳)有限公司 Webpage generation method, device, terminal and storage medium
CN110990731A (en) * 2019-10-12 2020-04-10 平安国际智慧城市科技股份有限公司 Rendering method, device and equipment of static webpage and computer storage medium
CN111309332A (en) * 2020-02-11 2020-06-19 北京达佳互联信息技术有限公司 File content on-demand loading method and device, electronic equipment and storage medium
CN111913761A (en) * 2020-08-18 2020-11-10 网易(杭州)网络有限公司 Plug-in processing method, device, equipment and storage medium for live channel
CN112230812A (en) * 2020-10-16 2021-01-15 北京字节跳动网络技术有限公司 Multimedia data processing method and device, electronic equipment and storage medium

Patent Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104050418A (en) * 2013-03-13 2014-09-17 阿里巴巴集团控股有限公司 Method and device for realizing safety print of text background of web browser
CN106020901A (en) * 2016-05-30 2016-10-12 青岛海信电器股份有限公司 Application entry configuration method and terminal
CN107766351A (en) * 2016-08-16 2018-03-06 腾讯科技(深圳)有限公司 The recognition methods of file directory and device
CN107577509A (en) * 2017-08-28 2018-01-12 深圳市金立通信设备有限公司 A kind of method, terminal and computer-readable recording medium for loading application interface
CN107545062A (en) * 2017-09-05 2018-01-05 北京小度信息科技有限公司 Entrance recalls method, apparatus, storage medium and electronic equipment
CN109783752A (en) * 2018-12-14 2019-05-21 深圳壹账通智能科技有限公司 Page loading method and device, electronic equipment and computer readable storage medium
CN110647320A (en) * 2019-08-14 2020-01-03 平安普惠企业管理有限公司 Project framework construction method and device, computer equipment and storage medium
CN110659253A (en) * 2019-09-03 2020-01-07 北京达佳互联信息技术有限公司 File packaging method and device, electronic equipment and medium
CN110990731A (en) * 2019-10-12 2020-04-10 平安国际智慧城市科技股份有限公司 Rendering method, device and equipment of static webpage and computer storage medium
CN110795666A (en) * 2019-10-18 2020-02-14 腾讯科技(深圳)有限公司 Webpage generation method, device, terminal and storage medium
CN111309332A (en) * 2020-02-11 2020-06-19 北京达佳互联信息技术有限公司 File content on-demand loading method and device, electronic equipment and storage medium
CN111913761A (en) * 2020-08-18 2020-11-10 网易(杭州)网络有限公司 Plug-in processing method, device, equipment and storage medium for live channel
CN112230812A (en) * 2020-10-16 2021-01-15 北京字节跳动网络技术有限公司 Multimedia data processing method and device, electronic equipment and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114817804A (en) * 2022-03-31 2022-07-29 北京达佳互联信息技术有限公司 Webpage generation method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN106569800B (en) Front-end interface generation method and device
CN109032606B (en) Native application compiling method and device and terminal
EP3128411A1 (en) Interface display method and device
CN117390330A (en) Webpage access method and device
CN110704053A (en) Method and device for processing style information
CN104951445B (en) Webpage processing method and device
CN105468606B (en) Webpage saving method and device
CN107402756B (en) Method, device and terminal for drawing page
CN107390974B (en) Code searching method, device, terminal and storage medium for webpage debugging
CN113536180A (en) Item processing method, item processing device, electronic equipment, storage medium and program product
CN107368562B (en) Page display method and device and terminal
CN112860625B (en) Data acquisition method, data storage method, device, equipment and storage medium
CN111131000B (en) Information transmission method, device, server and terminal
CN112182449A (en) Page loading method and device, electronic equipment and storage medium
CN107423060B (en) Animation effect presenting method and device and terminal
CN112631695A (en) Data verification method and device, electronic equipment and storage medium
CN113419773B (en) Log file generation method and device, electronic equipment, storage medium and product
CN110659081B (en) File processing method and device for program object and electronic equipment
CN113934452B (en) Data processing method and device, electronic equipment and storage medium
CN113420531B (en) Code text conversion method, device and storage medium
CN113535181B (en) File processing method and device, electronic equipment, storage medium and product
US9679076B2 (en) Method and device for controlling page rollback
CN107368561B (en) Page drawing method and device and terminal
CN110928621B (en) Information searching method and device, electronic equipment and storage medium
CN111880697B (en) Encyclopedic data processing method and device

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