Workflow control code generation method and device, electronic equipment and storage medium

By generating business semantic declarations, meta-information protocols, and logical inferences for workflows, more business logic information is automatically inferred, solving the problem that existing technologies require extensive secondary development of workflow base code and enabling the generation of richer and more flexible workflow control code.

CN116069300BActive Publication Date: 2026-07-31CHINA TELECOM CORP LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA TELECOM CORP LTD
Filing Date
2022-12-21
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

Existing technologies require extensive secondary development after generating the basic workflow code. The process is cumbersome and has a high development threshold, making it difficult to meet flexible business needs.

Method used

By generating business semantic declarations, meta-information protocols, business logic information, and workflow control code templates for workflows, and combining these with logical inference methods, more business logic information is automatically inferred, resulting in rich and comprehensive workflow control code.

Benefits of technology

It reduces the workload of secondary development, simplifies information entry during prototype design, lowers the development threshold, and improves the richness and flexibility of workflow control code.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116069300B_ABST
    Figure CN116069300B_ABST
Patent Text Reader

Abstract

This application provides a method, apparatus, electronic device, and storage medium for generating workflow control code. The workflow control code generation method includes: generating a business semantic declaration for the workflow; generating a meta-information protocol to express the business semantics; generating business logic information for the workflow; creating a workflow control code template; and generating workflow control code corresponding to the workflow based on the business semantic declaration, meta-information protocol, business logic information, and workflow control code template. In this application, the business semantic declaration, meta-information protocol, business logic information, and corresponding workflow control code template are extended for the workflow. Furthermore, appropriate meta-information is added to the prototype design based on the meta-information protocol. Through analysis and inference, more comprehensive information is obtained for generating workflow control code, thereby lowering the entry barrier and generating richer and more complete main business logic code, thus reducing the workload of secondary development.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a workflow control code generation method, apparatus, electronic device, and storage medium. Background Technology

[0002] A workflow is a computational model of a work process; it represents the logic and rules governing how tasks are organized sequentially within a workflow in a computer model and performs calculations accordingly. The main problem that workflows aim to solve is: to automatically transfer information between multiple participants according to predetermined rules using computers, in order to achieve a specific business objective.

[0003] Enterprise information system development relies heavily on UI (User Interface) prototyping and ER (Entity-Relationship) design during the design phase. With the rise of low-code development, methods have evolved to utilize these design outcomes to generate foundational workflow code, thereby reducing development workload. However, the foundational workflow code often covers limited business scenarios, necessitating substantial secondary development on top of this foundational code, resulting in a cumbersome process. Summary of the Invention

[0004] In view of the above problems, this application proposes a workflow control code generation method, apparatus, electronic device and storage medium, which can generate workflow control code for workflow, thereby reducing the workload of secondary development.

[0005] According to one aspect of an embodiment of this application, a workflow control code generation method is provided, the method comprising:

[0006] Business semantics declaration for generating workflows;

[0007] Generate a meta-information protocol to express the business semantics;

[0008] Generate the business logic information for the workflow;

[0009] Create a workflow control code template;

[0010] Based on the business semantic declaration, the meta-information protocol, the business logic information, and the workflow control code template, the workflow control code corresponding to the workflow is generated.

[0011] Optionally, the business semantic declaration for generating the workflow includes: obtaining business function information of the workflow; extracting business elements of the workflow and dependencies between the business elements from the business function information; and determining the business elements and dependencies between the business elements as the business semantic declaration of the workflow.

[0012] Optionally, generating the meta-information protocol for expressing the business semantics includes: creating page component click events, wherein the page component click events include at least one of the following: stage submission, stage withdrawal, stage processing, stage delegation, stage handover, stage signing, stage designing, process completion, process termination, process handling, and process tracking; creating the association relationship between the page form and the workflow stages; and determining the page component click events and the association relationship as the meta-information protocol.

[0013] Optionally, generating the business logic information of the workflow includes: creating a mapping relationship between workflow stages and pages, generating a page routing table based on the mapping relationship; creating a first binding protocol between runtime page forms and workflow stages; creating a second binding protocol between runtime page lists and workflow stages; setting corresponding interface declarations for workflow events; and determining the page routing table, the first binding protocol, the second binding protocol, and the corresponding interface declarations as the business logic information.

[0014] Optionally, the creation of the workflow control code template includes: creating a code template and call input parameters that correspond to the initialization semantics; and creating a template and call input parameters that correspond to the backend interface business semantics.

