Dynamic rendering method, system and device based on low code configuration
Through a dynamic rendering method based on low-code configuration, using the json file and interface mechanism, the problem of increasing the number of code writing in the traditional dynamic rendering method is solved, flexible parameter rendering and rapid configuration are realized, and development time is reduced.
Patent Information
- Application Number
- CN202411964322.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-04-29
AI Technical Summary
In low-code configuration, the traditional dynamic rendering method requires calling the rendering logic method in the code, resulting in an increase in the amount of code writing, and the code needs to be modified and redeployed when subsequent data rendering changes, which is cumbersome.
The dynamic rendering method based on low-code configuration is adopted, and the parameter rendering is configured through the json file, and the dynamic rendering interface and Java reflection mechanism are used to reduce code writing, and support in-parameter rendering, out-parameter rendering, data check-up and database interaction.
Flexible parameter rendering is realized, and subsequent data rendering changes do not require code changes, but only configuration files need to be modified, reducing the amount of code writing and development time.
Smart Images

Figure CN119902760A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer software technology, and in particular to a dynamic rendering method, system and device based on low-code configuration. Background Art
[0002] As the Internet develops, more and more network systems emerge. In a complete system, in order to maintain the perfection of a system's page, the style of its network pages will be kept unified. However, in the process of developing such a unified style system, each web page layout needs to be redeveloped and rewritten, which is inevitably a time-consuming operation. For such a unified style page, low-code configuration has emerged. Low-code configuration can ensure that as little code as possible is written, and only a drag-and-drop method is needed to generate a page. Developers only need to fill in the required data in the page.
[0003] However, in terms of data query or display, since the input / output parameter data cannot be directly used for database query operations and page data display, the input and output parameters need to be dynamically rendered to complete the query / display operation. For example, there is an account table, and the account number is stored in the acct_no field of the data table in an encrypted manner. However, when we query a certain account number on the page, we enter plain text such as "123", so such a query will inevitably fail to find the result. Therefore, we need to render the plain text into cipher text as a condition for database query. At this time, the dynamic rendering system can be applied. It can further reduce the workload of code writing on the basis of low code. Developers only need to implement a set of rendering for a certain type or data, and configure it in the specified file in the form of json to complete the input and output parameter rendering of the relevant data.
[0004] Traditional dynamic rendering implements the rendering logic in the code. Every time rendering is needed in the code, the rendering logic method needs to be called. Although this method can be implemented, it still increases the amount of code to be written from a low-code perspective. At the same time, if the rendered data needs to be changed later, we need to find the rendering logic in the code, modify it, and then repackage and deploy it, which is a more troublesome operation. If we change the rendering method to a non-code method, this will further reduce the amount of code to be written. Summary of the invention
[0005] The purpose of the present invention is to address the deficiencies in the prior art and to propose a dynamic rendering method, system and device based on low-code configuration. Based on the traditional low-code configuration method of parameter rendering using a method of calling a specified rendering code class, a method of parameter rendering through json file configuration is added. This rendering method is particularly suitable for rendering common data.
[0006] The object of the present invention is to achieve the following technical solution: a dynamic rendering method based on low-code configuration, the method comprising:
[0007] (1) Set up a dynamic rendering interface containing a unique ID, including an input parameter rendering interface, an output parameter rendering interface, a data verification interface, and an addition, deletion, and modification interface;
[0008] (2) The configuration files of various rendering modes are associated with the corresponding unique IDs. The corresponding configuration files are found by calling the dynamic rendering interface specified in the low-code.
[0009] (3) Configure interface parameters, use the Java reflection mechanism to find the corresponding class file through the interface name, and execute the logic in the class.
[0010] Furthermore, the input parameter rendering interface is used to perform relevant data processing on the parameters passed by the front end. By specifying the interface name in the corresponding configuration file, the specified parameters can be input and rendered.
[0011] Furthermore, the parameter rendering interface is used to render the enumeration code and decrypt the fields in the business logic code, and then return it for display on the page.
[0012] Furthermore, the data verification interface is used to globally implement all parameters that need to be judged whether they are empty.
[0013] Furthermore, the CRUD interface implements codeless interaction with the database and performs CRUD operations on a single table.
[0014] In a second aspect, the present invention further provides a dynamic rendering system based on low-code configuration, the system comprising:
[0015] The configuration file parsing module is used to parse the content of the format specified by the file and convert it into the corresponding format for storage;
[0016] The cache module is used to store the parsed related file content into the cache, and quickly find the corresponding method class from the cache and call it when using the related rendering method;
[0017] The built-in rendering module is used to set up a dynamic rendering interface containing a unique ID, including an input parameter rendering interface, an output parameter rendering interface, a data verification interface, an addition, deletion, and modification interface, and a business layer call interface; the unique ID is associated with the configuration files of various rendering methods; the business layer call interface uses reflection to call the specified code class to execute custom business logic.
[0018] In a third aspect, the present invention also provides a dynamic rendering device based on low-code configuration, comprising a memory and one or more processors, wherein the memory stores executable code, and when the processor executes the executable code, the dynamic rendering method based on low-code configuration is implemented.
[0019] In a fourth aspect, the present invention also provides a computer-readable storage medium having a program stored thereon, and when the program is executed by a processor, the dynamic rendering method based on low-code configuration is implemented.
[0020] In a fifth aspect, the present invention also provides a computer program product, including a computer program, which, when executed by a processor, implements the dynamic rendering method based on low-code configuration.
[0021] Beneficial effects of the present invention:
[0022] 1. The present invention changes the rendering of inherent page input and output parameters from a method of calling a rendering code class to a configurable method for implementation.
[0023] 2. The present invention makes data rendering more flexible than the original code-based method. If there are subsequent changes in data rendering, developers do not need to modify the code and repackage it, but only need to modify the configuration file.
[0024] 3. The rendering method of the present invention supports multiple configurations, and developers can freely choose which rendering configuration logic to use according to their business needs.
[0025] 4. Most of the commonly used rendering operations are embedded in the system, which reduces the time for users to write common rendering methods from scratch. At the same time, users can perform secondary writing operations on the interfaces provided by the system to implement their own rendering logic. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0027] Figure 1 It is a flow chart of starting and loading a configuration file of the dynamic rendering system of the present invention.
[0028] Figure 2 It is a flow chart of the execution system module of the dynamic rendering system of the present invention.
[0029] Figure 3 It is a structural diagram of a dynamic rendering device based on low-code configuration provided by the present invention. DETAILED DESCRIPTION
[0030] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described below in conjunction with the accompanying drawings and implementation examples. It should be understood that the specific implementation examples described herein are only used to explain the present invention and are not used to limit the present invention.
[0031] The first aspect of the present invention provides a dynamic rendering method based on a low-code configuration.
[0032] Through the various interfaces provided by the present invention, the methods inside each interface are re-implemented to realize the rendering of various parameters. Each interface includes an input parameter rendering interface, an output parameter rendering interface, a data verification interface, and an addition, deletion and modification interface. For the dynamic rendering interfaces described above, after implementation, it is only necessary to call the interface specified in the low code. According to the unique ID passed in the parameter, the present invention will find the corresponding configuration file according to this ID, and then implement the various rendering methods configured in the file, and perform various logics such as rendering, judgment, processing, and verification on the parameters passed by the front end. The provided interface will be briefly described below.
[0033] (1) Input parameter rendering interface. This interface is used to process the relevant data of the parameters passed by the front end. After the developer implements this interface, he can specify the interface name in the corresponding configuration file to perform input parameter rendering on the specified parameters. For example, the bank card number is stored in the database in base64 encryption. The card number parameter passed is in plain text and needs to be converted into ciphertext for data query.
[0034] (2) Output parameter rendering interface. In contrast to the input parameter rendering mentioned above, data storage, on the one hand, in order to maximize disk storage data, generally uses digital storage as the enumeration code; on the other hand, in order to ensure data security, the data will be encrypted (such as the bank card number field mentioned in (1) above), and then the enumeration code will be rendered and the field will be decrypted in the business logic code, and then returned and displayed on the page.
[0035] (3) Data verification interface. There are two ways to use traditional data verification to determine whether the parameters are empty. The first is that for the post request interface, the parameters can be received through the pojo entity class method, and annotations such as @NotNull or @NotBlank can be added to the attributes of the entity class to verify whether the data is filled in; the other way is to judge in the code. Both of these data verification methods have defects - they are repeated operations on a machine and are not easy to maintain. The first method requires adding the above-mentioned annotations to the attributes of the pojo entity class. The second method requires the use of if conditional judgment statements, which increases the difficulty of reading the code. The data verification interface provided by the present invention only needs to rewrite the corresponding interface and configure it in the configuration file, so that all parameters that need to be judged whether they are empty can be implemented globally through one method. In addition to verifying whether the data is an empty interface, this system supports all custom checks required in all requirements. Developers only need to implement the verification interface to implement custom logic. Take the empty verification method as an example: developers only need to add the configuration of the verification parameters in the json configuration file, and place the field name (name) and type (verification type) in the child configuration, as shown below;
[0036] "check":{
[0037] "type":"notNu11",
[0038] "name":"custName"
[0039] }
[0040] When the system is initialized and loaded, it will call the interface to determine whether the specified configuration file contains the verification configuration, and then point to the specified verification method through the type type, and then use the StringUtils class provided by JDK to verify whether it is an empty operation. Although the empty judgment implemented in this system is also processed by the for loop plus judgment method, the advantage is that this verification method can be used anywhere in all current projects, reducing code redundancy.
[0041] (4) Add, delete and modify interface. The present invention realizes the function of interacting with the database without coding. After the interface is implemented, it can support the addition, deletion and modification of a single table. At the same time, the system has built-in default addition, deletion and modification interface rewriting implementation class, and developers do not need to implement it by themselves. Developers only need to add relevant configurations in the json file, such as adding a new data interface: configure the key value in json as the Insert parameter, and its sub-level configure the corresponding parameters, as shown below.
[0042] "insert":{
[0043] "table":"Student"
[0044] }
[0045] "delete":{
[0046] "table":"order",
[0047] "primaryKey":[
[0048] "id",
[0049]
[0050] The system will determine whether there is an Insert configuration, then locate the table name through tablle, obtain the table fields (the relevant table structure needs to be maintained in the specified location of this system), and then match the fields and the passed parameters one by one and store them in the Map for processing, and then call the data interaction component (such as MyBatis-plus) to perform the warehousing operation.
[0051] (5) The business layer calls the interface. In the original low-code configuration system, after the page is configured, the controller interface in the code is directly called to execute business logic processing, and then the corresponding data is returned and displayed on the page. The present invention adds a new layer of processing in the traditional low-code configuration system, that is, the low-code configuration system specifies the corresponding file of the corresponding dynamic rendering system through a unique key, first performs the above-mentioned (1), (2), (3), and (4) data processing, and then configures the httpUrl interface parameter (hereinafter referred to as httpUrl) through a configuration in the file, and uses the Java reflection mechanism to find the corresponding class file through the interface name to execute the logic in the class.
[0052] (6) Database interaction query interface. The display of some page data in the low-code development process is relatively simple. It may only be necessary to query a table from the database or associate multiple tables to complete the page display. Therefore, based on (5), the present invention does not need to be completed by writing business code through a custom controller interface, and simultaneously provides the ability to interact directly with the database. The developer only needs to configure an id (hereinafter referred to as sqlId) that specifies the location of the sql statement. Note: The role of sqlId is to locate the sql maintained in the configuration file through this configuration, perform related operations such as preprocessing on the sql statement after obtaining it, and then call the database interaction component (such as MyBatis-plus) to perform data operations. At the same time, based on the interfaces provided by (4) and (5), if the three are configured in the synchronization configuration file, only one will be executed in the order of (6)>(5)>(4).
[0053] The second aspect provides a dynamic rendering system based on low-code configuration. The system includes a configuration file parsing module, a cache module, a built-in default rendering module, and a database interaction module.
[0054] The configuration file parsing module, when the system is started, will parse the files in the specified path under the current project, parse the content in the specified format and convert it into the format of the corresponding Table class for storage.
[0055] In order to improve the execution speed of the system, the cache module uses the concept of exchanging space for time, and stores the content of the first parsing of the relevant files when the system is started into the cache, so that when the relevant rendering method is used subsequently, the corresponding method class can be quickly found from the cache and called quickly, thereby reducing the execution time of the system.
[0056] The built-in rendering module, in order to facilitate the daily development of developers, this system has built-in a large number of data rendering modules commonly used in daily development for the relevant interfaces of the first aspect mentioned above. The built-in rendering modules of each interface will be briefly described below.
[0057] (1) Input parameter rendering interface, this interface has built-in:
[0058] The decryption module is used to decrypt the input data. The default decryption encoding is base64 decryption encoding.
[0059] The encryption module is the opposite of a), used for data encryption. The default encoding is base64. The encryption and decryption modules provided by this system also support customizable encryption and decryption encoding.
[0060] The string segmentation module can segment the input fields using the segmentation characters specified by the developer for use in subsequent business logic.
[0061] Date rendering module, because date processing is basically used in development, it involves date and time conversion. This rendering module supports conversion between various types of dates.
[0062] (2) Output parameter rendering interface, this interface has built-in:
[0063] The same encryption and decryption module and date conversion module as a), b) and d) in (1) above.
[0064] Desensitization module, this default module is used for data desensitization of parameter data. It supports configurable size of desensitized data. During the desensitization process, the plaintext data is saved in the cache to facilitate the use of subsequent pages to display the plaintext.
[0065] Amount unit conversion module, this module can convert the unit "centi" to "yuan".
[0066] Enumeration code rendering Chinese module, as described in the first aspect above, generally only the enumeration code is stored in the stored data, and it is rendered in Chinese in the subsequent code. Therefore, this system has a built-in code rendering module. Developers only need to store the enumeration code and Chinese name in the specified dictionary table, specify the type of this enumeration, and then configure it in the specified position of the file to realize the dynamic rendering function.
[0067] (3) Data verification interface, which has built-in:
[0068] Null value field verification module. This system provides a module to verify whether the specified field is empty, which is used to prevent null pointer errors during subsequent business logic development.
[0069] (4) Add, delete and modify interface. This interface has built-in:
[0070] Add, delete and modify module. To facilitate developers to perform add, delete and modify operations on a single table, this system provides a built-in add, delete and modify operation module. Developers can specify the following parameters in the configuration file to directly operate on a single table: type: operation type (INSERT - insert, UPDATE - update, DELETE - delete), tableName: table name, this field is used to determine which table to operate on, primaryKey: primary key name, this parameter configuration is used for the above-mentioned insert and update operations. Use this field to specify which database data to operate on. It can support the use of commas to separate and pass in multiple parameters.
[0071] (5) Business layer call interface. This interface has built-in methods for calling corresponding business interfaces through httpUrl in this system. Developers only need to configure the httpUrl parameter. When the system finds that this parameter is not empty and does not have sqlId, it obtains the instance beans of all interfaces through Spring's Ioc container management function, and determines whether the interface name is the same as the httpUrl parameter value in turn, and then uses reflection to call the specified code class to execute custom business logic.
[0072] (6) Database interaction interface. This interface has built-in logic for querying data through sqlId. It can locate the file storing sql through sqlId and retrieve sql for parsing and execution.
[0073] The third aspect is to provide a dynamic rendering configuration based on low-code configuration. When this system implements dynamic rendering, in order to ensure the flexibility of the system, it is implemented in the form of json file configuration without having to re-build and package the project, just modify the configuration file. The file is configured in the specified file path, so that when the system starts, it can correctly read the dynamic rendering configuration for subsequent data rendering operations.
[0074] The advantage of the low-code configuration provided by the present invention is that it is convenient for developers to reduce development time by dragging and dropping when configuring the same page style. However, for back-end developers, this only reduces part of the time for front-end and back-end joint debugging, and cannot greatly reduce too much time in business logic development. The requirements in various business developments are different, so there is no way to optimize development in business codes. However, data is different. The rendering and verification of data during the development process are an indispensable part of daily development. In this regard, the dynamic rendering and dynamic verification of data can be extracted to make a system similar to that only needs a set of formulas to process data. For each type of data processing, only a set of data processing logic needs to be written, and fast configuration is achieved through json files.
[0075] The second advantage of the present invention is the data acquisition operation. Even if the traditional low-code configuration only queries the data in the data table, the developer needs to obtain the relevant data by writing the interface logic. This system has a built-in database interaction function. Combined with Mybatis-plus, you only need to configure a sqlId and a sql statement to query the data to implement the table query operation. There is no need to write interface logic code, which speeds up the development of developers.
[0076] Corresponding to the aforementioned embodiment of a dynamic rendering method based on low-code configuration, the present invention also provides an embodiment of a dynamic rendering device based on low-code configuration.
[0077] See also Figure 3 A dynamic rendering device based on low-code configuration provided by an embodiment of the present invention includes a memory and one or more processors, wherein the memory stores executable code, and when the processor executes the executable code, it is used to implement a dynamic rendering method based on low-code configuration in the above embodiment.
[0078] An embodiment of a dynamic rendering device based on a low-code configuration provided by the present invention can be applied to any device with data processing capabilities, and the device with data processing capabilities can be a device or apparatus such as a computer. The device embodiment can be implemented through software, or through hardware or a combination of software and hardware. Taking software implementation as an example, as a device in a logical sense, it is formed by the processor of any device with data processing capabilities in which it is located reading the corresponding computer program instructions in the non-volatile memory into the memory for execution. From a hardware perspective, if Figure 3 As shown, it is a hardware structure diagram of any device with data processing capability where a dynamic rendering device based on low-code configuration provided by the present invention is located, except Figure 3 In addition to the processor, memory, network interface, and non-volatile memory shown, any device with data processing capabilities in which the apparatus in the embodiments is located may also include other hardware, generally based on the actual functions of the device with data processing capabilities, which will not be described in detail.
[0079] The implementation process of the functions and effects of each unit in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, and will not be repeated here.
[0080] For the device embodiment, since it basically corresponds to the method embodiment, the relevant parts can refer to the partial description of the method embodiment. The device embodiment described above is only schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units 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 may be selected according to actual needs to achieve the purpose of the scheme of the present invention. Ordinary technicians in this field can understand and implement it without paying creative work.
[0081] An embodiment of the present invention also provides a computer-readable storage medium on which a program is stored. When the program is executed by a processor, a dynamic rendering method based on low-code configuration in the above embodiment is implemented.
[0082] The computer-readable storage medium may be an internal storage unit of any device with data processing capability described in any of the aforementioned embodiments, such as a hard disk or a memory. The computer-readable storage medium may also be an external storage device of any device with data processing capability, such as a plug-in hard disk, a smart media card (SMC), an SD card, a flash card, etc. equipped on the device. Furthermore, the computer-readable storage medium may also include both an internal storage unit and an external storage device of any device with data processing capability. The computer-readable storage medium is used to store the computer program and other programs and data required by any device with data processing capability, and may also be used to temporarily store data that has been output or is to be output.
[0083] The present invention also provides a computer program product, including a computer program, which, when executed by a processor, implements the dynamic rendering method based on low-code configuration.
[0084] The above embodiments are used to illustrate the present invention rather than to limit the present invention. Any modification and change made to the present invention within the spirit of the present invention and the protection scope of the claims shall fall within the protection scope of the present invention.
Claims
1. A dynamic rendering method based on low-code configuration, characterized in that: The method includes: (1) Set up a dynamic rendering interface containing a unique ID, including an input parameter rendering interface, an output parameter rendering interface, a data verification interface, and an addition, deletion, and modification interface; (2) The configuration files of various rendering modes are associated with the corresponding unique IDs. The corresponding configuration files are found by calling the dynamic rendering interface specified in the low-code. (3) Configure interface parameters, use the Java reflection mechanism to find the corresponding class file through the interface name, and execute the logic in the class.
2. According to a dynamic rendering method based on low-code configuration according to claim 1, it is characterized in that: The input parameter rendering interface is used to process the relevant data of the parameters passed by the front end. By specifying the interface name in the corresponding configuration file, the specified parameters can be input and rendered.
3. According to the low-code configuration-based dynamic rendering method of claim 1, it is characterized in that: The output parameter rendering interface is used to render the enumeration code and decrypt the fields in the business logic code, and then return it to be displayed on the page.
4. According to the low-code configuration-based dynamic rendering method of claim 1, it is characterized in that: The data verification interface is used to globally implement all parameters that need to be judged whether they are empty.
5. According to the low-code configuration-based dynamic rendering method of claim 1, it is characterized in that: The CRUD interface implements codeless interaction with the database and performs CRUD operations on a single table.
6. A dynamic rendering system for implementing the dynamic rendering method based on low-code configuration as described in any one of claims 1 to 5, characterized in that: The system includes: The configuration file parsing module is used to parse the content of the format specified by the file and convert it into the corresponding format for storage; The cache module is used to store the parsed related file content into the cache, and quickly find the corresponding method class from the cache and call it when using the related rendering method; The built-in rendering module is used to set up a dynamic rendering interface containing a unique ID, including an input parameter rendering interface, an output parameter rendering interface, a data verification interface, an addition, deletion, and modification interface, and a business layer call interface; the unique ID is associated with the configuration files of various rendering methods; the business layer call interface uses reflection to call the specified code class to execute custom business logic.
7. A dynamic rendering device based on low-code configuration, comprising a memory and one or more processors, wherein the memory stores executable code, characterized in that: When the processor executes the executable code, a dynamic rendering method based on low-code configuration as described in any one of claims 1-5 is implemented.
8. A computer-readable storage medium having a program stored thereon, characterized in that: When the program is executed by the processor, a dynamic rendering method based on low-code configuration as described in any one of claims 1-5 is implemented.
9. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, a dynamic rendering method based on low-code configuration as described in any one of claims 1 to 5 is implemented.