CN116893811A - Processing method and device of man-machine interaction event, computer equipment and storage medium - Google Patents

Processing method and device of man-machine interaction event, computer equipment and storage medium Download PDF

Info

Publication number
CN116893811A
CN116893811A CN202310784119.1A CN202310784119A CN116893811A CN 116893811 A CN116893811 A CN 116893811A CN 202310784119 A CN202310784119 A CN 202310784119A CN 116893811 A CN116893811 A CN 116893811A
Authority
CN
China
Prior art keywords
man
machine interaction
event
text field
window
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
CN202310784119.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.)
Industrial Bank Co Ltd
CIB Fintech Services Shanghai Co Ltd
Original Assignee
Industrial Bank Co Ltd
CIB Fintech Services Shanghai 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 Industrial Bank Co Ltd, CIB Fintech Services Shanghai Co Ltd filed Critical Industrial Bank Co Ltd
Priority to CN202310784119.1A priority Critical patent/CN116893811A/en
Publication of CN116893811A publication Critical patent/CN116893811A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • 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
    • 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/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45504Abstract machines for programme code execution, e.g. Java virtual machine [JVM], interpreters, emulators
    • G06F9/45508Runtime interpretation or emulation, e g. emulator loops, bytecode interpretation
    • G06F9/45512Command shells
    • 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/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45504Abstract machines for programme code execution, e.g. Java virtual machine [JVM], interpreters, emulators
    • G06F9/45529Embedded in an application, e.g. JavaScript in a Web browser

Landscapes

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

Abstract

The application relates to a processing method, a processing device, computer equipment and a storage medium of a man-machine interaction event. The method comprises the following steps: acquiring an XML configuration file; analyzing the XML configuration file to obtain interface configuration information, each text field attribute and JavaScript; drawing a window interaction interface according to the interface configuration information; configuring text fields corresponding to the text field attributes in the window interactive interface according to the text field attributes; the text field is used for performing man-machine interaction; monitoring a human-computer interaction event through the text field, and determining a target processing function corresponding to the human-computer interaction event based on the JavaScript script; and processing the man-machine interaction event through the target processing function. The method can reduce the development threshold of the character interface.

Description

