CN113918144A - Method and system for generating reusable page based on image - Google Patents

Method and system for generating reusable page based on image Download PDF

Info

Publication number
CN113918144A
CN113918144A CN202111189021.9A CN202111189021A CN113918144A CN 113918144 A CN113918144 A CN 113918144A CN 202111189021 A CN202111189021 A CN 202111189021A CN 113918144 A CN113918144 A CN 113918144A
Authority
CN
China
Prior art keywords
module
url
file
page
json
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
CN202111189021.9A
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.)
Hunan Yingke Mutual Entertainment Network Information Co ltd
Original Assignee
Hunan Yingke Mutual Entertainment Network Information 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 Hunan Yingke Mutual Entertainment Network Information Co ltd filed Critical Hunan Yingke Mutual Entertainment Network Information Co ltd
Priority to CN202111189021.9A priority Critical patent/CN113918144A/en
Publication of CN113918144A publication Critical patent/CN113918144A/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/36Software reuse
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/955Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • G06F3/04845Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range for image manipulation, e.g. dragging, rotation, expansion or change of colour
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • G06F3/0486Drag-and-drop
    • 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
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Human Computer Interaction (AREA)
  • Data Mining & Analysis (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The invention relates to a method and a system for generating a reusable page based on an image, S1, a design drawing source file is converted into a field specific language file at the end of dsl through a parsing module command line; s2, operating an uploading storage command, converting the field specific language file at the end of the dsl into a JSON file by the storage module, storing the JSON file in the server, and returning a corresponding URL and an ID; s3, using the component editing module to import and acquire the corresponding URL and ID into the corresponding JSON file, carrying out dragging editing operation on the page, and writing back the edited result to the storage module; and S4, splicing the unique ID into the URL provided by the rendering module to form a final URL, wherein the URL is the page address provided for the user to view. According to the method, a programmer can modify the page content to a certain extent by using the visual component editing module operated by mouse dragging, and the page content can be re-online after the modification is completed, so that the labor is greatly saved, and the working efficiency is improved.

Description

Method and system for generating reusable page based on image
Technical Field
The invention relates to the technical field of computer application, in particular to a method and a system for generating a reusable page based on an image.
Background
With the development and popularization of network technology, the internet becomes a main medium for people to acquire and exchange information, information propaganda by using webpage becomes a main trend at present, and more platforms for providing webpage production are provided. The current mainstream page development mode is that designers add materials such as pictures and characters into user interface design software Sketch in a dragging mode, and assemble the materials into a complete design drawing in a mode of arrangement, combination and the like.
A professional programmer manually writes elements such as pictures and characters in a design drawing into a webpage code in a coding mode, and the code is compiled into a static HTML file through a compiling flow. And the HTML file is deployed on a server and is provided for a user to access in a URL mode.
Since the encoding step needs the participation of professional programmers, but the page restoration is easily inconsistent with the design drawing due to the inconsistent levels of programmers and other factors, and meanwhile, in many times, the components and elements designed on the page are actually similar, such as the same buttons, the same banner and the like, and only the size or color of the elements is changed, at this time, if the modification is needed, the professional programmers still need to participate, and a lot of manpower is consumed in the repeated encoding process, so that the situation of manpower shortage is caused.
Disclosure of Invention
The invention aims to provide a method for generating a reusable page based on an image.
The invention relates to a method for generating a reusable page based on an image, which comprises a design drawing analysis module, a data storage module, a component editing module and a page rendering module, wherein,
the sketch analyzing module analyzes the pattern and the position information of the layer contained in the sketch source file by analyzing the sketch source file, searches the inner layer elements of the analyzed layer in a recursive mode, and maps the analyzed source file information into a domain-specific language (DSL for short) by a specific algorithm;
the data storage module stores the domain specific language generated by the analysis module as a JavaScript Object Notation (JSON), stores the JSON in a disk and provides a corresponding URL access address;
the assembly editing module is used for storing preset modular assemblies, acquiring URL addresses provided in the operation process of the storage module, mapping JSON format data into the preset modular assemblies through a mapping relation to form a complete page, adding a draggable control and an attribute editor, monitoring the movement operation of a mouse and the input of a keyboard, feeding back the movement operation and the input of the keyboard to JSON data to complete secondary modification of the page, storing all data structures as templates for multiplexing, writing back the data into the data storage module, and updating corresponding links;
the page rendering module stores preset modular components, acquires a URL address provided in the operation process of the storage module, and maps JSON format data into the preset modular components through a mapping relation to form a complete page;
the method comprises the following steps:
s1, when the developer takes the design drawing source file, the source file is converted into a field specific language file at the end of dsl through a parsing module command line;
s2, operating an uploading storage command, converting the field specific language file at the end of dsl into a JSON file by a storage module, enabling the JSON format to be more convenient for Javascript language analysis, enabling the data structure to be clearer, storing the JSON file in a server, and returning a corresponding URL and an ID;
and S3, importing the corresponding URL and ID by using the component editing module to obtain the corresponding JSON file. The editing module can analyze the information such as the size, the position and the like of the data and place the data at the corresponding position of the editing module. The user can perform operations such as mouse dragging and form editing capable of responding in real time on the page module so as to synchronously show the modified effect and facilitate comparison before and after modification by the user. In this step, the position, size, picture style, internal properties, etc. of the component may be modified. After the modification is finished, the edited result can be regenerated into a JSON file and written back to the storage module;
and S4, splicing the unique ID into the URL provided by the rendering module to form a final URL, wherein the URL is a page address which can be provided for a user to view, and the rendering module relocates the component to a corresponding position according to the information in the JSON file.
Has the advantages that: the method for generating the page reduces the repeated labor in the page development process, reduces the problem of inaccurate page restoration caused by inconsistent personnel levels, can convert the design drawing into the page which can be browsed by a client without compiling and modifying codes through automatic design drawing identification generation, and has more accurate page restoration degree compared with manual compiling, thereby greatly improving the user experience degree and reducing the waste of human resources.
The secondary that provides simultaneously drags the editing function, makes things convenient for the operator to make secondary modification to page picture and file etc. and does not need the designer to revise the design manuscript again for the same style design manuscript can only revise several places of file just can be applied to many places, has reduced the time that the designer revises the design manuscript again, promotes work efficiency.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. In the drawings:
FIG. 1 is a block flow diagram of the present invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
The method for generating the reusable page based on the image is realized by adopting a device which is provided with a design drawing analysis module, a data storage module, a JSON component editing module and a page rendering module, wherein,
the design drawing analysis module analyzes the pattern and the position information of the layer contained in the sketch source file by analyzing the sketch source file, searches and analyzes the inner layer elements of the layer in a recursion mode, wherein the inner layer elements comprise pictures, characters, line frames, colors, sizes, positions and the like, and maps the analyzed source file information into a domain specific language through a specific algorithm;
the data storage module stores the domain specific language generated in the first step as a JavaScript object representation method JSON, stores the JSON in a disk and provides a corresponding URL access address;
the component editing module is used for storing preset modular components, and the components are some basic HTML elements or a set of basic HTML elements and contain certain logic of content related to company business, such as acquisition of texts, pictures and data interfaces, or a set with a certain structure formed by combining a plurality of pictures and texts. The components are preset with a unique type field, such as a Text component (Text), a picture component (Image) and the like, and subsequent rendering is mapped according to the type field. Acquiring a URL access address provided by a data storage module, mapping JSON format data into a preset modular component and forming a complete page through a mapping relation, adding a draggable control and an attribute editor, monitoring the movement operation of a mouse and the input of a keyboard, feeding back the movement operation and the input of the keyboard to JSON data to complete secondary modification of the page, storing all data structures as templates for multiplexing, writing back the data to the data storage module, and updating a corresponding link;
the page rendering module stores preset modular components, acquires the URL address provided in the second step, and maps the data in the JSON format into the preset modular components through a mapping relation to form a complete page;
the method for generating the reusable page based on the image specifically comprises the following steps:
s1, when the developer takes the design drawing source file, the source file is converted into a field specific language file at the end of dsl through a parsing module command line;
s2, operating the uploading storage command, converting the field specific language file at the end of dsl into a JSON file by the storage module, storing the JSON file in the server, and returning a corresponding URL and an ID;
s3, a component editing module is used for importing corresponding URL and ID, dragging and editing and other operations can be carried out on the page module, and edited results can be written back to a storage module;
and S4, splicing the unique ID into the URL provided by the rendering module to form a final URL, wherein the URL is the page address which can be provided for the user to view.
Fig. 1 is a flowchart of an embodiment of a method for generating a reusable page based on an image according to the present invention, and the specific embodiment is: the operator puts forward a certain long-term activity page requirement, after a designer finishes designing a draft, the design draft can be directly imported into the platform, the platform generates a URL address which can be accessed by a user through the steps of analyzing, storing, distributing and the like, and the first step is finished at the moment.
The method of the embodiment comprises the following specific operation steps:
step 1, using an unship command to decompress a sketch file into a folder, and converting a source file into a field specific language file at the end of dsl by analyzing a module command line;
and 2, the storage module converts the field specific language file at the end of the dsl into a JSON file, acquires a JSON format file in a page subfolder in the folder, and the editing module analyzes information such as the size and the position of the data and places the information at a corresponding position of the editing module. The user can perform operations such as mouse dragging and form editing capable of responding in real time on the page module so as to synchronously show the modified effect and facilitate comparison before and after modification by the user. In this step, the position, size, picture style, internal attributes and the like of the component can be modified, after the modification is completed, the edited result can be regenerated into a JSON file and written back to the storage module, and the JSON file can be analyzed according to the following rules:
1) layer extraction
a. Filtering out group, path and points;
b. extracting style information of the layer, and if the style information contains filling color, setting the filling color as background color;
c. recalculating element size and position according to the original design drawing size;
d. extracting characters contained in the picture layer, and splitting the characters into multiple sections for independent processing if the characters contain multiple sections of styles;
e. recording the picture address contained in the layer;
f. adjusting the corresponding zIndex attribute according to the processing sequence and the inclusion relation;
g. if the calculated character width only containing the character in the image layer is larger than the image layer width, setting the image layer width as auto;
2) picture processing
a. Traversing the image address data generated in the last step, sending an http uploading request, and uploading the image to a static file server;
b. replacing the remote picture address returned by the static file server into the DSL generated in the last step by a search replacement mode;
step 3, saving the DSL after the analysis into a JSON format, sending an http uploading request, saving a JSON file into a storage server, and generating a unique identification ID;
step 4, compiling a specific rendering component through the component editing module, enabling the specific rendering component to display a specific style according to specific data and storing the specific style in a rendering server,
the component editing module comprises the following steps:
a. rendering the rendering component into a complete page according to JSON data, and adding a dragging editing control and a property editing control;
b. changing the size and position of the component by monitoring the drag & drop event;
c. editing the form through the attribute, and modifying the content of the component;
d. when the save button is clicked, the data structure is uploaded to the storage server again, the link is updated, and meanwhile, the corresponding template is saved for later reuse;
the rendering module comprises the following steps:
and 5, generating a final URL of the page by splicing the unique identification ID and the rendering server URL, and providing the final URL for a client to view.
Since the activity is a long-term activity, certain modifications to the page content may be required depending on the day's date. If the original method is used, programmers are required to participate in each modification, the process is elongated, and labor stress is easily caused. If the editing module is used, operators can modify the page content to a certain extent, and the page content can be online again after the modification is finished. The manpower is greatly saved.
The above-mentioned embodiments are preferred embodiments of the present invention, but the scope of the present invention is not limited to these embodiments. The invention is not described in detail, and is a conventional application method technology in the field.

