Code process document generation method and device
By dividing business processes into functional subclasses and generating code process documents based on annotations and business logic, the problems of high cost and complex configuration of generating code process documents in the prior art are solved, and a fast, economical and easy-to-maintain code process document generation is achieved.
Patent Information
- Application Number
- CN202311575185.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-23
- Publication Date
- 2025-05-23
AI Technical Summary
In the prior art, the generation of code process documents based on the workflow capabilities provided by cloud services is expensive, and the configuration is cumbersome and the dependence is too heavy; generating code process documents based on the workflow engine also has the problems of high cost and complex transformation.
By dividing the business process into multiple functional subclasses, and generating code process documents based on the annotation, execution order and business processing logic of the functional subclasses, it is possible to quickly generate code process documents without relying on additional storage resources.
It realizes that whether it is an existing project or a new project, it can be quickly used with simple configuration, and it can easily generate code process documents efficiently and efficiently, saving costs; at the same time, code process documents can be changed with changes in business processes, reducing maintenance and newcomers' costs.
Smart Images

Figure CN120029589A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method and device for generating a code flow document. Background Art
[0002] In the process of software code development, in order to facilitate code understanding and use, process documents are usually generated based on the steps of the main process in the code. Currently, when developing software code, code process documents can be generated based on the application and service orchestration workflow capabilities provided by cloud services, or based on workflow engines.
[0003] In the process of implementing the present invention, the inventors found that there are at least the following problems in the prior art:
[0004] Generating code process documents based on the workflow capabilities provided by cloud services requires cloud-based services, which is costly. Generating code process documents based on workflow engines requires cumbersome configuration and excessive dependencies, and requires reliance on external storage media such as databases, which is costly and complex to transform existing project processes. Summary of the invention
[0005] In view of this, an embodiment of the present invention provides a method and device for generating a code flow document, which can generate a code flow document based on the annotations, execution sequence and business processing logic of the functional subclasses by dividing a business process into multiple functional subclasses without relying on additional storage resources. This ensures that both existing projects and new projects can be quickly used with simple configuration, and code flow documents can be generated conveniently and efficiently, saving costs. At the same time, the code flow document can also be changed as the business process changes, reducing the maintenance cost of the later code flow document and the cost of getting started for new employees.
[0006] To achieve the above object, according to one aspect of an embodiment of the present invention, a method for generating a code flow document is provided, comprising:
[0007] In response to application startup, registering functional subclasses of various business systems included in the application into the flow engine;
[0008] In response to receiving an interface call request from a business system, obtaining a function subclass set corresponding to the business system through the flow engine, wherein the function subclasses in the function subclass set have an execution order and a business processing logic;
[0009] In the process of the flow engine processing the function subclasses in the function subclass set according to the execution order of the function subclasses and the business processing logic, obtaining annotation information of the processed function subclasses;
[0010] A code flow document of the business system is generated according to the execution order, business processing logic and annotation information of the processed functional subclasses.
[0011] Optionally, the annotation information includes grouping information and execution order of functional subclasses; in response to application startup, the functional subclasses of each business system included in the application are registered in the flow engine, including: in response to application startup, obtaining the functional subclasses included in the application; for each functional subclass, obtaining the grouping information and execution order of the functional subclass according to the annotation information of the functional subclass, the grouping information corresponds to the business system; determining the business system group to which the functional subclass belongs according to the grouping information, and sorting the functional subclasses in each business system group according to the execution order; and registering the sorted grouped functional subclasses in the flow engine.
[0012] Optionally, in response to receiving an interface call request from a business system, obtaining a set of functional subclasses corresponding to the business system through the flow engine, including: in response to receiving an interface call request from a business system, obtaining a set of functional subclasses corresponding to the business system through the flow engine according to the business system grouping corresponding to the business system.
[0013] Optionally, the flow engine processes the function subclasses in the function subclass set according to the execution order of the function subclasses and the business processing logic, including: the flow engine traverses the function subclasses in the function subclass set according to the execution order of the function subclasses; for each function subclass, executes the business processing logic of the function subclass, and obtains the execution status of the business processing logic, the execution status including executing the next function subclass and returning a result; when the execution status is executing the next function subclass, obtains the next function subclass; when the execution status is returning a result, obtains the processing result from the flow processing context of the flow engine and returns it.
[0014] Optionally, for each functional subclass, before executing the business processing logic of the functional subclass, it also includes: judging whether the functional subclass has the business processing logic; and obtaining the next functional subclass if the business processing class does not have the business processing logic.
[0015] Optionally, the annotation information includes a functional description of a functional subclass; and based on the execution order, business processing logic and annotation information of the processed functional subclass, a code flow document of the business system is generated, including: obtaining the functional description of the processed functional subclass based on the annotation information of the processed functional subclass; and generating the code flow document of the business system based on the execution order, business processing logic and functional description of the processed functional subclass.
[0016] Optionally, a code flow document for the business system is generated based on the execution order, business processing logic and functional description of the processed functional subclasses, including: for each processed functional subclass, taking the processed functional subclass as a process node, and taking the functional description of the processed functional subclass as the description content of the process node; obtaining the connection relationship between the process nodes based on the execution order and business processing logic of the processed functional subclasses; and generating the code flow document for the business system based on the connection relationship between the process nodes and the description content of each process node.
[0017] According to another aspect of an embodiment of the present invention, there is provided a device for generating a code flow document, comprising:
[0018] A function subclass registration module, used for registering the function subclasses of each business system included in the application into the flow engine in response to the application starting;
[0019] A function subclass acquisition module, configured to, in response to receiving an interface call request from a business system, acquire a function subclass set corresponding to the business system through the flow engine, wherein the function subclasses in the function subclass set have an execution order and a business processing logic;
[0020] An annotation information acquisition module is used to acquire annotation information of processed function subclasses in the process in which the flow engine processes the function subclasses in the function subclass set according to the execution order of the function subclasses and the business processing logic;
[0021] The process document generation module is used to generate the code process document of the business system according to the execution order, business processing logic and annotation information of the processed functional subclasses.
[0022] According to another aspect of an embodiment of the present invention, there is provided an electronic device, comprising: one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method for generating a code flow document provided in an embodiment of the present invention.
[0023] According to another aspect of an embodiment of the present invention, a computer-readable medium is provided, on which a computer program is stored. When the program is executed by a processor, the method for generating a code flow document provided by an embodiment of the present invention is implemented.
[0024] An embodiment of the above invention has the following advantages or beneficial effects: by responding to the application startup, registering the function subclasses of each business system included in the application into the flow engine; in response to receiving the interface call request of the business system, obtaining the function subclass set corresponding to the business system through the flow engine, and the function subclasses in the function subclass set have an execution order and a business processing logic; in the process of the flow engine processing the function subclasses in the function subclass set according to the execution order and the business processing logic of the function subclass, obtaining the annotation information of the processed function subclass; according to the execution order, business processing logic and annotation information of the processed function subclass, a technical solution for generating a code flow document of the business system can be generated based on the annotation, execution order and business processing logic of the function subclass by dividing a business process into multiple function subclasses in a scenario without relying on additional storage resources, so that the code flow document can be quickly used with simple configuration regardless of whether it is an existing project or a new project, and the code flow document can be generated conveniently and efficiently, saving costs; at the same time, the code flow document can also be changed with the change of the business process, reducing the maintenance cost of the later code flow document and the cost of getting started for newcomers.
[0025] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.
[0027] Figure 1 It is a schematic diagram of the main steps of the method for generating a code flow document according to an embodiment of the present invention;
[0028] Figure 2 It is a schematic diagram of the function subclass registration process of an embodiment of the present invention;
[0029] Figure 3 It is a schematic diagram of the functional subclass processing flow of an embodiment of the present invention;
[0030] Figure 4 is a schematic diagram of a code flow document generated in one embodiment of the present invention;
[0031] Figure 5 is a schematic diagram of main modules of a device for generating a code flow document according to an embodiment of the present invention;
[0032] Figure 6 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;
[0033] Figure 7 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION
[0034] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0035] It should be noted that the collection, collection, updating, analysis, processing, use, transmission, storage and other aspects of user personal information involved in the technical solution disclosed in the present invention are in compliance with the provisions of relevant laws and regulations, are used for legitimate purposes, and do not violate public order and good morals. Necessary measures are taken for user personal information to prevent illegal access to user personal information data and maintain the security of user personal information, network security and national security.
[0036] In the prior art, the code flow document is generated based on the workflow capability provided by cloud services. It is necessary to provide services based on the cloud, which is costly. In addition, the entire system needs to be adjusted to generate the code flow document, which is labor-intensive and easy to lose sight of the big picture. The code flow document is generated based on the workflow engine, which is cumbersome to configure and has too much dependence. It needs to rely on external storage media such as databases, which is costly and complicated to transform the existing project process.
[0037] In order to solve this technical problem, the technical solution of the present invention is mainly aimed at low-cost transformation and no additional resource dependence. Through abstract design, it can produce process documents according to the steps of the main process, and can synchronize the process documents with the main process changes. At the same time, it can also reduce the cost of later document maintenance and the cost of getting started for new people. The technical solution of the present invention is lightweight and has no dependencies, and it abandons the characteristics of complex configuration and process flow, so it is low-cost whether it is used in the transformation of existing projects or in new projects. When transforming existing projects, it is only necessary to introduce a stream engine, analyze and evaluate each step in a process in the current application, and then perform atomic cutting. For each step, a stream processor is abstracted and inherited from the functional subclass of the stream engine for quick use.
[0038] In the technical solution of the present invention, in the process of code development, each step of the main process in the code will be abstracted to obtain a functional subclass, which has a method for judging whether the current functional subclass supports business processing and an implementation method for the business processing logic when supporting business processing. Among them, the specific business processing logic can be set according to business needs. An annotation will be added to each abstracted functional subclass to mark the class as a functional subclass of the flow engine. The annotation mainly has three attributes: group grouping, order sorting and desc process description. Among them, group and order are used to combine functional subclasses, and functional subclasses with the same group value are grouped together, and are sorted from small to large in order, that is, the execution order of the functional subclasses, and desc is used to display the functional description of the current node (functional subclass) when visualizing the process document.
[0039] In addition, the present invention also implements a stream engine, which mainly registers all functional subclasses into the registry inside the stream engine for maintenance when the program is started, and provides an execution method for the implementation method of the business processing logic, according to which the implementation method of the business processing logic of the functional subclass can be executed. During the execution process, the stream engine will open a copy thread for recording the stream processing context, which mainly manages the results, variables, etc. of multiple execution task atomic classes in a better way, and can be understood as a temporary storage medium, which is created as the request is received and eliminated as the request is responded to.
[0040] The implementation process of the present invention is described below in conjunction with specific embodiments.
[0041] Figure 1 FIG. 1 is a schematic diagram of the main steps of the method for generating a code flow document according to an embodiment of the present invention. Figure 1 As shown, the method for generating a code flow document according to an embodiment of the present invention mainly includes the following steps S101 to S104.
[0042] Step S101: In response to application startup, register the functional subclasses of each business system included in the application into the flow engine. After the application code development is completed, when the application is started, the functional subclasses of each business system included in the application will be registered into the flow engine. During the code development process, annotation information will be added to each functional subclass.
[0043] According to one embodiment of the present invention, the annotation information includes grouping information and execution order of functional subclasses. In response to application startup, the functional subclasses of each business system included in the application are registered in the flow engine, which may specifically include: in response to application startup, the functional subclasses included in the application are obtained; for each functional subclass, the grouping information and execution order of the functional subclass are obtained according to the annotation information of the functional subclass, and the grouping information corresponds to the business system; the business system group to which the functional subclass belongs is determined according to the grouping information, and the functional subclasses in each business system group are sorted according to the execution order; the functional subclasses after grouping and sorting are registered in the flow engine. Among them, when obtaining the functional subclasses included in the application, for example, it is obtained through a container created by an application development framework. After the application is started, the application development framework will create a container, create class objects according to the configuration file, solve the dependencies between class objects, and manage these class objects at the same time. Implement complex dependency, injection, management and other functions so that users can use this technology through simple configuration.
[0044] Figure 2 FIG. 1 is a schematic diagram of a functional subclass registration process according to an embodiment of the present invention. Figure 2 As shown, in one embodiment of the present invention, the main process of registering a functional subclass is as follows:
[0045] Step S201: when the application is started, all functional subclasses included in the application are obtained from the container;
[0046] Step S202: traverse all functional subclasses obtained in step S201;
[0047] Step S203: during the traversal process, obtain the annotation information of each functional subclass to obtain the group (grouping) and order (execution order) of the functional subclass;
[0048] Step S204: grouping the functional subclasses according to group, and grouping the functional subclasses with the same group value as one group;
[0049] Step S205: sort the functional subclasses in the same group from small to large according to order (execution order), which is the business step order;
[0050] Step S206: Register the grouped and sorted functional subclasses in the registry of the flow engine. The registry of the flow engine is, for example, a local key-value pair set table, where key = group for grouping, value = functional subclass of the same group. Here, since the group in the annotation information corresponds to the business system when adding annotations to the code, the group here is the business system group.
[0051] Step S102: In response to receiving an interface call request from a business system, the flow engine is used to obtain a set of function subclasses corresponding to the business system, wherein the function subclasses in the set of function subclasses have an execution order and business processing logic. When the business system interface receives a user call request, the flow engine is used to execute business processing.
[0052] In one embodiment of the present invention, in response to receiving an interface call request from a business system, obtaining a function subclass set corresponding to the business system through the flow engine may specifically include: in response to receiving an interface call request from the business system, obtaining a function subclass set corresponding to the business system through the flow engine according to a business system group corresponding to the business system. When obtaining the function subclass set corresponding to the business system, the flow engine first obtains a business system group group corresponding to the business system, and then finds a function subclass set corresponding to the business system group from a registration table according to the group.
[0053] Step S103: when the flow engine processes the function subclasses in the function subclass set according to the execution order of the function subclasses and the business processing logic, the annotation information of the processed function subclasses is obtained.
[0054] According to one embodiment of the present invention, the flow engine processes the function subclasses in the function subclass set according to the execution order and business processing logic of the function subclasses, which may specifically include: the flow engine traverses the function subclasses in the function subclass set according to the execution order of the function subclasses; for each function subclass, executes the business processing logic of the function subclass, and obtains the execution state of the business processing logic, the execution state includes executing the next function subclass and returning the result; when the execution state is to execute the next function subclass, obtain the next function subclass; when the execution state is to return the result, obtain the processing result from the flow processing context of the flow engine and return it. When the flow engine executes the business processing logic of the function subclass (i.e., the implementation method of the business processing logic of the function subclass), it will determine whether to execute the next function subclass or terminate the flow processing directly according to the execution state of the business processing logic or the implementation method of the business processing logic. Here, the execution state is defined to include executing the next function subclass (NEXT state) and returning the result (RETURN state).
[0055] According to another embodiment of the present invention, before executing the business processing logic of each functional subclass, it may also include: determining whether the functional subclass has business processing logic; and obtaining the next functional subclass when the business processing class does not have business processing logic. When the business processing class has business processing logic, the business processing logic of the functional subclass can be executed. Generally, for different application platforms of the same application, the functions that need to be implemented on different platforms are slightly different. For example, the security verification function may not need to be executed on a mobile phone terminal with higher security, but needs to be executed on a personal computer PC with relatively lower security. Therefore, when executing here, it is first determined whether the functional subclass supports business code implementation. If it does, there is business processing logic.
[0056] Figure 3 FIG. 1 is a schematic diagram of a functional subclass processing flow of an embodiment of the present invention. Figure 3 As shown, the functional subclass processing flow of one embodiment of the present invention is mainly as follows:
[0057] Step S301: receiving an interface call request from a business system and calling a flow engine to perform business processing;
[0058] Step S302: the flow engine obtains a corresponding function subclass set according to the business system group corresponding to the business system;
[0059] Step S303: traverse the function subclass set until all the function subclasses in the function subclass set are taken out;
[0060] Step S304: Execute the method of the function subclass to determine whether the current function subclass supports business processing, and determine whether the function subclass supports business code implementation; if it does, execute step S305, otherwise execute step S307:
[0061] Step S305: Execute the implementation method of the business processing logic of the functional subclass and obtain the execution status;
[0062] Step S306: Determine whether the execution state is NEXT state, if yes, execute step S307, otherwise execute step S308;
[0063] Step S307: Get the next functional subclass and execute step S304;
[0064] Step S308: The state is RETURN, the process is terminated, the response result is obtained from the stream processing context of the stream engine and returned to the caller.
[0065] Step S104: Generate the code flow document of the business system according to the execution order, business processing logic and annotation information of the processed function subclasses. When the flow engine processes the function subclasses, it will obtain the annotation information of the processed function subclasses and then generate the code flow document of the business system.
[0066] According to another embodiment of the present invention, the annotation information includes a functional description of the functional subclass. Generating the code flow document of the business system according to the execution order, business processing logic and annotation information of the processed functional subclass may specifically include: acquiring the functional description of the processed functional subclass according to the annotation information of the processed functional subclass; generating the code flow document of the business system according to the execution order, business processing logic and functional description of the processed functional subclass.
[0067] In a specific embodiment of the present invention, generating the code flow document of the business system according to the execution order, business processing logic and functional description of the processed functional subclasses may include: for each processed functional subclass, taking the processed functional subclass as a process node, and taking the functional description of the processed functional subclass as the description content of the process node; obtaining the connection relationship between the process nodes according to the execution order and business processing logic of the processed functional subclasses; and generating the code flow document of the business system according to the connection relationship between the process nodes and the description content of each process node.
[0068] In the process of processing the functional subclass by the flow engine, the annotation information of the processed functional subclass will be obtained, and then the code flow document of the business system will be generated, wherein the code flow document is, for example, a flowchart. When drawing a flowchart, for example, it can be realized by the drawing class that comes with the development software itself, which provides basic functions for drawing, such as common canvas, drawing a rectangle, drawing a line, writing text, etc. For each business system group, the functional subclasses it includes constitute the process nodes in the flowchart, and the functional description (i.e., desc attribute) in the annotation of each processed functional subclass is the description content of the process node. According to the execution order of the processed functional subclasses and the business processing logic, the connection relationship between the process nodes can be obtained, so that the code flow chart of the business system can be drawn.
[0069] Figure 4 Schematic diagram of a code flow document generated in one embodiment of the present invention. Figure 4 As shown, in one embodiment of the present invention, the description content of each process node can be obtained according to the value of the desc attribute in the annotation information on the left side of the figure; the connection relationship between the process nodes can be obtained according to the execution order and business processing logic of each process node, and based on this, the code flow document can be drawn.
[0070] Figure 5 Schematic diagram of the main modules of the device for generating code flow documents according to an embodiment of the present invention. Figure 5 As shown, the device 500 for generating a code flow document according to an embodiment of the present invention mainly includes:
[0071] A function subclass registration module 501 is used to register the function subclasses of each business system included in the application into the flow engine in response to the application starting;
[0072] A function subclass acquisition module 502, configured to, in response to receiving an interface call request from a business system, acquire a function subclass set corresponding to the business system through the flow engine, wherein the function subclasses in the function subclass set have an execution order and a business processing logic;
[0073] An annotation information acquisition module 503, used for acquiring annotation information of processed function subclasses in the process where the flow engine processes the function subclasses in the function subclass set according to the execution order of the function subclasses and the business processing logic;
[0074] The process document generation module 504 is used to generate the code process document of the business system according to the execution order, business processing logic and annotation information of the processed functional subclasses.
[0075] According to one embodiment of the present invention, the annotation information includes grouping information and execution order of functional subclasses; the functional subclass registration module 501 can also be used to: in response to application startup, obtain the functional subclasses included in the application; for each functional subclass, obtain the grouping information and execution order of the functional subclass according to the annotation information of the functional subclass, the grouping information corresponds to the business system; determine the business system group to which the functional subclass belongs according to the grouping information, and sort the functional subclasses in each business system group according to the execution order; register the grouped and sorted functional subclasses in the flow engine.
[0076] According to another embodiment of the present invention, the function subclass acquisition module 502 may also be used to: in response to receiving an interface call request from a business system, acquire a function subclass set corresponding to the business system according to a business system group corresponding to the business system through the flow engine.
[0077] According to another embodiment of the present invention, the flow engine processes the function subclasses in the function subclass set according to the execution order of the function subclasses and the business processing logic, including: the flow engine traverses the function subclasses in the function subclass set according to the execution order of the function subclasses; for each function subclass, executes the business processing logic of the function subclass, and obtains the execution status of the business processing logic, the execution status including executing the next function subclass and returning a result; when the execution status is executing the next function subclass, obtains the next function subclass; when the execution status is returning a result, obtains the processing result from the flow processing context of the flow engine and returns it.
[0078] According to another embodiment of the present invention, for each functional subclass, before executing the business processing logic of the functional subclass, it may also include: determining whether the functional subclass has business processing logic; and obtaining the next functional subclass if the business processing class does not have business processing logic.
[0079] According to another embodiment of the present invention, the annotation information includes a functional description of a functional subclass; the process document generation module 504 can also be used to: obtain the functional description of the processed functional subclass according to the annotation information of the processed functional subclass; generate the code flow document of the business system according to the execution order, business processing logic and functional description of the processed functional subclass.
[0080] According to another embodiment of the present invention, the process document generation module 504 can also be used to: for each processed function subclass, use the processed function subclass as a process node, and use the function description of the processed function subclass as the description content of the process node; obtain the connection relationship between the process nodes according to the execution order of the processed function subclass and the business processing logic; generate the code process document of the business system according to the connection relationship between the process nodes and the description content of each process node.
[0081] According to the technical solution of the embodiment of the present invention, in response to the application startup, the function subclasses of each business system included in the application are registered in the flow engine; in response to receiving the interface call request of the business system, the function subclass set corresponding to the business system is obtained through the flow engine, and the function subclasses in the function subclass set have an execution order and a business processing logic; in the process of the flow engine processing the function subclasses in the function subclass set according to the execution order and the business processing logic of the function subclass, the annotation information of the processed function subclass is obtained; according to the execution order, business processing logic and annotation information of the processed function subclass, the technical solution of generating the code flow document of the business system can be generated based on the annotation, execution order and business processing logic of the function subclass by dividing a business process into multiple function subclasses in a scenario without relying on additional storage resources, so that the code flow document can be quickly used with simple configuration regardless of whether it is an existing project or a new project, and the code flow document can be generated conveniently and efficiently, saving costs; at the same time, the code flow document can also be changed with the change of the business process, reducing the maintenance cost of the later code flow document and the cost of getting started for newcomers.
[0082] Figure 6 An exemplary system architecture 600 is shown to which the method for generating a code flow document or the apparatus for generating a code flow document according to the embodiment of the present invention can be applied.
[0083] like Figure 6 As shown, system architecture 600 may include terminal devices 601, 602, 603, network 604 and server 605. Network 604 is used to provide a medium for communication links between terminal devices 601, 602, 603 and server 605. Network 604 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0084] Users can use terminal devices 601, 602, 603 to interact with server 605 through network 604 to receive or send messages, etc. Various client applications can be installed on terminal devices 601, 602, 603, such as process management applications, web browser applications, search applications, social platform software, etc. (only examples).
[0085] The terminal devices 601 , 602 , and 603 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers, etc.
[0086] The server 605 may be a server that provides various services, such as a background management server that provides support for websites browsed by users using terminal devices 601, 602, and 603 (for example only). The background management server may respond to the received code flow document generation request and other data in response to application startup, register the functional subclasses of each business system included in the application into the flow engine; in response to receiving an interface call request from the business system, obtain a set of functional subclasses corresponding to the business system through the flow engine, and the functional subclasses in the functional subclass set have an execution order and business processing logic; in the process of the flow engine processing the functional subclasses in the functional subclass set according to the execution order and business processing logic of the functional subclasses, obtain the annotation information of the processed functional subclasses; according to the execution order, business processing logic and annotation information of the processed functional subclasses, generate the code flow document of the business system and other processing, and feed back the processing results (such as code flow document - for example only) to the terminal device.
[0087] It should be noted that the method for generating a code flow document provided in the embodiment of the present invention is generally executed by the server 605 , and accordingly, the device for generating a code flow document is generally arranged in the server 605 .
[0088] It should be understood that Figure 6 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to the implementation requirements.
[0089] Reference below Figure 7 , which shows a schematic diagram of the structure of a computer system 700 of a terminal device or a server suitable for implementing an embodiment of the present invention. Figure 7 The terminal device or server shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0090] like Figure 7 As shown, the computer system 700 includes a central processing unit (CPU) 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage part 708 into a random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the system 700 are also stored. The CPU 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0091] The following components are connected to the I / O interface 705: an input section 706 including a keyboard, a mouse, etc.; an output section 707 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN card, a modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I / O interface 705 as needed. A removable medium 711, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 710 as needed, so that a computer program read therefrom is installed into the storage section 708 as needed.
[0092] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 709, and / or installed from the removable medium 711. When the computer program is executed by the central processing unit (CPU) 701, the above-mentioned functions defined in the system of the present invention are executed.
[0093] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0094] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0095] The units or modules involved in the embodiments of the present invention may be implemented in software or hardware. The units or modules described may also be provided in a processor. For example, they may be described as follows: a processor includes a function subclass registration module, a function subclass acquisition module, an annotation information acquisition module, and a process document generation module. Among them, the names of these units or modules do not constitute limitations on the units or modules themselves in certain circumstances. For example, the function subclass registration module may also be described as "a module for registering the function subclasses of each business system included in the application into the flow engine in response to application startup."
[0096] As another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiment; or it may exist independently and not be assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes: in response to application startup, registering the functional subclasses of each business system included in the application into the flow engine; in response to receiving an interface call request of the business system, obtaining the functional subclass set corresponding to the business system through the flow engine, and the functional subclasses in the functional subclass set have an execution order and business processing logic; in the process of the flow engine processing the functional subclasses in the functional subclass set according to the execution order and business processing logic of the functional subclasses, obtaining the annotation information of the processed functional subclasses; generating the code flow document of the business system according to the execution order, business processing logic and annotation information of the processed functional subclasses.
[0097] According to the technical solution of the embodiment of the present invention, in response to the application startup, the function subclasses of each business system included in the application are registered in the flow engine; in response to receiving the interface call request of the business system, the function subclass set corresponding to the business system is obtained through the flow engine, and the function subclasses in the function subclass set have an execution order and a business processing logic; in the process of the flow engine processing the function subclasses in the function subclass set according to the execution order and the business processing logic of the function subclass, the annotation information of the processed function subclass is obtained; according to the execution order, business processing logic and annotation information of the processed function subclass, the technical solution of generating the code flow document of the business system can be generated based on the annotation, execution order and business processing logic of the function subclass by dividing a business process into multiple function subclasses in a scenario without relying on additional storage resources, so that the code flow document can be quickly used with simple configuration regardless of whether it is an existing project or a new project, and the code flow document can be generated conveniently and efficiently, saving costs; at the same time, the code flow document can also be changed with the change of the business process, reducing the maintenance cost of the later code flow document and the cost of getting started for newcomers.
[0098] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for generating code flow documents, It is characterized in that include: In response to application startup, registering functional subclasses of various business systems included in the application into the flow engine; In response to receiving an interface call request from a business system, obtaining a function subclass set corresponding to the business system through the flow engine, wherein the function subclasses in the function subclass set have an execution order and a business processing logic; In the process of the flow engine processing the function subclasses in the function subclass set according to the execution order of the function subclasses and the business processing logic, obtaining annotation information of the processed function subclasses; A code flow document of the business system is generated according to the execution order, business processing logic and annotation information of the processed functional subclasses.
2. The method according to claim 1, It is characterized in that The annotation information includes grouping information and execution order of functional subclasses; In response to the application being started, the functional subclasses of each business system included in the application are registered in the flow engine, including: In response to application startup, obtaining a function subclass included in the application; For each functional subclass, obtaining grouping information and execution order of the functional subclass according to the annotation information of the functional subclass, wherein the grouping information corresponds to the business system; Determine the business system group to which the function subclass belongs according to the grouping information, and sort the function subclasses in each business system group according to the execution order; The grouped and sorted functional subclasses are registered in the stream engine.
3. The method according to claim 2, It is characterized in that In response to receiving an interface call request from a business system, obtaining a set of function subclasses corresponding to the business system through the flow engine includes: In response to receiving an interface call request from a business system, the flow engine obtains a set of function subclasses corresponding to the business system according to a business system group corresponding to the business system.
4. The method according to claim 1, It is characterized in that The flow engine processes the function subclasses in the function subclass set according to the execution order of the function subclasses and the business processing logic, including: The flow engine traverses the function subclasses in the function subclass set according to the execution order of the function subclasses; For each function subclass, execute the business processing logic of the function subclass, and obtain the execution status of the business processing logic, wherein the execution status includes executing the next function subclass and returning the result; When the execution state is to execute the next functional subclass, obtaining the next functional subclass; When the execution state is to return a result, the processing result is obtained from the stream processing context of the stream engine and returned.
5. The method according to claim 4, It is characterized in that For each functional subclass, before executing the business processing logic of the functional subclass, it also includes: Determine whether the functional subclass has business processing logic; When the business processing class has no business processing logic, the next functional subclass is obtained.
6. The method according to claim 1, It is characterized in that The annotation information includes a functional description of the functional subclass; Generate the code flow document of the business system according to the execution order, business processing logic and annotation information of the processed functional subclasses, including: Acquire a function description of the processed function subclass according to the annotation information of the processed function subclass; A code flow document for the business system is generated according to the execution order, business processing logic and functional description of the processed functional subclasses.
7. The method according to claim 6, It is characterized in that Generate a code flow document of the business system according to the execution order, business processing logic and function description of the processed function subclasses, including: For each processed function subclass, the processed function subclass is used as a process node, and a function description of the processed function subclass is used as a description content of the process node; Obtaining the connection relationship between the process nodes according to the execution order of the processed functional subclasses and the business processing logic; A code flow document of the business system is generated according to the connection relationship between the process nodes and the description content of each process node.
8. A device for generating code flow documents, It is characterized in that include: A function subclass registration module, used for registering the function subclasses of each business system included in the application into the flow engine in response to the application starting; A function subclass acquisition module, configured to, in response to receiving an interface call request from a business system, acquire a function subclass set corresponding to the business system through the flow engine, wherein the function subclasses in the function subclass set have an execution order and a business processing logic; An annotation information acquisition module is used to acquire annotation information of processed function subclasses in the process in which the flow engine processes the function subclasses in the function subclass set according to the execution order of the function subclasses and the business processing logic; The process document generation module is used to generate the code process document of the business system according to the execution order, business processing logic and annotation information of the processed functional subclasses.
9. An electronic device, It is characterized in that include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 7.
10. A computer readable medium having a computer program stored thereon, It is characterized in that When the program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.