CN112527443A - Prompt box display method and device, electronic equipment and computer readable storage medium - Google Patents

Prompt box display method and device, electronic equipment and computer readable storage medium Download PDF

Info

Publication number
CN112527443A
CN112527443A CN202011581313.2A CN202011581313A CN112527443A CN 112527443 A CN112527443 A CN 112527443A CN 202011581313 A CN202011581313 A CN 202011581313A CN 112527443 A CN112527443 A CN 112527443A
Authority
CN
China
Prior art keywords
window
display
class
prompt box
task
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
CN202011581313.2A
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.)
Ping An Puhui Enterprise Management Co Ltd
Original Assignee
Ping An Puhui Enterprise Management 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 Ping An Puhui Enterprise Management Co Ltd filed Critical Ping An Puhui Enterprise Management Co Ltd
Priority to CN202011581313.2A priority Critical patent/CN112527443A/en
Publication of CN112527443A publication Critical patent/CN112527443A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0481Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance
    • G06F3/0483Interaction with page-structured environments, e.g. book metaphor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/31Programming languages or programming paradigms
    • G06F8/315Object-oriented languages
    • 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/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4488Object-oriented
    • G06F9/449Object-oriented method invocation or resolution
    • 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/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues

Abstract

The invention relates to a process optimization technology and discloses a prompt box display method, which comprises the following steps: performing interface analysis on the task thread to obtain a system API (application programming interface); calling a task object of a task thread by using a system API interface, and creating a window management rule class according to the task object; establishing an auxiliary class, and inheriting a preset system display rule class by using the auxiliary class to obtain a window display rule class; acquiring window display mechanism data, and generating a window queue by using the window display mechanism data; carrying out rule configuration on the window queue by utilizing the window management rule class and the window display rule class to obtain a prompt box display queue; and displaying the prompt box of the task thread by using the prompt box display queue. In addition, the invention also relates to a block chain technology, and the window display mechanism data can be stored in the nodes of the block chain. The invention also provides a prompt box display device, equipment and a medium. The invention can solve the problems of inaccurate content and missing prompt when the prompt box prompts.

Description