Claims (2)

1. A method for generating a reusable page based on an image, the method comprising the steps of:
s1, converting the source file of the design drawing into a field specific language file ending in dsl through a parsing module command line;
s2, operating an uploading storage command, converting the field specific language file at the end of the dsl into a JSON file by the storage module, storing the JSON file in the server, and returning a corresponding URL and an ID;
s3, using the component editing module to import and acquire the corresponding URL and ID into the corresponding JSON file, carrying out dragging editing operation on the page, and writing back the edited result to the storage module;
and S4, splicing the unique ID into the URL provided by the rendering module to form a final URL, wherein the URL is the page address provided for the user to view.
2. The method of claim 1, wherein the method is implemented using a system comprising a parsing module, a storage module, a component editing module, and a rendering module, wherein:
the parsing module parses the layer pattern and the position information contained in the design file by analyzing the sketch source file, searches the inner layer elements of the parsed layer in a recursive mode, and maps the parsed source file information into a domain specific language through a specific algorithm;
the storage module stores the domain specific language generated by S1 as a JavaScript object notation JSON, stores the JSON in a disk and provides a corresponding URL access address;
the assembly editing module is used for storing preset modular assemblies, acquiring URL addresses provided by S2, mapping JSON format data into the preset modular assemblies through a mapping relation to form a complete page, adding a draggable control and an attribute editor, finishing secondary modification of the page through dragging or editing the control, storing all data structures as templates for multiplexing, writing data back into the data storage module, and updating corresponding links;
the rendering module stores the preset modular components, acquires the URL address provided by S2, and maps the data in the JSON format into the preset modular components through the mapping relation to form a complete page.
CN202111189021.9A 2021-10-12 2021-10-12 Method and system for generating reusable page based on image Pending CN113918144A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111189021.9A CN113918144A (en) 2021-10-12 2021-10-12 Method and system for generating reusable page based on image

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111189021.9A CN113918144A (en) 2021-10-12 2021-10-12 Method and system for generating reusable page based on image

