WO2021212636A1 - Form page generation method and device, terminal, and storage medium - Google Patents

Form page generation method and device, terminal, and storage medium Download PDF

Info

Publication number
WO2021212636A1
WO2021212636A1 PCT/CN2020/097119 CN2020097119W WO2021212636A1 WO 2021212636 A1 WO2021212636 A1 WO 2021212636A1 CN 2020097119 W CN2020097119 W CN 2020097119W WO 2021212636 A1 WO2021212636 A1 WO 2021212636A1
Authority
WO
WIPO (PCT)
Prior art keywords
control
layer
controls
implementation
rendering
Prior art date
Application number
PCT/CN2020/097119
Other languages
French (fr)
Chinese (zh)
Inventor
洪笃辉
Original Assignee
平安国际智慧城市科技股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 平安国际智慧城市科技股份有限公司 filed Critical 平安国际智慧城市科技股份有限公司
Publication of WO2021212636A1 publication Critical patent/WO2021212636A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking

Definitions

  • This application relates to the field of computer technology, in particular to a method, device, terminal and storage medium for generating a form page.
  • the form is one of the interactive ways for users to submit information to the system. It almost takes on the information entry work of the website. With the increasing development of information construction, the diversity of data has become more obvious, and the workload of form UI development is increasing. Therefore, the form designer based on the visual operation interface not only simplifies the development of form UI development, but also reduces the development of form
  • the threshold allows non-development business personnel to design interactive form UI and publish it to the system according to business needs, thereby reducing development costs and improving the delivery efficiency of forms.
  • the form designer on the market only provides a single technology stack, so that the generated form pages can only run on systems with a specific technology stack, and the generated form pages can only be published to designated third-party systems.
  • This not only restricts the secondary development of the form to meet more customized scenarios, but also increases the difficulty of technical integration with the existing system; on the other hand, hosting the form in a third-party system is not conducive to the information security of the system. Therefore, the form page generated by this type of form designer can only solve simple form requirements and undertake simple information entry work, which is not conducive to its custom development and dynamic rendering.
  • the first aspect of the present application provides a method for generating a form page, and the method includes:
  • each of the form UI controls into an interface layer and an implementation layer, where an architectural isolation layer is between the interface layer and the implementation layer of each of the form UI controls;
  • a second aspect of the present application provides a terminal, the terminal includes a memory and a processor, the memory is configured to store at least one computer-readable instruction, and the processor is configured to execute the at least one computer-readable instruction to implement the following step:
  • each of the form UI controls into an interface layer and an implementation layer, where an architectural isolation layer is between the interface layer and the implementation layer of each of the form UI controls;
  • a third aspect of the present application provides a computer-readable storage medium that stores at least one computer-readable instruction, and when the at least one computer-readable instruction is executed by a processor, the following steps are implemented:
  • each of the form UI controls into an interface layer and an implementation layer, where an architectural isolation layer is between the interface layer and the implementation layer of each of the form UI controls;
  • a fourth aspect of the present application provides a form page generating device, the device including:
  • the creation module is used to create a dictionary, where the dictionary carries multiple historical form names;
  • the receiving module is used to receive the control names of multiple form UI controls of the form to be created input by the user;
  • An obtaining module configured to obtain multiple form UI controls corresponding to the control names of the multiple form UI controls from the dictionary
  • the dividing module is used to divide each of the form UI controls into an interface layer and an implementation layer, where the interface layer and the implementation layer of each form UI control are an architectural isolation layer;
  • the splicing module is used to splice the protocol content in the interface layer corresponding to each of the form UI controls into an intermediate language;
  • a generating module for generating a form UI control with an implementation layer based on each of the intermediate languages
  • a display module configured to display a form UI control with an implementation layer in the implementation layer through the isolation layer;
  • the rendering module is used to render the form UI controls in the implementation layer to generate a form page.
  • the form page generation method, device, terminal and storage medium described in this application can be applied to the fields of smart government affairs, smart law, smart community, smart finance, smart life, etc. in the construction of smart cities to promote smart cities Construction development.
  • This application separates the configuration and rendering of the form UI control by dividing the form UI control into an interface layer and an implementation layer, thereby providing a technical foundation for custom development. It also sets up an isolation layer to make the implementation layer of each control mutually exclusive.
  • the purpose of different rendering results can be achieved by switching the implementation layer, and the rendering efficiency of the browser can be improved; finally, the protocol content in the interface layer corresponding to the form UI control is translated into an intermediate language, which is convenient for later use in different In the technical language of, at the same time, a form UI control with an implementation layer is generated based on the intermediate language, and any form UI control is re-developed without changing any form UI control protocol, which meets the customization requirements of various scenarios.
  • FIG. 1 is a flowchart of a method for generating a form page provided by Embodiment 1 of the present application.
  • Fig. 2 is a structural diagram of a form page generating apparatus provided in the second embodiment of the present application.
  • FIG. 3 is a schematic structural diagram of a terminal provided in Embodiment 3 of the present application.
  • FIG. 1 is a flowchart of a method for generating a form page provided by Embodiment 1 of the present application.
  • the method for generating a form page can be applied to a terminal.
  • the function of generating the form page provided by the method of this application can be directly integrated on the terminal, or developed by software The tool kit (Software Development Kit, SKD) runs in the terminal.
  • the method for generating a form page specifically includes the following steps. According to different requirements, the order of the steps in the flowchart can be changed, and some of the steps can be omitted.
  • the dictionary refers to a collection of a series of protocol layers corresponding to the form UI controls of multiple historical forms.
  • the dictionary stores the name of each historical form, the form UI control of each historical form, and the form UI.
  • the protocol corresponding to the control and the corresponding protocol layer wherein the protocol includes the control name, protocol content, HTMLElement tag name, attribute, method, interface layer, implementation layer and parameter list of each form UI control.
  • the creating dictionary includes:
  • each of the form UI control protocol layers is composed of interface layers of multiple form UI controls corresponding to the historical form name ,
  • the interface layer of each form UI control carries a control name corresponding to the form UI control;
  • the multiple historical form names are taken as the first level of the dictionary
  • the interface layers of multiple form UI controls corresponding to each of the historical form names are taken as the second level of the dictionary
  • the protocol corresponding to the interface layers of the multiple form UI controls The layer serves as the third layer of the dictionary, where the dictionary is stored in a blockchain node.
  • each historical form name corresponds to a protocol layer
  • each protocol layer corresponds to the interface layers of multiple form UI controls
  • each interface layer of the form UI controls corresponds to a form UI control
  • each form UI control Corresponding to the control name of the form UI control, the historical form name, the form UI control corresponding to each historical punctuation name, and the protocol layer corresponding to the interface layer of the form UI control are defined as different levels, which improves the access to the form UI control efficient.
  • the above dictionary can also be stored in a node of a blockchain.
  • S12 Receive control names of multiple form UI controls of the form to be created input by the user.
  • the form name of the form to be created and the control names of multiple form UI controls corresponding to the form name are input in the browser.
  • the dictionary stores the form name of each historical form and multiple form UI controls corresponding to the form name of each historical form and the control names of the form UI controls.
  • the form to be created input by the user is received
  • the control names of multiple form UI controls are used, the form UI control corresponding to the control name of each form UI control is obtained from the dictionary.
  • the interface layer refers to the definition of the attributes and behaviors of the form UI control, that is, the internal operation of the form UI control and the external environment are independent of each other in the data processing process, for example, to modify the form UI
  • the internal operation of the control will not affect the external environment of the form UI control
  • the implementation layer refers to the implementation of the protocol content defined by the interface layer of the form UI control to implement internal operations, in order to prevent the implementation layer from Internal details pollute the global environment, and an isolation layer is constructed between the implementation layer and the interface layer.
  • the dividing each of the form UI controls into an interface layer and an implementation layer includes:
  • CustomElements defined to pass in the custom label to divide each form UI control into an interface layer and an implementation layer.
  • the form UI control is created as HTMLElement (custom) tags that can be natively recognized by the browser, and the customElements.define method is called to pass in the HTMLElement tags and JavaScript Class is used.
  • Implement the practical layer obtained from the interface layer corresponding to each form UI control thereby dividing each form UI control into an interface layer and an implementation layer.
  • the Shadow DOM technology is used An isolation layer is constructed between the interface layer and the implementation layer of each of the form UI controls.
  • each control is divided into an interface layer and an implementation layer to separate configuration and rendering.
  • the configuration is implemented through the interface layer, and the rendering is implemented through the implementation layer, which improves the rendering.
  • the architecture isolation layer is due to the fact that the default operating environment provided by the browser is not isolated.
  • the internal details of the implementation layer can easily pollute the global environment, causing other UI controls to be interfered and unable to work normally.
  • the architecture isolation layer between the interface layers improves the rendering quality.
  • S15 Splice the protocol content in the interface layer corresponding to each of the form UI controls into an intermediate language.
  • the protocol content in the interface layer corresponding to the form UI control is not conducive to storage and transmission in the form of code.
  • the interface corresponding to each form UI control will be The content of the agreement in the layer is spliced into an intermediate language.
  • the splicing the protocol content in the interface layer corresponding to each of the form UI controls into an intermediate language includes:
  • the protocol content in the interface layer corresponding to the form UI control is spliced into an intermediate language.
  • the user drags the form UI control list "I”, “Ping”, and “From” to the form canvas, and reads each form UI control according to the drag order of the user, and reads the interface corresponding to the first form UI control.
  • the protocol content of the layer is "I”
  • the protocol content of the interface layer corresponding to the second form UI control is read as “from”
  • the protocol content of the interface layer corresponding to the third form UI control is read as "Peace”
  • S16 Generate a form UI control with an implementation layer based on each of the intermediate languages.
  • each protocol layer corresponds to multiple implementation layers.
  • a translator, a configuration center, and a registry are designed. The translator, The configuration center and the registry work together in the translation layer.
  • the generating a form UI control with an implementation layer based on each of the intermediate languages includes:
  • the first form UI control read from each intermediate language is matched with the second form UI control read from the registry by the configuration center, where ,
  • the first form UI control read from each of the intermediate languages corresponds to an interface layer, and the second form UI control read from the registry by the configuration center corresponds to an implementation Floor;
  • the intermediate language is input to the translator, and the translator requests the corresponding dictionary in the configuration center according to the intermediate language, and in the configuration center Set the dictionary to the active state, then find the form UI control corresponding to the active state dictionary from the registry, return the form UI control to the translator, and the translator reads the corresponding data from each intermediate language.
  • the first form UI control, the first form UI control read from the intermediate language only corresponds to an interface layer
  • the second form UI control read from the registry by the configuration center only corresponds to an implementation layer
  • the first form UI control is matched with the second form UI control
  • the matched first form UI control is associated with the second form UI control to obtain a carrying
  • the interface layer and the form UI control list of the implementation layer are called, the translator is called to read each first form UI control in the list one by one, and the corresponding first form UI control is obtained through the interface layer of each first form UI control.
  • the realization layer of the form UI control is obtained through the interface layer of each first form UI control.
  • the realization layer of the form UI control completes the generation of the form UI control with the realization layer from the intermediate language.
  • Form UI controls "I”, “come from”, “PingAn”, match the first form UI control with the second form UI control to obtain the correspondence between “I” and “I”, and “from” and “come”
  • the form UI control list corresponding to “from”, “Ping An” and “PingAn” is called, and the translator is called to read the second form UI controls “I”, “come from”, and “PingAn” to generate an English implementation layer
  • Form controls for example: the form control with English implementation level corresponding to the intermediate language “I” is “I”, and the form control with English implementation level corresponding to the intermediate language “from” is “come here", the The form control with English implementation layer corresponding to the intermediate language “Ping An” is "PingAn".
  • the translation layer generates a form UI control with an implementation layer based on the intermediate language.
  • the form UI control contains specific style codes and interactive logic codes.
  • the secondary development of the form UI controls can also be implemented for each of the form UI controls to switch between different implementation layers, which meets the needs of various customized scenarios, promotes the development of smart city construction, and can be applied to the wisdom of smart city construction. Government affairs, smart law, smart community, smart finance, smart life and other fields.
  • S17 Display a form UI control with an implementation layer in the implementation layer through the isolation layer.
  • a form UI control protocol layer includes multiple form UI controls, each form UI control corresponds to multiple implementation layers, and each implementation layer is independently presented in the isolation layer.
  • the presenting the form UI control with the realization layer in the realization layer through the isolation layer includes:
  • the translator obtains the implementation layer information of the rendering version corresponding to the activated state from the configuration center;
  • the realization layer of the form UI control corresponding to the realization layer information is displayed in the realization layer.
  • each form UI control corresponds to multiple implementation layers
  • each implementation layer corresponds to a rendering version
  • obtain multiple rendering versions corresponding to the form UI control with implementation layers and register the multiple rendering versions Go to the registry and set the status to the suspended state; set the specified rendering version status to the active state in the configuration center, so that the "translator" will obtain the implementation of the only active rendering version from the "configuration center” Tier information.
  • the registry, the configuration center, and the translator work together in the translation layer, and are cooperatively responsible for dynamically maintaining the relationship between the different implementation layers of each form UI control, and realize the switching of different implementation layers. Since the isolation layer is constructed between the interface layer and the implementation layer of each form UI control, the implementation layer of each form UI control is independent of each other and does not interfere with each other, avoiding the default operating environment provided by the browser Without isolation, the internal details of the implementation layer can easily pollute the global environment, causing other UI controls to be interfered and unable to work normally.
  • the form page is generated by rendering the form UI controls in the implementation layer into different rendering pieces and then connecting them.
  • the rendering of the form UI control in the implementation layer to generate the form page includes:
  • a form page is generated based on the rendering image.
  • the isolation layer wraps each form UI control into an independent rendering piece, and each rendering piece can be independently and dynamically rendered under certain conditions without affecting other rendering pieces, achieving different rendering results, and improving the browser’s performance.
  • Rendering efficiency reduces the cost of rendering the entire form page.
  • the method for generating a form page receives the control names of multiple form UI controls of the form to be created that are input by the user after creating a dictionary; and obtains the multiple form UI controls from the dictionary Multiple form UI controls corresponding to the control name of the form; divide each of the form UI controls into an interface layer and an implementation layer, wherein the interface layer and the implementation layer of each form UI control have an architectural isolation layer between the interface layer and the implementation layer; The protocol content in the interface layer corresponding to each of the form UI controls is spliced into an intermediate language; a form UI control with an implementation layer is generated based on each intermediate language; the implementation layer is displayed in the implementation layer through the isolation layer Form UI controls; render the form UI controls in the implementation layer to generate a form page.
  • This embodiment separates the configuration and rendering of the form UI control by dividing the form UI control into an interface layer and an implementation layer, thereby providing a technical basis for custom development, and setting up an isolation layer to make the implementation layer of each control They are independent of each other and do not interfere with each other.
  • the purpose of different rendering results is achieved by switching the realization layer, and the rendering efficiency of the browser is improved; finally, the protocol content in the interface layer corresponding to the form UI control is translated into an intermediate language, which is convenient for later use Among different technical languages, form UI controls with implementation layers are generated based on the intermediate language at the same time, and any form UI controls are re-developed without changing the protocol of any form UI controls, which meets the customization needs of various scenarios .
  • Fig. 2 is a structural diagram of a form page generating apparatus provided in the second embodiment of the present application.
  • the form page generating device 20 may include multiple functional modules composed of program code segments.
  • the program code of each program segment in the form page generating device 20 may be stored in the memory of the terminal and executed by the at least one processor to perform (see FIG. 1 for details) form page generation.
  • the form page generating device 20 can be divided into multiple functional modules according to the functions it performs.
  • the functional modules may include: a creation module 201, a receiving module 202, an acquisition module 203, a division module 204, a splicing module 205, a generation module 206, a display module 207, and a rendering module 208.
  • the module referred to in this application refers to a series of computer program segments that can be executed by at least one processor and can complete fixed functions, and are stored in a memory. In this embodiment, the function of each module will be described in detail in subsequent embodiments.
  • Creation module 201 used to create a dictionary, where the dictionary carries multiple historical form names.
  • the dictionary refers to a collection of a series of protocol layers corresponding to the form UI controls of multiple historical forms.
  • the dictionary stores the name of each historical form, the form UI control of each historical form, and the form UI.
  • the protocol corresponding to the control and the corresponding protocol layer wherein the protocol includes the control name, protocol content, HTMLElement tag name, attribute, method, interface layer, implementation layer and parameter list of each form UI control.
  • the creation of the dictionary by the creation module 201 includes:
  • each of the form UI control protocol layers is composed of interface layers of multiple form UI controls corresponding to the historical form name ,
  • the interface layer of each form UI control carries a control name corresponding to the form UI control;
  • the multiple historical form names are taken as the first level of the dictionary
  • the interface layers of multiple form UI controls corresponding to each of the historical form names are taken as the second level of the dictionary
  • the protocol corresponding to the interface layers of the multiple form UI controls The layer serves as the third layer of the dictionary, where the dictionary is stored in a blockchain node.
  • each historical form name corresponds to a protocol layer
  • each protocol layer corresponds to the interface layers of multiple form UI controls
  • each interface layer of the form UI controls corresponds to a form UI control
  • each form UI control Corresponding to the control name of the form UI control, the historical form name, the form UI control corresponding to each historical punctuation name, and the protocol layer corresponding to the interface layer of the form UI control are defined as different levels, which improves the access to the form UI control efficient.
  • the above-mentioned dictionary can also be stored in a node of a blockchain.
  • Receiving module 202 used to receive control names of multiple form UI controls of the form to be created input by the user.
  • the form name of the form to be created and the control names of multiple form UI controls corresponding to the form name are input in the browser.
  • the obtaining module 203 is configured to obtain multiple form UI controls corresponding to the control names of the multiple form UI controls from the dictionary.
  • the dictionary stores the form name of each historical form and multiple form UI controls corresponding to the form name of each historical form and the control names of the form UI controls.
  • the form to be created input by the user is received
  • the control names of multiple form UI controls are used, the form UI control corresponding to the control name of each form UI control is obtained from the dictionary.
  • the dividing module 204 is configured to divide each of the form UI controls into an interface layer and an implementation layer, where the interface layer and the implementation layer of each form UI control are structured as an isolation layer.
  • the interface layer refers to the definition of the attributes and behaviors of the form UI control, that is, the internal operation of the form UI control and the external environment are independent of each other in the data processing process, for example, to modify the form UI
  • the internal operation of the control will not affect the external environment of the form UI control
  • the implementation layer refers to the implementation of the protocol content defined by the interface layer of the form UI control to implement internal operations, in order to prevent the implementation layer from Internal details pollute the global environment, and an isolation layer is constructed between the implementation layer and the interface layer.
  • the dividing module 204 dividing each of the form UI controls into an interface layer and an implementation layer includes:
  • CustomElements defined to pass in the custom label to divide each form UI control into an interface layer and an implementation layer.
  • the form UI control is created as HTMLElement (custom) tags that can be natively recognized by the browser, and the customElements.define method is called to pass in the HTMLElement tags and JavaScript Class is used.
  • Implement the practical layer obtained from the interface layer corresponding to each form UI control thereby dividing each form UI control into an interface layer and an implementation layer.
  • the Shadow DOM technology is used An isolation layer is constructed between the interface layer and the implementation layer of each of the form UI controls.
  • each control is divided into an interface layer and an implementation layer to separate configuration and rendering.
  • the configuration is implemented through the interface layer, and the rendering is implemented through the implementation layer, which improves the rendering.
  • the architecture isolation layer is due to the fact that the default operating environment provided by the browser is not isolated.
  • the internal details of the implementation layer can easily pollute the global environment, causing other UI controls to be interfered and unable to work normally.
  • the architecture isolation layer between the interface layers improves the rendering quality.
  • the splicing module 205 is used to splice the protocol content in the interface layer corresponding to each of the form UI controls into an intermediate language.
  • the protocol content in the interface layer corresponding to the form UI control is not conducive to storage and transmission in the form of code.
  • the interface corresponding to each form UI control will be The content of the agreement in the layer is spliced into an intermediate language.
  • the splicing module 205 splicing the protocol content in the interface layer corresponding to each of the form UI controls into an intermediate language includes:
  • the protocol content in the interface layer corresponding to the form UI control is spliced into an intermediate language.
  • the user drags the form UI control list "I”, “Ping”, and “From” to the form canvas, and reads each form UI control according to the drag order of the user, and reads the interface corresponding to the first form UI control.
  • the protocol content of the layer is "I”
  • the protocol content of the interface layer corresponding to the second form UI control is read as “from”
  • the protocol content of the interface layer corresponding to the third form UI control is read as "Peace”
  • the generating module 206 is configured to generate a form UI control with an implementation layer based on each intermediate language.
  • each protocol layer corresponds to multiple implementation layers.
  • a translator, a configuration center, and a registry are designed. The translator, The configuration center and the registry work together in the translation layer.
  • the generation module 206 generates a form UI control with an implementation layer based on each of the intermediate language includes:
  • the first form UI control read from each intermediate language is matched with the second form UI control read from the registry by the configuration center, where ,
  • the first form UI control read from each of the intermediate languages corresponds to an interface layer, and the second form UI control read from the registry by the configuration center corresponds to an implementation Floor;
  • the intermediate language is input to the translator, and the translator requests the corresponding dictionary in the configuration center according to the intermediate language, and in the configuration center Set the dictionary to the active state, then find the form UI control corresponding to the active state dictionary from the registry, return the form UI control to the translator, and the translator reads the corresponding data from each intermediate language.
  • the first form UI control, the first form UI control read from the intermediate language only corresponds to an interface layer
  • the second form UI control read from the registry by the configuration center only corresponds to an implementation layer
  • the first form UI control is matched with the second form UI control
  • the matched first form UI control is associated with the second form UI control to obtain a carrying
  • the interface layer and the form UI control list of the implementation layer are called, the translator is called to read each first form UI control in the list one by one, and the corresponding first form UI control is obtained through the interface layer of each first form UI control.
  • the realization layer of the form UI control is obtained through the interface layer of each first form UI control.
  • the realization layer of the form UI control completes the generation of the form UI control with the realization layer from the intermediate language.
  • the translation layer generates a form UI control with an implementation layer based on the intermediate language.
  • the form UI control contains specific style codes and interactive logic codes.
  • the secondary development of the form UI control can also be performed for each of the form UI controls to switch between different implementation layers, which meets the requirements of various customization scenarios.
  • the display module 207 is used to display the form UI control with the realization layer in the realization layer through the isolation layer.
  • a form UI control protocol layer includes multiple form UI controls, each form UI control corresponds to multiple implementation layers, and each implementation layer is independently presented in the isolation layer.
  • the display module 207 displays the form UI control with the realization layer in the realization layer through the isolation layer, including:
  • the translator obtains the implementation layer information of the rendering version corresponding to the activated state from the configuration center;
  • the realization layer of the form UI control corresponding to the realization layer information is displayed in the realization layer.
  • each form UI control corresponds to multiple implementation layers
  • each implementation layer corresponds to a rendering version
  • obtain multiple rendering versions corresponding to the form UI control with implementation layers and register the multiple rendering versions Go to the registry and set the status to the suspended state; set the specified rendering version status to the active state in the configuration center, so that the "translator" will obtain the implementation of the only active rendering version from the "configuration center” Tier information.
  • the registry, the configuration center, and the translator work together in the translation layer, and are cooperatively responsible for dynamically maintaining the relationship between the different implementation layers of each form UI control, and realize the switching of different implementation layers. Since the isolation layer is constructed between the interface layer and the implementation layer of each form UI control, the implementation layer of each form UI control is independent of each other and does not interfere with each other, avoiding the default operating environment provided by the browser Without isolation, the internal details of the implementation layer can easily pollute the global environment, causing other UI controls to be interfered and unable to work normally.
  • the rendering module 208 is used to render the form UI controls in the implementation layer to generate a form page.
  • the form page is generated by rendering the form UI controls in the implementation layer into different rendering pieces and then connecting them.
  • the rendering module 208 renders the form UI controls in the implementation layer, and generating a form page includes:
  • a form page is generated based on the rendering image.
  • the isolation layer wraps each form UI control into an independent rendering piece, and each rendering piece can be independently and dynamically rendered under certain conditions without affecting other rendering pieces, achieving different rendering results, and improving the browser’s performance.
  • Rendering efficiency reduces the cost of rendering the entire form page.
  • the form page generating device of this embodiment receives the control names of multiple form UI controls of the form to be created input by the user after creating a dictionary; obtains the multiple form UI controls from the dictionary Multiple form UI controls corresponding to the control name of the form; divide each of the form UI controls into an interface layer and an implementation layer, wherein the interface layer and the implementation layer of each form UI control have an architectural isolation layer between the interface layer and the implementation layer; The protocol content in the interface layer corresponding to each of the form UI controls is spliced into an intermediate language; a form UI control with an implementation layer is generated based on each intermediate language; the implementation layer is displayed in the implementation layer through the isolation layer Form UI controls; render the form UI controls in the implementation layer to generate a form page.
  • This embodiment separates the configuration and rendering of the form UI control by dividing the form UI control into an interface layer and an implementation layer, thereby providing a technical basis for custom development, and setting up an isolation layer to make the implementation layer of each control They are independent of each other and do not interfere with each other.
  • the purpose of different rendering results is achieved by switching the realization layer, and the rendering efficiency of the browser is improved; finally, the protocol content in the interface layer corresponding to the form UI control is translated into an intermediate language, which is convenient for later use Among different technical languages, form UI controls with implementation layers are generated based on the intermediate language at the same time, and any form UI controls are re-developed without changing the protocol of any form UI controls, which meets the customization needs of various scenarios .
  • the terminal 3 includes a memory 31, at least one processor 32, at least one communication bus 33, and a transceiver 34.
  • the structure of the terminal shown in FIG. 3 does not constitute a limitation of the embodiment of the present application. It may be a bus-type structure or a star structure. The terminal 3 may also include more More or less other hardware or software, or different component arrangements.
  • the terminal 3 is a terminal that can automatically perform numerical calculation and/or information processing in accordance with pre-set or stored instructions.
  • Its hardware includes, but is not limited to, a microprocessor, an application specific integrated circuit, and Programming gate arrays, digital processors and embedded devices, etc.
  • the terminal 3 may also include client equipment.
  • the client equipment includes, but is not limited to, any electronic product that can interact with the client through a keyboard, a mouse, a remote control, a touch panel, or a voice control device, for example, a personal computer. Computers, tablets, smart phones, digital cameras, etc.
  • terminal 3 is only an example, and other existing or future electronic products that can be adapted to this application should also be included in the scope of protection of this application and included here by reference.
  • the memory 31 is used to store program codes and various data, such as the form page generating device 20 installed in the terminal 3, and realize the high-speed and automatic completion of the program during the operation of the terminal 3 Or data access.
  • the memory 31 includes random access memory (Ramdom Access Memory, RAM), read-only memory (Read-Only Memory, ROM), programmable read-only memory (Programmable Read-Only Memory, PROM), and erasable programmable read-only memory (Erasable Programmable Read-Only Memory, EPROM), One-time Programmable Read-Only Memory (OTPROM), Electronically-Erasable Programmable Read-Only Memory, EEPROM ), CD-ROM (Compact Disc Read-Only Memory) or other optical disk storage, magnetic disk storage, tape storage, or any other computer-readable medium that can be used to carry or store data.
  • the at least one processor 32 may be composed of integrated circuits, for example, may be composed of a single packaged integrated circuit, or may be composed of multiple integrated circuits with the same function or different functions, including one Or a combination of multiple central processing units (CPU), microprocessors, digital processing chips, graphics processors, and various control chips.
  • the at least one processor 32 is the control core (Control Unit) of the terminal 3.
  • Various interfaces and lines are used to connect the various components of the entire terminal 3, and by running or executing programs or modules stored in the memory 31, And call the data stored in the memory 31 to execute various functions of the terminal 3 and process data.
  • the at least one communication bus 33 is configured to implement connection and communication between the memory 31 and the at least one processor 32 and the like.
  • the terminal 3 may also include a power source (such as a battery) for supplying power to various components.
  • the power source may be logically connected to the at least one processor 32 through a power management device, so as to realize management through the power management device. Functions such as charging, discharging, and power management.
  • the power supply may also include any components such as one or more DC or AC power supplies, recharging devices, power failure detection circuits, power converters or inverters, and power status indicators.
  • the terminal 3 may also include various sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.
  • the above-mentioned integrated unit implemented in the form of a software function module may be stored in a computer readable storage medium.
  • the above-mentioned software function module is stored in a storage medium and includes several instructions to make a computer device (which may be a personal computer, a terminal, or a network device, etc.) or a processor execute the method described in each embodiment of the present application. part.
  • the at least one processor 32 can execute the operating device of the terminal 3 and various installed applications (such as the form page generating device 20), Program code, etc., for example, the above-mentioned modules.
  • the memory 31 stores program codes, and the at least one processor 32 can call the program codes stored in the memory 31 to perform related functions.
  • the various modules described in FIG. 2 are program codes stored in the memory 31 and executed by the at least one processor 32, so as to realize the functions of the various modules to achieve the purpose of generating a form page.
  • the memory 31 stores a plurality of instructions, and the plurality of instructions are executed by the at least one processor 32 to realize the generation of a form page.
  • the disclosed device and method may be implemented in other ways.
  • the device embodiments described above are merely illustrative.
  • the division of the modules is only a logical function division, and there may be other division methods in actual implementation.
  • the computer-readable storage medium may be non-volatile or volatile.
  • the computer-readable storage medium may mainly include a storage program area and a storage data area, where the storage program area may store an operating system, an application program required by at least one function, etc.; the storage data area may store Data created by the use of nodes, etc.
  • the blockchain referred to in this application is a new application mode of computer technology such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm.
  • Blockchain essentially a decentralized database, is a series of data blocks associated with cryptographic methods. Each data block contains a batch of network transaction information for verification. The validity of the information (anti-counterfeiting) and the generation of the next block.
  • the blockchain can include the underlying platform of the blockchain, the platform product service layer, and the application service layer.
  • modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
  • the functional modules in the various embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated unit may be implemented in the form of hardware, or may be implemented in the form of hardware plus software functional modules.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Human Computer Interaction (AREA)
  • Data Mining & Analysis (AREA)
  • User Interface Of Digital Computer (AREA)
  • Stored Programmes (AREA)

