CN116560781A - User interface generation method, device, equipment and storage medium - Google Patents

User interface generation method, device, equipment and storage medium Download PDF

Info

Publication number
CN116560781A
CN116560781A CN202310650590.1A CN202310650590A CN116560781A CN 116560781 A CN116560781 A CN 116560781A CN 202310650590 A CN202310650590 A CN 202310650590A CN 116560781 A CN116560781 A CN 116560781A
Authority
CN
China
Prior art keywords
request
data
character string
awtk
user interface
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
CN202310650590.1A
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.)
Hangzhou Lianji Technology Co ltd
Original Assignee
Hangzhou Lianji 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 Hangzhou Lianji Technology Co ltd filed Critical Hangzhou Lianji Technology Co ltd
Priority to CN202310650590.1A priority Critical patent/CN116560781A/en
Publication of CN116560781A publication Critical patent/CN116560781A/en
Pending legal-status Critical Current

Links

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/451Execution arrangements for user interfaces
    • 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

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application relates to the field of image user interfaces and provides a user interface generation method, device, equipment and storage medium. The method comprises the following steps: acquiring a general request signal for generating a user interface, wherein the general request signal comprises an AWTK control identifier; acquiring a first request character string corresponding to an AWTK control identifier of the universal request signal; according to the marking information in the first request character string, carrying out data updating on the first request character string to generate a second request character string; and acquiring a corresponding response structure and binding information according to the character string identification of the first request character string, and updating a control of the user interface through an AWTK interface according to the response structure and the binding information so as to generate the user interface. The method and the device can dynamically update the control of the user interface by adopting a universal model instance and combining the corresponding relation between the data and the AWTK control identification based on the universal request signal.

Description

