CN113760247A - Front-end code generation method and device, electronic equipment and storage medium - Google Patents

Front-end code generation method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113760247A
CN113760247A CN202111110464.4A CN202111110464A CN113760247A CN 113760247 A CN113760247 A CN 113760247A CN 202111110464 A CN202111110464 A CN 202111110464A CN 113760247 A CN113760247 A CN 113760247A
Authority
CN
China
Prior art keywords
code
master
fragment
code fragment
master code
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
CN202111110464.4A
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.)
Bank of China Ltd
Original Assignee
Bank of China 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 Bank of China Ltd filed Critical Bank of China Ltd
Priority to CN202111110464.4A priority Critical patent/CN113760247A/en
Publication of CN113760247A publication Critical patent/CN113760247A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/31Programming languages or programming paradigms
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/33Intelligent editors

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application discloses a front-end code generation method and device, electronic equipment and a storage medium, which can be applied to the field of big data or the field of finance. The method comprises the steps of obtaining a starting fragment of a front-end code to be written currently in a static page, extracting a code label from the starting fragment, searching all master code fragments related to the code label from a code database based on the code label, and determining a target master code fragment with the highest weight value as the front-end code to be written currently. Therefore, the invention stores the commonly used front-end codes in the code database in the form of the master code fragment, and when developers write similar front-end codes again, the corresponding front-end codes can be directly obtained from the code database based on the initial fragment of the front-end codes to be written at present, so that the repeated work of the developers caused by writing the repeated codes is effectively reduced, and the generation efficiency of the front-end codes is improved.

Description

