A method for display console task processing and human-machine interface processing based on VxWorks SMP

By employing dual-threaded core binding, message queues, and semaphore communication mechanisms in the VxWorks SMP system, combined with task spinlocks and Qt cross-platform interface development, the concurrent operation problem of display console task processing and human-machine interface processing was solved, achieving efficient and reliable display console operation.

CN122086345APending Publication Date: 2026-05-26SHANGHAI SPACEFLIGHT ELECTRONICS & COMM EQUIP RES INST
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHANGHAI SPACEFLIGHT ELECTRONICS & COMM EQUIP RES INST
Filing Date
2026-02-11
Publication Date
2026-05-26

AI Technical Summary

Technical Problem

The VxWorks SMP system faces difficulties in multi-threaded concurrent operation during console task processing and human-machine interface processing, leading to system stability and real-time issues, and making it prone to anomalies such as crashes and software malfunctions.

Method used

A VxWorks SMP-based console task processing method is adopted, which uses dual-thread core binding processing, message queue and semaphore communication mechanisms, combined with task spinlocks and Qt cross-platform interface development to achieve concurrent execution and efficient communication between the task processing thread and the human-machine interface processing thread.

Benefits of technology

It enables concurrent operation of task processing on the display and control console and human-machine interface processing, improving system stability and real-time performance, reducing hardware costs, enhancing data processing capabilities and human-machine interaction efficiency, and ensuring high system integration and reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122086345A_ABST
    Figure CN122086345A_ABST
Patent Text Reader

Abstract

This invention relates to the field of high-performance embedded real-time operating system application technology, and provides a method for task processing and human-machine interface processing on a display console based on VxWorks SMP, including: S1: Building a display console with a computer installed, configuring various control components and a display, and using the VxWorks SMP system to concurrently execute the task processing and human-machine interface processing functions that traditionally require two separate computers on the display console on this computer; S2: Developing and generating system-related project files using VxWorks development tools, and allocating and configuring task processing threads, human-machine interface processing threads, and control response underlying processing tasks, while configuring inter-task cooperation and protection mechanisms; S3: Writing a script program, guided by the VxWorks system, to load the control response underlying processing task binding project, task processing thread project, and human-machine interface processing thread project step by step. This solves the difficulty of concurrent operation of display console task processing and human-machine interface processing in VxWorks SMP.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the technical field of high-performance embedded real-time operating system applications, and more particularly to a method for task processing and human-machine interface processing of a display console based on VxWorks SMP. Specifically, it involves dual-thread core binding processing based on the VxWorks SMP system, core binding processing of control response tasks, high integration of the display console's internal computer, development of a cross-platform Qt application interface, flexible communication methods between tasks using semaphores or message queues, and the use of task spinlocks and Qt synchronization semaphores. This significantly improves the display console's data processing capabilities and human-machine interaction capabilities, highlighting the display console's high integration, high efficiency, and high reliability, and solving the difficulties of concurrent operation of task processing and human-machine interface processing in VxWorks SMP display consoles. Background Technology

[0002] VxWorks is a high-performance embedded real-time operating system featuring an efficient microkernel, preemptive scheduling, time-slice round-robin scheduling, and flexible inter-task communication and synchronization mechanisms. Its excellent reliability and superior real-time performance have led to its widespread application in high-precision and real-time-critical fields. Qt is a cross-platform C++ graphical user interface development platform with a rich and sophisticated development library, efficient signal and slot communication mechanisms, simple programming, high readability, and facilitates modular and structured software architecture design.

[0003] As a human-computer interaction terminal, the display console possesses display and control capabilities, computing and storage capabilities, interconnection and communication capabilities, and complex data processing capabilities. Traditional display consoles often house two computers, one for task processing and the other for human-computer interface processing. Embedded display consoles widely use the VxWorks single-core operating system, which offers high stability. However, the VxWorks single-core operating system cannot resolve the conflict between multithreading, multitasking, and real-time performance because it operates on a preemptive multitasking programming model based on task priority, where each processor core executes only one task at a time. The VxWorks SMP system, as a tightly coupled shared-memory symmetric multiprocessor, as shown in the attached... Figure 1 As shown, a single instance of an operating system controls multiple tasks to run on multiple processor cores, enabling true multitasking concurrent execution and interrupt handling.