User interface generation method, device, equipment and storage medium
Technical Field
The present disclosure relates to the field of image user interfaces, and in particular, to a method, an apparatus, a device, and a storage medium for generating a user interface.
Background
In order to be able to adapt to different algorithm plug-ins when remotely configuring a network camera, XML (english, which is called Extensible Markup Language in full, chinese, which is called extensible markup language) data description UIs are generally used. And generating a corresponding UI by analyzing the XML data, generating a request, and analyzing response data of the equipment.
Since the NVR (english is called Network Video Recorder, chinese is called network video recorder) has more restrictions, in order to facilitate implementation of the NVR end, the design is considered if the restrictions based on the AWTK (Toolkit AnyWhere) support of XML page loading. The design requires that each end can analyze XML realized based on the specification, generate UI, generate request and analyze response and bind data, and needs to adapt to the conditions of unknown data types and quantity, complex response data structure and uncertain names of interaction methods.
The model entity is generated and bound, so that the problems of data binding and interactive binding can be well solved. However, AWTK does not support interface generation nor generation of model instances. The AWTK requires that the names and types of the binding and the bound data are known, so that the corresponding model is bound in advance, and the model is registered when the AWTK is initialized. Therefore, the XML specification based on AWTK can not realize data binding by generating model instances, and can not effectively dynamically update the controls of the user interface.
Disclosure of Invention
In view of this, the embodiments of the present application provide a method, an apparatus, a device, and a storage medium for generating a user interface, so as to solve the problem that in the prior art, the XML specification based on AWTK cannot implement data binding by generating a model instance, and cannot effectively dynamically update a control of the user interface.
A first aspect of an embodiment of the present application provides a method for generating a user interface, where the method is implemented based on a Qt platform embedded with AWTK, and the method includes:
acquiring a general request signal for generating a user interface, wherein the general request signal comprises an AWTK control identifier;
acquiring a first request character string corresponding to an AWTK control identifier of the universal request signal;
according to the marking information in the first request character string, carrying out data updating on the first request character string to generate a second request character string;
and acquiring equipment response data according to the second request character string, acquiring a corresponding response structure and binding information according to the character string identification of the first request character string, and updating a control of a user interface through an AWTK interface according to the equipment response data, the response structure and the binding information to generate the user interface.
With reference to the first aspect, in a first possible implementation manner of the first aspect, updating, through an AWTK interface, a control of a user interface according to the device response data, the response structure, and the binding information includes:
determining a response field corresponding to the first request character string in the equipment response data according to the binding information;
determining the data type of the response field according to the response structure, and converting the response field into the data of the data type;
and searching a corresponding control according to the binding information, and calling an AWTK interface to update the data to the control.
With reference to the first aspect, in a second possible implementation manner of the first aspect, the string identifier includes a request name, the device response data is obtained according to the second request string, and the corresponding response structure and binding information are obtained according to the string identifier of the first request string, including:
the second request character string is sent to the equipment end, and equipment response data returned by the equipment end are obtained;
and determining a response structure and binding information corresponding to the response data according to the request name in the first request character string.
With reference to the first aspect, in a third possible implementation manner of the first aspect, obtaining a generic request signal for generating a user interface includes:
detecting triggering information of a control through an AWTK management module;
and calling a signal management module to register and generate the universal request signal by the AWTK management module according to the trigger information.
With reference to the first aspect, in a fourth possible implementation manner of the first aspect, acquiring a first request string corresponding to the AWTK control identifier of the universal request signal includes:
the request and response management module sends a request for acquiring the character string to the XML analysis module according to the AWTK control identifier of the general request signal;
and the XML analysis module receives the request, searches a first request character string corresponding to the AWTK control identifier according to a preset binding relation, and sends the first request character string to the request and response management module.
With reference to the first aspect, in a fifth possible implementation manner of the first aspect, the generating a second request string by performing data update on the first request string includes:
determining data to be processed and data to be used in the first request character string according to the marking information included in the first request character string;
and replacing the data to be processed with the data to be used to generate a second request character string.
With reference to the first aspect, in a sixth possible implementation manner of the first aspect, determining, according to tag information included in the first request string, data to be processed and data to be used in the first request string includes:
determining the data in the marking information as data to be processed;
and acquiring a control identifier corresponding to the data name of the data to be processed, and acquiring the data to be used corresponding to the data to be processed according to the control identifier.
A second aspect of embodiments of the present application provides a generating device for a user interface, where the device includes:
the general request signal generation unit is used for obtaining a general request signal for generating a user interface, wherein the general request signal comprises an AWTK control identifier;
the first request character string acquisition unit is used for acquiring a first request character string corresponding to the AWTK control identifier of the universal request signal;
a second request character string generating unit, configured to perform data update on the first request character string according to the tag information in the first request character string, and generate a second request character string;
the user interface generating unit is used for acquiring equipment response data according to the second request character string, acquiring a corresponding response structure and binding information according to the character string identification of the first request character string, and updating a control of the user interface according to the equipment response data, the response structure and the binding information to generate the user interface.
A third aspect of embodiments of the present application provides a user interface generating device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the steps of the method according to any one of the first aspects when the computer program is executed.
A fourth aspect of the embodiments of the present application provides a computer-readable storage medium storing a computer program which, when executed by a processor, implements the steps of the method according to any one of the first aspects.
Compared with the prior art, the embodiment of the application has the beneficial effects that: according to the method, the device and the system, the universal request signal for generating the user interface is obtained, the AWTK control identification is included in the universal request signal, the corresponding first request character string can be obtained based on the AWTK control identification, data replacement is conducted on the first request character string according to the marking information in the first request character string, the second request character string capable of analyzing control data is generated, equipment response data is obtained based on the second request character string, corresponding response structure and binding information are obtained according to the first request character string, the control of the user interface is updated through the AWTK interface, and therefore the method, based on the universal request signal, a universal model instance is adopted, and dynamic updating of the control of the user interface is achieved by combining the corresponding relation between the data and the AWTK control identification.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required for the embodiments or the description of the prior art will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic implementation flow chart of a method for generating a user interface according to an embodiment of the present application;
FIG. 2 is a block diagram of a system for generating a user interface according to an embodiment of the present application;
FIG. 3 is a schematic diagram of an interaction flow of a method for generating a user interface according to an embodiment of the present application;
FIG. 4 is a schematic diagram of a generating device of a user interface according to an embodiment of the present application;
fig. 5 is a schematic diagram of a generating device for a user interface according to an embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system configurations, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
In order to illustrate the technical solutions described in the present application, the following description is made by specific examples.
When the network camera is configured remotely, in order to adapt to different algorithm plugins, the problem that each end develops a UI (Chinese is called User Interface fully), so that the plugins are blocked in test is avoided, and XML (English is called Extensible Markup Language fully, chinese is called extensible markup language) data are usually adopted to describe the UI. And generating a corresponding UI by analyzing the XML data, generating a request, and analyzing response data of the equipment.
Since NVR (english is called Network Video Recorder, chinese is called network video recorder) has a lot of restrictions, in order to facilitate implementation of NVR end, the specification of XML will be designed based on the restriction that AWTK (english is called Toolkit AnyWhere) supports loading of XML pages. The design requires that each end can analyze XML realized based on the specification, generate UI, generate request and analyze response and bind data, and needs to solve the adaptation problems of unknown data types and quantity, complex response data structure and uncertain names of interaction methods.
XML can be converted into UI by Qt (a cross-platform C++ development library, mainly used for developing graphical user interface programs). By creating the interface element tree in the form of a Map container. By recursively parsing the XML document, each time an interface element is encountered, it is instantiated and added to the element tree, and the properties of the element continue to be parsed to set the interface element of the UI.
Since Qt does not provide XML parsing function, if the UI is generated by Qt, it is necessary to parse XML by itself. The essence of parsing XML is text matching of XML, namely matching of control type and XML label, qt control object and control name, control attribute and XML attribute node. The realization of text matching fills a large number of condition judgment in codes, and the maintainability and the expandability are poor. And the Qt control (control described based on Qt) may be incompatible with other controls described by specifications (such as AWTK control), and a set of controls needs to be re-implemented to meet the requirements of the specifications, so that the workload is high. In addition, when generating the UI based on Qt, the prior art does not relate to the realization of the part because of the need of realizing data binding and interaction binding, and the difficulty of realizing the generation of the user interface is large.
AWTK (English is called Toolkit AnyWhere, is a set of GUI framework developed based on C language), supports the direct conversion of XML data conforming to the AWTK specification into pages and display, supports MVVM (Model-View Model) mode, and realizes the functions of data binding, command binding and the like. However, the AWTK specification requires that the corresponding model instance be implemented in advance for data binding, which requires that the name, number and type of variables used for binding be deterministic, as are the method names and numbers of interactions.
The model entity is generated and bound, so that the problems of data binding and interactive binding can be well solved. However, AWTK does not support interface generation nor generation of model instances. The AWTK requires that the names and types of the binding and the bound data are known, so that the corresponding model is bound in advance, and the model is registered when the AWTK is initialized. Therefore, the XML specification based on AWTK can not realize data binding by generating model instances, and can not effectively dynamically update the controls of the user interface.
In order to solve the above problems, the embodiment of the application provides a method for generating a user interface, which embeds an AWTK into a Qt platform, and directly generates a UI by using the AWTK on the basis of the AWTK-MVVM (a MVVM framework developed by a set of C language and specially optimized for the embedded platform) by using a request as a core, binding a control identifier with data, the request and a response respectively.
Fig. 1 is a schematic block diagram of a system for generating a user interface according to an embodiment of the present application. The system for generating the user interface comprises an XML analysis module, an AWTK management module, a signal management module and a request and response management module.
The XML analysis module can read and write XML through a 'QtXML' library of the Qt platform, and can be used for: preprocessing, request and response management and node recording are carried out on the data of the UI recorded in the XML.
In implementing the preprocessing operation, it may include:
1) Data specification conversion. The AWTK specification is not fully compliant because XML data needs to be considered vue specification. The XML data is made to conform to the AWTK specification by data specification conversion.
2) The general method is replaced. The method name used to bind the button or control is replaced with a generic method name.
As described above, AWTK-MVVM requires that a model be implemented in advance and that the corresponding method be defined in advance in the model. Only the method names defined in the model can be bound when generating the UI. The number and names of methods in XML are unknown.
To solve this problem, consider that the methods defined in the specification are all send requests, and that one control can bind only one method. Thus, the present application employs a generic approach for binding. The generic method may be used to send a generic request signal with a control identification (which may include, for example, a control name, etc.) to a request and response management module. The request and response management module may find a corresponding request according to the control identifier.
3) And (5) binding relation records. And the binding relation between the control identification and the data and between the control identification and the request is recorded.
4) And (5) intercepting the XML file. The method is used for intercepting the processed UI part and storing the UI part in a new XML folder.
5) And (5) variable replacement. The value used to bind the control identification of the same variable is replaced with a predefined variable.
In implementing request and response management, it may include:
request management: can be used to convert XML data into a corresponding first request string and tag the data or fields that need to be processed. For example, the flag information "c { } c" indicates that a channel id needs to be added, and the flag information "p { } p" indicates that data of a control is bound.
For example, the content of the first request string is:
{"method":"set","record_control":{"c{chn_record}c":{"stream_type":"p{strea mtype}p","mode":"p{mode}p"}}}
the tag information included therein includes "c { } c" and "p { } p", indicating that a channel ID needs to be added to the field "chn_record", and "stream_type" indicating data to which the control is bound.
And response management, which is used for converting the response into a corresponding n-ary tree and recording the data types of the nodes.
When the node record is realized, each node can be recorded through an array, and the nodes can be segmented according to preset segmenters. For example, "" may be employed as a segmenter for segmenting each node.
The request and response management module is used for receiving the general request signal sent by the signal management module and sending a request to the equipment. The method can process the corresponding character strings according to the general request signals, generate requests and send the requests to the equipment, then analyze the json format data transmitted back by the equipment, and transmit the analysis results to the controls corresponding to the control identifications.
And the signal management module can realize single instance through the Qt signal and the slot mechanism. The signal management module may be used to manage the sending of the generic request signal and the binding of the generic request signal to the slot function. When the button or control of the binding general request is clicked or triggered, a general request signal is sent to the request and response management module through the signal management module.
The AWTK management module comprises a model instance based on AWTK-MVVM implementation and an AWTK management class.
The Model instance can be modified based on the AWTK-MVVM, and can be used for binding a general method with a control identifier and processing a synchronization problem when a plurality of controls bind the same data through a predefined variable.
AWTK management class: the AWTK interface can be used for packaging, providing an interface for setting or acquiring corresponding type values according to control identification, and providing an interface for loading animation display during request response.
Based on the generation system using the user interface, the universal model entity is realized in advance, so that the generation system can be used for processing the condition that a plurality of controls bind the same data and requesting the binding with the control identification. The XML analysis module can analyze, modify and split the downloaded XML and record the binding relation between the control identification (including control name) and the data, the request and the response respectively. The characteristics of the XML generation UI can be directly used for generating the UI by using the AWTK. When a request needs to be sent, the model entity sends a general request signal with a control identifier to a request and response management module, after the request and response management module receives the general request signal, the request and response management module finds corresponding request information according to the control identifier, obtains a corresponding control value according to a data binding relation recorded in the request information, and then generates a Json format request to be sent to equipment. After the equipment responds, the corresponding relation between the related control identification and the response field is obtained by the request and response management module according to the recorded binding relation, response data is analyzed according to the response data structure described by XML, and the data of the corresponding field is set to the control bound with the corresponding control identification.
Fig. 2 is a schematic implementation flow chart of a method for generating a user interface according to an embodiment of the present application, which is described in detail below:
in S201, a generic request signal is obtained to generate a user interface, the generic request signal comprising an AWTK control identity.
The general request signal in the embodiment of the application is a signal generated based on the Qt platform. The generic request signal may be used to connect to a slot function. Upon signal transmission, the connected slot function is called.
When the universal request signal is acquired, the AWTK management module can detect the trigger information of the control, and after the AWTK management module detects the trigger information, the AWTK management module invokes an interface provided by the signal management module to send a registration request to the signal management module. The signal management module generates and obtains a generic request signal based on the request.
The trigger information may include information that the control is active or triggered. The triggering means may include operations such as clicking, touching or long movements.
To facilitate the use of the generic method, the generic request signal employs a generic request method that can be used to implement in advance the model entity used to bind the method. The universal request signal carries a control identification which can be used for uniquely identifying the control. The control identification may include a unique identification such as a control name.
In S202, a first request string corresponding to the AWTK control identifier of the universal request signal is acquired.
After the signal management module obtains the universal request signal, the universal request signal may be sent to the request and response management module. After receiving the universal request signal, the request and response management module can parse the universal request signal to obtain a first request character string.
For example, the control identifier may be obtained by the request and response management module parsing the generic request signal. And sending the control identification to an XML analysis module, and obtaining a first request character string corresponding to the control according to a preset binding relation of the control identification.
Or the request and response management module can send the general request signal to the XML analysis module, the XML analysis module analyzes the general request signal to obtain the control mark, and the first request character string corresponding to the control is obtained according to the preset binding relation of the control mark.
For example, the XML parsing module searches for the first request string corresponding to the universal request signal as the setting request according to the control identifier, where the data included in the first request string is:
{"method":"set","record_control":{"c{chn_record}c":{"stream_type":"p{strea mtype}p","mode":"p{mode}p"}}}
in S203, the first request string is updated with data according to the tag information in the first request string, and a second request string is generated.
The request and response management module determines data or fields to be processed therein according to the tag information included in the first request string. For example, the flag information included in the first request string in S202 includes c { } c and p { } p, which respectively indicate that the channel ID needs to be added and data of a certain control is bound. The data to be processed includes "p { streamtype } p" and "c { chn_record } c". Where "c { chn_record } c" is a field requiring special processing (plus channel ID). And searching the data to be used corresponding to the marking information according to the data name, and replacing the data to be processed with the data to be used.
For example, when determining the data to be used according to the data name, the corresponding control identifier can be determined and searched according to the data name, and the corresponding data to be used can be searched according to the control identifier. And replacing the data to be used with the data to be processed, so that the first request character string can be updated.
Alternatively, the fields in the tag information may be processed according to a preset processing rule. For example, the channel ID processing may be performed by adding a channel ID to a field to which a channel ID is to be added according to a preset rule of change of the channel ID.
In S204, device response data is obtained according to the second request string, corresponding response structure and binding information are obtained according to the string identifier of the first request string, and the control of the user interface is updated through the AWTK interface according to the device response data, the response structure and the binding information, so as to generate the user interface.
The request and response management module may send the second request string to the device via the existing communication class after constructing the update second string module. After the request and response management module receives the device response data, the character string identifier of the first request character string, including, for example, a request name, is sent to the XML parsing module, a response structure and binding information corresponding to the request name are obtained, and control setting information in the response data is determined according to the response structure and the binding information.
Determining the setting information according to the response structure and the binding information may include:
and positioning a response field corresponding to the first request character string in the device response data according to the binding information, and acquiring a value (character type) corresponding to the response field.
And converting the value of the response field into data of a corresponding data type according to the data type of the response field of the response structure record.
And traversing the control name array which is recorded in the binding information and is bound with the data, and calling an AWTK interface to set the data to all the controls bound with the AWTK interface.
The specific process of processing the request to be sent during page loading according to the embodiment of the application can comprise the following steps: when the XML file is parsed, the requests that need to be sent at page loading are recorded by an array. After XML analysis is completed, traversing the array of the record request, sending the request and receiving the device response data corresponding to the request. After receiving the response data of all the requested devices, displaying the page again, and displaying the response data on the corresponding control.
For a combined request with a sequence, the specific process of processing the combined request can comprise: when the XML is analyzed, if the requests have a precedence relationship, the request name of a second request which needs to be sent immediately after the first request is recorded. And after the first request is responded, transmitting response data to the corresponding control, checking whether a second request needs to be transmitted, and if so, immediately transmitting the second request. If not, displaying the page.
In the embodiment of the application, the binding method of the AWTK control and the request can include: a general method is realized in a model instance, the parameter of the method is a control name, a single instance is realized based on a general request signal and a slot mechanism, AWTK data is transferred to a Qt module, and when a corresponding event is triggered by a module bound with a request, the method can send a signal with the control name through the single instance, and the signal is processed by a corresponding slot function in a request and response management module.
In addition, in the flow in the embodiment of the present application, in order to solve the problem that multiple controls bind the same data, a certain number of variables may be predefined in a model entity for integer type, boolean type and character type variables, and when the XML is parsed, the data names bound by multiple controls at the same time may be replaced by the variable names of these variables according to the data. Because the number of the controls in one page is limited, the application scenario that a plurality of controls bind the same variable is not common, so that excessive variables do not need to be declared, and the processing method is feasible.
Fig. 3 is an interaction flow schematic diagram of a method for generating a user interface according to an embodiment of the present application, which is described in detail below:
1. when the user clicks the button which is bound with the request, the AWTK management module calls the interface provided by the signal management module to register a general request signal with a control identifier.
2. The signal management module sends the signal to the request and response management module.
3. And after the request and response management module receives the universal request signal, acquiring a first request character string corresponding to the control identification from the XML analysis module according to the control identification.
A set request generated for XML parsing module parsing XML is as follows:
{"method":"set","record_control":{"c{chn_record}c":{"stream_type":"p{strea mtype}p","mode":"p{mode}p"}}}
4. the request and response module acquires a data name "p { streamtype } p" and a field "c { chn_record } c" requiring special processing (plus a channel ID) based on the tag information included in the first request string. The addition channel ID processing is performed on the field requiring special processing, for example, the field processed by the addition channel ID may be "chn1_record". According to the data name 'stream type', a corresponding control identifier can be acquired, corresponding data to be used is acquired by the corresponding control identifier, and then the data is replaced by corresponding content in the first request character string, so that a real second request character string is generated:
{"method":"set","record_control":{"chn1_record":{"stream_type":"main","mod e":"auto"}}}
5. and sending the constructed request character string to the equipment by utilizing the existing communication class.
6. After the response data of the equipment is obtained, the corresponding response structure and binding information are obtained from the analysis module through the request name.
Based on the response structure and the binding information, data for control updates may be determined, including:
and positioning the response field corresponding to the request name according to the binding information, and acquiring the corresponding value (character type) of the response field.
And converting the response field into data of a corresponding data type according to the data type of the response field of the response structure record.
And traversing the control name array which is recorded in the binding information and is bound with the data, and calling an AWTK interface to set the data to all the controls bound with the AWTK interface.
According to the method and the device, the request is used as a core, the data and the request are bound, the control does not need to be bound to a specific variable, the control value is obtained according to the control identification when the request is sent to replace the control value to generate a real request, and the response data is updated to the corresponding control according to the data binding relation when the data is responded, so that the user interface can be effectively generated.
It should be understood that the sequence number of each step in the foregoing embodiment does not mean that the execution sequence of each process should be determined by the function and the internal logic of each process, and should not limit the implementation process of the embodiment of the present application in any way.
Fig. 4 is a schematic diagram of a generating device for a user interface according to an embodiment of the present application, where the device includes:
a universal request signal generating unit 401, configured to obtain a universal request signal for generating a user interface, where the universal request signal includes an AWTK control identifier;
a first request string obtaining unit 402, configured to obtain a first request string corresponding to an AWTK control identifier of the universal request signal;
a second request string generating unit 403, configured to perform data update on the first request string according to the tag information in the first request string, and generate a second request string;
the user interface generating unit 404 is configured to obtain device response data according to the second request string, obtain a corresponding response structure and binding information according to the string identifier of the first request string, and update a control of the user interface through an AWTK interface according to the device response data, the response structure and the binding information to generate the user interface.
The user interface generating apparatus shown in fig. 4 corresponds to the user interface generating method shown in fig. 2.
Fig. 5 is a schematic diagram of a generating device for a user interface according to an embodiment of the present application. As shown in fig. 5, the generation device 5 of the user interface of this embodiment includes: a processor 50, a memory 51 and a computer program 52, such as a user interface generation program, stored in the memory 51 and executable on the processor 50. The processor 50, when executing the computer program 52, implements the steps of the various user interface generation method embodiments described above. Alternatively, the processor 50, when executing the computer program 52, performs the functions of the modules/units of the apparatus embodiments described above.
By way of example, the computer program 52 may be partitioned into one or more modules/units that are stored in the memory 51 and executed by the processor 50 to complete the present application. The one or more modules/units may be a series of computer program instruction segments capable of performing the specified functions describing the execution of the computer program 52 in the generating device 5 of the user interface.
The user interface generating device may include, but is not limited to, a processor 50, a memory 51. It will be appreciated by those skilled in the art that fig. 5 is merely an example of a user interface generating device 5 and does not constitute a limitation of the user interface generating device 5, and may include more or less components than illustrated, or may combine certain components, or different components, e.g., the user interface generating device may further include an input-output device, a network access device, a bus, etc.
The processor 50 may be a central processing unit (Central Processing Unit, CPU), but may also be other general purpose processors, digital general purpose request signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated CircUit, ASIC), field programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 51 may be an internal storage unit of the generating device 5 of the user interface, for example a hard disk or a memory of the generating device 5 of the user interface. The memory 51 may be an external storage device of the user interface generating device 5, for example, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card) or the like, which are provided in the user interface generating device 5. Further, the memory 51 may also comprise both an internal storage unit and an external storage device of the generating device 5 of the user interface. The memory 51 is used for storing the computer program and other programs and data required by the generating device of the user interface. The memory 51 may also be used to temporarily store data that has been output or is to be output.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of the functional units and modules is illustrated, and in practical application, the above-described functional distribution may be performed by different functional units and modules according to needs, i.e. the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-described functions. The functional units and modules in the embodiment may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit, where the integrated units may be implemented in a form of hardware or a form of a software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working process of the units and modules in the above system may refer to the corresponding process in the foregoing method embodiment, which is not described herein again.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and in part, not described or illustrated in any particular embodiment, reference is made to the related descriptions of other embodiments.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus/terminal device and method may be implemented in other manners. For example, the apparatus/terminal device embodiments described above are merely illustrative, e.g., the division of the modules or units is merely a logical function division, and there may be additional divisions in actual implementation, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection via interfaces, devices or units, which may be in electrical, mechanical or other forms.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated modules/units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. With such understanding, the present application implements all or part of the flow of the method of the above embodiments, and may also be implemented by hardware associated with computer program instructions, where the computer program may be stored on a computer readable storage medium, where the computer program, when executed by a processor, implements the steps of the method embodiments described above. Wherein the computer program comprises computer program code which may be in source code form, object code form, executable file or some intermediate form etc. The computer readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), an electrical carrier wave universal request signal, a telecommunications universal request signal, a software distribution medium, and so forth. It should be noted that the content of the computer readable medium can be appropriately increased or decreased according to the requirements of the jurisdiction's law and the patent practice, for example, in some jurisdictions, the computer readable medium does not include the electric carrier wave universal request signal and the telecommunication universal request signal according to the jurisdiction's law and the patent practice.
The above embodiments are only for illustrating the technical solution of the present application, and are not limiting; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present application, and are intended to be included in the scope of the present application.

