A service code development method, system and computer readable storage medium
By generating a list of configuration file data and leveraging the collaborative work of the plugin layer and view layer, the visualization and automatic generation of business code are achieved, solving the problems of high code comprehension costs and poor maintainability in complex business scenarios, and improving development efficiency and code maintainability.
Patent Information
- Application Number
- CN202210556089.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-20
- Publication Date
- 2026-02-03
- Estimated Expiration
- 2042-05-20
AI Technical Summary
In complex business scenarios, existing technologies suffer from high costs in understanding business code, poor maintainability, and inconsistent development tools and environments, leading to low development efficiency and high costs in troubleshooting.
Based on the operator business code in the code library, a configuration file data list is generated. Through the collaborative work of the plugin layer and the view layer, the visual orchestration and automatic generation of business operators are realized, reducing the understanding cost and improving maintainability and robustness.
It enables visual orchestration and automatic generation of business code, reducing R&D costs, improving code maintainability and development efficiency, and simplifying the troubleshooting process.
Smart Images

Figure CN114816430B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and further to the fields of software development, business code development, and other technical fields, and particularly to a business code development method, system, and computer-readable storage medium. Background Technology
[0002] With the rapid growth of enterprise digitalization needs, the development of business code for software has flourished. Low-code is a rapid development tool for software systems, allowing developers to implement common functions without coding and to extend functionality with minimal code, thus facilitating the convenient construction of applications. Summary of the Invention
[0003] This disclosure provides a business code development method, system, and computer-readable storage medium.
[0004] According to one aspect of this disclosure, a business code development method is provided, comprising:
[0005] Based on the operator business code in the code library, a configuration file data list including multiple business operators is generated, wherein the multiple business operators are used to implement preset business functions;
[0006] Based on the data list in the configuration file, the multiple business operators are encapsulated into multiple components, and the multiple components are rendered and displayed respectively;
[0007] In response to an orchestration operation for at least one target component among the plurality of components, a data stream corresponding to the at least one target component is generated in the target area of the view layer;
[0008] Based on the execution logic of the at least one target component, generate state data representing the data flow;
[0009] Based on the state data and the business operators corresponding to the at least one target component, the application business code of the data stream is generated.
[0010] According to another aspect of this disclosure, a business code development system is provided, including: a plugin layer and a view layer;
[0011] The plugin layer is used to generate a configuration file data list including multiple business operators based on the operator business code in the code library, wherein the multiple business operators are used to implement preset business functions, and send the configuration file data list to the view layer; receive the status data of the data stream, and generate the application business code of the data stream based on the status data and the business operator corresponding to at least one target component;
[0012] The view layer is configured to receive the configuration file data list, encapsulate the multiple business operators into multiple components according to the configuration file data list, render and display the multiple components respectively; in response to an orchestration operation for at least one target component among the multiple components, generate a data stream corresponding to the at least one target component in the target area of the view layer; generate state data representing the data stream according to the execution logic of the at least one target component, and send the state data of the data stream to the plugin layer.
[0013] According to another aspect of this disclosure, a non-transitory computer-readable storage medium is provided storing computer instructions, wherein the computer instructions are used to cause the computer to execute the business code development method described in any one of this disclosure.
[0014] According to another aspect of this disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements the business code development method described in any one of this disclosure.
[0015] This disclosure embodiment implements the development of business code.
[0016] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description
[0017] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein:
[0018] Figure 1 This is a schematic diagram of a business code development system based on this disclosure;
[0019] Figure 2 This is a schematic diagram of a view layer interface display according to the present disclosure;
[0020] Figure 3 This is an interactive diagram of a business code development system based on this disclosure;
[0021] Figure 4 This is an interactive diagram of a system developed based on another business code according to this disclosure;
[0022] Figure 5 This is a flowchart illustrating a business code development method according to this disclosure;
[0023] Figure 6 This is a block diagram of an electronic device used to implement the business code development method of the embodiments of this disclosure. Detailed Implementation
[0024] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0025] With the rapid growth of enterprise digitalization needs, the development of business logic code for software is receiving increasing attention. In related technologies, during the development of business logic code for software, to meet customer business requirements, developers add or remove relevant business logic from existing codebases and introduce corresponding tricks or logic pairs. In complex business scenarios, adding or removing relevant business logic from existing codebases requires understanding the existing code, and changes in developers may increase the cost of understanding the business logic. Introducing tricks or logic pairs reduces the maintainability of the business logic code. Furthermore, for software development throughout its entire lifecycle—development, debugging, testing, and deployment—inconsistent development tools, development environments, and basic dependencies among developers increase the cost of troubleshooting during development and deployment, resulting in low overall efficiency in software development.
[0026] The business code development method provided in this disclosure includes: generating a configuration file data list including multiple business operators based on operator business code in a code library, wherein the multiple business operators are used to implement preset business functions; encapsulating the multiple business operators into multiple components according to the configuration file data list, rendering and displaying the multiple components respectively; generating a data stream corresponding to at least one target component in the target area of the view layer in response to an orchestration operation for at least one target component among the multiple components; generating state data representing the data stream according to the execution logic of at least one target component; and generating application business code for the data stream based on the state data and the business operators corresponding to at least one target component.
[0027] In this embodiment, a configuration file data list including multiple business operators can be generated based on the operator business code in the code library. The multiple business operators are then encapsulated into multiple components according to the configuration file data list, and each component is rendered and displayed. In response to an orchestration operation targeting at least one target component, a data flow corresponding to at least one target component is generated in the target area of the view layer. This achieves visual orchestration of the operator business code, reducing the understanding cost of the operator business code. Furthermore, based on the execution logic of at least one target component, state data representing the data flow is generated. Based on the state data and the business operators corresponding to at least one target component, application business code for the data flow is generated, achieving automatic generation of application business code, reducing development costs. The visual orchestration of the operator business code facilitates troubleshooting and increases the maintainability and robustness of the operator business code.
[0028] The business code development method provided in this disclosure can be applied to a business code development system, which can be found in [reference needed]. Figure 1 The business code development system 100 includes a plugin layer 110 and a view layer 120. In one example, the business code development system of this embodiment can be applied to the entire lifecycle of development, debugging, testing, and deployment in complex business scenarios, such as a search platform.
[0029] The business code development system of this disclosure embodiment can be built based on the VSCode (Visual Studio Code, a source code editor) plugin mechanism, integrated with the IDE (Integrated Development Environment), and provides a web (world wide web, internet) IDE and client devices, making the development tools, development environment, and basic dependencies unified. The plugin layer 110 can start a node JS (JavaScript, a scripting language) process to act as a server, realizing low-level system operations such as reading and writing business code.
[0030] The plugin layer 110 can be used to generate a configuration file data list containing multiple business operators based on the operator business code in the code library. The multiple business operators are used to implement preset business functions; and the configuration file data list is sent to the view layer 120.
[0031] In one example, the aforementioned pre-defined business functions could include request processing, data processing, data access, data querying, data parsing, data storage, data updating, and so on. The aforementioned codebase could be a local codebase for the business unit, or a shared codebase for multiple business units.
[0032] In one possible implementation, the plugin layer 110 is specifically used to: read operator business code from the code library, parse the operator business code, identify the business operators in the operator business code, encapsulate the business operators into configuration file data in JSON format, and obtain a list of configuration file data.
[0033] In one example, after the plugin layer 110 starts, it can scan the operator business code in the code library, read the operator business code, use AST (Abstract Syntax Tree) to parse the read operator business code, identify the business operators in the operator business code, and further encapsulate each identified business operator into JSON format configuration file data to obtain a configuration file data list. This configuration file data list can contain configuration file data for multiple business operators.
[0034] For example, the configuration file data of a business operator can be comments on the business functions implemented by the business operator, updates to the functions implemented by the business operator compared to the past, or operations on other business operators, etc.
[0035] In this embodiment of the disclosure, the plug-in layer 110 can act as a server to read operator business code from the code library, parse the read operator business code, identify business operators, and upgrade the business code from function level to operator level so that the business operators can be directly operated on in the future, thereby improving the reusability of operator business code. Furthermore, parsing the operator business code reduces the understanding cost of operator business code and further improves the software development efficiency.
[0036] After obtaining the configuration file data list containing multiple business operators, the plugin layer 110 can send the configuration file data list to the view layer 120 so that the view layer 120 can perform visual operations on the business operators based on the configuration file data list.
[0037] The view layer 120 can be used to receive a list of configuration file data, encapsulate the multiple business operators into multiple components according to the list of configuration file data, render and display the multiple components respectively; in response to an orchestration operation for at least one target component among the multiple components, generate a data stream corresponding to the at least one target component in the target area of the view layer; generate state data representing the data stream according to the execution logic of the at least one target component, and send the state data of the data stream to the plug-in layer 110.
[0038] In one example, view layer 120 can be a VSCode WebView. The VSCode WebView receives a list of configuration file data sent by plugin layer 110. For each business operator in the configuration file data list, it encapsulates the business operator into a component, resulting in multiple components. These components are then rendered and displayed; for example, components representing commonly used operators and all operators are displayed in the left area of view layer 120. Upon receiving an orchestration operation from the user for at least one target component among the displayed components, the view layer responds by generating a data stream corresponding to the orchestrated target component in the target area of view layer 120. For example, a data stream composed of at least one orchestrated target component is displayed in the middle area of view layer 120. Furthermore, based on the execution logic of the orchestrated target component, state data representing the data stream is generated and sent to plugin layer 110. Here, the target component represents the component operated by the user, i.e., the component used to generate the data stream.
[0039] In one possible implementation, the plug-in layer 110 sends a list of configuration file data to the view layer 120 in the form of a message, and the view layer 120 sends the status data of the data stream to the plug-in layer 110 in the form of a message.
[0040] In this embodiment of the disclosure, the plug-in layer 110 and the view layer 120 interact with each other through messages. Compared with data interaction through network requests, this can save data interaction time and conserve system resources.
[0041] The plugin layer 110 is also used to receive status data from the data stream and generate application business code for the data stream based on the status data and at least one business operator corresponding to the target component.
[0042] The plugin layer 110 receives status data of the data stream sent by the view layer 120. This status data is generated by the view layer 120 based on the execution logic of at least one target component, representing the status data of the data stream containing the at least one target component. The plugin layer 110 can generate application business code corresponding to the data stream based on the execution logic of the at least one target component in the data stream represented by the status data, and the business operators corresponding to the at least one target component in the data stream. Furthermore, after generating the application business code of the data stream, the plugin layer 110 can also store the generated application business code in a code repository so that the code can take effect at any time when the business goes live.
[0043] In this embodiment, the plugin layer can generate a configuration file data list including multiple business operators based on the operator business code in the code library. The view layer can encapsulate the multiple business operators into multiple components according to the configuration file data list, render and display the multiple components respectively. In response to the orchestration operation for at least one target component among the multiple components, a data stream corresponding to at least one target component is generated in the target area of the view layer, realizing the visual orchestration of operator business code and reducing the understanding cost of operator business code. Furthermore, the view layer generates state data representing the data stream according to the execution logic of at least one target component and sends the state data of the data stream to the plugin layer. The plugin layer generates the application business code of the data stream based on the state data of the data stream and the business operators corresponding to at least one target component, realizing the automatic generation of application business code, reducing the development cost, and the visual orchestration of operator business code facilitates the troubleshooting of problems and increases the maintainability and robustness of operator business code.
[0044] In one possible implementation, the view layer 120 may include a graph arranger, which may be used to: obtain the user's arrangement operation for at least one target component among a plurality of displayed components, arrange the corresponding target component in the target area of the view layer 120 according to the arrangement operation, and generate a data stream corresponding to at least one target component.
[0045] The view layer 120 may include a graph orchestrator. After the view layer 120 encapsulates multiple business operators into multiple components according to the configuration file data list, renders and displays the multiple components, the user can perform orchestration operations on the displayed components. The graph orchestrator obtains the user's orchestration operation for at least one target component among the multiple displayed components and responds to the user's orchestration operation. In the target area of the view layer 120, the corresponding target component is orchestrated according to the orchestration operation to generate a data stream corresponding to at least one target component. For example, the orchestrated data stream can be displayed in the middle area of the view layer 120.
[0046] In this embodiment of the disclosure, the graph arranger can obtain the user's arrangement operation for at least one target component among the multiple components displayed. The target component is rendered by the business operator. In response to the user's arrangement operation, the graph arranger arranges the corresponding target component in the target area of the view layer according to the arrangement operation, and generates a data stream corresponding to at least one target component, thereby realizing the visual editing of the operator business code.
[0047] In one possible implementation, the above arrangement operations include at least one of the following: drag, move, delete, select, edit, and connect.
[0048] For example, selection can be done by clicking to select, double-clicking to select, etc.
[0049] In this embodiment of the disclosure, the view layer can respond to the user's arrangement operations such as dragging, moving, deleting, selecting, editing, and connecting lines on at least one target component among the multiple displayed components, thereby enabling visual editing of the operator business code.
[0050] In one possible implementation, the view layer 120 is specifically used to: encapsulate the multiple business operators contained in the configuration file data list into multiple components through the Canvas, and render and display each component as a page element; and set each displayed component as an programmable component.
[0051] After receiving the configuration file data list sent by the plugin layer 110, the view layer 120 can use Canvas to encapsulate the configuration file data of each business operator contained in the configuration file data list into a component, resulting in multiple components. Then, for each component, the view layer 120 can render and display it as a page element.
[0052] The view layer 120 can also set each of the displayed components as an orchestratable component. In one example, each of the displayed components can be abstracted and encapsulated as a drag-and-drop source component and a drag-and-drop target component, so that each component can be orchestrated. The drag-and-drop source component is used to be dragged and moved, and the drag-and-drop target component is used to place the dragged component.
[0053] For example, such as Figure 2 As shown, the view layer 120 can encapsulate and render various business operators using Canvas. For example, it can encapsulate and render business operators based on their styles, edges, endpoints, etc., to obtain multiple components displayed by the view layer 120. It can also encapsulate the multiple displayed components into drag-and-drop source components and drag-and-drop target components, so that each component can be dragged, moved, deleted, selected, edited, connected, and other arrangement operations.
[0054] In this embodiment, the view layer encapsulates multiple business operators contained in the configuration file data list into multiple components using a Canvas, and renders and displays each component as a page element. Each displayed component is set as an orchestratable component, enabling the view layer 120's graph orchestrator to respond to user orchestration operations on at least one target component, thus achieving visual editing of the operator business code. The orchestratibility of each component indicates that the corresponding business operators are pluggable, making them reusable. The view layer generates a data stream corresponding to at least one target component, upgrading the operator business code from the operator level to the data stream flow level, facilitating the graphical representation of the operator business code and improving its maintainability.
[0055] In one possible implementation, the state data of the data stream generated by the view layer 120 may include: configuration parameter data of the configuration file data of at least one target component in the data stream, and execution order data of at least one target component in the data stream.
[0056] The aforementioned plug-in layer 110 is specifically used for: configuring the parameters of the business operators of the corresponding target components according to the configuration parameter data of the configuration file data of at least one target component in the status data, to obtain the target business operators of the corresponding target components; and setting the execution order of the target business operators of the corresponding target components according to the execution order data of at least one target component in the status data, to obtain the application business code of the data stream.
[0057] In one example, the configuration parameter data of the configuration file data of at least one target component in the data stream could be the business function parameter data implemented by the business operator corresponding to the target component, the update parameter data of the business operator corresponding to the target component, or the operation parameter data of the business operator corresponding to the target component on other business operators, etc. The execution order data of at least one target component in the data stream could be the connection data between target components, or the execution logic data between the business operators corresponding to the target components, etc.
[0058] After receiving the status data of the data stream sent by the view layer 120, the plug-in layer 110 can configure the parameters of the business operators of the corresponding target components according to the configuration parameter data of the configuration file data of at least one target component in the status data of the data stream, so as to obtain the target business operators of the corresponding target components, and set the execution order of the target business operators of the corresponding target components according to the execution order data of at least one target component in the status data, so as to generate the application business code of the data stream.
[0059] In this embodiment of the disclosure, after receiving the status data sent by the view layer, the plugin layer can generate application business code for the data stream according to the configuration parameter data of the configuration file data of at least one target component in the status data and the execution order data of at least one target component in the status data. This realizes the automatic generation of application business code and reduces the development cost.
[0060] In one possible implementation, the graph orchestrator described above can also be used to: after listening to the user's update operation on the components in the data stream, update the corresponding state data of the data stream, and send the updated state data to the plug-in layer 110.
[0061] In this embodiment, a global state data can be maintained locally in the view layer 120. This global state data can include the state data of all data streams generated by the view layer 120. The graph orchestrator can listen to the data streams generated by the view layer 120. When it hears a user's update operation on a component in the data stream, such as clicking, dragging, or moving a component, it can rearrange the corresponding component according to the user's update operation and update the data stream. After the user completes the update operation on the component in the data stream, it updates the state data corresponding to the data stream in real time and sends the updated state data to the plugin layer 110 so that the plugin layer 110 can integrate the generated business code according to the updated state data and update the business code corresponding to the data stream in the code library in real time.
[0062] In this embodiment of the disclosure, after the graph orchestrator of the view layer detects the user's update operation on the components in the data stream, it updates the corresponding state data of the data stream in real time and sends the updated state data to the plugin layer. This allows the plugin layer to integrate the generated application business code based on the updated state data and update the application business code corresponding to the data stream in the code library in real time, thus ensuring the consistency between the application business code corresponding to the view layer data stream and the plugin layer data stream.
[0063] In one possible implementation, the plugin layer 110 can also be used to: when a change is detected in the operator business code in the code library, parse the changed operator business code, identify the changed business operators in the changed operator business code, encapsulate the identified changed business operators into configuration file data in JSON format, obtain a list of changed configuration file data, and send the list of changed configuration file data to the view layer 120.
[0064] The view layer 120 can also be used to receive a list of changed configuration file data, and based on the configuration file data of each changed business operator in the list of changed configuration file data, re-encapsulate the components corresponding to each changed business operator, render and display them in the form of page elements, and update the corresponding data stream and the status data of the data stream.
[0065] After startup, plugin layer 110 can monitor operator business code in the codebase. Upon detecting changes to operator business code, it can use an AST (Abstract Syntax Tree) to parse the changed code, identify the modified business operators, and further encapsulate these operators into JSON-formatted configuration file data, obtaining a list of modified configuration file data. This list is then sent to view layer 120. This list can contain configuration file data for multiple business operators corresponding to the modified operator business code.
[0066] For example, changes to operator business code in the codebase can be caused by operations such as modification, addition, or deletion of operator business code in the codebase.
[0067] After receiving the list of changed configuration file data sent by the plugin layer 110, the view layer 120 can use the configuration file data of each changed business operator in the list of changed configuration file data to re-encapsulate the components corresponding to each changed business operator through the Canvas, and render and display them in the form of page elements. Based on the re-encapsulated and rendered components corresponding to each changed business operator, the view layer 120 updates the data stream and data stream status data containing the components corresponding to each changed business operator.
[0068] In one example, the components displayed in view layer 120 can be bidirectionally bound to the state data of the data stream. As the component rendering changes in real time, the state data of the data stream also changes accordingly. Similarly, as the state data of the data stream changes, the component rendering also changes accordingly.
[0069] In this embodiment, when the plugin layer detects a change in the operator business code in the codebase, it parses the changed operator business code in real time to identify the changed business operators in the changed operator business code. The identified changed business operators are then encapsulated into JSON format configuration file data to obtain a list of changed configuration file data. This list is then promptly sent to the view layer, enabling the view layer to re-encapsulate the components corresponding to each changed business operator based on the configuration file data of each changed business operator in the list of changed configuration file data, and to render and display them as page elements. The view layer also updates the corresponding data stream and data stream status data, ensuring the consistency between the view layer data stream and the plugin layer business code.
[0070] For example, such as Figure 3 As shown, Figure 3This is an interactive diagram of a business code development system according to an embodiment of the present disclosure. The code library may include local code libraries of business parties and common code libraries of multiple business parties. The plugin layer can read operator business code from the code library, parse the read operator business code, identify the business operators in the operator business code, encapsulate the business operators into configuration file data in JSON format, obtain a list of configuration file data, and send the list of configuration file data to the view layer.
[0071] The view layer receives a list of configuration file data, encapsulates the multiple business operators contained in the configuration file data list into multiple components using Canvas, renders and displays the multiple components separately, and sets each component as an orchestratable component. This enables the view layer's graph orchestrator to respond to the user's orchestration operation on at least one target component among the multiple displayed components, generate a data stream corresponding to at least one target component in the target area of the view layer, and send the status data of the data stream to the plugin layer.
[0072] The plugin layer receives the status data of the data stream, configures the parameters of the business operators of the corresponding target components according to the configuration parameter data of the configuration file data of at least one target component in the status data, and obtains the target business operators of the corresponding target components; sets the execution order of the target business operators of the corresponding target components according to the execution order data of at least one target component in the status data, generates the application business code of the data stream, and stores the generated application business code in the code library.
[0073] The aforementioned business code development system can also interact and communicate with other systems and devices through application programming interfaces (APIs).
[0074] In this embodiment, the plugin layer can generate a configuration file data list including multiple business operators based on the operator business code in the code library, upgrading the operator business code from the function level to the operator level. The view layer encapsulates the multiple business operators into multiple components according to the configuration file data list, and renders and displays the multiple components separately. In response to the orchestration operation for at least one target component among the multiple components, a data flow corresponding to at least one target component is generated in the target area of the view layer, which improves the expressiveness of the operator business code, realizes the visual orchestration of the operator business code, reduces the understanding cost of the operator business code, upgrades the operator business code from the operator level to the flow level of the data flow, and improves the reusability of the business code. Furthermore, the view layer generates state data representing the data flow according to the execution logic of at least one target component, and sends the state data of the data flow to the plugin layer. The plugin layer generates the application business code of the data flow based on the state data of the data flow and the business operators corresponding to at least one target component, realizing the automatic generation of application business code, reducing development costs, and the visual orchestration of operator business code facilitates the troubleshooting of problems and increases the maintainability and robustness of operator business code.
[0075] For example, such as Figure 4 As shown, Figure 4 This is an interactive diagram of another business code development system according to an embodiment of this disclosure. Figure 4 The dashed box in the lower left corner represents the initialization of the business code development system, which mainly includes the initialization of the plugin layer and the view layer. This corresponds to the plugin registration and activation function, content and command configuration, listeners, custom events, and triggering the webview initialization in the diagram. The content and command configuration can be the configuration of the relevant content and commands of the operator business code in the plugin layer. Figure 4 The unified Merge operator library refers to the code library mentioned above, which originates from the business side's local code library (including...). Figure 4 The middle part parses the business side's code repository, and listens for changes to the code repository files), and the public code repository ( Figure 4 (The corresponding business code for the JSON configuration of the load architecture operator).
[0076] The plugin layer generates a list of configuration file data by parsing the operator business code in the codebase. Figure 4 The list of configuration file data (including changes to regular files, configuration files, and updates available by operators) is sent to the view layer via a message.
[0077] The view layer receives a list of configuration file data and identifies the events contained in the list. Figure 4The event center (or event hub) uses Canvas to encapsulate the various business operators contained in the configuration file data list into different components and renders them for display. Figure 4 The content displayed in the left area of the webview (i.e., the business code development platform) on the low-to-medium code platform; the view layer's graph orchestrator responds to the user's orchestration operation for at least one target component among multiple displayed components, generating a data stream corresponding to at least one target component in the target area of the view layer. Figure 4 (The content displayed in the WebView area of a low-to-medium code platform) Figure 4 In low-to-medium code platforms, the content displayed in the right area of the webview represents the user's arrangement operations on the displayed components. After the user completes the arrangement of each component, the view layer sends the state data of the data stream to the plugin layer via messages. Figure 4 This includes the content displayed in the boxes for writing to the configuration file, configuring / sorting user-defined common operators, message prompts, and initializing / destroying the webview.
[0078] The plugin layer receives the status data of the data stream and generates the application business code of the data stream based on the status data.
[0079] This disclosure also provides a business code development method, which can be applied to the above-mentioned business code development system. See [link to relevant documentation]. Figure 5 The method includes:
[0080] S501 generates a configuration file data list containing multiple business operators based on the operator business code in the code library. These multiple business operators are used to implement preset business functions.
[0081] The plugin layer can generate a configuration file data list containing multiple business operators based on the operator business code in the code library, and send the configuration file data list to the view layer.
[0082] S502 encapsulates multiple business operators into multiple components based on the data list in the configuration file, and renders and displays each component separately.
[0083] The view layer receives a list of configuration file data sent by the plugin layer, encapsulates multiple business operators into multiple components based on the list of configuration file data, and renders and displays the multiple components separately.
[0084] S503, in response to an orchestration operation for at least one target component among a plurality of components, generates a data stream corresponding to at least one target component in the target area of the view layer.
[0085] The view layer can respond to an orchestration operation targeting at least one of a plurality of components by generating a data stream corresponding to at least one target component in the target area of the view layer.
[0086] S504, based on the execution logic of at least one target component, generate state data representing the data flow.
[0087] The view layer can generate state data representing the data flow based on the execution logic of at least one target component, and send the state data of the data flow to the plugin layer.
[0088] S505 generates application business code for data flow based on state data and at least one business operator corresponding to a target component.
[0089] The plugin layer receives the status data of the data stream sent by the view layer, and generates the application business code of the data stream based on the status data and the business operator corresponding to at least one target component.
[0090] In this embodiment, a configuration file data list including multiple business operators can be generated based on the operator business code in the code library. The multiple business operators are then encapsulated into multiple components according to the configuration file data list, and each component is rendered and displayed. In response to an orchestration operation targeting at least one target component, a data flow corresponding to at least one target component is generated in the target area of the view layer. This achieves visual orchestration of the operator business code, reducing the understanding cost of the operator business code. Furthermore, based on the execution logic of at least one target component, state data representing the data flow is generated. Based on the state data and the business operators corresponding to at least one target component, application business code for the data flow is generated, achieving automatic generation of application business code, reducing development costs. The visual orchestration of the operator business code facilitates troubleshooting and increases the maintainability and robustness of the operator business code.
[0091] In one possible implementation, the above-described response to an orchestration operation for at least one target component among the plurality of components, generating a data stream corresponding to the at least one target component in a target area of the view layer, includes:
[0092] Get the user's orchestration action for at least one target component among the multiple components displayed;
[0093] In the target area of the view layer, the corresponding target components are arranged according to the arrangement operation to generate a data stream corresponding to the at least one target component.
[0094] In one possible implementation, the above-mentioned generation of a configuration file data list including multiple business operators based on operator business code in the code library includes:
[0095] Read the operator business code from the code library, parse the operator business code, and identify the business operators in the operator business code;
[0096] The business operators are encapsulated into configuration file data in JSON format to obtain a list of configuration file data.
[0097] In one possible implementation, the state data of the data stream includes: configuration parameter data of the configuration file data of at least one target component in the data stream, and execution order data of at least one target component in the data stream;
[0098] The application business code that generates the data stream based on the state data and the business operators corresponding to the at least one target component includes:
[0099] Based on the configuration parameter data of the configuration file data of at least one target component in the state data, the parameters of the business operators of the corresponding target components are configured to obtain the target business operators of the corresponding target components.
[0100] Based on the execution order data of at least one target component in the state data, the execution order of the target business operators of the corresponding target components is set to obtain the application business code of the data stream.
[0101] In one possible implementation, the above-mentioned encapsulation of the plurality of business operators into a plurality of components according to the configuration file data list, and rendering and displaying the plurality of components respectively, includes:
[0102] The multiple business operators contained in the configuration file data list are encapsulated into multiple components using a Canvas, and each component is rendered and displayed as a page element.
[0103] The method further includes setting each of the displayed components as an editable component.
[0104] In one possible implementation, the above arrangement operations include at least one of the following: drag, move, delete, select, edit, and connect.
[0105] In one possible implementation, the above also includes:
[0106] After detecting a user's update operation on a component in the data stream, update the corresponding state data of the data stream.
[0107] In one possible implementation, the above also includes:
[0108] When changes are detected in the operator business code in the codebase, the changed operator business code is parsed to identify the changed business operators in the changed operator business code;
[0109] The identified change business operators are encapsulated into JSON format configuration file data to obtain a list of change configuration file data;
[0110] Based on the configuration file data of each change business operator in the change configuration file data list, the components corresponding to each change business operator are re-encapsulated and rendered and displayed in the form of page elements, and the corresponding data streams and data stream status data are updated.
[0111] This disclosure also provides a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause a computer to perform any of the methods of this disclosure.
[0112] This disclosure also provides a computer program product, including a computer program that, when executed by a processor, implements any of the methods described in this disclosure.
[0113] The collection, storage, use, processing, transmission, provision, and disclosure of user personal information in this technical solution comply with relevant laws and regulations and do not violate public order and good morals. It should be noted that the head model in this embodiment is not a head model specific to any particular user and does not reflect the personal information of any particular user. It should also be noted that the two-dimensional face images in this embodiment are from publicly available datasets.
[0114] Figure 6 A schematic block diagram of an example electronic device 600 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0115] like Figure 6As shown, device 600 includes a computing unit 601, which can perform various appropriate actions and processes based on a computer program stored in read-only memory (ROM) 602 or a computer program loaded from storage unit 608 into random access memory (RAM) 603. RAM 603 may also store various programs and data required for the operation of device 600. The computing unit 601, ROM 602, and RAM 603 are interconnected via bus 604. Input / output (I / O) interface 605 is also connected to bus 604.
[0116] Multiple components in device 600 are connected to I / O interface 605, including: input unit 606, such as keyboard, mouse, etc.; output unit 607, such as various types of monitors, speakers, etc.; storage unit 608, such as disk, optical disk, etc.; and communication unit 609, such as network card, modem, wireless transceiver, etc. Communication unit 609 allows device 600 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0117] The computing unit 601 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 601 performs the various methods and processes described above, such as business code development methods. For example, in some embodiments, the business code development method may be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 608. In some embodiments, part or all of the computer program may be loaded and / or installed on device 600 via ROM 602 and / or communication unit 609. When the computer program is loaded into RAM 603 and executed by the computing unit 601, one or more steps of the business code development method described above may be performed. Alternatively, in other embodiments, the computing unit 601 may be configured to perform business code development methods by any other suitable means (e.g., by means of firmware).
[0118] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0119] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0120] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0121] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0122] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with embodiments of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.
[0123] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact via communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, servers in distributed systems, or servers incorporating blockchain technology.
[0124] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.
[0125] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.
Claims
1. A business code development method, applied to a business code development system, the business code development system comprising a plugin layer and a view layer, the method comprising: The plugin layer generates a configuration file data list containing multiple business operators based on the operator business code in the code library, and sends the configuration file data list to the view layer; wherein, the multiple business operators are used to implement preset business functions; the configuration file data of the business operators includes: comments on the business functions implemented by the business operators, updates to the implemented functions, and operation data on other business operators; The view layer encapsulates the multiple business operators into multiple components based on the configuration file data list, and renders and displays the multiple components respectively; In response to an orchestration operation for at least one target component among the plurality of components, the view layer generates a data stream corresponding to the at least one target component in the target area of the view layer; The view layer generates state data representing the data flow based on the execution logic of the at least one target component, and sends the state data of the data flow to the plugin layer; the state data of the data flow includes: configuration parameter data of the configuration file data of the at least one target component in the data flow, and execution order data of the at least one target component in the data flow; The plugin layer generates the application business code for the data stream based on the state data and the business operators corresponding to the at least one target component.
2. The method according to claim 1, wherein, The view layer includes a graph orchestrator; in response to an orchestration operation for at least one target component among the plurality of components, the view layer generates a data stream corresponding to the at least one target component in a target area of the view layer, including: The graph arranger acquires the user's arrangement operation for at least one target component among multiple displayed components; In the target area of the view layer, the corresponding target components are arranged according to the arrangement operation to generate a data stream corresponding to the at least one target component.
3. The method according to claim 1, wherein, The plugin layer generates a configuration file data list containing multiple business operators based on the operator business code in the code repository, including: The plugin layer reads the operator business code from the code library, parses the operator business code, and identifies the business operators in the operator business code; The business operators are encapsulated into configuration file data in JSON format to obtain a list of configuration file data.
4. The method according to claim 3, wherein, The plugin layer generates application business code for the data stream based on the state data and the business operators corresponding to the at least one target component, including: The plugin layer configures the parameters of the business operators of the corresponding target components according to the configuration parameter data of the configuration file data of at least one target component in the state data, and obtains the target business operators of the corresponding target components. Based on the execution order data of at least one target component in the state data, the execution order of the target business operators of the corresponding target components is set to obtain the application business code of the data stream.
5. The method according to claim 1, wherein, The view layer encapsulates the multiple business operators into multiple components based on the configuration file data list, and renders and displays the multiple components respectively, including: The view layer encapsulates the multiple business operators contained in the configuration file data list into multiple components using a Canvas, and renders and displays each component as a page element. The method further includes: The view layer sets each component to be programmable.
6. The method according to claim 1, wherein, The arrangement operations include at least one of the following: drag, move, delete, select, edit, and connect.
7. The method according to claim 1, further comprising: After the view layer detects a user's update operation on a component in the data stream, it updates the corresponding state data of the data stream.
8. The method according to claim 1, further comprising: When the plugin layer detects changes in the operator business code in the codebase, it parses the changed operator business code and identifies the changed business operators in the changed operator business code. The identified change business operators are encapsulated into JSON format configuration file data to obtain a change configuration file data list, and the change configuration file data list is sent to the view layer; Based on the configuration file data of each change business operator in the change configuration file data list, the view layer re-encapsulates the components corresponding to each change business operator, renders and displays them in the form of page elements, and updates the corresponding data stream and data stream status data.
9. A business code development system, comprising: Plug-in layer and view layer; The plugin layer is used to generate a configuration file data list including multiple business operators based on the operator business code in the code library, wherein the multiple business operators are used to implement preset business functions, and send the configuration file data list to the view layer; receive the status data of the data stream, and generate the application business code of the data stream based on the status data and at least one business operator corresponding to the target component; the configuration file data of the business operators includes: comments on the business functions implemented by the business operators, updates to the implemented functions, and operation data on other business operators; The view layer is configured to receive the configuration file data list, encapsulate the multiple business operators into multiple components according to the configuration file data list, render and display the multiple components respectively; in response to an orchestration operation for at least one target component among the multiple components, generate a data stream corresponding to the at least one target component in the target area of the view layer; generate state data representing the data stream according to the execution logic of the at least one target component, and send the state data of the data stream to the plugin layer; the state data of the data stream includes: configuration parameter data of the configuration file data of at least one target component in the data stream, and execution order data of at least one target component in the data stream.
10. The system according to claim 9, wherein, The view layer includes a graph arranger; the graph arranger is used to: obtain the user's arrangement operation for at least one target component among multiple displayed components, arrange the corresponding target component in the target area of the view layer according to the arrangement operation, and generate a data stream corresponding to the at least one target component.
11. The business code development system according to claim 9, wherein, The plugin layer is specifically used for: reading operator business code from the code library, parsing the operator business code, identifying the business operators in the operator business code, encapsulating the business operators into JSON format configuration file data, and obtaining a list of configuration file data.
12. The system according to claim 11, wherein, The plugin layer is specifically used for: configuring the parameters of the business operators of the corresponding target components according to the configuration parameter data of the configuration file data of at least one target component in the state data, to obtain the target business operators of the corresponding target components; and setting the execution order of the target business operators of the corresponding target components according to the execution order data of at least one target component in the state data, to obtain the application business code of the data stream.
13. The business code development system according to claim 10, wherein, The view layer is specifically used for: encapsulating the multiple business operators contained in the configuration file data list into multiple components through the Canvas, and rendering and displaying each component as a page element; and setting each displayed component as an editable component.
14. The business code development system according to claim 9, wherein, The arrangement operations include at least one of the following: drag, move, delete, select, edit, and connect.
15. The business code development system according to claim 10, wherein the graph orchestrator is further configured to: after listening to the user's update operation on the components in the data stream, update the state data corresponding to the data stream, and send the updated state data to the plugin layer.
16. The business code development system according to claim 15, wherein the plugin layer is further configured to: when a change is detected in the operator business code in the code library, parse the changed operator business code, identify the changed business operator in the changed operator business code, encapsulate the identified changed business operator into configuration file data in JSON format, obtain a list of changed configuration file data, and send the list of changed configuration file data to the view layer; The view layer is also used to receive the list of changed configuration file data, and based on the configuration file data of each changed business operator in the list of changed configuration file data, to re-encapsulate the components corresponding to each changed business operator, and to render and display them in the form of page elements, and to update the corresponding data stream and the status data of the data stream.
17. In the business code development system according to claim 9, the plugin layer sends the configuration file data list to the view layer in the form of a message, and the view layer sends the status data of the data stream to the plugin layer in the form of a message.
18. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-8.
19. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1-8.
Citation Information
Patent Citations
Page development method and device, electronic equipment and computer storage medium
CN111443911A
Service code generation method and device, electronic equipment and computer readable medium
CN113504908A