[0015] According to another aspect of the embodiments of this application, a workflow control code generation apparatus is provided, the apparatus comprising:

[0016] The first generation module is used to generate business semantic declarations for the workflow;

[0017] The second generation module is used to generate a meta-information protocol for expressing the business semantics;

[0018] The third generation module is used to generate the business logic information of the workflow;

[0019] Create a module for creating workflow control code templates;

[0020] The fourth generation module is used to generate the workflow control code corresponding to the workflow based on the business semantic declaration, the meta-information protocol, the business logic information, and the workflow control code template.

[0021] Optionally, the first generation module includes: an information extraction unit, configured to acquire business function information of the workflow, and extract business elements of the workflow and dependencies between the business elements from the business function information; and a declaration determination unit, configured to determine the business elements and dependencies between the business elements as business semantic declarations of the workflow.

[0022] Optionally, the second generation module includes: an event creation unit, used to create page component click events, wherein the page component click events include at least one of the following: stage submission, stage withdrawal, stage processing, stage delegation, stage transfer, stage signing, stage designing, process completion, process termination, process handling, and process tracking; a relationship creation unit, used to create the association relationship between the page form and the workflow stages; and a protocol determination unit, used to determine the page component click events and the association relationship as the metadata protocol.

[0023] Optionally, the third generation module includes: a route creation unit, used to create a mapping relationship between workflow steps and pages, and generate a page routing table based on the mapping relationship; a first protocol creation unit, used to create a first binding protocol between runtime page forms and workflow steps; a second protocol creation unit, used to create a second binding protocol between runtime page lists and workflow steps; a declaration setting unit, used to set the corresponding interface declarations for workflow events; and an information determination unit, used to determine the page routing table, the first binding protocol, the second binding protocol, and the corresponding interface declarations as the business logic information.

[0024] Optionally, the creation module includes: a first template creation unit, used to create code templates and call input parameters that correspond to the initialization semantics; and a second template creation unit, used to create templates and call input parameters that correspond to the backend interface business semantics.

[0025] According to another aspect of the embodiments of this application, an electronic device is provided, comprising: one or more processors; and one or more computer-readable storage media having instructions stored thereon; wherein, when the instructions are executed by the one or more processors, the processors cause the processors to perform the workflow control code generation method as described in any of the preceding claims.

[0026] According to another aspect of the embodiments of this application, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, causes the processor to perform the workflow control code generation method as described in any of the preceding claims.

[0027] In this embodiment, a business semantic declaration for the workflow is generated; a meta-information protocol for expressing the business semantics is generated; business logic information for the workflow is generated; a workflow control code template is created; and workflow control code corresponding to the workflow is generated based on the business semantic declaration, the meta-information protocol, the business logic information, and the workflow control code template. Therefore, in this embodiment, for the workflow, the business semantic declaration, meta-information protocol, business logic information, and the corresponding workflow control code template are expanded. Furthermore, appropriate meta-information is added to the prototype design based on the meta-information protocol. On the one hand, software designers add business semantic-related information to the prototype design based on the meta-information protocol, which manifests as adding appropriate components to the UI prototype and setting component options according to business logic. On the other hand, without increasing the design workload, more detailed information to be expressed in the prototype design can be deduced through business logic inference. This information helps generate richer and more complete workflow control code, thereby lowering the entry barrier and simplifying information entry during prototype design. It can generate richer and more complete main business logic code, thereby reducing the workload of secondary development. Attached Figure Description

[0028] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments of this application will be briefly introduced below. Obviously, the drawings described below are only some drawings of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0029] Figure 1 This is a flowchart illustrating the steps of a workflow control code generation method according to an embodiment of this application.

[0030] Figure 2 This is an overall flowchart of a workflow code generation process according to an embodiment of this application.

[0031] Figure 3 This is a structural block diagram of a workflow control code generation device according to an embodiment of this application.

[0032] Figure 4 This is a schematic diagram of the structure of an electronic device according to an embodiment of this application. Detailed Implementation

[0033] The technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments of this application. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0034] Workflow refers to "the automation of part or all of a business process in a computer application environment." It is an abstract and generalized description of a workflow and the business rules between its various operational steps.

[0035] The concept of workflow originated in the fields of production organization and office automation. It is a concept proposed for activities with fixed procedures in daily work. The purpose is to improve work efficiency, better control the process, enhance customer service, and effectively manage business processes by breaking down work into well-defined tasks or roles, executing these tasks according to certain rules and processes, and monitoring them.