Claims (10)

1. A method for generating a user interface, the method being implemented based on a Qt platform embedded in AWTK, the method comprising:
acquiring a general request signal for generating a user interface, wherein the general request signal comprises an AWTK control identifier;
acquiring a first request character string corresponding to an AWTK control identifier of the universal request signal;
according to the marking information in the first request character string, carrying out data updating on the first request character string to generate a second request character string;
and acquiring equipment response data according to the second request character string, acquiring a corresponding response structure and binding information according to the character string identification of the first request character string, and updating a control of a user interface through an AWTK interface according to the equipment response data, the response structure and the binding information to generate the user interface.
2. The method of claim 1, wherein updating the control of the user interface through the AWTK interface based on the device response data, the response structure, and the binding information comprises:
determining a response field corresponding to the first request character string in the equipment response data according to the binding information;
determining the data type of the response field according to the response structure, and converting the response field into the data of the data type;
and searching a corresponding control according to the binding information, and calling an AWTK interface to update the data to the control.
3. The method of claim 1, wherein the string identifier includes a request name, wherein obtaining device response data from the second request string, and wherein obtaining corresponding response structure and binding information from the string identifier of the first request string, comprises:
the second request character string is sent to the equipment end, and equipment response data returned by the equipment end are obtained;
and determining a response structure and binding information corresponding to the response data according to the request name in the first request character string.
4. The method of claim 1, wherein obtaining a generic request signal that generates a user interface comprises:
detecting triggering information of a control through an AWTK management module;
and calling a signal management module to register and generate the universal request signal by the AWTK management module according to the trigger information.
5. The method of claim 1, wherein obtaining the first request string corresponding to the AWTK control identification of the generic request signal comprises:
the request and response management module sends a request for acquiring the character string to the XML analysis module according to the AWTK control identifier of the general request signal;
and the XML analysis module receives the request, searches a first request character string corresponding to the AWTK control identifier according to a preset binding relation, and sends the first request character string to the request and response management module.
6. The method of claim 1, wherein the data updating the first request string to generate a second request string comprises:
determining data to be processed and data to be used in the first request character string according to the marking information included in the first request character string;
and replacing the data to be processed with the data to be used to generate a second request character string.
7. The method of claim 6, wherein determining the data to be processed and the data to be used in the first request string based on the tag information included in the first request string comprises:
determining the data in the marking information as data to be processed;
and acquiring a control identifier corresponding to the data name of the data to be processed, and acquiring the data to be used corresponding to the data to be processed according to the control identifier.
8. A generating apparatus of a user interface, wherein the apparatus is implemented based on a Qt platform embedded in AWTK, the apparatus comprising:
the general request signal generation unit is used for obtaining a general request signal for generating a user interface, wherein the general request signal comprises an AWTK control identifier;
the first request character string acquisition unit is used for acquiring a first request character string corresponding to the AWTK control identifier of the universal request signal;
a second request character string generating unit, configured to perform data update on the first request character string according to the tag information in the first request character string, and generate a second request character string;
the user interface generating unit is used for acquiring equipment response data according to the second request character string, acquiring a corresponding response structure and binding information according to the character string identification of the first request character string, and updating a control of the user interface according to the equipment response data, the response structure and the binding information to generate the user interface.
9. A user interface generating device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the method according to any of claims 1 to 7 when the computer program is executed.
10. A computer readable storage medium storing a computer program, characterized in that the computer program when executed by a processor implements the steps of the method according to any one of claims 1 to 7.
CN202310650590.1A 2023-06-02 2023-06-02 User interface generation method, device, equipment and storage medium Pending CN116560781A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310650590.1A CN116560781A (en) 2023-06-02 2023-06-02 User interface generation method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310650590.1A CN116560781A (en) 2023-06-02 2023-06-02 User interface generation method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116560781A true CN116560781A (en) 2023-08-08

Family

ID=87498221

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310650590.1A Pending CN116560781A (en) 2023-06-02 2023-06-02 User interface generation method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116560781A (en)

Similar Documents

Publication Publication Date Title
CN111428462B (en) Communication protocol template construction method and terminal equipment
US10942708B2 (en) Generating web API specification from online documentation
CN108495192B (en) Page editing processing method and device
CN109918055B (en) Application program generation method and device
US8745641B1 (en) Automatic verification and anomaly detection in a representational state transfer (REST) application programming interface
US7739693B2 (en) Generic application program interface for native drivers
US20190188006A1 (en) Adapter configuration
US20130054812A1 (en) System and method for dynamically assembling an application on a client device
AU2021212135A1 (en) Building and managing data-processing attributes for modelled data sources
CN111061643B (en) SDK cluster compatibility detection method and device, electronic equipment and storage medium
CN113900958A (en) Test case script generation method, system, medium and electronic device
CN112230892B (en) Fault management method based on extensible markup language
CN113238740A (en) Code generation method, code generation device, storage medium, and electronic apparatus
CN114528269A (en) Method, electronic device and computer program product for processing data
CN108694172B (en) Information output method and device
CN116560781A (en) User interface generation method, device, equipment and storage medium
CN113407932B (en) Channel identifier reporting method, system and storage medium
CN115640279A (en) Method and device for constructing data blood relationship
CN114625373A (en) Application conversion method and device, electronic equipment and storage medium
CN114169318A (en) Process identification method, apparatus, device, medium, and program
CN114371982A (en) Simulation test method, device, equipment and readable storage medium
US11797293B2 (en) Relationship-apparent application artifact registration
CN109376023B (en) Method and equipment for generating calling information and issuing return code group
CN116610345B (en) Application program upgrading method and device based on execution record table
CN113987277A (en) Contract data processing method and device, electronic equipment and storage medium

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