Processing method and device of man-machine interaction event, computer equipment and storage medium
Technical Field
The present application relates to the field of man-machine interaction technologies, and in particular, to a method, an apparatus, a computer device, and a storage medium for processing a man-machine interaction event.
Background
The character interface is widely applied to the field of man-machine interaction of interfaces due to the advantages of high operation speed, less occupied resources, safety, stability and the like.
However, since the character interface is generally generated based on the curses function, the corresponding development language is C language, so in the development process based on the character interface, a developer needs to master the programming of C language and the use of the curses function library, resulting in a higher development threshold of the character interface.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a method, an apparatus, a computer device, and a storage medium for processing a man-machine interaction event, which can reduce the development threshold of a character interface.
In a first aspect, the present application provides a method for processing a man-machine interaction event. The method comprises the following steps:
acquiring an XML configuration file;
analyzing the XML configuration file to obtain interface configuration information, each text field attribute and JavaScript;
drawing a window interaction interface according to the interface configuration information;
configuring text fields corresponding to the text field attributes in the window interactive interface according to the text field attributes; the text field is used for performing man-machine interaction;
Monitoring a human-computer interaction event through the text field, and determining a target processing function corresponding to the human-computer interaction event based on the JavaScript script;
and processing the man-machine interaction event through the target processing function.
In one embodiment, the parsing the XML configuration file to obtain interface configuration information, each text field attribute, and JavaScript script includes:
reading interface configuration information, each text field attribute and JavaScript script stored in the XML configuration file;
the method further comprises the steps of:
loading the interface configuration information and each text field attribute into a screen structure;
and acquiring the interface configuration information from the screen structure body so as to draw a window interaction interface according to the interface configuration information.
In one embodiment, the interface configuration information includes window style information and window configuration information, and the drawing the window interaction interface according to the interface configuration information includes:
determining a window style according to window style information stored in the screen structure;
and drawing the window interaction interface according to the window configuration information and the window style.
In one embodiment, the monitoring, by the text field, a human-computer interaction event, and determining, based on the JavaScript script, a target processing function corresponding to the human-computer interaction event includes:
when the man-machine interaction event is monitored, determining whether the man-machine interaction event is a default event in a preset processing list;
if the man-machine interaction event belongs to a default event in the preset processing list, preprocessing according to the category to which the man-machine interaction event belongs;
and acquiring a JavaScript script according to the event number of the preprocessed man-machine interaction event, and determining the target processing function through the JavaScript script.
In one embodiment, the monitoring a man-machine interaction event through the text field, determining a target processing function corresponding to the man-machine interaction event based on the JavaScript script, and further includes:
and if the man-machine interaction event does not belong to the default event in the preset processing list, acquiring a JavaScript script according to the event number of the man-machine interaction event, and determining the target processing function through the JavaScript script.
In one embodiment, the obtaining a JavaScript script according to an event number of a man-machine interaction event, and determining the target processing function through the JavaScript includes:
Acquiring a corresponding JavaScript from the XML configuration file according to the event number of the man-machine interaction event;
and calling a SpiderMonkey engine to analyze the JavaScript to obtain a corresponding target processing function.
In a second aspect, the application further provides a processing device of the man-machine interaction event. The device comprises:
the file acquisition module is used for acquiring an XML configuration file;
the file analysis module is used for analyzing the XML configuration file to obtain interface configuration information, each text field attribute and JavaScript script;
the interface drawing module is used for drawing a window interaction interface according to the interface configuration information;
the configuration module is used for configuring text fields corresponding to the text field attributes in the window interactive interface according to the text field attributes; the text field is used for performing man-machine interaction;
the human-computer interaction module is used for monitoring a human-computer interaction event through the text field and determining a target processing function corresponding to the human-computer interaction event based on the JavaScript script;
and the processing module is used for processing the man-machine interaction event through the target processing function.
In a third aspect, the present application also provides a computer device. The computer device comprises a memory and a processor, wherein the memory stores a computer program, and the processor realizes the steps of the processing method of the man-machine interaction event when executing the computer program.
In a fourth aspect, the present application also provides a computer-readable storage medium. The computer readable storage medium has stored thereon a computer program which, when executed by a processor, implements the steps of the method for processing a human-computer interaction event described above.
In a fifth aspect, the present application also provides a computer program product. The computer program product comprises a computer program which, when executed by a processor, implements the steps of the method for processing human-computer interaction events described above.
According to the processing method, the device, the computer equipment and the storage medium of the man-machine interaction event, the man-machine interaction can be realized by storing the interface configuration information, the text field attributes and the JavaScript script in the XML file, drawing the window interaction interface according to the interface configuration information, configuring the text field in the window interaction interface through the text field attributes, monitoring the man-machine interaction event through the text field, determining the target processing function corresponding to the man-machine interaction event based on the JavaScript script, processing the man-machine interaction event through the target processing function, eliminating the need of a developer to master C language and the curses function, and reducing the development threshold.
Drawings
FIG. 1 is an application environment diagram of a method for processing a human-machine interaction event in one embodiment;
FIG. 2 is a flow chart of a method for processing a human-machine interaction event in one embodiment;
FIG. 3 is a flowchart illustrating steps performed on a human-machine interaction event in one embodiment;
FIG. 4 is a flowchart illustrating a processing step of a man-machine interaction event according to another embodiment;
FIG. 5 is a flowchart of a method for processing a man-machine interaction event according to another embodiment;
FIG. 6 is a block diagram of a processing device for man-machine interaction events in one embodiment;
fig. 7 is an internal structural diagram of a computer device in one embodiment.
Detailed Description
The present application will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present application more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application.
The processing method of the man-machine interaction event provided by the embodiment of the application can be applied to an application environment shown in figure 1. Wherein the terminal 102 communicates with the server 104 via a network. The data storage system may store data that the server 104 needs to process, such as storing an XML configuration file. The data storage system may be integrated on the server 104 or may be located on a cloud or other network server. The terminal 102 obtains an XML configuration file, analyzes the XML configuration file, and obtains interface configuration information, each text field attribute and a JavaScript; drawing a window interaction interface according to the interface configuration information; configuring text fields corresponding to the text field attributes in the window interactive interface according to the text field attributes; the text field is used for performing man-machine interaction; monitoring a human-computer interaction event through a text field, and determining a target processing function corresponding to the human-computer interaction event based on a JavaScript script; and processing the man-machine interaction event through the target processing function. The terminal 102 may be, but is not limited to, various personal computers, notebook computers, tablet computers. The server 104 may be implemented as a stand-alone server or as a server cluster of multiple servers.
In one embodiment, as shown in fig. 2, a method for processing a man-machine interaction event is provided, and the method is applied to the terminal 102 in fig. 1 for illustration, and includes the following steps:
step 202, an XML configuration file is obtained.
The XML configuration file may refer to a file storing configuration information in an XML format. The XML configuration file may be stored in the data storage system of the server 104 in advance, or may be stored in the terminal 102 in advance.
XML is an extensible language (Extensible Markup Language). XML is a language that does not use predefined tags, and thus, proprietary tags can be defined according to design requirements. The basic format of XML is standardized, it can be shared or transmitted across systems or platforms locally or on the internet, and the recipient can still parse the XML data. XML has great applicability.
Illustratively, the XML configuration file may be obtained from a server over a network.
In some embodiments, the overall style of the XML configuration file consists essentially of:
(1) HEAD configuration HEAD, (2) window picture configuration PIC_DESC, (3) interface element attribute configuration ELES, (4) EVENT processing script EVENT and (5) user-defined script method body FUNCTION.
The header configuration HEAD includes, among other things, DESC (window description information, such as transaction description, author, date, etc.), BORDER_TYPE (whether to add a BORDER to the window), TITLE (window TITLE, which is displayed above the window if relevant configuration is present), and SIZE (window height and width, in characters).
The window picture configuration PIC_DESC is provided with a FORM_LAYOUT node, and under the FORM_LAYOUT node, the window picture is drawn according to the mode of what you see is what you get. Such as may take the form of:
input field 1[ @ @ @ @ @ @
Input field 2[ @ @ @ @ ]
Input field 3[ @ @ @
Input field 4[ @ @@ @ @ @
Input field 5[ @ ]
Where @ is an escape character used to characterize the length of the text field (input field), i.e., the number of characters that can be accommodated by the input field can be characterized by @. The above-mentioned input field will not display an escape character @ after system parsing.
The interface element attributes configure ELES, and the window element attributes are configured under ELES nodes, including the attribute definition of each text field. Mainly comprising an alian attribute for representing an alias of the text field and a field number (no) for representing a unique identification of the text field. For each text field, the corresponding configuration information includes:
1) The MUST attribute indicates whether it is necessary to input;
2) The ALIGN attribute represents the text alignment;
3) TYPE attribute indicates the TYPE of value, such as text indicated by C, value indicated by N, date indicated by D, etc.;
4) The ENABLE attribute indicates whether this text field is infusible;
5) The Param WAY attribute indicates whether this text field is to be an input field or an output field;
6) The DEFAULT attribute represents the DEFAULT value of this text field;
7) PKG represents the message field and type corresponding to the text field when the PKG is communicated and packaged with the background;
8) The IN_SCRIPT is a text field event processing SCRIPT, and can define a javascript SCRIPT to be executed when a cursor enters the text field;
9) Out_script is a text field event processing SCRIPT that can define a javascript SCRIPT to be executed when a cursor leaves the text field.
The window EVENT processing script EVENT can define a JavaScript script to be executed when a window is initialized, exited and submitted to the background, and specifically comprises:
1) INIT indicates some initialization to be performed when the window is just started, here as an option;
2) EXIT represents some work to be performed when the window EXITs, i.e., when the ESC key is pressed, here selectable;
3) POST represents some work to be performed when the window performs a commit operation, i.e., communicates with the background, typically processes such as packaging, sending a message, receiving a message, and displaying a reply. The scheme defines the action of submitting when the CTRL+N key is pressed.
4) UP and DOWN arrow key event handling UP and DOWN may also be defined; list PAGE UP-DOWN event handling page_up, page_down; list records new, delete, modify, detail event handling INSERT, DELETE, UPDATE, DETAIL, etc.
The custom script method body FUNCTION, except the public method, can be used for customizing the script method here and can be called in the window. For example, dispMsg is a method predefined by the system, and proc_fun is a method of custom packaging of the window.
And 204, analyzing the XML configuration file to obtain interface configuration information, each text field attribute and JavaScript.
Parsing may refer to a process of parsing an XML configuration file.
Interface configuration information may refer to configuration information associated with a window interactive interface.
Text field attributes may refer to related attribute information of a text field for human-computer interaction. Such as the field number of the text field, the text alignment, the type of input value, etc.
For example, the XML configuration file may be disassembled and analyzed, then, information carried in the XML configuration file is read, and the read information is integrated to obtain interface configuration information, attributes of each text field, and JavaScript.
And 206, drawing a window interaction interface according to the interface configuration information.
The window interaction interface may refer to an interface window for performing man-machine interaction. A plurality of text fields can be arranged in the window interaction interface so as to realize man-machine interaction.
For example, the window interactive interface may be drawn according to specific interface configuration information. If the interface configuration information includes information such as style and size of the window interactive interface, the window interactive interface can be drawn according to the style and size information of the window interactive interface.
Step 208, configuring text fields corresponding to the text field attributes in the window interactive interface according to the text field attributes; the text field is used for human-computer interaction.
Wherein the text field includes an input field and an output field.
Illustratively, according to the text field attributes, configuring the text field corresponding to each text field attribute in the window interactive interface.
For example, when three text field attributes exist, three text fields can be configured on the window interactive interface, and information such as alignment mode, field number and the like of each text field can be set according to the text field attributes.
Step 210, monitoring a man-machine interaction event through the text field, and determining a target processing function corresponding to the man-machine interaction event based on the JavaScript script.
The target processing function may refer to a C language function for processing a man-machine interaction event.
And step 212, processing the man-machine interaction event through a target processing function.
By way of example, whether the text field monitors the man-machine interaction event can be confirmed by monitoring whether the window interaction interface receives the window event, when the man-machine interaction event is monitored, a JavaScript script corresponding to the man-machine interaction event is obtained, then the JavaScript script is analyzed to obtain a target processing function, and the man-machine interaction event is processed through the target processing function, so that a developer does not need to master a C language and a curses function.
For example, the target processing function can directly perform data processing and screen control on the man-machine interaction event, so that man-machine interaction is realized.
According to the technical scheme, interface configuration information, each text field attribute and a JavaScript script are stored in an XML file, then a window interaction interface is drawn according to the interface configuration information, the text field is configured in the window interaction interface through the text field attribute, so that man-machine interaction can be realized, man-machine interaction events are monitored through the text field, a target processing function corresponding to the man-machine interaction events is determined based on the JavaScript script, the man-machine interaction events are processed through the target processing function, a developer does not need to master a C language and a curses function, and the development threshold is reduced.
In some embodiments, step 204 "parse the XML configuration file to obtain interface configuration information, text field attributes, and JavaScript script" includes the steps of: and reading interface configuration information, each text field attribute and JavaScript script stored in the XML configuration file.
Illustratively, the XML configuration file may be disassembled according to preset input parameters, and then, the information stored in the disassembled XML configuration file is read by using the function of the libxml2 library, so as to obtain interface configuration information, attributes of each text field and JavaScript.
The preset input parameters may refer to preset input parameters. The preset incoming parameters include a screen structure SCR, an event number, and a domain number.
The event number may refer to the number of the human interaction event. Each event number is provided with a corresponding preprocessing procedure.
The processing method of the man-machine interaction event further comprises the following steps: loading interface configuration information and each text field attribute into a screen structure body; and acquiring interface configuration information from the screen structure body to draw the window interaction interface according to the interface configuration information.
Among them, the screen structure may refer to a structure for storing interface configuration information and text field attributes. The screen structure SCR is provided with a function pointer for performing a unified callback of window events, the unified callback function being defined as ScrCatch.
Illustratively, the interface configuration information and the text field attribute are loaded into the screen structure body, and then the interface configuration information and the text field attribute are acquired from the screen structure body, so that the window interaction interface is drawn according to the interface configuration information, and the text field is configured in the window interaction interface according to the text field attribute.
According to the technical scheme, the interface configuration information and the text field attributes are loaded into the screen structure body, and the callback function pointer is arranged in the screen structure body, so that the monitored human-computer interaction event can be conveniently and directly processed through the callback function.
In some embodiments, the interface configuration information includes window style information and window configuration information. Step 206 "drawing a window interactive interface according to interface configuration information" includes the steps of: determining a window style according to window style information stored in the screen structure; and drawing the window interactive interface according to the window configuration information and the window style.
Wherein, the window style information may refer to configuration information related to a window style. Such as whether the window has a border, style type of window, etc.
The window configuration information may include the height and width of the window, whether the window has a title, description information of the window (e.g., transaction description, author, date, etc.).
For example, the stored window style information and window configuration information may be acquired from the screen structure, a corresponding window style may be determined according to the window style information, and then the window interactive interface may be drawn according to the window configuration information and the window style.
According to the technical scheme, the window style information and the window configuration information are directly obtained from the screen structure body, and then the window interaction interface is drawn according to the window style information and the window configuration information, so that subsequent man-machine interaction is facilitated, the window style information and the window configuration information are directly obtained from the screen structure body, and man-machine interaction events can be conveniently processed through callback functions in the screen structure body in man-machine interaction.
Referring to fig. 3, in some embodiments, step 210 "monitor a human-computer interaction event through a text field and determine an object processing function corresponding to the human-computer interaction event based on JavaScript script" includes the steps of:
step 302, when a man-machine interaction event is monitored, determining whether the man-machine interaction event is a default event in a preset processing list.
The preset processing list may refer to a preset event processing list. The preset processing list comprises a plurality of default events.
For example, after the man-machine interaction event is monitored through the text field, whether the man-machine interaction event is a default event may be determined according to a preset processing list.
Step 304, if the man-machine interaction event belongs to a default event in a preset processing list, preprocessing is performed according to the category to which the man-machine interaction event belongs.
The preprocessing may refer to a process of preprocessing the man-machine interaction event according to the category to which the man-machine interaction event belongs. If the window is open, the focus of the cursor is in the first inputtable field; when the left arrow key and the right arrow key are pressed, the cursor moves to the corresponding inputtable domain according to the text domain position; pressing the enter key jumps to the next inputtable field; pressing the back key may delete text field content, pressing the ESC key may exit the window or return to the last window, etc. Different kinds of man-machine interaction events will have different preprocessing procedures.
The method includes the steps that when a human-computer interaction event is monitored through a text field and the human-computer interaction event is determined to be a default event in a preset processing list, the category of the human-computer interaction event is obtained, and the human-computer interaction event is preprocessed according to the category of the human-computer interaction event.
And 306, acquiring a JavaScript script according to the event number of the preprocessed man-machine interaction event, and determining a target processing function through the JavaScript script.
The event number of the man-machine interaction event may refer to the number of the man-machine interaction event. Different event numbers correspond to different JavaScript processing functions. If the mapping relation between the event number and the JavaScript processing function can be established, the JavaScript processing function can be directly determined according to the mapping relation after the event number is determined.
Illustratively, an event number of the man-machine interaction event is acquired, a JavaScript script is acquired according to the event number, and then a C-language target processing function for processing the man-machine interaction event is determined through the JavaScript.
If the js code corresponding to the man-machine interaction event is read through the JavaScript processing function, then the corresponding C processing function is called, and then the data of the man-machine interaction event is processed through the C processing function and the window interaction interface is controlled, so that man-machine interaction is realized.
In some embodiments, step 210, "monitor human-computer interaction event through text field and determine an objective processing function corresponding to human-computer interaction event based on JavaScript script" further comprises the steps of: if the man-machine interaction event does not belong to the default event in the preset processing list, acquiring a JavaScript script according to the event number of the man-machine interaction event, and determining a target processing function through the JavaScript script.
When the man-machine interaction event does not belong to a default event in a preset processing list, the fact that the man-machine interaction event does not need to be preprocessed is indicated, at the moment, the event number of the man-machine interaction event is directly obtained, a JavaScript script is obtained according to the event number, then a target processing function is determined according to the JavaScript, and then the target processing function is called to process the man-machine interaction event so as to realize man-machine interaction.
According to the technical scheme provided by the embodiment of the application, the target processing function can be directly determined through the JavaScript script, and then the man-machine interaction event is processed according to the target processing function, so that man-machine interaction is realized, a developer is not required to master the C language and the curses function, and the development threshold is reduced.
Referring to fig. 4, in some embodiments, step 306 "obtain JavaScript according to the event number of the man-machine interaction event, and determine the target processing function through the JavaScript" includes the following steps:
and step 402, acquiring a corresponding JavaScript script from the XML configuration file according to the event number of the man-machine interaction event.
By way of example, a mapping relationship between an event number and a JavaScript script may be established. And after determining the event number of the man-machine interaction event, determining a corresponding JavaScript according to the mapping relation.
And step 404, calling a SpiderMonkey engine to analyze the JavaScript script to obtain a corresponding target processing function.
Wherein, the SpiderMonkey engine may refer to an engine for parsing and executing JavaScript code. The SpiderMonkey engine can parse JavaScript code into corresponding C language functions and execute.
The target processing function may refer to a C language function for processing human-machine interaction events.
Illustratively, the SpiderMonkey engine is called to analyze the JavaScript script to obtain the target processing function for processing the man-machine interaction event.
According to the technical scheme, the JavaScript script is analyzed through the SpiderMonkey engine to obtain the target processing function, and the man-machine interaction event is directly processed through the target processing function, so that man-machine interaction is realized, a developer does not need to master a C language and a curses function, and the development threshold is reduced.
Referring to fig. 5, some embodiments of the present application provide a method for processing a man-machine interaction event, which includes the following steps:
step 502, an XML configuration file is obtained.
And step 504, disassembling the XML configuration file according to preset input parameters, and reading interface configuration information, each text field attribute and JavaScript stored in the disassembled XML configuration file.
At step 506, the interface configuration information and text field attributes are loaded into the screen structure. The interface configuration information comprises window style information and window configuration information.
Step 508, window style information and window configuration information are obtained from the screen structure body, window styles are determined according to the window style information stored in the screen structure body, and a window interactive interface is drawn according to the window configuration information and the window styles.
Step 510, configuring text fields corresponding to the text field attributes in the window interactive interface according to the text field attributes; the text field is used for human-computer interaction.
At step 512, the human-machine interaction event is monitored by the text field.
Step 514, determining whether the man-machine interaction event is a default event in a preset processing list.
If yes, go to step 516, if not, go to step 518.
Step 516, preprocessing according to the category to which the man-machine interaction event belongs.
And 518, acquiring a corresponding JavaScript from the XML configuration file according to the event number of the man-machine interaction event.
And step 520, calling a SpiderMonkey engine to analyze the JavaScript script to obtain a corresponding target processing function.
And 522, processing the man-machine interaction event through a target processing function.
Specifically, the specific steps from step 502 to step 522 can be referred to the foregoing embodiments, and are not described herein.
According to the technical scheme, interface configuration information, each text field attribute and a JavaScript script are stored in an XML file, then a window interaction interface is drawn according to the interface configuration information, the text field is configured in the window interaction interface through the text field attribute, so that man-machine interaction can be realized, man-machine interaction events are monitored through the text field, a target processing function corresponding to the man-machine interaction events is determined based on the JavaScript script, the man-machine interaction events are processed through the target processing function, a developer does not need to master a C language and a curses function, and the development threshold is reduced. .
Specifically, taking a man-machine interaction event of inquiring the name and age of a student through the student number as an example, the processing method of the man-machine interaction event is described.
Firstly, configuring an XML configuration file, drawing a window interaction interface based on interface configuration information in the XML configuration file, and configuring text fields corresponding to the text field attributes in the window interaction interface. In this embodiment, specific configuration information is as follows:
(1) Drawing each text field of the number, the name and the age, and defining the length of the characters which can be accommodated by each text field by using an @ escape character;
(2) defining attributes of each text field, such as the number field (text field for number interaction) as text type, left-aligned; such as an age field (text field for age interaction) defined as a number type, right alignment, etc.
(3) In the EVENT node, script processing at the time of submission is defined, and here, the qry_student () method is called, which is defined in the FUNCTION node. This event will be triggered when a ctrl+n operation is performed on the interface.
(4) Processing logic of the qry_student () method is defined in the FUNCTION node, in this embodiment, pubcal is a packaged public method, the bottom layer is a C language FUNCTION, and after being parsed by the SpiderMonkey engine, a corresponding C FUNCTION is called. The method is communicated with the background, and comprises the steps of packing parameters of an 'IN' type into JSON messages according to PKG attribute definition of a text field, and finally returning the JSON messages IN the form of objects. The ScrPutAllEle (obj) method is also a packaged public method, and the function of the method is to display the value in the returned object in the text field of the corresponding name and age.
After each text field is configured, whether a man-machine interaction event exists is monitored through the text field, when the man-machine interaction event exists, a JavaScript script is analyzed through a SpiderMonkey engine to obtain a target processing function, and then the man-machine interaction event is processed according to the target processing function, so that man-machine interaction is realized.
If the input academic number is monitored in the text field, analyzing the JavaScript script by the SpiderMonkey engine to obtain a target processing function, inquiring the name, age and the like of the student according to the academic number, and displaying the name, the age and the like in the text field, so that man-machine interaction is realized.
It should be understood that, although the steps in the flowcharts related to the above embodiments are sequentially shown as indicated by arrows, these steps are not necessarily sequentially performed in the order indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in the flowcharts described in the above embodiments may include a plurality of steps or a plurality of stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of the steps or stages is not necessarily performed sequentially, but may be performed alternately or alternately with at least some of the other steps or stages.
Based on the same inventive concept, the embodiment of the application also provides a processing device for the man-machine interaction event, which is used for realizing the processing method of the man-machine interaction event. The implementation of the solution provided by the device is similar to the implementation described in the above method, so the specific limitations in the embodiments of the processing device for one or more human-computer interaction events provided below can be seen from the above description of the human-computer interaction method.
In one embodiment, as shown in fig. 6, there is provided a processing apparatus for a man-machine interaction event, including: a file acquisition module 602, a file parsing module 604, an interface drawing module 606, a configuration module 608, a man-machine interaction module 610 and a processing module 612, wherein:
the file obtaining module 602 is configured to obtain an XML configuration file.
The file parsing module 604 is configured to parse the XML configuration file to obtain interface configuration information, attributes of each text field, and JavaScript.
The interface drawing module 606 is configured to draw a window interaction interface according to the interface configuration information.
A configuration module 608, configured to configure text fields corresponding to the text field attributes in the window interactive interface according to the text field attributes; the text field is used for human-computer interaction.
The man-machine interaction module 610 is configured to monitor a man-machine interaction event through the text field, and determine a target processing function corresponding to the man-machine interaction event based on the JavaScript script.
And the processing module 612 is configured to process the man-machine interaction event through a target processing function.
In some embodiments, the file parsing module 604 is further configured to read interface configuration information, text field attributes, and JavaScript scripts stored in the XML configuration file.
The processing device of the man-machine interaction event also comprises a reloading module which is used for loading interface configuration information and each text field attribute into the screen structure body;
the interface drawing module 606 is further configured to obtain interface configuration information from the screen structure body, so as to draw the window interaction interface according to the interface configuration information.
In some embodiments, the interface rendering module 606 is further configured to determine a window style from window style information stored in the screen structure; and drawing the window interactive interface according to the window configuration information and the window style.
In some embodiments, the human-machine interaction module 610 is further configured to: when the man-machine interaction event is monitored, determining whether the man-machine interaction event is a default event in a preset processing list; if the man-machine interaction event belongs to a default event in a preset processing list, preprocessing according to the category to which the man-machine interaction event belongs; and acquiring a JavaScript script according to the event number of the preprocessed man-machine interaction event, and determining a target processing function through the JavaScript script.
In some embodiments, the human-machine interaction module 610 is further configured to: if the man-machine interaction event does not belong to the default event in the preset processing list, acquiring a JavaScript script according to the event number of the man-machine interaction event, and determining a target processing function through the JavaScript script.
In some embodiments, the human-machine interaction module 610 is further configured to: acquiring a corresponding JavaScript from the XML configuration file according to the event number of the man-machine interaction event; and calling a SpiderMonkey engine to analyze the JavaScript to obtain the corresponding target processing function.
The modules in the processing device of the man-machine interaction event can be realized in whole or in part by software, hardware and a combination thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In one embodiment, a computer device is provided, which may be a terminal, and the internal structure of which may be as shown in fig. 7. The computer device includes a processor, a memory, an input/output interface, a communication interface, a display unit, and an input means. The processor, the memory and the input/output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input/output interface. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The input/output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used for carrying out wired or wireless communication with an external terminal, and the wireless mode can be realized through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. The computer program, when executed by a processor, implements a method for processing human-machine interaction events. The display unit of the computer device is used for forming a visual picture, and can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, can also be a key, a track ball or a touch pad arranged on the shell of the computer equipment, and can also be an external keyboard, a touch pad or a mouse and the like.
It will be appreciated by those skilled in the art that the structure shown in FIG. 7 is merely a block diagram of some of the structures associated with the present inventive arrangements and is not limiting of the computer device to which the present inventive arrangements may be applied, and that a particular computer device may include more or fewer components than shown, or may combine some of the components, or have a different arrangement of components.
In one embodiment, a computer device is provided comprising a memory and a processor, the memory having stored therein a computer program, the processor when executing the computer program performing the steps of: acquiring an XML configuration file; analyzing the XML configuration file to obtain interface configuration information, each text field attribute and JavaScript; drawing a window interaction interface according to the interface configuration information; configuring text fields corresponding to the text field attributes in the window interactive interface according to the text field attributes; the text field is used for performing man-machine interaction; monitoring a human-computer interaction event through a text field, and determining a target processing function corresponding to the human-computer interaction event based on a JavaScript script; and processing the man-machine interaction event through the target processing function.
In one embodiment, the processor when executing the computer program further performs the steps of: reading interface configuration information, each text field attribute and JavaScript script stored in an XML configuration file; loading interface configuration information and each text field attribute into a screen structure body; and acquiring interface configuration information from the screen structure body to draw the window interaction interface according to the interface configuration information.
In one embodiment, the processor when executing the computer program further performs the steps of: determining a window style according to window style information stored in the screen structure; and drawing the window interactive interface according to the window configuration information and the window style.
In one embodiment, the processor when executing the computer program further performs the steps of: when the man-machine interaction event is monitored, determining whether the man-machine interaction event is a default event in a preset processing list; if the man-machine interaction event belongs to a default event in a preset processing list, preprocessing according to the category to which the man-machine interaction event belongs; and acquiring a JavaScript script according to the event number of the preprocessed man-machine interaction event, and determining a target processing function through the JavaScript script.
In one embodiment, the processor when executing the computer program further performs the steps of: if the man-machine interaction event does not belong to the default event in the preset processing list, acquiring a JavaScript script according to the event number of the man-machine interaction event, and determining a target processing function through the JavaScript script.
In one embodiment, the processor when executing the computer program further performs the steps of: acquiring a corresponding JavaScript from the XML configuration file according to the event number of the man-machine interaction event; and calling a SpiderMonkey engine to analyze the JavaScript to obtain the corresponding target processing function.
In one embodiment, a computer readable storage medium is provided having a computer program stored thereon, which when executed by a processor, performs the steps of: acquiring an XML configuration file; analyzing the XML configuration file to obtain interface configuration information, each text field attribute and JavaScript; drawing a window interaction interface according to the interface configuration information; configuring text fields corresponding to the text field attributes in the window interactive interface according to the text field attributes; the text field is used for performing man-machine interaction; monitoring a human-computer interaction event through a text field, and determining a target processing function corresponding to the human-computer interaction event based on a JavaScript script; and processing the man-machine interaction event through the target processing function.
In one embodiment, the computer program when executed by the processor further performs the steps of: reading interface configuration information, each text field attribute and JavaScript script stored in an XML configuration file; loading interface configuration information and each text field attribute into a screen structure body; and acquiring interface configuration information from the screen structure body to draw the window interaction interface according to the interface configuration information.
In one embodiment, the computer program when executed by the processor further performs the steps of: determining a window style according to window style information stored in the screen structure; and drawing the window interactive interface according to the window configuration information and the window style.
In one embodiment, the computer program when executed by the processor further performs the steps of: when the man-machine interaction event is monitored, determining whether the man-machine interaction event is a default event in a preset processing list; if the man-machine interaction event belongs to a default event in a preset processing list, preprocessing according to the category to which the man-machine interaction event belongs; and acquiring a JavaScript script according to the event number of the preprocessed man-machine interaction event, and determining a target processing function through the JavaScript script.
In one embodiment, the computer program when executed by the processor further performs the steps of: if the man-machine interaction event does not belong to the default event in the preset processing list, acquiring a JavaScript script according to the event number of the man-machine interaction event, and determining a target processing function through the JavaScript script.
In one embodiment, the computer program when executed by the processor further performs the steps of: acquiring a corresponding JavaScript from the XML configuration file according to the event number of the man-machine interaction event; and calling a SpiderMonkey engine to analyze the JavaScript to obtain the corresponding target processing function.
In one embodiment, a computer program product is provided comprising a computer program which, when executed by a processor, performs the steps of: acquiring an XML configuration file; analyzing the XML configuration file to obtain interface configuration information, each text field attribute and JavaScript; drawing a window interaction interface according to the interface configuration information; configuring text fields corresponding to the text field attributes in the window interactive interface according to the text field attributes; the text field is used for performing man-machine interaction; monitoring a human-computer interaction event through a text field, and determining a target processing function corresponding to the human-computer interaction event based on a JavaScript script; and processing the man-machine interaction event through the target processing function.
In one embodiment, the computer program when executed by the processor further performs the steps of: reading interface configuration information, each text field attribute and JavaScript script stored in an XML configuration file; loading interface configuration information and each text field attribute into a screen structure body; and acquiring interface configuration information from the screen structure body to draw the window interaction interface according to the interface configuration information.
In one embodiment, the computer program when executed by the processor further performs the steps of: determining a window style according to window style information stored in the screen structure; and drawing the window interactive interface according to the window configuration information and the window style.
In one embodiment, the computer program when executed by the processor further performs the steps of: when the man-machine interaction event is monitored, determining whether the man-machine interaction event is a default event in a preset processing list; if the man-machine interaction event belongs to a default event in a preset processing list, preprocessing according to the category to which the man-machine interaction event belongs; and acquiring a JavaScript script according to the event number of the preprocessed man-machine interaction event, and determining a target processing function through the JavaScript script.
In one embodiment, the computer program when executed by the processor further performs the steps of: if the man-machine interaction event does not belong to the default event in the preset processing list, acquiring a JavaScript script according to the event number of the man-machine interaction event, and determining a target processing function through the JavaScript script.
In one embodiment, the computer program when executed by the processor further performs the steps of: acquiring a corresponding JavaScript from the XML configuration file according to the event number of the man-machine interaction event; and calling a SpiderMonkey engine to analyze the JavaScript to obtain the corresponding target processing function.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, database, or other medium used in embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, high density embedded nonvolatile Memory, resistive random access Memory (ReRAM), magnetic random access Memory (Magnetoresistive Random Access Memory, MRAM), ferroelectric Memory (Ferroelectric Random Access Memory, FRAM), phase change Memory (Phase Change Memory, PCM), graphene Memory, and the like. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory, and the like. By way of illustration, and not limitation, RAM can be in the form of a variety of forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), and the like. The databases referred to in the embodiments provided herein may include at least one of a relational database and a non-relational database. The non-relational database may include, but is not limited to, a blockchain-based distributed database, and the like. The processor referred to in the embodiments provided in the present application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, or the like, but is not limited thereto.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The foregoing examples illustrate only a few embodiments of the application and are described in detail herein without thereby limiting the scope of the application. It should be noted that it will be apparent to those skilled in the art that several variations and modifications can be made without departing from the spirit of the application, which are all within the scope of the application. Accordingly, the scope of the application should be assessed as that of the appended claims.

Claims (10)

1. A method for processing a human-computer interaction event, the method comprising:
acquiring an XML configuration file;
analyzing the XML configuration file to obtain interface configuration information, each text field attribute and JavaScript;
drawing a window interaction interface according to the interface configuration information;
configuring text fields corresponding to the text field attributes in the window interactive interface according to the text field attributes; the text field is used for performing man-machine interaction;
Monitoring a human-computer interaction event through the text field, and determining a target processing function corresponding to the human-computer interaction event based on the JavaScript script;
and processing the man-machine interaction event through the target processing function.
2. The method of claim 1, wherein parsing the XML configuration file to obtain interface configuration information, text field attributes, and JavaScript script comprises:
reading interface configuration information, each text field attribute and JavaScript script stored in the XML configuration file;
the method further comprises the steps of:
loading the interface configuration information and each text field attribute into a screen structure;
and acquiring the interface configuration information from the screen structure body so as to draw a window interaction interface according to the interface configuration information.
3. The method of claim 2, wherein the interface configuration information includes window style information and window configuration information, and wherein the drawing the window interactive interface according to the interface configuration information includes:
determining a window style according to window style information stored in the screen structure;
and drawing the window interaction interface according to the window configuration information and the window style.
4. The method of claim 1, wherein the monitoring of the human-machine interaction event by the text field and determining the target processing function corresponding to the human-machine interaction event based on the JavaScript script comprise:
when the man-machine interaction event is monitored, determining whether the man-machine interaction event is a default event in a preset processing list;
if the man-machine interaction event belongs to a default event in the preset processing list, preprocessing according to the category to which the man-machine interaction event belongs;
and acquiring a JavaScript script according to the event number of the preprocessed man-machine interaction event, and determining the target processing function through the JavaScript script.
5. The method of claim 4, wherein the monitoring of the human-machine interaction event by the text field and determining the target processing function corresponding to the human-machine interaction event based on the JavaScript script further comprises:
and if the man-machine interaction event does not belong to the default event in the preset processing list, acquiring a JavaScript script according to the event number of the man-machine interaction event, and determining the target processing function through the JavaScript script.
6. The method according to claim 5, wherein the obtaining a JavaScript script according to an event number of a man-machine interaction event, and determining the target processing function through the JavaScript script, comprises:
acquiring a corresponding JavaScript from the XML configuration file according to the event number of the man-machine interaction event;
and calling a SpiderMonkey engine to analyze the JavaScript to obtain a corresponding target processing function.
7. A device for processing a human-machine interaction event, the device comprising:
the file acquisition module is used for acquiring an XML configuration file;
the file analysis module is used for analyzing the XML configuration file to obtain interface configuration information, each text field attribute and JavaScript script;
the interface drawing module is used for drawing a window interaction interface according to the interface configuration information;
the configuration module is used for configuring text fields corresponding to the text field attributes in the window interactive interface according to the text field attributes; the text field is used for performing man-machine interaction;
the human-computer interaction module is used for monitoring a human-computer interaction event through the text field and determining a target processing function corresponding to the human-computer interaction event based on the JavaScript script;
And the processing module is used for processing the man-machine interaction event through the target processing function.
8. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any of claims 1 to 6 when the computer program is executed.
9. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 6.
10. A computer program product comprising a computer program, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 6.
CN202310784119.1A 2023-06-29 2023-06-29 Processing method and device of man-machine interaction event, computer equipment and storage medium Pending CN116893811A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310784119.1A CN116893811A (en) 2023-06-29 2023-06-29 Processing method and device of man-machine interaction event, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310784119.1A CN116893811A (en) 2023-06-29 2023-06-29 Processing method and device of man-machine interaction event, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116893811A true CN116893811A (en) 2023-10-17

