CN112860257A - Visual programming method based on static interface - Google Patents

Visual programming method based on static interface Download PDF

Info

Publication number
CN112860257A
CN112860257A CN202110252805.5A CN202110252805A CN112860257A CN 112860257 A CN112860257 A CN 112860257A CN 202110252805 A CN202110252805 A CN 202110252805A CN 112860257 A CN112860257 A CN 112860257A
Authority
CN
China
Prior art keywords
execution unit
interface
control information
configuration file
control
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
CN202110252805.5A
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.)
Zhejiang Hongcheng Technology Co ltd
Original Assignee
Zhejiang Hongcheng 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 Zhejiang Hongcheng Technology Co ltd filed Critical Zhejiang Hongcheng Technology Co ltd
Priority to CN202110252805.5A priority Critical patent/CN112860257A/en
Publication of CN112860257A publication Critical patent/CN112860257A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/36Software reuse

Abstract

The invention provides a visual programming method based on a static interface, which comprises the following steps: analyzing an interface design drawing file, constructing a control information base, configuring parameters of an execution unit, generating a configuration file of the execution unit, matching a code template base according to the configuration file of the execution unit, reversely acquiring dependent parameters from the configuration file of the execution unit from a matched code template in the code template base, and instantiating the code template according to the dependent parameters to generate codes. The invention can reduce the workload of code compiling, reduce code errors and improve the working efficiency.

Description

