Screen display method, system and device, electronic equipment and readable medium

By generating and converting user interface data based on lightweight multi-functional graphical library, the complex problem of traditional LCD screen driving methods is solved, and the simplification of user interface development and efficiency improvement is achieved.

CN120045259APending Publication Date: 2025-05-27GREE ELECTRIC APPLIANCE INC OF ZHUHAI +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411917790.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-24
Publication Date
2025-05-27

AI Technical Summary

Technical Problem

Traditional LCD screen driving methods are complex, requiring complex hardware interface support and deep firmware programming, which increases the difficulty and cost of system construction and is difficult to meet the market demand for rapid iteration.

Method used

The user interface data is generated based on the lightweight multi-functional graphics library, and converted it into a binary file recognized by the microcontroller unit, and written to the microcontroller unit, so that it controls the screen to display the user interface after power-on.

Benefits of technology

It simplifies the user interface development process, improves the user interface generation efficiency, reduces the difficulty and cost of system construction, and can respond to market demand more quickly.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120045259A_ABST
    Figure CN120045259A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a screen display method, system and 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, and the method comprises the following steps: generating user interface data corresponding to the screen based on a lightweight multifunctional graphics library; converting the user interface data into a binary file for the micro-control unit; the binary file is written into 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. According to the screen display method provided by the embodiment of the invention, the user interface data corresponding to the screen is generated and written into the micro-control unit for displaying the user interface through the lightweight multifunctional graphics library, so that the generation efficiency of the user interface can be effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] 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 device, and a computer-readable medium. Background Art

[0002] In the rapidly developing field of embedded systems, the LCD screen, as a key bridge connecting users and devices, its performance and flexibility have become the core elements of product competitiveness. With the rise of emerging applications such as the Internet of Things, smart homes, and wearable devices, users have put forward higher requirements for the interaction experience of devices. As the main interface for human-computer interaction, the display effect, response speed, power consumption, and flexibility of the interface design of the LCD screen directly determine the market competitiveness of products.

[0003] Traditional driving methods require complex hardware interface support, such as parallel interfaces, SPI interfaces, or I2C interfaces, etc. The design and debugging processes of these interfaces are cumbersome and time-consuming, increasing the difficulty of system construction. Secondly, driving the LCD screen requires in-depth firmware programming intervention. Developers need to write a large amount of underlying driver code to achieve screen initialization, data transmission, and display control. This driving method that relies on hardware and firmware not only raises the threshold and cost of system construction, but also prolongs the development cycle and is difficult to meet the rapidly iterative market demands. Summary of the Invention

[0004] Embodiments of the present invention provide a screen display method, system, device, electronic device, and computer-readable storage medium to solve the problem of complex user interface development.

[0005] Embodiments of the present invention disclose a screen display method, which is applied to a host computer. The host computer is communicatively connected to a microcontroller unit, and the microcontroller unit is used to control the screen. The method includes:

[0006] Generating user interface data corresponding to the screen based on a lightweight multi-functional graphics library;

[0007] Converting the user interface data into a binary file for the microcontroller unit;

[0008] Writing the binary file into the microcontroller unit; the microcontroller unit is used to control the screen to display the user interface corresponding to the binary file after power-on.

[0009] Optionally, the method further includes:

[0010] Running a preset firmware program in the microcontroller unit; the firmware program is used to communicate with the host computer through a preset serial port and drive the screen to display the user interface.

[0011] Optionally, the step of writing the binary file into the microcontroller unit includes:

[0012] Writing the binary file into the flash memory of the microcontroller unit through the serial port; the microcontroller unit is specifically configured to parse the binary file based on the firmware program to generate a user interface, and control the screen to display the user interface.

[0013] Optionally, the step of generating the user interface data corresponding to the screen based on the lightweight multi-functional graphics library includes:

[0014] Based on the lightweight multi-functional graphics library, determining at least one of button elements, text box elements, and icon elements in the user interface to obtain the user interface data corresponding to the screen.

[0015] An embodiment of the present invention further provides a screen display method, which is applied to a microcontroller unit. The microcontroller unit is communicatively connected to a host computer, and the microcontroller unit is used to control a screen. The method includes:

[0016] Receiving a binary file sent by the host computer; wherein, the binary file is obtained by the host computer generating the user interface data corresponding to the screen based on the lightweight multi-functional graphics library, converting the user interface data into a binary file for the microcontroller unit, and writing the binary file into the microcontroller unit;

[0017] After power-on, controlling the screen to display the user interface corresponding to the binary file.

[0018] Optionally, the microcontroller unit is specifically configured to be connected to the screen through a preset screen interface circuit. The step of controlling the screen to display the user interface corresponding to the binary file includes:

[0019] Controlling the screen to display the user interface corresponding to the binary file through the screen interface circuit.

[0020] Optionally, the method further includes:

[0021] Updating the user interface displayed on the screen according to a control instruction issued by a user based on the screen.

[0022] Optionally, the step of updating the user interface displayed on the screen according to a control instruction issued by a user based on the screen includes:

[0023] Listening for whether the controls on the user interface change;

[0024] When there is a change in the controls of the user interface, determine the control instructions issued by the user based on the screen;

[0025] Based on the binary file, determine the interface elements corresponding to the control instructions; the interface elements include at least one of button elements, text box elements, and icon elements;

[0026] Use the interface elements to update the user interface displayed on the screen.