Prompt box display method and device, electronic equipment and computer readable storage medium
Technical Field
The invention relates to the technical field of process optimization, in particular to a prompt box display method and device, electronic equipment and a computer readable storage medium.
Background
In the Android project development, when some simple messages of a user need to be prompted on a page in some scenes, a common method for prompting the messages of the user is to display the message contents by using a prompt box so as to prompt the messages of the user, and most of the existing prompt box prompting methods use an API (application programming interface) interface carried by a Google system to call a system method to display the prompt box messages. However, in this method, the prompt box needs to be authorized by the system in advance, so that situations such as prompt omission may occur, and the prompt content may be distributed by the system, which may cause a problem that the prompt content is inaccurate.
Disclosure of Invention
The invention provides a prompt box display method, a prompt box display device and a computer readable storage medium, and mainly aims to solve the problems of inaccurate content and missing prompt when a prompt box prompts.
In order to achieve the above object, the present invention provides a method for displaying a prompt box, including:
acquiring a task thread running on an application interface, and performing interface analysis on the task thread to obtain a system API (application programming interface);
calling a task object of the task thread by using the system API interface, and creating a window management rule class according to the task object;
establishing an auxiliary class, and inheriting a preset system display rule class by using the auxiliary class to obtain a window display rule class;
acquiring window display mechanism data, and generating a window queue by using the window display mechanism data;
carrying out rule configuration on the window queue by utilizing the window management rule class and the window display rule class to obtain a prompt box display queue;
and displaying the prompt box of the task thread by using the prompt box display queue.
Optionally, the performing interface analysis on the task thread to obtain a system API interface includes:
acquiring an operating instruction of the task thread;
extracting an interface field in the running instruction;
and analyzing the interface field to obtain a system API interface corresponding to the interface field.
Optionally, the extracting an interface field in the execution instruction includes:
traversing the operating instruction and determining the position of a field separator in the operating instruction;
carrying out field splitting on the operation instruction according to the position of the field separator to obtain a plurality of split fields;
carrying out serial number labeling on the plurality of split fields according to a split sequence;
and selecting a splitting field with a preset sequence number as the interface field.
Optionally, the invoking a task object of the task thread by using the system API interface includes:
extracting a calling parameter of the API;
generating a calling request of the API according to the calling parameter;
and executing the calling request by utilizing the API interface to call the task object of the task thread.
Optionally, the creating a window management rule class according to the task object includes:
extracting object attributes of the task object;
acquiring a preset method list;
screening and acquiring a task method corresponding to the object attribute from the method list;
and encapsulating the task method and the object attribute to obtain a window management rule class.
Optionally, the inheriting a preset system display rule class by using the auxiliary class to obtain a window display rule class, where the method includes:
acquiring inherited keywords;
and connecting the auxiliary class and the system display rule class by using the inherited keywords to obtain a window display rule class.
Optionally, the displaying the prompt box of the task thread by using the prompt box display queue includes:
constructing a prompt window by utilizing a prompt box generation function;
acquiring prompt contents of the task thread;
writing the prompt content into the prompt window to obtain a prompt box of the task thread;
and displaying the prompt box by using the prompt box display queue.
In order to solve the above problem, the present invention further provides a prompt box display device, including:
the interface analysis module is used for acquiring a task thread running on an application interface, and performing interface analysis on the task thread to obtain a system API (application programming interface);
the first rule class creating module is used for calling a task object of the task thread by using the system API interface and creating a window management rule class according to the task object;
the second rule class creating module is used for constructing an auxiliary class, and inheriting a preset system display rule class by using the auxiliary class to obtain a window display rule class;
the window queue generating module is used for acquiring window display mechanism data and generating a window queue by utilizing the window display mechanism data;
the rule configuration module is used for carrying out rule configuration on the window queue by utilizing the window management rule class and the window display rule class to obtain a prompt box display queue;
and the prompt box display module is used for displaying the prompt box of the task thread by utilizing the prompt box display queue.
In order to solve the above problem, the present invention also provides an electronic device, including:
a memory storing at least one instruction; and
and the processor executes the instructions stored in the memory to realize the prompt box display method.
In order to solve the above problem, the present invention further provides a computer-readable storage medium, where at least one instruction is stored, and the at least one instruction is executed by a processor in an electronic device to implement the above prompt box display method.
According to the embodiment of the invention, the task object of the task thread is called by utilizing the system API interface, and the window management rule class is created according to the task object, so that the matching between the created window management rule class and the task object can be ensured, and the accuracy of the content displayed by the prompt box can be improved; the preset system display rule class is inherited through the auxiliary class to obtain a window display rule class, so that the display and hiding of the prompt box can be controlled by utilizing the window display rule class, and the display success rate of the prompt box is improved; and generating a window queue by using the window display mechanism data, carrying out rule configuration on the window queue to obtain a prompt box display queue, and displaying the prompt box of the task thread by using the prompt box display queue to prevent omission of prompt content display. Therefore, the prompt box display method, the prompt box display device, the electronic equipment and the computer readable storage medium provided by the invention can solve the problems of inaccurate content and missing prompt when the prompt box prompts.
Drawings
Fig. 1 is a schematic flow chart illustrating a prompt box display method according to an embodiment of the present invention;
FIG. 2 is a functional block diagram of a prompt box display device according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of an electronic device implementing the prompt box display method according to an embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The embodiment of the application provides a prompt box display method. The execution subject of the prompt box display method includes, but is not limited to, at least one of electronic devices such as a server and a terminal that can be configured to execute the method provided by the embodiment of the present application. In other words, the prompt box display method may be executed by software or hardware installed in the terminal device or the server device, and the software may be a blockchain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, and the like.
Fig. 1 is a schematic flow chart illustrating a prompt box display method according to an embodiment of the present invention. In this embodiment, the method for displaying a prompt box includes:
and S1, acquiring the task thread running on the application interface, and performing interface analysis on the task thread to obtain a system API interface.
In the embodiment of the present invention, the application Interface is executed in an operating system, the operating system is an Android system, optionally, the application Interface is a User Interface (UI), the UI is a medium for interaction and information exchange between the system and the User, and the UI realizes conversion between an internal form of information and a human-acceptable form, so that the User can conveniently and efficiently operate hardware to achieve bidirectional interaction, and complete a desired work by means of the hardware.
In detail, the display, update and control interaction of the UI interface are controlled by a task thread created by the application program at runtime, where the task thread refers to a technology that implements concurrent execution of multiple threads from software or hardware, and the task thread is a single sequential control flow in the program.
The task thread is created based on the Application class of the Android system, and in order to better display the prompt box of the task thread, the embodiment of the invention adds the catch Application class in the Android system and inherits the Application class of the Android system, so that the task thread running on an Application interface is more efficiently acquired.
In the embodiment of the present invention, the performing interface analysis on the task thread to obtain a system API interface includes:
acquiring an operating instruction of the task thread;
extracting an interface field in the running instruction;
and analyzing the interface field to obtain a system API interface corresponding to the interface field.
In detail, the running instruction of the task thread refers to a computer instruction used for supporting normal running of the application thread in an operating system, and in the embodiment of the present invention, the running instruction of the task thread in the operating system may be obtained by monitoring using an ASM enhanced bytecode filter, which is a code analysis tool based on a java bytecode level, and the success rate of the data running instruction may be improved by monitoring the running instruction using the ASM enhanced bytecode filter.
Specifically, the extracting an interface field in the execution instruction includes:
traversing the operating instruction and determining the position of a field separator in the operating instruction;
carrying out field splitting on the operation instruction according to the position of the field separator to obtain a plurality of split fields;
carrying out serial number labeling on the plurality of split fields according to a split sequence;
and selecting a splitting field with a preset sequence number as the interface field.
For example, if the operation instruction is "qwe < rt < yuio < pl", where < is a field delimiter, the field splitting of the operation instruction is performed according to the position of the field delimiter in the operation instruction: the method comprises the following steps of dividing four division fields of 'qwe', 'rt', 'yuio' and 'pl', and marking sequence numbers of the division fields as follows according to a division sequence: 1 "qwe", 2 "rt", 3 "yuio" and 4 "pl", for example, if the preset sequence number is 2, the field "rt" is determined to be the interface field.
Further, in the embodiment of the present invention, a preset parser may be used to parse the interface field to obtain a system API interface corresponding to the interface field, where the parser includes CarakanC/C + +, squirrel fisherc + +, squirrel fisherxtremc + +, and the like.
And S2, calling the task object of the task thread by using the system API interface, and creating a window management rule class according to the task object.
In this embodiment of the present invention, the invoking the task object of the task thread by using the system API interface includes:
extracting a calling parameter of the API;
generating a calling request of the API according to the calling parameter;
and executing the calling request by utilizing the API interface to call the task object of the task thread.
In detail, the embodiment of the invention obtains the call parameters from the API interface through a java statement with a parameter crawling function, where the call parameters include, but are not limited to, interface information, a data transmission type, and an interface start condition.
According to the embodiment of the invention, the calling parameters are compiled into the calling requests of the API through a preset compiler, wherein the compiler comprises a Visual Studio compiler, a Dev C + + compiler, a Visual C + + compiler and the like.
In this embodiment of the present invention, the creating a window management rule class according to the task object includes:
extracting object attributes of the task object;
acquiring a preset method list;
screening and acquiring a task method corresponding to the object attribute from the method list;
and encapsulating the task method and the object attribute to obtain a window management rule class.
Specifically, the object attributes are determined by the task object, for example, the task object is "student", and the object attributes include, but are not limited to, name, school number, class.
In detail, the method list includes a plurality of Android systems, and the method is used for identifying functions of a window management rule class which can be realized according to the object attributes, for example, a window management rule class exists, the window management rule class includes a window display data type attribute, and a window data display method, so that the window management rule class can display data corresponding to the window display data type attribute by using the window data display method.
The embodiment of the invention utilizes the encapsulation method in java to encapsulate the task method and the object attribute to obtain the window management rule class.
In detail, the window management rule class is used for acquiring an object to be displayed by a prompt window of a task thread, and the window management rule class includes, but is not limited to, a WindowManager auxiliary class, and the WindowManager auxiliary class includes a ToastHelper task object, a set for storing task threads, a tag for a task object, and the like.
The embodiment of the invention calls the task object of the task thread by using the system API interface, creates the window management rule class according to the task object, can ensure the matching between the created window management rule class and the task object, and is favorable for improving the accuracy of the display content of the prompt box.
And S3, acquiring an auxiliary class, and inheriting a preset system display rule class by using the auxiliary class to obtain a window display rule class.
In the embodiment of the invention, the auxiliary class can be obtained by compiling a Java language, and is created in a configuration file of an Android system. The configuration file is an android manifest.
In detail, the auxiliary class includes, but is not limited to, a Toast auxiliary class.
In the embodiment of the present invention, inheriting a preset system display rule class by using the auxiliary class to obtain a window display rule class, where the inheriting includes:
acquiring inherited keywords;
and connecting the auxiliary class and the system display rule class by using the inherited keywords to obtain a window display rule class.
In detail, the inheritance key is a key for realizing inheritance relationship between classes, for example, keys such as extensions and instances.
Specifically, the system display rule class includes, but is not limited to, a Handler class, and the function of displaying and hiding the prompt box can be realized through the system display rule class.
In detail, in the embodiment of the present invention, the auxiliary class and the system display rule class may be connected by using an inheritance key, that is, the auxiliary class and the system display rule class are connected by writing the inheritance key between the auxiliary class and the system display rule class, so as to enable the auxiliary class to inherit the system display rule class, for example, there is an auxiliary class a and a system display rule class B, and the auxiliary class a can inherit the system display rule class B by using a statement in the form of "class a extensions B { }" or "class B { } class a extensions B { }".
The embodiment of the invention inherits the preset system display rule class through the auxiliary class to obtain the window display rule class, can realize the control of the display and the hiding of the prompt box by utilizing the window display rule class, and is favorable for improving the display success rate of the prompt box.
S4, acquiring window display mechanism data, and generating a window queue by using the window display mechanism data.
In the embodiment of the present invention, the window display mechanism data includes, but is not limited to, a window display order, a window display duration, a window display status identifier, and an inheritable parent class.
The embodiment of the invention can capture the window display mechanism data from a pre-constructed database by using the python statement with the data capture function, and can improve the efficiency of obtaining the window display mechanism data by using the high throughput of the block chain to the data.
In this embodiment of the present invention, the generating a window queue using the window display mechanism data includes:
acquiring a queue tool;
creating a window queue class using the queue tool;
and carrying out variable assignment on the window queue class by using the window display mechanism data to obtain a window queue.
Specifically, the queue tool is an application tool with a window queue creation function, and the queue tool comprises but is not limited to a classwizard tool and a dialogUtil tool. The queue tool is used for creating the window queue class, and the efficiency of creating the window queue class can be improved. By executing the popup tool, the window queue class may be created, including but not limited to the ToastStrategy class.
In detail, in the embodiment of the present invention, variable assignment is performed on the window queue class by using the window display mechanism data, so as to obtain a window queue.
For example, inheriting an inheritable parent class in the window display mechanism data by using a window queue class, adding a window state judgment condition to the window queue by using a window display state identifier in the window display mechanism data, and the like.
And S5, carrying out rule configuration on the window queue by using the window management rule class and the window display rule class to obtain a prompt box display queue.
In this embodiment of the present invention, the performing rule configuration on the window queue by using the window management rule class and the window display rule class to obtain a prompt box display queue includes: and calling and connecting the window management rule class and the window display rule class by using the window queue to obtain the prompt box display queue.
In detail, the embodiment of the invention realizes the calling connection of the window queue to the window management rule class and the window display rule class through the preset calling function.
Specifically, the invoking connection is to construct a dependency relationship between the window queue and the window management rule class and the window display rule class, so that the window queue can invoke the window management rule class and the window display rule class to implement the functions of the window management rule class and the window display rule class.
And S6, displaying the prompt box of the task thread by using the prompt box display queue.
In this embodiment of the present invention, the displaying the prompt box of the task thread by using the prompt box display queue includes:
constructing a prompt window by utilizing a prompt box generation function;
acquiring prompt contents of the task thread;
writing the prompt content into the prompt window to obtain a prompt box of the task thread;
and displaying the prompt box by using the prompt box display queue.
In detail, in the embodiment of the present invention, a frame of a prompt window may be created through functions such as a setMessage function, a setItems function, and a setSingleChoiceItems function, and a button of the prompt window may be created in the frame of the prompt window through functions such as a setposivebutton function, a setnegtivetbutton function, and a setNeutralButton function.
Specifically, the prompt box is displayed by using the prompt box display queue, that is, the prompt boxes are displayed according to the sequence of the prompt box display queue.
According to the embodiment of the invention, the task object of the task thread is called by utilizing the system API interface, and the window management rule class is created according to the task object, so that the matching between the created window management rule class and the task object can be ensured, and the accuracy of the content displayed by the prompt box can be improved; the preset system display rule class is inherited through the auxiliary class to obtain a window display rule class, so that the display and hiding of the prompt box can be controlled by utilizing the window display rule class, and the display success rate of the prompt box is improved; and generating a window queue by using the window display mechanism data, carrying out rule configuration on the window queue to obtain a prompt box display queue, and displaying the prompt box of the task thread by using the prompt box display queue to prevent omission of prompt content display. Therefore, the prompt box display method provided by the invention can solve the problems of inaccurate content and missing prompt when the prompt box prompts.
Fig. 2 is a functional block diagram of a prompt box display device according to an embodiment of the present invention.
The prompt box display device 100 of the present invention may be installed in an electronic device. According to the implemented functions, the prompt box display device 100 may include an interface parsing module 101, a first rule class creating module 102, a second rule class creating module 103, a window queue generating module 104, a rule configuring module 105, and a prompt box displaying module 106. The module of the present invention, which may also be referred to as a unit, refers to a series of computer program segments that can be executed by a processor of an electronic device and that can perform a fixed function, and that are stored in a memory of the electronic device.
In the present embodiment, the functions regarding the respective modules/units are as follows:
the interface analysis module 101 is configured to obtain a task thread running on an application interface, and perform interface analysis on the task thread to obtain a system API interface.
In the embodiment of the present invention, the application Interface is executed in an operating system, the operating system is an Android system, optionally, the application Interface is a User Interface (UI), the UI is a medium for interaction and information exchange between the system and the User, and the UI realizes conversion between an internal form of information and a human-acceptable form, so that the User can conveniently and efficiently operate hardware to achieve bidirectional interaction, and complete a desired work by means of the hardware.
In detail, the display, update and control interaction of the UI interface are controlled by a task thread created by the application program at runtime, where the task thread refers to a technology that implements concurrent execution of multiple threads from software or hardware, and the task thread is a single sequential control flow in the program.
The task thread is created based on the Application class of the Android system, and in order to better display the prompt box of the task thread, the embodiment of the invention adds the catch Application class in the Android system and inherits the Application class of the Android system, so that the task thread running on an Application interface is more efficiently acquired.
In this embodiment of the present invention, the interface analysis module 101 is specifically configured to:
acquiring an operating instruction of the task thread;
extracting an interface field in the running instruction;
and analyzing the interface field to obtain a system API interface corresponding to the interface field.
In detail, the running instruction of the task thread refers to a computer instruction used for supporting normal running of the application thread in an operating system, and in the embodiment of the present invention, the running instruction of the task thread in the operating system may be obtained by monitoring using an ASM enhanced bytecode filter, which is a code analysis tool based on a java bytecode level, and the success rate of the data running instruction may be improved by monitoring the running instruction using the ASM enhanced bytecode filter.
Specifically, the extracting an interface field in the execution instruction includes:
traversing the operating instruction and determining the position of a field separator in the operating instruction;
carrying out field splitting on the operation instruction according to the position of the field separator to obtain a plurality of split fields;
carrying out serial number labeling on the plurality of split fields according to a split sequence;
and selecting a splitting field with a preset sequence number as the interface field.
For example, if the operation instruction is "qwe < rt < yuio < pl", where < is a field delimiter, the field splitting of the operation instruction is performed according to the position of the field delimiter in the operation instruction: the method comprises the following steps of dividing four division fields of 'qwe', 'rt', 'yuio' and 'pl', and marking sequence numbers of the division fields as follows according to a division sequence: 1 "qwe", 2 "rt", 3 "yuio" and 4 "pl", for example, if the preset sequence number is 2, the field "rt" is determined to be the interface field.
Further, in the embodiment of the present invention, a preset parser may be used to parse the interface field to obtain a system API interface corresponding to the interface field, where the parser includes CarakanC/C + +, squirrel fisherc + +, squirrel fisherxtremc + +, and the like.
The first rule class creating module 102 is configured to call a task object of the task thread by using the system API interface, and create a window management rule class according to the task object.
In this embodiment of the present invention, the first rule class creating module 102 is specifically configured to:
extracting a calling parameter of the API;
generating a calling request of the API according to the calling parameter;
and executing the calling request by utilizing the API interface to call the task object of the task thread.
In detail, the embodiment of the invention obtains the call parameters from the API interface through a java statement with a parameter crawling function, where the call parameters include, but are not limited to, interface information, a data transmission type, and an interface start condition.
According to the embodiment of the invention, the calling parameters are compiled into the calling requests of the API through a preset compiler, wherein the compiler comprises a Visual Studio compiler, a Dev C + + compiler, a Visual C + + compiler and the like.
In this embodiment of the present invention, the creating a window management rule class according to the task object includes:
extracting object attributes of the task object;
acquiring a preset method list;
screening and acquiring a task method corresponding to the object attribute from the method list;
and encapsulating the task method and the object attribute to obtain a window management rule class.
Specifically, the object attributes are determined by the task object, for example, the task object is "student", and the object attributes include, but are not limited to, name, school number, class.
In detail, the method list includes a plurality of Android systems, and the method is used for identifying functions of a window management rule class which can be realized according to the object attributes, for example, a window management rule class exists, the window management rule class includes a window display data type attribute, and a window data display method, so that the window management rule class can display data corresponding to the window display data type attribute by using the window data display method.
The embodiment of the invention utilizes the encapsulation method in java to encapsulate the task method and the object attribute to obtain the window management rule class.
In detail, the window management rule class is used for acquiring an object to be displayed by a prompt window of a task thread, and the window management rule class includes, but is not limited to, a WindowManager auxiliary class, and the WindowManager auxiliary class includes a ToastHelper task object, a set for storing task threads, a tag for a task object, and the like.
The embodiment of the invention calls the task object of the task thread by using the system API interface, creates the window management rule class according to the task object, can ensure the matching between the created window management rule class and the task object, and is favorable for improving the accuracy of the display content of the prompt box.
The second rule class creating module 103 is configured to construct an auxiliary class, and inherit a preset system display rule class by using the auxiliary class to obtain a window display rule class.
In the embodiment of the invention, the auxiliary class can be obtained by compiling a Java language, and is created in a configuration file of an Android system. The configuration file is an android manifest.
In detail, the auxiliary class includes, but is not limited to, a Toast auxiliary class.
In this embodiment of the present invention, the second rule class creating module 103 is specifically configured to:
acquiring inherited keywords;
and connecting the auxiliary class and the system display rule class by using the inherited keywords to obtain a window display rule class.
In detail, the inheritance key is a key for realizing inheritance relationship between classes, for example, keys such as extensions and instances.
Specifically, the system display rule class includes, but is not limited to, a Handler class, and the function of displaying and hiding the prompt box can be realized through the system display rule class.
In detail, in the embodiment of the present invention, the auxiliary class and the system display rule class may be connected by using an inheritance key, that is, the auxiliary class and the system display rule class are connected by writing the inheritance key between the auxiliary class and the system display rule class, so as to enable the auxiliary class to inherit the system display rule class, for example, there is an auxiliary class a and a system display rule class B, and the auxiliary class a can inherit the system display rule class B by using a statement in the form of "class a extensions B { }" or "class B { } class a extensions B { }".
The embodiment of the invention inherits the preset system display rule class through the auxiliary class to obtain the window display rule class, can realize the control of the display and the hiding of the prompt box by utilizing the window display rule class, and is favorable for improving the display success rate of the prompt box.
The window queue generating module 104 is configured to obtain window display mechanism data, and generate a window queue using the window display mechanism data.
In the embodiment of the present invention, the window display mechanism data includes, but is not limited to, a window display order, a window display duration, a window display status identifier, and an inheritable parent class.
The embodiment of the invention can capture the window display mechanism data from a pre-constructed database by using the python statement with the data capture function, and can improve the efficiency of obtaining the window display mechanism data by using the high throughput of the block chain to the data.
In this embodiment of the present invention, the window queue generating module 104 is specifically configured to:
acquiring a queue tool;
creating a window queue class using the queue tool;
and carrying out variable assignment on the window queue class by using the window display mechanism data to obtain a window queue.
Specifically, the queue tool is an application tool with a window queue creation function, and the queue tool comprises but is not limited to a classwizard tool and a dialogUtil tool. The queue tool is used for creating the window queue class, and the efficiency of creating the window queue class can be improved. By executing the popup tool, the window queue class may be created, including but not limited to the ToastStrategy class.
In detail, in the embodiment of the present invention, variable assignment is performed on the window queue class by using the window display mechanism data, so as to obtain a window queue.
For example, inheriting an inheritable parent class in the window display mechanism data by using a window queue class, adding a window state judgment condition to the window queue by using a window display state identifier in the window display mechanism data, and the like.
The rule configuration module 105 is configured to perform rule configuration on the window queue by using the window management rule class and the window display rule class, so as to obtain a prompt box display queue.
In this embodiment of the present invention, the rule configuration module 105 is specifically configured to: and calling and connecting the window management rule class and the window display rule class by using the window queue to obtain the prompt box display queue.
In detail, the embodiment of the invention realizes the calling connection of the window queue to the window management rule class and the window display rule class through the preset calling function.
Specifically, the invoking connection is to construct a dependency relationship between the window queue and the window management rule class and the window display rule class, so that the window queue can invoke the window management rule class and the window display rule class to implement the functions of the window management rule class and the window display rule class.
The prompt box display module 106 is configured to display the prompt box of the task thread by using the prompt box display queue.
In the embodiment of the present invention, the prompt box displaying module 106 is specifically configured to:
constructing a prompt window by utilizing a prompt box generation function;
acquiring prompt contents of the task thread;
writing the prompt content into the prompt window to obtain a prompt box of the task thread;
and displaying the prompt box by using the prompt box display queue.
In detail, in the embodiment of the present invention, a frame of a prompt window may be created through functions such as a setMessage function, a setItems function, and a setSingleChoiceItems function, and a button of the prompt window may be created in the frame of the prompt window through functions such as a setposivebutton function, a setnegtivetbutton function, and a setNeutralButton function.
Specifically, the prompt box is displayed by using the prompt box display queue, that is, the prompt boxes are displayed according to the sequence of the prompt box display queue.
According to the embodiment of the invention, the task object of the task thread is called by utilizing the system API interface, and the window management rule class is created according to the task object, so that the matching between the created window management rule class and the task object can be ensured, and the accuracy of the content displayed by the prompt box can be improved; the preset system display rule class is inherited through the auxiliary class to obtain a window display rule class, so that the display and hiding of the prompt box can be controlled by utilizing the window display rule class, and the display success rate of the prompt box is improved; and generating a window queue by using the window display mechanism data, carrying out rule configuration on the window queue to obtain a prompt box display queue, and displaying the prompt box of the task thread by using the prompt box display queue to prevent omission of prompt content display. Therefore, the prompt box display device provided by the invention can solve the problems of inaccurate content and missing prompt when the prompt box prompts.
Fig. 3 is a schematic structural diagram of an electronic device implementing a prompt box display method according to an embodiment of the present invention.
The electronic device 1 may comprise a processor 10, a memory 11 and a bus, and may further comprise a computer program, such as a prompt box display program 12, stored in the memory 11 and executable on the processor 10.
The memory 11 includes at least one type of readable storage medium, which includes flash memory, removable hard disk, multimedia card, card-type memory (e.g., SD or DX memory, etc.), magnetic memory, magnetic disk, optical disk, etc. The memory 11 may in some embodiments be an internal storage unit of the electronic device 1, such as a removable hard disk of the electronic device 1. The memory 11 may also be an external storage device of the electronic device 1 in other embodiments, such as a plug-in mobile hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the electronic device 1. Further, the memory 11 may also include both an internal storage unit and an external storage device of the electronic device 1. The memory 11 may be used not only to store application software installed in the electronic device 1 and various types of data, such as codes of the prompt box display program 12, but also to temporarily store data that has been output or is to be output.
The processor 10 may be composed of an integrated circuit in some embodiments, for example, a single packaged integrated circuit, or may be composed of a plurality of integrated circuits packaged with the same or different functions, including one or more Central Processing Units (CPUs), microprocessors, digital Processing chips, graphics processors, and combinations of various control chips. The processor 10 is a Control Unit (Control Unit) of the electronic device, connects various components of the electronic device by using various interfaces and lines, and executes various functions and processes data of the electronic device 1 by running or executing programs or modules (e.g., a prompt box display program, etc.) stored in the memory 11 and calling data stored in the memory 11.
The bus may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is arranged to enable connection communication between the memory 11 and at least one processor 10 or the like.
Fig. 3 shows only an electronic device with components, and it will be understood by those skilled in the art that the structure shown in fig. 3 does not constitute a limitation of the electronic device 1, and may comprise fewer or more components than those shown, or some components may be combined, or a different arrangement of components.
For example, although not shown, the electronic device 1 may further include a power supply (such as a battery) for supplying power to each component, and preferably, the power supply may be logically connected to the at least one processor 10 through a power management device, so as to implement functions of charge management, discharge management, power consumption management, and the like through the power management device. The power supply may also include any component of one or more dc or ac power sources, recharging devices, power failure detection circuitry, power converters or inverters, power status indicators, and the like. The electronic device 1 may further include various sensors, a bluetooth module, a Wi-Fi module, and the like, which are not described herein again.
Further, the electronic device 1 may further include a network interface, and optionally, the network interface may include a wired interface and/or a wireless interface (such as a WI-FI interface, a bluetooth interface, etc.), which are generally used for establishing a communication connection between the electronic device 1 and other electronic devices.
Optionally, the electronic device 1 may further comprise a user interface, which may be a Display (Display), an input unit (such as a Keyboard), and optionally a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, or the like. The display, which may also be referred to as a display screen or display unit, is suitable for displaying information processed in the electronic device 1 and for displaying a visualized user interface, among other things.
It is to be understood that the described embodiments are for purposes of illustration only and that the scope of the appended claims is not limited to such structures.
The prompt box display program 12 stored in the memory 11 of the electronic device 1 is a combination of instructions that, when executed in the processor 10, may implement:
acquiring a task thread running on an application interface, and performing interface analysis on the task thread to obtain a system API (application programming interface);
calling a task object of the task thread by using the system API interface, and creating a window management rule class according to the task object;
establishing an auxiliary class, and inheriting a preset system display rule class by using the auxiliary class to obtain a window display rule class;
acquiring window display mechanism data, and generating a window queue by using the window display mechanism data;
carrying out rule configuration on the window queue by utilizing the window management rule class and the window display rule class to obtain a prompt box display queue;
and displaying the prompt box of the task thread by using the prompt box display queue.
Specifically, the specific implementation method of the processor 10 for the instruction may refer to the description of the relevant steps in the embodiment corresponding to fig. 1, which is not described herein again.
Further, the integrated modules/units of the electronic device 1, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. The computer readable storage medium may be volatile or non-volatile. For example, the computer-readable medium may include: any entity or device capable of carrying said computer program code, recording medium, U-disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM).
The present invention also provides a computer-readable storage medium, storing a computer program which, when executed by a processor of an electronic device, may implement:
acquiring a task thread running on an application interface, and performing interface analysis on the task thread to obtain a system API (application programming interface);
calling a task object of the task thread by using the system API interface, and creating a window management rule class according to the task object;
establishing an auxiliary class, and inheriting a preset system display rule class by using the auxiliary class to obtain a window display rule class;
acquiring window display mechanism data, and generating a window queue by using the window display mechanism data;
carrying out rule configuration on the window queue by utilizing the window management rule class and the window display rule class to obtain a prompt box display queue;
and displaying the prompt box of the task thread by using the prompt box display queue.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus, device and method can be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is only one logical functional division, and other divisions may be realized in practice.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules 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 modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, functional modules in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional module.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential attributes thereof.
The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference signs in the claims shall not be construed as limiting the claim concerned.
The block chain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
Furthermore, it is obvious that the word "comprising" does not exclude other elements or steps, and the singular does not exclude the plural. A plurality of units or means recited in the system claims may also be implemented by one unit or means in software or hardware. The terms second, etc. are used to denote names, but not any particular order.
Finally, it should be noted that the above embodiments are only for illustrating the technical solutions of the present invention and not for limiting, and although the present invention is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions may be made on the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.

Claims (10)

1. A prompt box display method is characterized by comprising the following steps:
acquiring a task thread running on an application interface, and performing interface analysis on the task thread to obtain a system API (application programming interface);
calling a task object of the task thread by using the system API interface, and creating a window management rule class according to the task object;
establishing an auxiliary class, and inheriting a preset system display rule class by using the auxiliary class to obtain a window display rule class;
acquiring window display mechanism data, and generating a window queue by using the window display mechanism data;
carrying out rule configuration on the window queue by utilizing the window management rule class and the window display rule class to obtain a prompt box display queue;
and displaying the prompt box of the task thread by using the prompt box display queue.
2. The method for displaying a prompt box according to claim 1, wherein the performing interface resolution on the task thread to obtain a system API interface comprises:
acquiring an operating instruction of the task thread;
extracting an interface field in the running instruction;
and analyzing the interface field to obtain a system API interface corresponding to the interface field.
3. The method of claim 2, wherein said extracting the interface field in the run instruction comprises:
traversing the operating instruction and determining the position of a field separator in the operating instruction;
carrying out field splitting on the operation instruction according to the position of the field separator to obtain a plurality of split fields;
carrying out serial number labeling on the plurality of split fields according to a split sequence;
and selecting a splitting field with a preset sequence number as the interface field.
4. The method of claim 1, wherein said invoking a task object of the task thread using the system API interface comprises:
extracting a calling parameter of the API;
generating a calling request of the API according to the calling parameter;
and executing the calling request by utilizing the API interface to call the task object of the task thread.
5. The method of claim 1, wherein creating a window management rule class from the task object comprises:
extracting object attributes of the task object;
acquiring a preset method list;
screening and acquiring a task method corresponding to the object attribute from the method list;
and encapsulating the task method and the object attribute to obtain a window management rule class.
6. The prompt box display method according to any one of claims 1 to 5, wherein inheriting a preset system display rule class by using the auxiliary class to obtain a window display rule class, comprises:
acquiring inherited keywords;
and connecting the auxiliary class and the system display rule class by using the inherited keywords to obtain a window display rule class.
7. The prompt box display method according to any one of claims 1 to 5, wherein the displaying the prompt box of the task thread by using the prompt box display queue comprises:
constructing a prompt window by utilizing a prompt box generation function;
acquiring prompt contents of the task thread;
writing the prompt content into the prompt window to obtain a prompt box of the task thread;
and displaying the prompt box by using the prompt box display queue.
8. A prompt box display apparatus, the apparatus comprising:
the interface analysis module is used for acquiring a task thread running on an application interface, and performing interface analysis on the task thread to obtain a system API (application programming interface);
the first rule class creating module is used for calling a task object of the task thread by using the system API interface and creating a window management rule class according to the task object;
the second rule class creating module is used for constructing an auxiliary class, and inheriting a preset system display rule class by using the auxiliary class to obtain a window display rule class;
the window queue generating module is used for acquiring window display mechanism data and generating a window queue by utilizing the window display mechanism data;
the rule configuration module is used for carrying out rule configuration on the window queue by utilizing the window management rule class and the window display rule class to obtain a prompt box display queue;
and the prompt box display module is used for displaying the prompt box of the task thread by utilizing the prompt box display queue.
9. An electronic device, characterized in that the electronic device comprises:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform a prompt box display method as claimed in any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the prompt box display method according to any one of claims 1 to 7.
CN202011581313.2A 2020-12-28 2020-12-28 Prompt box display method and device, electronic equipment and computer readable storage medium Pending CN112527443A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011581313.2A CN112527443A (en) 2020-12-28 2020-12-28 Prompt box display method and device, electronic equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011581313.2A CN112527443A (en) 2020-12-28 2020-12-28 Prompt box display method and device, electronic equipment and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN112527443A true CN112527443A (en) 2021-03-19