Publications (1)

Publication Number Publication Date
CN113918144A true CN113918144A (en) 2022-01-11

Family

ID=79239861

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111189021.9A Pending CN113918144A (en) 2021-10-12 2021-10-12 Method and system for generating reusable page based on image

Country Status (1)

Country Link
CN (1) CN113918144A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114625379A (en) * 2022-05-16 2022-06-14 杭州兑吧网络科技有限公司 H5 project source code generation method and H5 project source code development system
CN116107978A (en) * 2023-04-12 2023-05-12 北京尽微致广信息技术有限公司 File export method and device, storage medium and electronic equipment
CN117093219A (en) * 2023-10-20 2023-11-21 成都华栖云科技有限公司 Visualization method based on data source, electronic equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105447096A (en) * 2015-11-09 2016-03-30 百度在线网络技术(北京)有限公司 Web page generation method and apparatus
CN109801347A (en) * 2019-01-25 2019-05-24 北京字节跳动网络技术有限公司 A kind of generation method, device, equipment and the medium of editable image template
EP3495952A1 (en) * 2017-12-11 2019-06-12 Accenture Global Solutions Limited Prescriptive analytics based committed compute reservation stack for cloud computing resource scheduling
CN110795666A (en) * 2019-10-18 2020-02-14 腾讯科技(深圳)有限公司 Webpage generation method, device, terminal and storage medium
CN111026396A (en) * 2019-12-13 2020-04-17 北京小米移动软件有限公司 Page rendering method and device, electronic equipment and storage medium
CN112181416A (en) * 2020-10-12 2021-01-05 上海赛可出行科技服务有限公司 Method and device for directly generating UI (user interface) codes from visual draft

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105447096A (en) * 2015-11-09 2016-03-30 百度在线网络技术(北京)有限公司 Web page generation method and apparatus
EP3495952A1 (en) * 2017-12-11 2019-06-12 Accenture Global Solutions Limited Prescriptive analytics based committed compute reservation stack for cloud computing resource scheduling
CN109801347A (en) * 2019-01-25 2019-05-24 北京字节跳动网络技术有限公司 A kind of generation method, device, equipment and the medium of editable image template
CN110795666A (en) * 2019-10-18 2020-02-14 腾讯科技(深圳)有限公司 Webpage generation method, device, terminal and storage medium
CN111026396A (en) * 2019-12-13 2020-04-17 北京小米移动软件有限公司 Page rendering method and device, electronic equipment and storage medium
CN112181416A (en) * 2020-10-12 2021-01-05 上海赛可出行科技服务有限公司 Method and device for directly generating UI (user interface) codes from visual draft

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114625379A (en) * 2022-05-16 2022-06-14 杭州兑吧网络科技有限公司 H5 project source code generation method and H5 project source code development system
CN116107978A (en) * 2023-04-12 2023-05-12 北京尽微致广信息技术有限公司 File export method and device, storage medium and electronic equipment
CN117093219A (en) * 2023-10-20 2023-11-21 成都华栖云科技有限公司 Visualization method based on data source, electronic equipment and storage medium
CN117093219B (en) * 2023-10-20 2023-12-26 成都华栖云科技有限公司 Visualization method based on data source, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN112181416B (en) Method and device for directly generating UI code from visual manuscript
CN111506310B (en) Method, device, equipment and storage medium for generating multi-platform style
US11860968B2 (en) System and method for integrating user feedback into website building system services
CN113918144A (en) Method and system for generating reusable page based on image
JP4344693B2 (en) System and method for browser document editing
US8375294B2 (en) Editing web pages
JP2021028828A6 (en) Spreadsheet-based software application development
JP2020504889A (en) Software application development based on spreadsheets
CN108491205A (en) A kind of front end web development methods and system based on component tree
US20080215621A1 (en) Metamodel-based automatic report generation
JP2001243222A (en) Method, system and medium recording program for preparing display rule of structured document as well as method, system and medium recording program for changing structured document and document type definition
CN111309313A (en) Method for quickly generating HTML (hypertext markup language) and storing form data
JP6866551B2 (en) Computer algebra methods, devices, devices and programs
CN109710250A (en) It is a kind of for constructing the visualization engine system and method for user interface
CN111124380A (en) Front-end code generation method
CN113867694A (en) Method and system for intelligently generating front-end code
Shi et al. Reverse-engineering information presentations: Recovering hierarchical grouping from layouts of visual elements
CN116245052A (en) Drawing migration method, device, equipment and storage medium
CN114661286A (en) Large-screen visual code generation method, system and storage medium
CN112685033B (en) Automatic generation method and device for user interface component and computer readable storage medium
Bagley et al. Creating reusable well-structured PDF as a sequence of component object graphic (COG) elements
JP4724387B2 (en) Program conversion program, program conversion apparatus, and program conversion method
CN117032666A (en) Page editing method and device based on editor, terminal equipment and storage medium
JP2002288153A (en) Application-independent data forming method, information processing program, and layout information processing system
CN111949267B (en) UI front end generation method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination