A page development method and apparatus
By automatically generating code to implement the linkage control logic between page components in the low-code development platform, the problem of high workload for developers and high usage threshold for non-technical personnel in existing technologies is solved, thereby improving page development efficiency and flexibility and reducing platform coupling and complexity.
Patent Information
- Application Number
- CN202211457627.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-21
- Publication Date
- 2026-11-17
- Estimated Expiration
- 2042-11-21
AI Technical Summary
Existing low-code development platforms increase the workload for developers when implementing the interaction logic between page components. They also have a high barrier to entry for non-technical personnel, resulting in low page development efficiency, poor flexibility, and high coupling and complexity between components and the platform.
By automatically generating code to implement the linkage control logic between page components, including obtaining component information and control logic, creating control and controlled nodes, generating connection relationships and concatenating code, the workload of developers is reduced, the usage threshold for non-developers is increased, and page development efficiency and flexibility are improved.
It reduces the workload of developers, shortens the business development cycle, lowers the barrier to entry for non-developers, improves page development efficiency and flexibility, and reduces the coupling between components and low-code development platforms, thereby enhancing the scalability of the component library.
Smart Images

Figure CN115951869B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to a page development method and apparatus. Background Technology
[0002] Low-code development platforms (LCDPs, which allow for rapid application generation with little or no coding) often require controlling the interaction logic of one component with another when building pages or forms. This could involve showing or hiding a component, opening a new page, modifying internal data, or changing the state of a component. Currently, low-code development platforms implement inter-component interaction logic in two main ways: First, they assemble two or more atomic components into a new business component through code development and handle the interaction logic within that component. Second, the platform provides users with a window to define custom JavaScript, allowing users to define JavaScript according to the platform's code injection rules and implement component interaction through custom JavaScript.
[0003] In the process of realizing this invention, the inventors discovered at least the following problems in the prior art:
[0004] Currently, implementing the interaction logic between page components through code development increases the workload of developers. Furthermore, new business requirements heavily rely on the development cycle of developers, and the high barrier to entry for non-technical personnel results in low page development efficiency and poor flexibility. Summary of the Invention
[0005] In view of this, embodiments of the present invention provide a page development method and apparatus that can automatically generate code on a low-code development platform to implement the linkage control logic between page components. This reduces the workload of developers, shortens the business development cycle, lowers the barrier to entry for non-developers, and improves page development efficiency and flexibility. Simultaneously, it reduces the coupling between components and the low-code development platform, enhances the scalability of the component library, and reduces the complexity of integrating with other systems.
[0006] To achieve the above objectives, according to one aspect of the present invention, a page development method is provided, comprising:
[0007] In response to a page development request, page data is obtained, including component information and attribute information for each component;
[0008] The control relationship is obtained, including information about the control component, information about the controlled component, and the control logic between the control component and the controlled component.
[0009] A control node is created based on the control component information, and control component construction code is generated by combining the attribute information of the control component in the page data.
[0010] A controlled node is created based on the controlled component information, and the controlled component construction code is generated by combining the attribute information of the controlled component in the page data;
[0011] The control logic generates a connection relationship between the control node and the controlled node, and the control logic code is generated by combining the attribute information of the connection relationship, the attribute information of the control component, and the attribute information of the controlled component.
[0012] The code corresponding to the control relationship is obtained by concatenating the control component construction code, the controlled component construction code, and the control logic code;
[0013] Page code is generated based on the code corresponding to all control relationships for page development.
[0014] Optionally, before generating control component construction code by combining the attribute information of the control component in the page data, the method further includes: assigning operation attribute values to the control node in response to the setting instruction for the created control node; generating control component construction code by combining the attribute information of the control component in the page data includes: generating control component construction code by combining the attribute information of the control component in the page data and the operation attribute values of the control node.
[0015] Optionally, assigning operation attributes to the control node includes: obtaining the node type of the control node and obtaining the corresponding attribute configuration template according to the node type; and assigning operation attributes to the control node according to the user's operation information on the attribute configuration template.
[0016] Optionally, before generating the controlled component construction code by combining the attribute information of the controlled component in the page data, the method further includes: assigning operation attribute values to the controlled node in response to the setting instruction for the created controlled node; generating the controlled component construction code by combining the attribute information of the controlled component in the page data includes: generating the controlled component construction code by combining the attribute information of the controlled component in the page data and the operation attribute values of the controlled node.
[0017] Optionally, assigning operation attributes to the controlled node includes: obtaining the node type of the controlled node and obtaining the corresponding attribute configuration template according to the node type; and assigning operation attributes to the controlled node according to the user's operation information on the attribute configuration template.
[0018] Optionally, generating the connection relationship between the control node and the controlled node according to the control logic includes: generating the connection relationship between the control node and the controlled node by taking the control node as the source node and the controlled node as the target node according to the control logic.
[0019] Optionally, generating the connection relationship between the control node and the controlled node according to the control logic includes: generating attribute information of the connection relationship according to the control logic, the attribute information including the source node and target node corresponding to the connection relationship; and generating the connection relationship between the control node and the controlled node according to the source node and target node corresponding to the connection relationship.
[0020] Optionally, before generating control logic code by combining the attribute information of the connection relationship, the attribute information of the control component, and the attribute information of the controlled component, the method further includes: assigning operation attribute values to the connection relationship in response to a setting instruction for the created connection relationship; generating control logic code by combining the attribute information of the connection relationship, the attribute information of the control component, and the attribute information of the controlled component, including: generating control logic code by combining the attribute information of the connection relationship, the operation attribute value of the connection relationship, the attribute information of the control component, and the attribute information of the controlled component, wherein the operation attribute value of the connection relationship includes: the tag value of the connection relationship and the received value of the controlled node corresponding to each tag value.
[0021] Optionally, assigning operation attributes to the connection relationship includes: obtaining the type of the connection relationship and obtaining the corresponding attribute configuration template according to the type of the connection relationship; and assigning operation attributes to the connection relationship according to the user's operation information on the attribute configuration template.
[0022] Optionally, concatenating the control component construction code, the controlled component construction code, and the control logic code to obtain the code corresponding to the control relationship includes: concatenating the code handles of the control component construction code, the controlled component construction code, and the control logic code according to the control logic to obtain the code corresponding to the control relationship.
[0023] Optionally, for the instruction to establish the control relationship between each component, the code corresponding to the control relationship is generated based on the user's visual operation.
[0024] Optionally, the method further includes: establishing a listening event for the control component and the controlled component corresponding to each control relationship.
[0025] According to another aspect of the present invention, a page development apparatus is provided, comprising:
[0026] The page data acquisition module is used to acquire page data in response to page development requests. The page data includes component information and attribute information of each component.
[0027] The control relationship acquisition module is used to acquire the control component information, the controlled component information, and the control logic between the control component and the controlled component, including the control relationship.
[0028] The control component code generation module is used to create control nodes based on the control component information and generate control component construction code by combining the attribute information of the control component in the page data.
[0029] The controlled component code generation module is used to create controlled nodes based on the controlled component information and generate controlled component construction code by combining the attribute information of the controlled component in the page data;
[0030] The control logic code generation module is used to generate the connection relationship between the control node and the controlled node according to the control logic, and generate control logic code by combining the attribute information of the connection relationship, the attribute information of the control component and the attribute information of the controlled component.
[0031] The code splicing module is used to splice the control component construction code, the controlled component construction code, and the control logic code to obtain the code corresponding to the control relationship;
[0032] The page code generation module is used to generate page code based on the code corresponding to all control relationships for page development.
[0033] According to another aspect of the present invention, an electronic device for page development is provided, comprising: one or more processors; and 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 page development method provided in the embodiments of the present invention.
[0034] According to another aspect of the present invention, a computer-readable medium is provided having a computer program stored thereon, which, when executed by a processor, implements the page development method provided in the embodiments of the present invention.
[0035] An embodiment of the above invention has the following advantages or beneficial effects: By responding to a page development request, page data is obtained, including component information and attribute information of each component; control relationships are obtained, including control component information, controlled component information, and control logic between the control component and the controlled component; control nodes are created based on the control component information, and control component construction code is generated by combining the attribute information of the control component in the page data; controlled nodes are created based on the controlled component information, and controlled component construction code is generated by combining the attribute information of the controlled component in the page data; connection relationships between control nodes and controlled nodes are generated based on the control logic, and control logic code is generated by combining the attribute information of the connection relationships, the attribute information of the control component, and the attribute information of the controlled component; the control component construction code, the controlled component construction code, and the control logic code are concatenated to obtain the code corresponding to the control relationship; and page code is generated based on the code corresponding to all control relationships for page development. This technical solution achieves automatic code generation to realize the linkage control logic between page components on a low-code development platform, reducing the workload of developers, shortening the business development cycle, lowering the usage threshold for non-developers, and improving page development efficiency and flexibility. At the same time, it reduces the coupling between components and low-code development platforms, improves the scalability of component libraries, and reduces the complexity of integrating with other systems.
[0036] The further effects of the aforementioned unconventional alternative methods will be explained below in conjunction with specific implementation methods. Attached Figure Description
[0037] The accompanying drawings are provided to better understand the invention and are not intended to unduly limit the scope of the invention. Wherein:
[0038] Figure 1 This is a schematic diagram illustrating the main steps of a page development method according to an embodiment of the present invention;
[0039] Figure 2 This is a schematic diagram of the control relationship establishment process according to an embodiment of the present invention;
[0040] Figure 3 This is a schematic diagram of the connection relationship establishment process according to an embodiment of the present invention;
[0041] Figure 4 This is a diagram of the page development system architecture according to an embodiment of the present invention;
[0042] Figure 5 This is a schematic diagram illustrating the operational effect of an embodiment of the present invention;
[0043] Figure 6 This is a schematic diagram of the main modules of a page development apparatus according to an embodiment of the present invention;
[0044] Figure 7This is an exemplary system architecture diagram in which embodiments of the present invention can be applied;
[0045] Figure 8 This is a schematic diagram of the structure of a computer system suitable for implementing terminal devices or servers of the present invention. Detailed Implementation
[0046] The following description, in conjunction with the accompanying drawings, illustrates exemplary embodiments of the present invention, including various details to aid understanding. These details 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 the invention. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0047] The acquisition, storage, use, and processing of data in the technical solution of this invention all comply with the relevant provisions of national laws and regulations.
[0048] To address the technical problems existing in the prior art, this invention provides a page development method that gives users the ability to configure the linkage logic of components. It realizes the linkage effect between components through visual logic orchestration, reduces the development cost for developers for typical business scenarios, lowers the usage threshold for non-technical personnel when configuring linkage effects, and improves the efficiency and flexibility of page development.
[0049] Figure 1 This is a schematic diagram illustrating the main steps of a page development method according to an embodiment of the present invention. Figure 1 As shown, the page development method of this embodiment mainly includes the following steps S101 to S107.
[0050] Step S101: In response to the page development request, obtain page data, which includes component information and attribute information of each component.
[0051] When developing web pages on a low-code development platform, users can utilize the platform's page configuration module to generate pages through drag-and-drop component assembly, component attribute configuration, and data binding. The generated page data is then saved to a database. This page data primarily includes information about the components (e.g., component identifiers, component names) and the attribute information for each component. Attribute information includes the component's type, style, data, and actions. Taking a dropdown selection component as an example, its attribute information includes: the dropdown's label name, width, height, default display text, whether it is editable, whether it is read-only, whether the selected content can be cleared, and the dropdown data. The page data can then be saved using the storage structure shown in Table 1 below.
[0052] Table 1
[0053]
[0054]
[0055]
[0056] The searchFields field is an array that stores the configuration information for all components.
[0057] After the user generates a page through operations on the low-code development platform and clicks save, the page data is generated and saved. Subsequent configuration of the interaction control relationships between page components will be based on this page data.
[0058] Step S102: Obtain the control component information, controlled component information, and control logic between the control component and the controlled component, including the control relationship. Typically, step S102 is triggered when a control relationship needs to be established between components.
[0059] In embodiments of the present invention, page data is received, for example, through the stream task processing module of the page development system, and control relationships between components are established based on the page data and user operations. For each control relationship, there is a corresponding controlling component, a controlled component (which may be one or more), and control logic between the controlling component and the controlled component. For example, the controlling component controls the display and hiding of the controlled component, modifies the internal data of the controlled component, and modifies the state of the controlled component.
[0060] In embodiments of the present invention, the code corresponding to the control relationship between each component is generated through the user's visual operation to establish the control relationship. On a page in edit mode (page states are divided into preview and edit modes; in preview mode, dragging and other attribute configuration operations are not possible, so adding a flow task requires the page to be in edit mode), a flow task container is opened, and a flow task is created. One or more flow tasks can be created on the same page (i.e., there will be control relationships between one or more components). The created task name is validated to ensure it is unique. Clicking the task name jumps to the flow task editing page and transfers the current page's data to the flow task editing page. The page data (e.g., a JSON data structure) is a collection of information from various components. The page data is transferred to the flow task editing component through communication between Vue parent and child components; the page is the parent component, and the flow task editing page is the child component.
[0061] Figure 2This is a schematic diagram of the control relationship establishment process according to an embodiment of the present invention. Figure 2 As shown, the specific operation process for users to establish each control relationship is as follows:
[0062] 1. Drag an initial node into the editor of the stream task processing module. This initial node is the entry point for the entire stream task. It can be a decision node or an activity node. The node type will be distinguished internally by the program. Node types include, for example, start node, end node, open new page node, etc. Each type of node handles different logical actions internally. Next, establish the binding relationship between this initial node and the control component. For example, you can select the source field as the identifier ID of the control component in the node's property configuration.
[0063] 2. Drag one or more activity nodes (the number of activity nodes depends on the number of controlled components in the control relationship) into the editor, and establish the binding relationship between each activity node and the controlled component. For example, you can select the target field as the identifier ID of the controlled component in the property configuration of the activity node.
[0064] 3. Establish a connection between the initial node and the active node (e.g., by generating a connecting line) to establish a control relationship between the two nodes.
[0065] After the user edits the control relationships in the editor of the stream task processing module and clicks save, an instruction to establish the control relationships between components is generated. Then, the page development system of this invention will obtain the control component information, the controlled component information, and the control logic between the control component and the controlled component according to the control instruction. Finally, it will generate corresponding code based on the control relationships between the components for page development. The specific implementation process will be described in conjunction with steps S103 to S107.
[0066] Step S103: Create a control node based on the control component information, and generate control component construction code by combining the attribute information of the control component in the page data.
[0067] After the page development system obtains the control relationships between components, it first creates a source node, i.e., a control node, based on the control component information (such as the control component identifier ID). At this point, the control component and the control node are bound together. In the specific implementation, taking a conditional node as an example, after the user drags a conditional node into the editor as a control node, the editor program of the flow task processing module automatically creates the code string "switch(initVal){$_case}". By clicking the conditional node to activate it and selecting the control component identifier ID as the source data field, the binding between the control node and the control component is completed. After the control node and control component are bound, the editor program can generate the construction code for the control component based on the control component's attribute information.
[0068] According to one embodiment of the present invention, before generating control component construction code by combining the attribute information of the control component in the page data, the method may further include: assigning operation attribute values to the control node in response to the setting instruction for the created control node; and generating control component construction code by combining the attribute information of the control component in the page data includes: generating control component construction code by combining the attribute information of the control component in the page data and the operation attribute values of the control node.
[0069] Specifically, assigning operation attributes to the control node may include: obtaining the node type of the control node and obtaining the corresponding attribute configuration template according to the node type; and assigning operation attributes to the control node according to the user's operation information on the attribute configuration template.
[0070] Each node has its own information, including a node identifier (id), node name, node type, and a clazz field. The node type corresponds to the clazz field and is defined during the initialization of the stream task editor library. Each node has its own clazz field; for example, a node's clazz field is "decision," and an active node's clazz field is "activity." When a node is clicked in the editor, the program activates the node, retrieves its information, and determines its node type to obtain the corresponding attribute configuration template. Different node types will have different component configuration content in their attribute configuration templates.
[0071] In an embodiment of the present invention, when assigning operation attributes to a control node, the corresponding attribute configuration template is first obtained according to the node type of the control node. Configuration items include, for example, operation mode, operation type, maximum number of items to process, processing time, customer order number, task status, etc. The user can generate operation information for the attribute configuration template by operating on each configuration item in the template. Then, the editor program will assign operation attributes to the control node based on the user's operation information on the attribute configuration template.
[0072] Step S104: Create a controlled node based on the controlled component information, and generate controlled component construction code by combining the attribute information of the controlled component in the page data.
[0073] The creation process of a controlled node is similar to that of a control node, and will not be described in detail here. It should be noted that there can be one or more controlled nodes, and each controlled node corresponds to one controlled component.
[0074] According to one embodiment of the present invention, before generating the controlled component construction code by combining the attribute information of the controlled component in the page data, the method further includes: assigning operation attribute values to the controlled node in response to the setting instruction for the created controlled node; generating the controlled component construction code by combining the attribute information of the controlled component in the page data includes: generating the controlled component construction code by combining the attribute information of the controlled component in the page data and the operation attribute value of the controlled node.
[0075] Specifically, assigning operation attributes to the controlled node may include: obtaining the node type of the controlled node and obtaining the corresponding attribute configuration template based on the node type; and assigning operation attributes to the controlled node based on the user's operation information on the attribute configuration template. Specifically, when assigning operation attributes to the controlled node, the corresponding attribute configuration template is obtained based on the node type of the controlled node, and settings are made according to the specific configuration items in the template.
[0076] Step S105: Generate the connection relationship between the control node and the controlled node according to the control logic, and generate control logic code by combining the attribute information of the connection relationship, the attribute information of the control component and the attribute information of the controlled component.
[0077] After the control node and the controlled node are established according to steps S103 and S104, step S105 will be executed internally by the editor based on the user's dragging and dropping of the connecting line in the editor's visual interface.
[0078] According to one embodiment of the present invention, generating a connection relationship between the control node and the controlled node based on the control logic includes: according to the control logic, using the control node as a source node and the controlled node as a target node, generating a connection relationship between the control node and the controlled node. Based on the control logic, the specific control mechanism between the components can be determined, allowing the control node to be set as the source node and the controlled node as the target node. Subsequently, a connection line with a control direction can be generated between the control node and the controlled node to represent the connection relationship between them.
[0079] According to another embodiment of the present invention, generating the connection relationship between the control node and the controlled node based on the control logic includes: generating attribute information of the connection relationship based on the control logic, the attribute information including a source node and a target node corresponding to the connection relationship; and generating the connection relationship between the control node and the controlled node based on the source node and target node corresponding to the connection relationship. Based on the control logic, the control relationship between components can be determined, thus generating corresponding attribute information of the connection relationship to identify which node is the source node and which node is the target node. Therefore, the connection relationship between the control node and the controlled node can be generated based on the attribute information of the connection relationship.
[0080] According to another embodiment of the present invention, before generating control logic code by combining the attribute information of the connection relationship, the attribute information of the control component, and the attribute information of the controlled component, the method further includes: assigning operation attribute values to the connection relationship in response to a setting instruction for the created connection relationship. Furthermore, generating control logic code by combining the attribute information of the connection relationship, the attribute information of the control component, and the attribute information of the controlled component includes: generating control logic code by combining the attribute information of the connection relationship, the operation attribute values of the connection relationship, the attribute information of the control component, and the attribute information of the controlled component. The operation attribute values of the connection relationship include: the label value of the connection relationship and the received value of the controlled node corresponding to each label value. A connection relationship is essentially also a node; therefore, the operation attributes of the connection relationship can be set by clicking on it. For a connection relationship, its operation attributes mainly include the label value of the connection relationship and the received value of the controlled node corresponding to each label value.
[0081] According to another embodiment of the present invention, assigning operation attributes to the connection relationship includes: obtaining the type of the connection relationship and obtaining a corresponding attribute configuration template according to the type of the connection relationship; and assigning operation attributes to the connection relationship according to the user's operation information on the attribute configuration template.
[0082] In embodiments of the present invention, the connection relationship between nodes is represented by connecting lines between nodes. Each connecting line has its own attribute information, including main fields such as id, name, source (source node information), target (target node information), clazz field, and tag value. Here, source is the id of the starting node of the connection relationship (connection line), and target is the id of the ending node. Through this connection relationship (connection line), a relationship can be established between two nodes, thus revealing which is the controlling node and which is the controlled node.
[0083] When a connector is clicked, the editor's internal program retrieves the information of the current connector and determines its type based on the `clazz` field, triggering the corresponding connector attribute configuration panel. In the attribute configuration panel, the connector's label value can be set. This label value is determined by data in the attribute information of the component (controlling component) selected by the source node, such as an enumeration value (1 / 2 / 3...) or (true / false). The received value of the controlled node is the received value (or input value) of the component (controlled component) selected by the target node; it is the input value of the target node when different enumeration values of the source node are set.
[0084] Figure 3 This is a schematic diagram illustrating the connection relationship establishment process according to an embodiment of the present invention. Figure 3 As shown, after creating the control node and the controlled node, two connection lines can be established between the control node and the controlled node according to the control logic to establish a connection relationship between them. Then, after setting the label values (including 1 and 2 in this embodiment) and the received values of the controlled node corresponding to these two connection lines, the connection relationship can be established, and the corresponding control logic code can be generated subsequently.
[0085] In an embodiment of the invention, the label value of the connector is set to an enumerated value (1 / 2 / 3...) or (true / false) in the connector attribute configuration template. Simultaneously, the received value of the controlled node is set to assign operation attributes to the connector. This generates the following code string: `const handler=`(function(_this,state){_this.set(state.searchFields[${index}],“flowShow”,${targetValue})}(_this,state))`; where `index` is the index of the selected field (target) in the data passed from the parent page, and `targetValue` is the value of the field “flowShow”. After saving the operation attribute assignment result for the connector, the final code string `const_case=`case${label}:${handler}` is generated based on the operation assignment result and saved to the current application instance.
[0086] Step S106: Concatenate the control component construction code, the controlled component construction code, and the control logic code to obtain the code corresponding to the control relationship.
[0087] In practice, this step involves concatenating the code handles of the control component construction code, the controlled component construction code, and the control logic code according to the control logic to obtain the code corresponding to the control relationship.
[0088] Step S107: Generate page code based on the code corresponding to all control relationships for page development.
[0089] For the page to be developed, not all components have control relationships. The code for components that do not have control relationships with other components can be automatically generated by the low-code development platform when generating page data. Therefore, after all the control relationships between components are established, the page code can be generated by combining the code corresponding to all control relationships and the code corresponding to components that do not have control relationships with other components. The page is then generated by executing the page code.
[0090] According to one embodiment of the present invention, a listener event is established for the controlling component and the controlled component corresponding to each control relationship, and the code corresponding to the listener event is saved in the page code. Thus, when the client executes the script, it listens for changes in the values within the components and determines whether the components are bound to a streaming task. If inter-component control is triggered, the control logic can be invoked by listening to the actions triggered by the controlling component and the controlled component. This allows for both reactive updates of the listener data via React and Vue, simultaneously triggering page updates.
[0091] Figure 4 This is a diagram of the page development system architecture according to an embodiment of the present invention. Figure 4 As shown, the page development system of this embodiment mainly includes a page configuration module and a flow task processing module. The page configuration module is primarily used to configure the page by combining a page template and performing operations such as drag-and-drop assembly of basic components and container components, component attribute configuration, and data binding to generate page data. Then, the page data is passed to the flow task processing module. The flow task processing module receives the page data from the page configuration module, generates flow tasks based on the control relationship establishment instructions between components generated by the user's operations in the editor, and then creates control nodes bound to the control components and controlled nodes bound to the controlled components based on the flow tasks. It then configures the operation attributes of the control nodes and controlled nodes, and generates connection relationships that can associate the control nodes and controlled nodes, thereby generating code corresponding to the control relationships and storing the data for use in generating page code. Finally, the page is generated by running the page code on the client.
[0092] Figure 5 This is a schematic diagram illustrating the operational effect of an embodiment of the present invention. For example... Figure 5 The diagram illustrates the effect of the control component's ability to show and hide the controlled component. In this embodiment, the operation mode is the control component itself, which has two values: automatic scan order number and manual entry order number. When automatic scan order number is clicked, the controlled component "Customer Order Number" is displayed; when manual entry order number is clicked, the controlled component "Customer Order Number" is hidden.
[0093] Figure 6 This is a schematic diagram of the main modules of a page development apparatus according to an embodiment of the present invention. Figure 6 As shown, the page development device 600 of this embodiment mainly includes a page data acquisition module 601, a control relationship acquisition module 602, a control component code generation module 603, a controlled component code generation module 604, a control logic code generation module 605, a code splicing module 606, and a page code generation module 607.
[0094] The page data acquisition module 601 is used to acquire page data in response to a page development request. The page data includes component information and attribute information of each component.
[0095] The control relationship acquisition module 602 is used to acquire the control component information, the controlled component information, and the control logic between the control component and the controlled component, including the control relationship.
[0096] The control component code generation module 603 is used to create control nodes based on the control component information and generate control component construction code by combining the attribute information of the control component in the page data;
[0097] The controlled component code generation module 604 is used to create a controlled node based on the controlled component information and generate controlled component construction code by combining the attribute information of the controlled component in the page data;
[0098] The control logic code generation module 605 is used to generate a connection relationship between the control node and the controlled node according to the control logic, and generate control logic code by combining the attribute information of the connection relationship, the attribute information of the control component and the attribute information of the controlled component.
[0099] The code splicing module 606 is used to splice the control component construction code, the controlled component construction code, and the control logic code to obtain the code corresponding to the control relationship;
[0100] The page code generation module 607 is used to generate page code based on the code corresponding to all control relationships for page development.
[0101] According to one embodiment of the present invention, the page development apparatus 600 may further include an operation attribute assignment module (not shown in the figure), configured to: assign operation attribute values to the control node in response to a setting instruction for the created control node before generating control component construction code by combining the attribute information of the control component in the page data. Furthermore, the control component code generation module 603 may also be configured to: generate control component construction code by combining the attribute information of the control component in the page data and the operation attribute values of the control node.
[0102] According to another embodiment of the present invention, the operation attribute assignment module (not shown in the figure) can also be used to: obtain the node type of the control node, and obtain the corresponding attribute configuration template according to the node type; and assign operation attributes to the control node according to the user's operation information on the attribute configuration template.
[0103] According to another embodiment of the present invention, the operation attribute assignment module (not shown in the figure) can also be used to: assign operation attribute values to the controlled node in response to a setting instruction for the created controlled node before generating the controlled component construction code by combining the attribute information of the controlled component in the page data. Furthermore, the controlled component code generation module 604 can also be used to: generate the controlled component construction code by combining the attribute information of the controlled component in the page data and the operation attribute values of the controlled node.
[0104] According to another embodiment of the present invention, the operation attribute assignment module (not shown in the figure) can also be used to: obtain the node type of the controlled node, and obtain the corresponding attribute configuration template according to the node type; and assign operation attributes to the controlled node according to the user's operation information on the attribute configuration template.
[0105] According to another embodiment of the present invention, the control logic code generation module 605 can also be used to: generate a connection relationship between the control node and the controlled node by taking the control node as the source node and the controlled node as the target node according to the control logic.
[0106] According to another embodiment of the present invention, the control logic code generation module 605 can also be used to: generate attribute information of the connection relationship according to the control logic, the attribute information including the source node and target node corresponding to the connection relationship; and generate the connection relationship between the control node and the controlled node according to the source node and target node corresponding to the connection relationship.
[0107] According to another embodiment of the present invention, the operation attribute assignment module (not shown in the figure) can also be used to: assign operation attribute values to the connection relationship in response to a setting instruction for the created connection relationship before generating control logic code by combining the attribute information of the connection relationship, the attribute information of the control component, and the attribute information of the controlled component. Furthermore, the control logic code generation module 605 can also be used to: generate control logic code by combining the attribute information of the connection relationship, the operation attribute values of the connection relationship, the attribute information of the control component, and the attribute information of the controlled component, wherein the operation attribute values of the connection relationship include: a label value of the connection relationship and a received value of the controlled node corresponding to each label value.
[0108] According to another embodiment of the present invention, the operation attribute assignment module (not shown in the figure) can also be used to: obtain the type of the connection relationship, and obtain the corresponding attribute configuration template according to the type of the connection relationship; and assign operation attributes to the connection relationship according to the user's operation information on the attribute configuration template.
[0109] According to another embodiment of the present invention, the code splicing module 606 can also be used to: splice the code handles of the control component construction code, the controlled component construction code and the control logic code according to the control logic to obtain the code corresponding to the control relationship.
[0110] According to another embodiment of the present invention, the page development apparatus 600 generates code corresponding to the control relationship between each component by means of the instruction for establishing the control relationship between each component based on the user's visual operation.
[0111] According to another embodiment of the present invention, the page development apparatus 600 further includes a listening event establishment module (not shown in the figure), which is used to: establish listening events for the control component and the controlled component corresponding to each control relationship.
[0112] According to the technical solution of this invention, in response to a page development request, page data is obtained, including component information and attribute information of each component; control relationships are obtained, including control component information, controlled component information, and control logic between the control component and the controlled component; control nodes are created based on the control component information, and control component construction code is generated by combining the attribute information of the control component in the page data; controlled nodes are created based on the controlled component information, and controlled component construction code is generated by combining the attribute information of the controlled component in the page data; connection relationships between control nodes and controlled nodes are generated based on the control logic, and control logic code is generated by combining the attribute information of the connection relationship, the attribute information of the control component, and the attribute information of the controlled component; the control component construction code, the controlled component construction code, and the control logic code are concatenated to obtain the code corresponding to the control relationship; and page code is generated based on the code corresponding to all control relationships for page development. This technical solution realizes automatic code generation to implement the linkage control logic between page components on a low-code development platform, reducing the workload of developers, shortening the business development cycle, lowering the usage threshold for non-developers, and improving page development efficiency and flexibility. At the same time, it reduces the coupling between components and low-code development platforms, improves the scalability of component libraries, and reduces the complexity of integrating with other systems.
[0113] Figure 7 An exemplary system architecture 700 is shown that can be applied to the page development method or page development apparatus of the present invention.
[0114] like Figure 7 As shown, system architecture 700 may include terminal devices 701, 702, and 703, a network 704, and a server 705. Network 704 serves as the medium for providing communication links between terminal devices 701, 702, and 703 and server 705. Network 704 may include various connection types, such as wired or wireless communication links, or fiber optic cables, etc.
[0115] Users can use terminal devices 701, 702, and 703 to interact with server 705 via network 704 to receive or send messages, etc. Various communication client applications, such as web browser applications and web development applications, can be installed on terminal devices 701, 702, and 703 (for example only).
[0116] Terminal devices 701, 702, and 703 can be various electronic devices with displays and web browsing capabilities, including but not limited to smartphones, tablets, laptops, and desktop computers.
[0117] Server 705 can be a server that provides various services, such as a backend management server that supports the development of websites by users using the pages viewed by terminal devices 701, 702, and 703 (for example only). The backend management server can acquire page data from received page development requests, including component information and attribute information for each component; acquire the control relationships, including control component information, controlled component information, and control logic between the control component and the controlled component; create control nodes based on the control component information and generate control component construction code by combining the attribute information of the control component in the page data; create controlled nodes based on the controlled component information and generate controlled component construction code by combining the attribute information of the controlled component in the page data; generate connection relationships between the control nodes and the controlled nodes based on the control logic, and generate control logic code by combining the attribute information of the connection relationships, the attribute information of the control components, and the attribute information of the controlled components; concatenate the control component construction code, the controlled component construction code, and the control logic code to obtain the code corresponding to the control relationship; generate page code based on the code corresponding to all control relationships, and feed back the processing results (e.g., page code – just an example) to the terminal device.
[0118] It should be noted that the page development method provided in the embodiments of the present invention is generally executed by server 705, and correspondingly, the page development device is generally set in server 705.
[0119] It should be understood that Figure 7 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.
[0120] The following is for reference. Figure 8 It shows a schematic diagram of the structure of a computer system 800 suitable for implementing terminal devices or servers of the present invention. Figure 8The terminal device or server shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of the present invention.
[0121] like Figure 8 As shown, the computer system 800 includes a central processing unit (CPU) 801, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 802 or programs loaded from storage section 808 into random access memory (RAM) 803. The RAM 803 also stores various programs and data required for the operation of the system 800. The CPU 801, ROM 802, and RAM 803 are interconnected via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0122] The following components are connected to I / O interface 805: an input section 806 including a keyboard, mouse, etc.; an output section 807 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a LAN card, modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to I / O interface 805 as needed. A removable medium 811, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on drive 810 as needed so that computer programs read from it can be installed into storage section 808 as needed.
[0123] In particular, according to the embodiments disclosed in this invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 809, and / or installed from removable medium 811. When the computer program is executed by central processing unit (CPU) 801, it performs the functions defined above in the system of this invention.
[0124] It should be noted that the computer-readable medium shown in this invention can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, 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 device, magnetic storage device, or any suitable combination thereof. In this invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this invention, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.
[0125] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0126] The units or modules described in the embodiments of the present invention can be implemented in software or hardware. The described units or modules can also be housed in a processor. For example, a processor can be described as including a page data acquisition module, a control relationship acquisition module, a control component code generation module, a controlled component code generation module, a control logic code generation module, a code concatenation module, and a page code generation module. The names of these units or modules do not necessarily limit the specific unit or module itself; for example, a page data acquisition module can also be described as "a module for acquiring page data in response to a page development request."
[0127] In another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiments; or it may exist alone and not assembled into the device. The aforementioned computer-readable medium carries one or more programs. When the one or more programs are executed by a device, the device includes: in response to a page development request, acquiring page data, the page data including component information and attribute information of each component; acquiring control component information, controlled component information, and control logic between the control component and the controlled component, including the control relationship; creating a control node based on the control component information and generating control component construction code by combining the attribute information of the control component in the page data; creating a controlled node based on the controlled component information and generating controlled component construction code by combining the attribute information of the controlled component in the page data; generating a connection relationship between the control node and the controlled node based on the control logic, and generating control logic code by combining the attribute information of the connection relationship, the attribute information of the control component, and the attribute information of the controlled component; concatenating the control component construction code, the controlled component construction code, and the control logic code to obtain code corresponding to the control relationship; and generating page code based on the code corresponding to all control relationships for page development.
[0128] According to the technical solution of this invention, in response to a page development request, page data is obtained, including component information and attribute information of each component; control relationships are obtained, including control component information, controlled component information, and control logic between the control component and the controlled component; control nodes are created based on the control component information, and control component construction code is generated by combining the attribute information of the control component in the page data; controlled nodes are created based on the controlled component information, and controlled component construction code is generated by combining the attribute information of the controlled component in the page data; connection relationships between control nodes and controlled nodes are generated based on the control logic, and control logic code is generated by combining the attribute information of the connection relationship, the attribute information of the control component, and the attribute information of the controlled component; the control component construction code, the controlled component construction code, and the control logic code are concatenated to obtain the code corresponding to the control relationship; and page code is generated based on the code corresponding to all control relationships for page development. This technical solution realizes automatic code generation to implement the linkage control logic between page components on a low-code development platform, reducing the workload of developers, shortening the business development cycle, lowering the usage threshold for non-developers, and improving page development efficiency and flexibility. At the same time, it reduces the coupling between components and low-code development platforms, improves the scalability of component libraries, and reduces the complexity of integrating with other systems.
[0129] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can occur depending on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A page development method characterized by comprising: include: In response to a page development request, page data is obtained, including component information and attribute information for each component; The control relationship is obtained by acquiring information about the control component, the controlled component, and the control logic between the control component and the controlled component. A control node is created based on the control component information, and control component construction code is generated by combining the attribute information of the control component in the page data; A controlled node is created based on the controlled component information, and the controlled component construction code is generated by combining the attribute information of the controlled component in the page data. The control logic generates a connection relationship between the control node and the controlled node, and the control logic code is generated by combining the attribute information of the connection relationship, the attribute information of the control component, and the attribute information of the controlled component. The code corresponding to the control relationship is obtained by concatenating the control component construction code, the controlled component construction code, and the control logic code; Generate page code based on the code corresponding to all control relationships for page development; Establish a listening event for the controlling component and the controlled component corresponding to each control relationship, and save the code corresponding to the listening event to the page code.
2. The method of claim 1, wherein, Before generating the control component construction code by combining the attribute information of the control component in the page data, the process also includes: In response to the setting command for the created control node, the operation attributes of the control node are assigned values; The control component construction code is generated by combining the attribute information of the control component in the page data, including: The control component construction code is generated by combining the attribute information of the control component in the page data and the operation attribute values of the control node.
3. The method of claim 2, wherein, Assigning operation attributes to the control node includes: Obtain the node type of the control node, and obtain the corresponding attribute configuration template based on the node type; The control node is assigned operation attribute values based on the user's operation information for the attribute configuration template.
4. The method of claim 1, wherein, Before generating the controlled component construction code by combining the attribute information of the controlled component in the page data, the process also includes: In response to the setting command for the created controlled node, the operation attributes of the controlled node are assigned values; The controlled component construction code is generated by combining the attribute information of the controlled component in the page data, including: The controlled component construction code is generated by combining the attribute information of the controlled component in the page data and the operation attribute values of the controlled node.
5. The method of claim 4, wherein, Assigning operation attributes to the controlled node includes: Obtain the node type of the controlled node, and obtain the corresponding attribute configuration template based on the node type; The controlled node is assigned operation attribute values based on the user's operation information for the attribute configuration template.
6. The method of claim 1, wherein, Generating the connection relationship between the control node and the controlled node according to the control logic includes: According to the control logic, the control node is used as the source node and the controlled node is used as the target node to generate a connection relationship between the control node and the controlled node.
7. The method according to claim 1 or 6, characterized in that, Generating the connection relationship between the control node and the controlled node according to the control logic includes: The control logic generates attribute information of the connection relationship, and the attribute information includes the source node and target node corresponding to the connection relationship; The connection relationship between the control node and the controlled node is generated based on the source node and target node corresponding to the connection relationship.
8. The method of claim 7, wherein, Before generating control logic code by combining the attribute information of the connection relationship, the attribute information of the control component, and the attribute information of the controlled component, the method further includes: In response to the setting command for the created connection relationship, the operation attributes of the connection relationship are assigned values; The control logic code is generated by combining the attribute information of the connection relationship, the attribute information of the control component, and the attribute information of the controlled component, including: Control logic code is generated by combining the attribute information of the connection relationship, the operation attribute value of the connection relationship, the attribute information of the control component, and the attribute information of the controlled component. The operation attribute value of the connection relationship includes: the tag value of the connection relationship and the received value of the controlled node corresponding to each tag value.
9. The method of claim 8, wherein, Assigning operation attributes to the connection relationship includes: Obtain the type of the connection relationship, and obtain the corresponding attribute configuration template based on the type of the connection relationship; The connection relationship is assigned operation attribute values based on the user's operation information for the attribute configuration template.
10. The method according to claim 1, characterized in that, The code corresponding to the control relationship is obtained by concatenating the control component construction code, the controlled component construction code, and the control logic code, including: The code handles of the control component construction code, the controlled component construction code, and the control logic code are concatenated according to the control logic to obtain the code corresponding to the control relationship.
11. A page development apparatus, characterized in that, include: The page data acquisition module is used to acquire page data in response to page development requests. The page data includes component information and attribute information of each component. The control relationship acquisition module is used to acquire control relationship information, including control component information, controlled component information, and control logic between the control component and the controlled component. The control component code generation module is used to create control nodes based on the control component information and generate control component construction code by combining the attribute information of the control component in the page data. The controlled component code generation module is used to create controlled nodes based on the controlled component information and generate controlled component construction code by combining the attribute information of the controlled component in the page data; The control logic code generation module is used to generate the connection relationship between the control node and the controlled node according to the control logic, and generate control logic code by combining the attribute information of the connection relationship, the attribute information of the control component and the attribute information of the controlled component. The code splicing module is used to splice the control component construction code, the controlled component construction code, and the control logic code to obtain the code corresponding to the control relationship; The page code generation module is used to generate page code based on the code corresponding to all control relationships for page development; The event listening module is used to establish listening events for the control component and the controlled component corresponding to each control relationship, and save the code corresponding to the listening event to the page code.
12. An electronic device for page development, characterized in that, include: One or more processors; 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 as described in any one of claims 1-10.
13. A computer-readable medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1-10.
Citation Information
Patent Citations
Service orchestration method, device, equipment, computer readable medium and program product
CN115145560A
Method for providing application development environment and device
US20160004515A1
