CN116306531A - Automatic HTML document filling method and device, electronic device and storage medium - Google Patents

Automatic HTML document filling method and device, electronic device and storage medium Download PDF

Info

Publication number
CN116306531A
CN116306531A CN202310302311.2A CN202310302311A CN116306531A CN 116306531 A CN116306531 A CN 116306531A CN 202310302311 A CN202310302311 A CN 202310302311A CN 116306531 A CN116306531 A CN 116306531A
Authority
CN
China
Prior art keywords
filled
parameter
filling
html document
attribute
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
CN202310302311.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.)
Shanghai Genyan Network Technology Co ltd
Original Assignee
Shanghai Genyan Network 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 Shanghai Genyan Network Technology Co ltd filed Critical Shanghai Genyan Network Technology Co ltd
Priority to CN202310302311.2A priority Critical patent/CN116306531A/en
Publication of CN116306531A publication Critical patent/CN116306531A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • G06F40/174Form filling; Merging
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Document Processing Apparatus (AREA)

Abstract

The application provides an automatic HTML document filling method, an automatic HTML document filling device, electronic equipment and a storage medium, wherein the automatic HTML document filling method comprises the following steps: acquiring parameters to be filled and parameter name attributes of the parameters to be filled; inquiring a target label containing parameter name attribute in the label of the HTML document to be filled; in the target label, binding the parameter name attribute with a position to be filled; and filling the parameters to be filled in the positions to be filled, which are bound with the parameter name attribute. According to the method, after the parameter name attribute of the parameter to be filled is obtained, the parameter name attribute is adopted to quickly locate the target label containing the parameter name attribute, so that the parameter to be filled is filled to the target label of the position to be filled, where the parameter name attribute is bound in the target label, of the parameter name and the keyword position of the HTML document respectively, the keyword position can be quickly located, and the filling efficiency of the HTML document is greatly improved.

Description