Front-end code generation method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for generating a front-end code, an electronic device, and a storage medium.
Background
The existing normal front-end development process is as follows: and the developer writes a static page according to the business requirement. In practical applications, developers need to write front-end codes for different static pages, and similar front-end codes may exist in most of the static pages written by the developers, so that the developers usually need to perform a large amount of repeated work, resulting in inefficient generation of the front-end codes.
Disclosure of Invention
In view of this, the present invention discloses a method and an apparatus for generating front-end codes, an electronic device, and a storage medium, so as to solve the problem that a developer needs to perform a large amount of repetitive work, which results in low front-end code generation efficiency.
A method of generating front-end code, comprising:
acquiring a starting segment of a front-end code to be currently written in a static page;
extracting a code tag from the starting segment;
based on the code label, finding all related master code fragments with the code label from a code database;
searching a target master code fragment with the highest weight value from all the master code fragments;
and determining the target master code fragment as the front-end code to be written currently.
Optionally, the code database includes: a first master code fragment and a second master code fragment;
the first master code fragment is a code fragment automatically stored in the development programming process;
the second master code fragment is a code fragment stored according to a received code storage instruction in the development programming process;
the first master code fragment and the second master code fragment have different attribute identifiers.
Optionally, when the first master code fragment and the second master code fragment contain the same content, the weight value of the second master code fragment is higher than the weight value of the first master code fragment, and the weight coefficient of the second master code fragment is higher than the weight coefficient of the first master code fragment.
Optionally, the weight value of the first master code fragment is positively correlated with the usage frequency of the first master code fragment.
Optionally, the first master code fragment is: and automatically storing the same code segments with the frequency exceeding the preset frequency, wherein the same code segments are all code segments with the similarity exceeding the similarity threshold.
An apparatus for generating front-end code, comprising:
the obtaining unit is used for obtaining a starting segment of a front-end code to be currently written in the static page;
an extraction unit, configured to extract a code tag from the starting segment;
the first searching unit is used for searching all master code fragments related to the code label from a code database based on the code label;
the second searching unit is used for searching a target master code fragment with the highest weight value from all the master code fragments;
and the determining unit is used for determining the target master code fragment as the front-end code to be written currently.
Optionally, the code database includes: a first master code fragment and a second master code fragment;
the first master code fragment is a code fragment automatically stored in the development programming process;
the second master code fragment is a code fragment stored according to a received code storage instruction in the development programming process;
the first master code fragment and the second master code fragment have different attribute identifiers.
Optionally, when the first master code fragment and the second master code fragment contain the same content, the weight value of the second master code fragment is higher than the weight value of the first master code fragment, and the weight coefficient of the second master code fragment is higher than the weight coefficient of the first master code fragment.
Optionally, the weight value of the first master code fragment is positively correlated with the usage frequency of the first master code fragment.
Optionally, the first master code fragment is: and automatically storing the same code segments with the frequency exceeding the preset frequency, wherein the same code segments are all code segments with the similarity exceeding the similarity threshold.
An electronic device comprising a memory and a processor;
the memory is to store at least one instruction;
the processor is configured to execute the at least one instruction to implement the generation method as described above.
A computer-readable storage medium storing at least one instruction which, when executed by a processor, implements a generation method as described above.
The technical scheme includes that the invention discloses a front-end code generation method, a front-end code generation device, an electronic device and a storage medium, wherein a starting segment of a front-end code to be currently written in a static page is obtained, a code label is extracted from the starting segment, all master code segments related to the code label are searched from a code database based on the code label, and a target master code segment with the highest weight value is determined as the front-end code to be currently written. Therefore, the invention stores the commonly used front-end codes in the code database in the form of the master code fragment, and when developers write similar front-end codes again, the corresponding front-end codes can be directly obtained from the code database based on the initial fragment of the front-end codes to be written at present, so that the repeated work of the developers caused by writing the repeated codes is effectively reduced, and the generation efficiency of the front-end codes is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the disclosed drawings without creative efforts.
FIG. 1 is a flowchart of a method for generating a front-end code according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a front-end code generating apparatus according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
It should be noted that the front-end code generation method, apparatus, electronic device and storage medium provided by the present invention may be applied to the field of big data or the field of finance. The foregoing is merely an example, and does not limit the application fields of the method, the apparatus, the electronic device, and the storage medium for generating the front-end code provided in the present invention.
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The embodiment of the invention discloses a front-end code generation method, a front-end code generation device, electronic equipment and a storage medium, wherein a starting fragment of a front-end code to be currently written in a static page is obtained, a code label is extracted from the starting fragment, all master code fragments related to the code label are searched from a code database based on the code label, and a target master code fragment with the highest weight value is determined as the front-end code to be currently written. Therefore, the invention stores the commonly used front-end codes in the code database in the form of the master code fragment, and when developers write similar front-end codes again, the corresponding front-end codes can be directly obtained from the code database based on the initial fragment of the front-end codes to be written at present, so that the repeated work of the developers caused by writing the repeated codes is effectively reduced, and the generation efficiency of the front-end codes is improved.
Referring to fig. 1, a flowchart of a method for generating a front-end code disclosed in the embodiment of the present invention includes:
s101, acquiring an initial segment of a front-end code to be currently written in a static page;
the static page, namely the static webpage, exists in practice, and is directly loaded to the client browser to be displayed without being compiled by the server. Static pages need to occupy a certain server space and cannot manage pages for updating, and if web page content needs to be updated, files are downloaded through File Transfer Protocol (FTP) software and are modified through web page making software (with the exception of fso and other technologies). Common static pages are exemplified by: html extension,. htm extension.
Step S102, extracting a code tag from the starting segment;
the code label is also identification information of the front-end code to be written currently, and the relevant front-end code can be determined according to the code label.
Step S103, based on the code label, finding all master code fragments related to the code label from a code database;
the code database stores master code fragments corresponding to the code labels, one code label may correspond to a plurality of master code fragments in the code database, and the weight values of different master code fragments are different.
For example, for an HTML (Hyper Text Markup Language) file, DOM elements are stored with tag pair end "</xx >" as a code tag, and JS scripts are stored with method end "}" as a code tag. css is stored with the end "}" as a code label.
DOM is a standard model used for representing objects in a document in a webpage, all DOM objects in the webpage can be operated by JavaScript, and the DOM is a standard programming interface established by the organization of the world Wide Web alliance W3C.
S104, searching a target master code fragment with the highest weight value from all the master code fragments;
the master code fragment with higher weight value indicates that the master code fragment is used more frequently or is matched with the code label more closely.
Step S105, determining the target master code fragment as the front-end code to be written currently.
In summary, the invention discloses a front-end code generation method, which includes acquiring a starting segment of a front-end code to be currently written in a static page, extracting a code label from the starting segment, searching all master code segments related to the code label from a code database based on the code label, and determining a target master code segment with the highest weight value as the front-end code to be currently written. Therefore, the invention stores the commonly used front-end codes in the code database in the form of the master code fragment, and when developers write similar front-end codes again, the corresponding front-end codes can be directly obtained from the code database based on the initial fragment of the front-end codes to be written at present, so that the repeated work of the developers caused by writing the repeated codes is effectively reduced, and the generation efficiency of the front-end codes is improved.
To further optimize the above embodiments, the master code snippets stored in the code database include: a first master code fragment and a second master code fragment;
the first master code fragment is a code fragment automatically stored in the development programming process;
the second master code fragment is a code fragment stored according to a received code storage instruction in the development programming process;
the first master code fragment and the second master code fragment have different attribute identifiers, wherein the attribute identifier of the first master code fragment is used for representing that the first master code fragment is a code fragment automatically stored by a programming tool, and the attribute identifier of the second master code fragment is used for representing that the second master code fragment is a code fragment stored according to a code storage instruction sent by a developer.
That is, in the present invention, the first master code fragment is a code fragment automatically stored by the encoding tool, and after the encoding tool performs DOM and script recognition on the code fragment, the code fragment is cached. In the invention, the code fragment automatically stored by the coding tool is recorded as a first master code fragment.
The second master code fragment is used for issuing a code storage instruction to a common code fragment in the encoding process of a developer so as to store the code fragment. The invention marks the code fragment selected by the developer as a second master code fragment.
It should be noted that, when the first master code fragment and the second master code fragment contain the same content, the weight value of the second master code fragment is higher than the weight value of the first master code fragment, and the weight coefficient of the second master code fragment is higher than the weight coefficient of the first master code fragment.
That is, the weight value of the code segment selected by the developer is higher than the weight value of the code segment automatically saved by the coding tool. In practical application, each master plate name of a second master plate code fragment is defined, and if only the corresponding second master plate code fragment is required to be obtained from the code database based on a code label, the corresponding second master plate code fragment can be obtained according to the master plate name and the code label.
Preferably, the weight value of the first master code fragment is positively correlated with the use frequency of the first master code fragment. The first mother set code fragment is as follows: and automatically storing the same code segments with the frequency exceeding the preset frequency, wherein the same code segments are all code segments with the similarity exceeding the similarity threshold.
The value of the similarity threshold is determined according to actual needs, for example, 90%, and the present invention is not limited herein.
In the invention, the first master code fragment can be weighted according to the use frequency of the code fragment, the code fragment with similarity exceeding a similarity threshold is regarded as the same code fragment, and when the use frequency of the code fragment is higher than N (such as 10), the code fragment is regarded as the first master code fragment and is stored in a code database.
Front-end development generally consists of three parts: page elements, scripts, and styles. The style generally applies a common style. The page and the script are the most output of the developer, and the two parts are optimized and prompted, so that the burden of the developer can be reduced.
(1) The page elements mostly take DOM as a main part, exist in a tag pair mode, take a tag hierarchy sequence as an index, and are stored as a master code fragment. In the invention, the developer uses the page element once every time, and the use times of the corresponding master code fragment are overlapped.
(2) And the script takes the name of the method and the value of the compressed method as an index, and the developer uses the script once every time and superposes the use times of the corresponding master code fragments.
In practical application, the weight value of the second master code fragment may also be positively correlated with the usage frequency of the second master code fragment.
It should be particularly noted that, in the present invention, the weighting coefficients corresponding to the respective use frequencies of the first master code fragment and the second master code fragment are different, and the use frequency weighting coefficient of the second master code fragment is higher than the use frequency weighting coefficient of the first master code fragment, for example, the use frequency weighting coefficient of the second master code fragment is 1.5, and the use frequency weighting coefficient of the first master code fragment is 1.0.
In the invention, the weight value is calculated according to the relative weight of the master code fragment (including the first master code fragment and the second master code fragment) and the use frequency.
And performing 1.5 times of coefficient addition on the second master code fragment, and calculating according to the sequence of the added frequency meter, wherein the second master code fragment has 1.5 times of use frequency.
And adding the first master code fragment by a factor of 1.0 times, and calculating according to the sequence of the added frequency meter, wherein the first master code fragment has the use frequency of 1.0.
When a corresponding master code fragment is selected according to the code label, a plurality of recommended master code fragments can be displayed in a suspension manner in the editor when ctrl + is hovered. The suspension interface supports a retrieval frame, and further retrieval can be carried out according to the name of the master plate or the word frequency.
Corresponding to the embodiment of the method, the invention also discloses a device for generating the front-end code.
Referring to fig. 2, a schematic structural diagram of a front-end code generating apparatus disclosed in the embodiment of the present invention includes:
an obtaining unit 201, configured to obtain a starting segment of a front-end code to be currently written in a static page;
the static page, namely the static webpage, exists in practice, and is directly loaded to the client browser to be displayed without being compiled by the server. Static pages need to occupy a certain server space and cannot manage pages for updating, and if web page content needs to be updated, files are downloaded through File Transfer Protocol (FTP) software and are modified through web page making software (with the exception of fso and other technologies). Common static pages are exemplified by: html extension,. htm extension.
An extracting unit 202, configured to extract a code tag from the starting segment;
the code label is also identification information of the front-end code to be written currently, and the relevant front-end code can be determined according to the code label.
A first search unit 203, configured to search, based on the code tag, all master code segments related to the code tag from a code database;
the code database stores master code fragments corresponding to the code labels, one code label may correspond to a plurality of master code fragments in the code database, and the weight values of different master code fragments are different.
For example, for an HTML (Hyper Text Markup Language) file, DOM elements are stored with tag pair end "</xx >" as a code tag, and JS scripts are stored with method end "}" as a code tag. css is stored with the end "}" as a code label.
DOM is a standard model used for representing objects in a document in a webpage, all DOM objects in the webpage can be operated by JavaScript, and the DOM is a standard programming interface established by the organization of the world Wide Web alliance W3C.
A second searching unit 204, configured to search a target master code fragment with a highest weight value from all the master code fragments;
the master code fragment with higher weight value indicates that the master code fragment is used more frequently or is matched with the code label more closely.
A determining unit 205, configured to determine the target master code fragment as the front-end code to be currently written.
In summary, the invention discloses a front-end code generating device, which is used for obtaining an initial segment of a front-end code to be currently written in a static page, extracting a code label from the initial segment, searching all master code segments related to the code label from a code database based on the code label, and determining a target master code segment with the highest weight value as the front-end code to be currently written. Therefore, the invention stores the commonly used front-end codes in the code database in the form of the master code fragment, and when developers write similar front-end codes again, the corresponding front-end codes can be directly obtained from the code database based on the initial fragment of the front-end codes to be written at present, so that the repeated work of the developers caused by writing the repeated codes is effectively reduced, and the generation efficiency of the front-end codes is improved.
To further optimize the above embodiments, the master code snippets stored in the code database include: a first master code fragment and a second master code fragment;
the first master code fragment is a code fragment automatically stored in the development programming process;
the second master code fragment is a code fragment stored according to a received code storage instruction in the development programming process;
the first master code fragment and the second master code fragment have different attribute identifiers, wherein the attribute identifier of the first master code fragment is used for representing that the first master code fragment is a code fragment automatically stored by a programming tool, and the attribute identifier of the second master code fragment is used for representing that the second master code fragment is a code fragment stored according to a code storage instruction sent by a developer.
That is, in the present invention, the first master code fragment is a code fragment automatically stored by the encoding tool, and after the encoding tool performs DOM and script recognition on the code fragment, the code fragment is cached. In the invention, the code fragment automatically stored by the coding tool is recorded as a first master code fragment.
The second master code fragment is used for issuing a code storage instruction to a common code fragment in the encoding process of a developer so as to store the code fragment. The invention marks the code fragment selected by the developer as a second master code fragment.
It should be noted that, when the first master code fragment and the second master code fragment contain the same content, the weight value of the second master code fragment is higher than the weight value of the first master code fragment, and the weight coefficient of the second master code fragment is higher than the weight coefficient of the first master code fragment.
That is, the weight value of the code segment selected by the developer is higher than the weight value of the code segment automatically saved by the coding tool. In practical application, each master plate name of a second master plate code fragment is defined, and if only the corresponding second master plate code fragment is required to be obtained from the code database based on a code label, the corresponding second master plate code fragment can be obtained according to the master plate name and the code label.
Preferably, the weight value of the first master code fragment is positively correlated with the use frequency of the first master code fragment. The first mother set code fragment is as follows: and automatically storing the same code segments with the frequency exceeding the preset frequency, wherein the same code segments are all code segments with the similarity exceeding the similarity threshold.
The value of the similarity threshold is determined according to actual needs, for example, 90%, and the present invention is not limited herein.
In the invention, the first master code fragment can be weighted according to the use frequency of the code fragment, the code fragment with similarity exceeding a similarity threshold is regarded as the same code fragment, and when the use frequency of the code fragment is higher than N (such as 10), the code fragment is regarded as the first master code fragment and is stored in a code database.
Front-end development generally consists of three parts: page elements, scripts, and styles. The style generally applies a common style. The page and the script are the most output of the developer, and the two parts are optimized and prompted, so that the burden of the developer can be reduced.
(3) The page elements mostly take DOM as a main part, exist in a tag pair mode, take a tag hierarchy sequence as an index, and are stored as a master code fragment. In the invention, the developer uses the page element once every time, and the use times of the corresponding master code fragment are overlapped.
(4) And the script takes the name of the method and the value of the compressed method as an index, and the developer uses the script once every time and superposes the use times of the corresponding master code fragments.
In practical application, the weight value of the second master code fragment may also be positively correlated with the usage frequency of the second master code fragment.
It should be particularly noted that, in the present invention, the weighting coefficients corresponding to the respective use frequencies of the first master code fragment and the second master code fragment are different, and the use frequency weighting coefficient of the second master code fragment is higher than the use frequency weighting coefficient of the first master code fragment, for example, the use frequency weighting coefficient of the second master code fragment is 1.5, and the use frequency weighting coefficient of the first master code fragment is 1.0.
In the invention, the weight value is calculated according to the relative weight of the master code fragment (including the first master code fragment and the second master code fragment) and the use frequency.
And performing 1.5 times of coefficient addition on the second master code fragment, and calculating according to the sequence of the added frequency meter, wherein the second master code fragment has 1.5 times of use frequency.
And adding the first master code fragment by a factor of 1.0 times, and calculating according to the sequence of the added frequency meter, wherein the first master code fragment has the use frequency of 1.0.
When a corresponding master code fragment is selected according to the code label, a plurality of recommended master code fragments can be displayed in a suspension manner in the editor when ctrl + is hovered. The suspension interface supports a retrieval frame, and further retrieval can be carried out according to the name of the master plate or the word frequency.
Corresponding to the above embodiment, referring to fig. 3, the present invention also provides an electronic device, which may include: a processor 1 and a memory 2;
wherein, the processor 1 and the memory 2 complete the communication with each other through the communication bus 3;
a processor 1 for executing a computer program;
a memory 2 for storing a computer program;
the processor 1 may be a central processing unit CPU or an application Specific Integrated circuit asic or one or more Integrated circuits configured to implement embodiments of the present invention.
The memory 2 may comprise a high-speed RAM memory and may also include a non-volatile memory, such as at least one disk memory.
Wherein, the processor executes the computer program to realize the following functions:
acquiring a starting segment of a front-end code to be currently written in a static page;
extracting a code tag from the starting segment;
based on the code label, finding all related master code fragments with the code label from a code database;
searching a target master code fragment with the highest weight value from all the master code fragments;
and determining the target master code fragment as the front-end code to be written currently.
Corresponding to the above embodiment, the present invention also discloses a computer readable storage medium, which stores at least one instruction, and the at least one instruction realizes the generation method of the front-end code when being executed by the processor. .
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The embodiments in the present description are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (12)

