Method and device for real-time editing and rendering of user interface components

By obtaining and processing the editing information of the user interface components, generating and sending code to the browser, the real-time rendering component is solved, and real-time editing and rendering of the user interface components is realized.

CN113934486BActive Publication Date: 2024-11-22SHENZHEN COMTOP INFORMATION TECH
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202111072271.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-14
Publication Date
2024-11-22
Estimated Expiration
2041-09-14

AI Technical Summary

Technical Problem

The existing technology cannot realize real-time editing and real-time rendering of user interface components, resulting in inefficient editing. You need to frequently modify the theme resource files and re-deploy them, and you need to apply them to the page scene after editing to preview the effect.

Method used

By obtaining the editing information entered in the property editing window of the user interface component, the corresponding code is generated and sent to the user interface browser, so that it renders the component in real time according to the code, including determining the component type, generating style code or style configuration file, Storing preset style files, modifying rendering models, judging editing completion or applying instructions, etc.

Benefits of technology

Real-time editing and real-time rendering of user interface components is realized, improving editing efficiency, and users can instantly preview editing results without frequent deployment and application.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113934486B_ABST
    Figure CN113934486B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and device for real-time editing and rendering of user interface components, the method comprising: obtaining editing information submitted by a user in a property editing window of a user interface component and inputted in the property editing window; the property editing window is used to edit the property information of the user interface component in real time; according to the editing information, a code corresponding to the property information is generated; and the code is sent to a user interface browser so that the user interface browser renders the user interface component according to the code. It can be seen that the implementation of the present invention can perform real-time editing and real-time rendering of user interface components, thereby improving the editing efficiency of user interface components.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of user interface editing, and in particular to a method and device for real-time editing and rendering of user interface components. Background Art

[0002] User Interface (UI) is the medium for interaction and information exchange between the system and the user, and is composed of one or more components. With the development of society and the improvement of people's living standards, personalized needs are becoming more and more popular among the public. Therefore, personalized customization of user interfaces and regular updates of user interfaces to attract users are becoming more and more common.

[0003] However, in practice, there are two main problems with editing user interfaces: 1. Each time you edit part or all of the components in a user interface, you need to modify the theme resource file and redeploy it to the server, so it cannot be edited in real time; 2. After editing a component in a user interface, you must first apply it to a specific page scene to see the effect, and you cannot preview the effect in real time when editing component properties. It can be seen that it is very important to make user interface components editable and renderable in real time. Summary of the invention

[0004] The technical problem to be solved by the present invention is to provide a method and device for real-time editing and rendering of user interface components, which can perform real-time editing and real-time rendering of user interface components and improve the editing efficiency of user interface components.

[0005] In order to solve the above technical problems, the first aspect of the present invention discloses a method for real-time editing and rendering of a user interface component, the method comprising:

[0006] Acquiring editing information input by a user in a property editing window submitted by a user in the property editing window of a user interface component; the property editing window is used to edit the property information of the user interface component in real time;

[0007] Generate a code corresponding to the attribute information according to the editing information;

[0008] The code is sent to a user interface browser so that the user interface browser renders the user interface component according to the code.

[0009] As an optional implementation, in the first aspect of the present invention, the property editing window is a visual editing window of the user interface component or a code editing window of the user interface component, and generating the code corresponding to the property information according to the editing information includes:

[0010] Determine the source of the editing information; the source of the editing information includes the visual editing window and / or the code editing window;

[0011] When it is determined that the editing information comes from the visual editing window, generating a code corresponding to the attribute information of the user interface component according to the editing information and a preset code generation method;

[0012] When it is determined that the editing information comes from the code editing window, a code corresponding to the attribute information of the user interface component is generated according to the editing information.

[0013] As an optional implementation, in the first aspect of the present invention, before acquiring the editing information input by the user in the property editing window submitted by the user in the property editing window of the user interface component, the method further includes:

[0014] Determine the component type of the user interface component that needs to be edited; wherein the component type includes a custom type and a non-custom type;

[0015] When it is determined that the component type to be edited is the custom type, a style code corresponding to a preset style of a code editing window is generated, and the style code is sent to a user interface browser so that the user interface browser renders the code editing window and triggers the operation of obtaining the editing information entered by the user in the property editing window submitted by the property editing window of the user interface component;

[0016] When it is determined that the component type that needs to be edited is the non-custom type, a style configuration file corresponding to the preset style of the visual editing window is sent to the user interface browser, so that the user interface browser renders the visual editing window according to the style configuration file, and triggers the execution of the operation of obtaining the editing information entered by the user in the property editing window submitted by the property editing window of the user interface component.

[0017] As an optional implementation, in the first aspect of the present invention, generating the code corresponding to the attribute information of the user interface component according to the editing information and the preset code generation method includes:

[0018] Generate a property file corresponding to the property information according to the editing information;

[0019] Requesting the user interface browser to store the preset style file in a cache corresponding to the user interface browser;

[0020] When it is detected that the preset style file has been stored in the cache corresponding to the user interface browser, the property file and the preset style file are obtained, and the code corresponding to the property information is generated according to the property file and the preset style file.

[0021] As an optional implementation, in the first aspect of the present invention, sending the code to the user interface browser so that the user interface browser renders the user interface component according to the code includes:

[0022] The rendering model created by the user interface browser is modified according to the code, so that the user interface browser renders the user interface component according to the modified rendering model.

[0023] As an optional implementation, in the first aspect of the present invention, after sending the code to the user interface browser so that the user interface browser renders the user interface component according to the code, the method further includes:

[0024] Determining whether an edit completion instruction for the user interface component is received;