Automatic HTML document filling method and device, electronic device and storage medium
Technical Field
The application relates to the technical field of text processing, in particular to an automatic HTML document filling method, an automatic HTML document filling device, electronic equipment and a storage medium.
Background
Currently, when filling an HTML document, keyword positioning needs to be performed first, that is, it is determined to which position of the HTML document the content to be filled needs to be filled, and then the content to be filled can be filled to the corresponding HTML document keyword position, so that filling of the HTML document is realized.
For example, the time complexity of keyword positioning algorithms in related technologies such as a brute force search BF algorithm, a fingerprint string search RK algorithm, a KMP algorithm and the like is linear time complexity, and the processing time is long when positioning keywords, so that the filling efficiency of an HTML document is low.
Disclosure of Invention
An aim of the embodiment of the application is to provide an automatic filling method and device of an HTML document, electronic equipment and a storage medium, which are used for improving the automatic filling efficiency of the HTML document.
In a first aspect, an embodiment of the present application provides an HTML document automatic filling method, including: acquiring parameters to be filled and parameter name attributes of the parameters to be filled; inquiring a target label containing the parameter name attribute in the label of the HTML document to be filled; binding the parameter name attribute with the to-be-filled position to be filled; and filling the parameter to be filled at the position to be filled, which is bound with the parameter name attribute.
In the implementation process of the scheme, after the parameter name attribute of the parameter to be filled is obtained, the parameter name attribute is adopted to rapidly position the target tag containing the parameter name attribute, so that the parameter to be filled is filled in the position to be filled, where the parameter name attribute is bound in the target tag, and the filling efficiency of the HTML document is greatly improved.
In an implementation manner of the first aspect, after the obtaining the parameter to be filled and the parameter name attribute of the parameter to be filled, the method further includes: acquiring parameter type attributes of the parameters to be filled; the filling the parameter to be filled in the position to be filled bound with the parameter name attribute comprises the following steps: determining a first filling format corresponding to the parameter to be filled according to the parameter type attribute; and filling the parameter to be filled at the position to be filled, which is bound with the parameter name attribute, by adopting a first filling format.
In the implementation process of the scheme, the filling format of the parameters to be filled is determined through the parameter type attribute, so that the automatic HTML document filling method can fill the parameters to be filled in different formats according to the parameter type, the automatic HTML document filling method can be suitable for more application scenes, and the adaptability of the automatic HTML document filling method is improved; in addition, the content in the corresponding format is automatically filled according to the parameter type attribute, so that the filling efficiency of the HTML document is improved.
In an implementation manner of the first aspect, after the obtaining the parameter to be filled and the parameter name attribute of the parameter to be filled, the method further includes: acquiring a parameter filling version attribute of the parameter to be filled and a second filling format corresponding to the parameter filling version attribute; the filling the parameter to be filled in the position to be filled bound with the parameter name attribute comprises the following steps: and filling the parameter to be filled at the position to be filled, which is bound with the parameter name attribute, by adopting the second filling format.
In the implementation process of the scheme, the filling format of parameters to be filled is determined through the parameter filling version attribute, so that the HTML document automatic filling method can fill parameters to be filled of different versions, the HTML document automatic filling method can be suitable for more application scenes, and the adaptability of the HTML document automatic filling method is improved; in addition, the content in the corresponding format is automatically filled according to the parameter filling version attribute, so that the filling efficiency of the HTML document is improved.
In an implementation manner of the first aspect, the obtaining the parameter filling version attribute of the parameter to be filled and the parameter filling format corresponding to the parameter filling version attribute includes: and if the parameter filling version attribute is empty, acquiring a parameter filling format corresponding to the parameter filling version attribute according to a preset default version attribute.
In the implementation process of the scheme, if the parameter filling version attribute value of the parameter to be filled is not obtained, filling the parameter to be filled by adopting a filling format corresponding to a preset default version attribute, so that the automatic HTML document filling method can be suitable for more application scenes, and the adaptability of the automatic HTML document filling method is improved.
In an implementation manner of the first aspect, before the querying, in the tags of the HTML document to be filled, the target tag including the parameter name attribute, the method further includes: analyzing the HTML document to be filled, and obtaining the tag of the HTML document to be filled.
In the implementation process of the scheme, after the HTML document to be filled is analyzed to obtain the label of the HTML document to be filled, the target label can be positioned through the parameter name attribute, and then the parameter to be filled is filled at the position to be filled, which is bound with the parameter name attribute, so that the filling efficiency of the HTML document is greatly improved.
In an implementation manner of the first aspect, the parsing the HTML document to be filled to obtain a tag of the HTML document to be filled includes: analyzing an HTML document to be filled by using Jso to obtain a tag of the HTML document to be filled;
the filling the parameter to be filled in the position to be filled bound with the parameter name attribute comprises the following steps: and filling the parameter to be filled at the position to be filled, which is bound with the parameter name attribute, by adopting Jso.
In the implementation process of the scheme, jso is adopted to analyze the HTML document to be filled, and content filling is carried out on the HTML document according to the parameter names of the parameters to be filled, so that the full text keywords are not required to be queried and positioned, the time complexity of the automatic filling method of the HTML document is reduced to a constant level, and the filling efficiency of the HTML document is greatly improved; in addition, the Jso is adopted to analyze the HTML document to be filled and fill the content, so that the situation of randomly changing the content of the HTML document can be effectively reduced, and the safety of the automatic filling method of the HTML document is improved.
In an implementation manner of the first aspect, before the acquiring the parameter to be filled and the parameter name, the method further includes: and inserting the parameter name attribute of the parameter to be filled in the target label.
In the implementation process of the scheme, the parameter name attribute of the parameter to be filled is inserted into the target label of the HTML document to be filled, so that the corresponding target label can be positioned according to the parameter name attribute, the parameter to be filled is filled to the position to be filled, which is bound with the parameter name attribute, and the filling efficiency of the HTML document is greatly improved; in addition, the content of the target label can be customized, so that the self-defined filling of the HTML document is realized, the automatic filling method of the HTML document can be suitable for more scenes, and the adaptability of the automatic filling method of the HTML document is improved.
In a second aspect, an embodiment of the present application provides an HTML document automatic filling device, including:
the parameter acquisition module is used for acquiring parameters to be filled and parameter name attributes of the parameters to be filled;
the target tag acquisition module is used for inquiring a target tag containing the parameter name attribute in the tag of the HTML document to be filled; the target labels are respectively bound with the parameter names and the keyword positions in the HTML document;
and the parameter filling module is used for filling the parameter to be filled in the position to be filled, which is bound with the parameter name attribute.
In a third aspect, embodiments of the present application provide a computer-readable storage medium having stored thereon computer program instructions which, when read and executed by a processor, perform the method provided by the first aspect or any one of the possible implementations of the first aspect.
In a fourth aspect, embodiments of the present application provide an electronic device, including: the device comprises a processor, a memory and a communication bus, wherein the processor and the memory complete communication with each other through the communication bus; the memory has stored therein computer program instructions executable by the processor which, when read and executed by the processor, perform the method of the first aspect or any one of the possible implementations of the first aspect.
Additional features and advantages of the application will be set forth in the description which follows, and in part will be apparent from the description, or may be learned by practice of the embodiments of the application. The objectives and other advantages of the application will be realized and attained by the structure particularly pointed out in the written description and claims thereof as well as the appended drawings.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the embodiments of the present application will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and should not be considered as limiting the scope, and other related drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic flow chart of an automatic filling method for HTML documents according to an embodiment of the present application;
fig. 2 is a schematic structural diagram of an HTML document automatic filling device according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.
In order to realize automatic filling of an HTML document in the related art, it is first required to determine which position of the HTML document needs to be filled with the content to be filled, and currently, the related art mostly searches for a keyword position in the HTML document in the following manner, so that the content to be filled is filled in the keyword position:
(1) BF (Brute Force) algorithm: the algorithm is an exhaustion algorithm, the main idea is to match the first character of the target string S with the first character of the pattern string T, if the first character of the target string S is equal to the second character of the pattern string T, the second character of the target string S is continuously compared with the second character of the pattern string T, if the second character of the target string S is not equal to the first character of the pattern string T, the second character of the target string S is compared with the first character of the pattern string T, and the first character of the pattern string T is sequentially compared until a final matching result is obtained; the length of the target string S is set as n, the length of the mode string T is set as m, the algorithm divides the target string S into n-m+1 substrings under the worst condition, m times (n-m+1) comparison are needed, and the time complexity is O (m) n);
(2) RK (Robin-Karp, fingerprint character string search) algorithm, which performs some pruning processing on the basis of BF algorithm, respectively calculates hash values of n-m+1 substrings of a target string with the length of n through a hash algorithm, then compares the hash values with hash values of a pattern string one by one, and if the hash value of a substring is equal to the pattern string, completes matching of the substring and the pattern string; if the hash collision is considered, the time complexity of the RK algorithm is O (m) and if the hash collision is not considered, the time complexity of the RK algorithm is O (n);
(3) The KMP (The Knuth-Morris-Pratt Algorithm, knoot-Moris-Pratet Algorithm) Algorithm is characterized in that The information after matching failure is utilized, the matching times of a pattern string and a target string are reduced as much as possible, so that The aim of quick matching is achieved, and The time complexity is O (m+n).
The inventors found that: when the character string length of the HTML document reaches a certain limit, even if the fastest algorithm is adopted, the time complexity is O (n), that is, a long time is required to locate the keyword position, and then the content to be filled is filled into the keyword position, so that the filling efficiency of the HTML document is low.
In order to solve the problem of lower HTML document filling efficiency in the related art, the embodiment of the application provides an HTML document automatic filling method, which includes that a target tag is built in an HTML document to be filled, the target tag is respectively bound with a parameter name of a parameter to be filled and a keyword position in the HTML document, after the parameter name of the parameter to be filled is obtained, the keyword position of the HTML document to be filled is queried through a binding relation among the parameter name, the target tag and the keyword position of the HTML document, and therefore the parameter to be filled is filled in the keyword position to be filled.
The time complexity of the automatic filling method for the HTML document is constant when the keyword position is located, the time length required for locating the keyword is irrelevant to the size of the text, the quick location of the keyword position can be realized, and the filling efficiency of the HTML document is effectively improved.
The application scene of the automatic HTML document filling method comprises the following steps:
(1) Electronic sign scene: the contract content to be filled can be automatically filled into the corresponding position in the contract template through the contract template provided in advance;
(2) On-line examination scene: through the pre-provided test paper template, the answer content can be automatically filled into the corresponding position of the test paper template;
it can be understood that the electronic signature scene and the on-line examination scene are only two application scene examples of the HTML document automatic filling method, and the HTML document automatic filling method is not limited to the two application scenes, and the HTML document automatic filling method can be adopted to realize automatic filling in the scenes where the content needs to be filled into the HTML document.
Referring to fig. 1, an embodiment of the present application relates to an HTML document automatic filling method, which includes:
step S110: acquiring parameters to be filled and parameter name attributes of the parameters to be filled;
step S120: inquiring a target label containing parameter name attribute in the label of the HTML document to be filled; wherein, in the target label, the parameter name attribute is bound with the to-be-filled position to be filled;
step S130: and filling the parameters to be filled in the positions to be filled, which are bound with the parameter name attribute.
In the implementation process of the scheme, after the parameter name attribute of the parameter to be filled is obtained, the target label containing the parameter name attribute can be quickly positioned by adopting the parameter name attribute, so that the parameter to be filled is filled at the position to be filled, which is bound with the parameter name attribute, and the filling efficiency of the HTML document is greatly improved.
It will be appreciated that the parameters to be filled in may be content that can be filled in an HTML document, for example: text, pictures, radio boxes, check boxes, dynamic forms, rich text, and the like.
It can be understood that the parameters to be filled and the parameter name attribute acquired in the step S110 may be the parameters to be filled and the parameter name attribute of the electronic device that performs the HTML document automatic filling method and may be the parameters to be filled and the parameter name attribute that are sent by other electronic devices to the electronic device that performs the HTML document automatic filling method.
The parameter name attribute used in the step S120 is bound to the to-be-filled position, and it is understood that after the parameter name attribute of the to-be-filled parameter is obtained, the target tag containing the parameter name attribute may be located according to the parameter name attribute, and the to-be-filled position of the to-be-filled parameter bound to the parameter name attribute is set in the target tag. Therefore, after the target label is positioned according to the parameter name attribute, the position to be filled of the parameter to be filled, which is bound with the parameter name attribute, can be obtained, so that the parameter to be filled is filled in the position to be filled.
As an optional implementation manner of the HTML document automatic filling method, after obtaining the parameter to be filled and the parameter name, the HTML document automatic filling method further includes: and acquiring the parameter type attribute of the parameter to be filled. At this time, step S130 fills the parameter to be filled in the position to be filled bound to the parameter name attribute, including: determining a first filling format corresponding to the parameter to be filled according to the parameter type attribute; and filling the parameter to be filled at the position to be filled, which is bound with the parameter name attribute, by adopting a first filling format.
It can be appreciated that for contents to be filled in different formats, such as text, picture, radio box, check box, dynamic table, rich text, etc., different processing strategies need to be adopted for filling, so that parameter type attributes of parameters to be filled can also be identified by setting a data-qys-type field, and the parameter type attributes include: text, picture, radio box, check box, dynamic table, rich text, etc., each parameter type corresponds to a filling format, and the filling format of the parameter to be filled can be obtained through the parameter type attribute of the parameter to be filled, namely the first filling format. Step S130 may fill the parameter to be filled in the position to be filled bound to the parameter name attribute in the first filling format.
As an optional implementation manner of the HTML document automatic filling method, after obtaining the parameter to be filled and the parameter name, the HTML document automatic filling method further includes: acquiring a parameter filling version attribute of a parameter to be filled and a second filling format corresponding to the parameter filling version attribute; filling the parameter to be filled at the position to be filled bound with the parameter name attribute comprises the following steps: and filling the parameters to be filled at the positions to be filled, which are bound with the parameter name attribute, by adopting a second filling format.
It can be understood that in application scenarios such as electronic signing, since there may be different versions of the contract, and the same content filled in the versions of the different versions may have different formats, the parameter filling version attribute field data-qys-version may be set for the parameter to be filled, and the corresponding filling format, that is, the second filling format, may be set in advance for the different version attributes, which is shown in table 1, for example:
table 1 text pad format examples corresponding to version number fields
Value of version number field data-qys-version Second filling format corresponding to text content
1.0 Plain text
2.0 Bold text
3.0 Tilting text
It should be noted that, the binding between the parameter type attribute and the first filling format and the binding between the parameter filling version attribute and the second filling format may be user-defined content, that is, the user may user-define what filling format corresponds to each content and the filling format corresponding to each version number.
In addition, it should be noted that the parameter name attribute, the parameter type attribute, the parameter filling version attribute, and the location to be filled are mutually bound, that is, one parameter name attribute corresponds to one parameter type attribute, one parameter filling version attribute, and one location to be filled.
As an optional implementation manner of the automatic filling method of the HTML document, obtaining the parameter filling version attribute of the parameter to be filled and the parameter filling format corresponding to the parameter filling version attribute includes: and if the parameter filling version attribute is null, acquiring a parameter filling format corresponding to the parameter filling version attribute according to a preset default version attribute.
It will be appreciated that the user may not set the parameter filling version attribute of the parameter to be filled, and at this time, a default version attribute may be pre-specified, and taking the version number in table 1 as an example, the default version number may be pre-set to 1.0.
In addition, it can be understood that, for the same parameter to be filled, if the first filling format corresponding to the parameter type attribute of the parameter contradicts the second filling format corresponding to the parameter filling version attribute of the parameter, the first filling format and the second filling format can be solved by setting a priority in advance, for example, the priority of the second filling format can be set higher than that of the first filling format. Of course, when the first filling format and the second filling format contradict, a preset default format may be adopted to fill the parameters to be filled.
As an optional implementation manner of the above-mentioned HTML document automatic filling method, before the query of the tags of the HTML document to be filled for the target tag containing the parameter name attribute in step S110, the above-mentioned HTML document automatic filling method further includes: analyzing the HTML document to be filled, and obtaining the tag of the HTML document to be filled.
It will be appreciated that HTML is a hypertext markup language that links discrete Internet resources into a logical entity through a series of tags. Thus, the tags of the HTML document to be filled can be acquired using the HTML document analysis tool. Then the target label can be queried through the parameter name by the select method.
As an optional implementation manner of the above HTML document automatic filling method, analyzing the HTML document to be filled to obtain a tag of the HTML document to be filled, including: and analyzing the HTML document to be filled by using Jso to obtain the tag of the HTML document to be filled. Filling the parameter to be filled at the position to be filled bound with the parameter name attribute comprises the following steps: and filling the parameter to be filled at the position to be filled, which is bound with the parameter name attribute, by adopting Jso.
It will be appreciated that both step S120 and step S130 described above may invoke the Jsoup tool implementation. The Jso tool is a Java HTML parser, can directly parse URL addresses and HTML text contents, provides a set of very labor-saving APIs, and can fetch and manipulate data through DOM, CSS and operation methods similar to jQuery. Jso can parse the HTML Document into Document objects, and then can query the target tags through the parameter names by a select method.
In addition, compared with the method of analyzing other DOMs, the method of analyzing the HTML document by using Jso is higher in safety, for example, in an electronic signature scene, if the HTML document is analyzed by using JavaScript's DOM analysis, javaScript does not need to pass through a server for operation of a contract template, and the operation randomness is high, so that the situation of randomly changing contract content can occur, and the safety is poor.
As an optional implementation manner of the HTML document automatic filling method, before obtaining the parameter to be filled and the parameter name attribute of the parameter to be filled, the HTML document automatic filling method further includes: and inserting the parameter name attribute of the parameter to be filled in the target label.
In addition, it is understood that the parameter type attribute and the parameter filling version attribute of the parameter to be filled may also be inserted in the target tag.
In addition, it should be noted that the above-mentioned HTML document automatic filling method may be packaged in jar packets, so as to be embedded in any java environment for application. The parameters to be filled, the parameter name data-qys-name, the parameter type data-qys-type and the parameter filling version number data-qys-version can be packaged into a parameter set Parms, an HTML Document to be filled can be parsed into Document objects, a jar package provides a unified entry function filParms (documents), and a user can realize the functions of keyword positioning, parameter filling and the like of the HTML Document to be filled only by calling the entry function and inputting the Document objects and the parameter set Parms of the parameters to be filled.
Referring to fig. 2, based on the same inventive concept, an apparatus 200 for automatically filling an HTML document is further provided in the embodiments of the present application, including:
a parameter obtaining module 210, configured to obtain a parameter to be filled and a parameter name attribute of the parameter to be filled;
the target tag obtaining module 220 is configured to query, in tags of HTML documents to be filled, a target tag corresponding to the parameter name attribute; in the target label, the parameter name attribute is bound with the to-be-filled position to be filled;
and a parameter filling module 230, configured to fill the parameter to be filled in a position to be filled bound to the parameter name attribute.
As an alternative embodiment of the above HTML document automatic filling device, the parameter obtaining module 210 includes:
a parameter type attribute obtaining unit, configured to obtain a parameter type attribute of the parameter to be filled;
at this time, the parameter filling module 230 includes:
a first filling format determining unit, configured to determine a first filling format corresponding to the parameter to be filled according to the parameter type attribute;
and the filling unit is used for filling the parameter to be filled in the position to be filled, which is bound by the parameter name attribute, by adopting a first filling format.
As an alternative embodiment of the above HTML document automatic filling device, the parameter obtaining module 210 includes:
the parameter filling version attribute acquisition unit is used for acquiring the parameter filling version attribute of the parameter to be filled;
at this time, the parameter filling module 230 includes:
the second filling format determining unit is used for determining a second filling format corresponding to the parameter filling version number according to the parameter filling version attribute of the parameter to be filled;
and the filling unit is used for filling the parameter to be filled in the position to be filled, which is bound with the parameter name attribute, by adopting the second filling format.
As an optional embodiment of the above HTML document automatic filling device, the second filling format determining unit is specifically configured to: and if the parameter filling version attribute is empty, acquiring a parameter filling format corresponding to the parameter filling version attribute according to a preset default version attribute.
As an alternative embodiment of the above HTML document automatic filling device, the HTML document automatic filling device 200 further includes:
and the HTML document analysis module is used for analyzing the HTML document to be filled and obtaining the label of the HTML document to be filled.
As an optional implementation manner of the above HTML document automatic filling device, the HTML document parsing module is specifically configured to: and analyzing the HTML document to be filled by using Jso to obtain the tag of the HTML document to be filled.
As an optional implementation manner of the HTML document automatic filling device, the parameter filling module 230 is specifically configured to use Jsoup to fill the parameter to be filled in a position to be filled, where the parameter name attribute is bound to the parameter name attribute.
As an alternative embodiment of the above HTML document automatic filling device, the HTML document automatic filling device 200 further includes:
and the parameter name attribute inserting module is used for inserting the parameter name attribute into the target label of the HTML document to be filled.
As an alternative embodiment of the above HTML document automatic filling device, the HTML document automatic filling device 200 further includes:
and the parameter type attribute inserting module is used for inserting the parameter type attribute into the target label of the HTML document to be filled.
As an alternative embodiment of the above HTML document automatic filling device, the HTML document automatic filling device 200 further includes:
and the parameter filling version attribute inserting module is used for inserting the parameter filling version attribute into the target label of the filling HTML document.
Fig. 3 is a schematic diagram of an electronic device according to an embodiment of the present application. Referring to fig. 3, the electronic device 300 includes: processor 310, memory 320, and communication interface 330, which are interconnected and communicate with each other by a communication bus 340 and/or other forms of connection mechanisms (not shown).
The Memory 320 includes one or more (Only one is shown in the figure), which may be, but is not limited to, a random access Memory (Random Access Memory, RAM), a Read Only Memory (ROM), a programmable Read Only Memory (Programmable Read-Only Memory, PROM), an erasable Read Only Memory (Erasable Programmable Read-Only Memory, EPROM), an electrically erasable Read Only Memory (Electric Erasable Programmable Read-Only Memory, EEPROM), and the like. The processor 310, as well as other possible components, may access, read, and/or write data from, the memory 320.
The processor 310 includes one or more (only one shown) which may be an integrated circuit chip having signal processing capabilities. The processor 310 may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU), a micro control unit (Micro Controller Unit, MCU), a network processor (Network Processor, NP), or other conventional processor; but may also be a special purpose processor including a digital signal processor (Digital Signal Processor, DSP for short), an application specific integrated circuit (Application Specific Integrated Circuits, ASIC for short), a field programmable gate array (Field Programmable Gate Array, FPGA for short), or other programmable logic device, discrete gate or transistor logic device, discrete hardware components.
The communication interface 330 includes one or more (only one shown) that may be used to communicate directly or indirectly with other devices for data interaction. For example, the communication interface 330 may be an ethernet interface; may be a mobile communications network interface, such as an interface of a 3G, 4G, 5G network; or may be other types of interfaces with data transceiving functionality.
One or more computer program instructions may be stored in memory 320 that may be read and executed by processor 310 to implement the HTML document auto-filling method and other desired functions provided by embodiments of the present application.
It is to be understood that the configuration shown in fig. 3 is illustrative only, and that electronic device 300 may also include more or fewer components than shown in fig. 3, or have a different configuration than shown in fig. 3. The components shown in fig. 3 may be implemented in hardware, software, or a combination thereof. For example, the electronic device 300 may be a single server (or other device having computing processing capabilities), a combination of multiple servers, a cluster of a large number of servers, or the like, and may be either a physical device or a virtual device.
The embodiment of the application also provides a computer readable storage medium, and the computer readable storage medium stores computer program instructions, and when the computer program instructions are read and run by a processor of a computer, the method for automatically filling the HTML document provided by the embodiment of the application is executed. For example, the computer-readable storage medium may be implemented as memory 320 in electronic device 300 in FIG. 3.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners. The above-described apparatus embodiments are merely illustrative, for example, the division of the units is merely a logical function division, and there may be other manners of division in actual implementation, and for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some communication interface, device or unit indirect coupling or communication connection, which may be in electrical, mechanical or other form.
Further, the units described as separate units may or may not be physically separate, and units displayed as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
Furthermore, functional modules in various embodiments of the present application may be integrated together to form a single portion, or each module may exist alone, or two or more modules may be integrated to form a single portion.
The foregoing is merely exemplary embodiments of the present application and is not intended to limit the scope of the present application, and various modifications and variations may be suggested to one skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.