[0036] A workflow can be defined as follows: A workflow is a set of tasks organized to complete a business process. It defines the triggering order and triggering conditions of the tasks. Each task can be completed by one or more software systems, by one or a group of people, or by one or more people collaborating with software systems.

[0037] By using workflow software, users only need to fill out relevant forms on their computers, and the process will automatically proceed according to the predefined workflow. The next level of approvers will receive the relevant information and can modify, track, manage, query, statistically analyze, and print it as needed, which greatly improves efficiency, realizes knowledge management, and enhances the company's core competitiveness.

[0038] Workflow has the following advantages:

[0039] 1. Business Visualization: First and foremost, the biggest advantage is that it allows business visualization through a workflow engine. You can see the entire business process through the view, and it is clear at a glance what business logic is executed at each node. Branch processing and exception handling are also very clear.

[0040] 2. Business Arrangement: If the business logic never changes, then hardcoding it into a single method is fine. However, we know that business logic is constantly evolving, and a crucial aspect of software design is flexibility and scalability. Workflow re-orchestrating allows for further flexibility at the code level. Business processes can be quickly adjusted by modifying nodes, and nodes can be flexibly added or removed without impacting the overall workflow.

[0041] 3. Automatic retry: For some workflows, the workflow engine provides framework-level persistence and automatic retry capabilities.

[0042] Workflow is applicable to industries such as consumer goods, manufacturing, telecommunications services, financial services (including banking, securities, and insurance), logistics services, property services, property management, large and medium-sized import and export trading companies, government institutions, research institutes, and education services, especially large enterprises and groups.

[0043] For example, specific applications of workflows may involve the following aspects:

[0044] 1. Key business processes: order and quotation processing, procurement processing, contract review, customer call handling, supply chain management, etc.

[0045] 2. Administrative Management: Business trip applications, overtime applications, leave applications, vehicle applications, various office supplies applications, purchase applications, daily and weekly reports, and other administrative forms that were originally processed manually.

[0046] 3. Human Resources Management: Employee training arrangements, performance appraisals, handling of job changes, employee file information management, etc.

[0047] 4. Finance-related: payment requests, accounts receivable processing, daily expense reimbursement processing, business trip expense reimbursement, budget and plan applications, etc.

[0048] 5. Customer Service: Customer information management, customer complaints, request processing, after-sales service management, etc.

[0049] 6. Special services: Tasks that are manually completed step by step through forms, such as ISO (International Organization for Standardization) series processes, quality management processes, product data information management, customs declaration processing for trading companies, and cargo tracking processing for logistics companies, can all be automatically and systematically implemented using workflow software.

[0050] The benefits of implementing workflow management for enterprises include: improved operational efficiency, enhanced resource utilization, increased operational flexibility and adaptability, increased work efficiency, focus on core business operations, tracking of business processes, quantifiable performance evaluation of business processes, reduced waste, increased profits, and full utilization of existing computer network resources. Implementing workflows will shorten the enterprise's operating cycle, improve internal and external processes, optimize and rationally utilize resources, reduce human error and delays, and increase labor productivity.

[0051] Due to the inherent characteristics of workflows, workflow development has a high barrier to entry. Developers need to be familiar with workflow engines and proficient in transforming business processes into workflow flows. The complexity of workflow functionality also leads to cumbersome and error-prone component setup during prototype design, resulting in interdependencies. This application proposes introducing a logical inference method on top of the template-based workflow code. This method adds reasonable meta-information to the prototype design, and through analysis and inference, more comprehensive information is derived to generate workflow control code, thereby lowering the entry barrier and simplifying information entry during prototype design.

[0052] In this embodiment, based on template-based code generation, a logical inference-based method is proposed. This method adds analysis and inference steps before code generation to obtain more comprehensive information usable for code generation. For example, it infers the page routing table, eliminating page layout design work; it infers the protocols that page components bind to workflow stages at runtime; and it infers the corresponding workflow operation backend interface declarations. By comprehensively analyzing and inferring the results, a complete workflow control code—frontend JS code and backend interface code—can be generated using a code template. Merging these two parts into the project's basic code generated using the code template based on UI prototype design and ER design yields the complete business implementation code.

[0053] The workflow in this application embodiment can be in the form of approval workflow, work order workflow, etc.

[0054] The workflow control code generation method in the embodiments of this application will be described in detail below.

