KANZI data transparent transmission method and device, vehicle and storage medium
The KANZI data transmission method is used to build and capture click events of the graphical user interface in a dual SOC architecture car, which solves the problem of not being able to accurately capture click events and improves the response speed and interactive experience of the user interface.
Patent Information
- Application Number
- CN202510156061.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-12
- Publication Date
- 2025-05-13
AI Technical Summary
In cars with dual SOC architecture, click events cannot be accurately captured, resulting in program performance loss and interactive experience.
Through the KANZI data transmission method, controls in each area of the graphical user interface are constructed, the attribute identification and function name of each control are determined, and click events in the display screen are captured, and the corresponding attribute identification is transmitted to the real-time operating system or Android operating system.
Accurate capture and transmission of click events is achieved, improving the user interface's response speed and interactive experience, reducing latency and improving overall performance.
Smart Images

Figure CN119987639A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of vehicle control technology, and in particular to a KANZI data transparent transmission method, device, vehicle and storage medium. Background Art
[0002] In related technologies, automakers have begun to adopt a dual SOC (System on Chip) architecture, which integrates two independent chips into one system, each responsible for different tasks. One chip uses the Android operating system to handle the in-vehicle entertainment system, navigation system and other basic functions, while the other chip uses a real-time operating system to handle complex tasks such as advanced driver assistance systems (ADAS), real-time tasks and artificial intelligence algorithms.
[0003] However, both operating systems interact with the car system through the screen. As more and more applications and functions are integrated, it is not only not conducive to subsequent flexible expansion, but also unable to accurately capture click events on the screen when three-dimensional interaction is involved. This increases the program performance loss and reduces the interactive experience. Summary of the invention
[0004] The embodiments of the present application provide a KANZI data transparent transmission method, device, vehicle and storage medium to solve the technical problem in the related art that click events cannot be accurately captured.
[0005] The present application embodiment provides a KANZI data transparent transmission method, and the KANZI data transparent transmission method includes:
[0006] Construct controls for each area in a graphical user interface, determine the one-to-one corresponding attribute identifier and function name of each of the controls, and the graphical user interface is determined by KANZI; capture click events for any of the controls in the display screen; if any of the click events is captured, determine the attribute identifier corresponding to the current click event; transmit the attribute identifier to a real-time operating system or an Android operating system through data transparent transmission, and determine the corresponding function name and respond to the corresponding service in response to the attribute identifier.
[0007] In one embodiment of the present application, controls for each area in a graphical user interface are constructed, and attribute identifiers and function names corresponding to each of the controls are determined, including: constructing a graphical user interface based on the KANZI; pre-setting controls for each area in the graphical user interface, the controls including at least one of buttons, blank areas, hidden areas, and preset target areas; defining each of the controls preset in each area as a different function name, and each of the function names corresponds to an attribute identifier with a unique identifier.
[0008] In one embodiment of the present application, capturing a click event for any of the controls in the display screen includes: monitoring each control on the graphical user interface in the display screen; if any of the click events is monitored to be triggered, and the click event is located on the display area of at least a part of any of the buttons, then determining that the click event for the button in the display screen is captured; if any of the click events is monitored to be triggered, and the click event is located on the display area of at least a part of any of the blank areas, then determining that the click event for the blank area in the display screen is captured; if any of the click events is monitored to be triggered, and the click event is located on the display area of at least a part of any of the hidden areas, then determining that the click event for the hidden area in the display screen is captured; if any of the click events is monitored to be triggered, and the click event is located on the display area of at least a part of any of the preset target areas, then determining that the click event for the preset target area in the display screen is captured.
[0009] In one embodiment of the present application, it also includes: if the click event is not captured and exceeds the preset time period, determining each control in the current graphical user interface; searching the attribute identifier and the function name of each control, and verifying them in the preset link table; if the verification results are consistent, determining that the links of each control are correct; if the verification results are inconsistent, determining that the links of each control are incorrect.
[0010] In one embodiment of the present application, the attribute identifier is transparently transmitted to a real-time operating system or an Android operating system, and in response to the attribute identifier, the corresponding function name is determined and a corresponding service is responded to, including: using KANZI to write the attribute identifier and the write path of the control corresponding to the click event to form a data file; transparently transmitting the data file to the real-time operating system or the Android operating system, parsing the data file, and determining the attribute identifier; executing a functional service matching the attribute identifier, and feeding back a service result, wherein the service result is a response file generated by the real-time operating system or the Android operating system.
[0011] In one embodiment of the present application, it also includes: receiving the response file, using KANZI to read the response result in the response file; judging the writing status of the data file through the response result; if the response result includes successful service execution, determining that the KANZI data is written successfully; if the response result does not include successful service execution, determining that the KANZI data is written unsuccessfully.
[0012] In one embodiment of the present application, before capturing a click event for any of the controls in the display screen, it also includes: receiving an operation instruction from the Android system, the operation instruction carrying a command to change the target control; in response to the operation instruction, changing the target control in the graphical user interface, so that the KANZI renders the graphical user interface according to the change command and displays it.
[0013] The embodiment of the present application also provides a KANZI data transparent transmission device, which includes: a control construction module, configured to construct controls for each area in a graphical user interface, and determine the one-to-one corresponding attribute identifier and function name of each control, and the graphical user interface is determined by KANZI; a capture module, configured to capture click events for any of the controls in the display screen; an event determination module, configured to determine the attribute identifier corresponding to the current click event if any of the click events is captured; a data transparent transmission block, configured to transmit the attribute identifier to a real-time operating system or an Android operating system for data transparent transmission, and determine the corresponding function name and respond to the corresponding service in response to the attribute identifier.
[0014] An embodiment of the present application also provides a vehicle, which includes the KANZI data transparent transmission device as described in any of the above embodiments.
[0015] An embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the method described in any one of the above embodiments is implemented.
[0016] In the scheme implemented by the KANZI data transparent transmission method, device, vehicle and storage medium provided above, controls of each area in the graphical user interface are constructed by KANZI, and the attribute identifier and function name corresponding to each of the controls are determined; on the one hand, by constructing controls of each area by KANZ, highly customized development can be carried out according to one's own needs, with high flexibility; through the attribute identifier and function name, the interaction logic of the user interface is ensured to be clear and easy to manage; the click event for any of the controls in the display screen is captured; if any of the click events is captured, the attribute identifier corresponding to the current click event is determined; the attribute identifier is transparently transmitted and sent to the real-time operating system or Android operating system, and in response to the attribute identifier, the corresponding function name is determined and the corresponding service is responded; on the one hand, the attribute identifier corresponding to the captured click event is transparently transmitted and sent to the real-time operating system or Android operating system, ensuring that the user input instruction can be accurately and correctly transmitted to the back end, and at the same time, the high efficiency of data transparent transmission reduces delays and improves overall performance; on the other hand, by promptly responding to the user's click operation, the response speed and interactive experience of the user interface are improved; finally, by providing a graphical user interface that responds quickly, is easy to understand and operate, the user experience is also significantly enhanced. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments of the present application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative labor.
[0018] Figure 1 A flow chart of the KANZI data transparent transmission method provided in an embodiment of the present application;
[0019] Figure 2 A complete flow chart of the KANZI data transparent transmission method provided in the embodiment of the present application;
[0020] Figure 3 An application effect diagram of the KANZI data transparent transmission method provided in an embodiment of the present application;
[0021] Figure 4 A structural diagram of a KANZI data transparent transmission device provided in an embodiment of the present application;
[0022] Figure 5 A schematic diagram of the structure of an electronic device in an embodiment of the present application;
[0023] Figure 6 This is another structural schematic diagram of an electronic device in one embodiment of the present application;
[0024] Figure 7 A complete flow chart of click events in KANZI data transparent transmission provided in an embodiment of the present application. DETAILED DESCRIPTION
[0025] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0026] In order to enable those skilled in the art to better understand the improvements of the technical solution provided by the present disclosure, the present disclosure briefly introduces the implementation scenarios and related information of the KANZI data transparent transmission method in the related technology.
[0027] See also Figure 1 , Figure 1 A flow chart of the KANZI data transparent transmission method provided in an embodiment of the present application, the method comprises the following steps:
[0028] Step S101, constructing controls in each area of a graphical user interface, determining a one-to-one corresponding attribute identifier and a function name for each of the controls, the graphical user interface being determined by KANZI;
[0029] The KANZI tool is used to design and build a graphical user interface (GUI). KANZI is a high-performance UI rendering engine commonly used in automotive infotainment systems and other embedded devices. Developers define the interface layout in the KANZI environment, including the location, size, and style of various controls (such as buttons, sliders, text boxes, etc.). By assigning a unique attribute identifier (such as control ID) and function name to each control in each area of the graphical user interface, it is convenient to transmit click events.
[0030] For example, the attribute identifier is a unique identifier of the control, which can accurately identify the specific object of user interaction. The function name defines the operation to be performed or the service to be called when the control is triggered. The two form a mapping relationship through the control as the middleware, ensuring the clear interaction logic of the user interface and easy management.
[0031] For example, create a new button2D button in the KANZI project, and place it at the display position according to the rendering; set the size of the click area, for example, 100*100, and place it at the display position according to the rendering, and import the UI diagram into the button2D button; create Down event and Leave event in the button2D button to represent pressing and lifting. After adding these two events, you can get the click at that position of the screen.
[0032] Step S102, capturing a click event on any of the controls on the display screen;
[0033] Among them, the event monitoring mechanism relies on the underlying support of the operating system, allowing applications to register their attention to specific types of events and receive notifications when events occur. For click events, the coordinates are detected when the user touches the screen to determine whether the coordinates fall within the area of a certain control. If so, the event handler of the control is triggered.
[0034] For example, after the GUI is constructed, the user's interactive operations on these controls, especially click events, are monitored and captured, usually through an event monitoring mechanism, that is, an event handler is registered on each control, and the handler is triggered when the control is clicked.
[0035] Step S103, if any of the click events is captured, determining the attribute identifier corresponding to the current click event;
[0036] The determination of the attribute identifier depends on the event object in the event processing mechanism, which contains the identifier information of the control that triggers the event. By parsing this object, the required attribute identifier can be obtained.
[0037] Exemplarily, after a click event is captured, the event is parsed to determine which control triggered it, by comparing the coordinate information in the event with the boundary information of the control. Once a match is successful, the property identifier of the control can be obtained.
[0038] Specifically, an event pool or event queue can be used to manage events to improve the efficiency and scalability of event processing. Alternatively, an event distribution mechanism can be introduced to distribute events to different processing modules according to event types and control types to simplify event processing logic.
[0039] Step S104, transparently transmit the attribute identifier to the real-time operating system or the Android operating system, and determine the corresponding function name and respond to the corresponding service in response to the attribute identifier.
[0040] Among them, in RTOS (real-time operating system), event processing is implemented through tasks or interrupt service programs; in Android (Android operating system), it is implemented through mechanisms such as message queues, services or broadcast receivers.
[0041] Specifically, the attribute identifier of the control corresponding to the click event is sent to the operating system. In the real-time operating system (RTOS) or Android operating system, this identifier is used to find the function name associated with the control. If the function name is found, the corresponding service is called to respond.
[0042] For example, middleware or frameworks are used to abstract and encapsulate operating system-specific API calls to improve the portability and maintainability of the code. For another example, an event bus or message queue mechanism is introduced to implement cross-process or cross-thread asynchronous communication and event processing.
[0043] Among them, the above-mentioned KANZI data transmission method can be applied to vehicles. The vehicle in this application (sometimes referred to as a vehicle) is a vehicle in a broad sense, which can be a means of transportation (such as: cars, trucks, motorcycles, trains, airplanes, ships, etc.), industrial vehicles (such as: forklifts, trailers, tractors, etc.), engineering vehicles (such as: excavators, bulldozers, cranes, etc.), agricultural equipment (such as mowers, harvesters, etc.), amusement equipment, toy vehicles, etc. The vehicles in this application include fuel vehicles and new energy vehicles, and there is no limitation on the type of vehicle.
[0044] In the above way, by building graphical tools and controls through KANZI, the development efficiency is improved and the maintainability of the code is enhanced. The clear mapping relationship between controls and functions is also conducive to function expansion and interface adjustment. Only by modifying the design in KANZI can the attribute identifier and function name be automatically updated. By transparently transmitting the attribute identifier of the control corresponding to the captured click event to the backend, the accurate matching of the event and the control is ensured, and misoperation is avoided; thus, the efficiency and accuracy of event processing are improved. In addition, the mapping and execution of events to functions are realized, completing the closed loop of user interaction; through close integration with the operating system, the timely response and stability of the service are ensured.
[0045] Furthermore, the use of KANZI as the click event pass-through in this application also has the following technical effects: First, an intuitive and efficient design tool is provided through KANZI Studio, which has quick user interface design; second, it allows designers to view the effects of UI changes in real time, including visual feedback triggered by click events, ensuring that the processing of click events is consistent with the expected UI behavior, achieving a what-you-see-is-what-you-get effect; third, it supports seamless integration of 2D and 3D graphics, and realizes seamless docking of 2D / 3D rendering; fourth, KANZI real-time rendering and excellent real-time rendering engine capabilities ensure the smoothness and responsiveness of the user interface, and the efficient rendering engine helps to shorten the development cycle and improve development efficiency.
[0046] Optionally, in some embodiments, constructing controls in each area of the graphical user interface and determining a one-to-one corresponding attribute identifier and function name for each of the controls includes:
[0047] Building a graphical user interface based on the KANZI;
[0048] Presetting controls in various areas in the graphical user interface, the controls comprising at least one of a button, a blank area, a hidden area, and a preset target area;
[0049] Each of the controls preset in each area is defined as a different function name, and each function name corresponds to an attribute identifier of a unique identifier.
[0050] For example, the KANZI framework is introduced into the development environment. The framework is a graphical user interface (GUI) development tool designed for embedded systems, which supports efficient rendering and flexible layout management. By creating a KANZI project, relevant parameters such as screen resolution and color depth are configured according to project requirements. The overall layout of the user interface, including the location, size, color and other properties of each control, is designed using the graphic design tools or programming interface provided by KANZI. According to the interface design requirements, the control type is determined, such as buttons, blank areas, hidden areas, preset target areas, etc.
[0051] For example, in the UI layout, various types of controls are added to corresponding areas according to predetermined positions and sizes; a unique attribute identifier is set for each control, and a name describing its function is defined for each control, such as "submit button", "login box", etc. The function name and attribute identifier of the control are associated and stored so that they can be quickly found and accessed.
[0052] Through the above methods, the readability and maintainability of the code are improved, making it easier for developers to reference and manage controls, thereby improving development efficiency.
[0053] Optionally, in some embodiments, capturing a click event for any of the controls in the display screen includes:
[0054] Monitoring each control on the graphical user interface in the display screen;
[0055] If any of the click events is detected to be triggered, and the click event is located on at least a portion of the display area of any of the keys, it is determined that the click event for the key on the display screen is captured;
[0056] If any of the click events is detected to be triggered, and the click event is located on the display area of at least a part of any of the blank areas, it is determined that the click event for the blank area in the display screen is captured;
[0057] If any of the click events is monitored and triggered, and the click event is located on the display area of at least a part of any of the hidden areas, it is determined that the click event for the hidden area in the display screen is captured;
[0058] If any of the click events is monitored and triggered, and the click event is located on the display area of at least a part of any of the preset target areas, it is determined that the click event for the preset target area in the display screen is captured.
[0059] Exemplarily, in the graphical user interface framework, one or more listeners are initialized to listen to events on the screen, and the listeners register the event types of interest, such as clicks, touch mouse movements, etc., which are all considered click events in this embodiment. When the user interacts on the screen, the GUI framework captures these events and passes them to the corresponding listeners.
[0060] Specifically, based on the geometric judgment principle, it is determined whether a click event on a key occurs by comparing the click position with the coordinate range of the key display area.
[0061] Through the above method, click events for different areas can be processed more finely, so as to accurately determine the click events during user interaction.
[0062] Optionally, in some embodiments, it further includes:
[0063] If the click event is not captured and exceeds a preset time period, determining each control in the current graphical user interface;
[0064] Find the attribute identifier and the function name of each of the controls, and verify them in the preset link table;
[0065] If the verification results are consistent, it is determined that the control links are correct; if the verification results are inconsistent, it is determined that the control links are incorrect.
[0066] Exemplarily, by monitoring the click events and intervals input by the user, it is determined when the state of the control needs to be rechecked. For example, a heartbeat mechanism can be used instead of a timer to check the state of the control regularly (such as every second) instead of waiting for a timeout. By extracting the actual information of the control and comparing it with the preset expected information, it is determined whether the control is correctly configured. For example, a hash table or dictionary data structure can also be used to store the control information to improve the efficiency of search and verification. Based on logical judgment and result processing, decisions are made according to the verification results, and this information is recorded or fed back through appropriate mechanisms. For example, if the verification results are consistent, the control link is recorded as correct; if not, the control link is recorded as incorrect, and feedback is given to the developer or system administrator through logs, alarms, etc.
[0067] Through the above methods, unnecessary performance overhead is reduced through periodic or conditional triggering. The reliability and maintainability of the system are improved through the verification mechanism; the accuracy and consistency of the controls are ensured, and user interface problems caused by configuration errors are reduced; through timely feedback and records, developers or administrators are helped to quickly locate and solve control link problems.
[0068] In one embodiment of the present application, the attribute identifier is transparently transmitted to a real-time operating system or an Android operating system, and in response to the attribute identifier, the corresponding function name is determined and the corresponding service is responded to, including:
[0069] Using KANZI to write the attribute identifier and writing path of the control corresponding to the click event to form a data file;
[0070] Transparently transmit the data file to the real-time operating system or the Android operating system, parse the data file, and determine the attribute identifier;
[0071] Execute a functional service matching the attribute identifier and feed back a service result, wherein the service result is a response file generated by the real-time operating system or the Android operating system.
[0072] Exemplarily, the click event input by the user is captured through the GUI framework, the unique identifier of the control is extracted, and written into the data file. The data file is transparently transmitted to the target operating system (real-time operating system or Android operating system) through a communication mechanism (such as file transfer protocol, network communication, etc.). On the target operating system, the corresponding parsing tool or library is used to read and parse the data file, which involves reading the file content, parsing the data structure, extracting attribute identifiers, etc. According to the extracted attribute identifier, the matching functional service is searched in the target operating system, the matched functional service is called and responded; after the functional service is executed, a response file is generated, which contains the result or output of the service. Finally, the response file is sent back to the user interface to learn the execution status.
[0073] Through the above method, by writing the property identification and writing path information of the control into the data file, the persistence and accessibility of the data are achieved; using KANZI improves the development efficiency and interface quality, especially in the field of automotive HMI; by executing the functional service matching the property identification, accurate response and processing of user click events are achieved.
[0074] Optionally, in some embodiments, it further includes:
[0075] Receive the response file, and use KANZI to read the response result in the response file;
[0076] Determine the writing status of the data file according to the response result;
[0077] If the response result includes that the service is executed successfully, it is determined that the KANZI data is written successfully;
[0078] If the response result does not include successful service execution, it is determined that the KANZI data writing has failed.
[0079] Exemplarily, a receiving mechanism is set up to receive a response file sent back from a real-time operating system or an Android operating system. After receiving the response file, the response result in the response file can be read because the data itself is not processed in any way due to the transparent transmission method. By parsing the data in the response result, information related to the service execution can be extracted, and the writing status of the data file can be judged based on this information.
[0080] Through the above method, by accurately judging the data writing status, the correctness and integrity of the data can be ensured, which helps to improve the user experience; by accurately judging the data writing failure, timely error handling measures can be taken to avoid data loss or damage. At the same time, detailed error information and logs are provided, which helps to improve maintainability and debuggability.
[0081] Optionally, in some embodiments, before capturing a click event for any of the controls on the display screen, the method further includes:
[0082] Receiving an operation instruction from the Android system, wherein the operation instruction carries a command to change a target control;
[0083] In response to the operation instruction, the target control in the graphical user interface is changed so that the KANZI renders the graphical user interface according to the change command and displays it.
[0084] Exemplarily, a listener or receiver is set to listen to the operation instructions from the Android system, and the listener or receiver includes but is not limited to a network communication interface, a message queue, an event listener, etc., to capture and receive the operation instructions. The operation instructions include but are not limited to the change command of the target control, and possible other parameters or information, and the identifier of the target control, the change command and its parameters are extracted. KANZI generates the corresponding rendering result according to the provided change command and the state of the GUI, and finally displays the rendering result on the screen and displays the updated GUI.
[0085] Through the above method, precise changes to the target controls in the GUI improve the user experience, allowing users to see the GUI updates, achieving high-quality GUI rendering using KANZI, and improving the system's graphics performance and user experience.
[0086] See also Figure 2 , is a complete flow chart of the KANZI data transparent transmission method provided in the embodiment of the present application, which is described in detail as follows:
[0087] Capture click events of the central control screen;
[0088] Determine whether the click event is captured;
[0089] If the click event is not captured, check whether the button2D link is correct
[0090] If a click event is captured, the ID of the clicked button is recorded;
[0091] Transparent transmission to QNX;
[0092] QNX checks whether the ID value can be read;
[0093] If not, check whether the KANZI process is written successfully;
[0094] If so, execute the relevant logic.
[0095] In this embodiment, referring to the above method, we can get Figure 3The application effect diagram of the KANZI data transparent transmission method provided in the embodiment of the present application is adopted.
[0096] Figure 3 The configuration process to achieve the effect is described as follows:
[0097] 1. Click events that need to be transparently transmitted for the pre-order function with QNX
[0098]
[0099]
[0100] 2. Agree on the data reading and writing paths of QNX and KANZI
[0101] / / AvmQnx process writes, AvmKanzi process reads
[0102] constexprchar*READ_PATH=" / var / pps / avm_pps_node?wait,delta"; constexprchar*READ_NAME="@avm_pps_node";
[0103] / / AvmKanzi process writes, AvmQnx process reads
[0104] constexprchar*WRITE_PATH=" / var / pps / avm_pps_reply";
[0105] constexprchar*WRITE_NAME="@avm_pps_reply";
[0106] 3. Create a button in the kanzi project that needs to be passed to QNX for the click event. Use the Button2D node to create a 2DUI control, with which the user can interact by clicking, tapping, or pressing a key.
[0107] For example, the syntax is ConceptClass = ButtonConceptImpl<Node2D,Button2D>
[0108] Button2D's ButtonConceptImpl is used to receive key and touch inputs, and Kanzi converts them into state events. The events include PressedMessageArguments, PointerLeftMessageArguments, and LongPressMessageArguments. This project mainly uses press and lift actions.
[0109] The implementation code is as follows:
[0110] #defineBUTTONDEFINE(NAME,ID)\
[0111] / / Define a BUTTONDEFINE function, which provides two parameters, a name and an ID; kanzi::Button2DSharedPtrBtn##NAME=screen->lookupNode <button2d>("#"#NAME);\
[0112] if(Btn##NAME)\
[0113] {\
[0114] / / Use the standard class provided by Button2D to create a new pressed event using its PressedMessage
[0115] Btn##NAME->addMessageHandler(ButtonConcept::PressedMessage,bind(&ComLogic::buttonDown,this,placeholders::_1,ID));\
[0116] / / Use the standard class provided by Button2D to create a new lift event using its PointerLeftMessage
[0117] Btn##NAME->addMessageHandler(ButtonConcept::PointerLeftMessage,bind(&ComLogic::buttonUp,this,placeholders::_1));\
[0118] }
[0119] BUTTONDEFINE(2 / 3D,KANZI_CLICK_2D3D_BUTTON)
[0120] / / The BUTTONDEFINE function receives two parameters, the first is the name of the button corresponding to the kanzi project, and the second is the click event attribute name agreed with QNX
[0121] BUTTONDEFINE(Voice,KANZI_CLICK_VOLUME)
[0122] BUTTONDEFINE(camera,KANZI_CLICK_RCAMERA_CLEAN)
[0123] voidComLogic::buttonDown(ButtonConcept::PressedMessageArguments&msg,intid)
[0124] {
[0125] / / The buttonDown function is used to tell QNX the received click event ID and button event through setReplyData, so as to distinguish which button the user clicked on the screen
[0126] LogicLog(LOG_LEVEL::LOG_INFO,"%s\n",__FUNCTION__);
[0127] PPSFileOpe::Instance().setReplyData(id,ACTION_DOWN);
[0128] }
[0129] voidComLogic::buttonUp(ButtonConcept::PointerLeftMessageArguments& / *messageArguments* / )
[0130] {
[0131] / / The buttonUp function is used to tell QNX that the user has completed clicking on the interface button, so that it can perform corresponding operations. For example, if the user clicks the 2 / 3D switch button, Button2D will capture the screen click, record it, and tell QNX which button ID it is. QNX will perform corresponding operations based on the button ID value passed to it and switch to the 3D interface.
[0132] LogicLog(LOG_LEVEL::LOG_INFO,"%s\n",__FUNCTION__);
[0133] PPSFileOpe::Instance().setReplyData(KANZI_CLICK_NONE,ACTION_UP);
[0134] }
[0135] 4. Record the button click and write the agreed kanzi process avm_pps_reply. So, how to write the process to allow QNX to get the data? This is about the operation of the file in the system as follows:
[0136] 1) File system framework
[0137] In Linux system, everything is a file. File types are divided into the following types according to their meanings:
[0138] Ordinary files
[0139] Device file: represents a specific hardware device
[0140] Pipe files, FIFO files: files with special meanings, used for inter-process communication;
[0141] Socket file: used for network communication;
[0142] All these files can be operated using a set of APIs. The four most basic APIs are:
[0143] Open: open
[0144] Read file: read
[0145] Write a file: write
[0146] Close: close
[0147] When using these APIs (application programming interfaces) to operate files, you need to pass in the file identifier fd (filedescriptor). The essence of a file identifier is an integer that identifies a specific file in the process. It is uniquely assigned when a file is opened using the open function. In general, the value of fd is assigned starting from 0. If fd is a negative number, it means that the file fails to open or the operation fails. The code is as follows:
[0148] / / open
[0149] voidPPSFileOpe::ppsReplyOpen()
[0150] {
[0151] pps_encoder_initialize(&m_replyEncoder,false);
[0152] intretry=0;
[0153] while(retry <MAX_RETRY_COUNT){
[0154] m_writeFd=open(WRITE_PATH,O_RDWR|O_CREAT,S_IRWXU|S_IRWX G|S_IRWXO);
[0155] / / Open in the specified way, set file permissions, and define several modifications of the open function;
[0156] if(m_writeFd>=0){
[0157] break;
[0158] }
[0159] }
[0160] }
[0161] / / read
[0162] voidPPSFileOpe::readThread()
[0163] {
[0164] LogicLog(LOG_LEVEL::LOG_INFO,"%s\n",__FUNCTION__);
[0165] intfd = -1;
[0166] intret = -1;
[0167] while(m_Loop){
[0168] if(fd<0){
[0169] / / ppsfilestateisclose->openfilefd=open(READ_PATH,O_RDONLY); / / Open or create a file in the specified way if(fd<0){
[0170] LogicLog(LOG_INFO,"ppsopenfailed!errno:%d.reopening\n",errno);}
[0171] else{
[0172] LogicLog(LOG_INFO,"ppsopensuccess!fd=%d\n",fd);
[0173] }
[0174] }
[0175] else{
[0176] / / ppsfilestateisopen->readdataret=read(fd,m_readBuf,READ_SIZE);
[0177] / / Read READ_SIZE bytes of data from file fd and store them in m_readBuf if (ret>-1) {
[0178] ppsParse(); / / Call pps function to parse data
[0179] }
[0180] }
[0181] }
[0182] }
[0183] / / WritevoidPPSFileOpe::ppsReplyWrite()
[0184] {
[0185] while(m_Loop)
[0186] {
[0187] intwriteRet = -1;
[0188] if(!encoderError)
[0189] {
[0190] constchar*buf=pps_encoder_buffer(&m_replyEncoder); / / Store the encoded data in bufif(NULL!=buf){
[0191] writeRet=write(m_writeFd,buf,pps_encoder_length(&m_replyEncoder)); / / buf is not empty, write to avm_pps_reply node
[0192] LogicLog(LOG_INFO,"writeavmdata:%s\n",buf);
[0193] }
[0194] }
[0195] }
[0196] else{
[0197] usleep(10000);
[0198] }
[0199] }
[0200] }
[0201] Through the above method, the following technical effects are achieved: first, a function of transparently transmitting the click event of KANZI to the qnxavm service is realized, filling the technical gap in this area; second, for developers who are familiar with KANZI, highly customized development can be carried out according to user needs, with high flexibility; third, the scalability of the code is improved. When it is necessary to continue to add click buttons in the later stage, a new button can be directly implemented by adding it before and after the definition of button; fourth, the application greatly reduces the loss of program performance, especially greatly reduces the interaction between the central control and the 3D display, and also reduces the interaction frequency, thereby improving the user experience.
[0202] See also Figure 7 , which is a complete flow chart of click events in KANZI data transparent transmission provided in the embodiment of the present application, as detailed as follows:
[0203] Through the ravm.cpp program, the values processed by the logic thread are refreshed to KANZI and displayed. First, through the onProjectLoaded callback function, the program is loaded and the data is initialized for KANZI scene loading. For example, node loading will only be called once. Secondly, the thread main loop is implemented through onUpdate (update function) to update the data. For example, each frame is updated through periodic calls to automatically update the data of each frame. Thirdly, onPreRender (pre-rendering) is called before each frame is drawn. Then, onPostRender (post-rendering) draws the code content on the KZB scene after each frame is drawn, otherwise, it is drawn in onPreRender. Then, the onShutdown program ends. Finally, onConfigure, the virtual function inherits from the parent class and is configured. For example, the KZB file (KANZI package file) is loaded and the fdbus (high-speed distributed bus) client is enabled for calling.
[0204] Specifically, onProjectLoaded is called once after the initial content is loaded, the content is initialized, and the logic task is added. The PPS (Picture Parameter Set) class is initialized, the data is read, the program content used for the operation is obtained, and the program content is saved to the required node. The timer is added and the task is executed at a fixed time to refresh the screen content. For example, the HMI logic processing performance is guaranteed by refreshing at 50 milliseconds.
[0205] In the setScreen screen setting, the click event in the screen is determined through the messageAttch message transparent transmission, and the QNX click event information is displayed or transmitted through the buttonDown and buttonUp in the screen.
[0206] The file operations are performed through the PPSFileOpe.cpp system, for example, ppsReplyWrite (writing content to the file), pps_encoder_reset (resetting the encoder before encoding new data); pps_encoder_start_object (starting a new object, then adding attributes to avm_pps_reply) returns PPS_ENCODER_OK; pps_encoder_end_object (encoding of the image parameter dataset object is completed).
[0207] For example, in avm_pps_reply (Program Object Response), ppsReplyOpen is an API function for processing PPS reply messages, which is responsible for opening reply-related resources, initializing reply messages, or performing other reply-related operations. Among them, open (the first constant is the path name of the file to be opened, followed by the method of opening the file); pps_encoder_initialize initializes the memory used by the encoder to known values, where true is JSON and false is PPS.
[0208] For example, in ppsParse (data parsing), pps_decoder_initialize is initialized, the end is NULL, and the interface is called to parse the string. pps_decoder_parse_pps_str parses the PPS format data into the internal data structure of the decoder. pps_decoder_push (push to avm_pps_node node); pps_decoder_get_int extracts the value from the current node, and continues to the next one if successful. pps_decoder_cleanup cleans up the pointer to the PPS decoder structure.
[0209] For example, in readThread (reading thread), open opens or creates a file in the specified way; read reads READ_SIZE bytes of data from the file fd (file identifier) and stores them in m_readBuf.
[0210] In this embodiment, LogicAdater participates in program operation, transfers program content, and manages all business logic class operations. Each time the main program executes a task, it notifies all business objects to process data once, and the parent class pointer obtains the child class object to ensure interface consistency and reuse code. Through the AreaHandlerBase logical base class, a basic general processing method is provided, and subclass inheritance can be directly called or rewritten. Tool class access is provided. For example, through the three threads of the data processing class HMIPPSFileOpe to parse meter (length), ivi (instrument) and power supply data, the use of multi-threading technology significantly improves processing efficiency and facilitates business class reading. For example, the electrical module code calculates data through the parent class method and uses datasource (data source) to transmit signals.
[0211] Through DataProxylog (data proxy log), datasource and API are obtained just like plug-ins, which are set only when the function changes, thus improving performance.
[0212] In the present application, controls of each area in the graphical user interface are constructed by KANZI, and the attribute identifier and function name corresponding to each of the controls are determined; on the one hand, by constructing controls of each area by KANZ, highly customized development can be carried out according to one's own needs, with high flexibility; through the attribute identifier and function name, the interaction logic of the user interface is ensured to be clear and easy to manage; the click event for any of the controls in the display screen is captured; if any of the click events is captured, the attribute identifier corresponding to the current click event is determined; the attribute identifier is transparently transmitted and sent to the real-time operating system or Android operating system, and in response to the attribute identifier, the corresponding function name is determined and the corresponding service is responded to; on the one hand, the attribute identifier corresponding to the captured click event is transparently transmitted and sent to the real-time operating system (RTOS) or Android operating system (AndroidOS), ensuring that the user input instruction can be accurately and correctly transmitted to the back end, and at the same time, the high efficiency of data transparent transmission reduces delays and improves overall performance; on the other hand, by promptly responding to the user's click operation, the response speed and interactive experience of the user interface are improved; finally, by providing a graphical user interface that is fast-responding, easy to understand and operate, the user experience is also significantly enhanced.
[0213] In one embodiment, a KANZI data transparent transmission device is provided, and the KANZI data transparent transmission device is used to execute the KANZI data transparent transmission method provided in any of the above embodiments. Figure 4 , Figure 4 A structural diagram of a KANZI data transparent transmission device provided in an embodiment of the present application, such as Figure 4 As shown, the KANZI data transparent transmission device includes a control construction module 401, a capture module 402, a first event determination module 403 and a data transparent transmission block 404, wherein:
[0214] A control construction module 401 is configured to construct controls in each area of a graphical user interface and determine a one-to-one corresponding property identifier and a function name for each of the controls, wherein the graphical user interface is determined by KANZI;
[0215] A capture module 402 is configured to capture a click event on any of the controls in the display screen;
[0216] The event determination module 403 is configured to determine the attribute identifier corresponding to the current click event if any of the click events is captured;
[0217] The data transparent transmission block 404 is configured to transmit the attribute identifier to the real-time operating system or the Android operating system through data transparent transmission, and determine the corresponding function name and respond to the corresponding service in response to the attribute identifier.
[0218] For the specific definition of the KANZI data transparent transmission device, please refer to the definition of the KANZI data transparent transmission method above, which will not be repeated here. Each module in the above-mentioned KANZI data transparent transmission device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the electronic device in the form of hardware, or can be stored in the memory of the electronic device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0219] In this embodiment, the KANZI data transparent transmission device is essentially provided with multiple modules for executing the KANZI data transparent transmission method in any of the above embodiments. The specific functions and technical effects can be referred to the above embodiments and will not be repeated here.
[0220] In one embodiment, a vehicle is provided, which includes the KANZI data transparent transmission device provided in any one of the above embodiments.
[0221] For the specific limitations of the vehicle, please refer to the limitations of the KANZI data transmission method above, which will not be repeated here. Each module in the above-mentioned vehicle can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the electronic device in the form of hardware, or can be stored in the memory of the electronic device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0222] In one embodiment, an electronic device is provided. The electronic device may be a server, and its internal structure diagram may be as follows: Figure 5 As shown. The electronic device includes a processor, a memory, a network interface and a database connected via a system bus. The processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile and / or volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the electronic device is used to communicate with an external client via a network connection. When the computer program is executed by the processor, the functions or steps on the server side of the above method are implemented.
[0223] In one embodiment, an electronic device is provided. The electronic device may be a client, and its internal structure diagram may be as follows: Figure 6 As shown. The electronic device includes a processor, a memory, a network interface, a display screen and an input device connected via a system bus. Among them, the processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the electronic device is used to communicate with an external server via a network connection. When the computer program is executed by the processor, the functions or steps of the client side of the above method are implemented.
[0224] In one embodiment, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program:
[0225] Construct controls for each area in a graphical user interface, determine the one-to-one corresponding attribute identifier and function name of each of the controls, and the graphical user interface is determined by KANZI; capture click events for any of the controls in the display screen; if any of the click events is captured, determine the attribute identifier corresponding to the current click event; transmit the attribute identifier to a real-time operating system or an Android operating system through data transparent transmission, and determine the corresponding function name and respond to the corresponding service in response to the attribute identifier.
[0226] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0227] Construct controls for each area in a graphical user interface, determine the one-to-one corresponding attribute identifier and function name of each of the controls, and the graphical user interface is determined by KANZI; capture click events for any of the controls in the display screen; if any of the click events is captured, determine the attribute identifier corresponding to the current click event; transmit the attribute identifier to a real-time operating system or an Android operating system through data transparent transmission, and determine the corresponding function name and respond to the corresponding service in response to the attribute identifier.
[0228] It should be noted that the above functions or steps that can be implemented by the computer-readable storage medium or electronic device can refer to the relevant descriptions on the server side and the client side in the aforementioned method embodiment. To avoid repetition, they will not be described one by one here.
[0229] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing related hardware through a computer program, and the above-mentioned computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0230] Those skilled in the art will clearly understand that for the sake of convenience and brevity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the above-mentioned device or system can be divided into different functional units or modules to complete all or part of the functions described above.
[0231] The embodiments provided above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A KANZI data transparent transmission method, characterized in that: The method comprises: Constructing controls in each area of a graphical user interface, and determining a one-to-one corresponding attribute identifier and a function name for each of the controls, wherein the graphical user interface is determined by KANZI; Capturing click events for any of the controls on the display screen; If any of the click events is captured, then determining the attribute identifier corresponding to the current click event; The attribute identifier is transparently transmitted to the real-time operating system or the Android operating system, and in response to the attribute identifier, the corresponding function name is determined and the corresponding service is responded.
2. The KANZI data transparent transmission method according to claim 1, characterized in that: Constructing controls in each area of the graphical user interface, and determining the corresponding attribute identifiers and function names of each of the controls, including: Building a graphical user interface based on the KANZI; Presetting controls in various areas in the graphical user interface, the controls comprising at least one of a button, a blank area, a hidden area, and a preset target area; Each of the controls preset in each area is defined as a different function name, and each function name corresponds to an attribute identifier of a unique identifier.
3. The KANZI data transparent transmission method as claimed in claim 2, characterized in that: Capture click events for any of the controls on the display screen, including: Monitoring each control on the graphical user interface in the display screen; If any of the click events is detected to be triggered, and the click event is located on at least a portion of the display area of any of the keys, it is determined that the click event for the key on the display screen is captured; If any of the click events is detected to be triggered, and the click event is located on the display area of at least a part of any of the blank areas, it is determined that the click event for the blank area in the display screen is captured; If any of the click events is monitored and triggered, and the click event is located on the display area of at least a part of any of the hidden areas, it is determined that the click event for the hidden area in the display screen is captured; If any of the click events is monitored and triggered, and the click event is located on the display area of at least a part of any of the preset target areas, it is determined that the click event for the preset target area in the display screen is captured.
4. The KANZI data transparent transmission method as claimed in claim 3, characterized in that: Also includes: If the click event is not captured and exceeds a preset time period, determining each control in the current graphical user interface; Find the attribute identifier and the function name of each of the controls, and verify them in the preset link table; If the verification results are consistent, it is determined that the links of the respective controls are correct; If the verification results are inconsistent, it is determined that each of the control links is incorrect.
5. The KANZI data transparent transmission method according to any one of claims 1 to 4, characterized in that: The attribute identifier is transparently transmitted to the real-time operating system or the Android operating system, and in response to the attribute identifier, the corresponding function name is determined and the corresponding service is responded, including: Using KANZI to write the attribute identifier and writing path of the control corresponding to the click event to form a data file; Transparently transmit the data file to the real-time operating system or the Android operating system, parse the data file, and determine the attribute identifier; Execute a functional service matching the attribute identifier and feed back a service result, wherein the service result is a response file generated by the real-time operating system or the Android operating system.
6. The KANZI data transparent transmission method as claimed in claim 5, characterized in that: Also includes: Receive the response file, and use KANZI to read the response result in the response file; Determine the writing status of the data file according to the response result; If the response result includes that the service is executed successfully, it is determined that the KANZI data is written successfully; If the response result does not include successful service execution, it is determined that the KANZI data writing has failed.
7. The KANZI data transparent transmission method according to any one of claims 1 to 4, characterized in that: Before capturing the click event for any of the controls on the display screen, the method further includes: Receiving an operation instruction from the Android system, wherein the operation instruction carries a command to change a target control; In response to the operation instruction, the target control in the graphical user interface is changed so that the KANZI renders the graphical user interface according to the change command and displays it.
8. A KANZI data transparent transmission device, characterized in that: include: A control construction module is configured to construct controls in each area of a graphical user interface and determine a one-to-one corresponding attribute identifier and a function name for each of the controls, wherein the graphical user interface is determined by KANZI; A capture module, configured to capture a click event on any of the controls on the display screen; An event determination module is configured to determine an attribute identifier corresponding to the current click event if any of the click events is captured; The data transparent transmission block is configured to transmit the attribute identifier to the real-time operating system or the Android operating system through data transparent transmission, and determine the corresponding function name and respond to the corresponding service in response to the attribute identifier.
9. A vehicle, characterized in that: The vehicle includes the KANZI data transparent transmission device as described in claim 8.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Cited By
Display control method and device of ink screen, terminal and readable storage medium
CN122547433A