Family

ID=74976806

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011581313.2A Pending CN112527443A (en) 2020-12-28 2020-12-28 Prompt box display method and device, electronic equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN112527443A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113760433A (en) * 2021-09-06 2021-12-07 中广核工程有限公司 Sequence control-oriented nuclear power plant monitoring method and system and computer equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110035697A1 (en) * 2009-08-07 2011-02-10 Microsoft Corporation Autonomous display management of graphical interfaces
CN106371824A (en) * 2016-08-23 2017-02-01 广州优视网络科技有限公司 Portable device and application popup message display control method and apparatus
CN106383712A (en) * 2016-09-21 2017-02-08 武汉斗鱼网络科技有限公司 Toast component realization method and system
CN106445533A (en) * 2016-09-28 2017-02-22 北京金山安全软件有限公司 Toast display method and device and electronic equipment
CN106951332A (en) * 2017-03-01 2017-07-14 腾讯科技(深圳)有限公司 message dispatching method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110035697A1 (en) * 2009-08-07 2011-02-10 Microsoft Corporation Autonomous display management of graphical interfaces
CN106371824A (en) * 2016-08-23 2017-02-01 广州优视网络科技有限公司 Portable device and application popup message display control method and apparatus
CN106383712A (en) * 2016-09-21 2017-02-08 武汉斗鱼网络科技有限公司 Toast component realization method and system
CN106445533A (en) * 2016-09-28 2017-02-22 北京金山安全软件有限公司 Toast display method and device and electronic equipment
CN106951332A (en) * 2017-03-01 2017-07-14 腾讯科技(深圳)有限公司 message dispatching method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
纪晓阳;: "线程在Android开发中的应用", 软件, vol. 34, no. 08, pages 24 - 26 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113760433A (en) * 2021-09-06 2021-12-07 中广核工程有限公司 Sequence control-oriented nuclear power plant monitoring method and system and computer equipment
CN113760433B (en) * 2021-09-06 2023-12-15 中广核工程有限公司 Nuclear power plant monitoring method, system and computer equipment oriented to sequential control