[0055] Reference Figure 1 The diagram illustrates a flowchart of a workflow control code generation method according to an embodiment of this application.

[0056] like Figure 1 As shown, the workflow control code generation method may include the following steps:

[0057] Step 101: Generate the business semantics declaration for the workflow.

[0058] In this embodiment of the application, the main logic of the workflow business function is extracted, and the business elements that can be combined and the dependencies between the business elements are extracted.

[0059] In one optional implementation, the process of generating the business semantic declaration of the workflow may include the following steps A1 to A2:

[0060] Step A1: Obtain the business function information of the workflow, and extract the business elements of the workflow and the dependencies between the business elements from the business function information.

[0061] The workflow's business function information can be pre-set, which includes relevant information about each business element in the workflow.

[0062] Information related to business elements may include, but is not limited to: business elements (such as business name, business identifier, etc.), functional purpose, necessary conditions, dependencies, etc.

[0063] Extract the business elements of the workflow and the dependencies between these elements from the business function information. The extracted information includes, but is not limited to: stage submission, stage withdrawal, process completion, stage delegation, stage handover, signature addition / removal, pending list, etc. Specifically, for approval processes, this can be increased to include: approval passed, approval failed, etc.

[0064] Step A2: Determine the business elements and the dependencies between them as the business semantics declaration of the workflow.

[0065] After extracting the business elements of the workflow and the dependencies between them, the business elements of the workflow and the dependencies between them are determined as the business semantics declaration of the workflow.

[0066] Step 102: Generate a meta-information protocol for expressing the business semantics.

[0067] In this embodiment of the application, for the workflow, the analysis is conducted on how to express business semantics through meta-information, how to incorporate it into the prototype design, and input instructions, etc. The analysis is conducted on how to represent business semantics through meta-information in a more user-friendly and complete way. In order to facilitate subsequent analysis, it is necessary to input it in a pre-defined format, thereby generating a meta-information protocol for UI prototype design to express the business semantics of the workflow.

[0068] For example, the meta-information protocol is represented by prototype components and configurable options for those components, where the components can be special-purpose components or ordinary UI components, such as click events of UI buttons, etc.

[0069] In one optional implementation, the process of generating the meta-information protocol for expressing the business semantics may include the following steps B1 to B3:

[0070] Step B1: Create a click event for the page component.

[0071] The workflow involves multiple pages, and each page involves multiple page components. In this embodiment, a page component click event is created for each page component.

[0072] For example, the page component click events include at least one of the following: stage submission, stage withdrawal, stage processing, stage delegation, stage handover, stage signing, stage designing, process completion, process termination, process processing, and process tracking.

[0073] Step B2: Create the association between the page form and the workflow steps.

[0074] The workflow involves multiple pages, and each page contains multiple forms. Different workflow stages may involve different forms, so it is possible to create a relationship between the forms and the workflow stages.

[0075] For example, the specific information regarding the association between a page form and a workflow step can be the association between a page form identifier and a workflow step identifier. In implementation, this association can be stored in a data table, such as a key-value table.

[0076] Step B3: The click events of the page components and the associated relationships are determined as the metadata protocol.

[0077] After creating the page component click events and the association between the page form and the workflow stage, the page component click events and the association between the page form and the workflow stage are determined as the meta-information protocol used to express the business semantics.

[0078] Step 103: Generate the business logic information of the workflow.

[0079] In this embodiment of the application, the workflow is analyzed and logically inferred. The meta-information related to the workflow of page components is analyzed, the meta-information of each page is summarized, and information that helps generate code is inferred based on mapping rules and dependencies. The code template and options for implementing the business semantics declared in the design are inferred.

[0080] In one optional implementation, the process of generating the business logic information of the workflow may include the following steps C1 to C5:

[0081] Step C1: Create a mapping relationship between workflow steps and pages, and generate a page routing table based on the mapping relationship.

[0082] Workflows involve multiple pages, and different workflow stages may involve different pages. Therefore, a mapping relationship between workflow stages and pages can be created, and a page routing table can be generated based on this mapping relationship. By inferring the page routing table, page layout design work can be saved.

[0083] For example, the specific information regarding the mapping relationship between pages and workflow stages can be a mapping relationship between page identifiers and workflow stage identifiers. In implementation, this mapping relationship can be stored in a data table, such as a key-value table.

[0084] Step C2: Create the first binding protocol between the runtime page form and the workflow step.

[0085] Since the page form corresponds to a workflow stage at runtime, a first binding protocol can be created between the runtime page form and the workflow stage.