[0027] An embodiment of the present invention further provides a screen display system, which includes a host computer and a microcontroller unit. The host computer is communicatively connected to the microcontroller unit, and the microcontroller unit is used to control the screen;

[0028] The host computer is used to generate user interface data corresponding to the screen based on a lightweight multi-functional graphics library;

[0029] The host computer is used to convert the user interface data into a binary file for the microcontroller unit;

[0030] The host computer is used to write the binary file into the microcontroller unit;

[0031] The microcontroller unit is used to receive the binary file sent by the host computer;

[0032] The microcontroller unit is used to control the screen to display the user interface corresponding to the binary file after power-on.

[0033] An embodiment of the present invention further provides a screen display device, which is applied to a host computer. The host computer is communicatively connected to a microcontroller unit, and the microcontroller unit is used to control the screen. The device includes:

[0034] A data generation module, which is used to generate user interface data corresponding to the screen based on a lightweight multi-functional graphics library;

[0035] A data conversion module, which is used to convert the user interface data into a binary file for the microcontroller unit;

[0036] A file writing module, which is used to write the binary file into the microcontroller unit; the microcontroller unit is used to control the screen to display the user interface corresponding to the binary file after power-on.

[0037] Optionally, the device further includes:

[0038] A firmware program running module, which is used to run a preset firmware program in the microcontroller unit; the firmware program is used to communicate with the host computer through a preset serial port and drive the screen to display the user interface.

[0039] Optionally, the file writing module includes:

[0040] A serial port writing sub-module for writing the binary file into the flash memory of the microcontroller unit through the serial port; the microcontroller unit is specifically configured to parse the binary file based on the firmware program to generate a user interface, and control the screen to display the user interface.

[0041] Optionally, the data generation module includes:

[0042] A data determination sub-module for determining at least one of button elements, text box elements, and icon elements in the user interface based on a lightweight multi-functional graphics library, to obtain the user interface data corresponding to the screen.

[0043] An embodiment of the present invention further provides a screen display device, which is applied to a microcontroller unit. The microcontroller unit is communicatively connected to a host computer, and the microcontroller unit is used to control the screen. The device includes:

[0044] A file receiving module for receiving a binary file sent by the host computer; wherein, the binary file is obtained by the host computer generating the user interface data corresponding to the screen based on a lightweight multi-functional graphics library, converting the user interface data into a binary file for the microcontroller unit, and writing the binary file into the microcontroller unit.

[0045] An interface display module for controlling the screen to display the user interface corresponding to the binary file after power-on.

[0046] Optionally, the microcontroller unit is specifically configured to be connected to the screen through a preset screen interface circuit. The interface display module includes:

[0047] A circuit control sub-module for controlling the screen to display the user interface corresponding to the binary file through the screen interface circuit.

[0048] Optionally, the device further includes:

[0049] An interface update module for updating the user interface displayed on the screen according to a control instruction issued by a user based on the screen.

[0050] Optionally, the interface update module includes:

[0051] A control monitoring sub-module for monitoring whether the controls in the user interface change.

[0052] An instruction determination sub-module, configured to determine a control instruction issued by the user based on the screen when a control on the user interface changes;

[0053] An element determination sub-module, configured to determine an interface element corresponding to the control instruction based on the binary file; the interface element includes at least one of a button element, a text box element, and an icon element;

[0054] An interface update sub-module, configured to update the user interface displayed on the screen by using the interface element.

[0055] An embodiment of the present invention further discloses an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory complete communication with each other through the communication bus;

[0056] The memory is used to store a computer program;

[0057] When the processor is configured to execute the program stored on the memory, the method described in the embodiment of the present invention is implemented.

[0058] An embodiment of the present invention further discloses one or more computer-readable media, on which instructions are stored, and when executed by one or more processors, cause the processors to execute the method described in the embodiment of the present invention.

[0059] The embodiments of the present invention include the following advantages:

[0060] Through the screen display method provided by the embodiment of the present invention, which is applied to a host computer, the host computer is communicatively connected to a microcontroller unit, and the microcontroller unit is configured to control the screen, generate user interface data corresponding to the screen based on a lightweight multi-functional graphics library; convert the user interface data into a binary file for the microcontroller unit; write the binary file into the microcontroller unit; and the microcontroller unit is configured to control the screen to display the user interface corresponding to the binary file after power-on. Through the screen display method provided by the embodiment of the present invention, by using the lightweight multi-functional graphics library to generate the user interface data corresponding to the screen and write it into the microcontroller unit for user interface display, the efficiency of generating the user interface can be effectively improved. Description of the Drawings

[0061] Figure 1 is a flowchart of steps of a screen display method provided in an embodiment of the present invention;

[0062] Figure 2 is a flowchart of steps of another screen display method provided in an embodiment of the present invention;

[0063] Figure 3It is a block diagram of a screen display device provided in an embodiment of the present invention;

[0064] Figure 4 It is a block diagram of another screen display device provided in an embodiment of the present invention;

[0065] Figure 5 It is a block diagram of an electronic device provided in an embodiment of the present invention;

[0066] Figure 6 It is a schematic diagram of a computer-readable medium provided in an embodiment of the present invention. Detailed implementation manners

[0067] To make the above objects, features, and advantages of the present invention more obvious and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific implementation manners.

[0068] Referring to Figure 1 , a step flowchart of a screen display method provided in an embodiment of the present invention is shown. It is applied to a host computer, and the host computer is communicatively connected to a microcontroller unit. The microcontroller unit is used to control the screen. Specifically, it may include the following steps:

[0069] It should be noted that a host computer can refer to a high-level computer system responsible for data processing, monitoring, management, and control in a control system. It can be used for user interaction and performing complex tasks. In an embodiment of the present invention, the host computer can send control instructions to a lower computer (such as a microcontroller unit).

[0070] In specific implementation, a PC can be used as a design platform, and a GUI (Graphical User Interface) design tool (such as GUI-Guider or SquareLine Studio) can be combined to design a UI (User Interface) graphics library, and C code of LVGL (Light and Versatile Graphics Library, an embedded graphics library) can be generated. Then, the corresponding C code is compiled into an executable file for the corresponding target for UI interface design.

[0071] A microcontroller unit (MCU) is a single-chip microcomputer integrating a processor core, memories (such as RAM, ROM, Flash, etc.), and various peripheral interfaces (such as I / O ports, UART, SPI, I2C, etc.). The microcontroller unit can be used in an embedded system. In an embodiment of the present invention, various peripherals such as a screen, a sensor, and an actuator can be controlled through the microcontroller unit.

[0072] In a specific implementation, the microcontroller unit can serve as the core component of the serial screen, responsible for displaying the UI interface designed by the host computer and sending it to other chips (such as MCU, SOC, etc.) via UART (Universal Asynchronous Receiver / Transmitter) according to the set events.

[0073] A screen (Display Screen) can refer to an output device used to display images, text, or other information. Common screen types include LCD (Liquid Crystal Display), LED (Light Emitting Diode Display), OLED (Organic Light Emitting Diode Display), etc. The screen can be used to show information to the user, such as system status, data, graphical interfaces, etc. In the embodiments of the present invention, the microcontroller unit can control the driving circuit of the screen to update the display content.

[0074] In a specific implementation, the screen can be a serial screen, which is a display screen that communicates with a master device (such as a microcontroller, single-chip microcomputer, etc.) based on a serial communication interface (such as UART, SPI, I2C, etc.). It can integrate a display screen, a touch screen, a control chip, and a communication interface, and can realize the display and interaction of the graphical interface through simple serial commands.

[0075] Step 101: Generate the user interface data corresponding to the screen based on the lightweight multi-functional graphics library;

[0076] It should be noted that the lightweight multi-functional graphics library can be a graphics library designed specifically for resource-constrained embedded devices, which can realize rich graphical user interface (GUI) functions on hardware platforms with low memory and low processing capabilities, while maintaining lightweight and high performance. In the embodiments of the present invention, the user interface data can be generated through the lightweight multi-functional graphics library.

[0077] User interface data can refer to various data used to describe and define the structure, content, and behavior of the user interface (UI). It can include the layout, properties, event handling logic, styles, text content, image resources, etc. of the controls. The user interface data can exist in various forms, such as code, configuration files, JSON data, XML data, etc. In the embodiments of the present invention, in an embedded system or a graphics library (such as LVGL), the user interface data can be generated in the form of code to describe the layout and behavior of the UI.

[0078] In the embodiments of the present invention, the host computer can generate the user interface data corresponding to the screen based on the lightweight multi-functional graphics library.

[0079] In an embodiment of the present invention, LVGL can be selected as the graphics library, and then a GUI design tool (such as GUI-Guider or SquareLineStudio) can be installed on a PC. Create a new project in the GUI design tool, and select the target display device and resolution (such as 320x240).

[0080] Then, drag and drop controls (such as buttons, labels, sliders, charts, etc.) onto the design area. Then configure the properties of the controls (such as color, size, font, event response, etc.). Use the APIs provided by LVGL to create the controls and obtain the user interface data corresponding to the screen.

[0081] Step 102, convert the user interface data into a binary file for the microcontroller unit;

[0082] In an embodiment of the present invention, the host computer can convert the user interface data into a binary file for the microcontroller unit. Among them, the binary file is a format that the microcontroller unit can recognize.

[0083] In an embodiment of the present invention, after completing the UI design in the design tool, the user interface data can be exported to generate code. It is also possible to directly write the code for the user interface corresponding to the screen.

[0084] The code can include the following content:

[0085] UI layout file: Define the hierarchical structure and position of the controls.

[0086] Control definition file: Define the properties of each control (such as size, color, text, etc.).

[0087] Event handling file: Define the event callback functions of the controls.

[0088] In an embodiment of the present invention, the code can be integrated into the project of the microcontroller unit. For example, the generated code can be added to the main.c file. Then, use a cross-compilation toolchain (such as GCC, Keil, IAR, etc.) to compile the code into a binary file for the microcontroller unit.

[0089] Step 103, write the binary file into the microcontroller unit; the microcontroller unit is used to control the screen to display the user interface corresponding to the binary file after power-on.

[0090] In an embodiment of the present invention, the host computer can write the binary file into the microcontroller unit; the microcontroller unit is used to control the screen to display the user interface corresponding to the binary file after power-on.

[0091] In an embodiment of the present invention, a binary file can be burned into a microcontroller unit, and the microcontroller unit is used to control the screen to display the user interface corresponding to the binary file. Check whether the display effect and functions meet the expectations. Use debugging tools (such as serial port debugging, logic analyzer, etc.) to check memory usage and performance bottlenecks. The UI design can also be adjusted as needed, and the code can be regenerated and the binary file can be compiled and deployed.