[0004] It has been learned that there is currently insufficient development and practical experience with VxWorks SMP system application software. While VxWorks SMP system application software can perform its functions relatively well under low system load and low resource utilization, the implementation of VxWorks SMP-based console task processing and human-machine interface processing is still in its infancy. Furthermore, the console's backend data processing is complex, task calculation has high real-time requirements, there are numerous human-machine interaction control devices, interrupt response is complex, and if the hardware circuitry is subjected to unexplained interference, the software may experience abnormal jumps, easily entering unintended infinite loops, leading to software crashes, functional failures, and other abnormal phenomena. Summary of the Invention

[0005] Addressing the widespread use of the VxWorks operating system and the challenges in implementing task processing and human-machine interface processing for VxWorks SMP-based consoles, this invention aims to improve the reliability of VxWorks SMP systems on consoles and enhance their dual-thread parallel processing capabilities. The invention provides a method for task processing and human-machine interface processing for VxWorks SMP-based consoles, enabling concurrent execution of dual threads. Threads communicate using message queues, while single-threaded multi-task communication uses semaphores. Task switching is protected using task spinlocks. Furthermore, leveraging the Qt cross-platform application interface development library and utilizing Qt's efficient signal and slot transmission mechanism and synchronization semaphores, a user-friendly human-machine interaction is achieved.

[0006] The above-mentioned objective of this invention is achieved through the following technical solutions: A method for task processing and human-machine interface processing of a display console based on VxWorks SMP includes the following steps: S1: Build a display console with one computer installed inside, configure various control components and monitors, and use the VxWorks SMP system to concurrently execute the task processing functions and human-machine interface processing functions that traditional display consoles require two computers to implement on this computer. S2: Using the VxWorks development tool, generate system-related project files, allocate and configure task processing threads, human-machine interface processing threads and control response underlying processing tasks, and configure inter-task collaboration and protection mechanisms. S3: Write a script program that is guided by the VxWorks system to load the underlying processing task binding project, task processing thread project, and human-machine interface processing thread project in stages. The task processing thread and the human-machine interface processing thread use a message queue data transfer mechanism to complete the sending and receiving of display information and control commands.

[0007] Furthermore, in step S1, the various control components include a mouse, a standard keyboard, a custom keyboard, and a touch keyboard, and the display console features high integration, high reliability, and strong real-time performance.

[0008] Further, in step S2, the VxWorks development tool is workbench3.2, and the system-related project files include the high-efficiency microkernel system image VIP file, the task processing thread DKM project project, the human-machine interface processing thread DKM project project, and the control response underlying processing task binding kernel DKM project project. In steps S2 and S3, the application software is launched using a system script startup boot mode and a step-by-step loading method, which retains the traditional independent development mode of functional code under the VxWorks single-core architecture, minimizing the work of porting and writing code under the VxWorks SMP system.

[0009] Furthermore, in step S2, the task processing thread is assigned to processor core 0 for execution, and the human-machine interface processing thread is assigned to processor core 1 for execution. By binding threads to processor cores, the optimized design of assigning specific processor cores to threads reduces the task scheduling overhead between system processor cores and improves system stability.

[0010] Furthermore, in step S2, the control response-related tasks generated by the system's underlying configuration items and the control response-related underlying processing tasks generated by the system software middleware are jointly allocated to processor core 1 along with the human-machine interface processing thread. This avoids preemptive task context switching between control response-related tasks and task processing thread-related tasks, reduces scheduling between multiple task cores, and improves system execution efficiency.

[0011] Further, in step S2, the message queue includes a display message queue RefreshShow_msgid and a control message queue Operate_msgid; Data communication between the task processing thread's periodic display task and the human-machine interface processing thread's display and receive tasks, as well as between the human-machine interface processing thread's control response task and the task processing thread's control processing task, is achieved by creating separate display message queues and control message queues. The periodic display task of the task processing thread sends display information to the display receiving task of the human-machine interface processing thread through the display message queue, and the control response task of the human-machine interface processing thread sends control commands to the control processing task of the task processing thread through the control message queue.

