A meta-model-based intelligent approval method, device, equipment and medium
Through the intelligent approval method based on meta-model, the meta-model approval flow is constructed, which solves the complexity and high cost of the traditional BPM2.0 model, and achieves more convenient system integration and higher flexibility.
Patent Information
- Application Number
- CN202410103373.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-24
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2044-01-24
AI Technical Summary
The traditional BPM2.0 model is complex and costly when building approval flows, which leads to difficulty in system integration deployment, lack of flexibility and high technical threshold.
Using an intelligent approval method based on meta-model, a meta-model approval flow is constructed, including application nodes, approval nodes and gateway nodes, and the first UserTask meta-model generates approval content, and the approval results are generated based on the approval content and gateway meta-model.
Compared with the BPM2.0 model, the meta-model-based method is more convenient, reducing costs, facilitating system integration and deployment, and improving the flexibility of integration with third-party systems and reducing technical thresholds.
Smart Images

Figure CN117931143B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computers, and in particular to a meta-model-based intelligent approval method, device, equipment and medium. Background Art
[0002] At present, the traditional approval flow method is to first abstract the approval flow process into a BPM2.0 standard model, and use the database to store the relevant model status and business data to realize the status transfer and approval execution of the approval flow process. However, the model abstraction of BPM2.0 is very complex and the number is huge. For users, the learning cost and usage cost are relatively high. At the same time, the use of the BPM2.0 model causes the code volume of the entire approval flow engine to be huge, which is not conducive to system integration and deployment. When integrating with third-party systems, it lacks certain flexibility and requires a high technical threshold. Summary of the invention
[0003] The embodiment of the present application provides an intelligent approval method, device, equipment and medium based on a meta-model to solve at least one problem existing in the related technology. The technical solution is as follows:
[0004] In a first aspect, an embodiment of the present application provides an intelligent approval method based on a metamodel, comprising:
[0005] In response to the construction instruction, a metamodel approval flow is constructed, wherein the metamodel approval flow includes an application node, an approval node, and a gateway node, wherein the application node includes a first UserTask metamodel, the approval node includes a second UserTask metamodel, and the gateway node includes a gateway metamodel;
[0006] In response to the input instruction, the metamodel approval flow is started, and approval content is generated through the first UserTask metamodel;
[0007] An approval result is generated according to the approval content, the gateway metamodel and the second UserTask metamodel.
[0008] In one implementation, generating approval content through the first UserTask metamodel includes:
[0009] Obtaining input application information through the first UserTask metamodel;
[0010] Constructing approval data according to the application information in a preset format of field keywords and values corresponding to the field keywords;
[0011] The approval content is generated according to the approval data and the model ID of the first UserTask meta-model.
[0012] In one implementation, when the gateway node includes a parallel gateway sub-node and a merged gateway sub-node, generating an approval result according to the approval content, the gateway meta-model, and the second UserTask meta-model includes:
[0013] When there are multiple approval nodes, several target approval nodes are determined according to the model ID, and the approval content is transmitted to different target approval nodes in parallel through the gateway metamodel of the parallel gateway subnode;
[0014] According to the second UserTask metamodel of different target approval nodes and the approval content, a plurality of sub-approval results are obtained;
[0015] The approval result is generated by merging the sub-approval results of the gateway metamodel of the gateway sub-node and performing merging processing.
[0016] In one implementation, when the gateway node includes an internal and external condition gateway node, generating an approval result according to the approval content, the gateway metamodel, and the second UserTask metamodel includes:
[0017] Determine the application type corresponding to the approval content according to the gateway metamodel of the internal and external condition gateway node and the approval content, where the application type includes an external application and an internal application;
[0018] Determine the target approval node according to the application type and model ID;
[0019] The approval content is transmitted to the target approval node through the gateway metamodel of the internal and external condition gateway node, so as to generate an approval result through the second UserTask metamodel of the target approval node.
[0020] In one embodiment, the second UserTask meta-model according to different target approval nodes and the approval content obtains a plurality of sub-approval results including:
[0021] Acquire the approval content and the component type corresponding to the approval content on the display page through the approval flow engine;
[0022] Rendering the approval content according to the component type and displaying it on a display page in different target approval nodes;
[0023] In response to the approval instructions of different display pages, several sub-approval results are obtained.
[0024] In one embodiment, in response to the building instruction, building the metamodel approval flow includes:
[0025] In response to the first build sub-instruction, the application node, the approval node and the gateway node are established, and model information of the first UserTask metamodel, the second UserTask metamodel and the gateway metamodel are generated accordingly, wherein the model information includes a model ID and a metamodel type identifier;
[0026] In response to the second build sub-instruction, generating a plurality of wiring meta-models;
[0027] Constructing the metamodel approval flow according to the connection metamodel, the application node, the approval node and the gateway node;
[0028] The connection meta-model represents the sequential relationship between the meta-models in the meta-model approval flow, and the connection starting point and the connection end point of the connection meta-model are the model IDs of different meta-models.
[0029] In one embodiment, the method further comprises:
[0030] Obtaining node information of all child nodes of the application node from the memory according to the model information;
[0031] According to the node information, construct an attribute SQL database execution language;
[0032] According to the attribute SQL database execution language, database persistence mapping is performed.
[0033] In a second aspect, the embodiment of the present application provides an intelligent approval device based on a meta-model, including:
[0034] A first response module, configured to construct a metamodel approval flow in response to a construction instruction, wherein the metamodel approval flow includes an application node, an approval node, and a gateway node, wherein the application node includes a first UserTask metamodel, the approval node includes a second UserTask metamodel, and the gateway node includes a gateway metamodel;
[0035] A second response module, configured to start the metamodel approval flow in response to an input instruction, and generate approval content through the first UserTask metamodel;
[0036] A generation module is used to generate an approval result according to the approval content, the gateway meta-model and the second UserTask meta-model.
[0037] In one embodiment, the first response module is further configured to:
[0038] Obtaining node information of all child nodes of the application node from the memory according to the model information;
[0039] Construct attribute SQL database execution language;
[0040] Database persistence mapping is performed according to the attribute SQL database execution language, the model information of the application node and the node information.
[0041] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a processor and a memory, wherein the memory stores instructions, and the instructions are loaded and executed by the processor to implement a method in any one of the above-mentioned embodiments.
[0042] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed, the method in any one of the above-mentioned embodiments is implemented.
[0043] The beneficial effects of the above technical solution include at least:
[0044] By responding to the build instruction, a metamodel approval flow is constructed, the metamodel approval flow includes an application node, an approval node and a gateway node, the application node includes a first UserTask metamodel, the approval node includes a second UserTask metamodel, and the gateway node includes a gateway metamodel. In response to the input instruction, the metamodel approval flow is started, and the approval content is generated through the first UserTask metamodel. According to the approval content, the gateway metamodel and the second UserTask metamodel, the approval result is generated. Constructing the metamodel approval flow based on the metamodel is more convenient than the BPM2.0 model, which is conducive to reducing costs and facilitating system integration and deployment.
[0045] The above summary is for illustrative purposes only and is not intended to be limiting in any way. In addition to the illustrative aspects, embodiments and features described above, further aspects, embodiments and features of the present application will be readily apparent by reference to the accompanying drawings and the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In the accompanying drawings, unless otherwise specified, the same reference numerals throughout the multiple drawings represent the same or similar parts or elements. These drawings are not necessarily drawn to scale. It should be understood that these drawings only depict some embodiments disclosed in the present application and should not be regarded as limiting the scope of the present application.
[0047] Figure 1 This is a schematic diagram of the steps of the intelligent approval method based on the metamodel according to an embodiment of the present application;
[0048] Figure 2 This is a schematic diagram of the metamodel approval flow of an embodiment of the present application;
[0049] Figure 3 This is a structural block diagram of an intelligent approval device based on a metamodel according to an embodiment of the present application;
[0050] Figure 4 This is a structural block diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0051] In the following, only some exemplary embodiments are briefly described. As those skilled in the art will appreciate, the described embodiments may be modified in various ways without departing from the spirit or scope of the present application. Therefore, the drawings and descriptions are considered to be exemplary and non-restrictive in nature.
[0052] Reference Figure 1 , a flowchart of an intelligent approval method based on a metamodel according to an embodiment of the present application is shown. The intelligent approval method based on a metamodel may at least include steps S100-S300:
[0053] S100: In response to a building instruction, building a metamodel approval flow.
[0054] In one embodiment, Figure 2 The metamodel approval flow in is taken as an example for explanation. In other embodiments, the metamodel approval flow may be in other forms. Figure 2 As shown, the metamodel approval flow includes a start node (START) 201, an application node (applicant) 202, approval nodes 203, 204, 205 (manager approval, department manager approval, and industry manager approval), a gateway node (including a parallel gateway subnode 206 (parallel gateway-parallel), a merge gateway subnode 207 (parallel gateway-merge), an internal and external condition gateway node (external and internal condition gateway) 208) and an end node (END) 209; at the same time, the metamodel approval flow also includes a number of connection metamodels 210 (not all of which are marked). It should be noted that in some embodiments, the application node can be directly used as the start node, and the gateway node or the approval node can be used as the end node, without setting the start node and the end node.
[0055] It should be noted that each node is constructed based on the metamodel. For example, when each node is constructed, the model information of the metamodel will be generated accordingly, including model information including but not limited to name, model ID, metamodel type identifier (MetaType), metamodel business identifier (kind, which is not necessary for some metamodels, but in the case of representing fields, it can help modelers communicate with business personnel, and obtain the corresponding business value object through code and this information during the development stage), ParentID (the parent node ID of the business model tree where the metamodel is located during the modeling process. When retrieving the metamodel in memory, the subordinate relationship of the metamodel can be limited). The point (START) 201 includes the Start metamodel, the application node (applicant) 202 includes the first UserTask metamodel, each approval node includes the second UserTask metamodel, and each second UserTask metamodel also includes an approval button (Action metamodel), the gateway metamodels of the parallel gateway subnode 206 and the merged gateway subnode 207 are both ParallelGateway metamodels, and the gateway metamodel of the internal and external condition gateway node 208 is Condition. Gateway metamodel, the end node (END) 209 includes the End metamodel, the connection metamodel 210 may include a Forward connection or a Cancel connection, the connection metamodel represents the order relationship between each metamodel in the metamodel approval flow, and the connection start point and the connection end point of the connection metamodel are both model IDs of different metamodels. Figure 2 As shown, the starting point of a connection metamodel 210 is the model ID of the metamodel of the internal and external condition gateway node 208, and the end point of the connection is the model ID of the metamodel of the approval node 203. In the metamodel approval flow, if the result of the application type obtained by the internal and external condition gateway node 208 is an external application, the next node reached at this time is the approval node 203. Therefore, based on the model ID of the metamodel and the connection metamodel, the approval flow engine can know which node is the next node of the approval flow, so that the approval flow proceeds smoothly. Optionally, the connection metamodel can cancel the connection by Cancel connection.
[0056] For example, the model information of the start node 201 may include:
[0057] {ID: / a / b / c (model ID)
[0058] MetaType: START
[0059] Kind:Start
[0060] Name: Approval flow start node
[0061] ParentID: / a / b
[0062] Attributes: { / / Absorb the difference attributes between metamodels (Map, memory metamodel structure)
[0063] }, where Attributes stores some specific differentiated attribute information of the metamodel.
[0064] For example, the model information of the application node 202 may include:
[0065] {
[0066] ID: / a / b / d (model ID)
[0067] MetaType: UserTask
[0068] Kind: shenqing
[0069] Name:Applicant
[0070] ParentID: / a / b
[0071] Attributes: { / / Absorb the difference attributes between metamodels (Map)
[0072] Policy:{orientation:Administrative department, Role:Ordinary employee}, / / Permission role information
[0073] }
[0074] In the embodiment of the present application, the design of storing tree structure data in a two-dimensional array is implemented through the ParentId field, providing performance support for accessing structure data.
[0075] S200 . In response to an input instruction, start a metamodel approval flow and generate approval content through a first UserTask metamodel.
[0076] S300: Generate an approval result according to the approval content, the gateway metamodel and the second UserTask metamodel.
[0077] The meta-model-based intelligent approval method of the embodiment of the present application can be executed by an electronic control unit, controller, processor, etc. of a terminal such as a computer, a mobile phone, a tablet, or a vehicle-mounted terminal, or can be executed by a cloud server, for example, by a system in a cloud server.
[0078] The technical solution of the embodiment of the present application constructs a metamodel approval flow in response to a construction instruction. The metamodel approval flow includes an application node, an approval node and a gateway node. The application node includes a first UserTask metamodel, the approval node includes a second UserTask metamodel, and the gateway node includes a gateway metamodel. In response to an input instruction, the metamodel approval flow is started to implement an intelligent approval process. Approval content is generated through the first UserTask metamodel, and approval results are generated based on the approval content, the gateway metamodel and the second UserTask metamodel. The metamodel approval flow is constructed based on the metamodel, which is more convenient than the BPM2.0 model, helps reduce costs, and facilitates system integration and deployment; and is more flexible, which reduces the technical threshold when integrating with third-party systems.
[0079] In one embodiment, step S100 includes steps S110-S130:
[0080] S110. In response to the first construction sub-instruction, establish an application node, an approval node, and a gateway node, and generate model information of a first UserTask metamodel, a second UserTask metamodel, and a gateway metamodel accordingly.
[0081] like Figure 2 As shown, the user can operate in the system to generate construction instructions, such as the first construction sub-instruction and the second construction sub-instruction. Optionally, the system responds to the first construction sub-instruction to establish a start node (START) 201, an application node (applicant) 202, approval nodes 203, 204, 205 (manager approval, department manager approval and industry manager approval), a gateway node (including a parallel gateway sub-node 206 (parallel gateway-parallel), a merge gateway sub-node 207 (parallel gateway-merge), an internal and external condition gateway node (external and internal condition gateway) 208) and an end node (END) 209, and will generate the model information of the corresponding meta-model in each node (as recorded in the above content).
[0082] S120. In response to the second construction sub-instruction, generate a plurality of wiring meta-models.
[0083] Alternatively, if Figure 2 As shown, in response to the second build sub-instruction, a plurality of wiring meta-models 210 are generated.
[0084] S130: Construct a metamodel approval flow according to the connection metamodel, application nodes, approval nodes and gateway nodes.
[0085] Optionally, the approval flow engine constructs a metamodel approval flow based on the connection metamodel, application nodes, approval nodes, gateway nodes, start nodes, and end nodes.
[0086] It should be noted that the user can operate in the system through keyboard, mouse, touch screen, etc., so as to generate various instructions in the system, such as building instructions, input instructions, etc.
[0087] In one embodiment, in step S200, the user (applicant) can input application information to generate an input instruction, and the system responds to the input instruction to start the metamodel approval flow. For ease of description, the present application embodiment takes the approval flow of leave as an example, and other embodiments may be other approval flows.
[0088] In one embodiment, when starting the metamodel approval flow, the approval flow engine will calculate the path information (visual model tree path) of each node and metamodel, determine the execution order, and use it as the key information for parsing the memory metamodel to perform the aggregation information processing of dynamic content. For example, the path information may include:
[0089] -id: primary key information
[0090] -kind: node identification keyword
[0091] -parentkey: parent node id
[0092] -orientationkey: the path to the root node (composed of the node IDs concatenated with the string "-")
[0093] In one implementation, in step S200, generating approval content through the first UserTask metamodel includes steps S210-S230:
[0094] S210 . Obtain input application information through the first UserTask metamodel.
[0095] For example, the applicant enters application information in the first UserTask metamodel of the application node 202:
[0096] name: Information of the person who requested leave
[0097] vacation: number of days off
[0098] startDay: the start date of the leave
[0099] endDay: the leave end date.
[0100] After entering the application information, the first UserTask metamodel also provides an Apply button: connected to the START node as the start node of the approval flow, a Cancel button: which can withdraw the pre-application state from the next node state to which it is connected, and a Keep button: which can save the application as the pre-application state.
[0101] S220. Construct approval data according to the application information in a preset format of field keywords and values corresponding to the field keywords.
[0102] In the embodiment of the present application, in order to pass the context of approval data in the approval flow, a preset format for approval data construction is set: field keywords and values corresponding to field keywords. For example, the approval data is: [{name: Zhang San, vacation: 3, startDay: 2023 / 12 / 12, endDay: 2023 / 12 / 14},
[0103] {name: Zhang San, vacation: 1, startDay: 2023 / 12 / 16, endDay: 2023 / 12 / 16}].
[0104] Compared with the traditional construction method of [new application information], it can avoid the unpacking and packing process in the process of business object processing, thereby improving processing performance.
[0105] S230 : Generate approval content according to the approval data and the model ID of the first UserTask meta-model.
[0106] For example, assuming that the model ID of the first UserTask metamodel is / a / b / d, the final business content of the context is the approval content. The approval content is the Model metamodel, and the Model metamodel has the corresponding ModelID. Through the basic data types of the Map structure, the business and data are decoupled. For example, the approval content is:
[0107] {
[0108] / a / b / d: [{name: Zhang San, vacation: 3, startDay: 2023 / 12 / 12, endDay: 2023 / 12 / 14},
[0109] {name: Zhang San, vacation: 1, startDay: 2023 / 12 / 16, endDay: 2023 / 12 / 16}]
[0110] ModelID2:[…]
[0111] }
[0112] In one implementation, step S300 may include steps S310A-S330A:
[0113] S310A: When there are multiple approval nodes, determine several target approval nodes according to the model ID, and transmit the approval content to different target approval nodes in parallel through the gateway metamodel of the parallel gateway subnode.
[0114] For example, Figure 2 As shown, it includes multiple approval nodes such as approval nodes 204 and 205. At this time, if the judgment result of the internal and external condition gateway node 208 is an internal application, several target approval nodes can be determined according to the model ID of the gateway metamodel of the internal and external condition gateway node 208. Optionally, the connection metamodel 210 can be used to determine the model ID of the gateway metamodel of the internal and external condition gateway node 208, so as to determine the model ID of the connection end point. For example, the ID of the second UserTask metamodel of the approval node 204 and 205 can be determined as the connection end point, so as to determine the approval node 204 and 205 as the target approval node. Then, the approval content is transmitted to different target approval nodes in parallel through the gateway metamodel of the parallel gateway subnode 206, such as being transmitted to the approval nodes 204 and 205.
[0115] S320A: Obtain a number of sub-approval results according to the second UserTask meta-model of different target approval nodes and approval contents.
[0116] In the embodiment of the present application, the second UserTask metamodel has an approval button (Action metamodel), so in the approval nodes 204 and 205, the department manager and the industry approval manager can perform approval operations through the approval button (Action metamodel) to obtain a number of corresponding sub-approval results, which can be, for example, approval or rejection.
[0117] Optionally, when the approval flow performs context transfer, the approval flow engine obtains the approval content and the component type component corresponding to the approval content on the display page, wherein each data content in the approval content may have corresponding different components, and the components may be preset in advance. Then, the approval flow engine associates the approval content with the component type component, uses the approval content as the basic information for rendering, and then performs rendering processing according to the component type component and the approval content, and displays it on the display page of different target approval nodes. At this time, after understanding the approval content on the display page, the approval operation can be performed through the approval button (Action metamodel) in the second UserTask metamodel to generate an approval instruction. The Action metamodel of the target approval node responds to the approval instruction and obtains several corresponding sub-approval results.
[0118] S330A: Generate an approval result by merging the gateway metamodel sub-approval results of the gateway sub-nodes.
[0119] Optionally, if all the sub-approval results are approval, all the sub-approval results of the gateway metamodel of the merging gateway subnode 207 are merged to generate an approval result, such as approval, which is transmitted to the end node 209, and the approval result is returned to the application node 202 through the End metamodel. It can be understood that if any sub-approval result is rejection, the approval sub-result is returned to the application node 202 at this time, so that the applicant knows the final result of the approval.
[0120] It should be noted that in some embodiments, there may be only one approval node, and in this case, no gateway node may be provided.
[0121] In one implementation, step S300 may include steps S310B-S330B:
[0122] S310B, determining the application type corresponding to the approval content according to the gateway meta-model of the internal and external condition gateway node and the approval content.
[0123] Optionally, the application type includes an external application and an internal application. For example, the gateway metamodel of the internal and external condition gateway node 208 can match the name in the approval content, such as the leave requester information, with the pre-set content based on the pre-set internal and external lists, architecture, etc., to determine whether the application type is an external application or an internal application.
[0124] S320B. Determine the target approval node according to the application type and model ID.
[0125] Optionally, if the application type is an internal application, based on the model ID as the principle of step S310A, combined with the connection metamodel 210, the model ID of the gateway metamodel whose connection starting point is the internal and external condition gateway node 208 is determined, thereby determining the model ID of the connection end point, and the node of the model ID is the target approval node. Similarly, if the application type is an external application, the model ID of the gateway metamodel whose connection starting point is the internal and external condition gateway node 208 can be determined in combination with the connection metamodel 210, thereby determining the model ID of the connection end point, and finally determining the target approval node as the approval node 203.
[0126] S330B, transmitting the approval content to the target approval node through the gateway metamodel of the internal and external condition gateway node, so as to generate the approval result through the second UserTask metamodel of the target approval node.
[0127] Specifically, the approval content is transmitted to the target approval node through the gateway metamodel of the internal and external condition gateway node, so as to generate the approval result through the second UserTask metamodel of the target approval node. For example, through the approval button (Action metamodel) of the second UserTask metamodel, the department manager, industry approval manager or manager can perform the approval operation through the approval button (Action metamodel) and finally obtain the approval result, such as approval or rejection.
[0128] In one implementation, the metamodel-based intelligent approval method of the embodiment of the present application may further include step S400, including steps S410-S430:
[0129] S410. Obtain node information of all child nodes of the application node from the memory according to the model information.
[0130] Optionally, in the metamodel approval flow, since there is an execution order between nodes, the node with a higher order can be considered as the parent node of the node with a lower order, for example, the start node 201 is the parent node of all nodes after the start node 201, and the application node 202 is the parent node of all nodes after the application node 202. Conversely, all nodes after the application node 202 are child nodes of the application node 202. Therefore, taking the application node 202 as an example, based on the model ID of the first UserTask metamodel of the application node 202, all child nodes of the application node 202 can be searched: orientationkey like "$^{d.orientationkey}^%" and parentkey=${d.id}, and then the node information of all child nodes is obtained. The node information includes but is not limited to the model information in the node, the approval content obtained by the node, the approval sub-result (or approval result), etc.
[0131] S420: Construct an attribute SQL database execution language according to the node information.
[0132] Optionally, via a loop like:
[0133] For(node information)
[0134] Splicing and constructing attribute SQL database execution language
[0135] End.
[0136] S430, performing database persistence mapping according to the attribute SQL database execution language.
[0137] Then, using the constructed attribute SQL database execution language, the node information of the metamodel in each node is converted into the corresponding SQL statement element, and the database persistence mapping of the data is performed, thereby realizing the storage of data in the approval flow.
[0138] The approval flow state management of the embodiment of the present application obtains the corresponding approval flow state information through the approval flow service persistence database of the approval flow DB, isolates the state of the approval flow from the state of the approval business object, and realizes the reuse of multiple approval objects of the approval flow. The isolation form is shown in Table 1 of the state table. Among them, in the state table, only the business primary key information is stored, and the BusinessKey field is used as the association field with the business data table to realize the isolation of the approval flow state from the business object data, that is, the metamodel of each node. Id is the metamodel ID, BusinessKey is the business primary key, Name is the metamodel name, UserTaskID is the current approval node UserTaskID, FlowCode is the execution node ID (ActionID), FlowStatus is the current approval status: normal / abnormal, and MetaType is the metamodel type identifier.
[0139] Table 1
[0140]
[0141] The approval flow permission management of the embodiment of the present application converts the traditional DB permission management into a memory-based permission matching mechanism by binding permissions to the metamodel. The permissions include: Model table access permissions of the Model metamodel, Property field access permissions, and Rule row-level data access permissions. The Policy access policy is added to the above three metamodels during the construction phase. After the metamodel is loaded into the memory, the corresponding permission information can be obtained through the access method (GetPolicy (model ID of the metamodel)) provided by the Policy to perform business operations when the service is called.
[0142] Optionally, the permissions element is defined as follows:
[0143] SG: Scope (Organization)
[0144] Role: Role (business role)
[0145] Rule: rules (dynamically injected into SQL to affect business data operations)
[0146] The binding of the above three elements will be implemented in the memory (processed as metamodel attributes). In the process of implementing the memory metamodel to business processing, the SG and Role are verified. If passed, the Rule is injected into the corresponding SQL statement to implement permission verification and rule injection.
[0147] Through the intelligent approval method based on metamodel in the embodiment of the present application, the traditional approval flow modeling is made more abstract and generalized. Different from the traditional approval flow object instantiation process, a single instance of the metamodel is kept in memory, and the metamodel instance is encapsulated through basic data types, which reduces the unpacking and packing process in the model object instantiation process and greatly reduces the amount of code. At the same time, the approval flow metamodel information is reused from the memory dimension to realize the approval flow engine driven by the metamodel. In addition, the traditional approval flow front-end development is converted into a visual zero / low-code implementation, which greatly reduces the technical threshold of front-end developers, greatly improves development efficiency and development quality, and shortens the delivery cycle of front-end projects.
[0148] Reference Figure 3 , shows a structural block diagram of an intelligent approval device based on a metamodel according to an embodiment of the present application, and the device may include:
[0149] A first response module, configured to construct a metamodel approval flow in response to a construction instruction, wherein the metamodel approval flow includes an application node, an approval node, and a gateway node, wherein the application node includes a first UserTask metamodel, the approval node includes a second UserTask metamodel, and the gateway node includes a gateway metamodel;
[0150] A second response module, configured to start a metamodel approval flow in response to an input instruction, and generate approval content through the first UserTask metamodel;
[0151] The generation module is used to generate the approval result according to the approval content, the gateway metamodel and the second UserTask metamodel.
[0152] In one embodiment, the first response module is further configured to:
[0153] Obtain node information of all child nodes of the application node from memory according to model information;
[0154] Construct attribute SQL database execution language;
[0155] According to the attribute SQL database execution language, the model information of the application node and the node information, the database persistence mapping is performed.
[0156] The functions of each module in each device in the embodiments of the present application can be found in the corresponding description in the above method, and will not be repeated here.
[0157] Reference Figure 4, shows a structural block diagram of an electronic device according to an embodiment of the present application, the electronic device includes: a memory 310 and a processor 320, the memory 310 stores instructions that can be run on the processor 320, and the processor 320 loads and executes the instructions to implement the intelligent approval method based on the metamodel in the above embodiment. The number of the memory 310 and the processor 320 can be one or more.
[0158] In one embodiment, the electronic device also includes a communication interface 330 for communicating with external devices and performing data exchange transmission. If the memory 310, the processor 320 and the communication interface 330 are implemented independently, the memory 310, the processor 320 and the communication interface 330 can be interconnected through a bus and complete mutual communication. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 4 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0159] Optionally, in a specific implementation, if the memory 310, the processor 320 and the communication interface 330 are integrated on a chip, the memory 310, the processor 320 and the communication interface 330 can communicate with each other through an internal interface.
[0160] An embodiment of the present application provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the intelligent approval method based on the metamodel provided in the above embodiment.
[0161] An embodiment of the present application also provides a chip, which includes a processor for calling and executing instructions stored in the memory from the memory, so that a communication device equipped with the chip executes the method provided by the embodiment of the present application.
[0162] An embodiment of the present application also provides a chip, including: an input interface, an output interface, a processor and a memory, wherein the input interface, the output interface, the processor and the memory are connected via an internal connection path, and the processor is used to execute the code in the memory. When the code is executed, the processor is used to execute the method provided in the embodiment of the application.
[0163] It should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc. It is worth noting that the processor may be a processor supporting the advanced RISC machines (ARM) architecture.
[0164] Further, optionally, the above-mentioned memory may include a read-only memory and a random access memory, and may also include a non-volatile random access memory. The memory may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may include a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may include a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available. For example, static RAM (SRAM), dynamic random access memory (DRAM), synchronous DRAM (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM) and direct rambus RAM (DR RAM).
[0165] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium.
[0166] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example" or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. Moreover, the described specific features, structures, materials or characteristics may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine different embodiments or examples described in this specification and the features of different embodiments or examples, unless they are contradictory.
[0167] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of this application, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0168] Any process or method description in the flow chart or otherwise described herein can be understood to represent a module, fragment or portion of a code including one or more executable instructions for implementing the steps of a specific logical function or process. And the scope of the preferred embodiment of the present application includes other implementations, in which the functions may not be performed in the order shown or discussed, including in a substantially simultaneous manner or in a reverse order according to the functions involved.
[0169] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, which can be embodied in any computer-readable medium for use by an instruction execution system, apparatus or device (such as a computer-based system, a system including a processor or other system that can fetch instructions from an instruction execution system, apparatus or device and execute instructions), or used in combination with these instruction execution systems, apparatuses or devices.
[0170] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. All or part of the steps of the above embodiment method can be completed by instructing the relevant hardware through a program, which can be stored in a computer-readable storage medium, and when the program is executed, it includes one of the steps of the method embodiment or a combination thereof.
[0171] In addition, each functional unit in each embodiment of the present application can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into one module. The above-mentioned integrated module can be implemented in the form of hardware or in the form of a software functional module. If the above-mentioned integrated module is implemented in the form of a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. The storage medium can be a read-only memory, a disk or an optical disk, etc.
[0172] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. An intelligent approval method based on a meta-model, characterized in that: include: In response to the construction instruction, a metamodel approval flow is constructed, the metamodel approval flow comprising an application node, an approval node and a gateway node, the application node comprising a first UserTask metamodel, the approval node comprising a second UserTask metamodel, the gateway node comprising a gateway metamodel, the first UserTask metamodel, the second UserTask metamodel and the gateway metamodel having corresponding model information; In response to the input instruction, the metamodel approval flow is started, and approval content is generated through the first UserTask metamodel; Generate an approval result according to the approval content, the gateway metamodel and the second UserTask metamodel; The generating of approval content by using the first UserTask metamodel includes: Obtaining input application information through the first UserTask metamodel; Constructing approval data according to the application information in a preset format of field keywords and values corresponding to the field keywords; generating the approval content according to the approval data and the model ID of the first UserTask metamodel; When the gateway node includes an internal and external condition gateway node, generating an approval result according to the approval content, the gateway metamodel and the second UserTask metamodel includes: According to the gateway metamodel of the internal and external condition gateway node and the approval content, determine the application type corresponding to the approval content, the application type includes external application and internal application; according to the application type and the model ID, determine the target approval node; transmit the approval content to the target approval node through the gateway metamodel of the internal and external condition gateway node, so as to generate an approval result through the second UserTask metamodel of the target approval node; Obtain node information of all child nodes of the application node from the memory according to the model information, construct an attribute SQL database execution language according to the node information, convert the node information of the metamodel in each node into a corresponding SQL statement element according to the attribute SQL database execution language, perform database persistence mapping, and realize the storage of data in the approval flow; Among them, the corresponding approval flow status information is obtained through the approval flow service persistence database of the approval flow DB, and the status of the approval flow is isolated from the status of the approval object, so as to realize the reuse of multiple approval objects in the approval flow. Specifically: in the status table corresponding to the isolation form, only the business primary key information is stored, and the BusinessKey field is used as the association field with the business data table to realize the isolation of the approval flow status from the meta-model of each node; The permission management of the approval flow is based on the permission matching mechanism in memory by binding permissions to the metamodel. Specifically, after the metamodel is loaded into the memory, when the service is called, the corresponding permission information is obtained through the access method provided by the Policy to perform business operations; Among them, the gateway metamodel of the internal and external condition gateway node is provided with internal and external lists, and the internal and external lists are matched with the applicant information to determine whether the application type is an external application or an internal application.
2. The intelligent approval method based on metamodel according to claim 1 is characterized by: When the gateway node includes a parallel gateway sub-node and a merged gateway sub-node, generating an approval result according to the approval content, the gateway meta-model and the second UserTask meta-model includes: When there are multiple approval nodes, several target approval nodes are determined according to the model ID, and the approval content is transmitted to different target approval nodes in parallel through the gateway metamodel of the parallel gateway subnode; According to the second UserTask metamodel of different target approval nodes and the approval content, a plurality of sub-approval results are obtained; The sub-approval results are merged by merging the gateway meta-model of the gateway sub-nodes to generate the approval result.
3. The intelligent approval method based on metamodel according to claim 2 is characterized by: According to the second UserTask meta-model of different target approval nodes and the approval content, several sub-approval results are obtained, including: Acquire the approval content and the component type corresponding to the approval content on the display page through the approval flow engine; Rendering the approval content according to the component type and displaying it on a display page in different target approval nodes; In response to the approval instructions of different display pages, several sub-approval results are obtained.
4. The intelligent approval method based on metamodel according to any one of claims 1-2, characterized in that: In response to the building instruction, building the metamodel approval flow includes: In response to the first build sub-instruction, the application node, the approval node and the gateway node are established, and model information of the first UserTask metamodel, the second UserTask metamodel and the gateway metamodel are generated accordingly, wherein the model information includes a model ID and a metamodel type identifier; In response to the second build sub-instruction, generating a plurality of wiring meta-models; Constructing the metamodel approval flow according to the connection metamodel, the application node, the approval node and the gateway node; The connection meta-model represents the sequential relationship between the meta-models in the meta-model approval flow, and the connection starting point and the connection end point of the connection meta-model are the model IDs of different meta-models.
5. An intelligent approval device based on a meta-model, characterized in that: include: A first response module is used to construct a metamodel approval flow in response to a construction instruction, wherein the metamodel approval flow includes an application node, an approval node, and a gateway node, wherein the application node includes a first UserTask metamodel, the approval node includes a second UserTask metamodel, the gateway node includes a gateway metamodel, and the first UserTask metamodel, the second UserTask metamodel, and the gateway metamodel have corresponding model information; A second response module, configured to start the metamodel approval flow in response to an input instruction, and generate approval content through the first UserTask metamodel; A generation module, used to generate an approval result according to the approval content, the gateway metamodel and the second UserTask metamodel; The generating of approval content by using the first UserTask metamodel includes: Obtaining input application information through the first UserTask metamodel; Constructing approval data according to the application information in a preset format of field keywords and values corresponding to the field keywords; generating the approval content according to the approval data and the model ID of the first UserTask metamodel; When the gateway node includes an internal and external condition gateway node, generating an approval result according to the approval content, the gateway metamodel and the second UserTask metamodel includes: Determine the application type corresponding to the approval content according to the gateway metamodel of the internal and external condition gateway node and the approval content, where the application type includes an external application and an internal application; Determine the target approval node according to the application type and model ID; The approval content is transmitted to the target approval node through the gateway metamodel of the internal and external condition gateway node, so as to generate the approval result through the second UserTask metamodel of the target approval node; Obtain node information of all child nodes of the application node from the memory according to the model information, construct an attribute SQL database execution language according to the node information, convert the node information of the metamodel in each node into a corresponding SQL statement element according to the attribute SQL database execution language, perform database persistence mapping, and realize the storage of data in the approval flow; Among them, the corresponding approval flow status information is obtained through the approval flow service persistence database of the approval flow DB, and the status of the approval flow is isolated from the status of the approval object, so as to realize the reuse of multiple approval objects in the approval flow. Specifically: in the status table corresponding to the isolation form, only the business primary key information is stored, and the BusinessKey field is used as the association field with the business data table to realize the isolation of the approval flow status from the meta-model of each node; The permission management of the approval flow is based on the permission matching mechanism in memory by binding permissions to the metamodel. Specifically, after the metamodel is loaded into the memory, when the service is called, the corresponding permission information is obtained through the access method provided by the Policy to perform business operations; Among them, the gateway metamodel of the internal and external condition gateway node is provided with internal and external lists, and the internal and external lists are matched with the applicant information to determine whether the application type is an external application or an internal application.
6. An electronic device, characterized in that: include: A processor and a memory, wherein the memory stores instructions, and the instructions are loaded and executed by the processor to implement the method according to any one of claims 1 to 4.
7. A computer-readable storage medium, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed, the method according to any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
Examination and approval task processing method and device, storage medium and electronic equipment
CN115545627A
Automatic office method and system based on workflow engine
CN116308132A