CN112667225A - Method, system, equipment and readable storage medium for prototype graph code conversion - Google Patents

Method, system, equipment and readable storage medium for prototype graph code conversion Download PDF

Info

Publication number
CN112667225A
CN112667225A CN202011505839.2A CN202011505839A CN112667225A CN 112667225 A CN112667225 A CN 112667225A CN 202011505839 A CN202011505839 A CN 202011505839A CN 112667225 A CN112667225 A CN 112667225A
Authority
CN
China
Prior art keywords
component
prototype graph
prototype
feature library
graph
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.)
Withdrawn
Application number
CN202011505839.2A
Other languages
Chinese (zh)
Inventor
白子玉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Inspur Data Technology Co Ltd
Original Assignee
Beijing Inspur Data 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 Inspur Data Technology Co Ltd filed Critical Beijing Inspur Data Technology Co Ltd
Priority to CN202011505839.2A priority Critical patent/CN112667225A/en
Publication of CN112667225A publication Critical patent/CN112667225A/en
Withdrawn legal-status Critical Current

Links

Images

Landscapes

  • Image Analysis (AREA)

Abstract

The application discloses a method for converting a prototype graph code, which comprises the following steps: identifying the input prototype graph by using the feature library to obtain the component name of each component in the prototype graph; acquiring information in each component, and storing the information and the component name as each node of a tree structure; and converting each component into a corresponding code segment according to the feature library, and combining and outputting each code segment according to the tree structure. According to the method and the device, code conversion can be directly carried out through the prototype diagram in the development process of the cloud platform, codes which can be directly developed are obtained, the working time of developers is greatly saved, and the front-end development efficiency of the cloud platform is improved. The application also provides a system, a device and a readable storage medium for prototype graph code conversion, which have the beneficial effects.

Description