Claims (10)

1. An HTML document automatic filling method, comprising:
acquiring parameters to be filled and parameter name attributes of the parameters to be filled;
inquiring a target label containing the parameter name attribute in the label of the HTML document to be filled; in the target label, the parameter name attribute is bound with the to-be-filled position to be filled;
and filling the parameter to be filled at the position to be filled, which is bound with the parameter name attribute.
2. The HTML document automatic filling method according to claim 1, further comprising, after the obtaining the parameter to be filled and the parameter name attribute of the parameter to be filled:
acquiring parameter type attributes of the parameters to be filled;
the filling the parameter to be filled in the position to be filled bound with the parameter name attribute comprises the following steps:
determining a first filling format corresponding to the parameter to be filled according to the parameter type attribute;
and filling the parameter to be filled in the position to be filled, which is bound by the parameter name attribute, by adopting a first filling format.
3. The HTML document automatic filling method according to claim 1, further comprising, after the obtaining the parameter to be filled and the parameter name attribute of the parameter to be filled:
acquiring a parameter filling version attribute of the parameter to be filled and a second filling format corresponding to the parameter filling version attribute;
the filling the parameter to be filled in the position to be filled bound with the parameter name attribute comprises the following steps:
and filling the parameter to be filled at the position to be filled, which is bound with the parameter name attribute, by adopting the second filling format.
4. The HTML document automatic filling method according to claim 3, wherein the obtaining the parameter filling version attribute of the parameter to be filled and the parameter filling format corresponding to the parameter filling version attribute includes:
and if the parameter filling version attribute is empty, acquiring a parameter filling format corresponding to the parameter filling version attribute according to a preset default version attribute.
5. The HTML document automatic filling method according to claim 1, further comprising, before the querying the target tag containing the parameter name attribute in the tags of the HTML document to be filled:
analyzing the HTML document to be filled, and obtaining the tag of the HTML document to be filled.
6. The method for automatically filling an HTML document according to claim 5, wherein the parsing the HTML document to be filled to obtain the tag of the HTML document to be filled comprises:
analyzing an HTML document to be filled by using Jso to obtain a tag of the HTML document to be filled;
the filling the parameter to be filled in the position to be filled bound with the parameter name attribute comprises the following steps:
and filling the parameter to be filled at the position to be filled, which is bound with the parameter name attribute, by adopting Jso.
7. The HTML document automatic filling method according to any one of claims 1 to 6, further comprising, before the obtaining the parameter to be filled and the parameter name attribute of the parameter to be filled:
and inserting the parameter name attribute of the parameter to be filled in the target label.
8. An HTML document automatic filling device, comprising:
the parameter acquisition module is used for acquiring parameters to be filled and parameter name attributes of the parameters to be filled;
the target tag acquisition module is used for inquiring a target tag containing the parameter name attribute in the tag of the HTML document to be filled; the target labels are respectively bound with the parameter names and the keyword positions in the HTML document;
and the parameter filling module is used for filling the parameter to be filled in the position to be filled, which is bound with the parameter name attribute.
9. An electronic device, comprising: the device comprises a processor, a memory and a communication bus, wherein the processor and the memory complete communication with each other through the communication bus; the memory stores program instructions executable by the processor, the processor invoking the program instructions to perform the method of any of claims 1-7.
10. A non-transitory computer readable storage medium storing computer instructions which, when executed by a computer, cause the computer to perform the method of any one of claims 1 to 7.
CN202310302311.2A 2023-03-24 2023-03-24 Automatic HTML document filling method and device, electronic device and storage medium Pending CN116306531A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310302311.2A CN116306531A (en) 2023-03-24 2023-03-24 Automatic HTML document filling method and device, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310302311.2A CN116306531A (en) 2023-03-24 2023-03-24 Automatic HTML document filling method and device, electronic device and storage medium

