Disclosure of Invention
The present invention aims to provide a method, an apparatus, a terminal, and a storage medium for displaying a device status, so as to solve the problem in the related art that only a device can be controlled to perform corresponding processing, but a user corresponding to a terminal device cannot know an operating status of the device, thereby reducing user experience.
In order to achieve the above purpose, the embodiment of the present invention adopts the following technical solutions:
in a first aspect, an embodiment of the present invention provides a method for displaying an apparatus status, which is applied to a terminal presenting a graphical user interface, where the graphical user interface displays: spliced programming building blocks comprising:
responding to the running operation input aiming at the programming building block, and sending a target program code corresponding to the programming building block to the controlled equipment so as to enable the controlled equipment to execute the target program code;
acquiring state information of the controlled equipment in the process of executing the target program code;
and displaying the state information of the controlled equipment on the graphical user interface.
Optionally, before the obtaining of the state information of the controlled device in the process of executing the object program code, the method further includes:
generating a state interface on the graphical user interface according to the attribute information of the controlled equipment;
the displaying the state information of the controlled device on the graphical user interface comprises:
and displaying the state information of the controlled equipment on the state interface.
Optionally, the status interface includes: the state control of a plurality of hardware modules on the controlled device, the state information of the controlled device includes: status information of the plurality of hardware modules;
the displaying the state information of the controlled device on the state interface comprises:
and displaying the state information of each hardware module through the state control corresponding to each hardware module on the state interface.
Optionally, the attribute information includes: a list of attributes of a plurality of hardware modules on the controlled device; generating a state interface on the graphical user interface according to the attribute information of the controlled device, wherein the state interface comprises:
and generating the state interface on which the state controls of the plurality of hardware modules are displayed on the graphical user interface according to the attribute information of the plurality of hardware modules in the attribute list of the plurality of hardware modules.
Optionally, the method further includes:
responding to a stop operation input aiming at the programming building block, and sending a stop execution instruction to the controlled equipment so as to enable the controlled equipment to stop executing the target program code according to the stop execution instruction;
and canceling the display of the state information of the controlled equipment.
Optionally, the method further includes:
in the programming building block, determining a target programming building block corresponding to a target subprogram code being executed in the target program code, wherein the target program code comprises: a plurality of sub-program codes;
in the graphical user interface, a marker display is performed on the target programming building block in the programming building blocks.
Optionally, the state information of the controlled device includes: status check information and valid status information;
before presenting the state information of the controlled device on the graphical user interface, the method further comprises:
verifying the effective state information according to the state verification information to obtain a verification result;
the displaying the state information of the controlled device on the graphical user interface comprises:
and if the verification result indicates that the verification is successful, displaying the effective state information on the graphical user interface.
In a second aspect, an embodiment of the present invention further provides a terminal applied to present a graphical user interface, where the graphical user interface displays: spliced programming building blocks comprising:
the sending module is used for responding to the running operation input aiming at the programming building block and sending a target program code corresponding to the programming building block to the controlled equipment so as to enable the controlled equipment to execute the target program code;
the acquisition module is used for acquiring the state information of the controlled equipment in the process of executing the target program code;
and the display module is used for displaying the state information of the controlled equipment on the graphical user interface.
Optionally, the apparatus further comprises:
the generating module is used for generating a state interface on the graphical user interface according to the attribute information of the controlled equipment;
the display module is further used for displaying the state information of the controlled equipment on the state interface.
Optionally, the status interface includes: the state control of a plurality of hardware modules on the controlled device, the state information of the controlled device includes: status information of the plurality of hardware modules;
the display module is further configured to display the status information of each hardware module through a status control corresponding to each hardware module on the status interface.
Optionally, the attribute information includes: a list of attributes of a plurality of hardware modules on the controlled device; the generating module is further configured to generate the status interface on which the status controls of the plurality of hardware modules are displayed on the graphical user interface according to the attribute information of the plurality of hardware modules in the attribute list of the plurality of hardware modules.
Optionally, the apparatus further comprises:
a first sending module, configured to send an execution stop instruction to the controlled device in response to a stop operation input for the programming building block, so that the controlled device stops executing the target program code according to the execution stop instruction;
and the cancellation display module is used for canceling and displaying the state information of the controlled equipment.
Optionally, the apparatus further comprises:
a determining module, configured to determine, in the programming building block, a target programming building block corresponding to a target sub-program code being executed in the target program code, where the target program code includes: a plurality of sub-program codes;
and the mark display module is used for displaying marks of the target programming building blocks in the graphical user interface.
Optionally, the state information of the controlled device includes: status check information and valid status information;
the device further comprises:
the first obtaining module is used for carrying out verification processing on the effective state information according to the state verification information to obtain a verification result;
the display module is further configured to display the valid state information on the graphical user interface if the verification result indicates that the verification is successful.
In a third aspect, an embodiment of the present invention further provides a terminal, including: a memory storing a computer program executable by the processor, and a processor implementing the method for displaying a device status according to any one of the first aspect.
In a fourth aspect, an embodiment of the present invention further provides a storage medium, where a computer program is stored on the storage medium, and when the computer program is read and executed, the method for displaying the device status according to any one of the first aspect is implemented.
The invention has the beneficial effects that: the embodiment of the application provides a method for displaying equipment state, which is applied to a terminal presenting a graphical user interface, wherein the graphical user interface displays: the spliced programming building block comprises the following steps: responding to the running operation input aiming at the programming building block, and sending a target program code corresponding to the programming building block to the controlled equipment so as to enable the controlled equipment to execute the target program code; acquiring state information of controlled equipment in the process of executing a target program code; and displaying the state information of the controlled equipment on the graphical user interface. In the process that the controlled equipment executes the target program codes corresponding to the spliced programming building blocks, the state information of the controlled equipment is obtained, and the state information of the controlled equipment is displayed, so that a user can know the state of the control equipment when executing the target program codes, and the user experience is improved.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention.
Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
In the description of the present application, it should be noted that if the terms "upper", "lower", etc. are used for indicating the orientation or positional relationship based on the orientation or positional relationship shown in the drawings or the orientation or positional relationship which is usually arranged when the product of the application is used, the description is only for convenience of describing the application and simplifying the description, but the indication or suggestion that the referred device or element must have a specific orientation, be constructed in a specific orientation and operation, and thus, cannot be understood as the limitation of the application.
Furthermore, the terms "first," "second," and the like in the description and in the claims, as well as in the drawings, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It should be noted that the features of the embodiments of the present application may be combined with each other without conflict.
Fig. 1 is a schematic structural diagram of a device status display system according to an embodiment of the present invention, and as shown in fig. 1, the device status display system may include: a terminal 101 and a controlled device 102, wherein the controlled device 102 may include: acommunication module 1021, and a plurality ofhardware modules 1022.
The terminal 101 is communicatively connected to acommunication module 1021, and thecommunication module 1021 is communicatively connected to eachhardware module 1022.
In some embodiments, a graphical user interface may be displayed on the terminal 101, in which: and (5) splicing the programming building blocks. The terminal 101 can respond to the running operation input aiming at the programming building block and send the target program code corresponding to the programming building block to the controlled equipment 102 so as to enable the controlled equipment 102 to execute the target program code; acquiring state information of the controlled equipment 102 in the process of executing the target program code; the status information of the controlled device 102 is presented on a graphical user interface.
It should be noted that thecommunication module 1021 may be a bluetooth module, a WiFi (wireless fidelity) (mobile hotspot) module, or another type of module capable of performing communication, which is not limited in this embodiment of the present application.
In this embodiment, the terminal 101 may be any one of the following: the terminal 101 may be other devices having processing and displaying functions, and the embodiment of the present application is not limited to this specifically.
The following explains a method for displaying a device status provided in the embodiment of the present application, with a terminal as an execution subject.
Fig. 2 is a schematic flowchart of a method for displaying a device status according to an embodiment of the present invention, and as shown in fig. 2, the method may include:
s201, responding to the running operation input aiming at the programming building block, and sending the target program code corresponding to the programming building block to the controlled equipment so that the controlled equipment can execute the target program code.
Wherein, the terminal can present a graphical user interface, and the graphical user interface displays: and (5) splicing the programming building blocks. Optionally, the spliced programming building blocks may be: and responding to the input splicing operation aiming at the plurality of sub programming building blocks to obtain the spliced programming building block.
In some embodiments, a download control is displayed on the graphical user interface, the terminal can respond to an input selection operation for the download control to download a target program code corresponding to the programming building block to the controlled device, and the controlled device can acquire the target program code and then can execute the target program code.
It should be noted that, when the controlled device includes a communication module and a plurality of hardware modules, the terminal may download the object program code to the communication module, and may control the controlled device based on the object program code in the communication module.
S202, acquiring state information of the controlled device in the process of executing the target program code.
In the embodiment of the application, in the process of executing the target program code, the controlled device may feed back the state information to the terminal at intervals of a preset time or in real time. Of course, the terminal may also obtain the state information from the controlled device at a preset time interval or in real time, which is not specifically limited in the embodiment of the present application.
And S203, displaying the state information of the controlled equipment on the graphical user interface.
The state information of the controlled equipment is displayed on the graphical user interface, and a user can know the state information of the controlled equipment from the graphical user interface.
It should be noted that the terminal may directly display the state information of the controlled device on the graphical user interface, and the terminal may also display the state information of the controlled device in a pop-up window manner on the graphical user interface. Of course, the terminal may also display the state information of the controlled device on the graphical user interface in other manners, which is not specifically limited in this embodiment of the application.
In this embodiment of the application, a visual programming application is installed on the terminal, and the terminal may use the visual programming application to execute the processes in S201 to S203, for example, the visual programming application may be block.
To sum up, the embodiment of the present application provides a method for displaying a device status, which is applied to a terminal presenting a graphical user interface, where the graphical user interface displays: the spliced programming building block comprises the following steps: responding to the running operation input aiming at the programming building block, and sending a target program code corresponding to the programming building block to the controlled equipment so as to enable the controlled equipment to execute the target program code; acquiring state information of controlled equipment in the process of executing a target program code; and displaying the state information of the controlled equipment on the graphical user interface. In the process that the controlled equipment executes the target program codes corresponding to the spliced programming building blocks, the state information of the controlled equipment is obtained, and the state information of the controlled equipment is displayed, so that a user can know the state of the control equipment when executing the target program codes, and the user experience is improved.
Optionally, fig. 3 is a flowchart illustrating a method for displaying a device status according to an embodiment of the present invention, as shown in fig. 3, before acquiring status information of a controlled device in a process of executing an object program code in S202, the method may further include:
s301, generating a state interface on the graphical user interface according to the attribute information of the controlled equipment. The displaying the state information of the controlled device on the graphical user interface in S203 may include:
s302, displaying the state information of the controlled equipment on the state interface.
In the embodiment of the application, the terminal can divide a part of target area on the graphical user interface as a state interface according to the attribute information of the controlled equipment; and then presenting the state information of the controlled equipment on the target area.
In addition, the terminal can also generate a popup on a graphical user interface according to the attribute information of the controlled equipment, and the popup is used as a state interface; and then displaying the state information of the controlled equipment on the pop-up window.
Of course, the terminal may also generate a status interface on the graphical user interface in other manners, and display the status information of the controlled device on the status interface, which is not limited in this embodiment of the application.
Optionally, the status interface may include: the state control of a plurality of hardware modules on the controlled device, and the state information of the controlled device may include: status information of a plurality of hardware modules.
The sudden change displayed by the state control corresponding to different hardware modules can be different.
On the state interface, the state information of the controlled equipment is displayed, and the method comprises the following steps:
and displaying the state information of each hardware module through the state control corresponding to each hardware module on the state interface.
In some embodiments, after the state interface is generated on the graphical user interface in S301, the state control of each hardware module on the state interface has an initial state, and after the terminal acquires the state information of the plurality of hardware modules, the terminal may update and display the initial state of the state control corresponding to each hardware module on the state interface according to the state information of the plurality of hardware modules, so as to display the state information of each hardware module.
For example, the initial state of the state control of each hardware module may be: the state control is displayed in gray, and after the state information of the plurality of hardware modules is acquired, the initial states of the plurality of hardware modules can be updated according to the state information (for example, parameter information, whether the state information is started or not, and color state information) of the plurality of hardware modules and displayed in color.
In some implementations, the plurality of hardware modules may include: buttons, LED (light emitting diode) lights, steering engines, distance sensors, etc. The state information of the button can indicate whether the button is pressed, the state information of the LED lamp can indicate the color of the LED lamp (for example, the color can be any one of red, green and blue, and different colors can indicate different information), the state information of the steering engine can indicate the angle of the steering engine, and the state information of the distance sensor can indicate the distance collected by the distance sensor.
Fig. 4 is a schematic display diagram of a status interface according to an embodiment of the present invention, and as shown in fig. 4, a status control of a button, a status control of an LED lamp, a status control of a steering engine angle, and a status control of a distance sensor are displayed on the status interface.
On the status interface, the terminal may update the status control of the display button according to the status information of the button, for example, display the status control of the button in a pressed state; the status control for displaying the LED lamp may be updated according to the status information of the LED lamp, for example, the status control for the LED lamp is displayed in red; the state control that shows the steering wheel can be updated according to the state information of steering wheel, for example, the state control with the steering wheel shows as: the steering engine is 30 degrees; the state control displaying the distance sensor may be updated according to the state information of the distance sensor, for example, the state control displaying the distance sensor is displayed as: the distance is 10 cm.
Of course, fig. 4 is only an example, and the status control displayed in the status interface may be displayed according to status information of a plurality of hardware modules and a plurality of hardware modules in the controlled device, which is not limited in this embodiment of the present application.
Optionally, the attribute information includes: a list of attributes of the plurality of hardware modules; generating a state interface on the graphical user interface according to the attribute information of the controlled equipment, wherein the state interface comprises:
and generating a state interface on which state controls of the plurality of hardware modules are displayed on the graphical user interface according to the attribute information of the plurality of hardware modules in the attribute list of the plurality of hardware modules.
The plurality of hardware modules are the hardware modules which are currently connected with the terminal. The hardware modules with different attribute information and the state controls of the hardware modules displayed in the state interface are different.
For example, the attribute list of the plurality of hardware modules may include: the button, the LED lamp, the steering engine and the distance sensor are all different in corresponding attribute information. As shown in fig. 4, the icons of the status controls for the buttons, LED lights, steering engine, and distance sensors are also different.
Optionally, the attribute list of the plurality of hardware modules may include: the first button and the second button are similar in property, so that state controls of two identical buttons can be displayed in a state interface and are respectively marked as the first button and the second button.
Optionally, fig. 5 is a schematic flowchart of a method for displaying a device status according to an embodiment of the present invention, and as shown in fig. 5, the method may further include:
s501, responding to the stop operation input aiming at the programming building block, and sending an execution stop instruction to the controlled equipment so that the controlled equipment stops executing the target program code according to the execution stop instruction.
In some embodiments, a stop control may be displayed on the graphical user interface, the terminal determines to stop running of the target program code corresponding to the programmed building block in response to an input selection operation for the stop control, sends an execution stop instruction to the controlled device, and the controlled device may receive the execution stop instruction and stop executing the target program code according to the execution stop instruction.
And S502, canceling the display of the state information of the controlled equipment.
In the embodiment of the application, if the state information of the controlled device is directly displayed on the graphical user interface, the state information of the controlled device can be directly canceled from being displayed. And if the state information of the controlled equipment is displayed on the state interface, canceling the display of the state interface on the graphical user interface.
Optionally, if the status interface occupies a part of the graphical user interface, a partial area of the status interface may be displayed in a full screen; if the status interface is displayed in the form of a popup on the graphical user interface, the display of the popup may be cancelled.
It should be noted that, the operations referred to in the embodiment of the present application, for example, the operation and the stop operation, may be touch operations, may also be operations input by using external devices of the terminal, for example, operations input by using a mouse and/or a keyboard, and of course, may also be operations input by using other manners, which is not limited in the embodiment of the present application.
Optionally, fig. 6 is a schematic flowchart of a method for displaying a device status according to an embodiment of the present invention, and as shown in fig. 6, the method may further include:
s601, in the programming building block, determining a target programming building block corresponding to the target subprogram code being executed in the target program code.
Wherein the object program code comprises: a plurality of sub-program codes.
It should be noted that the target program code includes a plurality of program code modules, each program code module may correspond to one sub-programming building block in the spliced programming building blocks, and each program code module may include a plurality of sub-program codes, where the first line sub-program code of each program code module may include a sub-programming building block identifier corresponding to the program code module in which the program code module is located.
In some embodiments, when executing a plurality of program code modules in the target program code, the controlled device may feed back the sub-programming building block identification in a first program code to the terminal when executing the first program code in the first program code, and the terminal may regard the sub-programming building block corresponding to the sub-programming building block identification as the target programming building block.
And S602, in the graphical user interface, marking and displaying the target programming building blocks in the programming building blocks.
In an embodiment of the application, the terminal may highlight a target one of the programming building blocks.
Optionally, the state information of the controlled device includes: status check information and valid status information;
fig. 7 is a flowchart of a method for displaying a device status according to an embodiment of the present invention, and as shown in fig. 7, before the process of displaying the status information of the controlled device on the graphical user interface in S203, the method may further include:
and S701, verifying the effective state information according to the state verification information to obtain a verification result.
It should be noted that the status information of the controlled device may be in the form of a data packet, and the beginning of the data packet has a flag (for example, may be 0xaa), which indicates the status of the device. And then with a length of 2 bytes to illustrate the total length of the packet. After the total length, the status check information and the valid status information are added.
The process of displaying the state information of the controlled device on the graphical user interface in S203 may include:
and S702, if the verification result indicates that the verification is successful, displaying effective state information on a graphical user interface.
And if the verification result indicates that the verification is unsuccessful, canceling to display the effective state information, and waiting for the further state information fed back by the controlled equipment.
To sum up, the embodiment of the present application provides a method for displaying a device status, which is applied to a terminal presenting a graphical user interface, where the graphical user interface displays: the spliced programming building block, the method may include: responding to the running operation input aiming at the programming building block, and sending a target program code corresponding to the programming building block to the controlled equipment so as to enable the controlled equipment to execute the target program code; acquiring state information of controlled equipment in the process of executing a target program code; and displaying the state information of the controlled equipment on the graphical user interface. In the process that the controlled equipment executes the target program codes corresponding to the spliced programming building blocks, the state information of the controlled equipment is obtained, and the state information of the controlled equipment is displayed, so that a user can know the state of the control equipment when executing the target program codes, and the user experience is improved.
Moreover, the state of the controlled equipment and the currently running target programming building block can be displayed in real time, so that the debugging of a user is facilitated, and the user is helped to better edit the program corresponding to the programming building block.
Specific implementation processes and technical effects of the device status display apparatus, the terminal, the storage medium, and the like for executing the device status display method provided by the present application are described below with reference to the related contents of the device status display method, and are not described again below.
Fig. 8 is a schematic structural diagram of an apparatus for displaying device status according to an embodiment of the present invention, and as shown in fig. 8, the apparatus may include:
a sendingmodule 801, configured to send, in response to an operation input for the programming building block, a target program code corresponding to the programming building block to a controlled device, so that the controlled device executes the target program code;
an obtainingmodule 802, configured to obtain status information of the controlled device in the process of executing the target program code;
adisplay module 803, configured to display the status information of the controlled device on the graphical user interface.
Optionally, the apparatus further comprises:
the generating module is used for generating a state interface on the graphical user interface according to the attribute information of the controlled equipment;
the displayingmodule 803 is further configured to display the status information of the controlled device on the status interface.
Optionally, the status interface includes: the state control of a plurality of hardware modules on the controlled device, the state information of the controlled device includes: status information of the plurality of hardware modules;
the displayingmodule 803 is further configured to display the status information of each hardware module through a status control corresponding to each hardware module on the status interface.
Optionally, the attribute information includes: a list of attributes of the plurality of hardware modules; the generating module is further configured to generate the status interface on which the status controls of the plurality of hardware modules are displayed on the graphical user interface according to the attribute information of the plurality of hardware modules in the attribute list of the plurality of hardware modules.
Optionally, the apparatus further comprises:
a first sending module, configured to send an execution stop instruction to the controlled device in response to a stop operation input for the programming building block, so that the controlled device stops executing the target program code according to the execution stop instruction;
and the cancellation display module is used for canceling and displaying the state information of the controlled equipment.
Optionally, the apparatus further comprises:
a determining module, configured to determine, in the programming building block, a target programming building block corresponding to a target sub-program code being executed in the target program code, where the target program code includes: a plurality of sub-program codes;
and the mark display module is used for displaying marks of the target programming building blocks in the graphical user interface.
Optionally, the state information of the controlled device includes: status check information and valid status information;
the device further comprises:
the first obtaining module is used for carrying out verification processing on the effective state information according to the state verification information to obtain a verification result;
the displayingmodule 803 is further configured to display the valid state information on the graphical user interface if the verification result indicates that the verification is successful.
The above-mentioned apparatus is used for executing the method provided by the foregoing embodiment, and the implementation principle and technical effect are similar, which are not described herein again.
These above modules may be one or more integrated circuits configured to implement the above methods, such as: one or more Application Specific Integrated Circuits (ASICs), or one or more microprocessors (DSPs), or one or more Field Programmable Gate Arrays (FPGAs), among others. For another example, when one of the above modules is implemented in the form of a Processing element scheduler code, the Processing element may be a general-purpose processor, such as a Central Processing Unit (CPU) or other processor capable of calling program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).
Fig. 9 is a schematic structural diagram of an apparatus for displaying device status according to an embodiment of the present invention, and as shown in fig. 9, the terminal may include: a processor 901, amemory 902.
Thememory 902 is used for storing programs, and the processor 901 calls the programs stored in thememory 902 to execute the above method embodiments. The specific implementation and technical effects are similar, and are not described herein again.
Optionally, the invention also provides a program product, for example a computer-readable storage medium, comprising a program which, when being executed by a processor, is adapted to carry out the above-mentioned method embodiments.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units 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 unit.
The integrated unit implemented in the form of a software functional unit may be stored in a computer readable storage medium. The software functional unit is stored in a storage medium and includes several instructions to enable a computer device (which may be a personal computer, a server, or a network device) or a processor (processor) to execute some steps of the methods according to the embodiments of the present invention. And the aforementioned storage medium includes: a U disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above is only a preferred embodiment of the present invention, and is not intended to limit the present invention, and various modifications and changes will occur to those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.