1. A method for generating a front-end code, comprising:
acquiring a starting segment of a front-end code to be currently written in a static page;
extracting a code tag from the starting segment;
based on the code label, finding all related master code fragments with the code label from a code database;
searching a target master code fragment with the highest weight value from all the master code fragments;
and determining the target master code fragment as the front-end code to be written currently.
2. The generation method according to claim 1, wherein the code database includes: a first master code fragment and a second master code fragment;
the first master code fragment is a code fragment automatically stored in the development programming process;
the second master code fragment is a code fragment stored according to a received code storage instruction in the development programming process;
the first master code fragment and the second master code fragment have different attribute identifiers.
3. The generation method according to claim 2, wherein when the first master code fragment and the second master code fragment contain the same content, the weight value of the second master code fragment is higher than that of the first master code fragment, and the weight coefficient of the second master code fragment is higher than that of the first master code fragment.
4. The generation method as claimed in claim 3, wherein the weight value of the first master code fragment is positively correlated with the frequency of use of the first master code fragment.
5. The generation method of claim 2, wherein the first master code snippet is: and automatically storing the same code segments with the frequency exceeding the preset frequency, wherein the same code segments are all code segments with the similarity exceeding the similarity threshold.
6. An apparatus for generating a front-end code, comprising:
the obtaining unit is used for obtaining a starting segment of a front-end code to be currently written in the static page;
an extraction unit, configured to extract a code tag from the starting segment;
the first searching unit is used for searching all master code fragments related to the code label from a code database based on the code label;
the second searching unit is used for searching a target master code fragment with the highest weight value from all the master code fragments;
and the determining unit is used for determining the target master code fragment as the front-end code to be written currently.
7. The generation apparatus according to claim 6, wherein the code database includes: a first master code fragment and a second master code fragment;
the first master code fragment is a code fragment automatically stored in the development programming process;
the second master code fragment is a code fragment stored according to a received code storage instruction in the development programming process;
the first master code fragment and the second master code fragment have different attribute identifiers.
8. The generation apparatus as claimed in claim 7, wherein when the first master code fragment and the second master code fragment contain the same content, the weight value of the second master code fragment is higher than the weight value of the first master code fragment, and the weight coefficient of the second master code fragment is higher than the weight coefficient of the first master code fragment.
9. The generation apparatus of claim 8, wherein the weight value of the first master code snippet is positively correlated with a frequency of use of the first master code snippet.
10. The generation apparatus of claim 7, wherein the first master code snippet is: and automatically storing the same code segments with the frequency exceeding the preset frequency, wherein the same code segments are all code segments with the similarity exceeding the similarity threshold.
11. An electronic device, comprising a memory and a processor;
the memory is to store at least one instruction;
the processor is used for executing the at least one instruction to realize the generation method of any one of claims 1-5.
12. A computer-readable storage medium storing at least one instruction which, when executed by a processor, implements a generation method as claimed in any one of claims 1 to 5.
CN202111110464.4A 2021-09-18 2021-09-18 Front-end code generation method and device, electronic equipment and storage medium Pending CN113760247A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111110464.4A CN113760247A (en) 2021-09-18 2021-09-18 Front-end code generation method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111110464.4A CN113760247A (en) 2021-09-18 2021-09-18 Front-end code generation method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113760247A true CN113760247A (en) 2021-12-07