[0012] Furthermore, in step S2, the task protection mechanism is configured for BIT detection tasks with short execution cycles and minimal sequential code execution, specifically as follows: When the BIT detection task runs, it first acquires the task spin lock by using spinLockTaskTake(&coreReady). After the task code finishes running, it releases the task spin lock by using spinLockTaskGive(&coreReady) to protect the task and avoid unnecessary performance consumption caused by task switching.

[0013] Furthermore, in step S2, a multi-task collaboration mechanism is configured within the task processing thread, specifically by setting task priorities and VxWorks system semaphores to achieve complex data processing, task calculation, and process control.

[0014] Furthermore, in step S2, the human-machine interface processing thread is built using the VxWorks+Qt hybrid development platform. VxWorks provides it with secure, reliable, and real-time external communication functions, while Qt, through its rich, art-level cross-platform C++ graphical user interface library, makes the display interface of the control console beautiful, user-friendly, and practical. The interface information display and human-machine interaction functions within the human-machine interface processing thread use the Qt signal and slot message passing mechanism to efficiently complete data transmission between objects and human-machine interaction operations.

[0015] Furthermore, in step S2, the information receiving task and the interface refresh task of the human-machine interface processing thread are configured with a task cooperation mechanism through the Qt synchronization semaphore QSemaphore, specifically implemented as follows: After receiving the display information, the display information receiving task obtains the synchronization semaphore by judging if (QSemap_rcv.tryAcquire(1)!=false). If the acquisition is successful, the emit signal is released to trigger the Qt signal and slot mechanism, and the display information is passed to the interface refresh task. After the interface refresh task completes the screen redraw, it executes QSemap_rcv.release(1) to release the synchronization semaphore, so as to realize the synchronization between the display information receiving and the interface refresh.

[0016] Compared with the prior art, the present invention has at least one of the following beneficial effects: (1) Filling the technical gap and solving the concurrency problem: This invention is the first to realize the concurrent operation of display and control console task processing and human-machine interface processing based on VxWorks SMP system, effectively filling the gap of dual-thread concurrent execution application in this field in China, successfully solving the technical dilemma of parallel operation of dual core functions of display and control console under VxWorks SMP environment, avoiding the contradiction between the traditional single-core structure and multi-task processing and real-time performance, as well as the problems of crash, software failure and function failure that are prone to occur in existing SMP applications.

[0017] (2) Significant advantages of high integration: Through the characteristics of the VxWorks SMP system, the task processing and human-machine interface processing functions that traditional display consoles require two computers to implement are integrated into a single computer for concurrent execution, which greatly simplifies the hardware architecture of the display console, reduces hardware size and cost, and has the core characteristics of high integration, high reliability and strong real-time, which is suitable for the application needs of high-precision fields for equipment miniaturization and integration.

[0018] (3) Significantly improved operating efficiency: The thread-bound core optimization design is adopted, and the task processing thread is assigned to processor core 0, the human-machine interface processing thread and the control response related tasks are assigned to processor core 1, which effectively reduces the scheduling overhead between system cores and avoids preemptive context switching of tasks; the efficient data transmission between threads is achieved through message queues (display message queue RefreshShow_msgid and control message queue Operate_msgid), the data processing speed within the task processing thread is improved through priority settings and VxWorks semaphore mechanism, and the human-machine interface processing thread relies on the Qt signal and slot mechanism to achieve fast interactive response, which comprehensively improves the data processing capability and human-machine interaction efficiency of the display console.

[0019] (4) Significantly enhanced system reliability: Task spin lock protection is adopted for BIT detection tasks, and the task switching function of the current core is disabled to avoid performance consumption and data conflicts caused by task context switching; the synchronization of display information reception and interface refresh is ensured by Qt synchronization semaphore to prevent abnormal access to shared resources; the underlying task of control response and the human-machine interface thread are bound to the same core to avoid interference with the task processing thread, greatly reduce the risk of abnormal software jumps and infinite loops, and ensure the stable operation of the system under complex working conditions.

[0020] (5) Excellent development compatibility and scalability: The system script startup and guidance mode is adopted to load related projects step by step, which retains the independent development mode of traditional functional code under the VxWorks single-core structure, minimizes the workload of code porting and writing under the SMP system, and reduces development costs and cycle; the human-machine interface processing thread is based on the VxWorks+Qt hybrid development platform. Qt's cross-platform characteristics and rich graphical interface library not only make the display interface beautiful, friendly and practical, but also provide convenience for subsequent function expansion and multi-platform adaptation.

