Serial port screen architecture, firmware editing method and device, serial port screen and storage medium
Patent Information
- Application Number
- CN202310345349.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-31
- Publication Date
- 2026-10-16
- Estimated Expiration
- 2043-03-31
AI Technical Summary
上述过程不仅降低了效率,还增大了用户成本,而且若后续需要更换不同版本的串口屏时,用户需要重新适配修改或重新增加协议转换模块,使得产品的维修成本提升,难以实现迁移
[0019] Fifthly, embodiments of this application also provide a storage medium storing computer-executable instructions, which, when executed by a processor, are used to perform the firmware editing method as described in any of the above embodiments.
Smart Images

Figure CN116431531B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of serial communication technology, and in particular to a serial port screen architecture, firmware editing method, device, serial port screen and storage medium. Background Technology
[0002] A serial port screen, as a display terminal, refers to a TFT (Thin Film Transistor) color LCD screen display and control module with serial communication capabilities. In related technologies, a pre-designed UI (User Interface) is downloaded to the serial port screen, and communication with other devices is achieved through the serial port. The serial port screen displays relevant data on its display screen, and parameters or operation commands can be written via touchscreen, buttons, mouse, or other input units, thereby enabling information interaction between the user and the machine.
[0003] Currently, the communication protocols used by different manufacturers for their serial port displays are not entirely the same. These protocols are fixed at the factory and cannot be modified by the user. When using them, users can only modify the communication protocol of their product according to the manufacturer's provided protocol, or add a protocol conversion module, to enable communication between the serial port display and the industrial control processor. This protocol conversion module is used to establish protocol conversion between the serial port display and existing devices. This process not only reduces efficiency but also increases user costs. Furthermore, if a different version of the serial port display needs to be replaced later, the user needs to re-adapt and modify it or add a new protocol conversion module, increasing product maintenance costs and making migration difficult. Summary of the Invention
[0004] This application provides a serial port screen architecture, firmware editing method, device, serial port screen, and storage medium. The serial port screen architecture can provide an open communication protocol editing interface to meet the communication needs of existing devices and serial port screens, and facilitate device migration.
[0005] In a first aspect, embodiments of this application provide a serial port screen architecture, including a factory firmware project and a UI basic project. The factory firmware project includes factory firmware used to initialize peripheral resources after the processor starts. The UI basic project includes a UI driver library, a serial port transceiver function module, a transceiver callback function module, and a timed callback function module. The UI driver library includes a UI driver program and a serial port driver program corresponding to the UI display. The serial port transceiver function module includes functions for providing serial port transceiver data. The transceiver callback function module includes functions for parsing received data and functions for encapsulating and packaging data to be sent. The timed callback function module includes functions for periodically reading the transceiver buffer, parsing received data, and encoding and sending transmitted data.
[0006] Secondly, embodiments of this application also provide a firmware editing method applied to a serial port screen, the serial port screen including the serial port screen architecture as described in claim 1, the method comprising:
[0007] Based on the received UI firmware, obtain the UI design package corresponding to the user interface in the UI firmware, and store the UI design package in the UI folder corresponding to the UI basic project. The UI design package includes UI code and material package designed based on UI design tools.
[0008] Based on the UI firmware, load the UI driver and serial port driver corresponding to the UI design package into the UI driver library;
[0009] The UI firmware is parsed to obtain the first communication protocol, and the first communication protocol is added to the serial port transceiver function module of the UI basic project. The first communication protocol carries the serial port communication protocol function corresponding to the target device connected to the serial port screen.
[0010] Add a protocol parsing function and a protocol encapsulation function corresponding to the first communication protocol to the send / receive callback function module of the UI basic project.
[0011] Thirdly, embodiments of this application also provide a firmware editing device applied to a serial port screen, the serial port screen including the serial port screen architecture as claimed in claim 1, the device comprising:
[0012] The UI editing module is configured to obtain the UI design package corresponding to the user interface in the received UI firmware and store the UI design package in the UI folder corresponding to the UI base project. The UI design package includes UI code and material package designed based on UI design tools.
[0013] The driver editing module is configured to be based on the UI firmware and load the UI driver and serial port driver corresponding to the UI design package in the UI driver library;
[0014] The first protocol configuration module is configured to parse the UI firmware to obtain the first communication protocol, and add the first communication protocol to the serial port transceiver function module of the UI basic project. The first communication protocol carries the serial port communication protocol function corresponding to the target device connected to the serial port screen.
[0015] The second protocol configuration module adds a protocol parsing function and a protocol encapsulation function corresponding to the first communication protocol to the send / receive callback function module of the UI basic project.
[0016] Fourthly, embodiments of this application also provide a serial port screen, which includes the serial port screen architecture described in the first aspect embodiment above, and the serial port screen further includes:
[0017] One or more processors;
[0018] A storage device for storing one or more programs, which are executed by one or more processors, the one or more processors implementing the firmware editing method as described in any of the above embodiments.
[0019] Fifthly, embodiments of this application also provide a storage medium storing computer-executable instructions, which, when executed by a processor, are used to perform the firmware editing method as described in any of the above embodiments.
[0020] This application's solution sets up a serial port screen architecture on the serial port screen and edits the firmware of the serial port screen based on the corresponding firmware editing method, thereby opening up the editing interface for UI design and serial communication protocol. This allows users to directly port the device's communication protocol without having to perform protocol matching or relay, effectively improving the flexibility and efficiency of using the serial port screen. Attached Figure Description
[0021] Figure 1 This is a schematic diagram of a serial port screen architecture provided in an embodiment of this application;
[0022] Figure 2 A flowchart illustrating the steps of a firmware editing method provided in an embodiment of this application;
[0023] Figure 3 A flowchart illustrating the steps of adding a driver according to an embodiment of this application;
[0024] Figure 4 A flowchart illustrating the firmware upgrade steps provided in one embodiment of this application;
[0025] Figure 5 A schematic diagram of a firmware editing device provided in an embodiment of this application;
[0026] Figure 6 This is a schematic diagram of the structure of a serial port screen provided in an embodiment of this application. Detailed Implementation
[0027] The embodiments of this application will be further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are merely illustrative of the embodiments of this application and are not intended to limit the scope of the embodiments. Furthermore, it should be noted that, for ease of description, only the parts relevant to the embodiments of this application are shown in the accompanying drawings, not the entire structure.
[0028] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship. In the description of this application, "multiple" means two or more, and "several" means one or more.
[0029] In related technologies, the communication protocol of serial port screens is fixed by the manufacturer and cannot be modified by users. Users can only modify their own product's protocol according to the protocol provided by the manufacturer, or add a protocol conversion module to use it. Either way, it will increase the product's maintenance cost and make it difficult to migrate to other products in the future.
[0030] Figure 1 This is a schematic diagram of a serial port screen architecture provided in an embodiment of this application. This architecture offers an open editing interface, allowing the serial port screen's communication protocol to be editable for easy device migration. Figure 1 As shown, the serial port screen architecture includes the factory firmware project and the UI basic project.
[0031] In this solution, the factory firmware project of the serial port screen architecture includes the factory firmware, which is used to initialize peripheral resources after the processor starts. It is conceivable that the factory firmware can be burned into the serial port screen by the serial port screen manufacturer when the device leaves the factory and stored in the factory firmware project.
[0032] The UI infrastructure includes a UI driver library, a serial port transceiver function module, a transceiver callback function module, and a timed callback function module. The UI driver library includes the UI driver program for the UI display and the serial port driver program, enabling the display of the user interface on the serial port screen when the corresponding program is called. The serial port transceiver function module includes functions for providing serial port data transmission and reception, allowing the serial port screen to send and receive data for communication with external target devices. The transceiver callback function module includes functions for parsing received data and encapsulating data to be sent, thus enabling the serial port screen to communicate with the target device. The timed callback function module includes functions for periodically reading the transceiver buffer, parsing received data, and encoding and sending data.
[0033] The UI base project in the serial port screen architecture is editable, allowing editing of functions and programs stored within the architecture to meet the communication requirements of different target devices. This enables convenient migration to different target devices, facilitating data transmission without requiring additional protocol conversion modules or modifications to the target device's communication protocol, thus effectively improving the efficiency of device migration.
[0034] Figure 2 This is a flowchart illustrating the steps of a firmware editing method provided in an embodiment of this application. This firmware editing method can be applied to a serial port screen, and it is conceivable that the serial port screen adopts the serial port screen architecture shown in the above embodiment. Figure 2 As shown, the firmware editing method of this application includes the following steps:
[0035] Step S210: Based on the received UI firmware, obtain the UI design package corresponding to the user interface in the UI firmware, and store the UI design package in the UI folder corresponding to the UI basic project.
[0036] It is conceivable that the UI firmware is edited and generated in the host computer, and the host computer transmits the UI firmware to the serial port screen. Of course, the UI firmware can also be stored in a storage device, such as a USB flash drive or flash memory card. By connecting the storage device to the serial port screen, the serial port screen can receive the UI firmware.
[0037] In some embodiments, the UI firmware carries a UI design package, which corresponds to the user interface. The UI design package includes UI code and asset packages designed using UI design tools. This UI design package is also edited on a host computer and stored on a storage device. For example, in UI design software, after creating a UI canvas, assets, controls, and parameters are added according to the desired display effect. After completing the UI interface design, the UI design package is generated. Therefore, after obtaining the UI design package, it is stored in the UI folder corresponding to the UI basic project on the serial port screen.
[0038] Step S220: Based on the UI firmware, load the UI driver and serial port driver corresponding to the UI design package into the UI driver library.
[0039] The UI firmware also stores corresponding UI drivers and serial port drivers. After receiving the UI firmware, the serial port screen can parse it, obtain the UI drivers and serial port drivers, and load them to display the UI. In some embodiments, the UI firmware can be firmware edited according to the serial port screen architecture. Therefore, after receiving the UI firmware, the serial port screen can load the UI drivers and serial port drivers from the corresponding UI driver library. It should be noted that for serial port screens that can connect to the network, the screen can determine the UI design package on the UI firmware based on the firmware, and then download the corresponding UI drivers and serial port drivers.
[0040] Step S230: Parse the UI firmware to obtain the first communication protocol, and add the first communication protocol to the serial port transceiver function module of the UI basic project.
[0041] In this solution, the serial port screen employing firmware editing provides corresponding editing interfaces, such as a protocol editing interface. Through this open protocol editing interface, the serial port screen can edit the send / receive callback function modules of its architecture. The serial port screen then ports the first communication protocol to the serial port send / receive function modules to achieve communication connectivity with the target device.
[0042] As an external device connected to the serial port screen, the serial port screen needs to know the communication protocol with the target device, namely the first communication protocol. The UI firmware transmitted to the serial port screen includes the first communication protocol, which carries the serial port communication protocol functions corresponding to the target device. Therefore, the first communication protocol is added to the serial port transmit / receive function module of the serial port screen's UI base project to facilitate data transmission and reception between the serial port screen and the target device. Step S240: Add a protocol parsing function and a protocol encapsulation function corresponding to the first communication protocol to the transmit / receive callback function module of the UI base project.
[0043] After porting the first communication protocol, the serial port transceiver function module carries serial communication protocol functions. Correspondingly, the serial port screen's transceiver callback function module also adds protocol parsing and encapsulation functions corresponding to the first communication protocol to meet the communication requirements between the serial port screen and the target device. It should be noted that the above functions are computer functions, which are program segments or subroutines (i.e., code).
[0044] As described above, the serial port screen features a serial port architecture. This application's solution edits the firmware of the serial port screen using a corresponding firmware editing method, obtains the UI design package, adds the corresponding driver and serial port driver, and ports the corresponding communication protocol, along with its corresponding protocol parsing and encapsulation functions. This solution provides open interfaces for editing the UI design and serial communication protocol, allowing users to directly port the target device's communication protocol without needing to perform protocol matching or relaying, effectively improving the flexibility and efficiency of using the serial port screen.
[0045] In one embodiment, the UI firmware is firmware edited based on a serial port screen architecture. Therefore, during the driver addition process, methods such as... Figure 3 The steps shown are as follows: Figure 3 This is a flowchart illustrating the steps for adding a driver according to an embodiment of this application. The firmware editing method of this application further includes the following steps:
[0046] Step S310: Locate the target UI driver library and obtain the UI driver and serial port driver carried in the target UI driver library.
[0047] Step S320: Add the UI driver and serial port driver to the UI driver library.
[0048] Understandably, since the UI firmware is edited based on a serial port screen architecture, it includes a target UI driver library, which corresponds to the UI driver library in the serial port screen architecture. This target UI driver library stores both UI drivers and serial port drivers; that is, the UI drivers and serial port drivers stored within the target UI driver library are used to drive the UI display of the UI design package.
[0049] Upon receiving the UI firmware, the serial port screen locates the storage address corresponding to the UI firmware in the target UI driver library, and then extracts the UI driver and serial port driver. The serial port screen then adds the extracted UI driver and serial port driver to the UI driver library. Therefore, the serial port screen can quickly extract the UI driver and serial port driver from the UI firmware and add them to the UI driver library, which helps in displaying the user interface on the serial port screen.
[0050] In some embodiments, the serial port screen is provided with control keys for upgrading firmware. It is conceivable that the user interface of the serial port screen can also be provided with touch controls for upgrading firmware, which can respond to the user's touch operation to perform firmware upgrade.
[0051] Taking the control key as an example, when a user presses the control key and receives a UI firmware update, an upgrade operation for the UI firmware can be triggered. The serial port screen can respond to this upgrade operation by updating the UI firmware using the UI firmware update. It can be understood that the UI firmware update includes functions (or programs) that do not exist in the UI firmware. Therefore, during the update process, for different functions (or programs), the serial port screen loads the original function (or program) and retains the others that are identical.
[0052] In one embodiment, the UI update firmware includes a second communication protocol, which serves as the communication protocol for the new target device. When the target device is replaced, the corresponding communication protocol needs to be replaced to match the new target device and achieve data communication.
[0053] Figure 4 A flowchart illustrating the firmware upgrade steps provided in one embodiment of this application is shown below. Figure 4 As shown, the firmware editing method also includes the following steps:
[0054] Step S410: Parse the UI update firmware and obtain the second communication protocol of the corresponding UI update firmware.
[0055] Step S420: Add the second communication protocol to the serial port transceiver function module, and add a protocol parsing function and a protocol encapsulation function corresponding to the second communication protocol in the transceiver callback function.
[0056] Understandably, the first target device represents the target device before migration, and the second target device represents the target device after migration. During device migration—that is, changing the target device connected to the serial port screen (i.e., connecting the serial port screen to the second target device)—after receiving the UI firmware update, the serial port screen parses the updated firmware to determine the second communication protocol. This second communication protocol is then added to the serial port transceiver function module, and the previously stored first communication protocol is deleted. Furthermore, the protocol parsing and encapsulation functions corresponding to the second communication protocol are added to the transceiver callback functions, achieving the porting of the new communication protocol. Therefore, during firmware upgrades, the serial port screen can update the communication protocol to adapt to the communication requirements of the new target device, achieving device migration without the need for additional protocol conversion modules or modifications to the target device's communication protocol. This effectively improves the flexibility and efficiency of using the serial port screen.
[0057] In one embodiment, the UI firmware is named according to the target format. Therefore, during the process of the serial port screen reading the UI firmware, the serial port screen selects the required UI firmware from the firmware package according to the target format. It can be understood that the firmware package is stored in the storage device, and multiple firmwares are stored in the firmware package. The UI firmware in the firmware package is named according to the target format. It is conceivable that the target format is set by the developers of the serial port screen, and the developers of the UI firmware can name the UI firmware according to the target format.
[0058] When a serial port monitor is connected to a storage device, it can read the UI firmware according to the target format, thus ensuring that the UI firmware with a naming format that meets the target format is read. Therefore, by standardizing the UI firmware naming format, the serial port monitor can quickly read the UI firmware, which helps improve the efficiency of using the serial port monitor.
[0059] Figure 5 This is a schematic diagram of a firmware editing device according to an embodiment of this application. The device is used to execute the firmware editing method provided in the above embodiment, and has corresponding functional modules and beneficial effects for executing the method. Figure 5 As shown, the device includes: a UI editing module 501, a driver editing module 502, a first protocol configuration module 503, and a second protocol configuration module 504.
[0060] The UI editing module 501 is configured to obtain the UI design package corresponding to the user interface in the received UI firmware and store the UI design package in the UI folder corresponding to the UI base project. The UI design package includes UI code and material packages designed based on the UI design tool. The driver editing module 502 is configured to load the UI driver and serial port driver corresponding to the UI design package in the UI driver library based on the UI firmware. The first protocol configuration module 503 is configured to parse the UI firmware to obtain the first communication protocol and add the first communication protocol to the serial port transceiver function module of the UI base project. The first communication protocol carries the serial port communication protocol function corresponding to the target device connected to the serial port screen. The second protocol configuration module 504 is configured to add the protocol parsing function and protocol encapsulation function corresponding to the first communication protocol to the transceiver callback function module of the UI base project.
[0061] As can be seen from the above scheme, the present application scheme sets up a serial port screen architecture on the serial port screen, stores the UI design package in the UI base project through the UI editing module, and adds the corresponding UI driver and serial port driver in the UI driver library through the driver editing module. After the protocol acquisition module obtains the first communication protocol, the first communication protocol is ported to the send and receive callback function module through the protocol configuration module. This opens up the editing interface for UI design and serial communication protocol, so that users can directly port the communication protocol of the target device without having to do protocol matching or relay, effectively improving the flexibility and efficiency of using the serial port screen.
[0062] Based on the above embodiments, the UI firmware is firmware edited based on the serial port screen architecture.
[0063] Based on the above embodiments, the target UI driver library of the UI firmware stores the UI driver and the serial port driver, and the driver editing module 502 is further configured as follows:
[0064] Locate the target UI driver library and obtain the UI driver and serial port driver carried in the target UI driver library;
[0065] Add the UI driver and serial port driver to the UI driver library.
[0066] Based on the above embodiments, the firmware editing device further includes a firmware upgrade module, which is configured as follows:
[0067] Upon receiving a UI firmware update, in response to the UI firmware upgrade operation, the UI firmware is overwritten and updated using the UI firmware update.
[0068] Based on the above embodiments, the firmware upgrade module is further configured as follows:
[0069] Parse the UI update firmware to obtain the second communication protocol of the corresponding UI update firmware. The second communication protocol carries the serial communication protocol function corresponding to the target device.
[0070] Add the second communication protocol to the serial port transceiver function module, and add a protocol parsing function and a protocol encapsulation function corresponding to the second communication protocol in the transceiver callback function.
[0071] Based on the above embodiments, the received UI firmware is named in the target format, and the firmware editing device further includes a firmware selection module, which is configured as follows:
[0072] Select the desired UI firmware from the firmware package according to the target format.
[0073] It is worth noting that in the embodiments of the above-mentioned firmware editing device, the various functional modules are divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be achieved; in addition, the specific names of each functional module are only for easy differentiation and are not used to limit the scope of protection of this application.
[0074] Figure 6 This is a schematic diagram of a serial port screen according to an embodiment of this application. The serial port screen is used to execute the firmware editing method provided in the above embodiment, and has corresponding functional modules and beneficial effects for executing the method. For example... Figure 6 As shown, the device includes a processor 601, a memory 602, an input device 603, and an output device 604. The number of processors 601 in the device can be one or more; the figure shows one processor 601 as an example. The processor 601, memory 602, input device 603, and output device 604 in the device can be connected via a bus or other means; the figure shows a connection via a bus as an example. The memory 602, as a computer-readable storage medium, can be used to store software programs, computer-executable programs, and modules, such as the program instructions / modules corresponding to the firmware editing method in this embodiment. The processor 601 executes various functional applications and data processing of the device by running the software programs, instructions, and modules stored in the memory 602, thereby implementing the aforementioned firmware editing method.
[0075] The memory 602 may primarily include a program storage area and a data storage area. The program storage area may store the operating system and at least one application program required for a given function; the data storage area may store data recorded or created during the use of the flow detection device. Furthermore, the memory 602 may include high-speed random access memory and non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 602 may further include memory remotely configured relative to the processor 601, which can be connected to a serial port display via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0076] The input device 603 can be used to input corresponding numerical or character information to the processor 601, and to generate key signal inputs related to user settings and function control of the device. The output device 604 can be used to send or display key signal outputs related to user settings and function control of the device.
[0077] This application also provides a storage medium storing computer-executable instructions, which, when executed by a processor, are used to perform related operations in the firmware editing method provided in any embodiment of this application.
[0078] Computer-readable storage media include both permanent and non-permanent, removable and non-removable media, and information storage can be achieved by any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, disk storage or other magnetic storage devices, or any other non-transfer medium that can be used to store information accessible by a computing device.
[0079] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0080] Note that the above are merely preferred embodiments and the technical principles employed in this application. Those skilled in the art will understand that this application is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions can be made without departing from the scope of protection of this application. Therefore, although this application has been described in detail through the above embodiments, this application is not limited to the above embodiments, and may include many other equivalent embodiments without departing from the concept of this application, the scope of which is determined by the scope of the appended claims.
Claims
1. A serial port screen architecture, characterized in that, include: The factory firmware project includes factory firmware, which is used to initialize peripheral resources after the processor starts up; The UI foundation project includes a UI driver library, a serial port send / receive function module, a send / receive callback function module, and a timed callback function module. The UI driver library includes a UI driver program and a serial port driver program corresponding to the UI display; the serial port transceiver function module includes functions for providing serial port data transmission and reception; the transceiver callback function module includes functions for parsing received data and functions for encapsulating and packaging data to be sent; the timed callback function module includes functions for periodically reading the transceiver buffer, parsing received data, and encoding and sending data. The UI infrastructure includes a firmware upgrade module, which is used to parse the UI update firmware, obtain the second communication protocol corresponding to the UI update firmware, the second communication protocol carries the serial communication protocol function corresponding to the target device, add the second communication protocol to the serial port transceiver function module, and add the protocol parsing function and protocol encapsulation function corresponding to the second communication protocol to the transceiver callback function.
2. A firmware editing method, characterized in that, Applied to a serial port screen, the serial port screen including the serial port screen architecture as described in claim 1, the method includes: Based on the received UI firmware, obtain the UI design package corresponding to the user interface in the UI firmware, and store the UI design package in the UI folder corresponding to the UI basic project. The UI design package includes UI code and material package designed based on UI design tools. Based on the UI firmware, load the UI driver and serial port driver corresponding to the UI design package into the UI driver library; The UI firmware is parsed to obtain the first communication protocol, and the first communication protocol is added to the serial port transceiver function module of the UI basic project. The first communication protocol carries the serial port communication protocol function corresponding to the target device connected to the serial port screen. Add a protocol parsing function and a protocol encapsulation function corresponding to the first communication protocol to the send / receive callback function module of the UI base project; The UI update firmware is parsed to obtain the second communication protocol corresponding to the UI update firmware. The second communication protocol carries the serial communication protocol function corresponding to the target device. The second communication protocol is added to the serial port transceiver function module, and a protocol parsing function and a protocol encapsulation function corresponding to the second communication protocol are added to the transceiver callback function.
3. The firmware editing method according to claim 2, characterized in that, The UI firmware is firmware edited based on the serial port screen architecture.
4. The firmware editing method according to claim 3, characterized in that, The target UI driver library of the UI firmware stores the UI driver and the serial port driver. The step of loading the UI driver and serial port driver corresponding to the UI design package within the UI driver library based on the UI firmware includes: Locate the target UI driver library, and obtain the UI driver and the serial port driver carried in the target UI driver library; Add the UI driver and the serial port driver to the UI driver library.
5. The firmware editing method according to claim 2, characterized in that, The received UI firmware is named in the target format. Before receiving the UI firmware, the method further includes: Select the desired UI firmware from the firmware package according to the target format.
6. A firmware editing device, characterized in that, Applied to a serial port display, the serial port display including the serial port display architecture as described in claim 1, the device comprising: The UI editing module is configured to obtain the UI design package corresponding to the user interface in the received UI firmware, and store the UI design package in the UI folder corresponding to the UI base project. The UI design package includes UI code and material package designed based on UI design tools. The driver editing module is configured to load the UI driver and serial port driver corresponding to the UI design package in the UI driver library based on the UI firmware. The first protocol configuration module is configured to parse the UI firmware to obtain the first communication protocol, and add the first communication protocol to the serial port transceiver function module of the UI basic project. The first communication protocol carries the serial port communication protocol function corresponding to the target device connected to the serial port screen. The second protocol configuration module adds a protocol parsing function and a protocol encapsulation function corresponding to the first communication protocol to the send and receive callback function module of the UI base project; The firmware upgrade module is configured to parse the UI update firmware, obtain the second communication protocol of the corresponding UI update firmware, and the second communication protocol carries the serial communication protocol function corresponding to the target device. The second communication protocol is added to the serial port transceiver function module, and the protocol parsing function and protocol encapsulation function corresponding to the second communication protocol are added to the transceiver callback function.
7. A serial port screen, characterized in that, The serial port screen includes the serial port screen architecture as described in claim 1, and the serial port screen further includes: One or more processors; a storage device for storing one or more programs, which, when executed by one or more said programs, implement the firmware editing method as described in any one of claims 2 to 5.
8. A storage medium for storing computer-executable instructions, characterized in that, The computer-executable instructions, when executed by a processor, are used to perform the firmware editing method as described in any one of claims 2 to 5.
Citation Information
Patent Citations
Configuration serial port screen and achievement method of same
CN107145322A
Serial port screen secondary development method and system
CN107817776A