[0025] When it is determined that an editing completion instruction has been received for the user interface component, a property file corresponding to the property information is generated based on the property information of all the current user interface components; the property file includes a code corresponding to the property information; the property file is used to back up the property information of all the user interface components that have been edited this time and / or to perform subsequent editing work on the user interface components.

[0026] As an optional implementation, in the first aspect of the present invention, after sending the code to the user interface browser so that the user interface browser renders the user interface component according to the code, the method further includes:

[0027] Determining whether an application instruction for the user interface component is received;

[0028] When it is determined that an application instruction for the user interface component is received, the attribute information of the current user interface component is applied to the user interface according to the application instruction for the user interface component.

[0029] A second aspect of the present invention discloses a device for real-time editing and rendering of a user interface component, the device comprising:

[0030] An acquisition module, used for acquiring the editing information input by the user in the attribute editing window submitted by the user in the attribute editing window of the user interface component; the attribute editing window is used for editing the attribute information of the user interface component in real time;

[0031] A first generating module, used for generating a code corresponding to the attribute information according to the editing information;

[0032] The sending module is used to send the code to the user interface browser, so that the user interface browser renders the user interface component according to the code.

[0033] As an optional implementation, in the second aspect of the present invention, the property editing window is a visual editing window of the user interface component or a code editing window of the user interface component, and the first generating module includes:

[0034] A determination submodule, used for determining the source of the editing information; the source of the editing information includes the visual editing window and / or the code editing window;

[0035] A first generating submodule, configured to generate a code corresponding to the attribute information of the user interface component according to the editing information and a preset code generating method when the determining submodule determines that the editing information comes from the visual editing window;

[0036] The second generating submodule is used for generating a code corresponding to the attribute information of the user interface component according to the editing information when the determining submodule determines that the editing information comes from the code editing window.

[0037] As an optional implementation, in the second aspect of the present invention, the device further includes:

[0038] A determination module, used for determining the component type of the user interface component to be edited before the acquisition module acquires the editing information input by the user in the property editing window submitted by the user in the property editing window; wherein the component type includes a custom type and a non-custom type;

[0039] A second generating module, configured to generate a style code corresponding to a preset style of a code editing window when the determining module determines that the component type to be edited is the custom type;

[0040] The sending module is further used to send the style code generated by the second generating module to the user interface browser, so that the user interface browser renders the code editing window, and triggers the obtaining module to execute the operation of obtaining the editing information input by the user in the property editing window submitted by the user interface component;

[0041] The sending module is also used to send a style configuration file corresponding to a preset style of a visual editing window to the user interface browser when the determination module determines that the component type to be edited is the non-custom type, so that the user interface browser renders the visual editing window according to the style configuration file, and triggers the acquisition module to execute the operation of acquiring the editing information entered by the user in the property editing window submitted by the user in the property editing window of the user interface component.

[0042] As an optional implementation, in the second aspect of the present invention, the first generation submodule includes:

[0043] A generating unit, configured to generate a property file corresponding to the property information according to the editing information;

[0044] A requesting unit, configured to request the user interface browser to store a preset style file in a cache corresponding to the user interface browser;

[0045] an acquiring unit, configured to acquire the property file and the preset style file when detecting that the preset style file has been stored in a cache corresponding to the user interface browser;

[0046] The generating unit is further configured to generate a code corresponding to the attribute information according to the attribute file and the preset style file after the acquiring unit acquires the attribute file and the preset style file.

[0047] As an optional implementation, in the second aspect of the present invention, the sending module sends the code to the user interface browser so that the user interface browser renders the user interface component according to the code, specifically including:

[0048] The code is inserted into a rendering model created by the user interface browser, so that the user interface browser renders the user interface component according to the rendering model.

[0049] As an optional implementation, in the second aspect of the present invention, the device further includes:

[0050] A judging module, configured to judge whether an editing completion instruction for the user interface component is received after the sending module sends the code to the user interface browser so that the user interface browser renders the user interface component according to the code;

[0051] The third generation module is used to generate a property file corresponding to the property information according to the property information of all the current user interface components when the judgment module determines that an editing completion instruction has been received for the user interface component; the property file includes a code corresponding to the property information; the property file is used to back up the property information of all the user interface components whose editing has been completed this time and / or to subsequently edit the user interface components.

[0052] As an optional implementation, in the second aspect of the present invention, the device further includes:

[0053] The judging module is further configured to judge whether an application instruction for the user interface component is received after the sending module sends the code to the user interface browser so that the user interface browser renders the user interface component according to the code;

[0054] The application module is used to apply the attribute information of the current user interface component to the user interface according to the application instruction for the user interface component when the judgment module determines that an application instruction for the user interface component is received.

[0055] A third aspect of the present invention discloses another device for real-time editing and rendering of user interface components, the device comprising:

[0056] A memory storing executable program code;

[0057] a processor coupled to the memory;

[0058] The processor calls the executable program code stored in the memory to execute the method for real-time editing and rendering of user interface components disclosed in the first aspect of the present invention.

[0059] The fourth aspect of the present invention discloses a computer storable medium, wherein the computer storage medium stores computer instructions, and when the computer instructions are called, they are used to execute the method for real-time editing and rendering of user interface components disclosed in the first aspect of the present invention.

[0060] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:

[0061] In an embodiment of the present invention, the editing information input by the user in the property editing window submitted by the user interface component is obtained; the property editing window is used to edit the property information of the user interface component in real time; according to the editing information, a code corresponding to the property information is generated; and the code is sent to the user interface browser so that the user interface browser renders the user interface component according to the code. It can be seen that the implementation of the present invention can perform real-time editing and real-time rendering of the user interface component, thereby improving the editing efficiency of the user interface component. BRIEF DESCRIPTION OF THE DRAWINGS

[0062] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0063] Figure 1 It is a flowchart of a method for real-time editing and rendering of a user interface component disclosed in an embodiment of the present invention;

[0064] Figure 2 It is a flowchart of another method for real-time editing and rendering of a user interface component disclosed in an embodiment of the present invention;

[0065] Figure 3 It is a structural schematic diagram of a device for real-time editing and rendering of a user interface component disclosed in an embodiment of the present invention;

[0066] Figure 4 It is a structural schematic diagram of another device for real-time editing and rendering of user interface components disclosed in an embodiment of the present invention;

[0067] Figure 5 It is a structural schematic diagram of another device for real-time editing and rendering of user interface components disclosed in an embodiment of the present invention. DETAILED DESCRIPTION

[0068] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0069] The terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish different objects rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, device, product or end including a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units that are not listed, or may optionally include other steps or units inherent to these processes, methods, products or ends.

[0070] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0071] The present invention discloses a method and device for real-time editing and rendering of user interface components, which can perform real-time editing and real-time rendering of user interface components, thereby improving the editing efficiency of user interface components. Detailed descriptions are given below.

[0072] Embodiment 1

[0073] See also Figure 1 , Figure 1 1 is a flow chart of a method for real-time editing and rendering of a user interface component disclosed in an embodiment of the present invention. Figure 1 The method for real-time editing and rendering of user interface components described above can be applied to a local server or a cloud server, or to a user interface editing system, and the embodiments of the present invention are not limited thereto. Figure 1 As shown, the method for real-time editing and rendering of the user interface component may include the following operations:

[0074] 101. Obtain editing information input by a user in the property editing window submitted by the property editing window of the user interface component.

[0075] In the embodiment of the present invention, optionally, the user interface component may include a custom component and a non-custom component. Optionally, the non-custom component may include at least one of a basic component, an interactive component, and a chart component. Optionally, the basic component may include a user interface global color style component, and may also include a user interface layout style component. Optionally, the user interface global color style component may be a red global style component, a green global style component, or a yellow global style component, and so on, which is not limited in the embodiment of the present invention. Optionally, the user interface layout style component may include at least one of a center-aligned layout style component, a left-aligned layout style component, a right-aligned layout style component, and a two-end-aligned layout style component. Optionally, the interactive component may include at least one of a button component, a form component, a radio button component, and a check box component. Optionally, the button component may include at least one of a button border component, a button color component, and a button text component. Optionally, the form component may include at least one of a form label component, a form field component, and a form button component. Optionally, the radio button component may include a radio button component and / or a radio text label component. Optionally, the check box component may include a check button component and / or a check text label component. Optionally, the chart component may include at least one of a line chart component, a bar chart component, a pie chart component, and a scatter chart component. Optionally, the line chart component may include at least one of a line chart background color component, a line chart line color component, a line chart line width component, a line chart dash type component, a line chart text color component, a line chart text size component, and a line chart text layout component. Optionally, the bar chart component may include at least one of a bar chart background color component, a bar chart bar color component, a bar chart bar width component, a bar chart text color component, a bar chart text size component, and a bar chart text layout component. Optionally, the pie chart component may include at least one of a pie chart background color component, a pie chart partition line width component, a pie chart partition line dash type component, a pie chart text color component, a pie chart text size component, and a pie chart text layout component. Wherein, optionally, the scatter plot component may include at least one of a scatter plot background color component, a scatter plot scatter color component, a scatter plot scatter size component, a scatter plot scatter type component, a scatter plot text color component, a scatter plot text size component, and a scatter plot text layout component. Optionally, the custom component may include components not involved in the non-custom components, specifically, may include personalized components and / or special components.

[0076] In an embodiment of the present invention, the step of obtaining the editing information can be performed by configuring the collection technology of the vue event bus. In an embodiment of the present invention, the property editing window can be used to edit the property information of the user interface component in real time. Optionally, the property information of the user interface component may include the property parameter name and / or property parameter value of the user interface component. Optionally, the editing information may include the property information corresponding to the modified user interface component.

[0077] 102. Generate a code corresponding to the attribute information according to the edit information.

[0078] In the embodiment of the present invention, the code corresponding to the attribute information can be used by the user interface browser to render the user interface component according to the code. Optionally, the code corresponding to the attribute information can be a code segment based on the CSS Cascading Style Sheet specification.

[0079] 103. Send the code to the user interface browser so that the user interface browser renders the user interface component according to the code.

[0080] In the embodiment of the present invention, the user interface browser can render the user interface component according to the received code. The user interface browser may include at least one of a browser based on the Trident kernel (such as IE browser, etc.), a browser based on the Gecko kernel (such as Firefox browser, etc.), a browser based on the WebKit kernel (such as Safari browser, Chrome browser, etc.), and a browser based on the Presto kernel (such as Opera browser, etc.), which is not limited in the embodiment of the present invention.

[0081] It can be seen that the implementation of the embodiment of the present invention can perform real-time editing and real-time rendering of user interface components, thereby improving the editing efficiency of user interface components.

[0082] Embodiment 2

[0083] See also Figure 2 , Figure 2 1 is a flow chart of another method for real-time editing and rendering of a user interface component disclosed in an embodiment of the present invention. Figure 2 The method for real-time editing and rendering of user interface components described above can be applied to a local server or a cloud server, or to a user interface editing system, and the embodiments of the present invention are not limited thereto. Figure 2 As shown, the method for real-time editing and rendering of the user interface component may include the following operations:

[0084] 201. Obtain editing information input by a user in the property editing window submitted by the property editing window of the user interface component.

[0085] In the embodiment of the present invention, the property editing window of the user interface component can be a visual editing window of the user interface component or a code editing window of the user interface component. It should be noted that the visual editing window and the code editing window can be in the same page or in different pages, which is not limited in the embodiment of the present invention. In the embodiment of the present invention, for other descriptions of step 201, please refer to the detailed description of step 101 in embodiment 1, which will not be repeated in the embodiment of the present invention.