Method, system, equipment and readable storage medium for prototype graph code conversion
Technical Field
The present application relates to the field of prototype graph transcoding, and in particular, to a method, system, device and readable storage medium for prototype graph transcoding.
Background
The prototype drawing is a simple frame before the product is formed, namely, the typesetting layout of a page is displayed, and the interaction of each function key enables the primary concept of the product to have a visual display. The prototype drawing can show the interface style of the product, the function and effect of each button, the basic framework and the operation mechanism of the product, and the like in advance.
In the front-end development process of the cloud platform, developers need to write corresponding codes according to a large number of prototype graphs, however, output contents of the front-end prototype graphs are uniform, most interfaces appear in forms of tables, modal windows, cards, label pages and the like, and therefore the developers need to write a large number of repeated codes in the front-end development process, and the front-end development efficiency of the cloud platform is low.
Therefore, how to improve the front-end development efficiency of the cloud platform is a technical problem that needs to be solved by those skilled in the art at present.
Disclosure of Invention
The application aims to provide a method, a system, equipment and a readable storage medium for prototype graph code conversion, which are used for improving the front-end development efficiency of a cloud platform.
To solve the above technical problem, the present application provides a method for prototype graph transcoding, which includes:
identifying the input prototype graph by using a feature library to obtain the component name of each component in the prototype graph;
acquiring information in each component, and storing the information and the component name as each node of a tree structure;
and converting each component into a corresponding code segment according to the feature library, and combining and outputting each code segment according to the tree structure.
Optionally, before performing feature recognition on the input prototype graph by using the feature library, the method further includes:
receiving at least one group of input component names, component characteristics and code segments;
and establishing the feature library according to the first corresponding relation between the component name and the component feature and the second corresponding relation between the component name and the code segment.
Optionally, the performing feature recognition on the input prototype diagram by using the feature library to obtain the component name of each component in the prototype diagram includes:
sequentially extracting all the component features from the feature library to perform feature matching on the prototype graph;
and determining the component name of the component matched with the component characteristic in the prototype graph according to the first corresponding relation, and deleting the matched component in the prototype graph until no component which can be matched exists in the prototype graph.
Optionally, converting each component into a corresponding code segment according to the feature library, including:
and determining the code segment corresponding to the component name of each component according to the second corresponding relation.
Optionally, the method further includes:
and executing the input modification command to modify the first corresponding relation and/or the second corresponding relation.
Optionally, the feature recognition of the input prototype diagram by using the feature library includes:
carrying out binarization processing on the prototype graph to obtain a black and white line draft;
and performing characteristic identification on the black-white line draft by using the characteristic library.
The present application also provides a system for prototype graph transcoding, the system comprising:
the identification module is used for identifying the input prototype graph by utilizing the feature library to obtain the component name of each component in the prototype graph;
the acquisition module is used for acquiring the information in each component and storing the information and the component name as each node of a tree structure;
and the conversion module is used for converting each component into a corresponding code segment according to the feature library, and combining and outputting each code segment according to the tree structure.
Optionally, the method further includes:
the receiving module is used for receiving at least one group of input component names, component characteristics and code segments;
and the establishing module is used for establishing the feature library according to the first corresponding relation between the component name and the component feature and the second corresponding relation between the component name and the code segment.
The present application also provides a prototype diagram transcoding apparatus, including:
a memory for storing a computer program;
a processor for implementing the steps of the method of prototype graph transcoding as described in any of the above when the computer program is executed.
The present application also provides a readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the method of prototype graph transcoding as described in any of the above.
The method for transcoding the prototype graph comprises the following steps: identifying the input prototype graph by using the feature library to obtain the component name of each component in the prototype graph; acquiring information in each component, and storing the information and the component name as each node of a tree structure; and converting each component into a corresponding code segment according to the feature library, and combining and outputting each code segment according to the tree structure.
According to the technical scheme, the input prototype graph is identified by utilizing the feature library to obtain the component name of each component in the prototype graph, then the component names and the information of the obtained components are stored as each node of a tree structure, finally each component is converted into a corresponding code segment, and each code segment is combined and output according to the tree structure; therefore, code conversion can be directly carried out through the prototype graph in the development process of the cloud platform, codes which can be directly developed can be obtained, the working time of developers is greatly saved, and the front-end development efficiency of the cloud platform is improved. The present application also provides a system, an apparatus and a readable storage medium for prototype graph code conversion, which have the above beneficial effects and are not described herein again.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
FIG. 1 is a flowchart of a method for prototype graph transcoding provided by an embodiment of the present application;
FIG. 2 is a block diagram of a system for prototype graph transcoding provided in an embodiment of the present application;
fig. 3 is a block diagram of a prototype graph transcoding apparatus according to an embodiment of the present application.
Detailed Description
The core of the application is to provide a method, a system, equipment and a readable storage medium for prototype graph code conversion, which are used for improving the front-end development efficiency of a cloud platform.
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all 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 application.
Referring to fig. 1, fig. 1 is a flowchart illustrating a method for prototype graph transcoding according to an embodiment of the present disclosure.
The method specifically comprises the following steps:
s101: identifying the input prototype graph by using the feature library to obtain the component name of each component in the prototype graph;
based on the fact that in the front-end development process of the cloud platform, developers need to write corresponding codes according to a large number of prototype graphs, however, output contents of the front-end prototype graphs are uniform, most interfaces appear in forms of tables, modal windows, cards, label pages and the like, and therefore the developers need to write a large number of repeated codes in the front-end development process, and the front-end development efficiency of the cloud platform is low; therefore, the present application provides a method for prototype graph transcoding to solve the above problems;
in this step, the feature library is used to identify the input prototype diagram, so as to obtain the component name of each component in the prototype diagram, and further determine the code segment corresponding to each component;
optionally, before performing feature recognition on the input prototype diagram by using the feature library, the establishment of the feature library may be further implemented by performing the following steps:
receiving at least one group of input component names, component characteristics and code segments;
and establishing a feature library according to the first corresponding relation between the component name and the component feature and the second corresponding relation between the component name and the code segment.
Optionally, on the basis of the above embodiment, the feature library is used to perform feature recognition on the input prototype diagram to obtain a component name of each component in the prototype diagram, which may specifically be:
sequentially extracting all component characteristics from the characteristic library to perform characteristic matching on the prototype graph;
and determining the component names of the components matched with the component characteristics in the prototype graph according to the first corresponding relation, and deleting the matched components in the prototype graph until no components which can be matched exist in the prototype graph.
Optionally, in a specific embodiment, feature matching may be performed on the prototype graph in an outside-in order, and component features in the feature library are adapted one by one. After the adaptation, the component name and the information such as the characters appearing in the prototype graph are saved as a node of the tree structure. Within the identified regions, the sequence of "outside-in, top-down" continues to be followed and new nodes are saved as leaf nodes or sibling nodes of the tree structure until the contents of all prototype graphs have been matched.
Optionally, on the basis of the above embodiment, when the feature library needs to be updated, an input modification command may be further executed to modify the first corresponding relationship and/or the second corresponding relationship.
Optionally, the feature recognition of the input prototype diagram by using the feature library may specifically be:
carrying out binarization processing on the prototype graph to obtain a black and white line draft;
and performing feature recognition on the black and white line draft by using a feature library.
Optionally, in a specific embodiment, when receiving an input prototype diagram, the prototype diagram may be distinguished by gray, and divided into black and white, that is, binarized; after binarization, a black and white line draft without colors can be obtained, and then the black and white line draft is matched with the features in the feature library, wherein all the components mentioned here contain specific identification features and can be identified.
Alternatively, in a specific embodiment, a developer or a software designer may record a component to be used in a feature library in advance, and then design a prototype drawing by using the component which has been recorded in the feature library.
S102: acquiring information in each component, and storing the information and the component name as each node of a tree structure;
optionally, the information in the component mentioned here may specifically include text information, text position information, icon position information, and the like, which is not specifically limited in this application;
optionally, the information in each component is obtained, and the text information in the component can be specifically recognized through Optical Character Recognition (OCR).
S103: and converting each component into a corresponding code segment according to the feature library, and combining and outputting each code segment according to the tree structure.
Optionally, the converting each component into a corresponding code segment according to the feature library specifically may be:
and determining a code segment corresponding to the component name of each component according to the second corresponding relation.
Based on the technical scheme, the prototype graph code conversion method provided by the application identifies the input prototype graph by using the feature library to obtain the component name of each component in the prototype graph, then stores the component name as each node of a tree structure according to the obtained component information and the component name, finally converts each component into a corresponding code segment, and combines and outputs each code segment according to the tree structure; therefore, code conversion can be directly carried out through the prototype graph in the development process of the cloud platform, codes which can be directly developed can be obtained, the working time of developers is greatly saved, and the front-end development efficiency of the cloud platform is improved.
Referring to fig. 2, fig. 2 is a block diagram of a system for prototype graph transcoding according to an embodiment of the present disclosure.
The system may include:
the identification module 100 is configured to identify the input prototype diagram by using the feature library to obtain a component name of each component in the prototype diagram;
an obtaining module 200, configured to obtain information in each component, and store the information and the component name as each node of a tree structure;
and a conversion module 300, configured to convert each component into a corresponding code segment according to the feature library, and combine and output each code segment according to the tree structure.
On the basis of the above embodiment, in a specific embodiment, the system may further include:
the receiving module is used for receiving at least one group of input component names, component characteristics and code segments;
and the establishing module is used for establishing a characteristic library according to the first corresponding relation between the component name and the component characteristic and the second corresponding relation between the component name and the code segment.
On the basis of the above embodiments, in a specific embodiment, the identification module 100 may include:
the matching submodule is used for sequentially taking out all the component characteristics from the characteristic library to carry out characteristic matching on the prototype graph;
and the first determining submodule is used for determining the component name of the component matched with the component characteristic in the prototype diagram according to the first corresponding relation, and deleting the matched component in the prototype diagram until no component which can be matched exists in the prototype diagram.
On the basis of the above embodiments, in a specific embodiment, the conversion module 300 may include:
and the second determining submodule is used for determining the code segment corresponding to the component name of each component according to the second corresponding relation.
On the basis of the above embodiment, in a specific embodiment, the system may further include:
and the modification module is used for executing the input modification command to modify the first corresponding relation and/or the second corresponding relation.
On the basis of the above embodiments, in a specific embodiment, the conversion module 300 may include:
the processing submodule is used for carrying out binarization processing on the original pattern diagram to obtain a black and white line draft;
and the recognition submodule is used for carrying out feature recognition on the black and white line draft by utilizing the feature library.
Since the embodiment of the system part corresponds to the embodiment of the method part, the embodiment of the system part is described with reference to the embodiment of the method part, and is not repeated here.
Referring to fig. 3, fig. 3 is a structural diagram of a prototype graph transcoding apparatus according to an embodiment of the present application.
The prototype graphics transcoding apparatus 400 may vary significantly due to configuration or performance differences and may include one or more processors (CPUs) 422 (e.g., one or more processors) and memory 432, one or more storage media 430 (e.g., one or more mass storage devices) storing applications 442 or data 444. Wherein the memory 432 and storage medium 430 may be transient or persistent storage. The program stored on the storage medium 430 may include one or more modules (not shown), each of which may include a sequence of instruction operations for the device. Further, the processor 422 may be configured to communicate with the storage medium 430 to execute a series of instruction operations in the storage medium 430 on the prototype image transcoding apparatus 400.
The prototype graph transcoding apparatus 400 may also include one or more power supplies 424, one or more wired or wireless network interfaces 450, one or more input-output interfaces 458, and/or one or more operating systems 441, such as Windows Server, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, and so forth.
The steps in the method of prototype graph transcoding described above in fig. 1 are implemented by the prototype graph transcoding device based on the architecture shown in this fig. 3.
It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the system, the apparatus and the module described above may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus, device and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, a division of modules is merely a division of logical functions, and an actual implementation may have another division, for example, a plurality of modules or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or modules, and may be in an electrical, mechanical or other form.
Modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical modules, may be located in one place, or may be distributed on a plurality of network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, functional modules in the embodiments of the present application may be integrated into one processing module, or each of the modules may exist alone physically, or two or more modules are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode.
The integrated module, if implemented in the form of a software functional module and sold or used as a separate product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a function calling device, or a network device) to execute all or part of the steps of the method of the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
A method, system, device and readable storage medium for prototype graph transcoding provided by the present application are described in detail above. The principles and embodiments of the present application are explained herein using specific examples, which are provided only to help understand the method and the core idea of the present application. It should be noted that, for those skilled in the art, it is possible to make several improvements and modifications to the present application without departing from the principle of the present application, and such improvements and modifications also fall within the scope of the claims of the present application.
It is further noted that, in the present specification, relational terms such as first and second, and the like are 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.

