CN107844349B - Control method and device based on user interface - Google Patents

Control method and device based on user interface Download PDF

Info

Publication number
CN107844349B
CN107844349B CN201710974862.8A CN201710974862A CN107844349B CN 107844349 B CN107844349 B CN 107844349B CN 201710974862 A CN201710974862 A CN 201710974862A CN 107844349 B CN107844349 B CN 107844349B
Authority
CN
China
Prior art keywords
control
user interface
configuration parameters
request message
name
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.)
Active
Application number
CN201710974862.8A
Other languages
Chinese (zh)
Other versions
CN107844349A (en
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.)
Huzhou Yinglie Intellectual Property Operation Co ltd
Original Assignee
Taizhou Jiji Intellectual Property Operation 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 Taizhou Jiji Intellectual Property Operation Co ltd filed Critical Taizhou Jiji Intellectual Property Operation Co ltd
Priority to CN201710974862.8A priority Critical patent/CN107844349B/en
Publication of CN107844349A publication Critical patent/CN107844349A/en
Application granted granted Critical
Publication of CN107844349B publication Critical patent/CN107844349B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • G06F9/4451User profiles; Roaming

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The invention provides a control method and a device based on a user interface, wherein the method comprises the following steps: s100, acquiring a control file; the control file comprises control information of each control; the control information comprises a control type, a control ID, a control coordinate, a control name and a control configuration parameter; s200, generating a user interface according to the control information; s400, receiving a request message; s500, calling corresponding control configuration parameters according to the request message; s600, sending the control configuration parameters to a target address; the target address is the address of the request message. The invention realizes the addition of real-time parameter types, reduces the time for re-developing codes, shares the control configuration parameters in real time and saves the time cost of manual acquisition.

Description