[0086] 202. Determine the source of the editing information. When it is determined that the editing information comes from the visual editing window, step 203 may be triggered; when it is determined that the editing information comes from the code editing window, step 204 may be triggered.

[0087] 203. When it is determined that the editing information comes from the visual editing window, a code corresponding to the attribute information of the user interface component is generated according to the editing information and a preset code generation method.

[0088] In an embodiment of the present invention, the visual editing window can be used to edit a non-customized user interface component. Optionally, the preset code generation method can include a Sass front-end compilation method. Optionally, the code corresponding to the attribute information of the user interface component can be a code segment based on the CSS Cascading Style Sheet specification.

[0089] 204. When it is determined that the editing information comes from the code editing window, a code corresponding to the attribute information of the user interface component is generated according to the editing information.

[0090] In the embodiment of the present invention, the code editing window can be used to edit a user interface component of a custom type. Optionally, the editing information of the window can be a code segment based on the CSS Cascading Style Sheet specification written by the user in the code editing window.

[0091] 205. Send the code to the user interface browser, so that the user interface browser renders the user interface component according to the code.

[0092] In the embodiment of the present invention, for other descriptions of step 205, please refer to the detailed description of step 103 in the first embodiment, and the embodiment of the present invention will not be repeated.

[0093] It can be seen that the implementation of the embodiment of the present invention can generate different codes according to different sources of editing information, and perform real-time editing and real-time rendering of user interface components according to different codes, thereby improving the editing efficiency of user interface components.

[0094] In an optional embodiment, before acquiring the editing information input by the user in the property editing window and submitted by the property editing window of the user interface component, the method may further include:

[0095] Determine the component type of the user interface component that needs to be edited; wherein the component type may include a custom type and a non-custom type;

[0096] When it is determined that the component type to be edited is a custom type, a style code corresponding to a preset style of the code editing window is generated, and the style code is sent to the user interface browser so that the user interface browser renders the code editing window, and triggers the operation of obtaining the editing information entered by the user in the property editing window submitted by the property editing window of the user interface component;

[0097] When it is determined that the component type that needs to be edited is a non-custom type, a style configuration file corresponding to the preset style of the visual editing window is sent to the user interface browser, so that the user interface browser renders the visual editing window according to the style configuration file, and triggers the execution of an operation of obtaining the editing information entered by the user in the property editing window submitted by the property editing window of the user interface component.

[0098] In this optional embodiment, the code editing window can be based on the vsCode editor plug-in, and the vsCode editor plug-in can be used to modify components of custom types in user interface components. Optionally, the style configuration file can be a modifiable component property configuration file data.js. Among them, data.js can define the data format of all configurable properties, and optionally, the data format can include the outermost category component type name (such as non-custom component or custom component) and / or config configuration. Among them, optionally, the inner layer of the config configuration can include type (component refinement type) and / or key (parameter setting value corresponding to type type).

[0099] It can be seen that implementing this optional embodiment can generate style codes for corresponding windows according to the type of user interface component that needs to be edited, so that the user interface browser renders the corresponding editing window, providing the user with the required editing window and improving editing efficiency.

[0100] In another optional embodiment, generating the code corresponding to the attribute information of the user interface component according to the edit information based on a preset code generation rule may include:

[0101] Generate a property file corresponding to the property information according to the edited information;

[0102] Requesting the user interface browser to store the preset style file in a cache corresponding to the user interface browser;

[0103] When it is detected that the preset style file has been stored in the cache corresponding to the user interface browser, the property file and the preset style file are obtained, and the code corresponding to the property information is generated according to the property file and the preset style file.

[0104] In this optional embodiment, the property file corresponding to the property information can be a Sass variable file based on the writeFile module in the open source library Sass.js. In this optional embodiment, the preset style file can be a component Sass resource file based on the open source library Sass.js. Optionally, the user interface browser can be requested to perform the operation of preloading the preset style file through the preloadFiles module in the open source library Sass.js. In this optional embodiment, the property file and the preset style file can be uniformly compiled based on the compileFile module in the open source library Sass.js to obtain the code corresponding to the property information. Further, the code can be a code based on the CSS Cascading Style Sheet specification that can be recognized by the browser.

[0105] It can be seen that implementing this optional embodiment can generate code corresponding to the attribute information of the user interface component according to the attribute file and the preset style file, thereby facilitating improving the efficiency and accuracy of the browser in identifying and rendering the user interface component.

[0106] In yet another optional embodiment, sending the code to the user interface browser so that the user interface browser renders the user interface component according to the code may include:

[0107] The rendering model created by the UI browser is modified according to the code, so that the UI browser renders the UI component according to the modified rendering model.

[0108] In this optional embodiment, the rendering model created by the user interface browser can be a DOM document object model. Optionally, the rendering model created by the user interface browser can be modified by changing elements in the DOM document object model according to the code, and specifically, the rendering model created by the user interface browser can be modified by changing the head tag in the DOM document object file according to the code.

[0109] It can be seen that implementing this optional embodiment can modify the rendering model created by the user interface browser according to the code corresponding to the attribute information, so that the browser renders the user interface components according to the modified rendering model, thereby realizing real-time rendering of the user interface components and improving the efficiency of editing the user interface components.

[0110] In yet another optional embodiment, after sending the code to the user interface browser so that the user interface browser renders the user interface component according to the code, the method may further include:

[0111] Determining whether an edit completion instruction for the user interface component has been received;