Family

ID=88310181

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310784119.1A Pending CN116893811A (en) 2023-06-29 2023-06-29 Processing method and device of man-machine interaction event, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116893811A (en)

Similar Documents

Publication Publication Date Title
US20220253588A1 (en) Page processing method and related apparatus
CN112800370B (en) Processing method and device of business document, computer equipment and storage medium
CN112711418B (en) Front-end interface layout method and device for multiple components, electronic equipment and storage medium
EP2965290A1 (en) Data visualization
CN112558967A (en) Page automatic generation method and device, electronic equipment and storage medium
CN115543282A (en) Page code generation method and device, storage medium and computer equipment
CN115809056B (en) Component multiplexing implementation method and device, terminal equipment and readable storage medium
CN115062084B (en) Method and device for constructing API (application programming interface) based on database metadata
US9230022B1 (en) Customizable result sets for application program interfaces
CN116893811A (en) Processing method and device of man-machine interaction event, computer equipment and storage medium
CN115357161A (en) Table adjustment method, device, computer equipment and storage medium
CN112966481B (en) Data form display method and device
US9864739B1 (en) Automatic layout of graphical user interface screens from object data
CN117370281A (en) Data maintenance method, device, computer equipment and storage medium
US20240037325A1 (en) Ability to add non-direct ancestor columns in child spreadsheets
CN117331960A (en) Method, device, computer equipment and storage medium for generating table file
CN116304407A (en) Page rendering method, device, computer equipment and storage medium
CN114003213A (en) Data processing method, device and equipment
CN116843789A (en) Method, device, computer equipment and storage medium for generating folding column diagram
CN116737216A (en) Method, apparatus, device, storage medium and program product for managing technical resources
CN117251159A (en) Rule page generation method, device, computer equipment and storage medium
CN114491191A (en) Interface document generation method and device, electronic equipment and storage medium
CN117130606A (en) Front-end page configuration method, front-end page configuration device, computer equipment and storage medium
CN116400922A (en) Interface guide schematic diagram generation method, device, computer equipment and storage medium
CN117319335A (en) Communication client construction method and device adapting to financial operation system

Legal Events

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