Similar Documents

Publication Publication Date Title
CN112085217A (en) Method, device, equipment and computer medium for deploying artificial intelligence service
CN113238929B (en) Code testing method and device based on Mock data, electronic equipment and storage medium
CN112506779A (en) Software interface testing method and device, electronic equipment and storage medium
CN112579098A (en) Software release method and device, electronic equipment and readable storage medium
CN114020256A (en) Front-end page generation method, device and equipment and readable storage medium
CN114398194A (en) Data collection method and device, electronic equipment and readable storage medium
CN115129753A (en) Data blood relationship analysis method and device, electronic equipment and storage medium
CN114356530A (en) Task scheduling method and device, electronic equipment and storage medium
CN113360139A (en) Integration method and device of front-end frame, electronic equipment and storage medium
CN113468175A (en) Data compression method and device, electronic equipment and storage medium
CN112527443A (en) Prompt box display method and device, electronic equipment and computer readable storage medium
CN112541688A (en) Service data checking method and device, electronic equipment and computer storage medium
CN112486490A (en) Front-end code packaging method and device, electronic equipment and storage medium
CN111625236A (en) Front-end development method and device based on componentization, electronic equipment and storage medium
CN114816371B (en) Message processing method, device, equipment and medium
CN114911479A (en) Interface generation method, device, equipment and storage medium based on configuration
CN115220740A (en) Database environment deployment method and device, electronic equipment and storage medium
CN114398282A (en) Test script generation method, device, equipment and storage medium
CN114020414A (en) Symbiotic method and device of Android system and bottom layer Linux, electronic equipment and storage medium
CN114356379A (en) Backup-based service upgrading method, device, equipment and storage medium
CN113918305A (en) Node scheduling method and device, electronic equipment and readable storage medium
CN114003311A (en) Progress bar configuration method based on artificial intelligence and related equipment
CN113342472A (en) Micro-service cluster creating method and device, electronic equipment and readable storage medium
CN112214256A (en) Operation control method and device for machine learning, electronic equipment and storage medium
CN112631675A (en) Workflow configuration method, device, equipment and computer readable 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