CN120045259A - Screen display method, system, device, electronic equipment and readable medium - Google Patents
Screen display method, system, device, electronic equipment and readable medium Download PDFInfo
- Publication number
- CN120045259A CN120045259A CN202411917790.XA CN202411917790A CN120045259A CN 120045259 A CN120045259 A CN 120045259A CN 202411917790 A CN202411917790 A CN 202411917790A CN 120045259 A CN120045259 A CN 120045259A
- Authority
- CN
- China
- Prior art keywords
- screen
- user interface
- control unit
- micro control
- binary file
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
- G06F9/451—Execution arrangements for user interfaces
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/10—Program control for peripheral devices
- G06F13/102—Program control for peripheral devices where the programme performs an interfacing function, e.g. device driver
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/10—Program control for peripheral devices
- G06F13/12—Program control for peripheral devices using hardware independent of the central processor, e.g. channel or peripheral processor
- G06F13/124—Program control for peripheral devices using hardware independent of the central processor, e.g. channel or peripheral processor where hardware is a sequential transfer control unit, e.g. microprocessor, peripheral processor or state-machine
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/38—Information transfer, e.g. on bus
- G06F13/42—Bus transfer protocol, e.g. handshake; Synchronisation
- G06F13/4282—Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Software Systems (AREA)
- Computer Hardware Design (AREA)
- Microelectronics & Electronic Packaging (AREA)
- Human Computer Interaction (AREA)
- Digital Computer Display Output (AREA)
Abstract
The embodiment of the invention provides a screen display method, a system, a device, electronic equipment and a readable medium. The method is applied to an upper computer, the upper computer is in communication connection with a micro control unit, the micro control unit is used for controlling a screen, the method comprises the steps of generating user interface data corresponding to the screen based on a lightweight multifunctional graphic library, converting the user interface data into a binary file for the micro control unit, writing the binary file into the micro control unit, and controlling the screen to display a user interface corresponding to the binary file after the micro control unit is powered on. According to the screen display method provided by the embodiment of the invention, the user interface data corresponding to the screen is generated through the lightweight multifunctional graphic library and written into the micro control unit for user interface display, so that the user interface generation efficiency can be effectively improved.
Description
Technical Field
The present invention relates to the field of electronic technology, and in particular, to a screen display method, a screen display system, a screen display device, an electronic apparatus, and a computer readable medium.
Background
In the field of rapidly developing embedded systems, the LCD screen serves as a key bridge for connecting users and devices, and its performance and flexibility become core elements of product competitiveness. With the rising of emerging applications such as the internet of things, intelligent home, wearable equipment and the like, a user puts forward higher requirements on the interactive experience of the equipment, and an LCD screen is used as a main interface of man-machine interaction, so that the market competitiveness of a product is directly determined by the display effect, response speed, power consumption and flexibility of interface design.
The traditional driving mode needs complex hardware interface support, such as a parallel interface, an SPI interface or an I2C interface, and the design and debugging process of the interfaces are complex and time-consuming, so that the difficulty of system construction is increased. Secondly, driving the LCD screen requires deep firmware programming intervention, and the developer needs to write a large amount of underlying driving code to realize initialization, data transmission and display control of the screen. The driving mode depending on hardware and firmware not only increases the threshold and cost of system construction, but also prolongs the development period, and is difficult to meet the market demand of quick iteration.
Disclosure of Invention
The embodiment of the invention provides a screen display method, a system, a device, electronic equipment and a computer readable storage medium, which are used for solving the problem of complex development of a user interface.
The embodiment of the invention discloses a screen display method which is applied to an upper computer, wherein the upper computer is in communication connection with a micro control unit, the micro control unit is used for controlling a screen, and the method comprises the following steps:
Generating user interface data corresponding to the screen based on a lightweight multifunctional graphic library;
Converting the user interface data into a binary file for the micro control unit;
And the micro control unit is used for controlling the screen to display a user interface corresponding to the binary file after being electrified.
Optionally, the method further comprises:
And running a preset firmware program in the micro control unit, wherein the firmware program is used for communicating with the upper computer through a preset serial port and driving the screen to display a user interface.
Optionally, the step of writing the binary file into the micro control unit includes:
The micro control unit is specifically used for generating a user interface based on the analysis of the binary file by the firmware program and controlling the screen to display the user interface.
Optionally, the step of generating the user interface data corresponding to the screen based on the lightweight multifunctional graphic library includes:
and determining at least one of a button element, a text box element and an icon element in the user interface based on the lightweight multifunctional graphic library to obtain user interface data corresponding to the screen.
The embodiment of the invention also provides a screen display method which is applied to the micro control unit, wherein the micro control unit is in communication connection with the upper computer, and the micro control unit is used for controlling a screen, and the method comprises the following steps:
the method comprises the steps of receiving a binary file sent by an upper computer, generating user interface data corresponding to a screen through the upper computer based on a lightweight multifunctional graphic library, converting the user interface data into the binary file for a micro control unit, and writing the binary file into the micro control unit to obtain the binary file;
And after power-on, controlling the screen to display a user interface corresponding to the binary file.
Optionally, the micro control unit is specifically configured to connect to the screen through a preset screen interface circuit, and the step of controlling the screen to display a user interface corresponding to the binary file includes:
And controlling the screen to display a user interface corresponding to the binary file through the screen interface circuit.
Optionally, the method further comprises:
And updating the user interface displayed on the screen according to the control instruction sent by the user based on the screen.
Optionally, the step of updating the user interface displayed on the screen according to the control instruction sent by the user based on the screen comprises the following steps:
monitoring whether a control of the user interface changes;
Under the condition that the control of the user interface is changed, determining a control instruction sent by the user based on the screen;
determining an interface element corresponding to the control instruction based on the binary file, wherein the interface element comprises at least one of a button element, a text box element and an icon element;
and updating the user interface displayed on the screen by adopting the interface element.
The embodiment of the invention also provides a screen display system, which comprises an upper computer and a micro control unit, wherein the upper computer is in communication connection with the micro control unit, and the micro control unit is used for controlling a screen;
the upper computer is used for generating user interface data corresponding to the screen based on the lightweight multifunctional graphic library;
the upper computer is used for converting the user interface data into a binary file for the micro control unit;
The upper computer is used for writing the binary file into the micro control unit;
The micro control unit is used for receiving the binary file sent by the upper computer;
And the micro control unit is used for controlling the screen to display the user interface corresponding to the binary file after power-on.
The embodiment of the invention also provides a screen display device, which is applied to an upper computer, wherein the upper computer is in communication connection with a micro control unit, the micro control unit is used for controlling a screen, and the device comprises:
the data generation module is used for generating user interface data corresponding to the screen based on the lightweight multifunctional graphic library;
The data conversion module is used for converting the user interface data into a binary file for the micro control unit;
The micro control unit is used for controlling the screen to display a user interface corresponding to the binary file after being electrified.
Optionally, the apparatus further comprises:
the device comprises a micro control unit, a firmware program running module, a screen display user interface and a control module, wherein the micro control unit is used for controlling the micro control unit to display a screen, the firmware program running module is used for running a preset firmware program in the micro control unit, and the firmware program is used for communicating with the upper computer through a preset serial port and driving the screen display user interface.
Optionally, the file writing module includes:
The micro control unit is specifically used for generating a user interface based on the analysis of the binary file by the firmware program and controlling the screen to display the user interface.
Optionally, the data generating module includes:
And the data determination submodule is used for determining at least one of a button element, a text box element and an icon element in the user interface based on the lightweight multifunctional graphic library to obtain user interface data corresponding to the screen.
The embodiment of the invention also provides a screen display device, which is applied to a micro control unit, wherein the micro control unit is in communication connection with an upper computer, and the micro control unit is used for controlling a screen, and the device comprises:
The device comprises a file receiving module, a micro control unit, a file processing module and a display module, wherein the file receiving module is used for receiving a binary file sent by the upper computer, wherein the binary file generates user interface data corresponding to a screen based on a lightweight multifunctional graphic library through the upper computer, converts the user interface data into the binary file for the micro control unit, and writes the binary file into the micro control unit to obtain the binary file;
and the interface display module is used for controlling the screen to display the user interface corresponding to the binary file after power-on.
Optionally, the micro control unit is specifically configured to connect to the screen through a preset screen interface circuit, and the interface display module includes:
And the circuit control sub-module is used for controlling the screen to display the user interface corresponding to the binary file through the screen interface circuit.
Optionally, the apparatus further comprises:
and the interface updating module is used for updating the user interface displayed on the screen according to the control instruction sent by the user based on the screen.
Optionally, the interface updating module includes:
the control monitoring sub-module is used for monitoring whether the control of the user interface changes or not;
The instruction determining submodule is used for determining a control instruction sent by the user based on the screen under the condition that the control of the user interface changes;
The element determination submodule is used for determining an interface element corresponding to the control instruction based on the binary file, wherein the interface element comprises at least one of a button element, a text box element and an icon element;
and the interface updating sub-module is used for updating the user interface displayed on the screen by adopting the interface element.
The embodiment of the invention also discloses electronic equipment, which comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus;
The memory is used for storing a computer program;
The processor is configured to implement the method according to the embodiment of the present invention when executing the program stored in the memory.
Embodiments of the invention also disclose one or more computer-readable media having instructions stored thereon, which when executed by one or more processors, cause the processors to perform the methods described in the embodiments of the invention.
The embodiment of the invention has the following advantages:
The screen display method provided by the embodiment of the invention is applied to an upper computer, the upper computer is in communication connection with a micro control unit, the micro control unit is used for controlling a screen, generating user interface data corresponding to the screen based on a lightweight multifunctional graphic library, converting the user interface data into a binary file for the micro control unit, writing the binary file into the micro control unit, and controlling the screen to display a user interface corresponding to the binary file after the micro control unit is powered on. According to the screen display method provided by the embodiment of the invention, the user interface data corresponding to the screen is generated through the lightweight multifunctional graphic library and written into the micro control unit for user interface display, so that the user interface generation efficiency can be effectively improved.
Drawings
FIG. 1 is a flow chart of steps of a screen display method provided in an embodiment of the present invention;
FIG. 2 is a flowchart of steps of another screen display method provided in an embodiment of the present invention;
Fig. 3 is a block diagram of a screen display device provided in an embodiment of the present invention;
fig. 4 is a block diagram of another screen display device provided in an embodiment of the present invention;
FIG. 5 is a block diagram of an electronic device provided in an embodiment of the invention;
Fig. 6 is a schematic diagram of a computer readable medium provided in an embodiment of the invention.
Detailed Description
In order that the above-recited objects, features and advantages of the present invention will become more readily apparent, a more particular description of the invention will be rendered by reference to the appended drawings and appended detailed description.
Referring to fig. 1, a step flowchart of a screen display method provided in an embodiment of the present invention is shown, and the step flowchart is applied to a host computer, where the host computer is communicatively connected to a micro control unit, and the micro control unit is used for controlling a screen, and may specifically include the following steps:
It should be noted that, the Host Computer (Host Computer) may refer to a high-level Computer system responsible for data processing, monitoring, management and control in the control system. May be used to interact with a user and perform complex tasks. In the embodiment of the invention, the upper computer can send a control instruction to the lower computer (such as a micro control unit).
In a specific implementation, a PC may be used as a design platform, and a GUI design tool (such as GUI-Guider or SquareLine Studio) may be used to design a UI (User Interface) graphic Library, generate a C code of LVGL (LIGHT AND VERSATILE GRAPHICS Library, embedded graphic Library), and compile the corresponding C code into an executable file of a corresponding target for the design of the UI Interface.
The micro control unit (Microcontroller Unit, MCU) is a single chip microcomputer integrating a processor core, a memory (RAM, ROM, flash, etc.) and various peripheral interfaces (I/O ports, UART, SPI, I C, etc.). The micro control unit can be used in an embedded system, and in the embodiment of the invention, various peripheral devices such as a screen, a sensor, an actuator and the like can be controlled by the micro control unit.
In a specific implementation, the micro control unit can be used as a core component of the serial port screen and is responsible for displaying a UI interface designed by the upper computer and sending the UI interface to other chips (MCU, SOC and the like) through a UART (Universal Asynchronous Receiver/Transmitter, universal asynchronous receiver Transmitter) according to a set event.
A screen (DISPLAY SCREEN) may refer to an output device for displaying images, text, or other information. Common screen types include LCD (liquid crystal display), LED (light emitting diode display), OLED (organic light emitting diode display), and the like. The screen may be used to present information to the user, such as system status, data, graphical interfaces, and the like. In the embodiment of the invention, the micro control unit can control the driving circuit of the screen to update the display content.
In a specific implementation, the screen may be a serial port screen, where the serial port screen is a display screen that communicates with a master control device (such as a microcontroller, a singlechip, etc.) based on a serial communication interface (such as UART, SPI, I C, etc.). The display screen, the touch screen, the control chip and the communication interface can be integrated, and the display and interaction of the graphical interface can be realized through simple serial port commands.
Step 101, generating user interface data corresponding to the screen based on a lightweight multifunctional graphic library;
It should be noted that the lightweight multifunctional graphics library may be a graphics library designed specifically for an embedded device with limited resources, and may implement rich Graphical User Interface (GUI) functions on a low-memory, low-processing-capability hardware platform, while maintaining lightweight and high-performance. In embodiments of the present invention, user interface data may be generated through a lightweight multi-functional graphics library.
User interface data may refer to various data for describing and defining the structure, content, and behavior of a User Interface (UI). May include layout of controls, attributes, event processing logic, styles, text content, image resources, and the like. The user interface data may exist in a variety of forms, such as code, configuration files, JSON data, XML data, and the like. In an embodiment of the invention, in an embedded system or a graphics library (e.g., LVGL), user interface data may be generated in the form of code to describe the layout and behavior of the UI.
In the embodiment of the invention, the upper computer can generate the user interface data corresponding to the screen based on the lightweight multifunctional graphic library.
In an embodiment of the present invention LVGL may be selected as a graphics library and then a GUI design tool such as (GUI-Guider or SquareLineStudio) installed on the PC creates a new item in the GUI design tool, selecting the target display device and resolution (e.g., 320x 240).
The control (e.g., button, tab, slider, chart, etc.) is then dragged to the design area. The properties of the control (e.g., color, size, font, event response, etc.) are reconfigured. And creating a control by using the API provided by LVGL to obtain user interface data corresponding to the screen.
Step 102, converting the user interface data into a binary file for the micro control unit;
in the embodiment of the invention, the upper computer can convert the user interface data into the binary file for the micro control unit. Wherein the binary file is in a format recognizable by the micro control unit.
In the embodiment of the invention, the user interface data can be exported to generate codes after UI design is completed in the design tool. The code of the user interface corresponding to the screen can also be directly written.
The code may include the following:
UI layout file defining the hierarchical structure and location of the control.
Control definition file defining the properties (e.g., size, color, text, etc.) of each control.
Event processing file, defining event callback function of control.
In an embodiment of the invention, the code may be integrated into the engineering of the micro control unit. For example, the generated code may be added to a main.c file. The code is then compiled into a binary file of the microcontrol unit using a cross-compilation tool chain (e.g., GCC, keil, IAR, etc.).
And step 103, writing the binary file into the micro control unit, wherein the micro control unit is used for controlling the screen to display a user interface corresponding to the binary file after power-on.
In the embodiment of the invention, the upper computer can write the binary file into the micro control unit, and the micro control unit is used for controlling the screen to display the user interface corresponding to the binary file after power-on.
In the embodiment of the invention, the binary file can be burnt into the micro control unit, and the micro control unit is controlled to display the user interface corresponding to the binary file. It is checked whether the display effect and function meet expectations. Debug tools (e.g., serial port debug, logic analyzers, etc.) are used to check memory usage and performance bottlenecks. The UI design can also be adjusted as needed, code regenerated and the deployment binaries compiled.
Therefore, according to the screen display method provided by the embodiment of the invention, the user interface data corresponding to the screen can be generated based on the lightweight multifunctional graphic library, the user interface data can be converted into the binary file for the micro-control unit, the design of the user interface can be rapidly completed, the user interface can be converted into the binary file which can be understood by the micro-control unit, the screen can be controlled to display the user interface corresponding to the binary file based on the binary file, the design and display of the user interface can be rapidly completed, and complex micro-control unit control codes are not required to be processed.
The screen display method provided by the embodiment of the invention is applied to an upper computer, the upper computer is in communication connection with a micro control unit, the micro control unit is used for controlling a screen, the method comprises the steps of generating user interface data corresponding to the screen based on a lightweight multifunctional graphic library, converting the user interface data into a binary file for the micro control unit, writing the binary file into the micro control unit, and controlling the screen to display a user interface corresponding to the binary file after the micro control unit is powered on. According to the screen display method provided by the embodiment of the invention, the user interface data corresponding to the screen is generated through the lightweight multifunctional graphic library and written into the micro control unit for user interface display, so that the user interface generation efficiency can be effectively improved.
In one embodiment of the present invention, the method further comprises:
and S11, running a preset firmware program in the micro control unit, wherein the firmware program is used for communicating with the upper computer through a preset serial port and driving the screen display user interface.
It should be noted that, firmware program (Firmware) refers to a software program embedded in a hardware device, and is typically stored in a nonvolatile memory (such as a Flash memory) of the device, so as to control basic operations and functions of the hardware device. The firmware program is the core software of the hardware device and is responsible for managing the underlying operations of the hardware, driving peripherals, processing data and interacting with users or other devices. In the embodiment of the invention, the communication between the upper computer and the micro control unit and the driving of the micro control unit to the screen can be realized through the firmware program.
A Serial Port (Serial Port) may be an interface for Serial communications, allowing devices to exchange data via Serial data transfer. The serial port communication is a low-speed short-distance communication mode, and can be applied to the fields of embedded systems, computer peripherals, industrial control, internet of things equipment and the like. In the embodiment of the invention, the micro control unit can communicate with other chips through a serial UART.
In the embodiment of the invention, the upper computer can run a preset firmware program in the micro control unit, and the firmware program is used for communicating with the upper computer through a preset serial port and driving the screen to display a user interface.
In the embodiment of the invention, the firmware program of the micro control unit can be written, and the firmware program comprises modules such as serial port communication, LCD driving, UI data analysis and the like.
The firmware program can receive the UI data sent by the upper computer through the serial port and store the UI data in a FLASH memory (FLASH) of the MCU.
The firmware program can send a display instruction to the serial port screen through the LCD interface circuit according to the UI data, and control the serial port screen to display corresponding graphics and texts.
In the embodiment of the invention, the micro control unit can drive the screen by a driving circuit, and the driving circuit can comprise an MCU interface circuit, an LCD interface circuit, a power supply conversion circuit, a crystal oscillator circuit and the like.
The MCU interface circuit can enable the MCU to communicate with other chips through the serial UART.
The LCD interface circuit can convert SPI or other pins of the MCU into signals which can be identified by the LCD screen.
The power conversion circuit can be a low dropout linear regulator (LDO) power circuit and can provide stable power supply for MCU, LCD screen and the like. The power supply can be connected with an external power supply through a power socket, so that the power supply stability of the whole system is ensured.
The crystal oscillator circuit can provide stable clock signals for the MCU, and ensures the accuracy and stability of system operation.
In one embodiment of the present invention, the step of writing the binary file into the micro control unit includes:
And S21, writing the binary file into a flash memory of the micro control unit through the serial port, wherein the micro control unit is specifically used for generating a user interface based on the analysis of the binary file by the firmware program and controlling the screen to display the user interface.
It should be noted that, the Flash Memory (Flash Memory) may be a Non-Volatile Memory (NVM) capable of holding stored data after power-off. The flash memory has the characteristics of high storage density, low power consumption, quick reading, erasable and the like, and can be applied to various electronic devices, such as computers, smart phones, embedded systems, solid State Disks (SSDs) and the like. In the embodiment of the invention, the binary file can be written into the flash memory of the micro control unit.
In the embodiment of the invention, the upper computer can write the binary file into the flash memory of the micro control unit through the serial port, and the micro control unit can be particularly used for generating a user interface based on the analysis of the binary file by the firmware program and controlling the screen to display the user interface.
In one embodiment of the present invention, the step of generating the user interface data corresponding to the screen based on the lightweight multifunctional graphics library includes:
s31, determining at least one of button elements, text box elements and icon elements in the user interface based on the lightweight multifunctional graphic library to obtain user interface data corresponding to the screen.
In the embodiment of the invention, the upper computer can determine at least one of a button element, a text box element and an icon element in the user interface based on the lightweight multifunctional graphic library to obtain user interface data corresponding to the screen. Wherein the button may be an interactive control for triggering a specific operation. The user may perform the corresponding function by clicking, touching or pressing a button. A text box may be a control for entering and displaying text. The user may input words in the text box or the text box may display preset text content. An icon may be a graphical symbol used to represent a function or information. Icons are typically more intuitive than text and can convey information quickly.
Referring to fig. 2, a flowchart illustrating steps of another screen display method provided in an embodiment of the present invention is applied to a micro control unit, where the micro control unit is communicatively connected to an upper computer, and the micro control unit is configured to control a screen, and may specifically include the following steps:
S201, receiving a binary file sent by the upper computer, wherein the binary file is obtained by generating user interface data corresponding to the screen based on a lightweight multifunctional graphic library through the upper computer, converting the user interface data into a binary file for the micro control unit, and writing the binary file into the micro control unit;
The micro control unit can receive the binary file sent by the upper computer, wherein the binary file generates user interface data corresponding to a screen based on a lightweight multifunctional graphic library through the upper computer, converts the user interface data into the binary file for the micro control unit, and writes the binary file into the micro control unit to obtain the micro control unit.
In the embodiment of the invention, the micro control unit can receive the binary file sent by the upper computer through the serial port and write the binary file into the flash memory of the micro control unit.
In an embodiment of the present invention, the host computer may select LVGL as the graphic library and then install a GUI design tool such as (GUI-Guider or SquareLineStudio) on the PC to create a new item in the GUI design tool, selecting the target display device and resolution (e.g., 320x 240).
The control (e.g., button, tab, slider, chart, etc.) is then dragged to the design area. The properties of the control (e.g., color, size, font, event response, etc.) are reconfigured. And creating a control by using the API provided by LVGL to obtain user interface data corresponding to the screen.
In the embodiment of the invention, the upper computer can export the user interface data to generate codes after completing UI design in the design tool. The code of the user interface corresponding to the screen can also be directly written.
The code may include the following:
UI layout file defining the hierarchical structure and location of the control.
Control definition file defining the properties (e.g., size, color, text, etc.) of each control.
Event processing file, defining event callback function of control.
In the embodiment of the invention, the upper computer can integrate codes into the engineering of the micro-control unit. For example, in the STM32 project, the generated code is added to a main.c file. The code is then compiled into a binary file of the microcontrol unit using a cross-compilation tool chain (e.g., GCC, keil, IAR, etc.).
In the embodiment of the invention, the upper computer can burn the binary file into the micro-control unit, and the micro-control unit controls the screen to display the user interface corresponding to the binary file. It is checked whether the display effect and function meet expectations. Debug tools (e.g., serial port debug, logic analyzers, etc.) are used to check memory usage and performance bottlenecks. The UI design can also be adjusted as needed, code regenerated and the deployment binaries compiled.
And S202, after power-on, controlling the screen to display a user interface corresponding to the binary file.
In the embodiment of the invention, after power-on, the micro control unit can control the screen to display the user interface corresponding to the binary file.
In the embodiment of the invention, after the system is electrified, the micro control unit can read the UI data corresponding to the binary file from the flash memory and control the serial screen to display the UI interface through the LCD interface circuit.
In the embodiment of the invention, the drive code corresponding to the screen can be written aiming at a specific screen, such as a serial port screen or an LCD screen, so as to ensure that the micro control unit can correctly control the display of the screen.
The functions of the driving code may include initializing an LCD screen, initializing a touch chip, transmitting a display instruction, adjusting backlight brightness, and the like.
In one embodiment of the present invention, the micro control unit is specifically configured to connect to the screen through a preset screen interface circuit, and the step of controlling the screen to display a user interface corresponding to the binary file includes:
s41, controlling the screen to display a user interface corresponding to the binary file through the screen interface circuit.
In the embodiment of the invention, the micro control unit can control the screen to display the user interface corresponding to the binary file through the screen interface circuit. The screen interface circuit may be an LCD interface circuit, among others.
In one embodiment of the present invention, the method further comprises:
s51, updating a user interface displayed on the screen according to a control instruction sent by a user based on the screen.
In the embodiment of the invention, the micro control unit can update the user interface displayed on the screen according to the control instruction sent by the user based on the screen.
In the embodiment of the invention, a user can interact with a screen (such as a serial port screen) through a touch screen or other input devices, and the micro control unit can update the UI interface according to the input of the user and display the UI interface through the serial port screen.
In one embodiment of the present invention, the step of updating the user interface displayed on the screen according to the control instruction sent by the user based on the screen includes:
s61, monitoring whether a control of the user interface changes;
In the embodiment of the invention, the micro control unit can monitor whether the control of the user interface changes.
In the embodiment of the invention, the micro control unit can monitor the change of the UI in real time. The change in UI may be monitored in particular by:
event monitoring, namely capturing change events of the UI interface, such as adding a control, deleting the control, modifying the control attribute and the like through an event monitoring mechanism.
And synchronizing the captured event into an internal data model to ensure the consistency of the data.
S62, under the condition that the control of the user interface is changed, determining a control instruction sent by the user based on the screen;
in the embodiment of the invention, the micro control unit can determine the control instruction sent by the user based on the screen under the condition that the control of the user interface is changed.
S63, determining an interface element corresponding to the control instruction based on the binary file, wherein the interface element comprises at least one of a button element, a text box element and an icon element;
in the embodiment of the invention, the micro control unit can determine the interface element corresponding to the control instruction based on the binary file, wherein the interface element comprises at least one of a button element, a text box element and an icon element.
In the embodiment of the invention, the micro control unit can automatically adjust the control logic according to the changed control and the attribute of the control. The control logic may be specifically adapted by:
Rules engine-rules engine is used to define the processing rules for different control changes. The rules engine may automatically select the appropriate processing logic based on a predefined rule base.
State machine state and behavior of the control is managed using a finite state machine (FINITE STATE MACHINE, FSM). The state machine can automatically adjust the control logic according to the state change of the control.
S64, updating the user interface displayed on the screen by adopting the interface element.
In the embodiment of the invention, the micro control unit can update the user interface displayed on the screen by adopting the interface element. The micro-control unit may employ interface elements to code optimize the user interface displayed on the screen.
In the embodiment of the invention, the code optimization can be performed on the basis of the existing code according to the interface element so as to ensure the high efficiency and the readability of the code. The code optimization may include the steps of:
Code template-using optimized code template to ensure that the generated code has good structure and readability.
Code analysis by static code analysis tools, potential problems in the generated code, such as performance bottlenecks, logic errors, etc., are detected.
And reconstructing the codes, namely reconstructing the generated codes according to the analysis result, and improving the efficiency and maintainability of the codes.
The embodiment of the invention also provides a screen display system, which comprises an upper computer and a micro control unit, wherein the upper computer is in communication connection with the micro control unit, and the micro control unit is used for controlling a screen;
s71, the upper computer is used for generating user interface data corresponding to the screen based on a lightweight multifunctional graphic library;
in the embodiment of the invention, the upper computer can generate the user interface data corresponding to the screen based on the lightweight multifunctional graphic library.
In an embodiment of the present invention LVGL may be selected as a graphics library and then a GUI design tool such as (GUI-Guider or SquareLineStudio) installed on the PC creates a new item in the GUI design tool, selecting the target display device and resolution (e.g., 320x 240).
The control (e.g., button, tab, slider, chart, etc.) is then dragged to the design area. The properties of the control (e.g., color, size, font, event response, etc.) are reconfigured. And creating a control by using the API provided by LVGL to obtain user interface data corresponding to the screen.
S72, the upper computer is used for converting the user interface data into a binary file for the micro control unit;
in the embodiment of the invention, the upper computer can convert the user interface data into the binary file for the micro control unit. Wherein the binary file is in a format recognizable by the micro control unit.
In the embodiment of the invention, the user interface data can be exported to generate codes after UI design is completed in the design tool. The code of the user interface corresponding to the screen can also be directly written.
The code may include the following:
UI layout file defining the hierarchical structure and location of the control.
Control definition file defining the properties (e.g., size, color, text, etc.) of each control.
Event processing file, defining event callback function of control.
In an embodiment of the invention, the code may be integrated into the engineering of the micro control unit. For example, in the STM32 project, the generated code is added to a main.c file. The code is then compiled into a binary file of the microcontrol unit using a cross-compilation tool chain (e.g., GCC, keil, IAR, etc.).
S73, the upper computer is used for writing the binary file into the micro control unit;
In the embodiment of the invention, the upper computer can write the binary file into the micro control unit, and the micro control unit is used for controlling the screen to display the user interface corresponding to the binary file after power-on.
In the embodiment of the invention, the binary file can be burnt into the micro control unit, and the micro control unit is controlled to display the user interface corresponding to the binary file. It is checked whether the display effect and function meet expectations. Debug tools (e.g., serial port debug, logic analyzers, etc.) are used to check memory usage and performance bottlenecks. The UI design can also be adjusted as needed, code regenerated and the deployment binaries compiled.
S74, the micro control unit is used for receiving the binary file sent by the upper computer;
In the embodiment of the invention, the micro control unit can receive the binary file sent by the upper computer.
In the embodiment of the invention, the micro control unit can receive the binary file sent by the upper computer through the serial port and write the binary file into the flash memory of the micro control unit.
And S75, the micro control unit is used for controlling the screen to display the user interface corresponding to the binary file after power-on.
In the embodiment of the invention, after power-on, the micro control unit can control the screen to display the user interface corresponding to the binary file.
In the embodiment of the invention, after the system is electrified, the micro control unit can read the UI data corresponding to the binary file from the flash memory and control the serial screen to display the UI interface through the LCD interface circuit.
In the embodiment of the invention, the drive code corresponding to the screen can be written aiming at a specific screen, such as a serial port screen or an LCD screen, so as to ensure that the micro control unit can correctly control the display of the screen.
The functions of the driving code may include initializing an LCD screen, initializing a touch chip, transmitting a display instruction, adjusting backlight brightness, and the like.
It should be noted that, for simplicity of description, the method embodiments are shown as a series of acts, but it should be understood by those skilled in the art that the embodiments are not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the embodiments. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred embodiments, and that the acts are not necessarily required by the embodiments of the invention.
Referring to fig. 3, a block diagram of a screen display device according to an embodiment of the present invention is shown, where the block diagram is applied to a host computer, and the host computer is communicatively connected to a micro control unit, where the micro control unit is used to control a screen, and may specifically include the following modules:
the data generating module 301 is configured to generate user interface data corresponding to the screen based on a lightweight multifunctional graphics library;
a data conversion module 302, configured to convert the user interface data into a binary file for the micro control unit;
the file writing module 303 is configured to write the binary file into the micro control unit, and the micro control unit is configured to control the screen to display a user interface corresponding to the binary file after power is on.
Optionally, the apparatus further comprises:
the device comprises a micro control unit, a firmware program running module, a screen display user interface and a control module, wherein the micro control unit is used for controlling the micro control unit to display a screen, the firmware program running module is used for running a preset firmware program in the micro control unit, and the firmware program is used for communicating with the upper computer through a preset serial port and driving the screen display user interface.
Optionally, the file writing module includes:
The micro control unit is specifically used for generating a user interface based on the analysis of the binary file by the firmware program and controlling the screen to display the user interface.
Optionally, the data generating module includes:
And the data determination submodule is used for determining at least one of a button element, a text box element and an icon element in the user interface based on the lightweight multifunctional graphic library to obtain user interface data corresponding to the screen.
Referring to fig. 4, there is shown a block diagram of another screen display device according to an embodiment of the present invention, which is applied to a micro control unit, where the micro control unit is communicatively connected to an upper computer, and the micro control unit is configured to control a screen, and may specifically include the following modules:
The file receiving module 401 is configured to receive a binary file sent by the upper computer, where the binary file is obtained by generating user interface data corresponding to the screen based on a lightweight multifunctional graphics library by the upper computer, converting the user interface data into a binary file for the micro control unit, and writing the binary file into the micro control unit;
and the interface display module 402 is used for controlling the screen to display the user interface corresponding to the binary file after power-on.
Optionally, the micro control unit is specifically configured to connect to the screen through a preset screen interface circuit, and the interface display module includes:
And the circuit control sub-module is used for controlling the screen to display the user interface corresponding to the binary file through the screen interface circuit.
Optionally, the apparatus further comprises:
and the interface updating module is used for updating the user interface displayed on the screen according to the control instruction sent by the user based on the screen.
Optionally, the interface updating module includes:
the control monitoring sub-module is used for monitoring whether the control of the user interface changes or not;
The instruction determining submodule is used for determining a control instruction sent by the user based on the screen under the condition that the control of the user interface changes;
The element determination submodule is used for determining an interface element corresponding to the control instruction based on the binary file, wherein the interface element comprises at least one of a button element, a text box element and an icon element;
and the interface updating sub-module is used for updating the user interface displayed on the screen by adopting the interface element.
For the device embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference is made to the description of the method embodiments for relevant points.
In addition, the embodiment of the invention also provides an electronic device, as shown in fig. 5, which comprises a processor 501, a communication interface 502, a memory 503 and a communication bus 504, wherein the processor 501, the communication interface 502 and the memory 503 complete communication with each other through the communication bus 504,
A memory 503 for storing a computer program;
the processor 501 is configured to execute the program stored in the memory 503, and implement the following steps:
Generating user interface data corresponding to the screen based on a lightweight multifunctional graphic library;
Converting the user interface data into a binary file for the micro control unit;
And the micro control unit is used for controlling the screen to display a user interface corresponding to the binary file after being electrified.
Optionally, the method further comprises:
And running a preset firmware program in the micro control unit, wherein the firmware program is used for communicating with the upper computer through a preset serial port and driving the screen to display a user interface.
Optionally, the step of writing the binary file into the micro control unit includes:
The micro control unit is specifically used for generating a user interface based on the analysis of the binary file by the firmware program and controlling the screen to display the user interface.
Optionally, the step of generating the user interface data corresponding to the screen based on the lightweight multifunctional graphic library includes:
and determining at least one of a button element, a text box element and an icon element in the user interface based on the lightweight multifunctional graphic library to obtain user interface data corresponding to the screen.
The processor 501 is further configured to execute the program stored in the memory 503, thereby implementing the following steps:
the method comprises the steps of receiving a binary file sent by an upper computer, generating user interface data corresponding to a screen through the upper computer based on a lightweight multifunctional graphic library, converting the user interface data into the binary file for a micro control unit, and writing the binary file into the micro control unit to obtain the binary file;
And after power-on, controlling the screen to display a user interface corresponding to the binary file.
Optionally, the micro control unit is specifically configured to connect to the screen through a preset screen interface circuit, and the step of controlling the screen to display a user interface corresponding to the binary file includes:
And controlling the screen to display a user interface corresponding to the binary file through the screen interface circuit.
Optionally, the method further comprises:
And updating the user interface displayed on the screen according to the control instruction sent by the user based on the screen.
Optionally, the step of updating the user interface displayed on the screen according to the control instruction sent by the user based on the screen comprises the following steps:
monitoring whether a control of the user interface changes;
Under the condition that the control of the user interface is changed, determining a control instruction sent by the user based on the screen;
determining an interface element corresponding to the control instruction based on the binary file, wherein the interface element comprises at least one of a button element, a text box element and an icon element;
and updating the user interface displayed on the screen by adopting the interface element.
The communication bus mentioned by the above terminal may be a peripheral component interconnect standard (PERIPHERAL COMPONENT INTERCONNECT, abbreviated as PCI) bus or an extended industry standard architecture (Extended Industry Standard Architecture, abbreviated as EISA) bus, etc. The communication bus may be classified as an address bus, a data bus, a control bus, or the like. For ease of illustration, the figures are shown with only one bold line, but not with only one bus or one type of bus.
The communication interface is used for communication between the terminal and other devices.
The memory may include random access memory (Random Access Memory, RAM) or may include non-volatile memory (non-volatile memory), such as at least one disk memory. Optionally, the memory may also be at least one memory device located remotely from the aforementioned processor.
The processor may be a general-purpose processor, including a central Processing unit (Central Processing Unit, CPU), a network processor (Network Processor, NP), a digital signal processor (DIGITAL SIGNAL Processing, DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable gate array (FPGA) or other Programmable logic device, discrete gate or transistor logic device, or discrete hardware components.
In yet another embodiment provided by the present invention, as shown in fig. 6, there is also provided a computer-readable storage medium 601 having instructions stored therein, which when run on a computer, cause the computer to perform the screen display method described in the above embodiment.
In yet another embodiment of the present invention, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to perform the screen display method described in the above embodiment.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, produces a flow or function in accordance with embodiments of the present invention, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another, for example, by wired (e.g., coaxial cable, optical fiber, digital Subscriber Line (DSL)), or wireless (e.g., infrared, wireless, microwave, etc.). The computer readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains an integration of one or more available media. The usable medium may be a magnetic medium (e.g., floppy disk, hard disk, tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk Solid STATE DISK (SSD)), etc.
It is noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises an element.
In this specification, each embodiment is described in a related manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for system embodiments, since they are substantially similar to method embodiments, the description is relatively simple, as relevant to see a section of the description of method embodiments.
The foregoing description is only of the preferred embodiments of the present invention and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.
Claims (13)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202411917790.XA CN120045259A (en) | 2024-12-24 | 2024-12-24 | Screen display method, system, device, electronic equipment and readable medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202411917790.XA CN120045259A (en) | 2024-12-24 | 2024-12-24 | Screen display method, system, device, electronic equipment and readable medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN120045259A true CN120045259A (en) | 2025-05-27 |
Family
ID=95756448
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202411917790.XA Pending CN120045259A (en) | 2024-12-24 | 2024-12-24 | Screen display method, system, device, electronic equipment and readable medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN120045259A (en) |
-
2024
- 2024-12-24 CN CN202411917790.XA patent/CN120045259A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11709766B2 (en) | Mocking robotic process automation (RPAactivities for workflow testing | |
US11947443B2 (en) | Robotic process automation (RPA) debugging systems and methods | |
US20100313179A1 (en) | Integrated work lists for engineering project change management | |
CN103914315A (en) | Configuration method of drivers | |
US10387584B1 (en) | Streaming on hardware-software platforms in model based designs | |
US10489167B2 (en) | Dynamically binding data in an application | |
US11281437B2 (en) | User interface design platform, system, and method for applying consistent look and feel | |
US20220067272A1 (en) | Robotic Process Automation Systems and Methods Using A Helper Spreadsheet | |
EP4086755B1 (en) | Robotic process automation (rpa) comprising automatic document scrolling | |
CN107025040B (en) | Display setting method, system and graphical user interface based on OLED screen | |
CN120045259A (en) | Screen display method, system, device, electronic equipment and readable medium | |
WO2023143746A1 (en) | System and method for managing artifacts related to apps | |
Haase et al. | Application integration within an integrated design environment | |
CN106445487A (en) | Processing unit, software and method for controlling interactive components | |
CN112988139A (en) | Method and device for developing event processing file | |
US12254327B2 (en) | Dynamically binding data in an application | |
KR20200022254A (en) | Apparatus and method for configuration of os based on self-defined definition | |
Wolske | 3B: Computer Building Blocks | |
Sur | Visual Studio 2013 and. NET 4.5 Expert Cookbook | |
CN116841528A (en) | Low-code development methods and devices | |
Lamberský et al. | Development of Simulink blockset for embedded system with complex peripherals | |
Nixon | Getting Started with Python and Raspberry Pi | |
WO2025065464A1 (en) | Code generation method and apparatus, platform, electronic device, and storage medium | |
CN118170352A (en) | Cloud system for developing controller, controller development method and controller | |
CN119148631A (en) | System and method for managing updates to artifacts associated with applications |
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 |