Publications (1)

Publication Number Publication Date
CN116306531A true CN116306531A (en) 2023-06-23

Family

ID=86790256

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310302311.2A Pending CN116306531A (en) 2023-03-24 2023-03-24 Automatic HTML document filling method and device, electronic device and storage medium

Country Status (1)

Country Link
CN (1) CN116306531A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117272953A (en) * 2023-11-15 2023-12-22 明度智云(浙江)科技有限公司 Automatic document information filling method, system and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117272953A (en) * 2023-11-15 2023-12-22 明度智云(浙江)科技有限公司 Automatic document information filling method, system and storage medium
CN117272953B (en) * 2023-11-15 2024-03-12 明度智云(浙江)科技有限公司 Automatic document information filling method, system and storage medium

Similar Documents

Publication Publication Date Title
US8095622B1 (en) Methods and systems for collecting information transmitted over a network
US8762556B2 (en) Displaying content on a mobile device
CN110333863B (en) Method and device for generating and displaying applet page
CN106126693B (en) Method and device for sending related data of webpage
US20080072136A1 (en) Method and System for Accelerating Downloading of Web Pages
CN104077310B (en) Load the method, apparatus and system of resource file
CN102916991B (en) Method, system and device for transmitting data
US8826122B2 (en) Method, system and device for displaying a web page
CN103078945B (en) To the method and system that browser crash data processes
CN112579118B (en) Method, device, system, medium and equipment for updating configuration information of micro-service
CN110286917A (en) File packing method, device, equipment and storage medium
CN110674427B (en) Method, device, equipment and storage medium for responding to webpage access request
CN111444455A (en) Browser compatible method, system, computer device and storage medium
TW201437826A (en) Method and device for combining webpage style address
CN116306531A (en) Automatic HTML document filling method and device, electronic device and storage medium
CN108491715A (en) Generation method, device and the server in Terminal fingerprints library
CN113127776A (en) Breadcrumb path generation method and device and terminal equipment
CN103139298B (en) Method for transmitting network data and device
CN116304458B (en) Method, device, equipment and medium for web page real-time notification update
CN109150842B (en) Injection vulnerability detection method and device
CN113407193B (en) System deployment method, device and equipment
CN113139145B (en) Page generation method and device, electronic equipment and readable storage medium
CN109344344A (en) Identification method, server and the computer readable storage medium of webpage client
CN110929188A (en) Method and device for rendering server page
CN110309133B (en) Batch 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