Claims (10)

1. A method of prototype graph transcoding, comprising:
identifying the input prototype graph by using a feature library to obtain the component name of each component in the prototype graph;
acquiring information in each component, and storing the information and the component name as each node of a tree structure;
and converting each component into a corresponding code segment according to the feature library, and combining and outputting each code segment according to the tree structure.
2. The method of claim 1, prior to performing feature recognition on the input prototype graph using the feature library, further comprising:
receiving at least one group of input component names, component characteristics and code segments;
and establishing the feature library according to the first corresponding relation between the component name and the component feature and the second corresponding relation between the component name and the code segment.
3. The method according to claim 2, wherein the performing feature recognition on the input prototype graph by using a feature library to obtain a component name of each component in the prototype graph comprises:
sequentially extracting all the component features from the feature library to perform feature matching on the prototype graph;
and determining the component name of the component matched with the component characteristic in the prototype graph according to the first corresponding relation, and deleting the matched component in the prototype graph until no component which can be matched exists in the prototype graph.
4. The method of claim 2, wherein transforming each of the components into a corresponding code segment according to the feature library comprises:
and determining the code segment corresponding to the component name of each component according to the second corresponding relation.
5. The method of claim 2, further comprising:
and executing the input modification command to modify the first corresponding relation and/or the second corresponding relation.
6. The method of claim 1, wherein the feature recognition of the input prototype graph by using the feature library comprises:
carrying out binarization processing on the prototype graph to obtain a black and white line draft;
and performing characteristic identification on the black-white line draft by using the characteristic library.
7. A system for prototype graph transcoding, comprising:
the identification module is used for identifying the input prototype graph by utilizing the feature library to obtain the component name of each component in the prototype graph;
the acquisition module is used for acquiring the information in each component and storing the information and the component name as each node of a tree structure;
and the conversion module is used for converting each component into a corresponding code segment according to the feature library, and combining and outputting each code segment according to the tree structure.
8. The system of claim 7, further comprising:
the receiving module is used for receiving at least one group of input component names, component characteristics and code segments;
and the establishing module is used for establishing the feature library according to the first corresponding relation between the component name and the component feature and the second corresponding relation between the component name and the code segment.
9. A prototype graph transcoding apparatus, comprising:
a memory for storing a computer program;
a processor for implementing the steps of the method of prototype graph transcoding according to any of claims 1 to 6 when executing said computer program.
10. A readable storage medium, having stored thereon a computer program which, when executed by a processor, carries out the steps of the method of prototype graph transcoding according to any of claims 1 to 6.
CN202011505839.2A 2020-12-18 2020-12-18 Method, system, equipment and readable storage medium for prototype graph code conversion Withdrawn CN112667225A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011505839.2A CN112667225A (en) 2020-12-18 2020-12-18 Method, system, equipment and readable storage medium for prototype graph code conversion

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011505839.2A CN112667225A (en) 2020-12-18 2020-12-18 Method, system, equipment and readable storage medium for prototype graph code conversion