Visual programming method based on static interface
Technical Field
The invention relates to the technical field of computer software, in particular to a visual programming method based on a static interface.
Technical Field
In the software development process, an artist draws a software interface according to requirements, a front-end developer utilizes a graphical user interface designer to realize the interface according to software interface drawing draft, the interface cannot respond to a user click command at the moment, codes need to be written to realize functions corresponding to the clicked controls, a large amount of time is spent on realizing execution functions corresponding to the controls in the interface development, the workload is large, errors are prone to occurring, how to improve the code reuse rate is achieved, the workload of the developer is reduced, and the improvement of the development efficiency is the focus of technicians in the field.
Disclosure of Invention
In view of the above, the present invention provides a method for visual programming based on a static interface.
Specifically, the method is realized through the following technical scheme:
analyzing the interface design drawing file, extracting control information from the interface design drawing file according to a control feature library to generate a corresponding native control information item, and storing the native control information item into a control information library;
configuring sub-function parameters of the execution function according to a trigger condition by taking the native control information item as a trigger source of the execution function, and collecting all the sub-function parameters to form configuration parameters of an execution unit;
generating an execution unit configuration file according to the execution unit configuration parameters, wherein the execution unit configuration file and the corresponding hash value are stored in an execution unit configuration file library;
and matching a code template library according to the execution unit configuration file, reversely acquiring a dependent parameter from the execution unit configuration file by the matched code template, and instantiating the code template according to the dependent parameter to generate a code.
Preferably, the control feature items in the control feature library include: a graphical interface designer type, a graphical interface designer version number, a control type, a control version number, and a property name.
Preferably, extracting control information uses text matching extraction.
Preferably, extracting the control information uses regular expression matching extraction.
Preferably, extracting control information uses XPath lookup extraction based on XML format.
Further, the control information base also comprises a user-defined control information item.
Further, the native control information items may have the same or different configuration parameters of the execution unit according to different trigger conditions.
Further, a secure hash algorithm is used for calculating the hash value of the execution unit configuration file, and when the same hash value exists in the execution unit configuration file library, the hash value reference count is increased, and the execution unit configuration file is not saved.
Further, a file may be directly selected from the execution unit profile library according to the trigger condition.
Further, when the dependency parameter is not obtained from the execution unit configuration file, a default value in the code template is adopted.
The method for visual programming based on the static interface provided by the invention has the advantages that the interface design drawing file is used as a visual programming inlet from an output file of a previous procedure in application software development, templatized reconstruction codes are provided, so that developers can configure parameters required by the number of executing functions on the visual interface, the software development operation flow is standardized, the code reuse rate is improved, the workload of the developers is reduced, and the working efficiency is effectively improved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the principles of the invention and not to limit the invention.
FIG. 1 is an overall flow diagram of a method for visual programming based on a static interface;
FIG. 2 is an execution unit subfunction diagram of an embodiment of a method of static interface-based visual programming;
FIG. 3 is a diagram of a login interface design diagram file based on an embodiment of a method for static interface visualization programming;
FIG. 4 is a sub-function parameter configuration diagram of an embodiment of a method for static interface based visual programming.
DETAILED DESCRIPTION OF EMBODIMENT (S) OF INVENTION
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It will be understood that when an element is referred to as being "secured to" another element, it can be directly on the other element or intervening elements may also be present. When a component is referred to as being "connected" to another component, it can be directly connected to the other component or intervening components may also be present. When a component is referred to as being "disposed on" another component, it can be directly on the other component or intervening components may also be present. The terms "vertical," "horizontal," "left," "right," and the like as used herein are for illustrative purposes only.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. The terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used herein, the term "and/or" includes any and all combinations of one or more of the associated listed items.
The interface function implementation depends on data input, data processing and data result presentation. When the data information in the interface design drawing file can meet the data processing requirement, the data processing is divided according to subfunctions on the basis, the parameter source depended by the subfunctions is bound to the control selected by the user in a visual interface mode, and the required dependent parameters can be obtained from the interface.
Referring to fig. 1, an overall flowchart of a method for static interface-based visual programming according to this embodiment is shown in fig. 1, where the method for static interface-based visual programming may include the following steps:
and S100, analyzing the interface design drawing file and constructing a control information base.
The interface design drawing file at least comprises one control, various information contained in the control, such as interface type, interface instance name, control type, control instance name, attribute and the like, a method for obtaining the control value can be known according to the control type, and specific instances in the controls of the same type can be distinguished according to the control instance name. Constructing a control feature library, wherein feature values comprise: graphical interface designer type, graphical interface designer version number, control type, control version number, attribute name, and the like. And extracting control information from the interface design drawing file according to the control feature library.
Illustratively, the drop-down box control provides a drop-down list for a user to select, provides a method for obtaining a current selection item to obtain a value of the current selection item, such as a qcombox drop-down box control in Qt, and provides a currentText method to obtain a value of the current selection item; and C #, wherein the ComboBox drop-down box control provides a Text method to obtain the current associated value.
Illustratively, the text input box control provides an input box for a user to input data, and provides a method for acquiring current data, such as a QLineEdit text input box control in Qt, and provides a text method for acquiring current input data; and a textView text input box control in the Android provides a getText method to obtain current input data.
Further, the specific control information is extracted, and file matching and regular expression matching can be adopted. If the instance name of the QCombobox drop-down box control is matched, the following regular expression is adopted:
<widget class="QComboBox" name="[:text:]+">
furthermore, based on the interface design drawing file in the XML format, XPath can be adopted to extract information.
In the embodiment of the present application, as shown in fig. 3, an interface design drawing file of a user login interface is provided, the user login interface provides an interface entry for a user to log in a remote system, the remote system verifies a user name and a password submitted by the user and feeds back a verification result, and the user login interface simultaneously provides a local configuration option function, such as a function of "remembering a password", to avoid repeatedly inputting a user name and a password.
And analyzing the interface design drawing file according to the control feature library, establishing a corresponding native control information item for each control, and storing the native control information item into the control information library.
Furthermore, when the native control information item cannot meet the requirement, a user-defined control information item can be added into the control information base, and if verification succeeds, the user-defined control information item jumps to a new interface, and the user-defined control information item related to the jump control can be added.
And S200, configuring control execution unit parameters.
In one example, a user interacts with an application program through a visual interface to obtain an expected result, and the application program performs corresponding data processing and then presents the result to the user, for example, clicking a login button control to enter an application system, clicking a refresh button control to obtain a data list, clicking a delete button control to delete a data item, and the like.
The control receives trigger actions such as single click, double click, keyboard input and the like as a driving source of an execution function, corresponding functions are executed by taking one trigger action as an integral unit, one execution unit function is realized by a plurality of sub-functions, such as network connection establishment, local configuration storage, data sending and the like, and the plurality of sub-functions form a processing flow of the execution unit function.
As shown in fig. 2, the sub-functions of the embodiment of the present application are divided into network connection, protocol negotiation, encoding and decoding, persistent storage, data acquisition, data transmission, data monitoring, and feedback.
In the embodiment of the present application, as shown in fig. 4, the sub-function configuration parameters are provided in a visual interface manner:
in the embodiment of the application, a network connection subfunction configuration interface provides a network address drop-down box control and a connection protocol drop-down box control, the network address drop-down box control displays the control instance names in the control information base, the corresponding control instance names are selected from the network address drop-down box control for network address binding, the connection protocol drop-down box control provides a connection protocol option, and a corresponding default port is obtained according to the connection protocol option.
Illustratively, the network address may be in the form of a domain name, an IP address, a LOOPBACK address.
In the embodiment of the present application, the protocol negotiation subfunction configuration interface provides a protocol drop-down box control, the protocol drop-down box control displays protocol names, such as a TCP protocol, an HTTP protocol, an XMPP protocol, and the like, and a corresponding protocol is selected from the protocol drop-down box control.
In the embodiment of the application, the data acquisition subfunction configuration interface provides a data item drop-down box control, an add button control, and a data encoding drop-down box control, the data item drop-down box control displays the control instance name in the control information base, the add button control is responsible for adding the currently selected control instance name in the data item drop-down box control to a data sending list, and the data encoding drop-down box control displays an encoding mode, such as JSON, URLCODE, FORMDATA, and the like, which represents a mode of encoding data corresponding to the control instance name in the data sending list.
In the embodiment of the application, the login interface sends the user name and the password to the server for login verification, so that the control instance name corresponding to the user name and the password is selected from the data item drop-down box control, and the add button control is clicked.
In the embodiment of the application, the data coding mode adopts a JSON format.
In the embodiment of the application, the persistent storage configuration interface provides a local configuration item drop-down box control and an addition button control, the local configuration item drop-down box control displays a control instance name in the control information base, and the addition button control is responsible for adding the control instance name currently selected by the local configuration item drop-down box control to a local configuration data list.
Illustratively, all editable controls on the interface can be saved locally, and when the software is started again, the last interface state can be quickly recovered, so that the user experience is enhanced.
In this embodiment of the present application, the control instance name corresponding to the user name and the password is selected from the local configuration item drop-down box control.
In the embodiment of the application, a feedback item control, a feedback item value control, a mapping target drop-down box control and a mapping target behavior drop-down box control are provided in the feedback configuration interface. The feedback item control inputs keywords of the remote system feedback data to be monitored, the feedback item value control inputs a value corresponding to the keywords of the feedback data, the mapping target drop-down box control displays a control instance name in the control information base, and the mapping target behavior drop-down box control displays a behavior corresponding to the control instance name currently selected by the mapping target drop-down box control.
Illustratively, the feedback action is one or more than: updating, skipping and prompting.
In this embodiment of the application, the remote system feedback item is a verification result verify _ result, when the verification result verify _ result is an integer value other than 0, authentication is successful, and when the verification result verify _ result is an integer value other than 0, authentication is failed, so verify _ result is input in the feedback item control, 1 is input in the feedback item value control, an interface control is selected in the mapping target drop-down box control, and the mapping target behavior is selected to jump in the drop-down box control, that is, after the remote system verifies a successful feedback result, the login interface jumps to other interfaces, such as a program main interface.
And S300, constructing an execution unit configuration file.
And after configuring the configuration parameters of the execution unit, storing the configuration parameters in an XML file format, wherein each subfunction is used as a configuration node, corresponding parameter values are stored in the configuration nodes, and XML file contents are formed by the configuration nodes.
In the embodiment of the application, a login request is sent to a server through an HTTP/2.0 protocol, and the generated content of the network connection configuration node comprises a server address, a server port number, a protocol type and an authentication mode. The node contents are as follows:
<NetWork>
< PeerAddr > localhost </PeerAddr >// network address
< Protocol > HTTP/2.0</Protocol >// Protocol type
< PeerPort >80</port >// port number
< AuthType > Basic </AuthType >// authentication mode
</NetWork>
In one example, after the network is established, data needs to be sent to the server for interaction, such as user identity information verification, a sending request, and the like, where the sending data may be encoded or sent directly.
Illustratively, the configuration node contents of the data transfer sub-function may be as follows:
<UploadData>
encoding mode/json encoding mode
< data > { username: zjhckjpat, passswd: abc123456} </data >// data content
</UploadData>
In the embodiment of the application, the next action is performed through a server feedback result $ { verify _ result }, the feedback result is divided into a zero value and a non-zero value, two monitoring items need to be configured, a prompt action is performed when the feedback result is 0, and a next interface is skipped to execute a skip action when the feedback result is non-0, namely, the program main interface is entered. The configuration content is as follows:
<Monitor>
< MonitorItem >// monitoring item
< key > verify _ result </key >// monitor item keyword
< value > 0/monitoring item standard value
< Widget type QMESSAGEBOx </Widget type >// perform action
<WidgetInstName>hintbox</WidgetInstName>
<WidgetMethod>ShowHintMessage</WidgetMethod>
< Widget entries > Wrong username Or Pasdwd </Widget entries >/error prompt
</MonitorItem>
<MonitorItem>
<key>verify_result</key>
<value>1</0>
<WidgetType>QDialog</WidgetType>
<WidgetInstName>logindialog</WidgetInstName>
<WidgetMethod>JumNewWidget</WidgetMethod>
<WidgetArgs></WidgetArgs>
</MonitorItem>
</Monitor>
And calculating the generated execution unit configuration file by adopting a secure hash algorithm, and storing a calculation result hash value and the execution unit configuration file into an execution unit configuration file library. Files can be directly selected from the execution unit configuration file library according to the trigger condition, and repeated configuration is avoided.
Furthermore, when the same hash value exists in the execution unit configuration file library, only the hash value is increased to obtain reference count, and the hash value is not stored in the execution unit configuration file any more, so that the storage space is saved, and the retrieval efficiency is improved.
Further, the trigger behaviors of a plurality of controls may be associated with the same execution unit configuration file, and the trigger behavior of the same control may be associated with different execution unit configuration files.
S400, instantiating the code template to generate the code.
And matching a code template library according to the execution unit configuration file, wherein the matched code template reversely acquires corresponding parameter values from the execution unit configuration file according to the required dependent parameters, substitutes the corresponding parameter values and instantiates the code template to generate a code.
It should be noted that the adoption of the reverse acquisition mode can reduce the coupling degree between the code template and the configuration file of the execution unit, and reduce the complexity of code development.
In one example, a default value in the code template is employed when the dependent parameter is not obtained from the execution unit profile.
In the embodiment of the application, the login interface sends a user name and a password to the server through the network for verification, firstly, network connection is established, a network connection code template is found through the code template library, the network connection code template establishes a socket according to a protocol type $ { protocol }, and then connection is established to the server according to a remote address $ { address } and a remote port $ { port }, wherein the code template is as follows:
Socket *s=new Socket(${protocol});
S->connect(${address},${port});
substituting the dependent parameters in the configuration parameters of the execution unit on the basis of the network connection code template, wherein the dependent parameters, such as protocol LE, address LE and port LE, are control instance names, instantiating the network connection code template to generate the following executable codes:
Socket *s=new Socket(protocolLE->getText());
S->Connect(addressLE->getText(), portLE->getText);
it is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The embodiments of the present invention have been described in detail, but the present invention is only the preferred embodiments of the present invention, and is not to be considered as limiting the scope of the present invention. All equivalent changes and modifications made within the scope of the present invention should be covered by the present patent.

Claims (8)

1. A method for providing an interface design drawing file based on a static interface visual programming, wherein the interface design drawing file is a text file generated by a graphical user interface designer tool and contains control information for forming an interface, and the method comprises the following steps:
analyzing the interface design drawing file, extracting control information from the interface design drawing file according to a control feature library to generate a corresponding native control information item, and storing the native control information item into a control information library;
configuring sub-function parameters of the execution function according to a trigger condition by taking the native control information item as a trigger source of the execution function, and collecting all the sub-function parameters to form configuration parameters of an execution unit;
generating an execution unit configuration file according to the execution unit configuration parameters, wherein the execution unit configuration file and the corresponding hash value are stored in an execution unit configuration file library;
and matching a code template library according to the execution unit configuration file, reversely acquiring a dependent parameter from the execution unit configuration file by the matched code template, and instantiating the code template according to the dependent parameter to generate a code.
2. The method for visual programming based on a static interface according to claim 1, wherein the characteristics of the control characteristic library comprise: a graphical interface designer type, a graphical interface designer version number, a control type, a control version number, and a property name.
3. The method for visual programming based on a static interface according to claim 1, wherein the method for extracting control information comprises: text matching extraction, regular expression matching extraction, XPath searching extraction based on XML format.
4. The method for visual programming based on a static interface according to claim 1, wherein the control information base further comprises: and self-defining the control information item.
5. The method of claim 1, wherein the native control information items may have the same or different configuration parameters of the execution units according to different trigger conditions.
6. The method for visual programming based on a static interface according to claim 1, further comprising: and calculating the hash value of the configuration file of the execution unit by adopting a secure hash algorithm, and increasing the reference count of the hash value when the same hash value exists in the configuration file library of the execution unit, so that the configuration file of the execution unit is not saved any more.
7. The method for visual programming based on a static interface according to claim 1, further comprising: files can be directly selected from the execution unit configuration file library according to the trigger condition.
8. The method of claim 1, wherein the step of obtaining the dependent parameters from the configuration parameters of the execution unit comprises: when the dependent parameter does not exist, adopting a default value in the code template.
CN202110252805.5A 2021-03-09 2021-03-09 Visual programming method based on static interface Pending CN112860257A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110252805.5A CN112860257A (en) 2021-03-09 2021-03-09 Visual programming method based on static interface

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110252805.5A CN112860257A (en) 2021-03-09 2021-03-09 Visual programming method based on static interface

Publications (1)

Publication Number Publication Date
CN112860257A true CN112860257A (en) 2021-05-28

Family

ID=75994841

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110252805.5A Pending CN112860257A (en) 2021-03-09 2021-03-09 Visual programming method based on static interface

Country Status (1)

Country Link
CN (1) CN112860257A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113656012A (en) * 2021-08-17 2021-11-16 广州新科佳都科技有限公司 Low code development system of rail transit visual interface
CN115048097A (en) * 2022-08-15 2022-09-13 湖南云畅网络科技有限公司 Front-end unified packaging compiling system and method for low codes

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101334728A (en) * 2008-07-28 2008-12-31 北京航空航天大学 Interface creating method and platform based on XML document description
US20190361940A1 (en) * 2018-05-24 2019-11-28 People.ai, Inc. Systems and methods for generating group node profiles based on member nodes
CN111142861A (en) * 2019-12-17 2020-05-12 西安电子科技大学 Method and device for integrating structured comprehensive control system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101334728A (en) * 2008-07-28 2008-12-31 北京航空航天大学 Interface creating method and platform based on XML document description
US20190361940A1 (en) * 2018-05-24 2019-11-28 People.ai, Inc. Systems and methods for generating group node profiles based on member nodes
CN111142861A (en) * 2019-12-17 2020-05-12 西安电子科技大学 Method and device for integrating structured comprehensive control system

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113656012A (en) * 2021-08-17 2021-11-16 广州新科佳都科技有限公司 Low code development system of rail transit visual interface
CN115048097A (en) * 2022-08-15 2022-09-13 湖南云畅网络科技有限公司 Front-end unified packaging compiling system and method for low codes
CN115048097B (en) * 2022-08-15 2022-10-28 湖南云畅网络科技有限公司 Front-end unified packaging compiling system and method for low codes

Similar Documents

Publication Publication Date Title
US7676478B2 (en) Data warehousing systems and methods having reusable user transforms
US8869111B2 (en) Method and system for generating test cases for a software application
CN110914818A (en) Dataflow graph configuration
US8744980B2 (en) Systems and methods for analysis of network equipment command line interface (CLI) and runtime management of user interface (UI) generation for same
CN112860257A (en) Visual programming method based on static interface
US11531914B2 (en) Artificial intelligence (AI) based automatic rule generation
US8386608B1 (en) Service scripting framework
CN106897153B (en) Method and system for calling application programming interface
US20220147498A1 (en) Generation of schemas with error resolve
CN108229182B (en) Method and system for verifying picture configuration by using information isomorphism
US7028172B2 (en) Method and system for obtaining computer shutdown information
CN101170568A (en) A method for automatically generating and executing Telnet command via batch mode
CN113590123A (en) WPF interface switching method and device, computer equipment and storage medium
CN112861059A (en) Visual component generation method and device, computer equipment and readable storage medium
US7917904B2 (en) Automated analysis tasks of complex computer system
JP6866270B2 (en) SQL statement extraction device, SQL statement extraction method and program
CN111399830B (en) Application program capacity monitoring method and device, electronic equipment and storage medium
CN114389936A (en) Cross-cloud multi-cluster deployment operation and maintenance method, system, processor and storage medium
CN114253531A (en) Micro-service publishing system
JP5668492B2 (en) Data processing apparatus, computer program, and data processing method
CN112199219A (en) Cross-language operation remote calling method
CN108228161B (en) System and method for extending structured command line
WO2022137647A1 (en) Information processing device, information processing system, and user interface providing method
JP2018190219A (en) Software specification analyzer and software specification analytical method
CN115543524B (en) User interface management method and system for administrative management system

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