Abstract

A form page generation method and device, a terminal, and a storage medium, relating to data processing technologies. The method comprises: creating a dictionary, the dictionary carrying a plurality of historical form names (S11); receiving control names of a plurality of form UI controls of a form to be created input by a user (S12); obtaining a plurality of form UI controls corresponding to the control names of the plurality of form UI controls from the dictionary (S13); dividing each form UI control into an interface layer and an implementation layer, wherein an isolation layer is constructed between the interface layer and the implementation layer of each form UI control (S14); splicing protocol content in the interface layer corresponding to each form UI control into an intermediate language (S15); generating a form UI control having an implementation layer on the basis of each intermediate language (S16); displaying the form UI control having the implementation layer in the implementation layer by means of the isolation layer (S17); and rendering the form UI control in the implementation layer to generate a form page (S18). According to the method, the interface layer and the implementation layer are separated by means of the technology of the form UI control, so that configuration and rendering of the control are separated, the rendering efficiency of a browser is improved, and customization requirements for various scenes are met. In addition, the method further relates to the technical field of blockchain, and the dictionary is stored in a blockchain node.

Description

表单页面生成方法、装置、终端及存储介质Form page generation method, device, terminal and storage medium
本申请要求于2020年04月23日提交中国专利局,申请号为202010328627.5发明名称为“表单页面生成方法、装置、终端及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of a Chinese patent application filed with the Chinese Patent Office on April 23, 2020. The application number is 202010328627.5 and the invention title is "Method, Device, Terminal, and Storage Medium for Form Page Generation". The entire content is incorporated by reference. In this application.
技术领域Technical field
本申请涉及计算机技术领域,具体涉及一种表单页面生成方法、装置、终端及存储介质。This application relates to the field of computer technology, in particular to a method, device, terminal and storage medium for generating a form page.
背景技术Background technique
表单是用户向系统提交信息的交互方式之一,它几乎承担了网站的信息录入工作。随着信息化建设的日益发展,数据的多样性愈加明显,也使得表单UI开发工作量日渐增多,因而基于可视化操作界面的表单设计器不仅简化了表单UI开发的开发工作,而且降低了表单开发的门槛,使得非开发领域的业务人员也能依照业务需求自行设计可交互的表单UI并发布到系统上,从而降低了开发成本,提高了表单的交付效率。The form is one of the interactive ways for users to submit information to the system. It almost takes on the information entry work of the website. With the increasing development of information construction, the diversity of data has become more obvious, and the workload of form UI development is increasing. Therefore, the form designer based on the visual operation interface not only simplifies the development of form UI development, but also reduces the development of form The threshold allows non-development business personnel to design interactive form UI and publish it to the system according to business needs, thereby reducing development costs and improving the delivery efficiency of forms.
然而,发明人发现市面上的表单设计器仅提供了单一的技术栈,使得生成的表单页面只能运行于特定技术栈的系统,往往生成的表单页面也只能发布到指定的第三方系统。这不仅限制了表单的二次开发以满足更多定制场景,也加大了与现有系统的技术集成难度;另一方面,把表单托管在第三方系统是不利于系统的信息安全。因此,这类表单设计器生成的表单页面只能解决简单的表单需求,承担简单的信息录入工作,不利于对其定制开发和动态渲染。However, the inventor found that the form designer on the market only provides a single technology stack, so that the generated form pages can only run on systems with a specific technology stack, and the generated form pages can only be published to designated third-party systems. This not only restricts the secondary development of the form to meet more customized scenarios, but also increases the difficulty of technical integration with the existing system; on the other hand, hosting the form in a third-party system is not conducive to the information security of the system. Therefore, the form page generated by this type of form designer can only solve simple form requirements and undertake simple information entry work, which is not conducive to its custom development and dynamic rendering.
发明内容Summary of the invention
鉴于以上内容,有必要提出一种表单页面生成方法、装置、终端及存储介质,通过把表单UI控件的技术实现分离出接口层与实现层,从而分离了控件的配置和渲染,提高浏览器的渲染效率,满足了各种场景的定制需求。In view of the above, it is necessary to propose a form page generation method, device, terminal and storage medium. By separating the technical realization of form UI controls into the interface layer and the implementation layer, the configuration and rendering of the controls are separated and the browser’s performance is improved. The rendering efficiency meets the customization needs of various scenes.
本申请的第一方面提供一种表单页面生成方法,所述方法包括:The first aspect of the present application provides a method for generating a form page, and the method includes:
创建字典,其中所述字典携带有多个历史表单名称;Create a dictionary, where the dictionary carries multiple historical form names;
接收用户输入的待创建表单的多个表单UI控件的控件名称;Receive the control names of multiple form UI controls of the form to be created input by the user;
从所述字典中获取所述多个表单UI控件的控件名称对应的多个表单UI控件;Acquiring, from the dictionary, multiple form UI controls corresponding to the control names of the multiple form UI controls;
将每个所述表单UI控件划分为接口层和实现层,其中,每个所述表单UI控件的接口层和实现层之间架构隔离层;Divide each of the form UI controls into an interface layer and an implementation layer, where an architectural isolation layer is between the interface layer and the implementation layer of each of the form UI controls;
将每个所述表单UI控件对应的接口层中的协议内容拼接成中间语言;Splicing the protocol content in the interface layer corresponding to each of the form UI controls into an intermediate language;
基于每个所述中间语言生成具有实现层的表单UI控件;Generating a form UI control with an implementation layer based on each of the intermediate languages;
通过所述隔离层在所述实现层中展现具有实现层的表单UI控件;Displaying a form UI control with an implementation layer in the implementation layer through the isolation layer;
对所述实现层中的表单UI控件进行渲染,生成表单页面。Rendering the form UI controls in the implementation layer to generate a form page.
本申请的第二方面提供一种终端,所述终端包括存储器及处理器,所述存储器用于存储至少一个计算机可读指令,所述处理器用于执行所述至少一个计算机可读指令以实现以下步骤:A second aspect of the present application provides a terminal, the terminal includes a memory and a processor, the memory is configured to store at least one computer-readable instruction, and the processor is configured to execute the at least one computer-readable instruction to implement the following step:
创建字典,其中所述字典携带有多个历史表单名称;Create a dictionary, where the dictionary carries multiple historical form names;
接收用户输入的待创建表单的多个表单UI控件的控件名称;Receive the control names of multiple form UI controls of the form to be created input by the user;
从所述字典中获取所述多个表单UI控件的控件名称对应的多个表单UI控件;Acquiring, from the dictionary, multiple form UI controls corresponding to the control names of the multiple form UI controls;
将每个所述表单UI控件划分为接口层和实现层,其中,每个所述表单UI控件的接口层和实现层之间架构隔离层;Divide each of the form UI controls into an interface layer and an implementation layer, where an architectural isolation layer is between the interface layer and the implementation layer of each of the form UI controls;
将每个所述表单UI控件对应的接口层中的协议内容拼接成中间语言;Splicing the protocol content in the interface layer corresponding to each of the form UI controls into an intermediate language;
基于每个所述中间语言生成具有实现层的表单UI控件;Generating a form UI control with an implementation layer based on each of the intermediate languages;
通过所述隔离层在所述实现层中展现具有实现层的表单UI控件;Displaying a form UI control with an implementation layer in the implementation layer through the isolation layer;
对所述实现层中的表单UI控件进行渲染,生成表单页面。Rendering the form UI controls in the implementation layer to generate a form page.
本申请的第三方面提供一种计算机可读存储介质,所述计算机可读存储介质存储有至少一个计算机可读指令,所述至少一个计算机可读指令被处理器执行时以实现以下步骤:A third aspect of the present application provides a computer-readable storage medium that stores at least one computer-readable instruction, and when the at least one computer-readable instruction is executed by a processor, the following steps are implemented:
创建字典,其中所述字典携带有多个历史表单名称;Create a dictionary, where the dictionary carries multiple historical form names;
接收用户输入的待创建表单的多个表单UI控件的控件名称;Receive the control names of multiple form UI controls of the form to be created input by the user;
从所述字典中获取所述多个表单UI控件的控件名称对应的多个表单UI控件;Acquiring, from the dictionary, multiple form UI controls corresponding to the control names of the multiple form UI controls;
将每个所述表单UI控件划分为接口层和实现层,其中,每个所述表单UI控件的接口层和实现层之间架构隔离层;Divide each of the form UI controls into an interface layer and an implementation layer, where an architectural isolation layer is between the interface layer and the implementation layer of each of the form UI controls;
将每个所述表单UI控件对应的接口层中的协议内容拼接成中间语言;Splicing the protocol content in the interface layer corresponding to each of the form UI controls into an intermediate language;
基于每个所述中间语言生成具有实现层的表单UI控件;Generating a form UI control with an implementation layer based on each of the intermediate languages;
通过所述隔离层在所述实现层中展现具有实现层的表单UI控件;Displaying a form UI control with an implementation layer in the implementation layer through the isolation layer;
对所述实现层中的表单UI控件进行渲染,生成表单页面。Rendering the form UI controls in the implementation layer to generate a form page.
本申请的第四方面提供一种表单页面生成装置,所述装置包括:A fourth aspect of the present application provides a form page generating device, the device including:
创建模块,用于创建字典,其中所述字典携带有多个历史表单名称;The creation module is used to create a dictionary, where the dictionary carries multiple historical form names;
接收模块,用于接收用户输入的待创建表单的多个表单UI控件的控件名称;The receiving module is used to receive the control names of multiple form UI controls of the form to be created input by the user;
获取模块,用于从所述字典中获取所述多个表单UI控件的控件名称对应的多个表单UI控件;An obtaining module, configured to obtain multiple form UI controls corresponding to the control names of the multiple form UI controls from the dictionary;
划分模块,用于将每个所述表单UI控件划分为接口层和实现层,其中,每个所述表单UI控件的接口层和实现层之间架构隔离层;The dividing module is used to divide each of the form UI controls into an interface layer and an implementation layer, where the interface layer and the implementation layer of each form UI control are an architectural isolation layer;
拼接模块,用于将每个所述表单UI控件对应的接口层中的协议内容拼接成中间语言;The splicing module is used to splice the protocol content in the interface layer corresponding to each of the form UI controls into an intermediate language;
生成模块,用于基于每个所述中间语言生成具有实现层的表单UI控件;A generating module for generating a form UI control with an implementation layer based on each of the intermediate languages;
展现模块,用于通过所述隔离层在所述实现层中展现具有实现层的表单UI控件;A display module, configured to display a form UI control with an implementation layer in the implementation layer through the isolation layer;
渲染模块,用于对所述实现层中的表单UI控件进行渲染,生成表单页面。The rendering module is used to render the form UI controls in the implementation layer to generate a form page.
综上所述,本申请所述的表单页面生成方法、装置、终端及存储介质,可应用于智慧城市建设中的智慧政务、智慧法律、智慧社区、智慧财政、智慧生活等领域,推动智慧城市建设的发展。本申请一方面通过将表单UI控件划分为接口层与实现层,从而分离了表单UI控件的配置和渲染,为定制开发提供了技术基础,又通过架设隔离层,使得每个控件的实现层彼此独立、互不干扰,通过切换实现层实现不同渲染结果的目的,提高浏览器的渲染效率;最后,将所述表单UI控件对应的接口层中的协议内容翻译成中间语言,便于后期运用在不同的技术语言中,同时基于所述中间语言生成具有实现层的表单UI控件,在不改变任意表单UI控件协议的条件下对任意表单UI控件进行二次开发,满足了各种场景的定制需求。In summary, the form page generation method, device, terminal and storage medium described in this application can be applied to the fields of smart government affairs, smart law, smart community, smart finance, smart life, etc. in the construction of smart cities to promote smart cities Construction development. This application, on the one hand, separates the configuration and rendering of the form UI control by dividing the form UI control into an interface layer and an implementation layer, thereby providing a technical foundation for custom development. It also sets up an isolation layer to make the implementation layer of each control mutually exclusive. Independent and non-interference, the purpose of different rendering results can be achieved by switching the implementation layer, and the rendering efficiency of the browser can be improved; finally, the protocol content in the interface layer corresponding to the form UI control is translated into an intermediate language, which is convenient for later use in different In the technical language of, at the same time, a form UI control with an implementation layer is generated based on the intermediate language, and any form UI control is re-developed without changing any form UI control protocol, which meets the customization requirements of various scenarios.
附图说明Description of the drawings
图1是本申请实施例一提供的表单页面生成方法的流程图。FIG. 1 is a flowchart of a method for generating a form page provided by Embodiment 1 of the present application.
图2是本申请实施例二提供的表单页面生成装置的结构图。Fig. 2 is a structural diagram of a form page generating apparatus provided in the second embodiment of the present application.
图3是本申请实施例三提供的终端的结构示意图。FIG. 3 is a schematic structural diagram of a terminal provided in Embodiment 3 of the present application.
具体实施方式Detailed ways
为了能够更清楚地理解本申请的上述目的、特征和优点,下面结合附图和具体实施例对本申请进行详细描述。需要说明的是,在不冲突的情况下,本申请的实施例及实施例中的特征可以相互组合。In order to be able to understand the above objectives, features and advantages of the application more clearly, the application will be described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted that the embodiments of the application and the features in the embodiments can be combined with each other if there is no conflict.
除非另有定义,本文所使用的所有的技术和科学术语与属于本申请的技术领域的技术人员通常理解的含义相同。本文中在本申请的说明书中所使用的术语只是为了描述具体的实施例的目的,不是旨在于限制本申请。Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the technical field of this application. The terms used in the specification of the application herein are only for the purpose of describing specific embodiments, and are not intended to limit the application.
实施例一Example one
图1是本申请实施例一提供的表单页面生成方法的流程图。FIG. 1 is a flowchart of a method for generating a form page provided by Embodiment 1 of the present application.
在本实施例中,所述表单页面生成方法可以应用于终端中,对于需要进行表单页面生成的终端,可以直接在终端上集成本申请的方法所提供的表单页面生成的功能,或者以软件开发工具包(Software Development Kit,SKD)的形式运行在终端中。In this embodiment, the method for generating a form page can be applied to a terminal. For a terminal that needs to generate a form page, the function of generating the form page provided by the method of this application can be directly integrated on the terminal, or developed by software The tool kit (Software Development Kit, SKD) runs in the terminal.
如图1所示,所述表单页面生成方法具体包括以下步骤,根据不同的需求,该流程图中步骤的顺序可以改变,某些可以省略。As shown in FIG. 1, the method for generating a form page specifically includes the following steps. According to different requirements, the order of the steps in the flowchart can be changed, and some of the steps can be omitted.
S11:创建字典,其中所述字典携带有多个历史表单名称。S11: Create a dictionary, where the dictionary carries multiple historical form names.
本实施例中,所述字典是指多个历史表单的表单UI控件对应的一系列协议层的集合,所述字典中存储了每个历史表单名称、每个历史表单的表单UI控件、表单UI控件对应的协议及对应的协议层,其中,所述协议包括每个表单UI控件的控件名称、协议内容、HTMLElement标签名称、属性、方法、接口层、实现层及其参数列表。In this embodiment, the dictionary refers to a collection of a series of protocol layers corresponding to the form UI controls of multiple historical forms. The dictionary stores the name of each historical form, the form UI control of each historical form, and the form UI. The protocol corresponding to the control and the corresponding protocol layer, wherein the protocol includes the control name, protocol content, HTMLElement tag name, attribute, method, interface layer, implementation layer and parameter list of each form UI control.
优选的,所述创建字典包括:Preferably, the creating dictionary includes:
获取所述多个历史表单名称及每个历史表单名称对应的表单UI控件协议层,每个所述表单UI控件协议层是由所述历史表单名称对应的多个表单UI控件的接口层组成的,每个所述表单UI控件的接口层携带有对应表单UI控件的控件名称;Acquire the multiple historical form names and the form UI control protocol layer corresponding to each historical form name, each of the form UI control protocol layers is composed of interface layers of multiple form UI controls corresponding to the historical form name , The interface layer of each form UI control carries a control name corresponding to the form UI control;
将所述多个历史表单名称作为字典的第一层级,每个所述历史表单名称对应的多个表单UI控件的接口层作为字典的第二层级,多个表单UI控件的接口层对应的协议层作为字典的第三层级,其中,所述字典存储于区块链节点中。The multiple historical form names are taken as the first level of the dictionary, the interface layers of multiple form UI controls corresponding to each of the historical form names are taken as the second level of the dictionary, and the protocol corresponding to the interface layers of the multiple form UI controls The layer serves as the third layer of the dictionary, where the dictionary is stored in a blockchain node.
本实施例中,每个历史表单名称对应一个协议层,每个协议层对应多个表单UI控件的接口层,每个所述表单UI控件的接口层对应一个表单UI控件,每个表单UI控件对应有表单UI控件的控件名称,将所述历史表单名称、每个历史标点名称对应的表单UI控件及表单UI控件的接口层对应的协议层定义为不同的层级,提高了获取表单UI控件的效率。In this embodiment, each historical form name corresponds to a protocol layer, each protocol layer corresponds to the interface layers of multiple form UI controls, and each interface layer of the form UI controls corresponds to a form UI control, and each form UI control Corresponding to the control name of the form UI control, the historical form name, the form UI control corresponding to each historical punctuation name, and the protocol layer corresponding to the interface layer of the form UI control are defined as different levels, which improves the access to the form UI control efficient.
需要强调的是,为进一步保证上述字典的私密和安全性,上述字典还可以存储于一区块链的节点中。It should be emphasized that, in order to further ensure the privacy and security of the above dictionary, the above dictionary can also be stored in a node of a blockchain.
S12:接收用户输入的待创建表单的多个表单UI控件的控件名称。S12: Receive control names of multiple form UI controls of the form to be created input by the user.
本实施例中,当用户需要制作表单时,在浏览器中输入待创建表单的表单名称及所述表单名称对应的多个表单UI控件的控件名称。In this embodiment, when the user needs to create a form, the form name of the form to be created and the control names of multiple form UI controls corresponding to the form name are input in the browser.
S13:从所述字典中获取所述多个表单UI控件的控件名称对应的多个表单UI控件。S13: Obtain multiple form UI controls corresponding to the control names of the multiple form UI controls from the dictionary.
本实施例中,所述字典中存储有每个历史表单的表单名称及每个历史表单的表单名称对应的多个表单UI控件及表单UI控件的控件名称,当接收到用户输入的待创建表单的多个表单UI控件的控件名称时,从所述字典中获取每个所述表单UI控件的控件名称对应的表单UI控件。In this embodiment, the dictionary stores the form name of each historical form and multiple form UI controls corresponding to the form name of each historical form and the control names of the form UI controls. When the form to be created input by the user is received When the control names of multiple form UI controls are used, the form UI control corresponding to the control name of each form UI control is obtained from the dictionary.
S14:将每个所述表单UI控件划分为接口层和实现层,其中,每个所述表单UI控件的接口层和实现层之间架构隔离层。S14: Divide each form UI control into an interface layer and an implementation layer, where an isolation layer is structured between the interface layer and the implementation layer of each form UI control.
本实施例中,所述接口层是指定义所述表单UI控件的属性和行为,就是将所述表单UI控件的内部操作和外部环境在数据处理过程中相互独立,例如,修改所述表单UI控件的内部操作的时候不会影响到所述表单UI控件的外部环境;所述实现层是指执行所述表单UI控件 的接口层定义的协议内容来实现内部操作,为了防止所述实现层的内部细节污染到全局环境,在将所述实现层和所述接口层之间架构隔离层。In this embodiment, the interface layer refers to the definition of the attributes and behaviors of the form UI control, that is, the internal operation of the form UI control and the external environment are independent of each other in the data processing process, for example, to modify the form UI The internal operation of the control will not affect the external environment of the form UI control; the implementation layer refers to the implementation of the protocol content defined by the interface layer of the form UI control to implement internal operations, in order to prevent the implementation layer from Internal details pollute the global environment, and an isolation layer is constructed between the implementation layer and the interface layer.
优选的,所述将每个所述表单UI控件划分为接口层和实现层包括:Preferably, the dividing each of the form UI controls into an interface layer and an implementation layer includes:
将每个所述表单UI控件创建为浏览器能够原生识别的自定义标签;Creating each of the form UI controls as a custom label that can be natively recognized by the browser;
调用CustomElements.define传入所述自定义标签将每个所述表单UI控件划分为接口层和实现层。Call CustomElements.define to pass in the custom label to divide each form UI control into an interface layer and an implementation layer.
本实施例中,通过采用Web Components技术中的Custom Elements技术,把表单UI控件创建为浏览器能够原生识别的HTMLElement(自定义)标签,调用customElements.define方法传入所述HTMLElement标签以及使用JavaScript Class实现每个表单UI控件对应的接口层得到的实用层,从而把每个表单UI控件分为接口层和实现层,当将所述表单UI控件分为接口层和实现层之后,采用Shadow DOM技术在每个所述表单UI控件的接口层和实现层之间架构隔离层。In this embodiment, by using the Custom Elements technology in Web Components technology, the form UI control is created as HTMLElement (custom) tags that can be natively recognized by the browser, and the customElements.define method is called to pass in the HTMLElement tags and JavaScript Class is used. Implement the practical layer obtained from the interface layer corresponding to each form UI control, thereby dividing each form UI control into an interface layer and an implementation layer. After dividing the form UI control into an interface layer and an implementation layer, the Shadow DOM technology is used An isolation layer is constructed between the interface layer and the implementation layer of each of the form UI controls.
本实施例中,通过将每个控件分为接口层和实现层,是为了将配置和渲染分开,其中,所述配置通过接口层进行实现,所述渲染通过实现层中进行实现,提高了渲染效率,架构隔离层是由于浏览器提供的默认运行环境没有隔离性,实现层的内部细节很容易污染到全局环境,导致其他的UI控件受到干扰而无法正常工作,而在所述实现层和所述接口层之间架构隔离层提高了渲染质量。In this embodiment, each control is divided into an interface layer and an implementation layer to separate configuration and rendering. The configuration is implemented through the interface layer, and the rendering is implemented through the implementation layer, which improves the rendering. Efficiency, the architecture isolation layer is due to the fact that the default operating environment provided by the browser is not isolated. The internal details of the implementation layer can easily pollute the global environment, causing other UI controls to be interfered and unable to work normally. The architecture isolation layer between the interface layers improves the rendering quality.
S15:将每个所述表单UI控件对应的接口层中的协议内容拼接成中间语言。S15: Splice the protocol content in the interface layer corresponding to each of the form UI controls into an intermediate language.
本实施例中,所述表单UI控件对应的接口层中的协议内容以代码的形式既不利于保存,又不利于传输,为了方便存储和传输,将将每个所述表单UI控件对应的接口层中的协议内容拼接成中间语言。In this embodiment, the protocol content in the interface layer corresponding to the form UI control is not conducive to storage and transmission in the form of code. In order to facilitate storage and transmission, the interface corresponding to each form UI control will be The content of the agreement in the layer is spliced into an intermediate language.
优选的,所述将每个所述表单UI控件对应的接口层中的协议内容拼接成中间语言包括:Preferably, the splicing the protocol content in the interface layer corresponding to each of the form UI controls into an intermediate language includes:
接收表单画布中用户拖曳的表单UI控件;Receive the form UI controls dragged by the user in the form canvas;
根据所述用户拖曳的顺序读取所述表单画布中的表单UI控件;Read the form UI controls in the form canvas according to the drag order of the user;
每读取到一个表单UI控件,将所述表单UI控件对应的接口层中的协议内容拼接成中间语言。Each time a form UI control is read, the protocol content in the interface layer corresponding to the form UI control is spliced into an intermediate language.
示例性的,用户将表单UI控件列表“我”“平安”“来自”拖曳到表单画布中,根据用户拖曳的顺序读取每个表单UI控件,读取的第一个表单UI控件对应的接口层的协议内容为“我”,读取的第二个表单UI控件对应的接口层的协议内容为“来自”,读取的第三个表单UI控件对应的接口层的协议内容为“平安”,按照读取的先后顺序将每个所述表单UI控件对应的接口层中的协议内容拼接成中间语言“我来自平安”。Exemplarily, the user drags the form UI control list "I", "Ping", and "From" to the form canvas, and reads each form UI control according to the drag order of the user, and reads the interface corresponding to the first form UI control. The protocol content of the layer is "I", the protocol content of the interface layer corresponding to the second form UI control is read as "from", and the protocol content of the interface layer corresponding to the third form UI control is read as "Peace" , Splicing the protocol content in the interface layer corresponding to each of the form UI controls into the intermediate language "I come from Ping An" in the order of reading.
S16:基于每个所述中间语言生成具有实现层的表单UI控件。S16: Generate a form UI control with an implementation layer based on each of the intermediate languages.
本实施例中,在生成具有实现层的表单UI控件的过程中,每个协议层对应多个实现层,为了达到定制的目的,设计了翻译器、配置中心和注册表,所述翻译器、配置中心和注册表协同作用在翻译层。In this embodiment, in the process of generating a form UI control with an implementation layer, each protocol layer corresponds to multiple implementation layers. In order to achieve the purpose of customization, a translator, a configuration center, and a registry are designed. The translator, The configuration center and the registry work together in the translation layer.
优选的,所述基于每个所述中间语言生成具有实现层的表单UI控件包括:Preferably, the generating a form UI control with an implementation layer based on each of the intermediate languages includes:
将每个所述中间语言输入到翻译器中;Input each of the intermediate languages into the translator;
调用所述翻译器从配置中心请求所述中间语言对应的字典并将所述字典设置为激活状态;Calling the translator to request the dictionary corresponding to the intermediate language from the configuration center and setting the dictionary to an active state;
调用所述配置中心从注册表中读取处于激活状态的字典对应的表单UI控件;Calling the configuration center to read the form UI control corresponding to the dictionary in the active state from the registry;
返回所述表单UI控件至所述翻译器;Return the form UI control to the translator;
调用所述翻译器根据所述表单UI控件从每个所述中间语言中读取对应的表单UI控件的控件信息,其中,所述表单UI控件的控件信息对应有控件名称;Calling the translator to read the control information of the corresponding form UI control from each of the intermediate languages according to the form UI control, wherein the control information of the form UI control corresponds to the control name;
基于所述表单UI控件的控件名称将从每个所述中间语言读取到的第一表单UI控件与所述配置中心从所述注册表中读取到的第二表单UI控件进行匹配,其中,所述从每个所述中间语言读取到的所述第一表单UI控件对应有接口层,所述配置中心从所述注册表中读取到的所 述第二表单UI控件对应有实现层;Based on the control name of the form UI control, the first form UI control read from each intermediate language is matched with the second form UI control read from the registry by the configuration center, where , The first form UI control read from each of the intermediate languages corresponds to an interface layer, and the second form UI control read from the registry by the configuration center corresponds to an implementation Floor;
关联相匹配的所述第一表单UI控件的接口层和所述第二表单UI控件的实现层,得到一个对应有接口层和实现层的表单UI控件列表;Associating the matching interface layer of the first form UI control and the implementation layer of the second form UI control to obtain a form UI control list corresponding to the interface layer and the implementation layer;
调用所述翻译器读取所述表单UI控件列表中每个所述第二表单UI控件生成具有实现层的表单UI控件。Invoking the translator to read each second form UI control in the form UI control list to generate a form UI control with an implementation layer.
本实施例中,为了将每个所述中间语言生成具有实现层的表单UI控件,将中间语言输入到翻译器,翻译器在配置中心中根据所述中间语言请求对应的字典,在配置中心中将所述字典设置为激活状态,然后从注册表中查找到所述激活状态字典对应的表单UI控件,返回所述表单UI控件至翻译器,翻译器从每个所述中间语言读取对应所述第一表单UI控件,从所述中间语言读取的所述第一表单UI控件只对应有接口层,所述配置中心从所述注册表中读取到的所述第二表单UI控件只对应有实现层,将所述第一表单UI控件与所述第二表单UI控件进行匹配,将匹配后的所述第一表单UI控件与所述第二表单UI控件进行关联,得到一个携带有接口层和实现层的表单UI控件列表,调用翻译器逐条读取所述列表中的每个所述第一表单UI控件,通过每个所述第一表单UI控件的接口层获取对应所述第二表单UI控件的实现层,最终,所述翻译器完成从中间语言生成具有实现层的表单UI控件。In this embodiment, in order to generate a form UI control with an implementation layer for each intermediate language, the intermediate language is input to the translator, and the translator requests the corresponding dictionary in the configuration center according to the intermediate language, and in the configuration center Set the dictionary to the active state, then find the form UI control corresponding to the active state dictionary from the registry, return the form UI control to the translator, and the translator reads the corresponding data from each intermediate language. The first form UI control, the first form UI control read from the intermediate language only corresponds to an interface layer, and the second form UI control read from the registry by the configuration center only Corresponding to an implementation layer, the first form UI control is matched with the second form UI control, and the matched first form UI control is associated with the second form UI control to obtain a carrying The interface layer and the form UI control list of the implementation layer are called, the translator is called to read each first form UI control in the list one by one, and the corresponding first form UI control is obtained through the interface layer of each first form UI control. Second, the realization layer of the form UI control. Finally, the translator completes the generation of the form UI control with the realization layer from the intermediate language.
示例性的,将所述中间语言:“我来自平安”,输入到翻译器,调用所述翻译器从所述配置中心中请求所述中间语言对应的字典并设置为激活状态,调用所述配置中心从所述注册表中读取所述字典对应的表单UI控件的控件名称:“我”“来自”“平安”,将“我”“来自”“平安”返回给翻译器,调用翻译器根据“我”“来自”“平安”将从所述中间语言读取到的第一表单UI控件“我”“来自”“平安”,所述配置中心从所述注册表中读取到的第二表单UI控件“I”、“come from”、“PingAn”,将所述第一表单UI控件与所述第二表单UI控件进行匹配得到“我”与“I”对应、“来自”与“come from”对应、“平安”与“PingAn”对应的表单UI控件列表,调用所述翻译器读取所述第二表单UI控件“I”、“come from”、“PingAn”生成具有英语实现层的表单控件,例如:所述中间语言“我”对应的具有英语实现层的表单控件为“I”,所述中间语言“来自”对应的具有英语实现层的表单控件为“come here”,所述中间语言“平安”对应的具有英语实现层的表单控件为“PingAn”。Exemplarily, input the intermediate language: "I come from Ping An" into the translator, call the translator to request the dictionary corresponding to the intermediate language from the configuration center and set it to the active state, and call the configuration The center reads the control name of the form UI control corresponding to the dictionary from the registration table: "I", "From" and "Ping An", returning "I", "From" and "Ping An" to the translator, and calling the translator according to "I", "From" and "Ping An" read the first form UI control "I", "From" and "Ping An" from the intermediate language. The configuration center reads the second form from the registry. Form UI controls "I", "come from", "PingAn", match the first form UI control with the second form UI control to obtain the correspondence between "I" and "I", and "from" and "come" The form UI control list corresponding to "from", "Ping An" and "PingAn" is called, and the translator is called to read the second form UI controls "I", "come from", and "PingAn" to generate an English implementation layer Form controls, for example: the form control with English implementation level corresponding to the intermediate language "I" is "I", and the form control with English implementation level corresponding to the intermediate language "from" is "come here", the The form control with English implementation layer corresponding to the intermediate language "Ping An" is "PingAn".
本实施例中,翻译层基于所述中间语言生成具有实现层的表单UI控件,所述表单UI控件中包含了具体的样式代码和交互逻辑代码,开发人员可以在所述翻译层对每个所述表单UI控件进行二次开发,也可以对每个所述表单UI控件进行不同实现层切换,满足了各种定制场景的需求,推动智慧城市建设的发展,可应用于智慧城市建设中的智慧政务、智慧法律、智慧社区、智慧财政、智慧生活等领域。In this embodiment, the translation layer generates a form UI control with an implementation layer based on the intermediate language. The form UI control contains specific style codes and interactive logic codes. The secondary development of the form UI controls can also be implemented for each of the form UI controls to switch between different implementation layers, which meets the needs of various customized scenarios, promotes the development of smart city construction, and can be applied to the wisdom of smart city construction. Government affairs, smart law, smart community, smart finance, smart life and other fields.
S17:通过所述隔离层在所述实现层中展现具有实现层的表单UI控件。S17: Display a form UI control with an implementation layer in the implementation layer through the isolation layer.
本实施例中,一个表单UI控件协议层包括多个表单UI控件,每个表单UI控件对应多个实现层,每个实现层在所述隔离层中独立展现。In this embodiment, a form UI control protocol layer includes multiple form UI controls, each form UI control corresponds to multiple implementation layers, and each implementation layer is independently presented in the isolation layer.
优选的,所述通过所述隔离层在所述实现层中展现具有实现层的表单UI控件包括:Preferably, the presenting the form UI control with the realization layer in the realization layer through the isolation layer includes:
获取所述具有实现层的表单UI控件对应的多个渲染版本;Acquiring multiple rendering versions corresponding to the form UI control with an implementation layer;
注册所述多个渲染版本至注册表中,并将所述多个渲染版本的状态修改为挂起状态;Registering the multiple rendering versions in the registry, and modifying the status of the multiple rendering versions to a suspended state;
确定所述注册表中的一个渲染版本为目标渲染版本,并将所述目标渲染版本配置到所述配置中心;Determining that a rendering version in the registry is a target rendering version, and configuring the target rendering version to the configuration center;
修改所述配置中心中的所述目标渲染版本的状态为激活状态;Modifying the status of the target rendering version in the configuration center to an active status;
所述翻译器从所述配置中心中获取所述状态为激活状态对应的渲染版本的实现层信息;The translator obtains the implementation layer information of the rendering version corresponding to the activated state from the configuration center;
在所述实现层中展现所述实现层信息对应的表单UI控件的实现层。The realization layer of the form UI control corresponding to the realization layer information is displayed in the realization layer.
本实施例中,每个表单UI控件对应多个实现层,每个实现层对应一个渲染版本,获取所述具有实现层的表单UI控件对应的多个渲染版本,将所述多个渲染版本注册到注册表中,并将状态设置为挂起状态;在配置中心中把指定的渲染版本状态设置为激活状态,这样“翻译 器”会从“配置中心”获得唯一的激活状态的渲染版本的实现层信息。In this embodiment, each form UI control corresponds to multiple implementation layers, and each implementation layer corresponds to a rendering version, obtain multiple rendering versions corresponding to the form UI control with implementation layers, and register the multiple rendering versions Go to the registry and set the status to the suspended state; set the specified rendering version status to the active state in the configuration center, so that the "translator" will obtain the implementation of the only active rendering version from the "configuration center" Tier information.
本实施例中,所述注册表、配置中心及翻译器在所述翻译层中共同作用,协同负责动态维护每个表单UI控件不同实现层之间的关系,实现不同实现层的切换。由于在每个所述表单UI控件的接口层和实现层之间架构隔离层,故每个所述表单UI控件的实现层是彼此独立,互不干扰,避免了由于浏览器提供的默认运行环境没有隔离性,实现层的内部细节很容易污染到全局环境,导致其他的UI控件受到干扰而无法正常工作。In this embodiment, the registry, the configuration center, and the translator work together in the translation layer, and are cooperatively responsible for dynamically maintaining the relationship between the different implementation layers of each form UI control, and realize the switching of different implementation layers. Since the isolation layer is constructed between the interface layer and the implementation layer of each form UI control, the implementation layer of each form UI control is independent of each other and does not interfere with each other, avoiding the default operating environment provided by the browser Without isolation, the internal details of the implementation layer can easily pollute the global environment, causing other UI controls to be interfered and unable to work normally.
S18:对所述实现层中的表单UI控件进行渲染,生成表单页面。S18: Render the form UI control in the implementation layer to generate a form page.
本实施例中,所述表单页面是通过对所述实现层中的表单UI控件进行渲染成不同的渲染片后进行连接生成的。In this embodiment, the form page is generated by rendering the form UI controls in the implementation layer into different rendering pieces and then connecting them.
优选的,所述对所述实现层中的表单UI控件进行渲染,生成表单页面包括:Preferably, the rendering of the form UI control in the implementation layer to generate the form page includes:
对所述实现层中的表单UI控件进行渲染得到表单UI控件的渲染片;Rendering the form UI control in the implementation layer to obtain a rendering piece of the form UI control;
基于所述渲染片共同构成整张表单页面的渲染图;Based on the rendering pieces, a rendering image of the entire form page is formed together;
基于所述渲染图生成表单页面。A form page is generated based on the rendering image.
本实施例中,隔离层将每个表单UI控件包裹成独立的渲染片,每张渲染片在特定条件下可以独立的动态渲染而不影响其他渲染片,实现不同渲染结果,提高了浏览器的渲染效率,减少了整张表单页面的渲染成本。In this embodiment, the isolation layer wraps each form UI control into an independent rendering piece, and each rendering piece can be independently and dynamically rendered under certain conditions without affecting other rendering pieces, achieving different rendering results, and improving the browser’s performance. Rendering efficiency reduces the cost of rendering the entire form page.
综上所述,本实施例所述的表单页面生成方法,通过创建字典后接收用户输入的待创建表单的多个表单UI控件的控件名称;从所述字典中获取所述多个表单UI控件的控件名称对应的多个表单UI控件;将每个所述表单UI控件划分为接口层和实现层,其中,每个所述表单UI控件的接口层和实现层之间架构隔离层;将每个所述表单UI控件对应的接口层中的协议内容拼接成中间语言;基于每个所述中间语言生成具有实现层的表单UI控件;通过所述隔离层在所述实现层中展现具有实现层的表单UI控件;对所述实现层中的表单UI控件进行渲染,生成表单页面。本实施例一方面通过将表单UI控件划分为接口层与实现层,从而分离了表单UI控件的配置和渲染,为定制开发提供了技术基础,又通过架设隔离层,使得每个控件的实现层彼此独立、互不干扰,通过切换实现层实现不同渲染结果的目的,提高浏览器的渲染效率;最后,将所述表单UI控件对应的接口层中的协议内容翻译成中间语言,便于后期运用在不同的技术语言中,同时基于所述中间语言生成具有实现层的表单UI控件,在不改变任意表单UI控件协议的条件下对任意表单UI控件进行二次开发,满足了各种场景的定制需求。In summary, the method for generating a form page according to this embodiment receives the control names of multiple form UI controls of the form to be created that are input by the user after creating a dictionary; and obtains the multiple form UI controls from the dictionary Multiple form UI controls corresponding to the control name of the form; divide each of the form UI controls into an interface layer and an implementation layer, wherein the interface layer and the implementation layer of each form UI control have an architectural isolation layer between the interface layer and the implementation layer; The protocol content in the interface layer corresponding to each of the form UI controls is spliced into an intermediate language; a form UI control with an implementation layer is generated based on each intermediate language; the implementation layer is displayed in the implementation layer through the isolation layer Form UI controls; render the form UI controls in the implementation layer to generate a form page. This embodiment, on the one hand, separates the configuration and rendering of the form UI control by dividing the form UI control into an interface layer and an implementation layer, thereby providing a technical basis for custom development, and setting up an isolation layer to make the implementation layer of each control They are independent of each other and do not interfere with each other. The purpose of different rendering results is achieved by switching the realization layer, and the rendering efficiency of the browser is improved; finally, the protocol content in the interface layer corresponding to the form UI control is translated into an intermediate language, which is convenient for later use Among different technical languages, form UI controls with implementation layers are generated based on the intermediate language at the same time, and any form UI controls are re-developed without changing the protocol of any form UI controls, which meets the customization needs of various scenarios .
实施例二Example two
图2是本申请实施例二提供的表单页面生成装置的结构图。Fig. 2 is a structural diagram of a form page generating apparatus provided in the second embodiment of the present application.
在一些实施例中,所述表单页面生成装置20可以包括多个由程序代码段所组成的功能模块。所述表单页面生成装置20中的各个程序段的程序代码可以存储于终端的存储器中,并由所述至少一个处理器所执行,以执行(详见图1描述)表单页面生成。In some embodiments, the form page generating device 20 may include multiple functional modules composed of program code segments. The program code of each program segment in the form page generating device 20 may be stored in the memory of the terminal and executed by the at least one processor to perform (see FIG. 1 for details) form page generation.
本实施例中,所述表单页面生成装置20根据其所执行的功能,可以被划分为多个功能模块。所述功能模块可以包括:创建模块201、接收模块202、获取模块203、划分模块204、拼接模块205、生成模块206、展现模块207及渲染模块208。本申请所称的模块是指一种能够被至少一个处理器所执行并且能够完成固定功能的一系列计算机程序段,其存储在存储器中。在本实施例中,关于各模块的功能将在后续的实施例中详述。In this embodiment, the form page generating device 20 can be divided into multiple functional modules according to the functions it performs. The functional modules may include: a creation module 201, a receiving module 202, an acquisition module 203, a division module 204, a splicing module 205, a generation module 206, a display module 207, and a rendering module 208. The module referred to in this application refers to a series of computer program segments that can be executed by at least one processor and can complete fixed functions, and are stored in a memory. In this embodiment, the function of each module will be described in detail in subsequent embodiments.
创建模块201:用于创建字典,其中所述字典携带有多个历史表单名称。Creation module 201: used to create a dictionary, where the dictionary carries multiple historical form names.
本实施例中,所述字典是指多个历史表单的表单UI控件对应的一系列协议层的集合,所述字典中存储了每个历史表单名称、每个历史表单的表单UI控件、表单UI控件对应的协议及对应的协议层,其中,所述协议包括每个表单UI控件的控件名称、协议内容、HTMLElement标签名称、属性、方法、接口层、实现层及其参数列表。In this embodiment, the dictionary refers to a collection of a series of protocol layers corresponding to the form UI controls of multiple historical forms. The dictionary stores the name of each historical form, the form UI control of each historical form, and the form UI. The protocol corresponding to the control and the corresponding protocol layer, wherein the protocol includes the control name, protocol content, HTMLElement tag name, attribute, method, interface layer, implementation layer and parameter list of each form UI control.
优选的,所述创建模块201创建字典包括:Preferably, the creation of the dictionary by the creation module 201 includes:
获取所述多个历史表单名称及每个历史表单名称对应的表单UI控件协议层,每个所述表 单UI控件协议层是由所述历史表单名称对应的多个表单UI控件的接口层组成的,每个所述表单UI控件的接口层携带有对应表单UI控件的控件名称;Acquire the multiple historical form names and the form UI control protocol layer corresponding to each historical form name, each of the form UI control protocol layers is composed of interface layers of multiple form UI controls corresponding to the historical form name , The interface layer of each form UI control carries a control name corresponding to the form UI control;
将所述多个历史表单名称作为字典的第一层级,每个所述历史表单名称对应的多个表单UI控件的接口层作为字典的第二层级,多个表单UI控件的接口层对应的协议层作为字典的第三层级,其中,所述字典存储于区块链节点中。The multiple historical form names are taken as the first level of the dictionary, the interface layers of multiple form UI controls corresponding to each of the historical form names are taken as the second level of the dictionary, and the protocol corresponding to the interface layers of the multiple form UI controls The layer serves as the third layer of the dictionary, where the dictionary is stored in a blockchain node.
本实施例中,每个历史表单名称对应一个协议层,每个协议层对应多个表单UI控件的接口层,每个所述表单UI控件的接口层对应一个表单UI控件,每个表单UI控件对应有表单UI控件的控件名称,将所述历史表单名称、每个历史标点名称对应的表单UI控件及表单UI控件的接口层对应的协议层定义为不同的层级,提高了获取表单UI控件的效率。In this embodiment, each historical form name corresponds to a protocol layer, each protocol layer corresponds to the interface layers of multiple form UI controls, and each interface layer of the form UI controls corresponds to a form UI control, and each form UI control Corresponding to the control name of the form UI control, the historical form name, the form UI control corresponding to each historical punctuation name, and the protocol layer corresponding to the interface layer of the form UI control are defined as different levels, which improves the access to the form UI control efficient.
需要强调的是,为进一步保证上述字典的私密和安全性,上述字典还可以存储于一区块链的节点中。It should be emphasized that, in order to further ensure the privacy and security of the above-mentioned dictionary, the above-mentioned dictionary can also be stored in a node of a blockchain.
接收模块202:用于接收用户输入的待创建表单的多个表单UI控件的控件名称。Receiving module 202: used to receive control names of multiple form UI controls of the form to be created input by the user.
本实施例中,当用户需要制作表单时,在浏览器中输入待创建表单的表单名称及所述表单名称对应的多个表单UI控件的控件名称。In this embodiment, when the user needs to create a form, the form name of the form to be created and the control names of multiple form UI controls corresponding to the form name are input in the browser.
获取模块203:用于从所述字典中获取所述多个表单UI控件的控件名称对应的多个表单UI控件。The obtaining module 203 is configured to obtain multiple form UI controls corresponding to the control names of the multiple form UI controls from the dictionary.
本实施例中,所述字典中存储有每个历史表单的表单名称及每个历史表单的表单名称对应的多个表单UI控件及表单UI控件的控件名称,当接收到用户输入的待创建表单的多个表单UI控件的控件名称时,从所述字典中获取每个所述表单UI控件的控件名称对应的表单UI控件。In this embodiment, the dictionary stores the form name of each historical form and multiple form UI controls corresponding to the form name of each historical form and the control names of the form UI controls. When the form to be created input by the user is received When the control names of multiple form UI controls are used, the form UI control corresponding to the control name of each form UI control is obtained from the dictionary.
划分模块204:用于将每个所述表单UI控件划分为接口层和实现层,其中,每个所述表单UI控件的接口层和实现层之间架构隔离层。The dividing module 204 is configured to divide each of the form UI controls into an interface layer and an implementation layer, where the interface layer and the implementation layer of each form UI control are structured as an isolation layer.
本实施例中,所述接口层是指定义所述表单UI控件的属性和行为,就是将所述表单UI控件的内部操作和外部环境在数据处理过程中相互独立,例如,修改所述表单UI控件的内部操作的时候不会影响到所述表单UI控件的外部环境;所述实现层是指执行所述表单UI控件的接口层定义的协议内容来实现内部操作,为了防止所述实现层的内部细节污染到全局环境,在将所述实现层和所述接口层之间架构隔离层。In this embodiment, the interface layer refers to the definition of the attributes and behaviors of the form UI control, that is, the internal operation of the form UI control and the external environment are independent of each other in the data processing process, for example, to modify the form UI The internal operation of the control will not affect the external environment of the form UI control; the implementation layer refers to the implementation of the protocol content defined by the interface layer of the form UI control to implement internal operations, in order to prevent the implementation layer from Internal details pollute the global environment, and an isolation layer is constructed between the implementation layer and the interface layer.
优选的,所述划分模块204将每个所述表单UI控件划分为接口层和实现层包括:Preferably, the dividing module 204 dividing each of the form UI controls into an interface layer and an implementation layer includes:
将每个所述表单UI控件创建为浏览器能够原生识别的自定义标签;Creating each of the form UI controls as a custom label that can be natively recognized by the browser;
调用CustomElements.define传入所述自定义标签将每个所述表单UI控件划分为接口层和实现层。Call CustomElements.define to pass in the custom label to divide each form UI control into an interface layer and an implementation layer.
本实施例中,通过采用Web Components技术中的Custom Elements技术,把表单UI控件创建为浏览器能够原生识别的HTMLElement(自定义)标签,调用customElements.define方法传入所述HTMLElement标签以及使用JavaScript Class实现每个表单UI控件对应的接口层得到的实用层,从而把每个表单UI控件分为接口层和实现层,当将所述表单UI控件分为接口层和实现层之后,采用Shadow DOM技术在每个所述表单UI控件的接口层和实现层之间架构隔离层。In this embodiment, by using the Custom Elements technology in Web Components technology, the form UI control is created as HTMLElement (custom) tags that can be natively recognized by the browser, and the customElements.define method is called to pass in the HTMLElement tags and JavaScript Class is used. Implement the practical layer obtained from the interface layer corresponding to each form UI control, thereby dividing each form UI control into an interface layer and an implementation layer. After dividing the form UI control into an interface layer and an implementation layer, the Shadow DOM technology is used An isolation layer is constructed between the interface layer and the implementation layer of each of the form UI controls.
本实施例中,通过将每个控件分为接口层和实现层,是为了将配置和渲染分开,其中,所述配置通过接口层进行实现,所述渲染通过实现层中进行实现,提高了渲染效率,架构隔离层是由于浏览器提供的默认运行环境没有隔离性,实现层的内部细节很容易污染到全局环境,导致其他的UI控件受到干扰而无法正常工作,而在所述实现层和所述接口层之间架构隔离层提高了渲染质量。In this embodiment, each control is divided into an interface layer and an implementation layer to separate configuration and rendering. The configuration is implemented through the interface layer, and the rendering is implemented through the implementation layer, which improves the rendering. Efficiency, the architecture isolation layer is due to the fact that the default operating environment provided by the browser is not isolated. The internal details of the implementation layer can easily pollute the global environment, causing other UI controls to be interfered and unable to work normally. The architecture isolation layer between the interface layers improves the rendering quality.
拼接模块205:用于将每个所述表单UI控件对应的接口层中的协议内容拼接成中间语言。The splicing module 205 is used to splice the protocol content in the interface layer corresponding to each of the form UI controls into an intermediate language.
本实施例中,所述表单UI控件对应的接口层中的协议内容以代码的形式既不利于保存,又不利于传输,为了方便存储和传输,将将每个所述表单UI控件对应的接口层中的协议内容 拼接成中间语言。In this embodiment, the protocol content in the interface layer corresponding to the form UI control is not conducive to storage and transmission in the form of code. In order to facilitate storage and transmission, the interface corresponding to each form UI control will be The content of the agreement in the layer is spliced into an intermediate language.
优选的,所述拼接模块205将每个所述表单UI控件对应的接口层中的协议内容拼接成中间语言包括:Preferably, the splicing module 205 splicing the protocol content in the interface layer corresponding to each of the form UI controls into an intermediate language includes:
接收表单画布中用户拖曳的表单UI控件;Receive the form UI controls dragged by the user in the form canvas;
根据所述用户拖曳的顺序读取所述表单画布中的表单UI控件;Read the form UI controls in the form canvas according to the drag order of the user;
每读取到一个表单UI控件,将所述表单UI控件对应的接口层中的协议内容拼接成中间语言。Each time a form UI control is read, the protocol content in the interface layer corresponding to the form UI control is spliced into an intermediate language.
示例性的,用户将表单UI控件列表“我”“平安”“来自”拖曳到表单画布中,根据用户拖曳的顺序读取每个表单UI控件,读取的第一个表单UI控件对应的接口层的协议内容为“我”,读取的第二个表单UI控件对应的接口层的协议内容为“来自”,读取的第三个表单UI控件对应的接口层的协议内容为“平安”,按照读取的先后顺序将每个所述表单UI控件对应的接口层中的协议内容拼接成中间语言“我来自平安”。Exemplarily, the user drags the form UI control list "I", "Ping", and "From" to the form canvas, and reads each form UI control according to the drag order of the user, and reads the interface corresponding to the first form UI control. The protocol content of the layer is "I", the protocol content of the interface layer corresponding to the second form UI control is read as "from", and the protocol content of the interface layer corresponding to the third form UI control is read as "Peace" , Splicing the protocol content in the interface layer corresponding to each of the form UI controls into the intermediate language "I come from Ping An" in the order of reading.
生成模块206:用于基于每个所述中间语言生成具有实现层的表单UI控件。The generating module 206 is configured to generate a form UI control with an implementation layer based on each intermediate language.
本实施例中,在生成具有实现层的表单UI控件的过程中,每个协议层对应多个实现层,为了达到定制的目的,设计了翻译器、配置中心和注册表,所述翻译器、配置中心和注册表协同作用在翻译层。In this embodiment, in the process of generating a form UI control with an implementation layer, each protocol layer corresponds to multiple implementation layers. In order to achieve the purpose of customization, a translator, a configuration center, and a registry are designed. The translator, The configuration center and the registry work together in the translation layer.
优选的,所述生成模块206基于每个所述中间语言生成具有实现层的表单UI控件包括:Preferably, the generation module 206 generates a form UI control with an implementation layer based on each of the intermediate language includes:
将每个所述中间语言输入到翻译器中;Input each of the intermediate languages into the translator;
调用所述翻译器从配置中心请求所述中间语言对应的字典并将所述字典设置为激活状态;Calling the translator to request the dictionary corresponding to the intermediate language from the configuration center and setting the dictionary to an active state;
调用所述配置中心从注册表中读取处于激活状态的字典对应的表单UI控件;Calling the configuration center to read the form UI control corresponding to the dictionary in the active state from the registry;
返回所述表单UI控件至所述翻译器;Return the form UI control to the translator;
调用所述翻译器根据所述表单UI控件从每个所述中间语言中读取对应的表单UI控件的控件信息,其中,所述表单UI控件的控件信息对应有控件名称;Calling the translator to read the control information of the corresponding form UI control from each of the intermediate languages according to the form UI control, wherein the control information of the form UI control corresponds to the control name;
基于所述表单UI控件的控件名称将从每个所述中间语言读取到的第一表单UI控件与所述配置中心从所述注册表中读取到的第二表单UI控件进行匹配,其中,所述从每个所述中间语言读取到的所述第一表单UI控件对应有接口层,所述配置中心从所述注册表中读取到的所述第二表单UI控件对应有实现层;Based on the control name of the form UI control, the first form UI control read from each intermediate language is matched with the second form UI control read from the registry by the configuration center, where , The first form UI control read from each of the intermediate languages corresponds to an interface layer, and the second form UI control read from the registry by the configuration center corresponds to an implementation Floor;
关联相匹配的所述第一表单UI控件的接口层和所述第二表单UI控件的实现层,得到一个对应有接口层和实现层的表单UI控件列表;Associating the matching interface layer of the first form UI control and the implementation layer of the second form UI control to obtain a form UI control list corresponding to the interface layer and the implementation layer;
调用所述翻译器读取所述表单UI控件列表中每个所述第二表单UI控件生成具有实现层的表单UI控件。Invoking the translator to read each second form UI control in the form UI control list to generate a form UI control with an implementation layer.
本实施例中,为了将每个所述中间语言生成具有实现层的表单UI控件,将中间语言输入到翻译器,翻译器在配置中心中根据所述中间语言请求对应的字典,在配置中心中将所述字典设置为激活状态,然后从注册表中查找到所述激活状态字典对应的表单UI控件,返回所述表单UI控件至翻译器,翻译器从每个所述中间语言读取对应所述第一表单UI控件,从所述中间语言读取的所述第一表单UI控件只对应有接口层,所述配置中心从所述注册表中读取到的所述第二表单UI控件只对应有实现层,将所述第一表单UI控件与所述第二表单UI控件进行匹配,将匹配后的所述第一表单UI控件与所述第二表单UI控件进行关联,得到一个携带有接口层和实现层的表单UI控件列表,调用翻译器逐条读取所述列表中的每个所述第一表单UI控件,通过每个所述第一表单UI控件的接口层获取对应所述第二表单UI控件的实现层,最终,所述翻译器完成从中间语言生成具有实现层的表单UI控件。In this embodiment, in order to generate a form UI control with an implementation layer for each intermediate language, the intermediate language is input to the translator, and the translator requests the corresponding dictionary in the configuration center according to the intermediate language, and in the configuration center Set the dictionary to the active state, then find the form UI control corresponding to the active state dictionary from the registry, return the form UI control to the translator, and the translator reads the corresponding data from each intermediate language. The first form UI control, the first form UI control read from the intermediate language only corresponds to an interface layer, and the second form UI control read from the registry by the configuration center only Corresponding to an implementation layer, the first form UI control is matched with the second form UI control, and the matched first form UI control is associated with the second form UI control to obtain a carrying The interface layer and the form UI control list of the implementation layer are called, the translator is called to read each first form UI control in the list one by one, and the corresponding first form UI control is obtained through the interface layer of each first form UI control. Second, the realization layer of the form UI control. Finally, the translator completes the generation of the form UI control with the realization layer from the intermediate language.
示例性的,将所述中间语言:“我来自平安”,输入到翻译器,调用所述翻译器从所述配置中心中请求所述中间语言对应的字典并设置为激活状态,调用所述配置中心从所述注册表中读取所述字典对应的表单UI控件的控件名称:“我”“来自”“平安”,将“我”“来自”“平安”返回给翻译器,调用翻译器读取根据“我”“来自”“平安”将从所述中间语言 读取到的第一表单UI控件“我”“来自”“平安”,所述配置中心从所述注册表中读取到的第二表单UI控件生成:“I”,、“come from”,、“PingAn”,将所述第一表单UI控件与所述第二表单UI控件进行匹配得到“我”与“I”对应,、“来自”与“come from”对应,、“平安”与“PingAn”对应的表单UI控件列表,调用所述翻译器读取所述第二表单UI控件“I”、“come from”、“PingAn”生成具有英语实现层的表单控件,例如:所述中间语言“我”对应的具有英语实现层的表单控件为“I”,所述中间语言“来自”对应的具有英语实现层的表单控件为“come here”,所述中间语言“平安”对应的具有英语实现层的表单控件为“PingAn”。Exemplarily, input the intermediate language: "I come from Ping An" into the translator, call the translator to request the dictionary corresponding to the intermediate language from the configuration center and set it to the active state, and call the configuration The center reads the control name of the form UI control corresponding to the dictionary from the registry: "I", "From" and "Ping An", returning "I", "From" and "Ping An" to the translator, and calling the translator to read Take the first form UI control "I", "From" and "Ping An" read from the intermediate language according to "I", "From" and "Ping An", the configuration center reads from the registry The second form UI control is generated: "I", "come from", "PingAn", the first form UI control is matched with the second form UI control to obtain the correspondence between "I" and "I", , "From" corresponds to "come from", "PingAn" and "PingAn" correspond to the form UI control list, call the translator to read the second form UI control "I", "come from", " "PingAn" generates a form control with an English implementation level, for example: the form control with an English implementation level corresponding to the intermediate language "I" is "I", and the intermediate language "from" corresponds to a form control with an English implementation level. Is "come here", and the form control with English implementation layer corresponding to the intermediate language "Ping An" is "PingAn".
本实施例中,翻译层基于所述中间语言生成具有实现层的表单UI控件,所述表单UI控件中包含了具体的样式代码和交互逻辑代码,开发人员可以在所述翻译层对每个所述表单UI控件进行二次开发,也可以对每个所述表单UI控件进行不同实现层切换,满足了各种定制场景的需求。In this embodiment, the translation layer generates a form UI control with an implementation layer based on the intermediate language. The form UI control contains specific style codes and interactive logic codes. The secondary development of the form UI control can also be performed for each of the form UI controls to switch between different implementation layers, which meets the requirements of various customization scenarios.
展现模块207:用于通过所述隔离层在所述实现层中展现具有实现层的表单UI控件。The display module 207 is used to display the form UI control with the realization layer in the realization layer through the isolation layer.
本实施例中,一个表单UI控件协议层包括多个表单UI控件,每个表单UI控件对应多个实现层,每个实现层在所述隔离层中独立展现。In this embodiment, a form UI control protocol layer includes multiple form UI controls, each form UI control corresponds to multiple implementation layers, and each implementation layer is independently presented in the isolation layer.
优选的,所述展现模块207通过所述隔离层在所述实现层中展现具有实现层的表单UI控件包括:Preferably, the display module 207 displays the form UI control with the realization layer in the realization layer through the isolation layer, including:
获取所述具有实现层的表单UI控件对应的多个渲染版本;Acquiring multiple rendering versions corresponding to the form UI control with an implementation layer;
注册所述多个渲染版本至注册表中,并将所述多个渲染版本的状态修改为挂起状态;Registering the multiple rendering versions in the registry, and modifying the status of the multiple rendering versions to a suspended state;
确定所述注册表中的一个渲染版本为目标渲染版本,并将所述目标渲染版本配置到所述配置中心;Determining that a rendering version in the registry is a target rendering version, and configuring the target rendering version to the configuration center;
修改所述配置中心中的所述目标渲染版本的状态为激活状态;Modifying the status of the target rendering version in the configuration center to an active status;
所述翻译器从所述配置中心中获取所述状态为激活状态对应的渲染版本的实现层信息;The translator obtains the implementation layer information of the rendering version corresponding to the activated state from the configuration center;
在所述实现层中展现所述实现层信息对应的表单UI控件的实现层。The realization layer of the form UI control corresponding to the realization layer information is displayed in the realization layer.
本实施例中,每个表单UI控件对应多个实现层,每个实现层对应一个渲染版本,获取所述具有实现层的表单UI控件对应的多个渲染版本,将所述多个渲染版本注册到注册表中,并将状态设置为挂起状态;在配置中心中把指定的渲染版本状态设置为激活状态,这样“翻译器”会从“配置中心”获得唯一的激活状态的渲染版本的实现层信息。In this embodiment, each form UI control corresponds to multiple implementation layers, and each implementation layer corresponds to a rendering version, obtain multiple rendering versions corresponding to the form UI control with implementation layers, and register the multiple rendering versions Go to the registry and set the status to the suspended state; set the specified rendering version status to the active state in the configuration center, so that the "translator" will obtain the implementation of the only active rendering version from the "configuration center" Tier information.
本实施例中,所述注册表、配置中心及翻译器在所述翻译层中共同作用,协同负责动态维护每个表单UI控件不同实现层之间的关系,实现不同实现层的切换。由于在每个所述表单UI控件的接口层和实现层之间架构隔离层,故每个所述表单UI控件的实现层是彼此独立,互不干扰,避免了由于浏览器提供的默认运行环境没有隔离性,实现层的内部细节很容易污染到全局环境,导致其他的UI控件受到干扰而无法正常工作。In this embodiment, the registry, the configuration center, and the translator work together in the translation layer, and are cooperatively responsible for dynamically maintaining the relationship between the different implementation layers of each form UI control, and realize the switching of different implementation layers. Since the isolation layer is constructed between the interface layer and the implementation layer of each form UI control, the implementation layer of each form UI control is independent of each other and does not interfere with each other, avoiding the default operating environment provided by the browser Without isolation, the internal details of the implementation layer can easily pollute the global environment, causing other UI controls to be interfered and unable to work normally.
渲染模块208:用于对所述实现层中的表单UI控件进行渲染,生成表单页面。The rendering module 208 is used to render the form UI controls in the implementation layer to generate a form page.
本实施例中,所述表单页面是通过对所述实现层中的表单UI控件进行渲染成不同的渲染片后进行连接生成的。In this embodiment, the form page is generated by rendering the form UI controls in the implementation layer into different rendering pieces and then connecting them.
优选的,所述渲染模块208对所述实现层中的表单UI控件进行渲染,生成表单页面包括:Preferably, the rendering module 208 renders the form UI controls in the implementation layer, and generating a form page includes:
对所述实现层中的表单UI控件进行渲染得到表单UI控件的渲染片;Rendering the form UI control in the implementation layer to obtain a rendering piece of the form UI control;
基于所述渲染片共同构成整张表单页面的渲染图;Based on the rendering pieces, a rendering image of the entire form page is formed together;
基于所述渲染图生成表单页面。A form page is generated based on the rendering image.
本实施例中,隔离层将每个表单UI控件包裹成独立的渲染片,每张渲染片在特定条件下可以独立的动态渲染而不影响其他渲染片,实现不同渲染结果,提高了浏览器的渲染效率,减少了整张表单页面的渲染成本。In this embodiment, the isolation layer wraps each form UI control into an independent rendering piece, and each rendering piece can be independently and dynamically rendered under certain conditions without affecting other rendering pieces, achieving different rendering results, and improving the browser’s performance. Rendering efficiency reduces the cost of rendering the entire form page.
综上所述,本实施例所述的表单页面生成装置,通过创建字典后接收用户输入的待创建 表单的多个表单UI控件的控件名称;从所述字典中获取所述多个表单UI控件的控件名称对应的多个表单UI控件;将每个所述表单UI控件划分为接口层和实现层,其中,每个所述表单UI控件的接口层和实现层之间架构隔离层;将每个所述表单UI控件对应的接口层中的协议内容拼接成中间语言;基于每个所述中间语言生成具有实现层的表单UI控件;通过所述隔离层在所述实现层中展现具有实现层的表单UI控件;对所述实现层中的表单UI控件进行渲染,生成表单页面。本实施例一方面通过将表单UI控件划分为接口层与实现层,从而分离了表单UI控件的配置和渲染,为定制开发提供了技术基础,又通过架设隔离层,使得每个控件的实现层彼此独立、互不干扰,通过切换实现层实现不同渲染结果的目的,提高浏览器的渲染效率;最后,将所述表单UI控件对应的接口层中的协议内容翻译成中间语言,便于后期运用在不同的技术语言中,同时基于所述中间语言生成具有实现层的表单UI控件,在不改变任意表单UI控件协议的条件下对任意表单UI控件进行二次开发,满足了各种场景的定制需求。To sum up, the form page generating device of this embodiment receives the control names of multiple form UI controls of the form to be created input by the user after creating a dictionary; obtains the multiple form UI controls from the dictionary Multiple form UI controls corresponding to the control name of the form; divide each of the form UI controls into an interface layer and an implementation layer, wherein the interface layer and the implementation layer of each form UI control have an architectural isolation layer between the interface layer and the implementation layer; The protocol content in the interface layer corresponding to each of the form UI controls is spliced into an intermediate language; a form UI control with an implementation layer is generated based on each intermediate language; the implementation layer is displayed in the implementation layer through the isolation layer Form UI controls; render the form UI controls in the implementation layer to generate a form page. This embodiment, on the one hand, separates the configuration and rendering of the form UI control by dividing the form UI control into an interface layer and an implementation layer, thereby providing a technical basis for custom development, and setting up an isolation layer to make the implementation layer of each control They are independent of each other and do not interfere with each other. The purpose of different rendering results is achieved by switching the realization layer, and the rendering efficiency of the browser is improved; finally, the protocol content in the interface layer corresponding to the form UI control is translated into an intermediate language, which is convenient for later use Among different technical languages, form UI controls with implementation layers are generated based on the intermediate language at the same time, and any form UI controls are re-developed without changing the protocol of any form UI controls, which meets the customization needs of various scenarios .
实施例三Example three
参阅图3所示,为本申请实施例三提供的终端的结构示意图。在本申请较佳实施例中,所述终端3包括存储器31、至少一个处理器32、至少一条通信总线33及收发器34。Refer to FIG. 3, which is a schematic structural diagram of a terminal provided in Embodiment 3 of this application. In a preferred embodiment of the present application, the terminal 3 includes a memory 31, at least one processor 32, at least one communication bus 33, and a transceiver 34.
本领域技术人员应该了解,图3示出的终端的结构并不构成本申请实施例的限定,既可以是总线型结构,也可以是星形结构,所述终端3还可以包括比图示更多或更少的其他硬件或者软件,或者不同的部件布置。Those skilled in the art should understand that the structure of the terminal shown in FIG. 3 does not constitute a limitation of the embodiment of the present application. It may be a bus-type structure or a star structure. The terminal 3 may also include more More or less other hardware or software, or different component arrangements.
在一些实施例中,所述终端3是一种能够按照事先设定或存储的指令,自动进行数值计算和/或信息处理的终端,其硬件包括但不限于微处理器、专用集成电路、可编程门阵列、数字处理器及嵌入式设备等。所述终端3还可包括客户设备,所述客户设备包括但不限于任何一种可与客户通过键盘、鼠标、遥控器、触摸板或声控设备等方式进行人机交互的电子产品,例如,个人计算机、平板电脑、智能手机、数码相机等。In some embodiments, the terminal 3 is a terminal that can automatically perform numerical calculation and/or information processing in accordance with pre-set or stored instructions. Its hardware includes, but is not limited to, a microprocessor, an application specific integrated circuit, and Programming gate arrays, digital processors and embedded devices, etc. The terminal 3 may also include client equipment. The client equipment includes, but is not limited to, any electronic product that can interact with the client through a keyboard, a mouse, a remote control, a touch panel, or a voice control device, for example, a personal computer. Computers, tablets, smart phones, digital cameras, etc.
需要说明的是,所述终端3仅为举例,其他现有的或今后可能出现的电子产品如可适应于本申请,也应包含在本申请的保护范围以内,并以引用方式包含于此。It should be noted that the terminal 3 is only an example, and other existing or future electronic products that can be adapted to this application should also be included in the scope of protection of this application and included here by reference.
在一些实施例中,所述存储器31用于存储程序代码和各种数据,例如安装在所述终端3中的表单页面生成装置20,并在终端3的运行过程中实现高速、自动地完成程序或数据的存取。所述存储器31包括随机存取存储器(RamdomAccessMemory,RAM)、只读存储器(Read-Only Memory,ROM)、可编程只读存储器(Programmable Read-Only Memory,PROM)、可擦除可编程只读存储器(Erasable Programmable Read-Only Memory,EPROM)、一次可编程只读存储器(One-time Programmable Read-Only Memory,OTPROM)、电子擦除式可复写只读存储器(Electrically-Erasable Programmable Read-Only Memory,EEPROM)、只读光盘(Compact Disc Read-Only Memory,CD-ROM)或其他光盘存储器、磁盘存储器、磁带存储器、或者能够用于携带或存储数据的计算机可读的任何其他介质。In some embodiments, the memory 31 is used to store program codes and various data, such as the form page generating device 20 installed in the terminal 3, and realize the high-speed and automatic completion of the program during the operation of the terminal 3 Or data access. The memory 31 includes random access memory (Ramdom Access Memory, RAM), read-only memory (Read-Only Memory, ROM), programmable read-only memory (Programmable Read-Only Memory, PROM), and erasable programmable read-only memory (Erasable Programmable Read-Only Memory, EPROM), One-time Programmable Read-Only Memory (OTPROM), Electronically-Erasable Programmable Read-Only Memory, EEPROM ), CD-ROM (Compact Disc Read-Only Memory) or other optical disk storage, magnetic disk storage, tape storage, or any other computer-readable medium that can be used to carry or store data.
在一些实施例中,所述至少一个处理器32可以由集成电路组成,例如可以由单个封装的集成电路所组成,也可以是由多个相同功能或不同功能封装的集成电路所组成,包括一个或者多个中央处理器(Central Processing unit,CPU)、微处理器、数字处理芯片、图形处理器及各种控制芯片的组合等。所述至少一个处理器32是所述终端3的控制核心(Control Unit),利用各种接口和线路连接整个终端3的各个部件,通过运行或执行存储在所述存储器31内的程序或者模块,以及调用存储在所述存储器31内的数据,以执行终端3的各种功能和处理数据。In some embodiments, the at least one processor 32 may be composed of integrated circuits, for example, may be composed of a single packaged integrated circuit, or may be composed of multiple integrated circuits with the same function or different functions, including one Or a combination of multiple central processing units (CPU), microprocessors, digital processing chips, graphics processors, and various control chips. The at least one processor 32 is the control core (Control Unit) of the terminal 3. Various interfaces and lines are used to connect the various components of the entire terminal 3, and by running or executing programs or modules stored in the memory 31, And call the data stored in the memory 31 to execute various functions of the terminal 3 and process data.
在一些实施例中,所述至少一条通信总线33被设置为实现所述存储器31以及所述至少一个处理器32等之间的连接通信。In some embodiments, the at least one communication bus 33 is configured to implement connection and communication between the memory 31 and the at least one processor 32 and the like.
尽管未示出,所述终端3还可以包括给各个部件供电的电源(比如电池),优选的,电源可以通过电源管理装置与所述至少一个处理器32逻辑相连,从而通过电源管理装置实现管理充电、放电、以及功耗管理等功能。电源还可以包括一个或一个以上的直流或交流电源、 再充电装置、电源故障检测电路、电源转换器或者逆变器、电源状态指示器等任意组件。所述终端3还可以包括多种传感器、蓝牙模块、Wi-Fi模块等,在此不再赘述。Although not shown, the terminal 3 may also include a power source (such as a battery) for supplying power to various components. Preferably, the power source may be logically connected to the at least one processor 32 through a power management device, so as to realize management through the power management device. Functions such as charging, discharging, and power management. The power supply may also include any components such as one or more DC or AC power supplies, recharging devices, power failure detection circuits, power converters or inverters, and power status indicators. The terminal 3 may also include various sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.
应该了解,所述实施例仅为说明之用,在专利申请范围上并不受此结构的限制。It should be understood that the embodiments are only for illustrative purposes, and are not limited by this structure in the scope of the patent application.
上述以软件功能模块的形式实现的集成的单元,可以存储在一个计算机可读取存储介质中。上述软件功能模块存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,终端,或者网络设备等)或处理器(processor)执行本申请各个实施例所述方法的部分。The above-mentioned integrated unit implemented in the form of a software function module may be stored in a computer readable storage medium. The above-mentioned software function module is stored in a storage medium and includes several instructions to make a computer device (which may be a personal computer, a terminal, or a network device, etc.) or a processor execute the method described in each embodiment of the present application. part.
在进一步的实施例中,结合图2(装置模块),所述至少一个处理器32可执行所述终端3的操作装置以及安装的各类应用程序(如所述的表单页面生成装置20)、程序代码等,例如,上述的各个模块。In a further embodiment, with reference to FIG. 2 (device module), the at least one processor 32 can execute the operating device of the terminal 3 and various installed applications (such as the form page generating device 20), Program code, etc., for example, the above-mentioned modules.
所述存储器31中存储有程序代码,且所述至少一个处理器32可调用所述存储器31中存储的程序代码以执行相关的功能。例如,图2中所述的各个模块是存储在所述存储器31中的程序代码,并由所述至少一个处理器32所执行,从而实现所述各个模块的功能以达到表单页面生成的目的。The memory 31 stores program codes, and the at least one processor 32 can call the program codes stored in the memory 31 to perform related functions. For example, the various modules described in FIG. 2 are program codes stored in the memory 31 and executed by the at least one processor 32, so as to realize the functions of the various modules to achieve the purpose of generating a form page.
在本申请的一个实施例中,所述存储器31存储多个指令,所述多个指令被所述至少一个处理器32所执行以实现表单页面的生成。In an embodiment of the present application, the memory 31 stores a plurality of instructions, and the plurality of instructions are executed by the at least one processor 32 to realize the generation of a form page.
具体地,所述至少一个处理器32对上述指令的具体实现方法可参考图1对应实施例中相关步骤的描述,在此不赘述。Specifically, for the specific implementation method of the at least one processor 32 on the foregoing instructions, reference may be made to the description of the relevant steps in the embodiment corresponding to FIG. 1, which will not be repeated here.
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。In the several embodiments provided in this application, it should be understood that the disclosed device and method may be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.
进一步地,所述计算机可读存储介质可以是非易失性,也可以是易失性。Further, the computer-readable storage medium may be non-volatile or volatile.
进一步地,所述计算机可读存储介质可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序等;存储数据区可存储根据区块链节点的使用所创建的数据等。Further, the computer-readable storage medium may mainly include a storage program area and a storage data area, where the storage program area may store an operating system, an application program required by at least one function, etc.; the storage data area may store Data created by the use of nodes, etc.
本申请所指区块链是分布式数据存储、点对点传输、共识机制、加密算法等计算机技术的新型应用模式。区块链(Blockchain),本质上是一个去中心化的数据库,是一串使用密码学方法相关联产生的数据块,每一个数据块中包含了一批次网络交易的信息,用于验证其信息的有效性(防伪)和生成下一个区块。区块链可以包括区块链底层平台、平台产品服务层以及应用服务层等。The blockchain referred to in this application is a new application mode of computer technology such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm. Blockchain, essentially a decentralized database, is a series of data blocks associated with cryptographic methods. Each data block contains a batch of network transaction information for verification. The validity of the information (anti-counterfeiting) and the generation of the next block. The blockchain can include the underlying platform of the blockchain, the platform product service layer, and the application service layer.
所述作为分离部件说明的模块可以是或者也可以不是物理上分开的,作为模块显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。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 units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
另外,在本申请各个实施例中的各功能模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用硬件加软件功能模块的形式实现。In addition, the functional modules in the various embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware, or may be implemented in the form of hardware plus software functional modules.
对于本领域技术人员而言,显然本申请不限于上述示范性实施例的细节,而且在不背离本申请的精神或基本特征的情况下,能够以其他的具体形式实现本申请。因此,无论从哪一点来看,均应将实施例看作是示范性的,而且是非限制性的,本申请的范围由所附权利要求而不是上述说明限定,因此旨在将落在权利要求的等同要件的含义和范围内的所有变化涵括在本申请内。不应将权利要求中的任何附图标记视为限制所涉及的权利要求。此外,显然“包括”一词不排除其他单元或,单数不排除复数。装置权利要求中陈述的多个单元或装置也可以由一个单元或装置通过软件或者硬件来实现。第一,第二等词语用来表示名称,而并不表示任何特定的顺序。For those skilled in the art, it is obvious that the present application is not limited to the details of the foregoing exemplary embodiments, and the present application can be implemented in other specific forms without departing from the spirit or basic characteristics of the application. Therefore, no matter from which point of view, the embodiments should be regarded as exemplary and non-limiting. The scope of this application is defined by the appended claims rather than the above description, and therefore it is intended to fall into the claims. All changes in the meaning and scope of the equivalent elements of are included in this application. Any reference signs in the claims should not be regarded as limiting the claims involved. In addition, it is obvious that the word "including" does not exclude other elements or the singular number does not exclude the plural number. Multiple units or devices stated in the device claims can also be implemented by one unit or device through software or hardware. Words such as first and second are used to denote names, but do not denote any specific order.

Claims (20)

  1. 一种表单页面生成方法,其中,所述表单页面生成方法包括:A method for generating a form page, wherein the method for generating a form page includes:
    创建字典,其中所述字典携带有多个历史表单名称;Create a dictionary, where the dictionary carries multiple historical form names;
    接收用户输入的待创建表单的多个表单UI控件的控件名称;Receive the control names of multiple form UI controls of the form to be created input by the user;
    从所述字典中获取所述多个表单UI控件的控件名称对应的多个表单UI控件;Acquiring, from the dictionary, multiple form UI controls corresponding to the control names of the multiple form UI controls;
    将每个所述表单UI控件划分为接口层和实现层,其中,每个所述表单UI控件的接口层和实现层之间架构隔离层;Divide each of the form UI controls into an interface layer and an implementation layer, where an architectural isolation layer is between the interface layer and the implementation layer of each of the form UI controls;
    将每个所述表单UI控件对应的接口层中的协议内容拼接成中间语言;Splicing the protocol content in the interface layer corresponding to each of the form UI controls into an intermediate language;
    基于每个所述中间语言生成具有实现层的表单UI控件;Generating a form UI control with an implementation layer based on each of the intermediate languages;
    通过所述隔离层在所述实现层中展现具有实现层的表单UI控件;Displaying a form UI control with an implementation layer in the implementation layer through the isolation layer;
    对所述实现层中的表单UI控件进行渲染,生成表单页面。Rendering the form UI controls in the implementation layer to generate a form page.
  2. 如权利要求1所述的表单页面生成方法,其中,所述基于每个所述中间语言生成具有实现层的表单UI控件包括:The method for generating a form page according to claim 1, wherein said generating a form UI control with an implementation layer based on each of said intermediate language comprises:
    将每个所述中间语言输入到翻译器中;Input each of the intermediate languages into the translator;
    调用所述翻译器从配置中心请求所述中间语言对应的字典,并将所述字典设置为激活状态;Calling the translator to request the dictionary corresponding to the intermediate language from the configuration center, and setting the dictionary to an active state;
    调用所述配置中心从注册表中读取处于激活状态的字典对应的表单UI控件;Calling the configuration center to read the form UI control corresponding to the dictionary in the active state from the registry;
    返回所述表单UI控件至所述翻译器;Return the form UI control to the translator;
    调用所述翻译器根据所述表单UI控件从每个所述中间语言中读取对应的表单UI控件的控件信息,其中,所述表单UI控件的控件信息对应有控件名称;Calling the translator to read the control information of the corresponding form UI control from each of the intermediate languages according to the form UI control, wherein the control information of the form UI control corresponds to the control name;
    基于所述表单UI控件的控件名称将从每个所述中间语言读取到的第一表单UI控件与所述配置中心从所述注册表中读取到的第二表单UI控件进行匹配,其中,所述从每个所述中间语言读取到的所述第一表单UI控件对应有接口层,所述配置中心从所述注册表中读取到的所述第二表单UI控件对应有实现层;Based on the control name of the form UI control, the first form UI control read from each intermediate language is matched with the second form UI control read from the registry by the configuration center, where , The first form UI control read from each of the intermediate languages corresponds to an interface layer, and the second form UI control read from the registry by the configuration center corresponds to an implementation Floor;
    关联相匹配的所述第一表单UI控件的接口层和所述第二表单UI控件的实现层,得到一个对应有接口层和实现层的表单UI控件列表;Associating the matching interface layer of the first form UI control and the implementation layer of the second form UI control to obtain a form UI control list corresponding to the interface layer and the implementation layer;
    调用所述翻译器读取所述表单UI控件列表中每个所述第二表单UI控件生成具有实现层的表单UI控件。Invoking the translator to read each second form UI control in the form UI control list to generate a form UI control with an implementation layer.
  3. 如权利要求1所述的表单页面生成方法,其中,所述将每个所述表单UI控件对应的接口层中的协议内容拼接成中间语言包括:8. The method for generating a form page according to claim 1, wherein the splicing protocol content in the interface layer corresponding to each of the form UI controls into an intermediate language comprises:
    接收表单画布中用户拖曳的表单UI控件;Receive the form UI controls dragged by the user in the form canvas;
    根据所述用户拖曳的顺序读取所述表单画布中的表单UI控件;Read the form UI controls in the form canvas according to the drag order of the user;
    每读取到一个表单UI控件,将所述表单UI控件对应的接口层中的协议内容拼接成中间语言。Each time a form UI control is read, the protocol content in the interface layer corresponding to the form UI control is spliced into an intermediate language.
  4. 如权利要求1所述的表单页面生成方法,其中,所述通过所述隔离层在所述实现层中展现具有实现层的表单UI控件包括:The method for generating a form page according to claim 1, wherein the presenting the form UI control with the realization layer in the realization layer through the isolation layer comprises:
    获取所述具有实现层的表单UI控件对应的多个渲染版本;Acquiring multiple rendering versions corresponding to the form UI control with an implementation layer;
    注册所述多个渲染版本至注册表中,并将所述多个渲染版本的状态修改为挂起状态;Registering the multiple rendering versions in the registry, and modifying the status of the multiple rendering versions to a suspended state;
    确定所述注册表中的一个渲染版本为目标渲染版本,并将所述目标渲染版本配置到所述配置中心;Determining that a rendering version in the registry is a target rendering version, and configuring the target rendering version to the configuration center;
    修改所述配置中心中的所述目标渲染版本的状态为激活状态;Modifying the status of the target rendering version in the configuration center to an active status;
    所述翻译器从所述配置中心中获取所述状态为激活状态对应的渲染版本的实现层信息;The translator obtains the implementation layer information of the rendering version corresponding to the activated state from the configuration center;
    在所述实现层中展现所述实现层信息对应的表单UI控件的实现层。The realization layer of the form UI control corresponding to the realization layer information is displayed in the realization layer.
  5. 如权利要求1所述的表单页面生成方法,其中,所述对所述实现层中的表单UI控件进行渲染,生成表单页面包括:The method for generating a form page according to claim 1, wherein said rendering the form UI control in the realization layer to generate the form page comprises:
    对所述实现层中的表单UI控件进行渲染得到表单UI控件的渲染片;Rendering the form UI control in the implementation layer to obtain a rendering piece of the form UI control;
    基于所述渲染片共同构成整张表单页面的渲染图;Based on the rendering pieces, a rendering image of the entire form page is formed together;
    基于所述渲染图生成表单页面。A form page is generated based on the rendering image.
  6. 如权利要求1所述的表单页面生成方法,其中,所述创建字典包括:The method for generating a form page according to claim 1, wherein said creating a dictionary comprises:
    获取所述多个历史表单名称及每个历史表单名称对应的表单UI控件协议层,每个所述表单UI控件协议层是由所述历史表单名称对应的多个表单UI控件的接口层组成的,每个所述表单UI控件的接口层携带有对应表单UI控件的控件名称;Acquire the multiple historical form names and the form UI control protocol layer corresponding to each historical form name, each of the form UI control protocol layers is composed of interface layers of multiple form UI controls corresponding to the historical form name , The interface layer of each form UI control carries a control name corresponding to the form UI control;
    将所述多个历史表单名称作为字典的第一层级,每个所述历史表单名称对应的多个表单UI控件的接口层作为字典的第二层级,多个表单UI控件的接口层对应的协议层作为字典的第三层级,其中,所述字典存储于区块链节点中。The multiple historical form names are taken as the first level of the dictionary, the interface layers of multiple form UI controls corresponding to each of the historical form names are taken as the second level of the dictionary, and the protocol corresponding to the interface layers of the multiple form UI controls The layer serves as the third layer of the dictionary, where the dictionary is stored in a blockchain node.
  7. 如权利要求1所述的表单页面生成方法,其中,所述将每个所述表单UI控件划分为接口层和实现层包括:The method for generating a form page according to claim 1, wherein the dividing each of the form UI controls into an interface layer and an implementation layer comprises:
    将每个所述表单UI控件创建为浏览器能够原生识别的自定义标签;Creating each of the form UI controls as a custom label that can be natively recognized by the browser;
    调用CustomElements.define传入所述自定义标签将每个所述表单UI控件划分为接口层和实现层。Call CustomElements.define to pass in the custom label to divide each form UI control into an interface layer and an implementation layer.
  8. 一种终端,其中,所述终端包括存储器及处理器,所述存储器用于存储至少一个计算机可读指令,所述处理器用于执行所述至少一个计算机可读指令以实现以下步骤:A terminal, wherein the terminal includes a memory and a processor, the memory is configured to store at least one computer-readable instruction, and the processor is configured to execute the at least one computer-readable instruction to implement the following steps:
    创建字典,其中所述字典携带有多个历史表单名称;Create a dictionary, where the dictionary carries multiple historical form names;
    接收用户输入的待创建表单的多个表单UI控件的控件名称;Receive the control names of multiple form UI controls of the form to be created input by the user;
    从所述字典中获取所述多个表单UI控件的控件名称对应的多个表单UI控件;Acquiring, from the dictionary, multiple form UI controls corresponding to the control names of the multiple form UI controls;
    将每个所述表单UI控件划分为接口层和实现层,其中,每个所述表单UI控件的接口层和实现层之间架构隔离层;Divide each of the form UI controls into an interface layer and an implementation layer, where an architectural isolation layer is between the interface layer and the implementation layer of each of the form UI controls;
    将每个所述表单UI控件对应的接口层中的协议内容拼接成中间语言;Splicing the protocol content in the interface layer corresponding to each of the form UI controls into an intermediate language;
    基于每个所述中间语言生成具有实现层的表单UI控件;Generating a form UI control with an implementation layer based on each of the intermediate languages;
    通过所述隔离层在所述实现层中展现具有实现层的表单UI控件;Displaying a form UI control with an implementation layer in the implementation layer through the isolation layer;
    对所述实现层中的表单UI控件进行渲染,生成表单页面。Rendering the form UI controls in the implementation layer to generate a form page.
  9. 如权利要求8所述的终端,其中,所述处理器执行所述至少一个计算机可读指令以实现所述基于每个所述中间语言生成具有实现层的表单UI控件时,具体包括:The terminal according to claim 8, wherein when the processor executes the at least one computer-readable instruction to implement the generation of a form UI control with an implementation layer based on each of the intermediate languages, the specific steps include:
    将每个所述中间语言输入到翻译器中;Input each of the intermediate languages into the translator;
    调用所述翻译器从配置中心请求所述中间语言对应的字典,并将所述字典设置为激活状态;Calling the translator to request the dictionary corresponding to the intermediate language from the configuration center, and setting the dictionary to an active state;
    调用所述配置中心从注册表中读取处于激活状态的字典对应的表单UI控件;Calling the configuration center to read the form UI control corresponding to the dictionary in the active state from the registry;
    返回所述表单UI控件至所述翻译器;Return the form UI control to the translator;
    调用所述翻译器根据所述表单UI控件从每个所述中间语言中读取对应的表单UI控件的控件信息,其中,所述表单UI控件的控件信息对应有控件名称;Calling the translator to read the control information of the corresponding form UI control from each of the intermediate languages according to the form UI control, wherein the control information of the form UI control corresponds to the control name;
    基于所述表单UI控件的控件名称将从每个所述中间语言读取到的第一表单UI控件与所述配置中心从所述注册表中读取到的第二表单UI控件进行匹配,其中,所述从每个所述中间语言读取到的所述第一表单UI控件对应有接口层,所述配置中心从所述注册表中读取到的所述第二表单UI控件对应有实现层;Based on the control name of the form UI control, the first form UI control read from each intermediate language is matched with the second form UI control read from the registry by the configuration center, where , The first form UI control read from each of the intermediate languages corresponds to an interface layer, and the second form UI control read from the registry by the configuration center corresponds to an implementation Floor;
    关联相匹配的所述第一表单UI控件的接口层和所述第二表单UI控件的实现层,得到一个对应有接口层和实现层的表单UI控件列表;Associating the matching interface layer of the first form UI control and the implementation layer of the second form UI control to obtain a form UI control list corresponding to the interface layer and the implementation layer;
    调用所述翻译器读取所述表单UI控件列表中每个所述第二表单UI控件生成具有实现层的表单UI控件。Invoking the translator to read each second form UI control in the form UI control list to generate a form UI control with an implementation layer.
  10. 如权利要求8所述的终端,其中,所述处理器执行所述至少一个计算机可读指令以实现所述将每个所述表单UI控件对应的接口层中的协议内容拼接成中间语言时,具体包括:The terminal according to claim 8, wherein the processor executes the at least one computer-readable instruction to realize the splicing of protocol content in the interface layer corresponding to each of the form UI controls into an intermediate language, Specifically:
    接收表单画布中用户拖曳的表单UI控件;Receive the form UI controls dragged by the user in the form canvas;
    根据所述用户拖曳的顺序读取所述表单画布中的表单UI控件;Read the form UI controls in the form canvas according to the drag order of the user;
    每读取到一个表单UI控件,将所述表单UI控件对应的接口层中的协议内容拼接成中间语言。Each time a form UI control is read, the protocol content in the interface layer corresponding to the form UI control is spliced into an intermediate language.
  11. 如权利要求8所述的终端,其中,所述处理器执行所述至少一个计算机可读指令以实现所述通过所述隔离层在所述实现层中展现具有实现层的表单UI控件时,具体包括:The terminal according to claim 8, wherein the processor executes the at least one computer-readable instruction to realize the display of the form UI control with the realization layer in the realization layer through the isolation layer, specifically include:
    获取所述具有实现层的表单UI控件对应的多个渲染版本;Acquiring multiple rendering versions corresponding to the form UI control with an implementation layer;
    注册所述多个渲染版本至注册表中,并将所述多个渲染版本的状态修改为挂起状态;Registering the multiple rendering versions in the registry, and modifying the status of the multiple rendering versions to a suspended state;
    确定所述注册表中的一个渲染版本为目标渲染版本,并将所述目标渲染版本配置到所述配置中心;Determining that a rendering version in the registry is a target rendering version, and configuring the target rendering version to the configuration center;
    修改所述配置中心中的所述目标渲染版本的状态为激活状态;Modifying the status of the target rendering version in the configuration center to an active status;
    所述翻译器从所述配置中心中获取所述状态为激活状态对应的渲染版本的实现层信息;The translator obtains the implementation layer information of the rendering version corresponding to the activated state from the configuration center;
    在所述实现层中展现所述实现层信息对应的表单UI控件的实现层。The realization layer of the form UI control corresponding to the realization layer information is displayed in the realization layer.
  12. 如权利要求8所述的终端,其中,所述处理器执行所述至少一个计算机可读指令以实现所述对所述实现层中的表单UI控件进行渲染,生成表单页面时,具体包括:The terminal according to claim 8, wherein the processor executes the at least one computer-readable instruction to implement the rendering of the form UI control in the implementation layer, and when the form page is generated, it specifically includes:
    对所述实现层中的表单UI控件进行渲染得到表单UI控件的渲染片;Rendering the form UI control in the implementation layer to obtain a rendering piece of the form UI control;
    基于所述渲染片共同构成整张表单页面的渲染图;Based on the rendering pieces, a rendering image of the entire form page is formed together;
    基于所述渲染图生成表单页面。A form page is generated based on the rendering image.
  13. 如权利要求8所述的终端,其中,所述处理器执行所述至少一个计算机可读指令以实现所述创建字典时,具体包括:The terminal according to claim 8, wherein, when the processor executes the at least one computer-readable instruction to implement the dictionary creation, it specifically includes:
    获取所述多个历史表单名称及每个历史表单名称对应的表单UI控件协议层,每个所述表单UI控件协议层是由所述历史表单名称对应的多个表单UI控件的接口层组成的,每个所述表单UI控件的接口层携带有对应表单UI控件的控件名称;Acquire the multiple historical form names and the form UI control protocol layer corresponding to each historical form name, each of the form UI control protocol layers is composed of interface layers of multiple form UI controls corresponding to the historical form name , The interface layer of each form UI control carries a control name corresponding to the form UI control;
    将所述多个历史表单名称作为字典的第一层级,每个所述历史表单名称对应的多个表单UI控件的接口层作为字典的第二层级,多个表单UI控件的接口层对应的协议层作为字典的第三层级,其中,所述字典存储于区块链节点中。The multiple historical form names are taken as the first level of the dictionary, the interface layers of multiple form UI controls corresponding to each of the historical form names are taken as the second level of the dictionary, and the protocol corresponding to the interface layers of the multiple form UI controls The layer serves as the third layer of the dictionary, where the dictionary is stored in a blockchain node.
  14. 一种计算机可读存储介质,其上存储有计算机可读指令,其中,所述计算机可读存储介质存储有至少一个计算机可读指令,所述至少一个计算机可读指令被处理器执行时实现以下步骤:A computer-readable storage medium having computer-readable instructions stored thereon, wherein the computer-readable storage medium stores at least one computer-readable instruction, and when the at least one computer-readable instruction is executed by a processor, the following step:
    创建字典,其中所述字典携带有多个历史表单名称;Create a dictionary, where the dictionary carries multiple historical form names;
    接收用户输入的待创建表单的多个表单UI控件的控件名称;Receive the control names of multiple form UI controls of the form to be created input by the user;
    从所述字典中获取所述多个表单UI控件的控件名称对应的多个表单UI控件;Acquiring, from the dictionary, multiple form UI controls corresponding to the control names of the multiple form UI controls;
    将每个所述表单UI控件划分为接口层和实现层,其中,每个所述表单UI控件的接口层和实现层之间架构隔离层;Divide each of the form UI controls into an interface layer and an implementation layer, where an architectural isolation layer is between the interface layer and the implementation layer of each of the form UI controls;
    将每个所述表单UI控件对应的接口层中的协议内容拼接成中间语言;Splicing the protocol content in the interface layer corresponding to each of the form UI controls into an intermediate language;
    基于每个所述中间语言生成具有实现层的表单UI控件;Generating a form UI control with an implementation layer based on each of the intermediate languages;
    通过所述隔离层在所述实现层中展现具有实现层的表单UI控件;Displaying a form UI control with an implementation layer in the implementation layer through the isolation layer;
    对所述实现层中的表单UI控件进行渲染,生成表单页面。Rendering the form UI controls in the implementation layer to generate a form page.
  15. 如权利要求14所述的存储介质,其中,所述至少一个计算机可读指令被所述处理器执行以实现所述基于每个所述中间语言生成具有实现层的表单UI控件时,具体包括:The storage medium according to claim 14, wherein, when the at least one computer-readable instruction is executed by the processor to realize the generation of a form UI control with an implementation layer based on each of the intermediate languages, it specifically comprises:
    将每个所述中间语言输入到翻译器中;Input each of the intermediate languages into the translator;
    调用所述翻译器从配置中心请求所述中间语言对应的字典,并将所述字典设置为激 活状态;Calling the translator to request the dictionary corresponding to the intermediate language from the configuration center, and setting the dictionary to an active state;
    调用所述配置中心从注册表中读取处于激活状态的字典对应的表单UI控件;Calling the configuration center to read the form UI control corresponding to the dictionary in the active state from the registry;
    返回所述表单UI控件至所述翻译器;Return the form UI control to the translator;
    调用所述翻译器根据所述表单UI控件从每个所述中间语言中读取对应的表单UI控件的控件信息,其中,所述表单UI控件的控件信息对应有控件名称;Calling the translator to read the control information of the corresponding form UI control from each of the intermediate languages according to the form UI control, wherein the control information of the form UI control corresponds to the control name;
    基于所述表单UI控件的控件名称将从每个所述中间语言读取到的第一表单UI控件与所述配置中心从所述注册表中读取到的第二表单UI控件进行匹配,其中,所述从每个所述中间语言读取到的所述第一表单UI控件对应有接口层,所述配置中心从所述注册表中读取到的所述第二表单UI控件对应有实现层;Based on the control name of the form UI control, the first form UI control read from each intermediate language is matched with the second form UI control read from the registry by the configuration center, where , The first form UI control read from each of the intermediate languages corresponds to an interface layer, and the second form UI control read from the registry by the configuration center corresponds to an implementation Floor;
    关联相匹配的所述第一表单UI控件的接口层和所述第二表单UI控件的实现层,得到一个对应有接口层和实现层的表单UI控件列表;Associating the matching interface layer of the first form UI control and the implementation layer of the second form UI control to obtain a form UI control list corresponding to the interface layer and the implementation layer;
    调用所述翻译器读取所述表单UI控件列表中每个所述第二表单UI控件生成具有实现层的表单UI控件。Invoking the translator to read each second form UI control in the form UI control list to generate a form UI control with an implementation layer.
  16. 如权利要求14所述的存储介质,其中,所述至少一个计算机可读指令被所述处理器执行以实现所述将每个所述表单UI控件对应的接口层中的协议内容拼接成中间语言时,具体包括:The storage medium of claim 14, wherein the at least one computer-readable instruction is executed by the processor to implement the splicing of protocol content in the interface layer corresponding to each of the form UI controls into an intermediate language When, specifically include:
    接收表单画布中用户拖曳的表单UI控件;Receive the form UI controls dragged by the user in the form canvas;
    根据所述用户拖曳的顺序读取所述表单画布中的表单UI控件;Read the form UI controls in the form canvas according to the drag order of the user;
    每读取到一个表单UI控件,将所述表单UI控件对应的接口层中的协议内容拼接成中间语言。Each time a form UI control is read, the protocol content in the interface layer corresponding to the form UI control is spliced into an intermediate language.
  17. 如权利要求14所述的存储介质,其中,所述至少一个计算机可读指令被所述处理器执行以实现所述通过所述隔离层在所述实现层中展现具有实现层的表单UI控件时,具体包括:The storage medium according to claim 14, wherein the at least one computer-readable instruction is executed by the processor to realize the display of the form UI control with the realization layer in the realization layer through the isolation layer , Specifically including:
    获取所述具有实现层的表单UI控件对应的多个渲染版本;Acquiring multiple rendering versions corresponding to the form UI control with an implementation layer;
    注册所述多个渲染版本至注册表中,并将所述多个渲染版本的状态修改为挂起状态;Registering the multiple rendering versions in the registry, and modifying the status of the multiple rendering versions to a suspended state;
    确定所述注册表中的一个渲染版本为目标渲染版本,并将所述目标渲染版本配置到所述配置中心;Determining that a rendering version in the registry is a target rendering version, and configuring the target rendering version to the configuration center;
    修改所述配置中心中的所述目标渲染版本的状态为激活状态;Modifying the status of the target rendering version in the configuration center to an active status;
    所述翻译器从所述配置中心中获取所述状态为激活状态对应的渲染版本的实现层信息;The translator obtains the implementation layer information of the rendering version corresponding to the activated state from the configuration center;
    在所述实现层中展现所述实现层信息对应的表单UI控件的实现层。The realization layer of the form UI control corresponding to the realization layer information is displayed in the realization layer.
  18. 如权利要求14所述的存储介质,其中,所述至少一个计算机可读指令被所述处理器执行以实现所述对所述实现层中的表单UI控件进行渲染,生成表单页面时,具体包括:The storage medium of claim 14, wherein the at least one computer-readable instruction is executed by the processor to implement the rendering of the form UI control in the implementation layer, and when the form page is generated, it specifically includes :
    对所述实现层中的表单UI控件进行渲染得到表单UI控件的渲染片;Rendering the form UI control in the implementation layer to obtain a rendering piece of the form UI control;
    基于所述渲染片共同构成整张表单页面的渲染图;Based on the rendering pieces, a rendering image of the entire form page is formed together;
    基于所述渲染图生成表单页面。A form page is generated based on the rendering image.
  19. 如权利要求14所述的存储介质,其中,所述至少一个计算机可读指令被所述处理器执行以实现所述创建字典时,具体包括:The storage medium according to claim 14, wherein, when the at least one computer-readable instruction is executed by the processor to implement the dictionary creation, it specifically comprises:
    获取所述多个历史表单名称及每个历史表单名称对应的表单UI控件协议层,每个所述表单UI控件协议层是由所述历史表单名称对应的多个表单UI控件的接口层组成的,每个所述表单UI控件的接口层携带有对应表单UI控件的控件名称;Acquire the multiple historical form names and the form UI control protocol layer corresponding to each historical form name, each of the form UI control protocol layers is composed of interface layers of multiple form UI controls corresponding to the historical form name , The interface layer of each form UI control carries a control name corresponding to the form UI control;
    将所述多个历史表单名称作为字典的第一层级,每个所述历史表单名称对应的多个表单UI控件的接口层作为字典的第二层级,多个表单UI控件的接口层对应的协议层作为字典的第三层级,其中,所述字典存储于区块链节点中。The multiple historical form names are taken as the first level of the dictionary, the interface layers of multiple form UI controls corresponding to each of the historical form names are taken as the second level of the dictionary, and the protocol corresponding to the interface layers of the multiple form UI controls The layer serves as the third layer of the dictionary, where the dictionary is stored in a blockchain node.
  20. 一种表单页面生成装置,其中,所述表单页面生成装置包括:A form page generating device, wherein the form page generating device includes:
    创建模块,用于创建字典,其中所述字典携带有多个历史表单名称;The creation module is used to create a dictionary, where the dictionary carries multiple historical form names;
    接收模块,用于接收用户输入的待创建表单的多个表单UI控件的控件名称;The receiving module is used to receive the control names of multiple form UI controls of the form to be created input by the user;
    获取模块,用于从所述字典中获取所述多个表单UI控件的控件名称对应的多个表单UI控件;An obtaining module, configured to obtain multiple form UI controls corresponding to the control names of the multiple form UI controls from the dictionary;
    划分模块,用于将每个所述表单UI控件划分为接口层和实现层,其中,每个所述表单UI控件的接口层和实现层之间架构隔离层;The dividing module is used to divide each of the form UI controls into an interface layer and an implementation layer, where the interface layer and the implementation layer of each form UI control are an architectural isolation layer;
    拼接模块,用于将每个所述表单UI控件对应的接口层中的协议内容拼接成中间语言;The splicing module is used to splice the protocol content in the interface layer corresponding to each of the form UI controls into an intermediate language;
    生成模块,用于基于每个所述中间语言生成具有实现层的表单UI控件;A generating module for generating a form UI control with an implementation layer based on each of the intermediate languages;
    展现模块,用于通过所述隔离层在所述实现层中展现具有实现层的表单UI控件;A display module, configured to display a form UI control with an implementation layer in the implementation layer through the isolation layer;
    渲染模块,用于对所述实现层中的表单UI控件进行渲染,生成表单页面。The rendering module is used to render the form UI controls in the implementation layer to generate a form page.
PCT/CN2020/097119 2020-04-23 2020-06-19 Form page generation method and device, terminal, and storage medium WO2021212636A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010328627.5 2020-04-23
CN202010328627.5A CN111651158B (en) 2020-04-23 2020-04-23 Form page generation method, device, terminal and storage medium

Publications (1)

Publication Number Publication Date
WO2021212636A1 true WO2021212636A1 (en) 2021-10-28

Family

ID=72342891

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/097119 WO2021212636A1 (en) 2020-04-23 2020-06-19 Form page generation method and device, terminal, and storage medium

Country Status (2)

Country Link
CN (1) CN111651158B (en)
WO (1) WO2021212636A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115268916A (en) * 2022-09-29 2022-11-01 泰豪软件股份有限公司 Dynamic form implementation method and system based on low-code development platform

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113641671B (en) * 2021-07-14 2022-06-14 广州市玄武无线科技股份有限公司 Processing device and processing method for external data of form configuration module

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104267949A (en) * 2014-09-25 2015-01-07 成都国科海博信息技术股份有限公司 Form designer and form design method
US20160057220A1 (en) * 2014-08-20 2016-02-25 Samsung Electronics Co., Ltd. System for cloud computing using web components
CN106502973A (en) * 2016-09-19 2017-03-15 济南浪潮高新科技投资发展有限公司 A kind of universal description method of Form Designer control
CN108304179A (en) * 2016-10-08 2018-07-20 阿里巴巴集团控股有限公司 The method and device of pattern is introduced in a kind of Web Components components
CN109766097A (en) * 2018-12-15 2019-05-17 中国平安人寿保险股份有限公司 UI generation method, device, electronic equipment and computer readable storage medium

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7584416B2 (en) * 2006-02-21 2009-09-01 Microsoft Corporation Logical representation of a user interface form
US8352908B2 (en) * 2010-06-28 2013-01-08 International Business Machines Corporation Multi-modal conversion tool for form-type applications
CN105824647A (en) * 2016-04-05 2016-08-03 浪潮电子信息产业股份有限公司 Form page generating method and device
CN106598924A (en) * 2016-10-28 2017-04-26 深圳前海微众银行股份有限公司 Form generation method and device
CN109634598B (en) * 2018-12-14 2020-09-18 北京字节跳动网络技术有限公司 Page display method, device, equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160057220A1 (en) * 2014-08-20 2016-02-25 Samsung Electronics Co., Ltd. System for cloud computing using web components
CN104267949A (en) * 2014-09-25 2015-01-07 成都国科海博信息技术股份有限公司 Form designer and form design method
CN106502973A (en) * 2016-09-19 2017-03-15 济南浪潮高新科技投资发展有限公司 A kind of universal description method of Form Designer control
CN108304179A (en) * 2016-10-08 2018-07-20 阿里巴巴集团控股有限公司 The method and device of pattern is introduced in a kind of Web Components components
CN109766097A (en) * 2018-12-15 2019-05-17 中国平安人寿保险股份有限公司 UI generation method, device, electronic equipment and computer readable storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
RUAN YIFENG: "Web Components Introductory Examples and Tutorials", 6 August 2019 (2019-08-06), pages 1 - 9, XP055861187, Retrieved from the Internet <URL:http://www.ruanyifeng.com/blog/2019/08/web_components.html> *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115268916A (en) * 2022-09-29 2022-11-01 泰豪软件股份有限公司 Dynamic form implementation method and system based on low-code development platform

Also Published As

Publication number Publication date
CN111651158B (en) 2024-05-31
CN111651158A (en) 2020-09-11

Similar Documents

Publication Publication Date Title
CN110750654A (en) Knowledge graph acquisition method, device, equipment and medium
US10445423B2 (en) Domain-specific lexically-driven pre-parser
WO2021212636A1 (en) Form page generation method and device, terminal, and storage medium
WO2022142012A1 (en) Script configuration adjustment method and apparatus, electronic device, and storage medium
CN113094674A (en) Page display method and device, electronic equipment and storage medium
TW201610713A (en) Identifying and surfacing relevant report artifacts in documents
WO2023029509A1 (en) Dynamic service publishing method and apparatus, and electronic device and storage medium
CN114238808A (en) Page display method and device, computer equipment and storage medium
US11068664B2 (en) Generating comment excerpts within an online publication
WO2023040145A1 (en) Artificial intelligence-based text classification method and apparatus, electronic device, and medium
WO2022134809A1 (en) Model training processing method and apparatus, computer device, and medium
CN112799760B (en) Form rendering method and device
FI127955B (en) Layout guidance for localization
CN109035623A (en) Interface display method, interface display apparatus and the electronic equipment of self-aided terminal
CN116089535A (en) Data synchronization method, device, equipment and storage medium
WO2023272853A1 (en) Ai-based sql engine calling method and apparatus, and device and medium
US10769376B2 (en) Domain-specific lexical analysis
US20230177277A1 (en) Contextual dialogue framework over dynamic tables
US10140143B2 (en) Collection of guest status
CN115314570A (en) Data issuing method, device, equipment and medium based on protocol development framework
CN115698981A (en) Re-enrichment of oriented portions of a corpus based on NLP model enhancement
US10459748B2 (en) Transparent guest based notification overlay
US11977878B2 (en) System and method for managing software services in building customized software
US20210240469A1 (en) Method and apparatus for managing modules
US20230230324A1 (en) Method, System, Equipment and Medium for Modifying the Layering Layer Information of Finite Element Model Unit

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20932590

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 02.02.2023)

122 Ep: pct application non-entry in european phase

Ref document number: 20932590

Country of ref document: EP

Kind code of ref document: A1