[0092] Thus, the screen display method provided by the embodiment of the present invention can quickly complete the design of the user interface by generating the user interface data corresponding to the screen based on a lightweight multi-functional graphics library and converting the user interface data into a binary file for the microcontroller unit, and then convert it into a binary file that can be understood by the microcontroller unit. Subsequently, the screen can be controlled based on the binary file to display the user interface corresponding to the binary file, quickly completing the design and display of the user interface without dealing with complex microcontroller unit control codes.

[0093] The screen display method provided by the embodiment of the present invention is applied to a host computer, which is communicatively connected to a microcontroller unit, and the microcontroller unit is used to control the screen. The method includes: generating the user interface data corresponding to the screen based on a lightweight multi-functional graphics library; converting the user interface data into a binary file for the microcontroller unit; writing the binary file into the microcontroller unit; and the microcontroller unit is used to control the screen to display the user interface corresponding to the binary file after power-on. Through the screen display method provided by the embodiment of the present invention, by generating the user interface data corresponding to the screen through a lightweight multi-functional graphics library and writing it into the microcontroller unit for user interface display, the efficiency of user interface generation can be effectively improved.

[0094] In an embodiment of the present invention, the method further includes:

[0095] S11, running a preset firmware program in the microcontroller unit; the firmware program is used to communicate with the host computer through a preset serial port and drive the screen to display the user interface.

[0096] It should be noted that a firmware program (Firmware) refers to a software program embedded in a hardware device, usually stored in the non-volatile memory of the device (such as a Flash memory), and is used to control the basic operations and functions of the hardware device. The firmware program is the core software of the hardware device, 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 present invention, the communication between the host computer and the microcontroller unit, as well as the driving of the screen by the microcontroller unit, can be realized through the firmware program.

[0097] The serial port can be an interface for serial communication, allowing devices to exchange data through serial data transmission. Serial communication is a low-rate and short-distance communication method, which can be applied to fields such as embedded systems, computer peripherals, industrial control, and Internet of Things devices. In the embodiments of the present invention, the microcontroller unit can communicate with other chips through the serial port UART.

[0098] In the embodiments of the present invention, the host computer can run a preset firmware program in the microcontroller unit; the firmware program is used to communicate with the host computer through a preset serial port and drive the screen to display the user interface.

[0099] In the embodiments of the present invention, the firmware program of the microcontroller unit can be written, including modules such as serial communication, LCD driving, and UI data parsing.

[0100] The firmware program can receive UI data sent by the host computer through the serial port and store it in the flash memory (FLASH) of the MCU.

[0101] According to the UI data, the MCU can send a display instruction to the serial port screen through the LCD interface circuit to control the serial port screen to display corresponding graphics and texts.

[0102] In the embodiments of the present invention, the driving of the screen by the microcontroller unit can also be implemented by a driving circuit, and the driving circuit can include: an MCU interface circuit, an LCD interface circuit, a power conversion circuit, and a crystal oscillator circuit, etc.

[0103] The MCU interface circuit can enable the MCU to communicate with other chips through the serial port UART.

[0104] The LCD interface circuit can convert the SPI or other pins of the MCU into signals that the LCD screen can recognize.

[0105] The power conversion circuit can be a low-dropout linear regulator (LDO) power circuit, which can provide a stable power supply for the MCU, LCD screen, etc. It can also be connected to an external power supply through a power socket to ensure the stable power supply of the entire system.

[0106] The crystal oscillator circuit can provide a stable clock signal for the MCU to ensure the accuracy and stability of the system operation.

[0107] In an embodiment of the present invention, the step of writing the binary file into the microcontroller unit includes:

[0108] S21, writing the binary file into the flash memory of the microcontroller unit through the serial port; the microcontroller unit is specifically used to parse the binary file based on the firmware program to generate a user interface and control the screen to display the user interface.

[0109] It should be noted that flash memory can be a type of non-volatile memory (NVM) that can retain stored data even after power is cut off. Flash memory has characteristics such as high storage density, low power consumption, fast read speed, and erasability, and can be applied to various electronic devices, such as computers, smartphones, embedded systems, solid-state drives (SSDs), etc. In the embodiment of the present invention, a binary file can be written into the flash memory of the microcontroller unit.

[0110] In the embodiment of the present invention, the host computer can write a binary file into the flash memory of the microcontroller unit through a serial port; the microcontroller unit can specifically be used to parse the binary file based on a firmware program to generate a user interface and control the screen to display the user interface.

[0111] In an embodiment of the present invention, the step of generating user interface data corresponding to the screen based on a lightweight multi-functional graphics library includes:

[0112] S31, based on a lightweight multi-functional graphics library, determine at least one of button elements, text box elements, and icon elements in the user interface to obtain user interface data corresponding to the screen.

[0113] In the embodiment of the present invention, the host computer can determine at least one of button elements, text box elements, and icon elements in the user interface based on a lightweight multi-functional graphics library to obtain user interface data corresponding to the screen. Among them, a button can be an interactive control for triggering a specific operation. A user can perform a corresponding function by clicking, touching, or pressing the button. A text box can be a control for inputting and displaying text. A user can enter text in the text box, or the text box can display preset text content. An icon can be a graphical symbol for representing a function or information. Icons are usually more intuitive than text and can convey information quickly.

[0114] Refer to Figure 2 , which shows a flowchart of steps of another screen display method provided in the embodiment of the present invention. It is applied to a microcontroller unit that is communicatively connected to a host computer, and the microcontroller unit is used to control the screen. Specifically, it can include the following steps:

[0115] S201, receive the binary file sent by the host computer; wherein, the binary file is obtained by the host computer generating user interface data corresponding to the screen based on a lightweight multi-functional graphics library, converting the user interface data into a binary file for the microcontroller unit, and writing the binary file into the microcontroller unit.

[0116] In an embodiment of the present invention, the microcontroller unit can receive the binary file sent by the host computer; wherein, the binary file is obtained by the host computer generating the user interface data corresponding to the screen based on the lightweight multi-functional graphics library, converting the user interface data into a binary file for the microcontroller unit, and writing the binary file into the microcontroller unit.

[0117] In an embodiment of the present invention, the microcontroller unit can receive the binary file sent by the host computer through the serial port and write it into the flash memory of the microcontroller unit.

[0118] In an embodiment of the present invention, the host computer can select LVGL as the graphics library, and then install GUI design tools such as (GUI-Guider or SquareLineStudio) on the PC. Create a new project in the GUI design tool, and select the target display device and resolution (such as 320x240).

[0119] Then, drag and drop controls (such as buttons, labels, sliders, charts, etc.) to the design area. Then configure the properties of the controls (such as color, size, font, event response, etc.). Use the APIs provided by LVGL to create controls to obtain the user interface data corresponding to the screen.

[0120] In an embodiment of the present invention, after the host computer completes the UI design in the design tool, it can export the user interface data to generate code. It can also directly write the code for the user interface corresponding to the screen.

[0121] The code may include the following content:

[0122] UI layout file: Defines the hierarchical structure and position of the controls.

[0123] Control definition file: Defines the properties of each control (such as size, color, text, etc.).

[0124] Event handling file: Defines the event callback functions of the controls.

[0125] In an embodiment of the present invention, the host computer can integrate the code into the project of the microcontroller unit. For example, in an STM32 project, add the generated code to the main.c file. Then, use a cross-compilation toolchain (such as GCC, Keil, IAR, etc.) to compile the code into a binary file for the microcontroller unit.

[0126] In an embodiment of the present invention, the host computer can burn the binary file into the microcontroller unit, and control the screen on the microcontroller unit to display the user interface corresponding to the binary file. Check whether the display effect and functions meet the expectations. Use debugging tools (such as serial port debugging, logic analyzer, etc.) to check the memory usage and performance bottlenecks. It can also adjust the UI design as needed, regenerate the code and compile and deploy the binary file.

[0127] S202, after power-on, control the screen to display the user interface corresponding to the binary file.

[0128] In an embodiment of the present invention, after power-on, the microcontroller unit can control the screen to display the user interface corresponding to the binary file.

[0129] In an embodiment of the present invention, after the system is powered on, the microcontroller 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.

[0130] In an embodiment of the present invention, for a specific screen, such as a serial screen or an LCD screen, driver code corresponding to the screen can be written to ensure that the microcontroller unit can correctly control the display of the screen.

[0131] Among them, the functions of the driver code can include initializing the LCD screen, initializing the touch chip, sending display instructions, adjusting the backlight brightness, etc.

[0132] In an embodiment of the present invention, the microcontroller unit is specifically used to connect to the screen through a preset screen interface circuit. The step of controlling the screen to display the user interface corresponding to the binary file includes:

[0133] S41, control the screen to display the user interface corresponding to the binary file through the screen interface circuit.

[0134] In an embodiment of the present invention, the microcontroller unit can control the screen to display the user interface corresponding to the binary file through the screen interface circuit. Among them, the screen interface circuit can be an LCD interface circuit.

[0135] In an embodiment of the present invention, the method further includes:

[0136] S51, update the user interface displayed on the screen according to the control instruction issued by the user based on the screen.

[0137] In an embodiment of the present invention, the microcontroller unit can update the user interface displayed on the screen according to the control instruction issued by the user based on the screen.

[0138] In an embodiment of the present invention, the user can interact with the screen (such as a serial screen) through a touch screen or other input devices. The microcontroller unit can update the UI interface according to the user's input and display it through the serial screen.

[0139] In an embodiment of the present invention, the step of updating the user interface displayed on the screen according to the control instruction issued by the user based on the screen includes:

[0140] S61, monitor whether the controls on the user interface change;

[0141] In an embodiment of the present invention, the micro - control unit can monitor whether the controls on the user interface change.

[0142] In an embodiment of the present invention, the micro - control unit can monitor the changes of the UI in real time. Specifically, the changes of the UI can be monitored in the following ways:

[0143] Event listening: Through the event - listening mechanism, capture the change events of the UI interface, such as adding controls, deleting controls, modifying control attributes, etc.

[0144] Data synchronization: Synchronize the captured events to the internal data model to ensure data consistency.

[0145] S62, when the controls on the user interface change, determine the control instruction issued by the user based on the screen;

[0146] In an embodiment of the present invention, the micro - control unit can determine the control instruction issued by the user based on the screen when the controls on the user interface change.

[0147] S63, based on the binary file, determine the interface elements corresponding to the control instruction; the interface elements include at least one of button elements, text - box elements, and icon elements;

[0148] In an embodiment of the present invention, the micro - control unit can determine the interface elements corresponding to the control instruction based on the binary file; the interface elements include at least one of button elements, text - box elements, and icon elements.

[0149] In an embodiment of the present invention, the micro - control unit can automatically adjust the control logic according to the changed controls and the attributes of the controls. Specifically, the control logic can be adjusted in the following ways:

[0150] Rule engine: Use a rule engine to define the processing rules when different controls change. The rule engine can automatically select the appropriate processing logic according to the predefined rule library.

[0151] State machine: Use a finite - state machine (FSM) to manage the states and behaviors of the controls. The state machine can automatically adjust the control logic according to the state changes of the controls.

[0152] S64, update the user interface displayed on the screen with the interface elements.

[0153] In an embodiment of the present invention, the microcontroller unit can update the screen display of the user interface using interface elements. The microcontroller unit can optimize the code of the user interface displayed on the screen using interface elements.

[0154] In an embodiment of the present invention, code optimization can be performed based on the existing code according to interface elements to ensure the efficiency and readability of the code. The code optimization can include the following steps:

[0155] Code template: Use an optimized code template to ensure that the generated code has a good structure and readability.

[0156] Code analysis: Detect potential problems in the generated code, such as performance bottlenecks, logical errors, etc., through a static code analysis tool.

[0157] Code refactoring: Refactor the generated code according to the analysis results to improve the efficiency and maintainability of the code.

[0158] An embodiment of the present invention also provides a screen display system, which includes a host computer and a microcontroller unit. The host computer is communicatively connected to the microcontroller unit, and the microcontroller unit is used to control the screen;

[0159] S71, the host computer is used to generate user interface data corresponding to the screen based on a lightweight multi-functional graphics library;

[0160] In an embodiment of the present invention, the host computer can generate user interface data corresponding to the screen based on a lightweight multi-functional graphics library.

[0161] In an embodiment of the present invention, LVGL can be selected as the graphics library, and then a GUI design tool such as (GUI-Guider or SquareLineStudio) can be installed on the PC. Create a new project in the GUI design tool, and select the target display device and resolution (such as 320x240).

[0162] Then, drag and drop controls (such as buttons, labels, sliders, charts, etc.) into the design area. Then configure the properties of the controls (such as color, size, font, event response, etc.). Use the API provided by LVGL to create controls to obtain user interface data corresponding to the screen.

[0163] S72, the host computer is used to convert the user interface data into a binary file for the microcontroller unit;

[0164] In an embodiment of the present invention, the host computer can convert the user interface data into a binary file for the microcontroller unit. Among them, the binary file is a format that the microcontroller unit can recognize.

[0165] In an embodiment of the present invention, after completing the UI design in a design tool, the user interface data can be exported to generate code. It is also possible to directly write the code for the user interface corresponding to the screen.

[0166] The code may include the following:

[0167] UI layout file: Defines the hierarchical structure and position of the controls.

[0168] Control definition file: Defines the attributes of each control (such as size, color, text, etc.).

[0169] Event handling file: Defines the event callback functions of the controls.

[0170] In an embodiment of the present invention, the code can be integrated into the project of the microcontroller unit. For example, in an STM32 project, the generated code is added to the main.c file. Then, the code is compiled into a binary file for the microcontroller unit using a cross-compilation toolchain (such as GCC, Keil, IAR, etc.).

[0171] S73, the host computer is used to write the binary file into the microcontroller unit;

[0172] In an embodiment of the present invention, the host computer can write the binary file into the microcontroller unit; the microcontroller unit is used to control the screen to display the user interface corresponding to the binary file after power-on.

[0173] In an embodiment of the present invention, the binary file can be burned into the microcontroller unit, and the screen is controlled on the microcontroller unit to display the user interface corresponding to the binary file. Check whether the display effect and functions meet the expectations. Use debugging tools (such as serial port debugging, logic analyzer, etc.) to check memory usage and performance bottlenecks. It is also possible to adjust the UI design as needed, regenerate the code, and compile and deploy the binary file.

[0174] S74, the microcontroller unit is used to receive the binary file sent by the host computer;

[0175] In an embodiment of the present invention, the microcontroller unit can receive the binary file sent by the host computer.

[0176] In an embodiment of the present invention, the microcontroller unit can receive the binary file sent by the host computer through the serial port and write it into the flash memory of the microcontroller unit.

[0177] S75, the microcontroller unit is used to control the screen to display the user interface corresponding to the binary file after power-on.

[0178] In an embodiment of the present invention, after power-on, the microcontroller unit can control the screen to display the user interface corresponding to the binary file.

[0179] In an embodiment of the present invention, after the system is powered on, the microcontroller 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.

[0180] In an embodiment of the present invention, for a specific screen, such as a serial screen or an LCD screen, the corresponding driver code can be written to ensure that the microcontroller unit can correctly control the display of the screen.

[0181] Among them, the functions of the driver code can include initializing the LCD screen, initializing the touch chip, sending display instructions, adjusting the backlight brightness, etc.

[0182] It should be noted that for the method embodiments, for the sake of simple description, they are all expressed as a series of action combinations. However, those skilled in the art should know that the embodiments of the present invention are not limited by the described action sequence, because according to the embodiments of the present invention, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily essential for the embodiments of the present invention.

[0183] Referring to Figure 3 , a structural block diagram of a screen display device provided in an embodiment of the present invention is shown. It is applied to a host computer, and the host computer is communicatively connected to the microcontroller unit. The microcontroller unit is used to control the screen and specifically may include the following modules:

[0184] A data generation module 301, configured to generate user interface data corresponding to the screen based on a lightweight multi-functional graphics library;

[0185] A data conversion module 302, configured to convert the user interface data into a binary file for the microcontroller unit;

[0186] A file writing module 303, configured to write the binary file into the microcontroller unit; the microcontroller unit is used to control the screen to display the user interface corresponding to the binary file after being powered on.

[0187] Optionally, the device further includes:

[0188] A firmware program running module, configured to run a preset firmware program in the microcontroller unit; the firmware program is used to communicate with the host computer through a preset serial port and drive the screen to display the user interface.

[0189] Optionally, the file writing module includes:

[0190] A serial port writing sub-module is used to write the binary file into the flash memory of the microcontroller through the serial port; the microcontroller is specifically configured to parse the binary file based on the firmware program to generate a user interface and control the screen to display the user interface.

[0191] Optionally, the data generation module includes:

[0192] A data determination sub-module is used to determine at least one of button elements, text box elements, and icon elements in the user interface based on a lightweight multi-functional graphics library, and obtain the user interface data corresponding to the screen.

[0193] Referring to Figure 4 , a structural block diagram of another screen display device provided in an embodiment of the present invention is shown. It is applied to a microcontroller, and the microcontroller is communicatively connected to a host computer. The microcontroller is used to control the screen and specifically may include the following modules:

[0194] A file receiving module 401 is used to receive the binary file sent by the host computer; wherein, the binary file is obtained by the host computer generating the user interface data corresponding to the screen based on a lightweight multi-functional graphics library, converting the user interface data into a binary file for the microcontroller, and writing the binary file into the microcontroller.

[0195] An interface display module 402 is used to control the screen to display the user interface corresponding to the binary file after power-on.

[0196] Optionally, the microcontroller is specifically configured to be connected to the screen through a preset screen interface circuit. The interface display module includes:

[0197] A circuit control sub-module is used to control the screen to display the user interface corresponding to the binary file through the screen interface circuit.

[0198] Optionally, the device further includes:

[0199] An interface update module is used to update the user interface displayed on the screen according to the control instruction issued by the user based on the screen.

[0200] Optionally, the interface update module includes:

[0201] A control monitoring sub-module is used to monitor whether the controls in the user interface change;

[0202] An instruction determination sub-module is used to determine the control instruction issued by the user based on the screen when the controls in the user interface change;

[0203] An element determination sub-module, configured to determine an interface element corresponding to the control instruction based on the binary file; the interface element includes at least one of a button element, a text box element, and an icon element;

[0204] An interface update sub-module, configured to update the user interface displayed on the screen by using the interface element.

[0205] For the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple. For related parts, please refer to the partial description of the method embodiment.

[0206] In addition, an embodiment of the present invention further provides an electronic device, as Figure 5 shown, including a processor 501, a communication interface 502, a memory 503, and a communication bus 504. Among them, the processor 501, the communication interface 502, and the memory 503 complete mutual communication through the communication bus 504,

[0207] The memory 503 is used to store a computer program;

[0208] The processor 501, when executing the program stored on the memory 503, implements the following steps:

[0209] Generate user interface data corresponding to the screen based on a lightweight multi-functional graphics library;

[0210] Convert the user interface data into a binary file for the microcontroller unit;

[0211] Write the binary file into the microcontroller unit; the microcontroller unit is used to control the screen to display the user interface corresponding to the binary file after power-on.

[0212] Optionally, the method further includes:

[0213] Run a preset firmware program in the microcontroller unit; the firmware program is used to communicate with the host computer through a preset serial port and drive the screen to display the user interface.

[0214] Optionally, the step of writing the binary file into the microcontroller unit includes:

[0215] Write the binary file into the flash memory of the microcontroller unit through the serial port; the microcontroller unit is specifically configured to parse the binary file based on the firmware program to generate a user interface and control the screen to display the user interface.

[0216] Optionally, the step of generating user interface data corresponding to the screen based on a lightweight multi-functional graphics library includes:

[0217] Based on a lightweight multi-functional graphics library, at least one of button elements, text box elements, and icon elements in the user interface is determined to obtain user interface data corresponding to the screen.

[0218] The processor 501 is further configured to implement the following steps when executing the program stored on the memory 503:

[0219] Receive the binary file sent by the host computer; wherein, the binary file is generated by the host computer based on the lightweight multi-functional graphics library, convert the user interface data corresponding to the screen into a binary file for the microcontroller unit, and write the binary file into the microcontroller unit.

[0220] After power-on, control the screen to display the user interface corresponding to the binary file.

[0221] Optionally, the microcontroller unit is specifically configured to be connected to the screen through a preset screen interface circuit, and the step of controlling the screen to display the user interface corresponding to the binary file includes:

[0222] Control the screen to display the user interface corresponding to the binary file through the screen interface circuit.

[0223] Optionally, the method further includes:

[0224] Update the user interface displayed on the screen according to the control instruction issued by the user based on the screen.

[0225] Optionally, the step of updating the user interface displayed on the screen according to the control instruction issued by the user based on the screen includes:

[0226] Monitor whether the controls on the user interface change;

[0227] When the controls on the user interface change, determine the control instruction issued by the user based on the screen;

[0228] Based on the binary file, determine the interface element corresponding to the control instruction; the interface element includes at least one of button elements, text box elements, and icon elements;

[0229] Update the user interface displayed on the screen with the interface element.

[0230] The communication bus mentioned in the above terminal may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of convenience of representation, only a thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0231] The communication interface is used for communication between the above terminal and other devices.

[0232] The memory may include a Random Access Memory (RAM), or may also include a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located far from the aforementioned processor.

[0233] The above-mentioned processor may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0234] As Figure 6 shown, in another embodiment provided by the present invention, a computer-readable storage medium 601 is further provided. Instructions are stored in the computer-readable storage medium. When it runs on a computer, the computer is made to execute the screen display method described in the above embodiment.

[0235] In another embodiment provided by the present invention, a computer program product containing instructions is further provided. When it runs on a computer, the computer is made to execute the screen display method described in the above embodiment.

[0236] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can 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 the computer program instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present invention are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access, or a data storage device such as a server or data center that includes one or more integrated available media. The available medium can be a magnetic medium (such as a floppy disk, hard disk, magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid state disk (SSD)).

[0237] It should be noted that in this document, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variation thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising one..." does not exclude the presence of additional identical elements in the process, method, article or device comprising the element.

[0238] Each embodiment in this specification is described in a related manner. The same or similar parts between the embodiments can be referred to each other, and the differences between each embodiment and other embodiments are emphasized. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the description of the method embodiment.

[0239] The above are only the preferred embodiments of the present invention and are not intended to limit the protection scope of the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention are all included in the protection scope of the present invention.

Claims

1. A screen display method, characterized in that: It is applied to a host computer, the host computer is connected to a micro control unit for communication, the micro control unit is used to control a screen, and the method includes: Based on a lightweight multifunctional graphics library, generating user interface data corresponding to the screen; converting the user interface data into a binary file for the microcontroller unit; The binary file is written into the micro control unit; the micro control unit is used to control the screen to display the user interface corresponding to the binary file after power-on.

2. The method according to claim 1, characterized in that The method further comprises: A preset firmware program is run in the micro control unit; the firmware program is used to communicate with the host computer through a preset serial port and drive the screen to display a user interface.

3. The method according to claim 2, characterized in that The step of writing the binary file into the micro control unit comprises: The binary file is written into the flash memory of the micro control unit through the serial port; the micro control unit is specifically used to parse the binary file based on the firmware program to generate a user interface, and control the screen to display the user interface.

4. The method according to claim 1, characterized in that: The step of generating user interface data corresponding to the screen based on the lightweight multifunctional graphics library comprises: Based on a lightweight multifunctional graphics library, at least one of a button element, a text box element, and an icon element in the user interface is determined to obtain user interface data corresponding to the screen.

5. A screen display method, characterized in that: It is applied to a micro control unit, the micro control unit is connected to a host computer for communication, the micro control unit is used to control a screen, and the method includes: Receiving a binary file sent by the host computer; wherein the binary file generates user interface data corresponding to the screen through the host computer based on a lightweight multifunctional graphics library, converting the user interface data into a binary file for the microcontroller unit, and writing the binary file into the microcontroller unit; After power-on, the screen is controlled to display a user interface corresponding to the binary file.

6. The method according to claim 5, characterized in that The micro control unit is specifically used to connect to the screen through a preset screen interface circuit, and the step of controlling the screen to display the user interface corresponding to the binary file includes: The screen is controlled by the screen interface circuit to display a user interface corresponding to the binary file.

7. The method according to claim 5, characterized in that The method further comprises: The user interface displayed on the screen is updated according to a control instruction issued by the user based on the screen.

8. The method according to claim 7, characterized in that The step of updating the user interface displayed on the screen according to the control instruction issued by the user based on the screen comprises: Monitor whether the controls of the user interface change; In the case where a control of the user interface changes, determining a control instruction issued by the user based on the screen; Based on the binary file, determining the interface element corresponding to the control instruction; the interface element includes at least one of a button element, a text box element, and an icon element; The interface element is used to update the user interface displayed on the screen.

9. A screen display system, characterized in that: The screen display system includes a host computer and a micro control unit, wherein the host computer is in communication connection with the micro control unit, and the micro control unit is used to control the screen; The host computer is used to generate user interface data corresponding to the screen based on a lightweight multifunctional graphics library; The host computer is used to convert the user interface data into a binary file for the micro control unit; The host computer is used to write the binary file into the micro control unit; The micro control unit is used to receive the binary file sent by the host computer; The micro control unit is used to control the screen to display the user interface corresponding to the binary file after power-on.

10. A screen display device, characterized in that: It is applied to a host computer, the host computer is connected to a micro control unit for communication, the micro control unit is used to control a screen, and the device comprises: A data generation module, used for generating user interface data corresponding to the screen based on a lightweight multifunctional graphics library; A data conversion module, used for converting the user interface data into a binary file for the micro control unit; The file writing module is used to write the binary file into the micro control unit; the micro control unit is used to control the screen to display the user interface corresponding to the binary file after power-on.

11. A screen display device, characterized in that: It is applied to a micro control unit, the micro control unit is connected to a host computer for communication, the micro control unit is used to control a screen, and the device includes: A file receiving module is used to receive a binary file sent by the host computer; wherein the binary file is generated by the host computer based on a lightweight multifunctional graphics library, the user interface data corresponding to the screen is converted into a binary file for the microcontroller unit, and the binary file is written into the microcontroller unit; The interface display module is used to control the screen to display the user interface corresponding to the binary file after power-on.

12. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; The memory is used to store computer programs; The processor, when used to execute a program stored in the memory, implements the method described in any one of claims 1-4 or 5-8.

13. A computer-readable medium having instructions stored thereon, which, when executed by one or more processors, cause the processors to perform the method according to any one of claims 1-4 or 5-8.