Family

ID=78796812

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111110464.4A Pending CN113760247A (en) 2021-09-18 2021-09-18 Front-end code generation method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113760247A (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106202523A (en) * 2016-07-22 2016-12-07 乐视控股(北京)有限公司 Page authoring method and device
CN109947431A (en) * 2019-03-28 2019-06-28 北京字节跳动网络技术有限公司 A kind of code generating method, device, equipment and storage medium
CN112416338A (en) * 2020-11-26 2021-02-26 上海睿成软件有限公司 Code warehouse system based on label

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106202523A (en) * 2016-07-22 2016-12-07 乐视控股(北京)有限公司 Page authoring method and device
CN109947431A (en) * 2019-03-28 2019-06-28 北京字节跳动网络技术有限公司 A kind of code generating method, device, equipment and storage medium
CN112416338A (en) * 2020-11-26 2021-02-26 上海睿成软件有限公司 Code warehouse system based on label

Similar Documents

Publication Publication Date Title
US9619448B2 (en) Automated document revision markup and change control
US8065667B2 (en) Injecting content into third party documents for document processing
US7818330B2 (en) Block tracking mechanism for web personalization
CN111125598A (en) Intelligent data query method, device, equipment and storage medium
CN109191158B (en) Processing method and processing equipment for user portrait label data
CN103530339A (en) Mobile application information push method and device
CN111737623A (en) Webpage information extraction method and related equipment
US20050187899A1 (en) Structured document processing method, structured document processing system, and program for same
CN112084448B (en) Similar information processing method and device
Cardoso et al. An efficient language-independent method to extract content from news webpages
JP2020098596A (en) Method, device and storage medium for extracting information from web page
CN113868568A (en) Webpage keyword highlighting method, device, equipment and storage medium
CN112232075A (en) Article release time identification method based on time format and webpage element characteristics
CN110390037B (en) Information classification method, device and equipment based on DOM tree and storage medium
CN114818680A (en) Method and device for identifying webpage text and related equipment
CN111221711A (en) User behavior data processing method, server and storage medium
CN113901169A (en) Information processing method, information processing device, electronic equipment and storage medium
CN114021042A (en) Webpage content extraction method and device, computer equipment and storage medium
US20110252313A1 (en) Document information selection method and computer program product
US20110078552A1 (en) Transclusion Process
CN107783983B (en) Information display method and device
CN111949916B (en) Webpage analysis method, device, equipment and storage medium
CN115061688B (en) Page effect display method, computing device and storage medium
CN113760247A (en) Front-end code generation method and device, electronic equipment and storage medium
JP6870454B2 (en) Analytical equipment, analytical programs and analytical methods

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