[0112] When it is determined that an editing completion instruction has been received for a user interface component, a property file corresponding to the property information is generated based on the property information of all current user interface components; the property file may include code corresponding to the property information; the property file can be used to back up the property information of all user interface components completed in this editing and / or for subsequent editing of the user interface components.

[0113] It can be seen that the implementation of this optional embodiment can generate a property file corresponding to the property information based on the property information of all current user interface components after receiving the editing completion instruction for the user interface component, so as to facilitate the backup of the property information of all user interface components completed in this editing and / or subsequent editing of the user interface components.

[0114] In this optional embodiment, the editing completion instruction for the user interface component may come from the user end. Optionally, determining whether the editing completion instruction for the user interface component is received may include:

[0115] When a signal is received from the user that the user interface component has been completely edited, it is determined that an editing completion instruction for the user interface component has been received; or,

[0116] The editing time of the user interface component is recorded, and when the editing time of the user interface component is greater than or equal to a predetermined time, it is determined that an editing completion instruction for the user interface component is received.

[0117] In this optional embodiment, the signal indicating that the user interface component has been completely edited can be a signal generated by the browser when the user clicks a button to confirm that the editing is complete. It can be seen that the implementation of this optional embodiment can determine whether the editing completion instruction for the user interface component has been received based on the signal indicating that the user interface component has been completely edited or the editing time of the user interface component, thereby realizing automatic determination of whether the editing completion instruction has been received, and improving the efficiency of the user interface component editing work.

[0118] In yet another optional embodiment, after sending the code to the user interface browser so that the user interface browser renders the user interface component according to the code, the method may further include:

[0119] Determining whether an application instruction for a user interface component is received;

[0120] When it is determined that an application instruction for the user interface component is received, the attribute information of the current user interface component is applied to the user interface according to the application instruction for the user interface component.

[0121] In this optional embodiment, the application instruction for the user interface component may come from the user end. It can be seen that the implementation of this optional embodiment can apply the attribute information of the current user interface component to the user interface according to the received application instruction for the user interface component, thereby applying the editing result of the user interface component to the actual user interface.

[0122] Optionally, the application instruction for the user interface component may include only one http request. It can be seen that this optional embodiment can issue fewer http requests, which helps save resources.

[0123] Embodiment 3

[0124] See also Figure 3 , Figure 3 1 is a schematic diagram of a device for real-time editing and rendering of a user interface component disclosed in an embodiment of the present invention. Figure 3 The device for real-time editing and rendering of user interface components described above can be applied to a local server or a cloud server, or to a user interface editing system, and the embodiments of the present invention do not limit this. Figure 3 As shown, the device for real-time editing and rendering of the user interface component may include:

[0125] The acquisition module 301 is used to acquire the editing information input by the user in the property editing window submitted by the user in the property editing window of the user interface component; the property editing window is used to edit the property information of the user interface component in real time;

[0126] A first generating module 302, used to generate a code corresponding to the attribute information according to the editing information;

[0127] The sending module 303 is used to send the code to the user interface browser so that the user interface browser renders the user interface component according to the code.

[0128] In the embodiment of the present invention, optionally, the user interface component may include a custom component and a non-custom component. Optionally, the non-custom component may include at least one of a basic component, an interactive component, and a chart component. Optionally, the basic component may include a user interface global color style component, and may also include a user interface layout style component. Optionally, the user interface global color style component may be a red global style component, a green global style component, or a yellow global style component, and so on, which is not limited in the embodiment of the present invention. Optionally, the user interface layout style component may include at least one of a center-aligned layout style component, a left-aligned layout style component, a right-aligned layout style component, and a two-end-aligned layout style component. Optionally, the interactive component may include at least one of a button component, a form component, a radio button component, and a check box component. Optionally, the button component may include at least one of a button border component, a button color component, and a button text component. Optionally, the form component may include at least one of a form label component, a form field component, and a form button component. Optionally, the radio button component may include a radio button component and / or a radio text label component. Optionally, the check box component may include a check button component and / or a check text label component. Optionally, the chart component may include at least one of a line chart component, a bar chart component, a pie chart component, and a scatter chart component. Optionally, the line chart component may include at least one of a line chart background color component, a line chart line color component, a line chart line width component, a line chart dash type component, a line chart text color component, a line chart text size component, and a line chart text layout component. Optionally, the bar chart component may include at least one of a bar chart background color component, a bar chart bar color component, a bar chart bar width component, a bar chart text color component, a bar chart text size component, and a bar chart text layout component. Optionally, the pie chart component may include at least one of a pie chart background color component, a pie chart partition line width component, a pie chart partition line dash type component, a pie chart text color component, a pie chart text size component, and a pie chart text layout component. Wherein, optionally, the scatter plot component may include at least one of a scatter plot background color component, a scatter plot scatter color component, a scatter plot scatter size component, a scatter plot scatter type component, a scatter plot text color component, a scatter plot text size component, and a scatter plot text layout component. Optionally, the custom component may include components not involved in the non-custom components, specifically, may include personalized components and / or special components.

[0129] In an embodiment of the present invention, a property editing window can be used to edit the property information of a user interface component in real time. Optionally, the property information of a user interface component may include the property parameter name and / or the property parameter value of the user interface component. Optionally, the editing information may include the property information corresponding to the modified user interface component. In an embodiment of the present invention, the code corresponding to the property information can be used by a user interface browser to render the user interface component according to the code. Optionally, the code corresponding to the property information may be a code segment based on the CSS Cascading Style Sheet specification.

[0130] In the embodiment of the present invention, the user interface browser can render the user interface component according to the received code. The user interface browser may include at least one of a browser based on the Trident kernel (such as IE browser, etc.), a browser based on the Gecko kernel (such as Firefox browser, etc.), a browser based on the WebKit kernel (such as Safari browser, Chrome browser, etc.), and a browser based on the Presto kernel (such as Opera browser, etc.), which is not limited in the embodiment of the present invention.