Publications (1)

Publication Number Publication Date
CN112667225A true CN112667225A (en) 2021-04-16

Family

ID=75406703

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011505839.2A Withdrawn CN112667225A (en) 2020-12-18 2020-12-18 Method, system, equipment and readable storage medium for prototype graph code conversion

Country Status (1)

Country Link
CN (1) CN112667225A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115309380A (en) * 2022-10-10 2022-11-08 深圳鲲云信息科技有限公司 Comprehensive constraint code generation method and device
CN116823999A (en) * 2023-06-29 2023-09-29 浪潮智慧科技有限公司 Interaction method, device and medium based on picture identification

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115309380A (en) * 2022-10-10 2022-11-08 深圳鲲云信息科技有限公司 Comprehensive constraint code generation method and device
CN116823999A (en) * 2023-06-29 2023-09-29 浪潮智慧科技有限公司 Interaction method, device and medium based on picture identification
CN116823999B (en) * 2023-06-29 2024-02-02 浪潮智慧科技有限公司 Interaction method, device and medium based on picture identification

Similar Documents

Publication Publication Date Title
CN111615702B (en) Method, device and equipment for extracting structured data from image
CN108108342B (en) Structured text generation method, search method and device
CN110502520B (en) Method, system and equipment for data warehousing and computer readable storage medium
CN112667225A (en) Method, system, equipment and readable storage medium for prototype graph code conversion
CN109710224B (en) Page processing method, device, equipment and storage medium
CN112540862A (en) Interface document data generation method, device, equipment and storage medium
CN111143446A (en) Data structure conversion processing method and device of data object and electronic equipment
CN111046634A (en) Document processing method, document processing device, computer equipment and storage medium
CN116644213A (en) XML file reading method, device, equipment and storage medium
CN114529933A (en) Contract data difference comparison method, device, equipment and medium
CN113642569A (en) Unstructured data document processing method and related equipment
CN111142871B (en) Front-end page development system, method, equipment and medium
CN108694041A (en) Data transfer device, device and service terminal
CN110597765A (en) Large retail call center heterogeneous data source data processing method and device
CN113741864B (en) Automatic semantic service interface design method and system based on natural language processing
CN111291539A (en) File editing control method, file editing control device, computer device and storage medium
CN115982358B (en) Document splitting method, device, terminal equipment and computer readable storage medium
CN112148943A (en) Webpage classification method and device, electronic equipment and readable storage medium
CN113626075A (en) Similar code detection method, device, equipment and computer storage medium
CN111273913A (en) Method and device for outputting application program interface data represented by specifications
EP4068141A1 (en) Method and system to enable print functionality in high-level synthesis (hls) design platforms
CN113010184B (en) Method for realizing conversion from Axure engineering to Qt engineering
CN116127926B (en) Method, device, equipment and medium for generating XSLT file of data body
CN113535594B (en) Method, device, equipment and storage medium for generating service scene test case
CN113297306B (en) Data processing method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WW01 Invention patent application withdrawn after publication

Application publication date: 20210416

WW01 Invention patent application withdrawn after publication