CN115951869A - Page development method and device - Google Patents

Page development method and device Download PDF

Info

Publication number
CN115951869A
CN115951869A CN202211457627.0A CN202211457627A CN115951869A CN 115951869 A CN115951869 A CN 115951869A CN 202211457627 A CN202211457627 A CN 202211457627A CN 115951869 A CN115951869 A CN 115951869A
Authority
CN
China
Prior art keywords
control
component
node
controlled
code
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211457627.0A
Other languages
Chinese (zh)
Inventor
杨树威
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Zhenshi Information Technology Co Ltd
Original Assignee
Beijing Jingdong Zhenshi Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Zhenshi Information Technology Co Ltd filed Critical Beijing Jingdong Zhenshi Information Technology Co Ltd
Priority to CN202211457627.0A priority Critical patent/CN115951869A/en
Publication of CN115951869A publication Critical patent/CN115951869A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/02Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]

Landscapes

  • Stored Programmes (AREA)

Abstract

The invention discloses a page development method and device, and relates to the technical field of computers. One embodiment of the method comprises: responding to a page development request, and acquiring page data; acquiring control component information and controlled component information included in the control relation and control logic between the control component and the controlled component; generating a control component construction code according to the control component information; generating a controlled component construction code according to the controlled component information; generating a connection relation between a control node and a controlled node according to the control logic and generating a control logic code; splicing the codes to obtain codes corresponding to the control relationship; and generating a page code according to the codes corresponding to all the control relations so as to develop the page. The implementation mode reduces the workload of developers, shortens the service development period, reduces the use threshold of non-developers, and improves the page development efficiency and flexibility.

Description

Page development method and device
Technical Field
The invention relates to the technical field of computers, in particular to a page development method and device.
Background
When a page or a form is built, a Low Code Development Platform (LCDP), which is a development platform capable of quickly generating an application without coding or with a small amount of code, often needs to control the linkage logic of another component by operating one component, such as hiding the display of the component, opening a new page, modifying internal data of a certain component, modifying the state of a certain component, and the like. At present, the realization of linkage logic between low-code development platform realization components mainly has two modes: the first is to assemble two or more atomic components into a new business component by a code development mode and carry out linkage logic processing in the business component; and the second method is that the platform opens a window of the user-defined JS to the user, the user defines the JS according to a code injection rule of the platform, and linkage between the components is realized in a mode of the user-defined JS.
In the process of implementing the invention, the inventor finds that at least the following problems exist in the prior art:
at present, linkage logic between page components is realized in a code development mode, the workload of developers is increased, new service requirements strongly depend on the development cycle of the developers, and the use threshold of non-technical personnel is high, so that the page development efficiency is low and the flexibility is poor.
Disclosure of Invention
In view of this, embodiments of the present invention provide a page development method and apparatus, which can implement a low-code development platform, automatically generate codes to implement a linkage control logic between page components, reduce workload of developers, shorten a service development period, reduce a use threshold of non-developers, and improve page development efficiency and flexibility. Meanwhile, the coupling degree of the components and the low-code development platform is reduced, the expandability of the component library is improved, and the complexity of accessing other systems is reduced.
In order to achieve the above object, according to an aspect of an embodiment of the present invention, there is provided a page development method, including:
responding to a page development request, and acquiring page data, wherein the page data comprises 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, wherein the control component information and the controlled component information are included in the control relationship;
creating a control node according to the control component information, and generating a control component construction code by combining the attribute information of the control component in the page data;
creating a controlled node according to the controlled component information, and generating a controlled component construction code by combining the attribute information of the controlled component in the page data;
generating a connection relation between the control node and the controlled node according to the control logic, and generating a control logic code by combining attribute information of the connection relation, attribute information of the control component and attribute information of the controlled component;
splicing the control component construction code, the controlled component construction code and the control logic code to obtain a code corresponding to the control relationship;
and generating page codes according to the codes corresponding to all the control relations so as to develop the page.
Optionally, before generating the control component building code by combining the attribute information of the control component in the page data, the method further includes: responding to a setting instruction of the created control node, and performing operation attribute assignment on the control node; generating a control component construction code by combining the attribute information of the control component in the page data, wherein the control component construction code comprises the following steps: and generating a control component construction code by combining the attribute information of the control component in the page data and the operation attribute value of the control node.
Optionally, performing operation attribute assignment on the control node includes: acquiring the node type of the control node, and acquiring a corresponding attribute configuration template according to the node type; and carrying out operation attribute assignment on the control node according to the operation information of the user on the attribute configuration template.
Optionally, before generating a controlled component construction code by combining the attribute information of the controlled component in the page data, the method further includes: responding to a setting instruction of the created controlled node, and performing operation attribute assignment on the controlled node; generating a controlled component construction code by combining the attribute information of the controlled component in the page data, wherein the method comprises the following steps: and generating a 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.
Optionally, the performing operation attribute assignment on the controlled node includes: acquiring the node type of the controlled node, and acquiring a corresponding attribute configuration template according to the node type; and carrying out operation attribute assignment on the controlled node according to the operation information of the attribute configuration template by the user.
Optionally, generating a connection relationship between the control node and the controlled node according to the control logic includes: and according to the control logic, taking the control node as a source node and the controlled node as a target node, and generating a connection relation between the control node and the controlled node.
Optionally, generating a connection relationship between the control node and the controlled node according to the control logic includes: generating attribute information of a connection relation according to the control logic, wherein the attribute information comprises a source node and a target node corresponding to the connection relation; and generating the connection relation between the control node and the controlled node according to the source node and the target node corresponding to the connection relation.
Optionally, before generating the 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: responding to a setting instruction of the created connection relation, and performing operation attribute assignment on the connection relation; generating a 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, wherein the control logic code comprises: generating a 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 comprises: the label value of the connection relation and the receiving value of the controlled node corresponding to each label value.
Optionally, performing operation attribute assignment on the connection relationship, including: acquiring the type of the connection relation, and acquiring a corresponding attribute configuration template according to the type of the connection relation; and performing operation attribute assignment on the connection relation according to the operation information of the user on the attribute configuration template.
Optionally, splicing the control component construction code, the controlled component construction code, and the control logic code to obtain a code corresponding to the control relationship, includes: and splicing the control component construction code, the controlled component construction code and the code handle of the control logic code according to the control logic to obtain a code corresponding to the control relationship.
Optionally, for the establishment instruction of the control relationship between each component, a code corresponding to the control relationship is generated by a visualization operation according to a user.
Optionally, the method further comprises: and establishing monitoring events for the control component and the controlled component corresponding to each control relation.
According to another aspect of the embodiments of the present invention, there is provided a page development apparatus, including:
the page data acquisition module is used for responding to a page development request and acquiring page data, and the page data comprises component information and attribute information of each component;
the control relation acquisition module is used for acquiring control component information, controlled component information and control logic between the control component and the controlled component which are included in the control relation;
the control component code generation module is used for creating a control node according to the control component information and generating a 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 for creating a controlled node according to the controlled component information and generating a 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 for generating a connection relation between the control node and the controlled node according to the control logic and generating a control logic code by combining the attribute information of the connection relation, the attribute information of the control component and the attribute information of the controlled component;
the code splicing module is used for splicing the control component construction code, the controlled component construction code and the control logic code to obtain a code corresponding to the control relation;
and the page code generating module is used for generating page codes according to the codes corresponding to all the control relations so as to develop pages.
According to another aspect of the embodiments of the present invention, there is provided an electronic device for page development, including: one or more processors; the storage device is used for storing one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors realize the page development method provided by the embodiment of the invention.
According to still another aspect of the embodiments of the present invention, there is provided a computer-readable medium on which a computer program is stored, the program, when executed by a processor, implementing the page development method provided by the embodiments of the present invention.
One embodiment of the above invention has the following advantages or benefits: acquiring page data by responding to a page development request, wherein the page data comprises component information and attribute information of each component; acquiring control component information, controlled component information and control logic between a control component and a controlled component, wherein the control component information and the controlled component information are included in the control relationship; creating a control node according to the control component information, and generating a control component construction code by combining the attribute information of the control component in the page data; creating a controlled node according to the controlled component information, and generating a controlled component construction code by combining the attribute information of the controlled component in the page data; generating a connection relation between a control node and a controlled node according to the control logic, and generating a control logic code by combining attribute information of the connection relation, attribute information of a control component and attribute information of the controlled component; splicing the control component construction code, the controlled component construction code and the control logic code to obtain a code corresponding to the control relationship; according to the technical scheme, the page codes are generated according to the codes corresponding to all the control relations so as to carry out page development, the linkage control logic between the page components is realized by automatically generating the codes on a low-code development platform, the workload of developers is reduced, the service development period is shortened, the use threshold of non-developers is reduced, and the page development efficiency and flexibility are improved. Meanwhile, the coupling degree of the components and the low-code development platform is reduced, the expandability of the component library is improved, and the complexity of accessing other systems is reduced.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is a schematic diagram of the main steps of a page development method according to an embodiment of the present invention;
FIG. 2 is a flow chart illustrating the establishment of a control relationship according to an embodiment of the present invention;
FIG. 3 is a diagram illustrating a connection establishment procedure according to an embodiment of the present invention;
FIG. 4 is a page development system architecture diagram of an embodiment of the present invention;
FIG. 5 is a schematic diagram illustrating the operation of an embodiment of the present invention;
FIG. 6 is a schematic diagram of the main modules of a page development apparatus according to an embodiment of the present invention;
FIG. 7 is an exemplary system architecture diagram in which embodiments of the present invention may be employed;
fig. 8 is a schematic structural diagram of a computer system suitable for implementing a terminal device or a server according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
In the technical scheme of the invention, the data acquisition, storage, use, processing and the like all conform to relevant regulations of national laws and regulations.
In order to solve the technical problems in the prior art, the invention provides a page development method, which provides a user with the capability of configuring linkage logic of components, realizes the linkage effect between the components by visual logic arrangement, reduces the development cost of developers for typical service scenes, reduces the use threshold of non-technical personnel when configuring the linkage effect, and improves the page development efficiency and flexibility.
Fig. 1 is a schematic diagram of main steps of a page development method according to an embodiment of the present invention. As shown in fig. 1, the page development method according to the embodiment of the present invention mainly includes the following steps S101 to S107.
Step S101: and responding to the page development request, and acquiring page data, wherein the page data comprises component information and attribute information of each component.
When page development is performed in the low-code development platform, a user can generate a page through operations of dragging component assembly, component attribute configuration, data binding and the like based on a page configuration module of the low-code development platform, and page data of the generated page is stored in a database, wherein the page data mainly comprises component information (such as component identification, component name and the like) included in the page and attribute information of each component, and the attribute information mainly comprises information of the type, style, data, action and the like of the component. For example, the attribute information of the pull-down select box component (select) mainly includes: the tab name, width, height, default display text, whether editable, whether read-only, whether selected content can be cleared, pull-down data, etc. of the drop-down selection box. Thereafter, the page data may be stored in the storage structure shown in table 1 below.
TABLE 1
Figure BDA0003953871800000071
Figure BDA0003953871800000081
/>
Figure BDA0003953871800000091
The searchFields field is an array, and stores therein configuration information of all components.
After a user generates a page through operation on the low-code development platform and clicks and saves the page, page data can be generated and saved. And subsequently, configuring the linkage control relationship among the page components according to the page data.
Step S102: and acquiring control component information, controlled component information and control logic between the control component and the controlled component, wherein the control relation comprises the control component information, the controlled component information and the control logic between the control component and the controlled component. In general, when the control relationship between the components needs to be established, the step S102 is triggered to be executed.
In the embodiment of the invention, the page data is received by a stream task processing module of the page development system, and the control relation between the components is established according to the page data and the user operation. For each control relationship, there are a control component, a controlled component (which may be one or more), and control logic between the control component and the controlled component, such as: the control component controls the display hiding of the controlled component, modifies the internal data of the controlled component, modifies the state of the controlled component and the like.
In the embodiment of the invention, for the establishment instruction of the control relationship between each component, the code corresponding to the control relationship is generated through the visual operation of the user. When a page with an edit state (the page state is divided into a preview state and an edit state, and the page cannot be dragged and configured with other attributes in the preview state, so that a stream task needs to be added in the edit state), a stream task container is opened, a stream task is created, one or more stream tasks can be created on the same page (namely, the control relationship among one or more components exists), and meanwhile, the created task name is checked and cannot be repeated. And clicking the task name to jump to a stream task editing page and transmitting the page data of the current page to the stream task editing page. Page data (e.g., a Json data structure) is a collection of information for each component, and is passed to the stream task editing component through communication between the Vue parent and child components, with pages being parent components and pages being child components.
Fig. 2 is a schematic diagram of a control relationship establishment process according to an embodiment of the present invention. As shown in fig. 2, when the user establishes each control relationship, the specific operation flow is as follows:
1. dragging an initial node into an editor of the flow task processing module, wherein the initial node is an entrance for starting the whole flow task, can be a judgment node or an active node, the types of the nodes can be distinguished in a program, the types of the nodes include a start node, an end node, a new page opening node and the like, and each type of node internally processes different logic actions. Then, establishing a binding relationship between the initial node and the control component, for example, selecting a source field as an identification ID of the control component in the attribute configuration of the node;
2. dragging one or more active nodes (the number of the active nodes depends on the number of the controlled components in the control relationship) into the editor, and respectively establishing the binding relationship between each active node and the controlled components, for example: a target field can be selected as an identification ID of a controlled component in the attribute configuration of the active node;
3. the control relationship can be established for the two nodes by establishing a connection relationship (for example, establishing a connection relationship by generating a connection line) with the initial node as a starting point and the active node as an end point.
After a user edits a control relationship in an editor of the flow task processing module, clicking and storing the control relationship, so that an establishment instruction of the control relationship among the components can be generated, and then, the page development system of the invention acquires control component information and controlled component information included in the control relationship and control logic between the control component and the controlled component according to the control instruction, and then generates corresponding codes according to the control relationship among the components for page development. The specific implementation process will be described in conjunction with step S103 to step S107.
Step S103: and creating a control node according to the control component information, and generating a control component construction code by combining the attribute information of the control component in the page data.
After the page development system obtains the control relationship between the components, a source node, that is, a control node, is created according to control component information (for example, a control component identification ID), and at this time, the control component and the control node are bound. In a specific implementation process, taking a judgment node as an example, after a user drags a judgment node into an editor as a control node, a code character string "switch (initVal) { $ case }" is automatically created inside a program of the editor of the stream task processing module at this time; and the node is activated by clicking the judgment node and the control component identification ID is selected as a source data field source field, so that the binding between the control node and the control component can be completed. After the control node is bound with the control component, the program inside the editor can generate the construction code of the control component according to the property information of the control component.
According to an embodiment of the present invention, before generating the control component building code by combining the attribute information of the control component in the page data, the method may further include: responding to a setting instruction of the created control node, and performing operation attribute assignment on the control node; and generating a control component construction code by combining the attribute information of the control component in the page data, wherein the control component construction code comprises the following steps: and generating a control component construction code by combining the attribute information of the control component in the page data and the operation attribute value of the control node.
The performing operation attribute assignment on the control node may specifically include: acquiring the node type of the control node, and acquiring a corresponding attribute configuration template according to the node type; and carrying out operation attribute assignment on the control node according to the operation information of the user on the attribute configuration template.
Each node has its own information, including node identification id, node name, node type, clazz field, etc., where the node type corresponds to the clazz field, the node type is defined when the stream task editing library is initialized, and each node has its own clazz field, for example: the clazz field of the judgment node is "decision" and the clazz field of the active node is "activity". When clicking a node in the editor, the program activates the node and obtains the information of the node, and simultaneously judges the node type of the node so as to obtain the corresponding attribute configuration template according to the node type. Different component configuration contents exist in the attribute configuration templates corresponding to different node types.
In the embodiment of the present invention, when performing operation attribute assignment on a control node, a corresponding attribute configuration template is first obtained according to a node type of the control node, where a configuration item includes, for example: mode of operation, type of operation, maximum number of processes, processing time, customer order number, task status, etc. The user can generate the operation information of the user on the attribute configuration template by operating each configuration item in the attribute configuration template, and then the program inside the editor assigns the operation attribute to the control node according to the operation information of the user on the attribute configuration template.
Step S104: and creating a controlled node according to the controlled component information, and generating a controlled component construction code by combining the attribute information of the controlled component in the page data.
The creation process of the controlled node is similar to the creation process of the control node, and will not be described in detail here. It should be noted that there may be one or more controlled nodes, and each controlled node corresponds to one controlled component.
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: responding to a setting instruction of the created controlled node, and performing operation attribute assignment on the controlled node; generating a controlled component construction code by combining the attribute information of the controlled component in the page data, wherein the method comprises the following steps: and generating a 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.
Specifically, the performing operation attribute assignment on the controlled node may include: acquiring the node type of the controlled node, and acquiring a corresponding attribute configuration template according to the node type; and carrying out operation attribute assignment on the controlled node according to the operation information of the attribute configuration template by the user. When the operation attribute assignment is performed on the controlled node, the corresponding attribute configuration template is obtained according to the node type of the controlled node, and the setting is performed according to the specific configuration item in the template.
Step S105: and generating a connection relation between the control node and the controlled node according to the control logic, and generating a control logic code by combining the attribute information of the connection relation, the attribute information of the control component and the attribute information of the controlled component.
After the control node and the controlled node are established according to step S103 and step S104, the step S105 is triggered to be executed inside the program of the editor according to the operation of dragging the connecting line in the visual interface of the editor by the user.
According to an embodiment of the present invention, generating the connection relationship between the control node and the controlled node according to the control logic includes: and according to the control logic, the control node is used as a source node, the controlled node is used as a target node, and the connection relation between the control node and the controlled node is generated. According to the control logic, how the components are controlled specifically can be obtained, that is, the control node can be set as a source node, the controlled node is set as a target node, and then a connecting line with a control direction between the control node and the controlled node can be generated to represent the connection relationship between the control node and the controlled node.
According to another embodiment of the present invention, generating the connection relationship between the control node and the controlled node according to the control logic includes: generating attribute information of a connection relation according to the control logic, wherein the attribute information comprises a source node and a target node corresponding to the connection relation; and generating the connection relation between the control node and the controlled node according to the source node and the target node corresponding to the connection relation. According to the control logic, how the components are controlled can be obtained, so that the attribute information of the corresponding connection relation can be generated to indicate which node is the source node and which node is the target node, and thus, the connection relation between the control node and the controlled node can be generated according to the attribute information of the connection relation.
According to another embodiment of the present invention, before generating the 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: and performing operation attribute assignment on the connection relation in response to a setting instruction of the created connection relation. And generating a 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 a 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 comprises: the label value of the connection relation and the receiving value of the controlled node corresponding to each label value. The connection relation is also a node in nature, so the operation attribute can be set on the connection relation by clicking the connection relation. For the connection relationship, the operation attribute mainly includes the tag value of the connection relationship and the receiving value of the controlled node corresponding to each tag value.
According to another embodiment of the present invention, the performing operation attribute assignment on the connection relationship includes: acquiring the type of the connection relation, and acquiring a corresponding attribute configuration template according to the type of the connection relation; and performing operation attribute assignment on the connection relation according to the operation information of the user on the attribute configuration template.
In the embodiment of the present invention, the connection relationship between the nodes is represented as a connection line between the nodes. The connecting line has its own attribute information, including main field id, name, source (source node information), target (target node information), clazz field, label value, etc., where source is id of the connecting relation (connecting line) starting point node, and target is id of the terminal point node, and a relation can be established for the two nodes through the connecting relation (connecting line), that is, it is known which is the control node and which is the controlled node.
When the connecting line is clicked, the internal program of the editor acquires the information of the current connecting line, and the type of the connecting line activated at the moment is judged according to the clazz field so as to trigger activation of the connecting line attribute configuration panel of the corresponding type. In the attribute configuration panel, a tag value of the connection line may be set, where the value of the tag value is determined by data in attribute information of a component (control component) selected by the source node, for example, an enumerated value (1/2/3.) or (true/false); the receiving value of the controlled node is the receiving value (or input value) of the component (controlled component) selected by the set target node, and is the input value when the source node enumeration value is set to be different, and the target node corresponds to the execution time.
Fig. 3 is a schematic diagram of a connection establishment procedure according to an embodiment of the present invention. As shown in fig. 3, after the control node and the controlled node are created, two connection lines between the control node and the controlled node may be established according to the control logic to establish a connection relationship between the control node and the controlled node. Then, after setting the tag values (in this embodiment, including 1 and 2) corresponding to the two connection lines and the receiving value of the controlled node, the connection relationship establishment can be completed, and then the corresponding control logic code can be generated.
In the embodiment of the present invention, after setting the label value of the connecting line as an enumerated value (1/2/3.) or (true/false) in the attribute configuration template of the connecting line, and simultaneously setting the received value of the controlled node to assign an operation attribute to the connecting line, the following code character string may be generated: const handle =' (function (_ this, state) { _ this.set (state. Searchfields [ $ { index } ], "flowShow", $ { targetValue }) } (_ this, state)) "; wherein index is the index of the selected field (target) in the controlled node in the data transmitted by the parent page, and targetValue is the value of the field "flowShow". After the operation attribute assignment result of the connecting line is saved, a final code string, request _ case =' case $ { label }: handle } "of the current connecting line is generated according to the operation assignment result, and the final code string is saved to the current application instance.
Step S106: and splicing the control component construction code, the controlled component construction code and the control logic code to obtain a code corresponding to the control relation.
When the step is executed specifically, the control component construction code, the controlled component construction code and the code handle of the control logic code may be spliced according to the control logic to obtain the code corresponding to the control relationship.
Step S107: and generating a page code according to the codes corresponding to all the control relations so as to develop the page.
For the page to be developed, all components do not have control relations, and codes corresponding to components without control relations with other components can be automatically generated by the low-code development platform when page data is generated. Therefore, after the control relationships among all the components are established, the codes corresponding to all the control relationships and the codes corresponding to the components without the control relationships with other components can be spliced together to generate page codes, and the page is generated by executing the page codes.
According to one embodiment of the invention, a monitoring event is established for the control component and the controlled component corresponding to each control relationship, and codes corresponding to the monitoring event are stored in the page codes. Therefore, when the client executes the script, the change of the internal value of the component can be monitored, whether the component is bound with a stream task or not is judged, if linkage control between the components is triggered, control logic can be called through actions triggered by the monitoring control component and the controlled component, and updating of the page is triggered while the change of monitored data is updated in a response mode through React and Vue.
FIG. 4 is a page development system architecture diagram of an embodiment of the present invention. As shown in fig. 4, the page development system of the embodiment of the present invention mainly includes a page configuration module and a stream task processing module, where the page configuration module is mainly used to configure a page by combining page templates and performing operations such as dragging and splicing, component attribute configuration, and data binding on a base component, a container component, and the like, so as to generate page data; and then, transmitting the page data to the stream task processing module. The flow task processing module is used for receiving the page data transmitted by the page configuration module, generating a flow task according to a control relation establishing instruction between the components generated by the operation of a user in the editor, then creating a control node bound with the control component and a controlled node bound with the controlled component according to the flow task, then performing operation attribute configuration on the control node and the controlled node, and generating a connection relation capable of associating the control node and the controlled node, thereby generating a code corresponding to the control relation and storing data for generating a page code. And finally, the page can be generated by running the page code at the client.
Fig. 5 is a schematic diagram illustrating the operation effect of the embodiment of the present invention. As shown in fig. 5, the operation effect of the control component on the display hiding control of the controlled component is shown. In this embodiment, the operation mode is a control component, which has two values: automatically scanning the order number and manually introducing the order number. When the automatic scanning list number is clicked, the controlled component of the client list number is displayed; when the manual incoming order number is clicked, the controlled component of the client order number is hidden.
Fig. 6 is a schematic diagram of main modules of a page development apparatus according to an embodiment of the present invention. As shown in fig. 6, the page development apparatus 600 according to the embodiment of the present invention mainly includes a page data obtaining module 601, a control relationship obtaining module 602, a control component code generating module 603, a controlled component code generating module 604, a control logic code generating module 605, a code splicing module 606, and a page code generating module 607.
A page data obtaining module 601, configured to obtain page data in response to a page development request, where the page data includes component information and attribute information of each component;
a control relationship obtaining module 602, configured to obtain control component information, controlled component information, and control logic between a control component and a controlled component that are included in the control relationship;
a control component code generating module 603, configured to create a control node according to the control component information, and generate a control component construction code by combining the attribute information of the control component in the page data;
a controlled component code generating module 604, configured to create a controlled node according to the controlled component information, and generate a controlled component construction code by combining the attribute information of the controlled component in the page data;
a control logic code generating module 605, configured to generate a connection relationship between the control node and the controlled node according to the control logic, and generate a control logic code by combining attribute information of the connection relationship, attribute information of the control component, and attribute information of the controlled component;
a code splicing module 606, configured to splice the control component construction code, the controlled component construction code, and the control logic code to obtain a code corresponding to the control relationship;
the page code generation module 607 is configured to generate a page code according to the codes corresponding to all the control relationships, so as to perform page development.
According to an embodiment of the present invention, the page development device 600 may further include an operation attribute assignment module (not shown in the figure) for: and before generating a control component construction code by combining the attribute information of the control component in the page data, responding to a setting instruction of the created control node, and performing operation attribute assignment on the control node. Also, the control component code generation module 603 may be further configured to: and generating a control component construction code by combining the attribute information of the control component in the page data and the operation attribute value of the control node.
According to another embodiment of the present invention, the operation attribute assignment module (not shown in the figure) may be further configured to: acquiring the node type of the control node, and acquiring a corresponding attribute configuration template according to the node type; and carrying out operation attribute assignment on the control node according to the operation information of the user on the attribute configuration template.
According to another embodiment of the present invention, the operation attribute assignment module (not shown in the figure) may be further configured to: and before generating a controlled component construction code by combining the attribute information of the controlled component in the page data, responding to a setting instruction of the created controlled node, and performing operation attribute assignment on the controlled node. Also, the controlled component code generating module 604 can be further configured to: and generating a 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.
According to another embodiment of the present invention, the operation attribute assignment module (not shown in the figure) may be further configured to: acquiring the node type of the controlled node, and acquiring a corresponding attribute configuration template according to the node type; and carrying out operation attribute assignment on the controlled node according to the operation information of the attribute configuration template by the user.
According to yet another embodiment of the invention, the control logic code generation module 605 may be further operable to: and according to the control logic, the control node is used as a source node, the controlled node is used as a target node, and the connection relation between the control node and the controlled node is generated.
According to yet another embodiment of the invention, the control logic code generation module 605 may be further configured to: generating attribute information of a connection relation according to the control logic, wherein the attribute information comprises a source node and a target node corresponding to the connection relation; and generating the connection relation between the control node and the controlled node according to the source node and the target node corresponding to the connection relation.
According to another embodiment of the present invention, the operation attribute assignment module (not shown in the figure) may be further configured to: and performing operation attribute assignment on the connection relation in response to a setting instruction of the created connection relation before generating a control logic code by combining the attribute information of the connection relation, the attribute information of the control component and the attribute information of the controlled component. Also, the control logic code generation module 605 may be further configured to: generating a 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 comprises: the label value of the connection relation and the receiving value of the controlled node corresponding to each label value.
According to another embodiment of the present invention, the operation attribute assignment module (not shown in the figure) may be further configured to: acquiring the type of the connection relation, and acquiring a corresponding attribute configuration template according to the type of the connection relation; and performing operation attribute assignment on the connection relation according to the operation information of the user on the attribute configuration template.
According to yet another embodiment of the invention, the code splicing module 606 may be further configured to: and splicing the control component construction code, the controlled component construction code and the code handle of the control logic code according to the control logic to obtain a code corresponding to the control relationship.
According to another embodiment of the present invention, the page development device 600 generates, for the establishment instruction of the control relationship between each component, a code corresponding to the control relationship by a visualization operation according to a user.
According to another embodiment of the present invention, the page developing apparatus 600 further comprises a listening event establishing module (not shown in the figure) for: and establishing monitoring events for the control component and the controlled component corresponding to each control relation.
According to the technical scheme of the embodiment of the invention, page data is obtained by responding to a page development request, and the page data comprises component information and attribute information of each component; acquiring control component information and controlled component information included in the control relation and control logic between the control component and the controlled component; creating a control node according to the control component information, and generating a control component construction code by combining the attribute information of the control component in the page data; creating a controlled node according to the controlled component information, and generating a controlled component construction code by combining the attribute information of the controlled component in the page data; generating a connection relation between a control node and a controlled node according to the control logic, and generating a control logic code by combining the attribute information of the connection relation, the attribute information of the control component and the attribute information of the controlled component; splicing the control component construction code, the controlled component construction code and the control logic code to obtain a code corresponding to the control relationship; according to the technical scheme, the page codes are generated according to the codes corresponding to all the control relations so as to carry out page development, the linkage control logic between the page components is realized by automatically generating the codes on a low-code development platform, the workload of developers is reduced, the service development period is shortened, the use threshold of non-developers is reduced, and the page development efficiency and flexibility are improved. Meanwhile, the coupling degree of the components and the low-code development platform is reduced, the expandability of the component library is improved, and the complexity of accessing other systems is reduced.
Fig. 7 illustrates an exemplary system architecture 700 of a page development method or page development apparatus to which embodiments of the invention may be applied.
As shown in fig. 7, the system architecture 700 may include terminal devices 701, 702, 703, a network 704, and a server 705. The network 704 is the medium used to provide communications links between terminal devices 701, 702, 703 and the server 705. Network 704 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
A user may use the terminal devices 701, 702, 703 to interact with a server 705 over a network 704, to receive or send messages or the like. Various communication client applications, such as a web browser application, a web development application, etc. (just examples) may be installed on the terminal devices 701, 702, 703.
The terminal devices 701, 702, 703 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 705 may be a server providing various services, such as a background management server (for example only) providing support for a page development website browsed by a user using the terminal devices 701, 702, 703. The background management server can acquire page data from data such as a received page development request, wherein the page data comprises 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, wherein the control component information and the controlled component information are included in the control relationship; creating a control node according to the control component information, and generating a control component construction code by combining the attribute information of the control component in the page data; creating a controlled node according to the controlled component information, and generating a controlled component construction code by combining the attribute information of the controlled component in the page data; generating a connection relation between the control node and the controlled node according to the control logic, and generating a control logic code by combining attribute information of the connection relation, attribute information of the control component and attribute information of the controlled component; splicing the control component construction code, the controlled component construction code and the control logic code to obtain a code corresponding to the control relationship; and generating page codes according to codes corresponding to all the control relations, and the like, and feeding back a processing result (such as the page codes, which are just examples) to the terminal equipment.
It should be noted that the page development method provided by the embodiment of the present invention is generally executed by the server 705, and accordingly, the page development apparatus is generally disposed in the server 705.
It should be understood that the number of terminal devices, networks, and servers in fig. 7 are merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 8, shown is a block diagram of a computer system 800 suitable for use with a terminal device or server implementing embodiments of the present invention. The terminal device or the server shown in fig. 8 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 8, the computer system 800 includes a Central Processing Unit (CPU) 801 that can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM) 802 or a program loaded from a storage section 808 into a Random Access Memory (RAM) 803. In the RAM 803, various programs and data necessary for the operation of the system 800 are also stored. The CPU 801, ROM 802, and RAM 803 are connected to each other via a bus 804. An input/output (I/O) interface 805 is also connected to bus 804.
The following components are connected to the I/O interface 805: an input portion 806 including a keyboard, a mouse, and the like; an output section 807 including components such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and a speaker; a storage portion 808 including a hard disk and the like; and a communication section 809 including a network interface card such as a LAN card, a modem, or the like. The communication section 809 performs communication processing via a network such as the internet. A drive 810 is also connected to the I/O interface 805 as needed. A removable medium 811 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 810 as necessary, so that a computer program read out therefrom is mounted on the storage section 808 as necessary.
In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 809 and/or installed from the removable medium 811. The computer program performs the above-described functions defined in the system of the present invention when executed by the Central Processing Unit (CPU) 801.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures 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 the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units or modules described in the embodiments of the present invention may be implemented by software, or may be implemented by hardware. The described units or modules may also be provided in a processor, and may be described as: a processor comprises a page data acquisition module, a control relation acquisition module, a control component code generation module, a controlled component code generation module, a control logic code generation module, a code splicing module and a page code generation module. The names of these units or modules do not constitute a limitation to the units or modules themselves in some cases, and for example, the page data acquisition module may also be described as a "module for acquiring page data in response to a page development request".
As another aspect, the present invention also provides a computer-readable medium, which may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to comprise: responding to a page development request, and acquiring page data, wherein the page data comprises 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, wherein the control component information and the controlled component information are included in the control relationship; creating a control node according to the control component information, and generating a control component construction code by combining the attribute information of the control component in the page data; creating a controlled node according to the controlled component information, and generating a controlled component construction code by combining the attribute information of the controlled component in the page data; generating a connection relation between the control node and the controlled node according to the control logic, and generating a control logic code by combining the attribute information of the connection relation, the attribute information of the control component and the attribute information of the controlled component; splicing the control component construction code, the controlled component construction code and the control logic code to obtain a code corresponding to the control relationship; and generating page codes according to the codes corresponding to all the control relations so as to develop the page.
According to the technical scheme of the embodiment of the invention, page data is obtained by responding to a page development request, and the page data comprises component information and attribute information of each component; acquiring control component information, controlled component information and control logic between a control component and a controlled component, wherein the control component information and the controlled component information are included in the control relationship; creating a control node according to the control component information, and generating a control component construction code by combining the attribute information of the control component in the page data; creating a controlled node according to the controlled component information, and generating a controlled component construction code by combining the attribute information of the controlled component in the page data; generating a connection relation between a control node and a controlled node according to the control logic, and generating a control logic code by combining the attribute information of the connection relation, the attribute information of the control component and the attribute information of the controlled component; splicing the control component construction code, the controlled component construction code and the control logic code to obtain a code corresponding to the control relationship; according to the technical scheme, the page codes are generated according to the codes corresponding to all the control relations so as to carry out page development, the linkage control logic between the page components is realized by automatically generating the codes on a low-code development platform, the workload of developers is reduced, the service development period is shortened, the use threshold of non-developers is reduced, and the page development efficiency and flexibility are improved. Meanwhile, the coupling degree of the components and the low-code development platform is reduced, the expandability of the component library is improved, and the complexity of accessing other systems is reduced.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (13)

1. A page development method is characterized by comprising the following steps:
responding to a page development request, and acquiring page data, wherein the page data comprises 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, wherein the control component information and the controlled component information are included in the control relationship;
creating a control node according to the control component information, and generating a control component construction code by combining the attribute information of the control component in the page data;
creating a controlled node according to the controlled component information, and generating a controlled component construction code by combining the attribute information of the controlled component in the page data;
generating a connection relation between the control node and the controlled node according to the control logic, and generating a control logic code by combining attribute information of the connection relation, attribute information of the control component and attribute information of the controlled component;
splicing the control component construction code, the controlled component construction code and the control logic code to obtain a code corresponding to the control relationship;
and generating page codes according to the codes corresponding to all the control relations so as to develop the page.
2. The method of claim 1, further comprising, before generating control component build code in conjunction with attribute information of the control component in the page data:
responding to a setting instruction of the created control node, and performing operation attribute assignment on the control node;
generating a control component construction code by combining the attribute information of the control component in the page data, wherein the control component construction code comprises the following steps:
and generating a control component construction code by combining the attribute information of the control component in the page data and the operation attribute value of the control node.
3. The method of claim 2, wherein assigning operational attributes to the control node comprises:
acquiring the node type of the control node, and acquiring a corresponding attribute configuration template according to the node type;
and carrying out operation attribute assignment on the control node according to the operation information of the user on the attribute configuration template.
4. The method of claim 1, further comprising, before generating a controlled component construction code in combination with the attribute information of the controlled component in the page data:
responding to a setting instruction of the created controlled node, and performing operation attribute assignment on the controlled node;
generating a controlled component construction code by combining the attribute information of the controlled component in the page data, wherein the method comprises the following steps:
and generating a 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.
5. The method of claim 4, wherein performing operational attribute assignments on the controlled node comprises:
acquiring the node type of the controlled node, and acquiring a corresponding attribute configuration template according to the node type;
and carrying out operation attribute assignment on the controlled node according to the operation information of the attribute configuration template by the user.
6. The method of claim 1, wherein generating the connection relationship between the control node and the controlled node according to the control logic comprises:
and according to the control logic, the control node is used as a source node, the controlled node is used as a target node, and the connection relation between the control node and the controlled node is generated.
7. The method according to claim 1 or 6, wherein generating the connection relationship between the control node and the controlled node according to the control logic comprises:
generating attribute information of a connection relation according to the control logic, wherein the attribute information comprises a source node and a target node corresponding to the connection relation;
and generating the connection relation between the control node and the controlled node according to the source node and the target node corresponding to the connection relation.
8. The method of claim 7, further comprising, before generating control logic code in combination with the attribute information of the connection relationship, the attribute information of the control component, and the attribute information of the controlled component:
responding to a setting instruction of the created connection relation, and performing operation attribute assignment on the connection relation;
generating a 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, wherein the control logic code comprises:
generating a 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 comprises: the label value of the connection relation and the receiving value of the controlled node corresponding to each label value.
9. The method of claim 8, wherein performing operation attribute assignment on the connection relationship comprises:
acquiring the type of the connection relation, and acquiring a corresponding attribute configuration template according to the type of the connection relation;
and performing operation attribute assignment on the connection relation according to the operation information of the user on the attribute configuration template.
10. The method of claim 1, wherein splicing the control component construction code, the controlled component construction code, and the control logic code to obtain a code corresponding to the control relationship comprises:
and splicing the control component construction code, the controlled component construction code and the code handle of the control logic code according to the control logic to obtain a code corresponding to the control relationship.
11. A page development apparatus, comprising:
the page data acquisition module is used for responding to a page development request and acquiring page data, and the page data comprises component information and attribute information of each component;
the control relation acquisition module is used for acquiring control component information, controlled component information and control logic between the control component and the controlled component which are included in the control relation;
the control component code generation module is used for creating a control node according to the control component information and generating a control component construction code by combining the attribute information of the control component in the page data;
the controlled component code generating module is used for creating a controlled node according to the controlled component information and generating a controlled component construction code by combining the attribute information of the controlled component in the page data;
a control logic code generating module, configured to generate a connection relationship between the control node and the controlled node according to the control logic, and generate a control logic code by combining attribute information of the connection relationship, attribute information of the control component, and attribute information of the controlled component;
the code splicing module is used for splicing the control component construction code, the controlled component construction code and the control logic code to obtain a code corresponding to the control relation;
and the page code generating module is used for generating page codes according to the codes corresponding to all the control relations so as to develop pages.
12. An electronic device for page development, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-10.
13. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-10.
CN202211457627.0A 2022-11-21 2022-11-21 Page development method and device Pending CN115951869A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211457627.0A CN115951869A (en) 2022-11-21 2022-11-21 Page development method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211457627.0A CN115951869A (en) 2022-11-21 2022-11-21 Page development method and device