[0021] In summary, this invention comprehensively improves the overall performance of the display console through hardware integration, thread optimization, and communication and protection mechanism design, highlighting the core advantages of high integration, high efficiency, and high reliability, and providing a reliable solution for the in-depth application of VxWorks SMP system in the field of high-precision embedded real-time applications. Attached Figure Description

[0022] Figure 1 This is a schematic diagram of a typical dual-processor SMP structure of the present invention; Figure 2 This is an overall flowchart of the VxWorks SMP-based display console task processing and human-machine interface processing method of the present invention; Figure 3 This is a schematic diagram of the task processing and human-machine interface processing method for the display console based on VxWorks SMP of the present invention; Figure 4 This is a schematic diagram of the functional components of the conventional display and control console of the present invention; Figure 5 This is a schematic diagram of the display and control console software architecture of the present invention; Figure 6 This is a schematic diagram illustrating the communication between the task processing thread and the human-machine interface processing thread of the present invention. Detailed Implementation

[0023] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0024] Those skilled in the art will understand that, unless specifically stated otherwise, the singular forms “a,” “an,” “the,” and “the” used herein may also include the plural forms. It should be further understood that the term “comprising” as used in this specification means the presence of the stated features, integers, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.

[0025] First Embodiment like Figure 2 and 3 As shown, this embodiment provides a method for task processing and human-machine interface processing of a display console based on VxWorks SMP, characterized by the following steps: S1: Build a display console with one computer installed inside, configured with various control components and monitors, and use the VxWorks SMP system to concurrently execute the task processing functions and human-machine interface processing functions that traditional display consoles require two computers to perform on this computer.

[0026] In this embodiment, in step S1, the various control components include a mouse, a standard keyboard, a custom keyboard, and a touch keyboard, and the display console has the characteristics of high integration, high reliability, and strong real-time performance.

[0027] S2: Using the VxWorks development tool, generate system-related project files, allocate and configure task processing threads, human-machine interface processing threads, and underlying control response processing tasks, and configure inter-task collaboration and protection mechanisms.

[0028] In this embodiment, in step S2, the VxWorks development tool is workbench3.2, and the system-related project files include the high-efficiency microkernel system image VIP file, the task processing thread DKM project project, the human-machine interface processing thread DKM project project, and the control response underlying processing task binding kernel DKM project project.

[0029] In this embodiment, in step S2, the task processing thread is assigned to processor core 0 for execution, and the human-machine interface processing thread is assigned to processor core 1 for execution. By binding threads to processor cores, the optimized design of assigning specific processor cores to threads reduces the task scheduling overhead between system processor cores and improves system stability.

[0030] In this embodiment, in step S2, the control response-related tasks generated by the system's underlying configuration items and the control response underlying processing tasks generated by the system software middleware are jointly allocated to processor core 1 along with the human-machine interface processing thread. This avoids preemptive task context switching between control response-related tasks and task processing thread-related tasks, reduces scheduling between multiple task cores, and improves system execution efficiency.

[0031] In this embodiment, in step S2, the message queue includes a display message queue RefreshShow_msgid and a control message queue Operate_msgid; Data communication between the task processing thread's periodic display task and the human-machine interface processing thread's display and receive tasks, as well as between the human-machine interface processing thread's control response task and the task processing thread's control processing task, is achieved by creating separate display message queues and control message queues. The periodic display task of the task processing thread sends display information to the display receiving task of the human-machine interface processing thread through the display message queue, and the control response task of the human-machine interface processing thread sends control commands to the control processing task of the task processing thread through the control message queue.

[0032] In this embodiment, in step S2, the task protection mechanism is configured for BIT detection tasks with short execution cycles and minimal sequential code execution, specifically as follows: When the BIT detection task runs, it first acquires the task spin lock by using spinLockTaskTake(&coreReady). After the task code finishes running, it releases the task spin lock by using spinLockTaskGive(&coreReady) to protect the task and avoid unnecessary performance consumption caused by task switching.