Control method and device based on user interface
Technical Field
The present invention relates to the field of computer applications, and in particular, to a control method and apparatus based on a user interface.
Background
The test software is applied to a production line in a large scale and can realize the automatic production of products. Compared with other software, the testing software has a remarkable characteristic that different technical parameters are required to be configured for different products. The configuration of the technical parameters is an important link in the production process of products. However, since different products need to set different types of technical parameters, a solution for flexibly adding configuration items needs to be designed.
Currently, CN201410453727.5, a graphical user interface dynamic generation method, has similarities in the interface dynamic generation technology. However, it only discusses how to record, store and regenerate the coordinates, attributes and action response modes of the interface elements, and does not dynamically acquire a new interface element number in real time, which causes a problem that after a user interface is generated, when a new interface element needs to be changed or a boundary element needs to be adjusted in a later stage, a new user interface needs to be newly developed and generated, and development and maintenance costs are high. In addition, configuration parameters cannot be effectively acquired to realize control in the prior art, and only manual acquisition is needed, so that the efficiency is low.
Disclosure of Invention
The invention aims to provide a control method and a control device based on a user interface, which are used for reducing development and maintenance cost and realizing the purpose of automatic control.
The technical scheme provided by the invention is as follows:
the invention provides a control method based on a user interface, which comprises the following steps: s100, acquiring a control file; the control file comprises control information of each control; the control information comprises a control type, a control ID, a control coordinate, a control name and a control configuration parameter; s200, generating a user interface according to the control information; s400, receiving a request message; s500, calling corresponding control configuration parameters according to the request message; s600, sending the control configuration parameters to a target address; the target address is the address of the request message.
Further, the step S100 includes the steps of: s010 obtains the control information; and S020 storing the control information according to an XML format to obtain the control file.
Further, the step S010 includes the steps of: s011, acquiring the control type; s012, detecting whether the control type accords with a preset control type; if yes, go to step S013; s013 generates the control ID; s014 acquiring the control coordinates, the control name and the control configuration parameters; the preset control type comprises any one or more of a static text control, an edit box control, a radio control, a drop-down list control, a button control and a TAB control.
Further, the step S200 includes the steps of: s210, analyzing the control file to obtain the control information; s220, generating a corresponding control according to the control type, the control ID and the control name; s230, controlling the layout of the control on the interface according to the control coordinate; s240, initializing the control according to the control configuration parameters, and generating the user interface.
Further, after the step S200, before the step S400, the method includes the steps of: s310, acquiring an XML character string in the control file; s320, generating a relational expression of the control name and the control configuration parameters according to the XML character string; the step S500 includes the steps of: s510, calling corresponding control configuration parameters according to the request message and the relational expression; the request message includes a control name requested for use.
The invention also provides a control device based on the user interface, which comprises: the first acquisition module is used for acquiring the control file; the control file comprises control information of each control; the control information comprises a control type, a control ID, a control coordinate, a control name and a control configuration parameter; the first generation module generates a user interface according to the control information; a receiving module for receiving the request message; the calling module calls the corresponding control configuration parameters according to the request message; the sending module is used for sending the control configuration parameters to a target address; the target address is the address of the request message.
Further, the method also comprises the following steps: the second acquisition module is used for acquiring the control information; and the storage module is used for storing the control information according to an XML format to obtain the control file.
Further, the second obtaining module includes: the first acquisition unit is used for acquiring the control type; the detection unit is used for detecting whether the control type accords with a preset control type; the first generation unit is used for generating the control ID when the detection unit detects that the control type accords with the preset control type; the second acquisition unit is used for acquiring the control coordinates, the control name and the control configuration parameters; the preset control type comprises any one or more of a static text control, an edit box control, a radio control, a drop-down list control, a button control and a TAB control.
Further, the generating module includes: the analysis unit is used for analyzing the control file to obtain the control information; the second generation unit generates a corresponding control according to the control type, the control ID and the control name; the control unit controls the layout of the control on the interface according to the control coordinates; and the third generation unit initializes the control according to the control configuration parameters and generates the user interface.
Further, the method also comprises the following steps: the second acquisition module is used for acquiring the XML character string in the control file; the second generation module generates a relational expression of the control name and the control configuration parameters according to the XML character string; the calling module is also used for calling corresponding control configuration parameters according to the request message and the relational expression; the request message includes a control name requested for use.
The control method and the control device based on the user interface can bring at least one of the following beneficial effects:
1) the invention realizes the dynamic configuration of the user interface, reduces the time for redeveloping the software code and saves manpower and material resources.
2) The method and the device can call the obtained control configuration parameters in real time, so that the equipment requesting to obtain the control configuration parameters for running can call the control configuration parameters in time, and the working efficiency is improved.
3) The invention reduces the interface development cost and improves the use flexibility of the user interface.
4) The method and the device have the advantages that the control function is dynamically and visually displayed in real time, the use convenience of a user is improved, and the use experience of the user is improved.
5) The invention can realize the addition of real-time parameter types, also increases the real-time sharing of the parameters and the equipment or the module which sends the request message, reduces the time for re-developing the code and saves the development cost.
Drawings
The above features, technical features, advantages and implementations of a user interface based control method and apparatus will be further described in the following detailed description of preferred embodiments in a clearly understandable manner, in conjunction with the accompanying drawings.
FIG. 1 is a flow chart of one embodiment of a user interface based control method of the present invention;
FIG. 2 is a flow chart of another embodiment of a user interface based control method of the present invention;
FIG. 3 is a flow chart of another embodiment of a user interface based control method of the present invention;
FIG. 4 is a schematic diagram of an embodiment of a user interface based control apparatus of the present invention;
FIG. 5 is a flow chart of one example of a user interface based control method of the present invention;
FIG. 6 is a flow chart of another example of a user interface based control method of the present invention;
FIG. 7 is a flow chart of another example of a user interface based control method of the present invention;
FIG. 8 is a flow chart of another example of a user interface based control method of the present invention;
FIG. 9 is a flow chart of another example of a user interface based control method of the present invention;
FIG. 10 is a code diagram of another example of a user interface based control method of the present invention;
FIG. 11 is an interface diagram of another example of a user interface based control method of the present invention.
Detailed Description
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following description will be made with reference to the accompanying drawings. It is obvious that the drawings in the following description are only some examples of the invention, and that for a person skilled in the art, other drawings and embodiments can be derived from them without inventive effort.
For the sake of simplicity, the drawings only schematically show the parts relevant to the present invention, and they do not represent the actual structure as a product. In addition, in order to make the drawings concise and understandable, components having the same structure or function in some of the drawings are only schematically illustrated or only labeled. In this document, "one" means not only "only one" but also a case of "more than one".
One embodiment of a control method based on a user interface according to the present invention is shown in fig. 1, and includes:
s100, acquiring a control file; the control file comprises control information of each control; the control information comprises a control type, a control ID, a control coordinate, a control name and a control configuration parameter;
s200, generating a user interface according to the control information;
s400, receiving a request message;
s500, calling corresponding control configuration parameters according to the request message;
s600, sending the control configuration parameters to a target address; the target address is the address of the request message.
Specifically, in this embodiment, because the design and implementation of the user interface are very important in the test software, if a new function is added, the corresponding user interface of the function must be added synchronously, but if an interface similar to the previous function is added, the work is repeated, the work efficiency is reduced, a large amount of human and material resources are wasted, and the maintenance is difficult. The invention generates the user interface by acquiring the control file, the control file can be the control file obtained according to the control information initially set by the user or the adjustment information obtained after the adjustment by the later-stage user according to the requirements, the adjustment content can be any one or the combination of a plurality of control types, control coordinates, control IDs, control names or control configuration parameters, if the control information is newly added or changed, the new user interface can be regenerated according to the adjusted control information to replace the original user interface, the code rewriting by developers is not needed, the development time is reduced, the generation and updating speed of the user interface is improved, the control efficiency is improved, and the control configuration parameters can be timely called by the equipment requesting to acquire the control configuration parameters for operation work due to the fact that the called control configuration parameters can be real-timely, the work efficiency is improved.
Another embodiment of a control method based on a user interface according to the present invention, as shown in fig. 2, includes:
s010 obtains the control information;
s020 storing the control information according to an XML format to obtain the control file;
s100, acquiring a control file; the control file comprises control information of each control; the control information comprises a control type, a control ID, a control coordinate, a control name and a control configuration parameter;
s200, generating a user interface according to the control information;
s400, receiving a request message;
s500, calling corresponding control configuration parameters according to the request message;
s600, sending the control configuration parameters to a target address; the target address is the address of the request message.
Specifically, in this embodiment, an abbreviation of xml (extentsiblemarkup language) extensible markup language is a meta language used to define other languages. XML is a subset of the Standard Generalized Markup Language (SGML), well suited for Web transport, and provides a uniform way to describe and exchange structured data that is independent of the application or vendor. Because the XML format is used for storing the control information to obtain the control file, the obstacle of inherent data can be reduced, the application system can access all data in the same mode, the searching is quicker and more efficient, the comparison and the collection of the data are more convenient, the data can be gradually modified without being greatly adjusted, the most important is that the transmission of repeated data can be reduced, and the use efficiency of a network system is enhanced.
Another embodiment of a control method based on a user interface according to the present invention, as shown in fig. 3, includes:
s011, acquiring the control type;
s012, detecting whether the control type accords with a preset control type; if yes, go to step S013;
s013 generates the control ID;
s014 acquiring the control coordinates, the control name and the control configuration parameters;
s020 storing the control information according to an XML format to obtain the control file;
specifically, in this embodiment, the control type is selected by the user, the control type must conform to the preset control type, the preset control type includes any one or more of a static text control, an edit box control, a single selection control, a drop-down list control, a button control, and a TAB control, and if the control type is legal, the control ID is dynamically generated. The control ID is the identification of the control identity, the controls of the same type in the same dialog box resource are sequentially increased from small to large according to natural numbers, and a user needs to appoint or preset control coordinates, control names and control configuration parameters, and all control information is generated into character strings in an XML format and stored. The coordinates are the abscissa X, the ordinate Y of the control relative to the upper left corner of the rectangular design area, and the width and height of the control. The control name is the name of the control, which will be defined by the system as the variable name later. The control configuration parameter is a data attribute of the control and is the purpose of creating the control, and the control configuration parameter is defined as a variable container value by the system later. The invention generates all the information of the control into a character string in an XML format and stores the character string in the control file, thereby reducing the transmission of repeated data and strengthening the use efficiency of a network system.
S100, acquiring a control file; the control file comprises control information of each control; the control information comprises a control type, a control ID, a control coordinate, a control name and a control configuration parameter;
s210, analyzing the control file to obtain the control information;
s220, generating a corresponding control according to the control type, the control ID and the control name;
s230, controlling the layout of the control on the interface according to the control coordinate;
s240, initializing the control according to the control configuration parameters to generate the user interface;
specifically, in this embodiment, different control coordinates can be selected according to business requirements or test requirements to perform interface layout, a common control is laid out at a position where the interface is conspicuous, and since the control file describes the control type, the control name, the control ID, and the control configuration parameters, the interface layout does not need to be debugged again, so that the interface development efficiency is improved, and the design difficulty of the user interface is reduced. In addition, if the user adds a function of the user interface, but the added function is similar to the function of the original user interface, the user interface may only need to slightly add some controls; or if the user adjusts the coordinates of a certain control in the user interface, the work is repeated if interface program codes are rewritten, the work efficiency is reduced, a large amount of manpower and material resources are wasted, and the maintenance is difficult. The method and the device can regenerate a new user interface according to the adjusted control information to replace the original user interface no matter the control information is newly added or changed, developers do not need to rewrite codes, development time is reduced, the generation and updating speed of the user interface is increased, and control efficiency is improved. In the process of supporting the use of the user interface, the user interface is changed according to the requirements of the user, the code of the user interface can be repeatedly used, and the control information is defined and set to generate the control file in the subsequent project, so that the interface development cost is reduced, and the use flexibility of the user interface is improved.
S310, acquiring an XML character string in the control file;
s320, generating a relational expression of the control name and the control configuration parameters according to the XML character string;
s400, receiving a request message;
s510, calling corresponding control configuration parameters according to the request message and the relational expression; the request message comprises a control name requested to be used;
s600, sending the control configuration parameters to a target address; the target address is the address of the request message.
Specifically, in the embodiment, the control information of each control is automatically analyzed and recorded, the control file is automatically loaded, all control information of the user interface originally dispersed in the program code is concentrated in an XML character string, unified management on the control is facilitated, and the risk of recompiling and acting during interface change and modification is reduced. Firstly, loading a control file, calculating the total number of controls, and then sequentially judging whether the parameters of each control are legal. And if the data is legal, analyzing the XML character string. The character string contains the control name and the control configuration parameter, and we need to translate the XML character string into an expression, for example:
<Edit name="ComPort"id="1"left="100"top="10"right="200"bottom="22"value="3"/Edit>
the translation into an expression is: $ ComPort ═ 3 ";
the expression is then handed to the manager for processing, the manager defines a variable container (e.g. map < string > m _ vTable), and we correspondingly pack the left and right sides of the expression into the container, which is equivalent to establishing a set of correspondence table of variable names and variable values. The process actually completes the conversion from the expression to the variable container, so that after the expression is converted into the variable container, when a terminal or a module corresponding to a target address for sending the request message requests to use the control configuration parameters, the manager can feed back the corresponding variable value to the equipment or the module for sending the request message, thereby realizing the real-time access of other modules of the system to data, increasing the real-time sharing function of the parameters and the equipment or the module for sending the request message, and improving the control efficiency.
One embodiment of a user interface based control apparatus 100 of the present invention, as shown in fig. 4, includes:
a first obtaining module 110, which obtains a control file; the control file comprises control information of each control; the control information comprises a control type, a control ID, a control coordinate, a control name and a control configuration parameter;
the first generation module 120 generates a user interface according to the control information;
a receiving module 130 for receiving the request message;
the calling module 140 calls the corresponding control configuration parameters according to the request message;
the sending module 150 sends the control configuration parameters to a target address; the target address is the address of the request message.
Specifically, in this embodiment, a corresponding user interface is generated according to the control file, and the corresponding control is displayed on the user interface, so that a real-time dynamic visual display control function is realized, the convenience of use of the user is improved, and the use experience of the user is improved.
The device embodiment corresponding to the method embodiment has the same effects as the method embodiment, and details are not repeated herein, and the effects of the method embodiment are specifically described.
Another embodiment of a control device based on a user interface according to the present invention is a preferred embodiment of the previous embodiment, and the other parts are the same as the previous embodiment, and includes: the device comprises a first acquisition module, a first generation module, a receiving module, a calling module and a sending module.
In addition, the method further comprises the following steps:
the second acquisition module is used for acquiring the control information;
and the storage module is used for storing the control information according to an XML format to obtain the control file.
Specifically, this embodiment is a device embodiment corresponding to the method embodiment, and the effects thereof are the same as the method embodiment, and are not described herein again, specifically, the effects of the method embodiment are described in detail.
Preferably, the second obtaining module includes:
the first acquisition unit is used for acquiring the control type;
the detection unit is used for detecting whether the control type accords with a preset control type;
the first generation unit is used for generating the control ID when the detection unit detects that the control type accords with the preset control type;
the second acquisition unit is used for acquiring the control coordinates, the control name and the control configuration parameters;
the preset control type comprises any one or more of a static text control, an edit box control, a radio control, a drop-down list control, a button control and a TAB control.
Specifically, this embodiment is a device embodiment corresponding to the method embodiment, and the effects thereof are the same as the method embodiment, and are not described herein again, specifically, the effects of the method embodiment are described in detail.
Preferably, the generating module includes:
the analysis unit is used for analyzing the control file to obtain the control information;
the second generation unit generates a corresponding control according to the control type, the control ID and the control name;
the control unit controls the layout of the control on the interface according to the control coordinates;
and the third generation unit initializes the control according to the control configuration parameters and generates the user interface.
Specifically, this embodiment is a device embodiment corresponding to the method embodiment, and the effects thereof are the same as the method embodiment, and are not described herein again, specifically, the effects of the method embodiment are described in detail.
Preferably, the method further comprises the following steps:
the second acquisition module is used for acquiring the XML character string in the control file;
the second generation module generates a relational expression of the control name and the control configuration parameters according to the XML character string;
the calling module is also used for calling corresponding control configuration parameters according to the request message and the relational expression; the request message includes a control name requested for use.
Specifically, this embodiment is a device embodiment corresponding to the method embodiment, and the effects thereof are the same as the method embodiment, and are not described herein again, specifically, the effects of the method embodiment are described in detail.
An example of a control method based on a user interface according to the present invention, as shown in fig. 5, includes:
s10, defining a control and storing information;
s20, redrawing the control;
s30, defining a variable container and assigning values;
and S40, the module uses the control configuration parameters in real time.
Specifically, in this example, the control customizer is used to define control information, which includes a control type, a control ID, control coordinates, a control name, and control configuration parameters, and store the control information as a control file in an XML format. A control customizer is a software module that defines the kind of control, and the information necessary for a certain type of control. Types of controls include static text controls, edit box controls, radio controls, drop down list controls, button controls, TAB controls, and the like. Each control has some information representing its own characteristics, such as control ID, control coordinates, control name (used later as variable name), control configuration parameters (used later as variable values). We specify that each control is collocated with a control file, and the title of the control file is consistent with the name of its corresponding control, which is for convenience to see the use of each control. In addition, a special symbol is added to the head or tail of the control name, such as "$", to serve as the control name corresponding to the control, and clear guidance is provided for subsequent calling. The information representing the control features is stored in an XML format to facilitate recall. And dynamically redrawing and configuring a user interface according to the stored control file, namely, redrawing the interface once due to each time of information storage, wherein the redrawing of the interface is realized by a redrawing module for analyzing the control file, dynamically creating a control according to the type, the ID and the name of the control defined by the file, then laying out the control according to the control coordinate defined by the control file, and finally initializing the default value of each control according to the configuration parameters of the control. The method comprises the steps of generating variable names for all the controls according to names, assigning values to variable containers according to control configuration parameters, namely defining the corresponding relation between the variable names and variable values by the control names and the control configuration parameters in control files, and if the variable names and the variable values are expressed by expressions, defining a variable container in advance, wherein the variable container can be a two-dimensional array but not limited to a two-dimensional array and is used for storing the variable names and the variable values. The manager is a software module for calculating and accessing variables, which acts between the expression and the variable container, and is a conversion device of the expression and the variables. And sending a request message to access and call the control configuration parameters, namely sending the request message by other modules, acquiring the control configuration parameters in real time by virtue of a manager, and converting the control configuration parameters into the required data type. The method comprises the steps of defining control types, control IDs, control coordinates, control names and control configuration parameters by using a control customizer, storing the information into a control file in an XML format, dynamically redrawing a configuration user interface according to the stored control file, generating variable containers for the controls according to the names, assigning values to the variable containers according to the control configuration parameters, and accessing the variable containers to call the control configuration parameters.
An example of a control method based on a user interface according to the present invention is shown in fig. 6, and includes:
s11, detecting whether the control type designed by the user is legal; if yes, go to step S12; otherwise, return to step S11;
s12, creating a control ID;
s13, specifying control coordinates, control names and control configuration parameters;
s14, detecting whether the control coordinates, the control name and the control configuration parameters are legal or not; if yes, go to step S15;
and S15, generating the XML format character string.
Specifically, the present example is the specific step of the above example S10, S1: the control customizer is used to define the type, ID, coordinates, control name (variable name), control configuration parameters of the control, and store these information as XML formatted files.
The type of control is selected by the user and must be one of a static text control, an edit box control, a radio control, a drop down list control, a button control, a TAB control, etc. If the control type is legal, then the control ID is dynamically generated. The control ID is the identification of the control identity, and the controls of the same type in the same dialog box resource are sequentially increased from small to large according to the natural number. And (3) the user specifies coordinates, control names and control configuration parameters, and all control information is generated into character strings in an XML format and stored. The coordinates are the abscissa X, the ordinate Y of the control relative to the upper left corner of the rectangular design area, and the width and height of the control. The control name is the name of the control, which will be defined by the system as the variable name later. The control configuration parameters are data attributes of the control, and are the purpose of creating the control, and all the information of the control is generated into a character string in an XML format and is stored in a control file.
A legal XML string is given as follows:
<Edit name="ComPort"id="1"left="100"top="10"right="200"bottom="22"value="3"/Edit>
the above string defines that the control type is "Edit" (Edit box control), its name is Comport (port number-a configuration name that is common in the testing arts), the control ID is 1, the coordinates are in the upper left corner (100, 10), the length is 200, the height is 22, and its control configuration parameter is 3.
An example of a control method based on a user interface according to the present invention is shown in fig. 7, and includes:
s21, loading a control file;
s22, detecting whether the control file is legal; if yes, go to step S23;
s23, analyzing the XML character string in the control file;
s24, creating a control;
s25, layout control;
s26, initializing the control according to the control parameter;
s27, judging whether drawing is finished or not; if yes, go to step S28; otherwise, return to step S23;
and S28, refreshing and displaying the interface.
Specifically, this example is the specific step of the above example S20, that is, the configuration user interface is dynamically redrawn according to the stored XML data information, that is, the control file is loaded first, the XML data information is adjusted to obtain a new control file, whether the file parameter of the new control file is legal is determined, then the information of each control is sequentially analyzed, the control and the layout are dynamically created according to the type, name, ID, and coordinate of the control, data is initialized for the control according to the data attribute, and finally, the adjusted configuration user interface is displayed.
An example of a control method based on a user interface according to the present invention is shown in fig. 8, and includes:
s31, loading a control file;
s32, detecting whether the control file is legal; if yes, go to step S33;
s33, analyzing the XML character string in the control file, and converting and generating an expression according to the XML character string;
s34, storing the expression into a variable container;
s35, judging whether the storage is finished; if yes, go to step S36; otherwise, return to step S33;
and S36, finishing the conversion storage process.
Specifically, in this example, the specific step of the above example S30 is to generate a variable container for each control according to a name, assign a value to the variable container according to the control configuration parameter, load the control file first, calculate the total number of controls, and then sequentially determine whether the parameter of each control is legal. And if the data is legal, analyzing the XML character string. The character string contains the control name and the control configuration parameter, and we need to translate the XML character string into an expression, for example:
<Edit name="ComPort"id="1"left="100"top="10"right="200"bottom="22"value="3"/Edit>
the translation into an expression is: $ ComPort ═ 3 ";
the expression is then handed to the manager for processing, the manager defines a variable container (e.g. map < string > m _ vTable), and we correspondingly pack the left and right sides of the expression into the variable container, which is equivalent to establishing a set of correspondence table of variable names and variable values. This process in essence completes a large turn of the expression into a variable container.
An example of a control method based on a user interface according to the present invention is shown in fig. 9, and includes:
s41, receiving a request message;
s42, judging whether to allow the request message; if yes, go to step S43; otherwise, go to step S41;
s43, calling corresponding control configuration parameters;
and S44, sending the corresponding control configuration parameters to the equipment or module sending the request message.
Specifically, in this example, which is a specific step of the above example S40, other modules of the system access the variable container to call the control configuration parameter. After the expression is transferred into the variable container, when the device or module sending the request message requests to use the control configuration parameters, the manager can feed back the corresponding control configuration parameters to the target address according to the corresponding relation of the expression, so that the device or module sending the request message corresponding to the target address can access the data in real time. As shown in fig. 10, which is a user-defined XML file, and the software configuration interface generated according to the XML file is shown in fig. 11, it can be seen that the software configuration interface generated according to the code of fig. 10, where reference numerals 1-6 in fig. 10 correspond to the controls generated in fig. 11, respectively, includes:
note1 configures dialog box size:
the dialog box name is defined as Config, 500 wide and 320 high.
Note2TabCtrl size:
a TabCtrl control is arranged in the definition dialog box, coordinates (10, 10) at the upper left corner, width 470, height 200, and parameter Visible ═ 1.
Note3 paginated titles:
the title is defined as "first page", and the ID is 0.
Note4 static text control:
the definition name is ComPort, ID is 1, coordinates (10, 13) in the upper left corner, width is 100, and height is 22.
Note5 edit box control:
the definition name is ComPort, ID is 1, coordinates (100, 10) in the upper left corner, width is 200, height is 22, and data is 3.
Note6 radio button control:
the name PowerSupply (whether programmable power is used or not) is defined, ID is 1, coordinates at the top left corner (10, 100), width 100, height 22, and data is 0.
The invention realizes flexible addition and adjustment of test software configuration items through one-time coding, applies control configuration parameters to the test software in real time, avoids continuous development work caused by requirement change, realizes adjustment of parameters represented by interface elements, and then records, stores and shares the parameters to other components of the test software in real time. The invention can realize the addition of real-time parameter types, also increases the real-time sharing of the parameters and the equipment or the module which sends the request message, reduces the time for re-developing the code and saves the development cost.
It should be noted that the above embodiments can be freely combined as necessary. The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.

Claims (8)

1. A control method based on a user interface is characterized by comprising the following steps:
s100, acquiring a control file; the control file comprises control information of each control; the control information comprises a control type, a control ID, a control coordinate, a control name and a control configuration parameter;
s200, generating a user interface according to the control information;
s400, receiving a request message;
s500, calling corresponding control configuration parameters according to the request message;
s600, sending the control configuration parameters to a target address; the target address is an address for sending the request message;
wherein: after step S200, before step S400, the method includes the steps of:
s310, acquiring an XML character string in the control file;
s320, generating a relational expression of the control name and the control configuration parameters according to the XML character string;
the step S500 includes the steps of:
s510, calling corresponding control configuration parameters according to the request message and the relational expression; the request message includes a control name requested for use.
2. The user interface-based control method according to claim 1, wherein the step S100 comprises the steps of:
s010 obtains the control information;
and S020 storing the control information according to an XML format to obtain the control file.
3. The user interface-based control method according to claim 2, wherein the step S010 comprises the steps of:
s011, acquiring the control type;
s012, detecting whether the control type accords with a preset control type; if yes, go to step S013;
s013 generates the control ID;
s014 acquiring the control coordinates, the control name and the control configuration parameters;
the preset control type comprises any one or more of a static text control, an edit box control, a radio selection control, a drop-down list control, a button control and a TAB control.
4. The user interface-based control method according to claim 1, wherein the step S200 comprises the steps of:
s210, analyzing the control file to obtain the control information;
s220, generating a corresponding control according to the control type, the control ID and the control name;
s230, controlling the layout of the control on the interface according to the control coordinate;
s240, initializing the control according to the control configuration parameters, and generating the user interface.
5. A user interface based control apparatus, comprising:
the first acquisition module is used for acquiring the control file; the control file comprises control information of each control; the control information comprises a control type, a control ID, a control coordinate, a control name and a control configuration parameter;
the first generation module generates a user interface according to the control information;
a receiving module for receiving the request message;
the calling module calls the corresponding control configuration parameters according to the request message;
the sending module is used for sending the control configuration parameters to a target address; the target address is an address for sending the request message; the second acquisition module is used for acquiring the XML character string in the control file;
the second generation module generates a relational expression of the control name and the control configuration parameters according to the XML character string;
the calling module is also used for calling corresponding control configuration parameters according to the request message and the relational expression; the request message includes a control name requested for use.
6. The user interface-based control device of claim 5, further comprising:
the second acquisition module is used for acquiring the control information;
and the storage module is used for storing the control information according to an XML format to obtain the control file.
7. The user interface-based control device of claim 6, wherein the second obtaining module comprises:
the first acquisition unit is used for acquiring the control type;
the detection unit is used for detecting whether the control type accords with a preset control type;
the first generation unit is used for generating the control ID when the detection unit detects that the control type accords with the preset control type;
and the second acquisition unit is used for acquiring the control coordinates, the control name and the control configuration parameters.
8. The user interface-based control device of claim 5, wherein the generating module comprises:
the analysis unit is used for analyzing the control file to obtain the control information;
the second generation unit generates a corresponding control according to the control type, the control ID and the control name;
the control unit controls the layout of the control on the interface according to the control coordinates;
and the third generation unit initializes the control according to the control configuration parameters and generates the user interface.
CN201710974862.8A 2017-10-19 2017-10-19 Control method and device based on user interface Active CN107844349B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710974862.8A CN107844349B (en) 2017-10-19 2017-10-19 Control method and device based on user interface

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710974862.8A CN107844349B (en) 2017-10-19 2017-10-19 Control method and device based on user interface

Publications (2)

Publication Number Publication Date
CN107844349A CN107844349A (en) 2018-03-27
CN107844349B true CN107844349B (en) 2021-06-04

Family

ID=61661479

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710974862.8A Active CN107844349B (en) 2017-10-19 2017-10-19 Control method and device based on user interface

Country Status (1)

Country Link
CN (1) CN107844349B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109002390B (en) * 2018-06-25 2021-07-27 天维讯达(北京)科技有限公司 Test case parameter dynamic configuration method and device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101251800A (en) * 2008-04-01 2008-08-27 北京中星微电子有限公司 Graphical user interface creating method and apparatus
CN102110143A (en) * 2011-02-09 2011-06-29 浪潮集团山东通用软件有限公司 Assembly facing various controls in desktop application program
CN103176802A (en) * 2013-03-29 2013-06-26 厦门亿联网络技术股份有限公司 Method of achieving separation of user interface UI of system and control library through control pool

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101251800A (en) * 2008-04-01 2008-08-27 北京中星微电子有限公司 Graphical user interface creating method and apparatus
CN102110143A (en) * 2011-02-09 2011-06-29 浪潮集团山东通用软件有限公司 Assembly facing various controls in desktop application program
CN103176802A (en) * 2013-03-29 2013-06-26 厦门亿联网络技术股份有限公司 Method of achieving separation of user interface UI of system and control library through control pool