[0086] For example, the first binding protocol between the runtime page form and the workflow stage may include, but is not limited to: the workflow stage identifier field name, the initialization semantic declaration related to the stage after the page is loaded, and so on.

[0087] Step C3: Create a second binding protocol between the runtime page list and the workflow stages.

[0088] The page list corresponds to a workflow stage at runtime, so a second binding protocol can be created between the runtime page list and the workflow stage.

[0089] For example, the second binding protocol between the runtime page list and the workflow stages may include, but is not limited to: the workflow stage identifier field name, the initialization semantic declaration related to the stages after the list is loaded, and so on.

[0090] Step C4: Set up the corresponding interface declaration for workflow events.

[0091] The core of the current stage is the inference algorithm, which outputs business logic information based on the input information. The inference algorithm is used to determine the declaration of the corresponding interface for workflow events. The inference algorithm automatically derives the information from the input analysis without manual intervention.

[0092] For example, the interface declarations associated with workflow events may include, but are not limited to: interface address, input parameters and fields, output parameters and fields, business semantic declarations, etc.

[0093] Step C5: The page routing table, the first binding protocol, the second binding protocol, and the corresponding interface declaration are identified as the business logic information.

[0094] After obtaining the page routing table, the first binding protocol, the second binding protocol, and the corresponding interface declaration through the above process, the page routing table, the first binding protocol, the second binding protocol, and the corresponding interface declaration can be determined as the business logic information of the workflow.

[0095] In one alternative implementation, a suitable code template and input parameter mapping can be further set as the business logic information of the workflow.

[0096] Step 104: Create a workflow control code template.

[0097] In this embodiment, workflow control code templates are extracted according to the business semantics of the workflow implementation. For example, serial code templates, checkpoints for easy secondary development, page jump code templates, etc. are written to realize pre-made templated workflow control code, and the implemented business semantics and required input parameters are defined.

[0098] In one optional implementation, creating the workflow control code template may include the following steps D1 to D2:

[0099] Step D1: Create the code template and input parameters to support the initialization semantics.

[0100] Step D2: Create templates and input parameters that correspond to the business semantics of the backend interface.

[0101] Step 105: Based on the business semantic declaration, the meta-information protocol, the business logic information, and the workflow control code template, generate the workflow control code corresponding to the workflow.

[0102] After generating the business semantics declaration for the workflow, generating the meta-information protocol to express the business semantics, generating the business logic information for the workflow, and creating the workflow control code template, a code generation tool can be invoked to generate the workflow control code corresponding to the workflow based on the business semantics declaration, the meta-information protocol, the business logic information, and the workflow control code template.

[0103] In this embodiment, for workflow, the business semantic declaration, meta-information protocol, business logic information, and supporting workflow control code template are extended. Furthermore, appropriate meta-information is added to the prototype design based on the meta-information protocol. On the one hand, software designers add business semantic-related information to the prototype design based on the meta-information protocol, which manifests as adding appropriate components to the UI prototype and setting component options according to business logic. On the other hand, without increasing the design workload, more detailed information to be expressed in the prototype design can be deduced through business logic inference. This information helps generate richer and more complete workflow control code, thereby lowering the entry barrier and simplifying information entry during prototype design. It can generate richer and more complete main business logic code, thus reducing the workload of secondary development.

[0104] Reference Figure 2 The diagram shows an overall flowchart of a workflow code generation process according to an embodiment of this application.

[0105] like Figure 2 As shown, the workflow code generation process includes a basic code generation process and a workflow control code generation process.

[0106] During the design phase, in the basic code generation process, business table design, prototype design, and basic code template development are carried out.

[0107] During the design phase, in the workflow control code generation process, we conduct business semantic declaration design, metadata protocol design, workflow control code template development, and prototype supplementary metadata.

[0108] During the development and implementation phase, in the basic code generation process, basic code generation is achieved based on business table design, prototype design, and basic code template development.

[0109] During the development and implementation phase, in the workflow control code generation process, workflow control code generation is achieved based on business semantic declaration design, meta-information protocol design, workflow control code template development, and prototype supplementary meta-information.

[0110] During the development and implementation phase, the code is merged based on the base code and workflow control code, and then secondary development is carried out.

[0111] Depend on Figure 2 As can be seen, a complete workflow function includes basic code and workflow control code.

[0112] The basic code implements the standard CRUD (Create, Retrieve, Update, and Delete) functions, and this part of the code is implemented using industry-standard code generation methods.

[0113] The workflow control code implements the main workflow business logic, and the generation of this part of the code is the objective of this application embodiment.

[0114] By extracting functional requirements related to workflows from past projects, the three units of business semantic declaration design, metadata protocol design, and workflow control code module development can be completed in advance. During the design phase, appropriate metadata is added to the prototype based on an understanding of the business functions.

[0115] After generating basic code and workflow control code during the development and implementation phase and merging them into the project code, secondary development is carried out to supplement business logic.

[0116] In this embodiment, on the one hand, prototype design can be simplified. By utilizing the analysis and inference results page routing table, the page associated with the current stage can be invoked at runtime. By using a reasonable metadata protocol, unnecessary information input can be reduced. On the other hand, the development threshold of workflow functions can be lowered. Backend code that decouples workflow operation code from business logic can be generated. More suitable workflow operation code can be generated by extending the metadata of the prototype design, so developers will likely only need to perform secondary development related to the business.

[0117] The workflow control code generation method in this embodiment can be implemented in a workflow engine. A workflow engine is a set of tools that drive workflows. Workflow is essentially an abstraction of business flow; therefore, different categories of business flow form different workflows, and different workflow engines are responsible for defining and implementing these different types of workflows. Workflow engines generally include designer capabilities, i.e., drag-and-drop tools responsible for business processes, and can be plug-in or web-based. This embodiment does not limit the specific workflow engine; for example, Activiti and Flowable workflow engines are both applicable.

[0118] The following describes the implementation steps using a representative "Pending Approvals" list page as an example:

[0119] Phase 1: Design Phase

[0120] Step 1: Design the business table in a generic way;

[0121] Step 2: Complete the design of an approval process that conforms to the BPMN2 (Business Process Modeling Notation, including how these elements are combined into a business process diagram) specification in a general way;

[0122] Step 3: Complete the prototype design of the approval pages for each stage using a generic approach;

[0123] Step 4: Add process identifier metadata to each approval page;

[0124] Step 5: Complete the prototype design of my pending approval page in a generic way;

[0125] Step 6: Add a processing button to the list on my pending approval page, and select the appropriate process for the click event of the button;

[0126] Phase Two: Development and Implementation Phase

[0127] Step 7: Using the UI prototype design and business table design as input, call the analysis and inference tools to generate analysis results;

[0128] Step 8: Using the UI prototype design and business table design as input, call the code generation tool to generate basic code;

[0129] Step 9: Based on the analysis results of Step 7, call the code generation tool to generate workflow control code.

[0130] In this embodiment, on the one hand, by introducing analysis and inference, the amount of information that needs to be input into the UI prototype is reduced, while also reducing repetitive work in maintaining design consistency between pages; on the other hand, by designing reasonable business semantic declarations and meta-information protocols, more accurate business logic can be inferred, thereby generating code to implement more functions and reducing the workload of secondary development; it can also reduce the requirements for developers' business familiarity and coding ability.

[0131] This application embodiment is based on logical reasoning, which improves the applicability of code templates and reduces tedious details in prototype design, and realizes a more professional division of labor in the development process: skilled developers expand business semantic declarations and develop code templates, while non-skilled developers implement workflow function code by selecting appropriate meta-information.

[0132] Reference Figure 3 The diagram shows a structural block diagram of a workflow control code generation apparatus according to an embodiment of this application.

[0133] like Figure 3 As shown, the workflow control code generation device may include the following modules:

[0134] The first generation module 301 is used to generate business semantic declarations for the workflow;

[0135] The second generation module 302 is used to generate a meta-information protocol for expressing the business semantics;

[0136] The third generation module 303 is used to generate the business logic information of the workflow;

[0137] Create module 304 to create workflow control code templates;

[0138] The fourth generation module 305 is used to generate the workflow control code corresponding to the workflow based on the business semantic declaration, the meta-information protocol, the business logic information and the workflow control code template.

[0139] Optionally, the first generation module 301 includes: an information extraction unit, configured to acquire business function information of the workflow, and extract business elements of the workflow and dependencies between the business elements from the business function information; and a declaration determination unit, configured to determine the business elements and dependencies between the business elements as business semantic declarations of the workflow.

[0140] Optionally, the second generation module 302 includes: an event creation unit, used to create page component click events, the page component click events including at least one of the following: stage submission, stage withdrawal, stage processing, stage delegation, stage transfer, stage signing, stage designing, process completion, process termination, process processing, and process tracking; a relationship creation unit, used to create the association relationship between the page form and the workflow stages; and a protocol determination unit, used to determine the page component click events and the association relationship as the metadata protocol.