[0131] It can be seen that the implementation of the embodiment of the present invention can perform real-time editing and real-time rendering of user interface components, thereby improving the editing efficiency of user interface components.

[0132] In an optional embodiment, if Figure 4 As shown, the property editing window is a visual editing window of the user interface component or a code editing window of the user interface component. The first generating module 302 may include:

[0133] The determination submodule 3021 is used to determine the source of the editing information; the source of the editing information may include a visual editing window and / or a code editing window;

[0134] The first generating submodule 3022 is used to generate a code corresponding to the attribute information of the user interface component according to the editing information and a preset code generating method when the determining submodule 3021 determines that the editing information comes from the visual editing window;

[0135] The second generating submodule 3023 is used for generating a code corresponding to the attribute information of the user interface component according to the editing information when the determining submodule 3021 determines that the editing information comes from the code editing window.

[0136] In this optional embodiment, the visual editing window can be used to edit a non-customized user interface component. Optionally, the preset code generation method can include a Sass front-end compilation method. Optionally, the code corresponding to the attribute information of the user interface component can be a code segment based on the CSS Cascading Style Sheet specification. In this optional embodiment, the code editing window can be used to edit a custom type of user interface component. Optionally, the editing information of the window can be a code segment based on the CSS Cascading Style Sheet specification written by the user in the code editing window.

[0137] It can be seen that the implementation of this optional embodiment can generate different codes according to different sources of editing information, and perform real-time editing and real-time rendering of user interface components according to different codes, thereby improving the editing efficiency of user interface components.

[0138] In yet another optional embodiment, Figure 4 As shown, the device may also include:

[0139] The determination module 304 is used to determine the component type of the user interface component to be edited before the acquisition module 301 acquires the editing information input by the user in the property editing window submitted by the user in the property editing window of the user interface component; wherein the component type may include a custom type and a non-custom type;

[0140] The second generating module 305 is further used to generate a style code corresponding to a preset style of the code editing window when the determining module 304 determines that the component type to be edited is a custom type;

[0141] The sending module 303 is further used to send the style code generated by the second generating module 305 to the user interface browser, so that the user interface browser renders the code editing window, and triggers the acquisition module 301 to execute an operation of acquiring the editing information input by the user in the property editing window submitted by the user in the property editing window of the user interface component;

[0142] The sending module 303 is also used to send a style configuration file corresponding to a preset style of the visual editing window to the user interface browser when the determination module 304 determines that the component type to be edited is a non-custom type, so that the user interface browser renders the visual editing window according to the style configuration file, and triggers the acquisition module 301 to execute an operation of acquiring the editing information entered by the user in the property editing window submitted by the property editing window of the user interface component.

[0143] In this optional embodiment, the code editing window can be based on the vsCode editor plug-in, and the vsCode editor plug-in can be used to modify components of custom types in user interface components. Optionally, the style configuration file can be a modifiable component property configuration file data.js. Among them, data.js can define the data format of all configurable properties, and optionally, the data format can include the outermost category component type name (such as non-custom component or custom component) and / or config configuration. Among them, optionally, the inner layer of the config configuration can include type (component refinement type) and / or key (parameter setting value corresponding to type type).

[0144] It can be seen that implementing this optional embodiment can generate style codes for corresponding windows according to the type of user interface component that needs to be edited, so that the user interface browser renders the corresponding editing window, providing the user with the required editing window and improving editing efficiency.

[0145] In yet another optional embodiment, Figure 4 As shown, the first generation submodule 3022 may include:

[0146] The generating unit 30221 is used to generate a property file corresponding to the property information according to the editing information;

[0147] The requesting unit 30222 is used to request the user interface browser to store the preset style file in a cache corresponding to the user interface browser;

[0148] The acquiring unit 30223 is used to acquire the property file and the preset style file when it is detected that the preset style file has been stored in the cache corresponding to the user interface browser;

[0149] The generating unit 30221 is further configured to generate a code corresponding to the attribute information according to the attribute file and the preset style file after the acquiring unit 30223 acquires the attribute file and the preset style file.

[0150] In this optional embodiment, the property file corresponding to the property information can be a Sass variable file based on the writeFile module in the open source library Sass.js. In this optional embodiment, the preset style file can be a component Sass resource file based on the open source library Sass.js. Optionally, the user interface browser can be requested to perform the operation of preloading the preset style file through the preloadFiles module in the open source library Sass.js. In this optional embodiment, the property file and the preset style file can be uniformly compiled based on the compileFile module in the open source library Sass.js to obtain the code corresponding to the property information. Further, the code can be a code based on the CSS Cascading Style Sheet specification that can be recognized by the browser.

[0151] It can be seen that implementing this optional embodiment can generate code corresponding to the attribute information of the user interface component according to the attribute file and the preset style file, thereby facilitating improving the efficiency and accuracy of the browser in identifying and rendering the user interface component.

[0152] In yet another optional embodiment, Figure 4 As shown, the sending module 303 sends the code to the user interface browser so that the user interface browser renders the user interface component according to the code, which may specifically include:

[0153] The code is inserted into the rendering model created by the UI browser to cause the UI browser to render the UI component according to the rendering model.

[0154] In this optional embodiment, the rendering model created by the user interface browser can be a DOM document object model. Optionally, the rendering model created by the user interface browser can be modified by changing elements in the DOM document object model according to the code, and specifically, the rendering model created by the user interface browser can be modified by changing the head tag in the DOM document object file according to the code.

[0155] It can be seen that implementing this optional embodiment can modify the rendering model created by the user interface browser according to the code corresponding to the attribute information, so that the browser renders the user interface components according to the modified rendering model, thereby realizing real-time rendering of the user interface components and improving the efficiency of editing the user interface components.