[0033] In this embodiment, in step S2, a multi-task collaboration mechanism is configured within the task processing thread, specifically by setting task priorities and VxWorks system semaphores to achieve complex data processing, task calculation, and process control.

[0034] In this embodiment, in step S2, the human-machine interface processing thread is built using the VxWorks+Qt hybrid development platform. VxWorks provides it with secure, reliable, and real-time external communication functions, while Qt, through its rich, art-level cross-platform C++ graphical user interface library, makes the display interface of the control console beautiful, user-friendly, and practical. The interface information display and human-machine interaction functions within the human-machine interface processing thread use the Qt signal and slot message passing mechanism to efficiently complete data transmission between objects and human-machine interaction operations.

[0035] In this embodiment, in step S2, the information receiving task and the interface refresh task of the human-machine interface processing thread are configured with a task cooperation mechanism through the Qt synchronization semaphore QSemaphore, specifically implemented as follows: After receiving the display information, the display information receiving task obtains the synchronization semaphore by judging if (QSemap_rcv.tryAcquire(1)!=false). If the acquisition is successful, the emit signal is released to trigger the Qt signal and slot mechanism, and the display information is passed to the interface refresh task. After the interface refresh task completes the screen redraw, it executes QSemap_rcv.release(1) to release the synchronization semaphore, so as to realize the synchronization between the display information receiving and the interface refresh.

[0036] S3: Write a script program that is guided by the VxWorks system to load the underlying processing task binding project, task processing thread project, and human-machine interface processing thread project in stages. The task processing thread and the human-machine interface processing thread use a message queue data transfer mechanism to complete the sending and receiving of display information and control commands.

[0037] In addition, in steps S2 and S3, the application software is launched using a system script startup boot mode and a step-by-step loading method, which retains the traditional independent development mode of functional code under the VxWorks single-core architecture, minimizing the work of porting and writing code under the VxWorks SMP system.

[0038] Second Embodiment This embodiment further illustrates the technical solution protected by the present invention. As a basic platform for human-computer interaction, a traditional display console typically houses two computers, one for task processing and the other for human-computer interface processing. The computers communicate with each other via two external network interfaces on the display console, connected to the same switch, as shown in the attached diagram. Figure 4 As shown, one task processing computer is primarily responsible for complex data processing, task calculation, and external network communication; the other human-machine interface (HMI) processing computer is primarily responsible for receiving display information from the task processing computer and displaying it on the interface in real time, as well as generating control intervention commands through device operation and sending them to the task processing computer. This invention, based on a VxWorks SMP-based console task processing and HMI processing method, provides a solution that integrates task processing and HMI processing functions on a console onto a single computer, featuring high integration, high reliability, and strong real-time performance.