Also Published As

Publication number Publication date
CN107844349A (en) 2018-03-27

Similar Documents

Publication Publication Date Title
US11443110B2 (en) Editable table in a spreadsheet integrated with a web service
CN102739770B (en) Method and system for scheduling resource based on cloud computing
US7165073B2 (en) Dynamic, hierarchical data exchange system
CN101271475B (en) Commercial intelligent system
US6215502B1 (en) Method and apparatus for automatically reconfiguring graphical objects relative to new graphical layouts
CN106021617A (en) Page generation method and device
US10635408B2 (en) Method and apparatus for enabling agile development of services in cloud computing and traditional environments
US8140590B2 (en) Dynamic generation of user interfaces and automated mapping of input data for service-oriented architecture-based system management applications
CN110705237B (en) Automatic document generation method, data processing device and storage medium
US9514115B2 (en) Method for creating form validation program and corresponding form interface according to result set metadata
US20050267789A1 (en) Portal generation for industry specific business roles
US10338894B2 (en) Generating applications based on data definition language (DDL) query view and application page template
CN111784108B (en) Modeling method and device of main data management platform
US20070033570A1 (en) Method and system for transforming a process flow
US20010037228A1 (en) System and method for using metadata to flexibly analyze data
CN104798067A (en) Web server system, dictionary system, dictionary call method, screen control display method, and demonstration application generation method
US8140977B2 (en) Hosted data visualization service
US7434227B2 (en) Portable business information content and management system
CN107844349B (en) Control method and device based on user interface
CN101714080A (en) Method and system for realizing web multiple language control
US20070094289A1 (en) Dynamic, hierarchical data exchange system
CN114756228A (en) Page processing method, device, equipment and storage medium
CN114281463B (en) Form interface format configuration and interface display method, device and medium
CN111858595B (en) Dynamic configuration method and system for electric power engineering examination record table
Somi User Interface Development of a Modern Web Application

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
TA01 Transfer of patent application right

Effective date of registration: 20201104

Address after: 318015 no.2-3167, zone a, Nonggang City, no.2388, Donghuan Avenue, Hongjia street, Jiaojiang District, Taizhou City, Zhejiang Province

Applicant after: Taizhou Jiji Intellectual Property Operation Co.,Ltd.

Address before: 201616 Shanghai city Songjiang District Sixian Road No. 3666

Applicant before: Phicomm (Shanghai) Co.,Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20231227

Address after: 313000 room 1019, Xintiandi commercial office, Yishan street, Wuxing District, Huzhou, Zhejiang, China

Patentee after: Huzhou YingLie Intellectual Property Operation Co.,Ltd.

Address before: 318015 no.2-3167, area a, nonggangcheng, 2388 Donghuan Avenue, Hongjia street, Jiaojiang District, Taizhou City, Zhejiang Province

Patentee before: Taizhou Jiji Intellectual Property Operation Co.,Ltd.

TR01 Transfer of patent right