[0156] In yet another optional embodiment, Figure 4 As shown, the device may also include:

[0157] A judging module 306, configured to judge whether an editing completion instruction for the user interface component is received after the sending module 303 sends the code to the user interface browser so that the user interface browser renders the user interface component according to the code;

[0158] The third generation module 307 is also used to generate a property file corresponding to the property information based on the property information of all current user interface components when the judgment module 306 determines that an editing completion instruction for the user interface component has been received; the property file may include code corresponding to the property information; the property file is used to back up the property information of all user interface components completed in this editing and / or to perform subsequent editing work on the user interface components.

[0159] It can be seen that the implementation of this optional embodiment can generate a property file corresponding to the property information based on the property information of all current user interface components after receiving the editing completion instruction for the user interface component, so as to facilitate the backup of the property information of all user interface components completed in this editing and / or subsequent editing of the user interface components.

[0160] In yet another optional embodiment, Figure 4 As shown, the device may also include:

[0161] The judging module 306 is further configured to judge whether an application instruction for the user interface component is received after the sending module 303 sends the code to the user interface browser so that the user interface browser renders the user interface component according to the code;

[0162] The application module 308 is used to apply the attribute information of the current user interface component to the user interface according to the application instruction for the user interface component when the determination module 306 determines that an application instruction for the user interface component is received.

[0163] It can be seen that implementing this optional embodiment can apply the attribute information of the current user interface component to the user interface according to the received application instruction for the user interface component, thereby applying the editing result of the user interface component to the actual user interface.

[0164] Embodiment 4

[0165] See also Figure 5 , Figure 5 is a schematic diagram of the structure of another device for real-time editing and rendering of user interface components disclosed in an embodiment of the present invention. Figure 5 As shown, the device for real-time editing and rendering of the user interface component may include:

[0166] A memory 401 storing executable program codes;

[0167] a processor 402 coupled to the memory 401;

[0168] The processor 402 calls the executable program code stored in the memory 401 to execute the steps of the method for real-time editing and rendering of user interface components described in the first embodiment of the present invention or the second embodiment of the present invention.

[0169] Embodiment 5

[0170] An embodiment of the present invention discloses a computer storable medium, which stores computer instructions. When the computer instructions are called, they are used to execute the steps in the method for real-time editing and rendering of user interface components described in Embodiment 1 or Embodiment 2 of the present invention.

[0171] Embodiment 6

[0172] An embodiment of the present invention discloses a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to enable a computer to execute the steps in the method for real-time editing and rendering of user interface components described in embodiment one or embodiment two.

[0173] The device embodiments described above are only illustrative, wherein the modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, i.e., they may be located in one place, or they may be distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Those of ordinary skill in the art may understand and implement it without creative work.

[0174] Through the specific description of the above embodiments, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on such an understanding, the above technical solution can be essentially or partly contributed to the prior art in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, and the storage medium includes a read-only memory (ROM), a random access memory (RAM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), a one-time programmable read-only memory (OTPROM), an electronically erasable rewritable read-only memory (EEPROM), a compact disc (CD-ROM) or other optical disc storage, magnetic disk storage, magnetic tape storage, or any other computer-readable medium that can be used to carry or store data.

[0175] Finally, it should be noted that the method and device for real-time editing and rendering of a user interface component disclosed in the embodiment of the present invention disclose only the preferred embodiments of the present invention, which are only used to illustrate the technical solution of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, it should be understood by those skilled in the art that the technical solutions described in the aforementioned embodiments can still be modified, or some of the technical features therein can be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.

Claims

1. A method for real-time editing and rendering of user interface components, characterized in that: The method comprises: Acquiring editing information input by a user in a property editing window submitted by a user in the property editing window of a user interface component; the property editing window is used to edit the property information of the user interface component in real time; Generate a code corresponding to the attribute information according to the editing information; Sending the code to a user interface browser so that the user interface browser renders the user interface component according to the code; The property editing window is a visual editing window of the user interface component or a code editing window of the user interface component; The step of generating a code corresponding to the attribute information according to the editing information includes: Determine the source of the editing information; the source of the editing information includes the visual editing window and / or the code editing window; When it is determined that the editing information comes from the visual editing window, generating a code corresponding to the attribute information of the user interface component according to the editing information and a preset code generation method; When it is determined that the editing information comes from the code editing window, generating a code corresponding to the attribute information of the user interface component according to the editing information; The visual editing window can be used to edit non-customized user interface components, the preset code generation method includes a Sass front-end compilation method, and the code corresponding to the attribute information of the user interface component is a code segment based on the CSS Cascading Style Sheet specification; Before acquiring the editing information input by the user in the property editing window and submitted by the property editing window of the user interface component, the method further comprises: Determine the component type of the user interface component that needs to be edited; wherein the component type includes a custom type and a non-custom type; When it is determined that the component type to be edited is the custom type, a style code corresponding to a preset style of a code editing window is generated, and the style code is sent to a user interface browser so that the user interface browser renders the code editing window and triggers the operation of obtaining the editing information entered by the user in the property editing window submitted by the property editing window of the user interface component; When it is determined that the component type to be edited is the non-custom type, a style configuration file corresponding to a preset style of a visual editing window is sent to a user interface browser, so that the user interface browser renders the visual editing window according to the style configuration file, and triggers the operation of obtaining the editing information entered by the user in the property editing window submitted by the user in the property editing window of the user interface component; The code editing window is based on the vsCode editor plug-in, which is used to modify the components of the custom type in the user interface component. The style configuration file is represented as a modifiable component property configuration file data.js; data.js defines the data format of all configurable properties, and the data format includes: the type name of the outermost non-custom component or custom component, and / or config configuration; The inner layer of the config configuration includes: the detailed type of the component and / or the parameter setting value corresponding to the detailed type of the component; And, after sending the code to the user interface browser so that the user interface browser renders the user interface component according to the code, the method further includes: Determining whether an edit completion instruction for the user interface component has been received; When it is determined that an editing completion instruction for a user interface component is received, a property file corresponding to the property information is generated according to the property information of all current user interface components; the property file includes a code corresponding to the property information; the property file is used to back up the property information of all user interface components edited this time and / or to edit the user interface components later; The determining whether an editing completion instruction for the user interface component is received includes: When a signal is received from the user that the user interface component has been completely edited, it is determined that an editing completion instruction for the user interface component has been received; or, The editing time of the user interface component is recorded, and when the editing time of the user interface component is greater than or equal to a predetermined time, it is determined that an editing completion instruction for the user interface component is received.

