Dynamic extension method of model and device thereof
By identifying target components and generating metadata from a graphical component library within a low-code development platform, and then using reflection technology to generate backend Java objects, the problem of slow backend service generation in low-code development is solved. This enables synchronous development of frontend web pages and backend services, improving development efficiency and program scalability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-10
- Publication Date
- 2026-03-24
AI Technical Summary
Existing low-code development platforms can quickly generate applications for front-end web technologies, but they cannot quickly generate back-end services, resulting in low development efficiency.
By identifying target components from a graphical component library, metadata for the business model is generated, and backend Java objects are generated using reflection technology, enabling synchronous development of frontend web pages and backend services.
It lowers the development threshold, increases the iteration speed, and enables application developers to design applications themselves in a visual way, dynamically enhance model functions, reduce program maintenance costs, and enhance program scalability.
Smart Images

Figure CN116088841B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of terminal equipment, financial technology and information technology industry, and particularly relates to a dynamic expansion method of a model and a device thereof. BACKGROUND
[0002] As a new trend of software development, a low-code development platform (LCDP) is a development platform that can quickly generate an application program without coding or through a small amount of code. The low-code development platform can use a reusable, component-based architecture for development, thereby accelerating the development and delivery cycle of an application program. The low-code development platform provides a visual modeling tool, so that developers with different experience levels can create a web page or a mobile application, a data model, and build a business process by dragging a component and model-driven logic, and add their own code if necessary. In the related art, the low-code development can quickly generate a front-end web page technology, but cannot quickly generate a back-end service. SUMMARY
[0003] The present application provides a dynamic expansion method of a model and a device thereof, to solve the problem that in the prior art, the low-code development can quickly generate a front-end web page technology, but cannot quickly generate a back-end service.
[0004] In a first aspect, the present application provides a dynamic expansion method of a model, comprising: determining a target component from a graphical component library, and generating a business model based on the target component; performing meta-model structuring on the business model to obtain metadata of the business model; and reflecting the metadata to generate a Java object of a business model runtime.
[0005] The present application provides a method of writing a business model through graphics, which can quickly generate a back-end Java object while generating a front-end web page. Compared with a traditional programming code writing method, when an application developer designs an application through a visual method, the threshold is low, the iteration speed is improved, the model function can be dynamically enhanced at runtime, the model method does not need to be defined in advance, the program maintenance cost is reduced, and the program expansion capability is enhanced.
[0006] In some embodiments, the meta-model structuring on the business model to obtain the metadata of the business model comprises: generating a meta-model of the business model based on a target component in the business model; and defining the meta-model according to a metadata format to obtain the metadata of the business model.
[0007] In some embodiments, the meta-model is defined according to a metadata format to obtain metadata of the business model, including: determining a key field of the target component and an attribute of the target component in the meta-model; and defining the key field and the attribute of the target component according to the metadata format to obtain the metadata.
[0008] In some embodiments, the metadata is reflected to generate a Java object of a business model runtime, including: parsing the metadata through a parsing engine to obtain core elements of the Java object, wherein the core elements include object fields, object methods and object constructors; and generating the Java object of the business model runtime based on the core elements of the Java object.
[0009] In some embodiments, the target component is determined from a graphical component library, and the business model is generated based on the target component, including: selecting one or more target components from candidate components in the graphical component library; determining an attribute of the target component; and generating the business model based on the target component and the attribute of the target component.
[0010] In some embodiments, after the metadata is reflected to generate the Java object of the business model runtime, the method further includes: determining to-be-filled data of the business model; and calling and running a class file of the Java object to write the to-be-filled data into the metadata during runtime of the class file to obtain a running result of the business model.
[0011] In a second aspect, the present application provides a dynamic extension device of a model, including: a determining module configured to determine a target component from a graphical component library and generate a business model based on the target component; an obtaining module configured to structure the business model according to a meta-model to obtain metadata of the business model; and a reflecting module configured to reflect the metadata to generate a Java object of a business model runtime.
[0012] In some embodiments, the obtaining module is further configured to: generate a meta-model of the business model based on the target component in the business model; and define the meta-model according to a metadata format to obtain the metadata of the business model.
[0013] In some embodiments, the obtaining module is further configured to: determine a key field of the target component and an attribute of the target component in the meta-model; and define the key field and the attribute of the target component according to the metadata format to obtain the metadata.
[0014] In some embodiments, the reflecting module is further configured to: parse the metadata through a parsing engine to obtain core elements of the Java object, wherein the core elements include object fields, object methods and object constructors; and generate the Java object of the business model runtime based on the core elements of the Java object.
[0015] In some embodiments, the determining module is further configured to: select one or more target components from the candidate components in the graphical component library; determine attributes of the target components; and generate the business model based on the target components and the attributes of the target components.
[0016] In some embodiments, the dynamic expansion apparatus of the model further includes a data determining module configured to determine to-be-filled data of the business model; and a calling module configured to call and run a class file of the Java object, and write the to-be-filled data into the metadata during the running of the class file, to obtain a running result of the business model.
[0017] In a third aspect, the present application provides an electronic device, comprising: a processor, and a memory connected with the processor in communication; the memory stores computer execution instructions; and the processor executes the computer execution instructions stored in the memory to implement the dynamic expansion method of the model as described above.
[0018] In a fourth aspect, the present application provides a computer readable storage medium, when the computer readable storage medium stores computer execution instructions, the computer execution instructions are executed by the processor to implement the dynamic expansion method of the model as described above.
[0019] In a fifth aspect, the present application provides a computer program product, comprising computer programs / instructions, characterized in that the computer programs / instructions are executed by the processor to implement the dynamic expansion method of the model as described above.
[0020] The dynamic expansion method of the model, the apparatus, the device and the storage medium provided by the present application determine target components from a graphical component library, and generate a business model based on the target components; perform meta-model structuring on the business model to obtain metadata of the business model; and perform reflection on the metadata to generate a Java object for the business model runtime. The present application provides a method for writing a business model through graphing, which can quickly generate a backend Java object while generating a front-end web page. Compared with the traditional programming code writing method, when an application developer designs an application through a visual method, the threshold is lower, the iteration speed is improved, the program can dynamically enhance the model function during the runtime, the model method does not need to be defined in advance, the program maintenance cost is reduced, and the expansion capability of the program is enhanced. BRIEF DESCRIPTION OF DRAWINGS
[0021] The above and / or additional aspects and advantages of the present application will become apparent and more readily appreciated from the following description of embodiments, taken in conjunction with the accompanying drawings, in which:
[0022] Figure 1 is a schematic diagram of an exemplary embodiment of a dynamic expansion method of a model according to an embodiment of the present application;
[0023] Figure 2is a schematic diagram of generating a business model based on a target component according to an embodiment of the present application;
[0024] Figure 3 is a schematic diagram of an exemplary embodiment of a dynamic extension method of a model according to an embodiment of the present application;
[0025] Figure 4 is a schematic diagram of a framework of a dynamic extension method of a model according to an embodiment of the present application;
[0026] Figure 5 is a schematic diagram of a dynamic extension method of a model according to an embodiment of the present application;
[0027] Figure 6 is a schematic diagram of a dynamic extension device of a model according to an embodiment of the present application;
[0028] Figure 7 is a schematic diagram of an electronic device according to an embodiment of the present application.
[0029] The specific embodiments have been shown and described in the above drawings and written description with the specific embodiments. Further, it is to be understood that the above description is intended to come within the scope of the claims and that changes can be made in the order, equivalents, and substitutes for those parts of the application detailed herein. Additionally, it is intended that distinct embodiments not be construed as being within or without the scope of the current application unless such a constructive interpretation is explicitly set forth in the claims. DETAILED DESCRIPTION
[0030] The exemplary embodiments will be described in detail herein with reference to the attached drawings. The description of the exemplary embodiments is intended to apply to all alternative embodiments, unless it is otherwise indicated. It is to be understood that other embodiments can be utilized, and structural or procedural changes can be made without departing from the scope of the present application. Furthermore, where possible, like reference numerals will be used throughout the several drawings to refer to the same or like parts.
[0031] Terminology:
[0032] Dynamic proxy technology: Dynamic proxy is a technology that creates a proxy object of a target object during program running, and enhances the function of the methods in the target object. The proxy object created by the proxy class during program running is called a dynamic proxy object. In this case, the created proxy object is not defined in advance in the Java code. Instead, it is dynamically generated during running according to the "instructions" in the dynamic proxy object. That is, if you want to get a proxy of an object, the dynamic proxy will dynamically generate the proxy object of the object. Dynamic proxy can enhance the function of the methods of the object being proxied. With the technology of dynamic proxy, the function of the methods of the object being proxied can be enhanced without modifying the source code of the method.
[0033] Reflection technology: This mechanism allows a program to obtain internal information of any class with a known name at runtime through Reflection APIs, including its modifiers (such as public, static, etc.), superclass (such as Object), implemented interfaces (such as Cloneable), as well as all information about fields and methods, and can change the content of fields or invoke methods at runtime.
[0034] Model: This refers to the backend entity model, an abstraction of actual business operations. This patent mainly includes model entities, model operations, and model extensions. For example, an order model includes the order entity, the order creation operation, and extended methods such as order payment.
[0035] Figure 1 This application illustrates an exemplary implementation of a method for dynamically expanding a model, such as... Figure 1 As shown, the dynamic expansion method of this model includes the following steps:
[0036] S101: Determine the target component from the graphical component library and generate a business model based on the target component.
[0037] As enterprises accelerate their digital transformation, more and more personalized applications are emerging, requiring more efficient and accessible development methods. Low-code development has thus emerged. Low-code platforms allow developers to develop software without writing code, using a graphical drag-and-drop interface, significantly improving work efficiency.
[0038] Figure 2 This application illustrates a schematic diagram of generating a business model based on target components, such as... Figure 2 As shown, taking the creation of a leave application process as an example, Figure 2 The left side shows several candidate components from the graphical component library. Figure 2 The right side shows a business model generated from multiple target components identified from a graphical component library. Target components can be dragged and dropped to the right to form the business model.
[0039] S102, perform meta-model structuring on the business model to obtain the metadata of the business model.
[0040] The business model is meta-modeled to obtain metadata of the business model. The meta-model is used to define the format of the metadata content, such as the structural definition of object fields (Fields), the structural definition of object methods (Functions), and the structural definition of object constructors (Constructors). Optionally, the metadata storage format is Json.
[0041] S103, reflecting the metadata to generate Java objects of the business model runtime.
[0042] The low-code development platform includes a front-end module and a back-end module, and the front-end module and the back-end module are independent of each other. For software developers, they are mainly concerned about three things, object fields (Fields), object methods (Functions), and object constructors (Constructors). In this application, based on dynamic proxy and reflection technology, the metadata is parsed at metadata runtime to generate Java objects of the business model runtime.
[0043] The embodiment of the application provides a dynamic expansion method of a model, which comprises the following steps: determining a target component from a graphical component library, and generating a business model based on the target component; meta-modeling the business model to obtain metadata of the business model; and reflecting the metadata to generate Java objects of the business model runtime. The application provides a method for writing a business model through graphical programming, which can quickly generate back-end Java objects while generating front-end web pages. Compared with traditional programming code writing methods, when application developers design applications through a visual method, the threshold is lower, the iteration speed is improved, the model function can be dynamically enhanced at runtime, the model method does not need to be defined in advance, the program maintenance cost is reduced, and the program expansion capability is improved.
[0044] Figure 3 The embodiment of the application provides a dynamic expansion method of a model, which comprises the following steps: determining a target component from a graphical component library, and generating a business model based on the target component; meta-modeling the business model to obtain metadata of the business model; and reflecting the metadata to generate Java objects of the business model runtime. The application provides a method for writing a business model through graphical programming, which can quickly generate back-end Java objects while generating front-end web pages. Compared with traditional programming code writing methods, when application developers design applications through a visual method, the threshold is lower, the iteration speed is improved, the model function can be dynamically enhanced at runtime, the model method does not need to be defined in advance, the program maintenance cost is reduced, and the program expansion capability is improved. Figure 3 The embodiment of the application provides a dynamic expansion method of a model, which comprises the following steps: determining a target component from a graphical component library, and generating a business model based on the target component; meta-modeling the business model to obtain metadata of the business model; and reflecting the metadata to generate Java objects of the business model runtime. The application provides a method for writing a business model through graphical programming, which can quickly generate back-end Java objects while generating front-end web pages. Compared with traditional programming code writing methods, when application developers design applications through a visual method, the threshold is lower, the iteration speed is improved, the model function can be dynamically enhanced at runtime, the model method does not need to be defined in advance, the program maintenance cost is reduced, and the program expansion capability is improved.
[0045] S301, determining a target component from a graphical component library, and generating a business model based on the target component.
[0046] One or more target components are selected from candidate components in the graphical component library, the attributes of the target components are determined, and the business model is generated based on the target components and the attributes of the target components.
[0047] S302, generating a meta-model of the business model based on the target components in the business model.
[0048] According to the target component in the business model, a meta model of the business model is generated.
[0049] S303, defining the meta model according to the meta data format to obtain the meta data of the business model.
[0050] The key field of the target component and the attribute of the target component in the meta model are determined, and the key field and the attribute of the target component are defined according to the meta data format to obtain the meta data.
[0051] S304, the meta data is parsed by the parsing engine to obtain the core elements of the Java object, wherein the core elements include object fields, object methods and object constructors.
[0052] The meta data is parsed by the parsing engine to obtain the core elements of the Java object, wherein the core elements include object fields (Fields), object methods (Functions) and object constructors (Constructors).
[0053] The parsing engine can run in Jar mode using Springboot technology. Springboot: a Java software program can run in Jar package mode and be recognized by the computer in process mode.
[0054] Figure 4 is a model of a dynamic expansion method framework diagram shown in this application, as Figure 4 shown, the meta model defines the meta data format, the meta data is parsed by the parsing engine to obtain the core elements of the Java object, wherein the core elements include object fields (Fields), object methods (Functions) and object constructors (Constructors).
[0055] S305, based on the core elements of the Java object, the Java object of the business model runtime is generated.
[0056] According to the core elements of the Java object obtained above, that is, according to the object fields (Fields), object methods (Functions) and object constructors (Constructors) obtained above, the Java object of the business model runtime is generated.
[0057] The application provides a method for business model writing through graphing, which can quickly generate a back-end Java object while generating a front-end webpage.
[0058] Further, after reflecting the metadata and generating the Java object of the business model runtime, the data to be filled in the business model needs to be determined, and the class file of the Java object needs to be called and run, so as to write the data to be filled in the metadata during the runtime of the class file, and obtain the running result of the business model.
[0059] Figure 5 is a general flowchart of a model dynamic expansion method shown in the application, as shown in Figure 5 The model dynamic expansion method comprises the following steps:
[0060] S501, selecting one or more target components from candidate components in a graphical component library.
[0061] S502, determining the attributes of the target components.
[0062] S503, generating a business model based on the target components and the attributes of the target components.
[0063] S504, generating a meta model of the business model based on the target components in the business model.
[0064] For the specific implementation of steps S501-S504, refer to the specific description of the related part in the above embodiment, which will not be repeated here.
[0065] S505, determining the key field of the target component in the meta model and the attributes of the target component.
[0066] S506, defining the key field and the attributes of the target component according to the metadata format to obtain the metadata.
[0067] For the specific implementation of steps S505-S506, refer to the specific description of the related part in the above embodiment, which will not be repeated here.
[0068] S507, parsing the metadata through a parsing engine to obtain the core elements of the Java object, wherein the core elements include object fields, object methods and object constructors.
[0069] S508, based on the core element of the Java object, generating the Java object of the business model runtime.
[0070] For the specific implementation of steps S507-S508, refer to the specific description of the related part in the above embodiment, which will not be repeated here.
[0071] S509, determining the data to be filled in the business model.
[0072] S510, calling and running the class file of the Java object, writing the data to be filled in the metadata during the class file runtime, and obtaining the running result of the business model.
[0073] For the specific implementation of steps S509-S510, refer to the specific description of the related part in the above embodiment, which will not be repeated here.
[0074] The embodiment of the application provides a dynamic expansion method of a model, which determines a target component from a graphical component library, generates a business model based on the target component, structures the business model according to a meta model, obtains metadata of the business model, and reflects the metadata to generate a Java object of the business model runtime. The application provides a method of writing a business model through graphing, which can quickly generate a backend Java object while generating a front-end web page. Compared with the traditional programming code writing method, when an application developer designs an application through a visual method, the threshold is low, the iteration speed is improved, the model function can be dynamically enhanced during the program runtime, the model method does not need to be defined in advance, the program maintenance cost is reduced, and the expansion ability of the program is improved.
[0075] Figure 6 is a schematic diagram of a model dynamic expansion device provided by the application, as shown in Figure 6 The model dynamic expansion device 600 includes a determination module 601, an acquisition module 602, and a reflection module 603, wherein:
[0076] The determination module 601 is configured to determine a target component from a graphical component library, and generate a business model based on the target component.
[0077] The acquisition module 602 is configured to structure the business model according to a meta model, and obtain metadata of the business model.
[0078] The reflection module 603 is configured to reflect the metadata, and generate a Java object of the business model runtime.
[0079] The device provides a method for business model writing through graphing, which can quickly generate a back-end Java object while generating a front-end web page. Compared with a traditional programming code writing method, when an application developer designs an application through a visual method, the threshold is lower, the iteration speed is improved, the model function can be dynamically enhanced at runtime, the model method does not need to be defined in advance, the program maintenance cost is reduced, and the program expansion ability is enhanced.
[0080] In some embodiments, the obtaining module 602 is further configured to generate a meta model of the business model based on the target component in the business model; and define the meta model according to a metadata format to obtain the metadata of the business model.
[0081] In some embodiments, the obtaining module 602 is further configured to determine a key field of the target component and an attribute of the target component in the meta model; and define the key field and the attribute of the target component according to the metadata format to obtain the metadata.
[0082] In some embodiments, the reflecting module 603 is further configured to parse the metadata through a parsing engine to obtain core elements of the Java object, wherein the core elements include object fields, object methods and object constructors; and generate the Java object of the business model runtime based on the core elements of the Java object.
[0083] In some embodiments, the determining module 601 is further configured to select one or more target components from candidate components in a graphical component library; determine an attribute of the target component; and generate the business model based on the target component and the attribute of the target component.
[0084] In some embodiments, the dynamic expansion device of the model 600 further includes a data determining module 604 configured to determine to-be-filled data of the business model; and a calling module 605 configured to call and run a class file of the Java object, and write the to-be-filled data into the metadata at runtime of the class file to obtain a running result of the business model.
[0085] Figure 7 A structural schematic diagram of an electronic device provided by the embodiments of the present application is shown in FIG. 1. Figure 7 As shown in FIG. 1, the electronic device can include a transceiver 71, a processor 72 and a memory 73.
[0086] The processor 72 executes computer-executed instructions stored in the memory, so that the processor 72 performs the solutions in the above embodiments. The processor 72 can be a general-purpose processor, including a central processing unit CPU, a network processor NP, etc.; can also be a digital signal processor DSP, an application-specific integrated circuit ASIC, a field programmable gate array FPGA or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component.
[0087] The memory 73 is connected with the processor 72 through the system bus and completes mutual communication, and the memory 73 is used for storing computer program instructions.
[0088] The transceiver 71 can be used to determine a target component from a graphical component library, and generate a business model based on the target component; perform meta-model structuring on the business model to obtain metadata of the business model; and perform reflection on the metadata to generate Java objects of a runtime of the business model.
[0089] The system bus can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The system bus can be divided into an address bus, a data bus, a control bus, etc. For the convenience of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. The transceiver is used to realize the communication between the database access device and other computers (such as clients, read-write libraries and read-only libraries). The memory can include random access memory (RAM), and can also include non-volatile memory.
[0090] The electronic device provided by the embodiment of the application can be the terminal device of the above embodiment.
[0091] The embodiment of the application further provides a chip for running instructions, which is used to execute the dynamic expansion method of the model in the above embodiment.
[0092] The embodiment of the application further provides a computer readable storage medium, which stores computer instructions, and when the computer instructions run on a computer, the computer executes the dynamic expansion method of the model in the above embodiment.
[0093] The embodiment of the present application further provides a computer program product, which comprises a computer program stored in a computer readable storage medium, at least one processor can read the computer program from the computer readable storage medium, and the at least one processor executes the computer program to realize the dynamic expansion method of the model in the above embodiment.
[0094] Other embodiments of the application will be apparent to those skilled in the art from consideration of the specification and practice of the application disclosed herein. It is intended that the specification and examples be considered as exemplary only, with the true scope and spirit of the application being indicated by the following claims.
[0095] It is to be understood that the application is not limited to the precise details of construction and the above-described embodiments and that various modifications and changes can be effected therein by those skilled in the art without departing from the scope of the application. The scope of the application should be determined by the terms of the following claims.
Claims
1. A method for dynamically expanding a model, characterized in that, include: Identify target components from a graphical component library and generate a business model based on those target components; The business model is structured into a metamodel to obtain the metadata of the business model; The metadata is parsed by a parsing engine to obtain the core elements of the Java object, wherein the core elements include object fields, object methods, and object constructors; Based on the core elements of the Java object, a Java object for the business model runtime is generated; Determine the data to be populated in the business model; The class file of the Java object is called and run. When the class file is running, the data to be populated is written into the metadata to obtain the running result of the business model.
2. The method according to claim 1, characterized in that, The meta-model structuring of the business model to obtain the metadata of the business model includes: Based on the target component in the business model, a meta-model of the business model is generated; The metadata of the business model is obtained by defining the meta-model according to the metadata format.
3. The method according to claim 2, characterized in that, The process of defining the meta-model according to the metadata format to obtain the metadata of the business model includes: Determine the key fields and attributes of the target component in the metamodel; The key field and the attributes of the target component are defined according to the metadata format to obtain the metadata.
4. The method according to any one of claims 1-3, characterized in that, The step of determining the target component from the graphical component library and generating a business model based on the target component includes: Select one or more target components from the candidate components in the graphical component library; Determine the properties of the target component; The business model is generated based on the target component and its attributes.
5. A dynamic expansion device for a model, characterized in that, include: The determination module is used to determine the target component from the graphical component library and generate a business model based on the target component; The acquisition module is used to perform metamodel structuring on the business model to obtain the metadata of the business model; The reflection module is used to parse the metadata through the parsing engine to obtain the core elements of the Java object. The core elements include object fields, object methods, and object constructors. Based on the core elements of the Java object, the Java object for the business model runtime is generated. The data determination module is used to determine the data to be filled in the business model; The calling module is used to call and run the class file of the Java object, write the data to be populated into the metadata when the class file is running, and obtain the running result of the business model.
6. The apparatus according to claim 5, characterized in that, The acquisition module is also used for: Based on the target component in the business model, a meta-model of the business model is generated; The metadata of the business model is obtained by defining the meta-model according to the metadata format.
7. The apparatus according to claim 6, characterized in that, The acquisition module is also used for: Determine the key fields and attributes of the target component in the metamodel; The key field and the attributes of the target component are defined according to the metadata format to obtain the metadata.
8. The apparatus according to any one of claims 5-7, characterized in that, The determining module is further configured to: Select one or more target components from the candidate components in the graphical component library; Determine the properties of the target component; The business model is generated based on the target component and its attributes.
9. An electronic device, characterized in that, include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the method as described in any one of claims 1-4.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1-4.
11. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements the method of any one of claims 1-4.
Citation Information
Patent Citations
Processing method, device and system for webpage request
CN106293688A
Hyper dynamic JAVA management extension
US20180314498A1