[0141] Optionally, the third generation module 303 includes: a route creation unit, used to create a mapping relationship between workflow steps and pages, and generate a page routing table based on the mapping relationship; a first protocol creation unit, used to create a first binding protocol between runtime page forms and workflow steps; a second protocol creation unit, used to create a second binding protocol between runtime page lists and workflow steps; a declaration setting unit, used to set the corresponding interface declarations for workflow events; and an information determination unit, used to determine the page routing table, the first binding protocol, the second binding protocol, and the corresponding interface declarations as the business logic information.

[0142] Optionally, the creation module 304 includes: a first template creation unit, used to create code templates and call input parameters that match the initialization semantics; and a second template creation unit, used to create templates and call input parameters that match the backend interface business semantics.

[0143] In this embodiment, for workflow, the business semantic declaration, meta-information protocol, business logic information, and supporting workflow control code template are extended. Furthermore, appropriate meta-information is added to the prototype design based on the meta-information protocol. On the one hand, software designers add business semantic-related information to the prototype design based on the meta-information protocol, which manifests as adding appropriate components to the UI prototype and setting component options according to business logic. On the other hand, without increasing the design workload, more detailed information to be expressed in the prototype design can be deduced through business logic inference. This information helps generate richer and more complete workflow control code, thereby lowering the entry barrier and simplifying information entry during prototype design. It can generate richer and more complete main business logic code, thus reducing the workload of secondary development.

[0144] As the device embodiment is basically similar to the method embodiment, the description is relatively simple, and relevant parts can be found in the description of the method embodiment.

[0145] In embodiments of this application, an electronic device is also provided. This electronic device may include one or more processors and one or more computer-readable storage media storing instructions thereon, such as an application program. When the instructions are executed by the one or more processors, the processors cause the processors to perform the workflow control code generation method of any of the above embodiments.

[0146] Reference Figure 4 The diagram illustrates a schematic representation of an electronic device structure according to an embodiment of this application. Figure 4 As shown, the electronic device includes a processor 401, a communication interface 402, a memory 403, and a communication bus 404. The processor 401, communication interface 402, and memory 403 communicate with each other via the communication bus 404.

[0147] Memory 403 is used to store computer programs.

[0148] When the processor 401 executes the program stored in the memory 403, it implements the workflow control code generation method of any of the above embodiments.

[0149] Communication interface 402 is used for communication between the above-mentioned electronic device and other devices.

[0150] The aforementioned communication bus 404 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, it is represented by only one thick line in the diagram, but this does not indicate that there is only one bus or one type of bus.

[0151] The processor 401 mentioned above may include, but is not limited to: a central processing unit (CPU), a network processor (NP), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.

[0152] The aforementioned memory 403 may include, but is not limited to: Read Only Memory (ROM), Random Access Memory (RAM), Compact Disc Read Only Memory (CD-ROM), Electronic Erasable Programmable Read Only Memory (EEPROM), Hard Disk, Floppy Disk, Flash Memory, etc.

[0153] In embodiments of this application, a computer-readable storage medium is also provided, on which a computer program is stored, which can be executed by a processor of an electronic device, and when the computer program is executed by the processor, the processor performs the workflow control code generation method as described in any of the above embodiments.

[0154] The various embodiments in this specification are related to each other and are described in a progressive manner. Each embodiment focuses on the differences from other embodiments, and the same or similar parts between the embodiments can be referred to each other.

[0155] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.

[0156] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM, RAM, magnetic disk, optical disk), and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0157] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.

[0158] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed in this application can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0159] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0160] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0161] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0162] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0163] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, ROM, RAM, magnetic disks, or optical disks.

[0164] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. In summary, the content of this specification should not be construed as a limitation of this application.

Claims