[0039] This invention relates to the development and porting of task processing and human-machine interface (HMI) software based on a traditional VxWorks single-core architecture system. Since most operating systems supporting VxWorks SMP adopt a strategy of maintaining the original single-core interface unchanged, this invention employs a system script startup mode, loading the task processing and HMI processing modules step-by-step. This ensures that the software development is carried out independently on the VxWorks integrated development environment (Workbench 3.2), and then uniformly installed and debugged on the display console. The specific implementation of the script startup and step-by-step loading is as follows: cd " / ata0a / smp / usr # Loading the task processing thread module ld <taskPro.out sp vxtaskP taskDelay(sysClkRateGet()*30) # Loading the Human-Machine Interface Processing Thread Module ld <hmInter.out sp vxhmIn Currently, research and practical experience with VxWorks SMP application software in China is insufficient, especially in the application of dual-threaded concurrent execution on display consoles, which is still in its infancy and development is relatively slow. In other related applications, users often fail to specify thread priorities according to actual needs, leading to unexpected interruptions of important tasks. This makes them unsuitable for applications with high real-time requirements and also frequently causes other problems such as high scheduling overhead between task cores and insufficient interrupt response capabilities, making the system prone to crashes. As a fundamental platform for human-computer interaction, the display console, with its complex background task processing functions and excellent human-computer interface interaction capabilities, not only requires high real-time performance and logical consistency for data processing tasks, but also clear and smooth data display and timely and effective response from USB control devices. This invention presents a method for task processing and human-machine interface processing on a VxWorks SMP-based display console. It provides a method to pre-assign task processing threads and human-machine interface processing threads to specific VxWorks SMP processor cores, enabling the two functional modules to execute concurrently without interference. This strategy effectively coordinates the parallel activities between VxWorks SMP processor cores, avoiding damage to the VxWorks kernel's data structures and preventing excessive shared data between the two threads. This avoids data contention between processor cores, which increases system performance due to contention and waiting for data. The specific implementation of binding two threads to specific VxWorks SMP processor cores in the VxWorks SMP system is as follows: void vxtaskP() / / Task processing thread { cpuset_t affinity; CPUSET_ZERO(affinity); CPUSET_SET(affinity,0); status = taskCpuAffinitySet(0, affinity); / / The task processing thread is assigned to processor core-0. taskSpawn(..........); } void vxhmIn() / / Human-computer interface processing thread { cpuset_t affinity; CPUSET_ZERO(affinity); CPUSET_SET(affinity, 1); status = taskCpuAffinitySet(1, affinity); / / The human-machine interface processing thread is assigned to processor core-1 taskSpawn(..........); } The widely used display and control console adopts a modular design of software and hardware, integrating functions such as comprehensive display, human-computer interaction, and real-time processing of multi-source information. The system uses software middleware, which enables the control modules of various display and control consoles to be interchangeable and interoperable. The event management program and event driver program of the control device are pre-deployed on the display and control console hardware platform as basic system configuration items. The software architecture diagram of the display and control console is attached. Figure 5 As shown. Based on this, in order to maximize system performance and avoid interference between task processing threads and related control tasks due to inter-core scheduling, this invention provides a VxWorks SMP-based console task processing and human-machine interface processing method. This method allocates system-level control response tasks and the human-machine interface thread to the same processor core, thereby improving system execution efficiency and reliability. The specific functional implementation is as follows: static char taskUsbNames[]

[32] = { \ "EHCD_IH0", \ "BusM A", \ "vxbUsbKeyboard_IRP", \ "vxbUsbMouse_IRP ... }; / / List of task names related to device response int taskUsbCpuBindStatus = 0; / / Flag indicating the core binding status of the task related to device response. / / Implement the core binding function for controlling device response to related tasks STATUS taskUsbCpuBind(unsigned int cpu){ / / Check the core-binding input parameters against the number of cores configured in the VxWorks SMP processor to prevent incorrect input parameters. if(cpu >= vxCpuConfiguredGet()){ return ERROR; } while(taskUsbCpuBindStatus != ((1< <sizeof(taskUsbNames) / sizeof(taskUsbNames[0]))-1)){ for(i=0; i <sizeof(taskUsbNames) / sizeof(taskUsbNames[0]); i++){ if (taskUsbCpuBindStatus & (1< <i)){ continue; / * Avoid duplicate binding of device response-related tasks * / } tid = taskNameToId(taskUsbNames[i]); if(tid != ERROR){ cpuset_t affinity; CPUSET_ZERO (affinity); CPUSET_SET (affinity, cpu); if(taskCpuAffinitySet(tid, affinity) == OK){ taskUsbCpuBindStatus |= 1< <i; } } } taskDelay(sysClkRateGet()); } return OK; } After completing the core binding code implementation for controlling device response tasks, simply place its executable program into the system startup script for loading. The specific implementation is as follows: cd " / ata0a / smp / usr #Loading and binding cores for control response related tasks ld <taskCpuBind.out # Bind the control response related tasks to processor core-1 sp taskUsbCpuBind,1 This document describes a VxWorks SMP-based method for console task processing and human-machine interface (HMI) processing. For BIT monitoring tasks within the HMI processing thread, which have short execution cycles and minimal sequential code execution, a task spinlock is employed for task protection to avoid unnecessary performance overhead caused by task scheduling context switching. The task spinlock disables task switching on the processor core, preventing other tasks on that core from preemptively occupying it. This allows the task holding the spinlock to hold it exclusively until completion, without affecting task scheduling on other processor cores. The specific implementation is as follows: void devbit(){ / / BIT task function body static spinlockTask_t coreReady; while(1){ spinLockTaskTake(&coreReady); / / Acquire the task spin lock ...... spinLockTaskGive(&coreReady); / / Release the task spin lock } } In the VxWorks SMP-based display console task processing and human-machine interface (HMI) processing method, the task processing thread and the HMI thread are executed concurrently on the same motherboard. Communication between the two threads is achieved through a message queue mechanism. The task processing thread periodically sends the information to be displayed to the display message queue, and the HMI processing thread periodically retrieves the display information through the display message queue, then displays it in real time using the Qt cross-platform application interface development library within the HMI processing thread. Control commands generated by the HMI processing thread are sent non-periodically to the control message queue, and the task processing thread then retrieves the control commands through this message queue to intervene and control the task process. A schematic diagram of the dual-thread communication implementation is attached. Figure 6 As shown.

[0040] Based on VxWorks SMP, the workflow control of the task processing thread on the display console first assigns differentiated task priorities according to task level, thereby obtaining more CPU time through priority and achieving multi-task concurrency. Synchronous semaphore communication is used between tasks to realize the rapid acquisition, processing and output of data by multiple tasks, and finally completes the data processing, task calculation and device control functions of the task processing thread.

[0041] The human-machine interface processing thread on the display console, based on VxWorks SMP, is developed using a hybrid approach of VxWorks and Qt. VxWorks primarily provides secure, reliable, and real-time external communication capabilities, while Qt, through its rich, high-quality, cross-platform C++ graphical user interface library, delivers a beautiful, user-friendly, and practical display. Furthermore, the interface display and human-machine interaction functions internally utilize Qt's signal and slot message passing mechanism, enabling efficient and timely responses to various messages and efficient human-machine interaction operations.

[0042] Based on VxWorks SMP, this paper addresses the issue of protecting shared resources between the display information receiving task and the interface display refresh task in the human-machine interface processing thread of the display console. It proposes using Qt's QSemaphore to ensure that the display information receiving task and the interface display refresh task can be correctly synchronized, thus achieving synchronization and communication between tasks. Specifically, after receiving display information from the task processing thread via the display message queue, the display information receiving task checks if (QSemap_rcv.tryAcquire(1)!=false) has acquired the synchronization semaphore. If so, it releases the emit signal to trigger the Qt signal and slot mechanism, efficiently transmitting the display information to the interface display refresh task. Upon receiving the display information, the interface display refresh task begins redrawing the display screen. After the refresh is complete, it executes QSemap_rcv.release(1) to release the synchronization semaphore, completing the periodic interface display refresh.

[0043] A computer-readable storage medium stores computer code that, when executed, performs the methods described above. Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing related hardware. This program can be stored in a computer-readable storage medium, which may include: read-only memory (ROM), random access memory (RAM), a magnetic disk, or an optical disk, etc.

[0044] The above description is merely a preferred embodiment of the present invention. The scope of protection of the present invention is not limited to the above embodiments. All technical solutions falling within the scope of the present invention's concept are within the scope of protection of the present invention. It should be noted that for those skilled in the art, any improvements and modifications made without departing from the principles of the present invention should also be considered within the scope of protection of the present invention.

[0045] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0046] It should be noted that the above embodiments can be freely combined as needed. The above description is only a preferred embodiment of the present invention. It should be pointed out that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. A method for task processing and human-machine interface processing of a display console based on VxWorks SMP, characterized in that, Includes the following steps: S1: Build a display console with one computer installed inside, configure various control components and monitors, and use the VxWorks SMP system to concurrently execute the task processing functions and human-machine interface processing functions that traditional display consoles require two computers to implement on this computer. S2: Using the VxWorks development tool, generate system-related project files, allocate and configure task processing threads, human-machine interface processing threads and control response underlying processing tasks, and configure inter-task collaboration and protection mechanisms. S3: Write a script program that is guided by the VxWorks system to load the underlying processing task binding project, task processing thread project, and human-machine interface processing thread project in stages. The task processing thread and the human-machine interface processing thread use a message queue data transfer mechanism to complete the sending and receiving of display information and control commands.

2. The method for task processing and human-machine interface processing of a display and control console based on VxWorks SMP according to claim 1, characterized in that, In step S1, the various control components include a mouse, a standard keyboard, a custom keyboard, and a touch keyboard, and the display console features high integration, high reliability, and strong real-time performance.

3. The method for task processing and human-machine interface processing of a display and control console based on VxWorks SMP according to claim 1, characterized in that, In step S2, the VxWorks development tool is workbench3.2, and the system-related project files include the high-efficiency microkernel system image VIP file, the task processing thread DKM project project, the human-machine interface processing thread DKM project project, and the control response underlying processing task binding kernel DKM project project. In steps S2 and S3, the application software is launched using a system script startup boot mode and a step-by-step loading method, which retains the traditional independent development mode of functional code under the VxWorks single-core architecture, minimizing the work of porting and writing code under the VxWorksSMP system.

4. The method for task processing and human-machine interface processing of a display and control console based on VxWorks SMP according to claim 1, characterized in that, In step S2, the task processing thread is assigned to processor core 0 for execution, and the human-machine interface processing thread is assigned to processor core 1 for execution. By binding threads to processor cores, the optimized design of assigning specific processor cores to threads reduces the task scheduling overhead between system processor cores and improves system stability.

5. The method for task processing and human-machine interface processing of a display and control console based on VxWorks SMP according to claim 1, characterized in that, In step S2, the control response-related tasks generated by the system's underlying configuration items and the control response underlying processing tasks generated by the system software middleware are jointly allocated to processor core 1 along with the human-machine interface processing thread. This avoids preemptive task context switching between control response-related tasks and task processing thread-related tasks, reduces scheduling between multiple task cores, and improves system execution efficiency.

6. The method for task processing and human-machine interface processing of a display and control console based on VxWorks SMP according to claim 1, characterized in that, In step S2, the message queue includes a display message queue RefreshShow_msgid and a control message queue Operate_msgid; Data communication between the task processing thread's periodic display task and the human-machine interface processing thread's display and receive tasks, as well as between the human-machine interface processing thread's control response task and the task processing thread's control processing task, is achieved by creating separate display message queues and control message queues. The periodic display task of the task processing thread sends display information to the display receiving task of the human-machine interface processing thread through the display message queue, and the control response task of the human-machine interface processing thread sends control commands to the control processing task of the task processing thread through the control message queue.

7. The method for task processing and human-machine interface processing of a display and control console based on VxWorks SMP according to claim 1, characterized in that, In step S2, the task protection mechanism is configured for BIT detection tasks with short execution cycles and minimal sequential code execution, specifically as follows: When the BIT detection task runs, it first acquires the task spin lock by using spinLockTaskTake(&coreReady). After the task code finishes running, it releases the task spin lock by using spinLockTaskGive(&coreReady) to protect the task and avoid unnecessary performance consumption caused by task switching.

8. The method for task processing and human-machine interface processing of a display and control console based on VxWorks SMP according to claim 1, characterized in that, In step S2, a multi-task collaboration mechanism is configured within the task processing thread, specifically by setting task priorities and VxWorks system semaphores to achieve complex data processing, task calculation, and process control.

9. The method for task processing and human-machine interface processing of a display and control console based on VxWorks SMP according to claim 1, characterized in that, In step S2, the human-machine interface processing thread is built using the VxWorks+Qt hybrid development platform. VxWorks provides it with secure, reliable, and real-time external communication functions, while Qt, through its rich, art-level cross-platform C++ graphical user interface library, makes the display interface of the control console beautiful, user-friendly, and practical. The interface information display and human-machine interaction functions within the human-machine interface processing thread use the Qt signal and slot message passing mechanism to efficiently complete data transmission between objects and human-machine interaction operations.

10. The method for task processing and human-machine interface processing of a display and control console based on VxWorks SMP according to claim 1, characterized in that, In step S2, the information receiving task and the interface refresh task of the human-machine interface processing thread are configured with a task cooperation mechanism through the Qt synchronization semaphore QSemaphore, specifically implemented as follows: After receiving the display information, the display information receiving task obtains the synchronization semaphore by judging if (QSemap_rcv.tryAcquire (1)!=false). If the acquisition is successful, the emit signal is released to trigger the Qt signal and slot mechanism, and the display information is passed to the interface refresh task. After the interface refresh task completes the screen redraw, it executes QSemap_rcv.release(1) to release the synchronization semaphore, so as to realize the synchronization between the display information receiving and the interface refresh.