2. The method for real-time editing and rendering of user interface components according to claim 1, characterized in that: The step of generating a code corresponding to the attribute information of the user interface component according to the editing information and a preset code generation method includes: Generate a property file corresponding to the property information according to the editing information; Requesting the user interface browser to store the preset style file in a cache corresponding to the user interface browser; When it is detected that the preset style file has been stored in the cache corresponding to the user interface browser, the property file and the preset style file are obtained, and the code corresponding to the property information is generated according to the property file and the preset style file.

3. The method for real-time editing and rendering of user interface components according to claim 1, characterized in that: The step of sending the code to a user interface browser so that the user interface browser renders the user interface component according to the code comprises: The rendering model created by the user interface browser is modified according to the code, so that the user interface browser renders the user interface component according to the modified rendering model.

4. The method for real-time editing and rendering of user interface components according to claim 1, characterized in that: After sending the code to the user interface browser so that the user interface browser renders the user interface component according to the code, the method further includes: Determining whether an application instruction for the user interface component is received; When it is determined that an application instruction for the user interface component is received, the attribute information of the current user interface component is applied to the user interface according to the application instruction for the user interface component.

5. A device for real-time editing and rendering of user interface components, characterized in that: The device comprises: An acquisition module, used for acquiring the editing information input by the user in the attribute editing window submitted by the user in the attribute editing window of the user interface component; the attribute editing window is used for editing the attribute information of the user interface component in real time; A first generating module, used for generating a code corresponding to the attribute information according to the editing information; A sending module, used for sending the code to a user interface browser, so that the user interface browser renders the user interface component according to the code; The property editing window is a visual editing window of the user interface component or a code editing window of the user interface component; The first generation module comprises: A determination submodule, used for determining the source of the editing information; the source of the editing information includes the visual editing window and / or the code editing window; A first generating submodule, configured to generate a code corresponding to the attribute information of the user interface component according to the editing information and a preset code generating method when the determining submodule determines that the editing information comes from the visual editing window; A second generating submodule, configured to generate a code corresponding to the attribute information of the user interface component according to the editing information when the determining submodule determines that the editing information comes from the code editing window; The visual editing window can be used to edit non-customized user interface components, the preset code generation method includes a Sass front-end compilation method, and the code corresponding to the attribute information of the user interface component is a code segment based on the CSS Cascading Style Sheet specification; The device also includes: A determination module, used for determining the component type of the user interface component to be edited before the acquisition module acquires the editing information input by the user in the property editing window submitted by the user in the property editing window; wherein the component type includes a custom type and a non-custom type; A second generating module, configured to generate a style code corresponding to a preset style of a code editing window when the determining module determines that the component type to be edited is the custom type; The sending module is further used to send the style code generated by the second generating module to the user interface browser, so that the user interface browser renders the code editing window and triggers the obtaining module to execute the operation of obtaining the editing information input by the user in the property editing window submitted by the user in the property editing window of the user interface component; The sending module is further used for sending a style configuration file corresponding to a preset style of a visual editing window to the user interface browser when the determining module determines that the component type to be edited is the non-customized type, so that the user interface browser renders the visual editing window according to the style configuration file, and triggers the obtaining module to execute the operation of obtaining the editing information input by the user in the property editing window submitted by the user in the property editing window of the user interface component; The code editing window is based on the vsCode editor plug-in, which is used to modify the components of the custom type in the user interface component. The style configuration file is represented as a modifiable component property configuration file data.js; data.js defines the data format of all configurable properties, and the data format includes: the type name of the outermost non-custom component or custom component, and / or config configuration; And, the device further comprises: A judging module, configured to judge whether an editing completion instruction for the user interface component is received after the sending module sends the code to the user interface browser so that the user interface browser renders the user interface component according to the code; The third generation module is used to generate a property file corresponding to the property information according to the property information of all the current user interface components when the judgment module determines that an editing completion instruction has been received for the user interface component; the property file includes a code corresponding to the property information; the property file is used to back up the property information of all the user interface components whose editing has been completed this time and / or to subsequently edit the user interface components.

6. A device for real-time editing and rendering of user interface components, characterized in that: The device comprises: A memory storing executable program code; a processor coupled to the memory; The processor calls the executable program code stored in the memory to execute the method for real-time editing and rendering of user interface components as described in any one of claims 1-5.

7. A computer storable medium, characterized in that: The computer storage medium stores computer instructions, which, when called, are used to execute the method for real-time editing and rendering of user interface components as described in any one of claims 1-5.

Citation Information

Patent Citations

  • Method and device for webpage making

    CN104572092A

  • Use case generation method, and page generation method and device

    CN106469050A

  • Web page style adjusting method with immediate effect

    CN107480278A

  • Method for customizing component by user and method and device for generating platform code

    CN109614095A

  • Webpage development preview method and device and electronic equipment

    CN112068824A