Publications (1)

Publication Number Publication Date
CN115951869A true CN115951869A (en) 2023-04-11

Family

ID=87296215

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211457627.0A Pending CN115951869A (en) 2022-11-21 2022-11-21 Page development method and device

Country Status (1)

Country Link
CN (1) CN115951869A (en)

Similar Documents

Publication Publication Date Title
US20210034336A1 (en) Executing a process-based software application in a first computing environment and a second computing environment
US20210333984A1 (en) Method and apparatus for generating customized visualization component
CN107832045B (en) Method and apparatus for cross programming language interface conversion
CN113504908A (en) Business code generation method and device, electronic equipment and computer readable medium
CN111045653B (en) System generation method and device, computer readable medium and electronic equipment
CN113760251A (en) Form development method and device based on Vue
CN112015654A (en) Method and apparatus for testing
CN112199373A (en) Form development method and system
CN113326030A (en) Service request processing method and device
CN114217789A (en) Function component expansion method, device, equipment, storage medium and program product
CN112596854A (en) Method and device for continuously integrating running of assembly line
CN109254778B (en) Method and apparatus for deploying an information flow system
CN112905225A (en) Method and device for creating continuous integration tool construction task
CN114579120A (en) Application code processing method and device, electronic equipment and storage medium
CN115951869A (en) Page development method and device
CN112286514B (en) Method and device for configuring task flow and electronic equipment
CN112988139B (en) Method and device for developing event processing file
CN114675921A (en) Method and device for customizing interface, electronic equipment and storage medium
CN114661274A (en) Method and device for generating intelligent contract
CN113760248A (en) Method and device for generating application program
CN113535037A (en) Interactive display method and device for command line terminal, computer readable medium and equipment
CN113781608A (en) Animation editing method and device
CN113342450A (en) Page processing method and device, electronic equipment and computer readable medium
CN113806596B (en) Operation data management method and related device
CN111290683A (en) Method, device and equipment for visual application instantiation

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination