Cross-platform interface development method and system based on Sketch, computer device and medium
Through the cross-platform interface development method based on Sketch, the server is used to extract and inject text information data to generate the target interface layout, which solves the problem of redundant work and long design cycle for UI designers, and achieves code-free development and improved design efficiency. .
Patent Information
- Application Number
- CN202111003082.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-30
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2041-08-30
AI Technical Summary
Existing low-code and no-code development platforms lack a no-code design platform for UI designers, which results in UI designers needing a lot of redundant work, making it difficult to unify design styles and making the design cycle long.
Using a cross-platform interface development method based on Sketch, by obtaining the layer information of the standard template and the target template, sending it to the server to extract the text information data, and injecting it into the standard template, a cross-platform interface with the target interface layout is generated, achieving seamless Code-based development.
It reduces the workload of interface designers, improves the flexibility and work efficiency of interface design, reduces product design and development costs, and realizes code-free UI design.
Smart Images

Figure CN113626023B
Abstract
Description
Technical Field
[0001] The present invention relates to computer technology, and more specifically, to a Sketch-based cross-platform interface development method and system, computer equipment and medium. Background Art
[0002] Low-code is a system that allows developers to quickly build enterprise information systems based on the platform. In this process, users only need to write a small amount of code, and most of the other work is done through visual dragging and clicking. No-code or zero-code is a development method that does not require any code programming at all. It mainly focuses on enterprise data and business management needs, and designs data structures, user interaction forms, sets access permissions, and defines workflow platforms in a visual way.
[0003] At present, low-code platforms on the market are more user-oriented to developers. No-code development platforms generally also require some software development technical capabilities to be used smoothly. However, there is a lack of no-code design platforms for UI (User Interface) designers. UI designers need a lot of redundant workload when designing, and it is difficult to maintain a unified design style. The UI design and development cycle is long. Summary of the invention
[0004] The object of the present invention is to provide a method for solving at least one of the problems existing in the prior art.
[0005] In order to achieve the above object, the present invention adopts the following technical solutions:
[0006] A first aspect of the present invention provides a cross-platform interface development method based on Sketch, which is applied to a client and includes:
[0007] Get a standard template, which has a standard interface layout;
[0008] Acquire a target template, extract layer information of the target template and send the layer information to a server, so that the server extracts text information data according to the layer information, and the target template has a target interface layout corresponding to the interface to be formed;
[0009] receiving text information data and injecting it into the standard template to update the standard template to the target interface layout; and
[0010] The target interface layout is coded to generate a code block file, and the code block file is used to generate a cross-platform interface with the target interface layout.
[0011] In some optional embodiments, acquiring the target template, extracting the layer information of the target template, and sending the layer information to the server further includes:
[0012] Get the target template;
[0013] Extract the target template's layers;
[0014] Parse the elements in the layer into element data;
[0015] Converts element data into encoded data for sending.
[0016] In some optional embodiments, receiving text information data and injecting it into the standard template to update the standard template to the target interface layout further includes:
[0017] Parsing the text information data into a plurality of data arrays representing each graphic according to the interface graphic logic in the target interface layout, wherein the interface graphic logic includes: one or more of the dimension, text position, and text content of each graphic; and
[0018] The data array is injected into the standard template and the interface layout of the target template is updated to the target interface layout according to the interface graphic logic represented by the data array.
[0019] In some optional embodiments, the step of generating a code block file by coding according to the target interface layout further includes:
[0020] Get the standard code block of the pre-stored standard template;
[0021] Modify the position information in the standard code block according to the data array of the target interface layout;
[0022] The position information and the text contents in the multiple data arrays are injected into a standard code block to form a cross-platform based code block file, and the cross-platform based code block file is used to generate a cross-platform interface.
[0023] In some optional embodiments, the encoded data is Base64-based encoded data, and the cross-platform code block file is a Flutter code block file.
[0024] A second aspect of the present invention provides a cross-platform interface development method, which is applied to a server and includes:
[0025] Receiving layer information of a target template, wherein the target template has a target interface layout corresponding to an interface to be formed;
[0026] Extract text information data according to layer information;
[0027] Output text information data to generate a cross-platform interface with a target interface layout.
[0028] In some optional embodiments, extracting text information data according to the layer information further includes:
[0029] Perform text detection on layer information;
[0030] Identifying text data in the layer information based on the text detection result; and
[0031] Extract text information data based on the text data.
[0032] In some optional embodiments, performing text detection on the layer information further includes: decoding the layer information and performing text detection on the layer information based on the decoding result,
[0033] When the text detection result indicates that text data is contained, extracting the text information data according to the layer information further includes:
[0034] Extracting text information from text data based on an information extraction algorithm, the text information including text location and text content; and
[0035] Text information data having a first structure format is generated based on the text information.
[0036] In some optional embodiments, when the text detection result indicates that no text data is included, extracting text information data based on the text data further includes:
[0037] Generate text information data in a second structure format, where the text information data is an extraction failure message.
[0038] A third aspect of the present invention provides an interface development device for implementing the cross-platform interface development method described in the first aspect above, comprising:
[0039] An interaction module is configured to obtain a standard template and a target template, wherein the standard template has a standard interface layout, and the target template has a target interface layout corresponding to the interface to be formed;
[0040] An extraction module configured to extract layer information of a target template;
[0041] a communication module configured to send layer information to a server and receive text information data from the server;
[0042] A logic processing module configured to inject text information data into the standard template to update the target interface layout; and
[0043] The code block generation module is configured to generate a code block file according to the target interface layout, and the code block file is used to generate a cross-platform interface with the target interface layout.
[0044] A fourth aspect of the present invention provides an interface development device for implementing the cross-platform interface development method as described in the second aspect above, comprising:
[0045] A text extraction module configured to extract text information data from the layer information of the received target template, the target template having a target interface layout corresponding to the interface to be formed;
[0046] The communication module is configured to receive layer data and output text information data for generating a cross-platform interface with a target interface format.
[0047] A fifth aspect of the present invention provides a computer device, comprising:
[0048] one or more processors;
[0049] a storage device having one or more programs stored thereon;
[0050] When the one or more programs are executed by the one or more processors, the one or more processors are enabled to implement the method as described in the first aspect above or the method as described in the second aspect above.
[0051] A sixth aspect of the present invention is a computer-readable storage medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the method described in the first aspect or the method described in the second aspect.
[0052] The beneficial effects of the present invention are as follows:
[0053] In view of the existing problems, the present invention develops a cross-platform interface development method and system, computer equipment and medium based on Sketch. The method extracts the layer information of the target template by using the Sketch plug-in and sends it to the server, so that the server extracts the text information data of the target template, injects the received text information data into the standard template to update the interface layout and encodes it to generate a cross-platform interface with the target interface layout. The method realizes a code-free development platform for interface designers, reduces the workload of interface designers, and thus makes up for the problems existing in the prior art, effectively improves the flexibility of interface design, improves the work efficiency of designers, reduces the cost of product design and development, and has broad application prospects. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] The specific implementation modes of the present invention are further described in detail below in conjunction with the accompanying drawings.
[0055] Figure 1 A flowchart of a cross-platform interface development method based on Sketch according to an embodiment of the present invention is shown;
[0056] Figure 2 A structural block diagram of a cross-platform interface development system for implementing a cross-platform interface development method according to an embodiment of the present invention is shown;
[0057] Figure 3 A schematic diagram of a home page of a Sketch plug-in for implementing a cross-platform interface development method according to an embodiment of the present invention is shown;
[0058] Figure 4 A schematic diagram of a design page of a Sketch plug-in for implementing a cross-platform interface development method according to an embodiment of the present invention is shown;
[0059] Figure 5 A schematic diagram of an OCR recognition layer picking window of a Sketch plug-in for implementing a cross-platform interface development method according to an embodiment of the present invention is shown;
[0060] Figure 6 A specific flow chart showing the second step of the cross-platform interface development method based on Sketch according to an embodiment of the present invention;
[0061] Figure 7 A flowchart showing the extraction of text information on the server side of the cross-platform interface development method according to an embodiment of the present invention; and
[0062] Figure 8 A schematic structural diagram of a computer device according to an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0063] In order to explain the present invention more clearly, the present invention is further described below in conjunction with embodiments and drawings. Similar components in the drawings are represented by the same reference numerals. It should be understood by those skilled in the art that the content specifically described below is illustrative rather than restrictive, and the protection scope of the present invention should not be limited thereto.
[0064] After research, the inventor found that for interface development, current design products often provide standard templates with standard layouts. In order to meet product design needs, UI designers need to make modifications based on the standard templates each time they design. For example, they need to change the proportion of each graphic in the chart and the arrangement order of each graphic to more realistically reflect the actual data changes. These modifications require designers to manually copy, delete, paste, etc. to adjust. The process of generating the final interface product layout from the standard template requires designers to do a lot of tedious and redundant repetitive work.
[0065] In addition, even if it is the same set of statistical data, if the display size of each cross-platform device to which the interface product to be developed needs to be applied is different from the display size of each cross-platform device to which the previously designed interface product is applied, the user may need to adjust the number of elements of the interface product to be developed to adapt to the new size requirements. Take a bar chart as an example. Assume that a bar chart is needed in the interface to show the trend of the number of elderly people in a city over 35 years. In the interface product designed by the user for a small-sized cross-platform terminal (for example, a mobile phone with a 4-inch display screen of Android, IOS and Windows systems), due to size limitations and for display effects, the bar chart can only show 5 bars, that is, one bar for every 7 years of data to display 35 years of statistical data. If the interface product will be applied to a large-sized cross-platform terminal, such as a mobile phone with a 5.5-inch display screen of Android, IOS and Windows systems, the product needs to increase the number of bars in the bar chart to 7, that is, one bar for every 5 years of data to display 35 years of statistical data.
[0066] In current UI design tools, designers need to manually draw and paste new bars in the design interface to generate new designs. Manual design is repetitive and tedious, which brings redundant workload to designers. Often, similar modifications exist in a large number of interfaces in the interface product design of a project. The large amount of redundant workload of manual modification undoubtedly reduces the convenience of UI design, increases product design time, and reduces product efficiency.
[0067] For at least one of the above questions, such as Figure 1 As shown, an embodiment of the present invention provides a cross-platform interface development method based on Sketch, which is applied to a first client and includes:
[0068] Get a standard template, which has a standard interface layout;
[0069] Acquire a target template, extract layer information of the target template and send the layer information to a server, so that the server extracts text information data according to the layer information, and the target template has a target interface layout corresponding to the interface to be formed;
[0070] receiving text information data and injecting it into the standard template to update the standard template to the target interface layout; and
[0071] The target interface layout is coded to generate a code block file, and the code block file is used to generate a cross-platform interface with the target interface layout.
[0072] In this embodiment, the layer information of the target template is extracted by using the Sketch plug-in and sent to the server, so that the server extracts the text information data of the target template, injects the received text information data into the standard template to update the interface layout and encodes it to generate a cross-platform interface with the target interface layout, thereby realizing a codeless development platform for interface designers, reducing the workload of interface designers, thereby compensating for the problems existing in the prior art, effectively improving the flexibility of interface design, improving the work efficiency of designers, and reducing product design and development costs, and has broad application prospects.
[0073] In a specific example, Figure 2 The cross-platform interface development system is shown, including a client 100 and a server 200. The client 100 and the server 200 can communicate with each other by wire or wirelessly. Among them, the client 100 can be an electronic device that can run a UI design and development tool, such as a computer, a portable computer, a tablet computer, a smart phone, etc. In this example, the UI design and development tool is a Sketch tool, which is a vector drawing application suitable for all designers. It is a one-stop application tool with an excellent UI. In the embodiment of the invention, a Sketch plug-in is loaded on it. The server 200 can be a cloud server or a local server, which is equipped with an application tool based on optical character recognition (OCR) to implement the text recognition function of the embodiment of the present invention, which can be software or firmware.
[0074] Combine the following Figures 3 to 7 The cross-platform interface development method of the embodiment of the present invention is described in detail with the detailed workflow of the cross-platform interface development system.
[0075] First, the client 100 obtains a standard template, which has a standard interface layout.
[0076] Specifically, Figure 3 As shown, a user (for example, a UI design developer) starts the Sketch tool installed on the client 100, automatically starts the Sketch plug-in therein, and displays the Sketch plug-in on the client 100. Figure 3 The user interaction interface home page is shown. In the user interaction interface, there is a selection menu list shown on the left and a corresponding content selection area on the right. The selection menu list lists various interface template libraries. When the user selects a corresponding library in the selection menu list, the corresponding template thumbnails in the library are listed in the content selection area.
[0077] Specifically, the selection menu list includes a standard template library and a custom library, and the standard template library stores standard templates with standard interface layouts. The standard template library includes but is not limited to a standard chart library, a standard component library, a standard element library, and a standard icon library. Exemplarily, the charts are mainly line charts, three-dimensional bar charts, two-dimensional bar charts, pie charts, etc. Components are mainly combinations of some complex UIs, such as chart panel combination components, video playback sample components, video control bar components, etc. Elements are mainly basic UI units, such as text titles, text bodies, standard shapes, basic lines, etc. Optionally, the custom library is a private custom library that the user opens to his own permissions after logging into his account. Of course, the present application is not limited to this. The custom library stores various custom interface templates pre-stored by the user, which may include interface templates designed and stored in historical projects. Custom libraries can be stored locally or in the cloud.
[0078] Those skilled in the art should understand that, for the convenience of description, a certain layout of icons is used as an example in the specific examples below, but the present application is not limited thereto, and various other interface layouts are possible.
[0079] Specific as Figure 3 As shown, in this example, the cross-platform interface to be developed by the user includes a chart, so the user selects the standard icon library in the standard template library, that is, four templates of several standard templates of the standard chart template stored in the standard icon library are displayed in one of the pages of the content selection area. The user can select the chart to be designed in the homepage of the user interaction interface, such as a two-dimensional bar chart, and then obtain the corresponding Figure 3 In the specific example, by selecting the corresponding standard template, the user interface of the Sketch plug-in will automatically jump to Figure 4 Design page shown.
[0080] Those skilled in the art should understand that the standard interface layout usually only shows simple examples of graphic styles that can represent the interface layout. For example, for a bar chart, the standard layout only shows a fixed number of bars that are continuously increasing or decreasing without gaps. For the interface design of an actual product project, the number needs to be adjusted according to the size of the device to which the interface is ultimately applied, and often the statistical data does not change sequentially. The actual product also requires bars arranged at intervals to clearly show the various statistical data. In order to make the code block of the generated interface appear closer to the real product before binding the data, we hope that the interface to be formed will have a layout that is closer to the actual data statistics. Therefore, in an embodiment of the present invention, it is necessary to obtain a target template, and the target interface template has a target interface layout corresponding to the interface layout to be formed.
[0081] It should be noted that, at the UI design stage, designers only need to make the interface look real, and do not need to focus on the actual value changes of the data in the final product of this interface product. For example, if this interface product needs to use a bar chart to show the growth trend of the elderly population in a city over 35 years, and the cross-platform device used is a 5.5-inch Android, IOS and Windows system mobile phone, for this size, a bar chart showing 7 bars has a better display effect, then at this stage of interface development, the UI designer only needs to provide an interface that can be composed of 7 bars arranged at intervals and staggered in height, and the specific data binding is the work of subsequent developers.
[0082] In order to reduce the workload of designers, in an embodiment of the present invention, in particular, the cross-platform interface development method includes:
[0083] Second, the target template is acquired, layer information of the target template is extracted and the layer information is sent to the server, so that the server extracts text information data according to the layer information, and the target template has a target interface layout corresponding to the interface to be formed.
[0084] For example, continue to refer to Figure 4 As shown, the design page of the user interaction interface shows a content editing area on the left, a UI configuration area on the upper right corner, and in particular, a function area. Figure 4 The standard template obtained in the previous step, for example, a standard bar chart, has been shown. The user can adjust parameters such as the canvas size in the UI configuration area. In particular, in an embodiment of the present invention, the design page also includes a function area located in its lower right corner, including an "Extract and inject data from layer" button and an "Add template" button. Of course, those skilled in the art should understand that the specific names of the above buttons are only exemplary, and the names of the buttons in actual products can be changed as needed, as long as they have the corresponding functions described below.
[0085] Specifically, the user can click "Extract and inject data from layer" in the design page to jump to the Figure 5The OCR recognition layer picking window shown is a window in which the target template is selected in the corresponding path in the template input box to obtain the target template. The path can be a network link to enter a custom library or an online template search. The specific form is not limited. In an embodiment of the present invention, the method of entering the OCR recognition layer picking window is not limited to this. When starting the Sketch plug-in, the OCR recognition layer picking window can be opened by selecting it in the corresponding toolbar. That is to say, in an embodiment of the present invention, there are at least two ways to enter the OCR recognition layer picking window to obtain the target template. Of course, those skilled in the art should understand that this is only exemplary and may not be limited to this in actual applications.
[0086] Exemplarily, the target interface layout in the target template can be as shown in Figure 5. For this example, the layout of the interface to be formed needs to have a bar graph showing 7 bars. Usually, in a real environment, the growth trend of the number of elderly people within a certain age range should be high and low. Therefore, the target template is required to have the above-mentioned interface layout. The user only needs to find the corresponding path in the template input box in the OCR recognition layer picking window to select a bar graph with an interface layout corresponding to the interface to be formed as the target template. For example, a bar graph with a target interface layout can be found in a project that has been designed in the custom library as a target template. Once the corresponding target template is selected, the template is shown in the canvas of the OCR recognition layer picking window.
[0087] Furthermore, users Figure 5 The canvas of the window shown is selected and data injection is started. For example, the user can start data injection by double-clicking or pressing Enter. Taking double-clicking as an example, the user double-clicks the mouse to start the data flow, and the client 100 uses the Sketch plug-in to extract the layer information in the target template and send the layer information to the server, so that the server extracts the text information data according to the layer information.
[0088] Specifically, Figure 6 As shown, obtaining the target template, extracting the layer information of the target template and sending the layer information to the server further includes: obtaining the target template; extracting the layer of the target template; parsing the elements in the layer into element data; converting the element data into encoded data for sending.
[0089] Among them, the client 100 uses the Sketch plug-in to extract the layer of the target template based on the user's selection operation. Specifically, the selected layer can be extracted through the underlying API interface of the Sketch tool, and then the elements in the layer are parsed to represent each element in the layer in the form of element data, that is, the target template is expressed in the form of element data. Next, the element data is converted into a coding format that can be used for communication transmission to form a picture coding information stream with a certain format. Optionally, the coded data is Base64-based coded data. Among them, Base64 is a coding method for transmitting 8-bit bytecodes, which is a method of representing binary data with 64 printable characters. Of course, the present invention is not limited to this coding method. Because the element data represents the elements in the layer, the coded data is the information stream of the element data, so the coded data can be referred to as layer information in this article.
[0090] After the element data is formatted, the client 100 communicates with the server 200 to send the encoded data. For example, an Http / Https network request may be initiated to the interface of the application tool for text recognition loaded in the server 200, and the encoded data may be sent in response to the acceptance request information fed back from the interface, so that the server 200 extracts the text information data according to the layer information.
[0091] Specifically on the server side, the server 200 receives the layer information of the target template; extracts the text information data according to the layer information; and outputs the text information data to generate a cross-platform interface with the target interface format.
[0092] Refer to the following Figure 7 The flowchart shown illustrates the process of extracting text information on the server side according to an embodiment of the present invention.
[0093] Based on the interface communication protocol, the server 200 receives the layer information using the interface of the OCR text recognition application tool.
[0094] In an embodiment of the present invention, extracting text information data from layer information needs to be based on an OCR algorithm kernel. Specifically, extracting text information data based on layer information further includes: performing text detection on the layer information; identifying text data in the layer information based on the text detection result; and extracting text information data based on the text data.
[0095] Reference Figure 7 As shown, the server 200 performs text detection on the received coded data representing the layer information, specifically, decodes the layer information and performs text detection on the layer information based on the decoding result. This step is equivalent to decoding the coded data to detect whether it contains text data.
[0096] Based on the detection result, the text data in the layer information is identified. When the detection result is judged to contain text data, that is, after the target template is detected to contain text data, the text data of each text line is further identified based on the detection result of containing text data. That is, the specific text content, that is, the meaning of the text, is identified.
[0097] Furthermore, text information data is extracted based on the identified text data. In an embodiment of the present invention, the text information data represents key information data that is meaningful to the interface layout injected into the target template. This step specifically includes: extracting text information of the text data based on an information extraction algorithm, the text information includes text position and text content, that is, each text content to be injected into the standard template and the position corresponding to the text content, based on the text position and text content, any one of the text types such as text corresponding data, table header, legend, etc. can be determined; based on the text information, text information data having a first structure format is generated, wherein the structure is, for example, a code structure having a fixed format. In this example, the text information in the first structure format represents data containing the text position and text content of the text information formed according to the fixed format of the structure.
[0098] On the other hand, referring to Figure 7 As shown, optionally, if the detection result is judged to contain no text data, it means that the target template does not contain text data, and no further identification and extraction are performed, then the text information data is extracted based on the text data and further only includes: generating text information data having a second structure format, the text information data is an extraction failure message, wherein the structure is, for example, a code structure having a fixed format. In this example, the text information in the second structure format represents data formed according to the fixed format of the structure and only contains the extraction failure message.
[0099] Afterwards, refer to Figure 7 As shown, text information data is output through an interface to generate a cross-platform interface with a target interface format.
[0100] Third, the client 100 receives the text information data and injects it into the standard template to update the standard template to the target interface layout.
[0101] Specifically, when the client 100 receives the text information data, it is equivalent to the process of the Sketch plug-in loading the text information data. Optionally, if the received text information data is the text information data in the first structure format, after successful reception, the text information data is automatically loaded. Figure 5 The OCR recognition layer picking window shown jumps back to Figure 4 The design page shown in the figure updates the standard template in the content editing area to the target interface layout.
[0102] Specifically, receiving text information data and injecting it into the standard template to update the standard template to the target interface layout further includes:
[0103] Parsing the text information data into a plurality of data arrays representing each graphic according to the interface graphic logic in the target interface layout, wherein the interface graphic logic includes: one or more of the dimension, text position, and text content of each graphic, according to;
[0104] The data array is injected into the standard template and the interface layout of the target template is updated to the target interface layout according to the interface graphic logic represented by the data array.
[0105] It should be noted that if the text information data is data containing an extraction failure message, it indicates that the target template does not contain text or fails to recognize text, and the update cannot be successful after the text information data is injected. Optionally, the Sketch plug-in can prompt an update failure message after jumping back to the design page, and the user selects a new target template to re-complete the operation in the second step. The client and the server respond to the user's operation to loop the second step process; or after receiving the text data information, it does not jump back to the design page to prompt the user that the update was unsuccessful, or does not jump back to the design page but pops up an update failure message to prompt the user that the update was unsuccessful, and the user selects a new target template to complete the operation in the second step. The client and the server respond to the user's operation to loop the second step process.
[0106] In some optional embodiments, such as Figure 4 As shown, the function area in the design page also includes an "Add Template" button. Optionally, the user can select a loaded template (standard template or updated target template) in the content editing area and select the button to pop up the Figure 3 The homepage shown in the figure makes the client 100 repeat the first to third steps to complete the modification of the interface layout, for example, changing the bar chart to a pie chart or a line chart, etc. Further optionally, the user can select the blank area of the content editing area and select the button to pop up Figure 3 The home page shown in FIG. 1 causes the client 100 to repeat the first to third steps to complete adding a new interface layout, for example, adding Figure 4 WordArt shown.
[0107] For text elements such as artistic words, the interface layout is updated through the OCR recognition method in the present invention, so that UI designers do not have to manually type in text and manually adjust the spacing, paragraphs and other layouts. Instead, they can directly use the text and expected layout method given by the customer in the target template, and inject text content and format through OCR recognition by taking screenshots, which greatly facilitates the design of UI designers, simplifies the design process, saves labor costs, and improves design efficiency.
[0108] Fourth, according to the target interface layout, the code is converted into a code block file, which is used to generate a cross-platform interface with the target interface layout. For users, they can click Figure 4 The "Generate" button in the client 100 generates a code block file according to the target interface layout in response to the user operation.
[0109] Specifically, generating a code block file by coding according to the target interface layout further includes:
[0110] Get the standard code block of the pre-stored standard template;
[0111] Modify the position information in the standard code block according to the data array of the target interface layout;
[0112] The position information and the text content in the multiple data arrays are injected into the standard code block to form a cross-platform code block file, which is used to generate a cross-platform interface. The cross-platform interface represents the interface of a product that can be applied to multiple platforms, including but not limited to Android, IOS, Windows, Web or Hongmeng, etc. Optionally, the cross-platform code block file is a Flutter code block file. Of course, the present invention is not limited to this. Code cross files under other cross-platform frameworks are also possible as long as they can be used to generate a cross-platform interface.
[0113] In this embodiment, after the code block is generated, it can be saved as a file and exported to a certain path, such as exported to a local storage path, or exported to a cloud path of a cloud platform, so that subsequent developers can bind data, events, and graphics based on the code block to generate a graphical cross-platform interface.
[0114] In an embodiment of the present invention, a target template is obtained by using a Sketch plug-in on the designer's client, and layer information is extracted and sent to a server, so that the server identifies the layer information to generate text information data, and the standard template is injected and directly updated based on the text information data sent back, so that an interface with a target interface layout is directly generated based on the identified text information data, so that UI designers no longer need to repeat redundant operations such as copying, pasting, and modifying sizes during interface development, thereby realizing one-click interface design, and the design process no longer requires manual coding of UI design sketches in traditional design, realizing codeless UI design and a codeless development platform for interface designers, reducing the workload of interface designers, thereby making up for the problems existing in the prior art, effectively improving the flexibility of interface design, improving the work efficiency of designers, and reducing product design and development costs, and has broad application prospects.
[0115] Based on the same concept, an embodiment of the present invention further provides a cross-platform interface development method, comprising:
[0116] Receiving layer information of a target template, wherein the target template has a target interface layout corresponding to an interface to be formed;
[0117] Extract text information data according to layer information;
[0118] Output text information data to generate a cross-platform interface with a target interface layout.
[0119] Optionally, extracting text information data according to the layer information further includes: performing text detection on the layer information; identifying text data in the layer information based on the text detection result; and extracting text information data based on the text data.
[0120] Optionally, performing text detection on the layer information further includes: decoding the layer information and performing text detection on the layer information based on the decoding result; when the text detection result indicates that text data is contained, extracting text information data based on the layer information further includes: extracting text information of the text data based on an information extraction algorithm, the text information including text position and text content; and generating text information data having a first structure format based on the text information.
[0121] Optionally, when the text detection result indicates that no text data is included, extracting text information data based on the text data further includes:
[0122] Generate text information data in a second structure format, where the text information data is an extraction failure message.
[0123] In this embodiment, by receiving the layer information of the target template extracted by the client, performing text recognition on the layer information to obtain text information data, and returning it to the client to generate a cross-platform interface with the target interface layout, a code-free development platform is implemented for interface designers, reducing the workload of interface designers, thereby compensating for the problems existing in the prior art, effectively improving the flexibility of interface design, improving the work efficiency of designers, and reducing product design and development costs, and has broad application prospects.
[0124] Based on the same inventive concept, an embodiment of the present invention further provides an interface development device for implementing the above-mentioned Sketch-based cross-platform interface development method, comprising:
[0125] An interaction module is configured to obtain a standard template and a target template, wherein the standard template has a standard interface layout, and the target template has a target interface layout corresponding to the interface to be formed;
[0126] An extraction module configured to extract layer information of a target template;
[0127] a communication module configured to send layer information to a server and receive text information data from the server;
[0128] A logic processing module configured to inject text information data into the standard template to update the target interface layout; and
[0129] The code block generation module is configured to generate a code block file according to the target interface layout, and the code block file is used to generate a cross-platform interface with the target interface layout.
[0130] In this embodiment, the interface development device uses the Sketch plug-in to extract the layer information of the target template and send it to the server, so that it extracts the text information data of the target template, injects the received text information data into the standard template to update the interface layout and encodes it to generate a cross-platform interface with the target interface layout, thereby realizing a codeless development platform for interface designers, reducing the workload of interface designers, thereby compensating for the problems existing in the prior art, effectively improving the flexibility of interface design, improving the work efficiency of designers, and reducing product design and development costs, and has broad application prospects.
[0131] Based on the same inventive concept, an embodiment of the present invention further provides an interface development device for implementing the cross-platform interface development method described above, comprising:
[0132] A text extraction module configured to extract text information data from the layer information of the received target template, the target template having a target interface layout corresponding to the interface to be formed;
[0133] The communication module is configured to receive layer data and output text information data for generating a cross-platform interface with a target interface format.
[0134] In this embodiment, the layer information of the target template extracted by the client is received through the interface development device, and text recognition is performed on the layer information to obtain text information data, and the text information data is returned to the client to generate a cross-platform interface with the target interface layout, thereby realizing a code-free development platform for interface designers, reducing the workload of interface designers, thereby compensating for the problems existing in the prior art, effectively improving the flexibility of interface design, improving the work efficiency of designers, and reducing product design and development costs, and has broad application prospects.
[0135] Another embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements: obtaining a standard template, the standard template having a standard interface layout; obtaining a target template, extracting layer information of the target template and sending the layer information to a server, so that the server extracts text information data based on the layer information, the target template having a target interface layout corresponding to the interface to be formed; receiving text information data and injecting it into the standard template to update the standard template to the target interface layout; and coding to generate a code block file based on the target interface layout, the code block file being used to generate a cross-platform interface with the target interface layout.
[0136] Another embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements: receiving layer information of a target template, wherein the target template has a target interface layout corresponding to an interface to be formed; extracting text information data based on the layer information; and outputting the text information data to generate a cross-platform interface having the target interface layout.
[0137] In practical applications, the computer-readable storage medium can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present embodiment, the computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it.
[0138] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0139] The program code embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0140] Computer program code for performing the operations of the present invention may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0141] like Figure 8 As shown, a structural schematic diagram of a computer device provided by another embodiment of the present invention. Figure 8 The computer device 12 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0142] like Figure 8 As shown, the computer device 12 is in the form of a general-purpose computing device. The components of the computer device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that connects various system components (including the system memory 28 and the processing unit 16).
[0143] Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus architectures. By way of example, these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MAC) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.
[0144] The computer device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the computer device 12, including volatile and non-volatile media, removable and non-removable media.
[0145] The system memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. The computer device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 34 may be used to read and write non-removable, non-volatile magnetic media ( Figure 8 not shown, usually called a "hard drive"). Although Figure 8 Not shown in the figure, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, a DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to the bus 18 via one or more data medium interfaces. The memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present invention.
[0146] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in the memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. The program modules 42 generally perform the functions and / or methods of the embodiments described herein.
[0147] The computer device 12 may also communicate with one or more external devices 14 (e.g., keyboards, pointing devices, displays 24, etc.), one or more devices that enable a user to interact with the computer device 12, and / or any device that enables the computer device 12 to communicate with one or more other computing devices (e.g., network cards, modems, etc.). Such communication may be performed through an input / output (I / O) interface 22. Furthermore, the computer device 12 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) through a network adapter 20. Figure 8 As shown, the network adapter 20 communicates with other modules of the computer device 12 via the bus 18. It should be understood that although Figure 8 Not shown, other hardware and / or software modules may be used in conjunction with computer device 12, including but not limited to microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0148] The processor unit 16 executes various functional applications and data processing by running programs stored in the system memory 28, such as implementing a cross-platform interface development method or a cross-platform interface development method based on Sketch provided in an embodiment of the present invention.
[0149] In view of the existing problems, the present invention develops a cross-platform interface development method and system, computer equipment and medium based on Sketch. The method extracts the layer information of the target template by using the Sketch plug-in and sends it to the server, so that the server extracts the text information data of the target template, injects the received text information data into the standard template to update the interface layout and encodes it to generate a cross-platform interface with the target interface layout. The method realizes a code-free development platform for interface designers, reduces the workload of interface designers, and thus makes up for the problems existing in the prior art, effectively improves the flexibility of interface design, improves the work efficiency of designers, reduces the cost of product design and development, and has broad application prospects.
[0150] Obviously, the above embodiments of the present invention are merely examples for clearly illustrating the present invention, and are not limitations on the embodiments of the present invention. For those skilled in the art, other different forms of changes or modifications can be made based on the above description. It is impossible to list all the embodiments here. All obvious changes or modifications derived from the technical solution of the present invention are still within the protection scope of the present invention.
Claims
1. A cross-platform interface development method based on Sketch, applied to the client, characterized in that: include: Acquire a standard template, wherein the standard template has a standard interface format; Acquire a target template, extract layer information of the target template and send the layer information to a server, so that the server extracts text information data according to the layer information, and the target template has a target interface layout corresponding to the interface to be formed; Receiving the text information data and injecting it into the standard template to update the standard template to the target interface layout; as well as Generate a code block file according to the target interface layout, wherein the code block file is used to generate a cross-platform interface with the target interface layout. The step of acquiring a target template, extracting layer information of the target template, and sending the layer information to a server further comprises: Acquire the target template; Extracting the layer of the target template; Parsing the elements in the layer into element data; converting the element data into coded data for transmission, The receiving of the text information data and injecting it into the standard template to update the standard template to the target interface layout further includes: Parsing the text information data into a plurality of data arrays representing each graphic according to the interface graphic logic in the target interface format, wherein the interface graphic logic includes: one or more of the dimension, text position, and text content of each graphic; and Inject the data array into the standard template and update the interface layout of the target template to the target interface layout according to the interface graphic logic represented by the data array, The generating a code block file by coding according to the target interface layout further comprises: Get the standard code block of the pre-stored standard template; Modify the position information in the standard code block according to the data array of the target interface layout; The position information and the text contents in the multiple data arrays are injected into the standard code block to form a cross-platform based code block file, and the cross-platform based code block file is used to generate a cross-platform interface.
2. The cross-platform interface development method according to claim 1, characterized in that: The encoded data is Base64-based encoded data, and the cross-platform code block file is a Flutter code block file.
3. A cross-platform interface development method, applied to a server, characterized in that: include: Receiving layer information of a target template, wherein the target template has a target interface layout corresponding to an interface to be formed; Extracting text information data according to the layer information; Outputting the text information data to generate a cross-platform interface having a target interface format, The extracting of text information data according to the layer information further comprises: Performing text detection on the layer information; Identifying text data in the layer information based on the text detection result; and extracting the text information data based on the text data, The performing text detection on the layer information further comprises: decoding the layer information and performing text detection on the layer information based on the decoding result, When the text detection result indicates that text data is contained, extracting text information data according to the layer information further includes: Extracting text information of the text data based on an information extraction algorithm, the text information including text position and text content; and Text information data having a first structure format is generated based on the text information.
4. The cross-platform interface development method according to claim 3, characterized in that: When the text detection result indicates that no text data is included, extracting the text information data based on the text data further includes: Generate text information data in a second structure format, where the text information data is an extraction failure message.
5. An interface development device for implementing the cross-platform interface development method according to claim 1 or 2, characterized in that: include: An interaction module, configured to obtain a standard template and a target template, wherein the standard template has a standard interface layout, and the target template has a target interface layout corresponding to the interface to be formed; An extraction module, configured to extract layer information of the target template; a communication module configured to send the layer information to a server and receive text information data from the server; a logic processing module, configured to inject the text information data into the standard template to update the standard template to the target interface layout; and The code block generation module is configured to generate a code block file by coding according to the target interface layout, and the code block file is used to generate a cross-platform interface with the target interface layout.
6. An interface development device for implementing the cross-platform interface development method according to claim 3 or 4, characterized in that: include: A text extraction module configured to extract text information data from the layer information of the received target template, wherein the target template has a target interface layout corresponding to the interface to be formed; The communication module is configured to receive the layer data and output the text information data for generating a cross-platform interface with a target interface format.
7. A computer device comprising: one or more processors; a storage device having one or more programs stored thereon; When the one or more programs are executed by the one or more processors, the one or more processors are enabled to implement the method according to claim 1 or 2 or the method according to claim 3 or 4.
8. A computer-readable storage medium having a computer program stored thereon, wherein: When the program is executed by a processor, the method according to claim 1 or 2 or the method according to claim 3 or 4 is implemented.