1. A workflow control code generation method characterized by, The method includes: Business semantics declaration for generating workflows; Generate a meta-information protocol to express the business semantics; Generate the business logic information for the workflow; Create a workflow control code template; Based on the business semantics declaration, the meta-information protocol, the business logic information, and the workflow control code template, the workflow control code corresponding to the workflow is generated. The business semantics declaration for generating the workflow includes: Obtain the business function information of the workflow, and extract the business elements of the workflow and the dependencies between the business elements from the business function information; the business function information includes relevant information of the business elements in the workflow; the relevant information of the business elements includes at least one of the following: business element, functional purpose, necessary conditions, and dependencies; The business elements and the dependencies between them are defined as the business semantics declarations of the workflow; The generation of the meta-information protocol for expressing the business semantics includes: Create page component click events, wherein the page component click events include at least one of the following: stage submission, stage withdrawal, stage processing, stage delegation, stage handover, stage signing, stage designing, process completion, process termination, process processing, and process tracking; Establish the relationship between page forms and workflow steps; The click events of the page components and the associated relationships are determined as the meta-information protocol; the meta-information protocol is represented by the prototype components and the options set by the components. The business logic information for generating the workflow includes: Create a mapping relationship between workflow steps and pages, and generate a page routing table based on the mapping relationship; Create a first binding protocol between the runtime page form and the workflow stage; the first binding protocol includes at least one of the following: the workflow stage identifier field name, and the initialization semantic declaration related to the stage after the page is loaded; A second binding protocol is created between the runtime page list and workflow stages; the second binding protocol includes at least one of the following: a workflow stage identifier field name, and an initialization semantic declaration related to the stages after the list is loaded; Configure the workflow event-related interface declaration; the workflow event-related interface declaration includes at least one of the following: interface address, input parameters and fields, output parameters and fields, and business semantic declaration; The page routing table, the first binding protocol, the second binding protocol, and the corresponding interface declaration are identified as the business logic information.

2. The method according to claim 1, characterized in that, The creation of the workflow control code template includes: Create code templates and input parameters to support the initialization semantics; Create templates and input parameters that correspond to the business semantics of the backend interface.

3. A workflow control code generation device, characterized in that, The device includes: The first generation module is used to generate business semantic declarations for the workflow; The second generation module is used to generate a meta-information protocol for expressing the business semantics; The third generation module is used to generate the business logic information of the workflow; Create a module for creating workflow control code templates; The fourth generation module is used to generate the workflow control code corresponding to the workflow based on the business semantic declaration, the meta-information protocol, the business logic information, and the workflow control code template. The first generation module includes: An information extraction unit is used to acquire business function information of the workflow, and extract business elements of the workflow and dependencies between the business elements from the business function information; the business function information includes relevant information of the business elements in the workflow; the relevant information of the business elements includes at least one of the following: business element, functional purpose, necessary conditions, and dependency relationship; The declaration determination unit is used to determine the business elements and the dependencies between the business elements as the business semantics declaration of the workflow; The second generation module includes: The event creation unit is used to create page component click events, which include at least one of the following: stage submission, stage withdrawal, stage processing, stage delegation, stage handover, stage signing, stage designing, process completion, process termination, process processing, and process tracking. The relationship creation unit is used to create the association between page forms and workflow steps; The protocol determination unit is used to determine the page component click event and the association relationship as the meta-information protocol; the meta-information protocol is represented by the prototype component and the component settings options; The third generation module includes: The route creation unit is used to create a mapping relationship between workflow steps and pages, and to generate a page routing table based on the mapping relationship; The first protocol creation unit is used to create a first binding protocol between the runtime page form and the workflow stage; the first binding protocol includes at least one of the following: the workflow stage identifier field name, and the initialization semantic declaration related to the stage after the page is loaded; The second protocol creation unit is used to create a second binding protocol between the runtime page list and the workflow stage; the second binding protocol includes at least one of the following: the workflow stage identifier field name, and the initialization semantic declaration related to the stage after the list is loaded; The declaration setting unit is used to set the corresponding interface declaration for workflow events; the corresponding interface declaration for workflow events includes at least one of the following: interface address, input parameters and fields, output parameters and fields, and business semantic declaration; The information determination unit is used to determine the page routing table, the first binding protocol, the second binding protocol, and the supporting interface declaration as the business logic information.

4. The apparatus according to claim 3, characterized in that, The creation module includes: The first template creation unit is used to create code templates that accompany the initialization semantics and call input parameters; The second template creation unit is used to create templates and input parameters that correspond to the business semantics of the backend interface.

5. An electronic device, characterized in that, include: One or more processors; and One or more computer-readable storage media on which instructions are stored; When the instructions are executed by the one or more processors, the processors perform the workflow control code generation method as described in any one of claims 1 to 2.

6. A computer-readable storage medium, characterized in that, It stores a computer program that, when executed by a processor, causes the processor to perform the workflow control code generation method as described in any one of claims 1 to 2.