CN111475156A - Page code generation method and device, electronic equipment and storage medium - Google Patents

Page code generation method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN111475156A
CN111475156A CN202010285885.XA CN202010285885A CN111475156A CN 111475156 A CN111475156 A CN 111475156A CN 202010285885 A CN202010285885 A CN 202010285885A CN 111475156 A CN111475156 A CN 111475156A
Authority
CN
China
Prior art keywords
design drawing
page design
information
page
determining
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.)
Granted
Application number
CN202010285885.XA
Other languages
Chinese (zh)
Other versions
CN111475156B (en
Inventor
魏景云
柳超
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jindi Technology Co Ltd
Original Assignee
Beijing Jindi Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jindi Technology Co Ltd filed Critical Beijing Jindi Technology Co Ltd
Priority to CN202010285885.XA priority Critical patent/CN111475156B/en
Publication of CN111475156A publication Critical patent/CN111475156A/en
Application granted granted Critical
Publication of CN111475156B publication Critical patent/CN111475156B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/34Graphical or visual programming
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The embodiment of the disclosure discloses a page code generation method and device, electronic equipment and a storage medium, wherein the method comprises the following steps: acquiring a page design drawing, and determining information of each element in the page design drawing; determining key words corresponding to each element in the page design drawing based on the type information and the hierarchy information of each element in the page design drawing; and generating a code of the page design drawing based on the feature information and the position information of each element in the page design drawing and the key words corresponding to each element. Therefore, the code for generating the page design drawing can be quickly and accurately determined, the labeled information in the page design drawing is omitted, and the understanding deviation of designers and developers is avoided.

Description

Page code generation method and device, electronic equipment and storage medium
Technical Field
The present disclosure relates to computer technologies, and in particular, to a method and an apparatus for generating a page code, an electronic device, and a storage medium.
Background
In front-end development, page design is particularly important, and usually a designer needs to draw a design drawing first and then writes codes through the design drawing.
In carrying out the present disclosure, the inventors found that: when a developer writes code, a later rework problem often occurs due to discrepancies communicated and understood by the designer.
Disclosure of Invention
The present disclosure is proposed to solve the above technical problems. The embodiment of the disclosure provides a page code generation method and device, an electronic device and a storage medium.
According to an aspect of the embodiments of the present disclosure, there is provided a page code generating method, including:
acquiring a page design drawing, and determining information of each element in the page design drawing; wherein, the information of each element in the page design drawing comprises: type information, hierarchy information, feature information, and location information;
determining key words corresponding to each element in the page design drawing based on the type information and the hierarchy information of each element in the page design drawing;
and generating a code of the page design drawing based on the feature information and the position information of each element in the page design drawing and the key words corresponding to each element.
Optionally, in the above method embodiments of the present disclosure, the keyword corresponding to each element in the page design drawing includes: element type keywords and element hierarchy keywords.
Optionally, in the above method embodiments of the present disclosure, the determining, based on the type information and the hierarchy information of each element in the page design drawing, a keyword corresponding to each element in the page design drawing includes:
determining element type keywords corresponding to each element in the page design drawing based on the type information of each element in the page design drawing;
and determining element level keywords corresponding to each element in the page design drawing based on the level information of each element in the page design drawing.
Optionally, in the above method embodiments of the present disclosure, the element hierarchy keyword includes: folder management keywords and picture adjustment keywords.
Optionally, in the above method embodiments of the present disclosure, the determining, based on the hierarchical information of each element in the page design drawing, an element hierarchical keyword of each element in the page design drawing includes:
determining folder management keywords corresponding to each element in the page design drawing based on the hierarchy of the folder in which each element in the page design drawing is located;
determining a picture adjustment keyword corresponding to each element in the page design drawing based on the picture hierarchical relationship of each element in the page design drawing.
Optionally, in each of the method embodiments of the present disclosure, the determining, based on the type information and the hierarchy information of each element in the page design drawing, a keyword corresponding to each element in the page design drawing, and the generating, based on the feature information and the position information of each element in the page design drawing and the keyword corresponding to each element, a code of the page design drawing further includes: and merging the folders in which the elements in the page design drawing are positioned in the same level based on the folder management key words of the elements in the page design drawing.
Optionally, in the above method embodiments of the present disclosure, the generating a code of the page design drawing based on the feature information and the position information of each element in the page design drawing and the keyword corresponding to each element includes:
determining a class corresponding to each element in the page design drawing and attribute information of the class based on the feature information and the position information of each element in the page design drawing;
and generating a code of the page design drawing based on the class corresponding to each element in the page design drawing, the attribute information of the class and the keyword corresponding to each element in the page design drawing.
According to another aspect of the embodiments of the present disclosure, there is provided a page code generating apparatus including:
the first determining module is used for acquiring a page design drawing and determining information of each element in the page design drawing; wherein, the information of each element in the page design drawing comprises: type information, hierarchy information, feature information, and location information;
the second determining module is used for determining keywords corresponding to each element in the page design drawing based on the type information and the hierarchy information of each element in the page design drawing;
and the generating module is used for generating a code of the page design drawing based on the characteristic information and the position information of each element in the page design drawing and the key words corresponding to each element.
Optionally, in the above apparatus embodiments of the present disclosure, the keyword corresponding to each element in the page design drawing includes: element type keywords and element hierarchy keywords.
Optionally, in each of the apparatus embodiments of the present disclosure, the second determining module includes:
the first determining unit is used for determining element type keywords corresponding to each element in the page design drawing based on the type information of each element in the page design drawing;
and the second determining unit is used for determining element level keywords corresponding to each element in the page design drawing based on the level information of each element in the page design drawing.
Optionally, in each of the above apparatus embodiments of the present disclosure, the element level keyword includes: folder management keywords and picture adjustment keywords.
Optionally, in each of the apparatus embodiments of the present disclosure above, the second determining unit is configured to:
determining folder management keywords corresponding to each element in the page design drawing based on the hierarchy of the folder in which each element in the page design drawing is located;
determining a picture adjustment keyword corresponding to each element in the page design drawing based on the picture hierarchical relationship of each element in the page design drawing.
Optionally, in each of the apparatus embodiments of the present disclosure, between the second determining module and the generating module, further includes: and the merging module is used for merging the folders in which the elements in the page design drawings are positioned in the same level based on the folder management key words of the elements in the page design drawings.
Optionally, in each of the apparatus embodiments of the present disclosure, the generating module includes:
a third determining unit, configured to determine a class corresponding to each element in the page design drawing and attribute information of the class based on the feature information and the position information of each element in the page design drawing;
and the generating unit is used for generating the code of the page design drawing based on the class corresponding to each element in the page design drawing, the attribute information of the class and the key word corresponding to each element in the page design drawing.
According to still another aspect of the embodiments of the present disclosure, there is provided a computer-readable storage medium storing a computer program for executing the page code generating method according to any of the above-mentioned embodiments of the present disclosure.
According to still another aspect of an embodiment of the present disclosure, there is provided an electronic apparatus including: a processor; a memory for storing the processor-executable instructions; the processor is configured to read the executable instruction from the memory and execute the instruction to implement the page code generating method according to any of the above embodiments.
Based on the page code generation method and device, the electronic device and the storage medium provided by the above embodiments of the present disclosure, a page design drawing is obtained, and information of each element in the page design drawing is determined; determining key words corresponding to each element in the page design drawing based on the type information and the hierarchy information of each element in the page design drawing; and generating a code of the page design drawing based on the feature information and the position information of each element in the page design drawing and the key words corresponding to each element. Therefore, the code for generating the page design drawing can be quickly and accurately determined, the labeled information in the page design drawing is omitted, and the understanding deviation of designers and developers is avoided.
The technical solution of the present disclosure is further described in detail by the accompanying drawings and examples.
Drawings
The above and other objects, features and advantages of the present disclosure will become more apparent by describing in more detail embodiments of the present disclosure with reference to the attached drawings. The accompanying drawings are included to provide a further understanding of the embodiments of the disclosure and are incorporated in and constitute a part of this specification, illustrate embodiments of the disclosure and together with the description serve to explain the principles of the disclosure and not to limit the disclosure. In the drawings, like reference numbers generally represent like parts or steps.
Fig. 1 is a flowchart illustrating a page code generation method according to an exemplary embodiment of the disclosure.
FIG. 2 is a page plan view provided by an exemplary embodiment of the present disclosure.
Fig. 3 is a flowchart illustrating a page code generation method according to another exemplary embodiment of the present disclosure.
Fig. 4 is a flowchart illustrating a page code generation method according to yet another exemplary embodiment of the present disclosure.
Fig. 5 is a flowchart illustrating a page code generation method according to still another exemplary embodiment of the present disclosure.
Fig. 6 is a schematic structural diagram of a page code generation apparatus according to an exemplary embodiment of the present disclosure.
Fig. 7 is a block diagram of an electronic device provided in an exemplary embodiment of the present disclosure.
Detailed Description
Hereinafter, example embodiments according to the present disclosure will be described in detail with reference to the accompanying drawings. It is to be understood that the described embodiments are merely a subset of the embodiments of the present disclosure and not all embodiments of the present disclosure, with the understanding that the present disclosure is not limited to the example embodiments described herein.
It should be noted that: the relative arrangement of the components and steps, the numerical expressions, and numerical values set forth in these embodiments do not limit the scope of the present disclosure unless specifically stated otherwise.
It will be understood by those of skill in the art that the terms "first," "second," and the like in the embodiments of the present disclosure are used merely to distinguish one element from another, and are not intended to imply any particular technical meaning, nor is the necessary logical order between them.
It is also understood that in embodiments of the present disclosure, "a plurality" may refer to two or more and "at least one" may refer to one, two or more.
It is also to be understood that any reference to any component, data, or structure in the embodiments of the disclosure, may be generally understood as one or more, unless explicitly defined otherwise or stated otherwise.
In addition, the term "and/or" in the present disclosure is only one kind of association relationship describing an associated object, and means that three kinds of relationships may exist, for example, a and/or B may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" in the present disclosure generally indicates that the former and latter associated objects are in an "or" relationship.
It should also be understood that the description of the various embodiments of the present disclosure emphasizes the differences between the various embodiments, and the same or similar parts may be referred to each other, so that the descriptions thereof are omitted for brevity.
Meanwhile, it should be understood that the sizes of the respective portions shown in the drawings are not drawn in an actual proportional relationship for the convenience of description.
The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the disclosure, its application, or uses.
Techniques, methods, and apparatus known to those of ordinary skill in the relevant art may not be discussed in detail but are intended to be part of the specification where appropriate.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, further discussion thereof is not required in subsequent figures.
The disclosed embodiments may be applied to electronic devices such as terminal devices, computer systems, servers, etc., which are operational with numerous other general purpose or special purpose computing system environments or configurations. Examples of well known terminal devices, computing systems, environments, and/or configurations that may be suitable for use with electronic devices, such as terminal devices, computer systems, servers, and the like, include, but are not limited to: personal computer systems, server computer systems, thin clients, thick clients, hand-held or laptop devices, microprocessor-based systems, set-top boxes, programmable consumer electronics, networked personal computers, minicomputer systems, mainframe computer systems, distributed cloud computing environments that include any of the above, and the like.
Electronic devices such as terminal devices, computer systems, servers, etc. may be described in the general context of computer system-executable instructions, such as program modules, being executed by a computer system. Generally, program modules may include routines, programs, objects, components, logic, data structures, etc. that perform particular tasks or implement particular abstract data types. The computer system/server may be practiced in distributed cloud computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed cloud computing environment, program modules may be located in both local and remote computer system storage media including memory storage devices.
Fig. 1 is a flowchart of a page code generation method according to an exemplary embodiment of the present disclosure. The present embodiment can be applied to an electronic device, and as shown in fig. 1, the page code generation method includes the following steps:
s102, acquiring the page design drawing, and determining the information of each element in the page design drawing.
The information of each element in the page design drawing in the embodiment of the present disclosure may include: type information, hierarchy information, feature information, and location information.
Wherein, each element in the page design drawing can include: text, pictures, and/or buttons. The type information of each element may include: text type, picture type, and/or button type that the user can click. The information of the located level is used for representing the view level of the element. The feature information is used to represent features of the element, such as: the font size, font style, and color of the text, the color of the picture, etc. The location information may include: horizontal coordinate information and vertical coordinate information of the elements, and width information and height information of the elements.
And S104, determining keywords corresponding to each element in the page design drawing based on the type information and the hierarchy information of each element in the page design drawing.
The keywords corresponding to each element in the page design drawing in the embodiment of the present disclosure may include: element type keywords and element hierarchy keywords.
Wherein the element type keyword is used to represent a mark element type, which may include: text keywords, picture keywords, and button keywords. The element hierarchy key is used for representing the hierarchical relationship among the elements of the mark, and can comprise the following steps: folder management keywords and picture adjustment keywords. The folder management key words are used for indicating folders which can be combined in the same hierarchy, and the picture adjustment key words are used for marking the picture hierarchies required to be adjusted.
And S106, generating a code of the page design drawing based on the feature information and the position information of each element in the page design drawing and the key words corresponding to each element.
In one example, a page plan as shown in fig. 2 is obtained by using Sketch software, and the elements in the page plan are determined: the ' new user exclusive share ', ' coupon ', ' when purchasing VIP after receiving the coupon, ' can use ' as character type, ' immediately receive ' as button type, ' immediately receive ' grey base map under button and ' new user exclusive share ' grey base map as picture type, and the position information of each element in the page design map is automatically generated by sketch software. Determining keywords corresponding to each element in the page design drawing based on the type information and the hierarchy information of each element in the page design drawing: text keywords, picture keywords, and button keywords, folder management keywords, and picture adjustment keywords. And generating a code of the page design drawing based on the feature information and the position information of each element in the page design drawing and the key words corresponding to each element.
Based on the page code generation method provided by the embodiment of the disclosure, a page design drawing is obtained, and information of each element in the page design drawing is determined; determining key words corresponding to each element in the page design drawing based on the type information and the hierarchy information of each element in the page design drawing; and generating a code of the page design drawing based on the feature information and the position information of each element in the page design drawing and the key words corresponding to each element. Therefore, the codes for generating the page design drawing can be quickly and accurately determined, the labeled information in the page design drawing is omitted, and the understanding deviation of designers and developers is avoided.
As shown in fig. 3, based on the embodiment shown in fig. 1, in some optional implementations, step S104 may specifically include:
s301, determining element type keywords corresponding to each element in the page design drawing based on the type information of each element in the page design drawing.
S302, determining element level keywords corresponding to each element in the page design drawing based on the level information of each element in the page design drawing.
As shown in fig. 4, based on the embodiment shown in fig. 3, in some optional implementations, step S302 may specifically include:
s401, determining folder management keywords corresponding to each element in the page design drawing based on the hierarchy of the folder in which each element in the page design drawing is located.
S402, determining picture adjustment keywords corresponding to each element in the page design drawing based on the picture hierarchical relation of each element in the page design drawing.
In the example shown in FIG. 2, the element type keywords may include: the character keyword is text, the picture keyword is image, and the button keyword is button; element-level keywords may include: folder management keywords are flood and picture adjustment keywords are super. Because characters such as special share of a new user, a coupon, available after the coupon is picked up and when the VIP is purchased belong to a folder at the same level, the characters are marked as keywords, and the characters are shown at the same level, and the characters can also show that no view level exists; since the grayscale base under the "immediate pick" button and the grayscale base under the "new user-specific text" are displayed under the text, the mark keyword super indicates that the grayscale base is at the next level of the text.
Therefore, the folder management keywords and the picture adjustment keywords are utilized in the embodiment of the disclosure, so that the folder management and the picture hierarchy in the page view can be accurately divided, and the accuracy of page code generation is improved.
In some optional embodiments, between step 104 and step S106, there may be further included: and merging the folders in which the elements in the page design drawings positioned at the same level are positioned based on the folder management key words of the elements in the page design drawings. For example: and merging the folders 'flow _ tag' and 'flow _ pattern' in which the characters of 'new user exclusive share' and 'coupon' are positioned. Therefore, the embodiment of the disclosure can avoid writing of many repeated codes, and improve the working efficiency of designers and developers.
As shown in fig. 5, based on the embodiment shown in fig. 1, in some optional implementations, step S106 may specifically include:
s501, determining a class corresponding to each element in the page design drawing and attribute information of the class based on the feature information and the position information of each element in the page design drawing.
The attribute information of the class may include: the attribute of each element in the class and the description information corresponding to the attribute of each element, for example: the attribute of the font size textsize of the text is the character string number, and the description information corresponding to the attribute is 10, that is, the font size is 10.
S502, generating a code of the page design drawing based on the class corresponding to each element in the page design drawing, the attribute information of the class and the keyword corresponding to each element in the page design drawing.
In a specific embodiment, firstly, based on a folder management keyword flow _ cell2 corresponding to a page design drawing, determining that a parent class corresponding to the page design drawing is UITableViewCell, then, based on feature information and position information of each element in the page design drawing, determining a class corresponding to each element in the page design drawing and attribute information of the class, for example, determining that the page design drawing belongs to a class UI L able according to the feature information of a character "coupon", wherein the attribute information of the class is a character string, and description information corresponding to the attribute is the coupon, and finally, based on the class corresponding to each element in the page design drawing, the attribute information of the class and the keyword corresponding to each element in the page design drawing, generating a code of the page design drawing.
Any page code generation method provided by the embodiments of the present disclosure may be executed by any suitable device with data processing capability, including but not limited to: terminal equipment, a server and the like. Alternatively, any page code generation method provided by the embodiments of the present disclosure may be executed by a processor, for example, the processor may execute any page code generation method mentioned in the embodiments of the present disclosure by calling a corresponding instruction stored in a memory. And will not be described in detail below.
Fig. 6 is a schematic structural diagram of a page code generation apparatus according to an exemplary embodiment of the present disclosure. The test device may be disposed in an electronic device such as a terminal device or a server, and executes the page code generation method according to any of the embodiments of the disclosure. As shown in fig. 6, the page code generating apparatus includes:
the first determining module 61 is configured to obtain a page design drawing, and determine information of each element in the page design drawing; wherein, the information of each element in the page design drawing comprises: type information, hierarchy information, feature information, and location information;
a second determining module 62, configured to determine, based on the type information and the hierarchy information of each element in the page design drawing, a keyword corresponding to each element in the page design drawing;
a generating module 63, configured to generate a code of the page design drawing based on the feature information and the position information of each element in the page design drawing and the keyword corresponding to each element.
Based on the page code generation device provided by the above embodiment of the present disclosure, a page design drawing is obtained, and information of each element in the page design drawing is determined; determining key words corresponding to each element in the page design drawing based on the type information and the hierarchy information of each element in the page design drawing; and generating a code of the page design drawing based on the feature information and the position information of each element in the page design drawing and the key words corresponding to each element. Therefore, the code for generating the page design drawing can be quickly and accurately determined, the labeled information in the page design drawing is omitted, and the understanding deviation of designers and developers is avoided.
In some embodiments, the keywords corresponding to the elements in the page design drawing include: element type keywords and element hierarchy keywords.
In some embodiments, the second determining module 62 includes:
the first determining unit is used for determining element type keywords corresponding to each element in the page design drawing based on the type information of each element in the page design drawing;
and the second determining unit is used for determining element level keywords corresponding to each element in the page design drawing based on the level information of each element in the page design drawing.
In some embodiments, the element-level keywords comprise: folder management keywords and picture adjustment keywords.
In some embodiments, the second determining unit is configured to:
determining folder management keywords corresponding to each element in the page design drawing based on the hierarchy of the folder in which each element in the page design drawing is located;
determining a picture adjustment keyword corresponding to each element in the page design drawing based on the picture hierarchical relationship of each element in the page design drawing.
In some embodiments, between the second determining module 62 and the generating module 63, further comprising: and the merging module is used for merging the folders in which the elements in the page design drawings are positioned in the same level based on the folder management key words of the elements in the page design drawings.
In some embodiments, the generating module 63 includes:
a third determining unit, configured to determine a class corresponding to each element in the page design drawing and attribute information of the class based on the feature information and the position information of each element in the page design drawing;
and the generating unit is used for generating the code of the page design drawing based on the class corresponding to each element in the page design drawing, the attribute information of the class and the key word corresponding to each element in the page design drawing.
In addition, an embodiment of the present disclosure also provides an electronic device, which includes: a processor; a memory for storing the processor-executable instructions;
the processor is configured to read the executable instruction from the memory and execute the instruction to implement the page code generating method according to any of the above embodiments of the present disclosure.
Next, an electronic apparatus according to an embodiment of the present disclosure is described with reference to fig. 7. The electronic device may be either or both of the first device and the second device, or a stand-alone device separate from them, which stand-alone device may communicate with the first device and the second device to receive the acquired input signals therefrom. FIG. 7 illustrates a block diagram of an electronic device in accordance with an embodiment of the disclosure. As shown in fig. 7, the electronic device includes one or more processors 71 and a memory 72.
The processor 71 may be a Central Processing Unit (CPU) or other form of processing unit having data processing capabilities and/or instruction execution capabilities, and may control other components in the electronic device to perform desired functions.
Memory 72 may include one or more computer program products that may include various forms of computer-readable storage media, such as volatile memory and/or non-volatile memory. The volatile memory may include, for example, Random Access Memory (RAM), cache memory (cache), and/or the like. The non-volatile memory may include, for example, Read Only Memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium and executed by the processor 71 to implement the page code generation method of the software program of the various embodiments of the present disclosure described above and/or other desired functions. In one example, the electronic device may further include: an input device 73 and an output device 74, which are interconnected by a bus system and/or other form of connection mechanism (not shown).
The input device 73 may also include, for example, a keyboard, a mouse, and the like.
The output device 74 may output various information to the outside. The output devices 74 may include, for example, a display, speakers, a printer, and a communication network and remote output devices connected thereto, among others.
Of course, for simplicity, only some of the components of the electronic device relevant to the present disclosure are shown in fig. 7, omitting components such as buses, input/output interfaces, and the like. In addition, the electronic device may include any other suitable components, depending on the particular application.
In addition to the above-described methods and apparatus, embodiments of the present disclosure may also be a computer program product comprising computer program instructions which, when executed by a processor, cause the processor to perform the steps in the page code generation methods of the software programs of the various embodiments described above in this specification.
The computer program product may write program code for carrying out operations for embodiments of the present disclosure in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server.
Furthermore, embodiments of the present disclosure may also be a computer-readable storage medium having stored thereon computer program instructions, which, when executed by a processor, cause the processor to perform the steps in the page code generation method of the software program of the various embodiments described above in this specification.
The computer-readable storage medium may take any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may include, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The foregoing describes the general principles of the present disclosure in conjunction with specific embodiments, however, it is noted that the advantages, effects, etc. mentioned in the present disclosure are merely examples and are not limiting, and they should not be considered essential to the various embodiments of the present disclosure. Furthermore, the foregoing disclosure of specific details is for the purpose of illustration and description and is not intended to be limiting, since the disclosure is not intended to be limited to the specific details so described.
In the present specification, the embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same or similar parts in the embodiments are referred to each other. For the system embodiment, since it basically corresponds to the method embodiment, the description is relatively simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The block diagrams of devices, apparatuses, systems referred to in this disclosure are only given as illustrative examples and are not intended to require or imply that the connections, arrangements, configurations, etc. must be made in the manner shown in the block diagrams. These devices, apparatuses, devices, systems may be connected, arranged, configured in any manner, as will be appreciated by those skilled in the art. Words such as "including," "comprising," "having," and the like are open-ended words that mean "including, but not limited to," and are used interchangeably therewith. The words "or" and "as used herein mean, and are used interchangeably with, the word" and/or, "unless the context clearly dictates otherwise. The word "such as" is used herein to mean, and is used interchangeably with, the phrase "such as but not limited to".
The methods and apparatus of the present disclosure may be implemented in a number of ways. For example, the methods and apparatus of the present disclosure may be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above-described order for the steps of the method is for illustration only, and the steps of the method of the present disclosure are not limited to the order specifically described above unless specifically stated otherwise. Further, in some embodiments, the present disclosure may also be embodied as programs recorded in a recording medium, the programs including machine-readable instructions for implementing the methods according to the present disclosure. Thus, the present disclosure also covers a recording medium storing a program for executing the method according to the present disclosure.
It is also noted that in the devices, apparatuses, and methods of the present disclosure, each component or step can be decomposed and/or recombined. These decompositions and/or recombinations are to be considered equivalents of the present disclosure.
The previous description of the disclosed aspects is provided to enable any person skilled in the art to make or use the present disclosure. Various modifications to these aspects will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other aspects without departing from the scope of the disclosure. Thus, the present disclosure is not intended to be limited to the aspects shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
The foregoing description has been presented for purposes of illustration and description. Furthermore, this description is not intended to limit embodiments of the disclosure to the form disclosed herein. While a number of example aspects and embodiments have been discussed above, those of skill in the art will recognize certain variations, modifications, alterations, additions and sub-combinations thereof.

Claims (14)

1. A method for generating a page code, comprising:
acquiring a page design drawing, and determining information of each element in the page design drawing; wherein, the information of each element in the page design drawing comprises: type information, hierarchy information, feature information, and location information;
determining key words corresponding to each element in the page design drawing based on the type information and the hierarchy information of each element in the page design drawing;
and generating a code of the page design drawing based on the feature information and the position information of each element in the page design drawing and the key words corresponding to each element.
2. The method according to claim 1, wherein the keywords corresponding to the elements in the page design drawing comprise: element type keywords and element hierarchy keywords.
3. The method according to claim 1 or 2, wherein the determining the keyword corresponding to each element in the page design drawing based on the type information and the hierarchy information of each element in the page design drawing comprises:
determining element type keywords corresponding to each element in the page design drawing based on the type information of each element in the page design drawing;
and determining element level keywords corresponding to each element in the page design drawing based on the level information of each element in the page design drawing.
4. The method of any of claims 1-3, wherein the element-level keywords comprise: folder management keywords and picture adjustment keywords.
5. The method according to claim 4, wherein the determining element hierarchy keywords for each element in the page design drawing based on the hierarchy information of each element in the page design drawing comprises:
determining folder management keywords corresponding to each element in the page design drawing based on the hierarchy of the folder in which each element in the page design drawing is located;
determining a picture adjustment keyword corresponding to each element in the page design drawing based on the picture hierarchical relationship of each element in the page design drawing.
6. The method according to claim 5, wherein the determining, based on the type information and the hierarchy information of each element in the page design drawing, the keyword corresponding to each element in the page design drawing and the code for generating the page design drawing based on the feature information and the position information of each element in the page design drawing and the keyword corresponding to each element further comprises: and merging the folders in which the elements in the page design drawing are positioned in the same level based on the folder management key words of the elements in the page design drawing.
7. The method according to any one of claims 1 to 6, wherein the generating the code of the page design drawing based on the feature information and the position information of each element in the page design drawing and the keyword corresponding to each element comprises:
determining a class corresponding to each element in the page design drawing and attribute information of the class based on the feature information and the position information of each element in the page design drawing;
and generating a code of the page design drawing based on the class corresponding to each element in the page design drawing, the attribute information of the class and the keyword corresponding to each element in the page design drawing.
8. A page code generating apparatus, comprising: .
The first determining module is used for acquiring a page design drawing and determining information of each element in the page design drawing; wherein, the information of each element in the page design drawing comprises: type information, hierarchy information, feature information, and location information;
the second determining module is used for determining keywords corresponding to each element in the page design drawing based on the type information and the hierarchy information of each element in the page design drawing;
and the generating module is used for generating a code of the page design drawing based on the characteristic information and the position information of each element in the page design drawing and the key words corresponding to each element.
9. The apparatus of claim 8, wherein the second determining module comprises:
the first determining unit is used for determining element type keywords corresponding to each element in the page design drawing based on the type information of each element in the page design drawing;
and the second determining unit is used for determining element level keywords corresponding to each element in the page design drawing based on the level information of each element in the page design drawing.
10. The apparatus of claim 8 or 9, wherein the element level keywords comprise: folder management keywords and picture adjustment keywords;
the second determination unit is configured to:
determining folder management keywords corresponding to each element in the page design drawing based on the hierarchy of the folder in which each element in the page design drawing is located;
determining a picture adjustment keyword corresponding to each element in the page design drawing based on the picture hierarchical relationship of each element in the page design drawing.
11. The apparatus of claim 10, wherein between the second determining module and the generating module, further comprising: and the merging module is used for merging the folders in which the elements in the page design drawings are positioned in the same level based on the folder management key words of the elements in the page design drawings.
12. The apparatus of claim 11, wherein the generating module comprises:
a third determining unit, configured to determine a class corresponding to each element in the page design drawing and attribute information of the class based on the feature information and the position information of each element in the page design drawing;
and the generating unit is used for generating the code of the page design drawing based on the class corresponding to each element in the page design drawing, the attribute information of the class and the key word corresponding to each element in the page design drawing.
13. A computer-readable storage medium, characterized in that the storage medium stores a computer program for executing the page code generating method of any one of claims 1 to 7.
14. An electronic device, characterized in that the electronic device comprises:
a processor;
a memory for storing the processor-executable instructions;
the processor is used for reading the executable instructions from the memory and executing the instructions to realize the page code generation method of any one of the claims 1 to 7.
CN202010285885.XA 2020-04-13 2020-04-13 Page code generation method and device, electronic equipment and storage medium Active CN111475156B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010285885.XA CN111475156B (en) 2020-04-13 2020-04-13 Page code generation method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010285885.XA CN111475156B (en) 2020-04-13 2020-04-13 Page code generation method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111475156A true CN111475156A (en) 2020-07-31
CN111475156B CN111475156B (en) 2024-04-02

Family

ID=71752247

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010285885.XA Active CN111475156B (en) 2020-04-13 2020-04-13 Page code generation method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111475156B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112528117A (en) * 2020-12-11 2021-03-19 杭州安恒信息技术股份有限公司 Recognition method and related device for government affair website primary catalog

Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2001008007A1 (en) * 1999-07-22 2001-02-01 Passage Software, Llc Method and system of automated generation of program code from an object oriented model
US20030025728A1 (en) * 2001-07-10 2003-02-06 Ebbo David S. User control objects for providing server-side code generation from a user-defined dynamic web page content file
US20100313179A1 (en) * 2009-06-05 2010-12-09 Microsoft Corporation Integrated work lists for engineering project change management
US20140282384A1 (en) * 2013-03-13 2014-09-18 Microsoft Corporation Graph-based model for type systems
CN107291476A (en) * 2017-06-27 2017-10-24 北京微影时代科技有限公司 Canvas code generating methods, device, electronic equipment and storage medium
US20180210864A1 (en) * 2017-01-25 2018-07-26 International Business Machines Corporation Web page design snapshot generator
CN108804093A (en) * 2018-06-15 2018-11-13 联想(北京)有限公司 A kind of code generating method and electronic equipment
CN109783094A (en) * 2018-12-15 2019-05-21 深圳壹账通智能科技有限公司 Front end page generation method, device, computer equipment and storage medium
CN109814866A (en) * 2019-01-31 2019-05-28 天津字节跳动科技有限公司 Page application is converted into the treating method and apparatus of native applications
CN110275705A (en) * 2019-06-19 2019-09-24 北京三快在线科技有限公司 Generate method, apparatus, equipment and the storage medium for preloading page code
US20190310835A1 (en) * 2017-03-28 2019-10-10 Tencent Technology (Shenzhen) Company Limited Application development method, tool, and device, and storage medium
CN110321126A (en) * 2019-07-08 2019-10-11 北京三快在线科技有限公司 The method and apparatus for generating page code
CN110333862A (en) * 2019-06-17 2019-10-15 深圳壹账通智能科技有限公司 UI page code generation method, device and server
CN110442333A (en) * 2019-07-11 2019-11-12 北京磨刀刻石科技有限公司 Method and apparatus based on design drawing automatically generating program code

Patent Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2001008007A1 (en) * 1999-07-22 2001-02-01 Passage Software, Llc Method and system of automated generation of program code from an object oriented model
US20030025728A1 (en) * 2001-07-10 2003-02-06 Ebbo David S. User control objects for providing server-side code generation from a user-defined dynamic web page content file
US20100313179A1 (en) * 2009-06-05 2010-12-09 Microsoft Corporation Integrated work lists for engineering project change management
US20140282384A1 (en) * 2013-03-13 2014-09-18 Microsoft Corporation Graph-based model for type systems
US20180210864A1 (en) * 2017-01-25 2018-07-26 International Business Machines Corporation Web page design snapshot generator
US20190310835A1 (en) * 2017-03-28 2019-10-10 Tencent Technology (Shenzhen) Company Limited Application development method, tool, and device, and storage medium
CN107291476A (en) * 2017-06-27 2017-10-24 北京微影时代科技有限公司 Canvas code generating methods, device, electronic equipment and storage medium
CN108804093A (en) * 2018-06-15 2018-11-13 联想(北京)有限公司 A kind of code generating method and electronic equipment
CN109783094A (en) * 2018-12-15 2019-05-21 深圳壹账通智能科技有限公司 Front end page generation method, device, computer equipment and storage medium
CN109814866A (en) * 2019-01-31 2019-05-28 天津字节跳动科技有限公司 Page application is converted into the treating method and apparatus of native applications
CN110333862A (en) * 2019-06-17 2019-10-15 深圳壹账通智能科技有限公司 UI page code generation method, device and server
CN110275705A (en) * 2019-06-19 2019-09-24 北京三快在线科技有限公司 Generate method, apparatus, equipment and the storage medium for preloading page code
CN110321126A (en) * 2019-07-08 2019-10-11 北京三快在线科技有限公司 The method and apparatus for generating page code
CN110442333A (en) * 2019-07-11 2019-11-12 北京磨刀刻石科技有限公司 Method and apparatus based on design drawing automatically generating program code

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
廖坤;谭景信;栾名君;: "面向Web应用整合开发的页面编辑器的设计与实现", 计算机工程与设计, no. 12, 28 June 2010 (2010-06-28) *
赵金东,于沛: "一种轻量级Web应用建模方法", no. 02 *
阳林;及俊川;李新;: "一种可视化代码生成器的研究及应用", no. 02 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112528117A (en) * 2020-12-11 2021-03-19 杭州安恒信息技术股份有限公司 Recognition method and related device for government affair website primary catalog
CN112528117B (en) * 2020-12-11 2023-03-14 杭州安恒信息技术股份有限公司 Recognition method and related device for government affair website primary catalog

Also Published As

Publication number Publication date
CN111475156B (en) 2024-04-02

Similar Documents

Publication Publication Date Title
US10831984B2 (en) Web page design snapshot generator
US10466971B2 (en) Generation of an application from data
US7624349B2 (en) Declarative definition enabling graphical designer reuse
US10223698B2 (en) Integrating a web-based CRM system with a PIM client application
US20140047409A1 (en) Enterprise application development tool
CN110096275B (en) Page processing method and device
JP2006252557A (en) Method and system for managing development object for computer program code
CN109213668B (en) Operation recording method and device and terminal
CN112445693B (en) Page update detection method, device, equipment and storage medium
CN113535165A (en) Interface generation method and device, electronic equipment and computer readable storage medium
US11366704B2 (en) Configurable analytics for microservices performance analysis
US20140068464A1 (en) System And Method For Capturing Computer Application-Related Information
MXPA06013949A (en) Computer aided design interface .
JP6692289B2 (en) Screen information generating device, screen information generating method, and program
CN113986426B (en) Image detection method and device, readable medium and electronic equipment
US20150169508A1 (en) Obfuscating page-description language output to thwart conversion to an editable format
CN114327435A (en) Technical document generation method and device and computer readable storage medium
CN111475156A (en) Page code generation method and device, electronic equipment and storage medium
US20150186758A1 (en) Image processing device
CN114548040A (en) Note processing method, electronic device and storage medium
US8504916B2 (en) Managing presentation and storing of multi-language fonts
JP2009509196A (en) Positioning screen elements
CN111782180A (en) Page generation method and device, electronic equipment and storage medium
JP2014164548A (en) Information processing system
CN102567305B (en) The page of resolving in layout relevant documentation is quoted

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
GR01 Patent grant
GR01 Patent grant