View display method and system
By setting the binding relationship between CAN signals and view states and the inter-layer chain structure in the vehicle system, the interface update process is simplified, the problems of cumbersome Handler mechanism and low code reuse rate in the existing technology are solved, and efficient interface updates and code readability are achieved.
Patent Information
- Application Number
- CN202210552574.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-20
- Publication Date
- 2025-09-09
- Estimated Expiration
- 2042-05-20
AI Technical Summary
In the prior art, the interaction between users and vehicle components in an in-vehicle system requires a large number of Handler mechanisms to process, resulting in low code reuse rate and poor code readability.
By pre-setting the binding relationship between CAN signals and view states, using CAN signal change notifications to trigger interface updates, and adopting inter-layer chain-structured CAN view components to synchronize interface states, the interface update process is simplified.
Improves code readability and reuse, shortens development cycle.
Smart Images

Figure CN115185618B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of human-computer interaction technology, and in particular to a view display method and system. Background Art
[0002] In the development of vehicle-mounted systems, some vehicle-mounted components need to communicate with the vehicle computer to realize the interaction function between users and vehicle-mounted components, and the communication method is generally CAN communication.
[0003] Currently, users need to use a lot of Handler mechanisms to interact with vehicle components through the vehicle computer. That is, the communication between the view and the CAN signal jumps to different files, and the correspondence between the two needs to be determined through the msg field. This makes the code readability difficult and is not convenient for code reuse in various projects. Summary of the Invention
[0004] The present invention provides a view display method and system, which solves the technical problems that the existing interaction mechanism requires a large number of Handler mechanisms for processing, the process is too complicated and the code reuse rate is low.
[0005] To solve the above technical problems, the present invention provides a view display method, comprising the steps of:
[0006] S1. Pre-set the one-to-one correspondence between CAN signals and view states, and save the binding relationship;
[0007] S2. Send a signal change notification based on the received CAN signal change;
[0008] S3. Acquire the target view state corresponding to the signal change notification according to the binding relationship, and then update the corresponding CAN view component.
[0009] In a further implementation scheme, the step S1 is specifically: traversing each CAN signal, determining the pre-update view state and post-update view state corresponding to each CAN view component, and saving the binding relationship between the CAN signal and each group of the pre-update view state and post-update view state.
[0010] This solution uses the CAN signal as the trigger signal, sets its trigger interface (i.e., the view state before updating) and the update interface (the view state after updating). During interaction, when a change in the CAN signal is detected, the current view state of each interface control (i.e., the parent CAN view component and the child CAN view component) is synchronously detected. When it is consistent with the trigger interface, the interface update is triggered, and the current view state is replaced with the view state after updating. The update process is simple and efficient.
[0011] In a further implementation scheme, the CAN signal changes include vehicle body CAN signal changes and user interaction CAN signal changes. The vehicle body CAN signal changes include door status signals and tire pressure signals sent by the vehicle body; user interaction CAN signal changes are operation instructions generated by the user operating on the user interface.
[0012] In a further implementation scheme, step S0 is also included: setting a parent CAN view component and several child CAN view components in the CAN view component; taking the parent CAN view component as the end, linking each of the child CAN view components layer by layer in sequence to form an inter-layer chain structure.
[0013] In a further embodiment, step S3 comprises:
[0014] S31. Determine whether the signal change notification is associated with the parent CAN view component. If so, obtain the corresponding target view state according to the signal change notification and update the parent CAN view component according to the target view state. If not, proceed to the next step.
[0015] S32, sending the signal change notification to the sub-CAN view of the next layer;
[0016] S33. Determine whether the signal change notification is associated with the sub-CAN view component of the current layer. If so, obtain the corresponding target view state according to the signal change notification, and update the sub-CAN view component according to the target view state. If not, return to step S32 until the signal change notification is sent to all the sub-CAN view components.
[0017] In a further embodiment, the determining whether the signal change notification is associated with the parent CAN view component is specifically as follows: according to the CAN signal change in the signal change notification, obtaining the pre-update view state corresponding to the parent CAN view component and the current view state of the parent CAN view component, determining whether the current view state is consistent with the pre-update view state, and if so, determining that the signal change notification is associated with the parent CAN view component, otherwise, not associated;
[0018] The determining whether the signal change notification is associated with the sub-CAN view component of the current layer is specifically as follows: according to the CAN signal change in the signal change notification, obtaining the pre-update view state corresponding to the sub-CAN view component and the current view state of the sub-CAN view component, and determining whether the current view state is consistent with the pre-update view state; if so, determining that the signal change notification is associated with the sub-CAN view component; otherwise, not associated;
[0019] The target view state is the updated view state bound to the corresponding CAN signal change.
[0020] The present invention also provides a view display system, comprising a CAN signal transceiver component, a CAN signal processing component, and at least one set of view update modules connected in sequence; the view update module comprises a view state setting component, a view management component, and a CAN view component; the CAN signal processing component, the view management component, the CAN view component, and the CAN signal transceiver component are connected in sequence, and the view state setting component is connected to the view management component;
[0021] The view state setting component is used to set the binding relationship between each CAN signal and the binding view state in the CAN view component;
[0022] The CAN signal transceiver component is used to send or receive CAN signals;
[0023] The CAN signal processing component is used to receive CAN signals and send signal change notifications to the view management component;
[0024] The view management component is used to manage the CAN view component according to the signal change notification;
[0025] The CAN view component is used to update the interface view according to the signal change notification.
[0026] In a further embodiment, the CAN view component includes a parent CAN view component and several child CAN view components, wherein the parent CAN view component is an end, and each of the child CAN view components is linked layer by layer in sequence to form an interlayer chain structure.
[0027] In a further embodiment, the binding view state includes a pre-update view state and a post-update view state corresponding to the parent CAN view component and / or the child CAN view component.
[0028] According to the software interface view display requirements, this basic solution sets up a CAN view component including a parent CAN view component and several child CAN view components. With the parent CAN view component as the end, each child CAN view component is linked layer by layer in sequence to form an inter-layer chain structure. When a CAN signal change is detected, the parent CAN view component and each child CAN view component in the inter-layer chain structure are traversed in sequence according to the binding relationship to update the interface; the dual setting of view binding CAN signal + inter-layer chain structure makes the display code highly readable, and only needs to change the configuration relationship to quickly reuse the code in various projects, thereby shortening the development cycle. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 This is a workflow diagram of a view display method provided by an embodiment of the present invention;
[0030] Figure 2 This is a system framework diagram of a view display system provided by an embodiment of the present invention;
[0031] Figure 3 This is a system framework diagram of another embodiment of a view display system provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0032] The following describes the embodiments of the present invention in detail with reference to the accompanying drawings. The embodiments are provided for illustrative purposes only and are not to be construed as limiting the present invention. The accompanying drawings are provided for reference and illustration only and do not constitute a limitation on the scope of protection of the present invention. Many changes may be made to the present invention without departing from the spirit and scope of the present invention.
[0033] The embodiment of the present invention provides a view display method and system, such as Figure 1 As shown, in this embodiment, the steps include:
[0034] S0: A parent CAN view component and several child CAN view components are set in the CAN view component; with the parent CAN view component as the end, each child CAN view component is linked layer by layer in sequence to form an inter-layer chain structure.
[0035] S1. Pre-set a one-to-one correspondence between CAN signals and view states, and save the binding relationship. Specifically, traverse each CAN signal, determine the pre-update view state and post-update view state corresponding to each CAN view component, and save the binding relationship between the CAN signal and each set of pre-update view states and post-update view states.
[0036] This embodiment uses the CAN signal as the trigger signal, sets its trigger interface (i.e., the view state before updating) and the update interface (the view state after updating). During interaction, when a change in the CAN signal is detected, the current view state of each interface control (i.e., the parent CAN view component and the child CAN view component) is synchronously detected. When it is consistent with the trigger interface, the interface update is triggered, and the current view state is replaced with the view state after updating. The update process is simple and efficient.
[0037] S2. Send a signal change notification based on the received CAN signal change;
[0038] In this embodiment, CAN signal changes include vehicle body CAN signal changes and user interaction CAN signal changes. Vehicle body CAN signal changes include door status signals and tire pressure signals sent by the vehicle body; user interaction CAN signal changes are operation instructions generated by users operating on the user interface, such as air conditioning temperature control instructions generated by clicking on the touch screen.
[0039] S3. Obtain the target view state corresponding to the signal change notification according to the binding relationship, and then update the corresponding CAN view component, including the following steps:
[0040] S31. Determine whether the signal change notification is associated with the parent CAN view component. If so, obtain the corresponding target view state according to the signal change notification and update the parent CAN view component according to the target view state. If not, proceed to the next step.
[0041] In this embodiment, determining whether the signal change notification is associated with the parent CAN view component specifically includes: obtaining the pre-update view state corresponding to the parent CAN view component and the current view state of the parent CAN view component according to the CAN signal change in the signal change notification, and determining whether the current view state is consistent with the pre-update view state; if so, determining that the signal change notification is associated with the parent CAN view component (i.e., determining that the corresponding CAN signal is in a binding relationship with the current view state); otherwise, determining that the signal change notification is not associated;
[0042] The target view state is the updated view state that is bound to the corresponding CAN signal change.
[0043] S32, sending the signal change notification to the sub-CAN view of the next layer;
[0044] S33. Determine whether the signal change notification is associated with the sub-CAN view component of the current layer. If so, obtain the corresponding target view state according to the signal change notification, and update the sub-CAN view component according to the target view state. If not, return to step S32 until the signal change notification is sent to all sub-CAN view components.
[0045] Determining whether the signal change notification is associated with the sub-CAN view component of the current layer is specifically as follows: according to the CAN signal change in the signal change notification, obtaining the pre-update view state corresponding to the sub-CAN view component and the current view state of the sub-CAN view component, and determining whether the current view state is consistent with the pre-update view state; if so, determining that the signal change notification is associated with the sub-CAN view component; otherwise, not associating;
[0046] The target view state is the updated view state that is bound to the corresponding CAN signal change.
[0047] According to the software interface view display requirements, an embodiment of the present invention sets a CAN view component including a parent CAN view component and several child CAN view components. With the parent CAN view component as the end, each child CAN view component is linked layer by layer in sequence to form an inter-layer chain structure. When a CAN signal change is detected, the parent CAN view component and each child CAN view component in the inter-layer chain structure are traversed in sequence according to the binding relationship to update the interface. The dual setting of view binding CAN signal + inter-layer chain structure makes the display code highly readable, and only the configuration relationship needs to be changed to quickly reuse the code in various projects, thereby shortening the development cycle.
[0048] Example 2
[0049] The reference numerals in the accompanying drawings of the embodiment of the present invention include: a CAN signal transceiver component 1, a CAN signal processing component 2, a view state setting component 3, a view management component 4, and a CAN view component 5.
[0050] The present invention also provides a view display system, see Figure 2 , including a CAN signal transceiver component 1, a CAN signal processing component 2 and at least one set of view update modules connected in sequence; the view update module includes a view state setting component 3, a view management component 4 and a CAN view component 5; the CAN signal processing component 2, the view management component 4, the CAN view component 5 and the CAN signal transceiver component 1 are connected in sequence, and the view state setting component 3 is connected to the view management component 4;
[0051] The view state setting component 3 is used to set the binding relationship between each CAN signal and the binding view state in the CAN view component 5;
[0052] The CAN signal transceiver component 1 is used to send or receive CAN signals;
[0053] The CAN signal processing component 2 is used to receive CAN signals and send signal change notifications to the view management component 4;
[0054] The view management component 4 is used to manage the CAN view component 5 according to the signal change notification;
[0055] The CAN view component 5 is used to update the interface view according to the signal change notification.
[0056] In this embodiment, the CAN view component 5 includes a parent CAN view component and several child CAN view components. The parent CAN view component is the end, and each child CAN view component is linked layer by layer in sequence to form an inter-layer chain structure.
[0057] See also Figure 3Two groups of view update modules are set up, one group is view state setting component 3, view management component 4 and CAN view component 5; the other group is view state setting component 5, view management component 6 and CAN view component 7.
[0058] For example, view management component 4 manages CAN view component 5, and view management component 6 manages CAN view component 7. CAN view component 5 includes parent CAN view component f10, child CAN view component f11, child CAN view component f12, child CAN view component f13, etc.; CAN view component 7 includes child CAN view component f21, child CAN view component f22, child CAN view component f23, etc.
[0059] Among them, the sub-CAN view component f11 and the sub-CAN view component f21 are view components that need to be updated synchronously, the sub-CAN view component f12 and the sub-CAN view component f22 are view components that need to be updated synchronously, and so on.
[0060] When the parent CAN view component f10 receives the signal change notification sent by the view management component 4, it checks whether the signal is associated with itself. If so, it sets the status of the parent CAN view component f10 according to the return value of the view status setting component 3 (the returned updated view status), and sends the signal change notification to the next layer of child CAN view components (for example, child CAN view component f11, child CAN view component f21); if not, it directly sends the signal change notification to the next layer of child CAN view components (for example, child CAN view component f12, child CAN view component f22).
[0061] The sub-CAN view component of the next layer checks whether the signal is associated with itself. If so, it sets the state of the current sub-CAN view component according to the return value of view state setting component 3, and sends the signal change notification to the sub-CAN view component of the next layer; if not, it directly sends the signal change notification to the sub-CAN view component of the next layer until all CAN view components are sent.
[0062] In this embodiment, the binding view state includes a pre-update view state and a post-update view state corresponding to the parent CAN view component and / or the child CAN view component.
[0063] The display system provided in this embodiment uses various modules to implement various steps in the testing method, providing a hardware foundation for the display method and facilitating the implementation of the method.
[0064] The above embodiments are preferred implementation modes of the present invention, but the implementation modes of the present invention are not limited to the above embodiments. Any other changes, modifications, substitutions, combinations, and simplifications that do not deviate from the spirit and principles of the present invention should be considered as equivalent replacement methods and are included in the scope of protection of the present invention.
Claims
1. A view display method, characterized in that: Including steps: S1. Pre-set the one-to-one correspondence between CAN signals and view states, and save the binding relationship; The step S1 specifically includes: traversing each CAN signal, determining the pre-update view state and the post-update view state corresponding to each CAN view component, and saving the binding relationship between the CAN signal and each set of the pre-update view state and the post-update view state; S2. Send a signal change notification based on the received CAN signal change; S3. Acquire the target view state corresponding to the signal change notification according to the binding relationship, and then update the corresponding CAN view component; The target view state is the updated view state bound to the corresponding CAN signal change; The step S3 specifically comprises: determining whether the signal change notification is associated with the CAN view component, and if so, obtaining a corresponding target view state according to the signal change notification, and updating the CAN view component according to the target view state; The determination of whether the signal change notification is associated with the CAN view component is specifically as follows: based on the CAN signal change in the signal change notification, obtaining the pre-update view state corresponding to the CAN view component and the current view state of the CAN view component, and determining whether the current view state is consistent with the pre-update view state; if so, determining that the signal change notification is associated with the CAN view component.
2. A view display method according to claim 1, characterized in that: The CAN signal changes include changes in the vehicle body CAN signal and changes in the user-interactive CAN signal. The vehicle body CAN signal changes include door status signals and tire pressure signals sent by the vehicle body. The CAN signal of the user interaction is changed into the operation instruction generated by the user operation on the user interface.
3. A view display method according to claim 1, characterized in that: The method further includes step S0: setting a parent CAN view component and several child CAN view components in the CAN view component; taking the parent CAN view component as the end, linking each of the child CAN view components layer by layer in sequence to form an inter-layer chain structure.
4. A view display method according to claim 3, characterized in that: The step S3 comprises: S31. Determine whether the signal change notification is associated with the parent CAN view component. If so, obtain the corresponding target view state according to the signal change notification and update the parent CAN view component according to the target view state. If not, proceed to the next step. S32, sending the signal change notification to the sub-CAN view of the next layer; S33. Determine whether the signal change notification is associated with the sub-CAN view component of the current layer. If so, obtain the corresponding target view state according to the signal change notification, and update the sub-CAN view component according to the target view state. If not, return to step S32 until the signal change notification is sent to all the sub-CAN view components.
5. A view display method according to claim 4, characterized in that: Determining whether the signal change notification is associated with the parent CAN view component specifically comprises: obtaining the pre-update view state corresponding to the parent CAN view component and the current view state of the parent CAN view component according to the CAN signal change in the signal change notification, and determining whether the current view state is consistent with the pre-update view state; if so, determining that the signal change notification is associated with the parent CAN view component; otherwise, determining that the signal change notification is not associated; The determination of whether the signal change notification is associated with the sub-CAN view component of the current layer is specifically as follows: based on the CAN signal change in the signal change notification, obtaining the pre-update view state corresponding to the sub-CAN view component and the current view state of the sub-CAN view component, and determining whether the current view state is consistent with the pre-update view state; if so, determining that the signal change notification is associated with the sub-CAN view component; otherwise, not associated.
6. A view display system, configured to implement the view display method according to any one of claims 1 to 5, characterized in that: It includes a CAN signal transceiver component, a CAN signal processing component and at least one set of view update modules connected in sequence; the view update module includes a view state setting component, a view management component and a CAN view component; the CAN signal processing component, the view management component, the CAN view component and the CAN signal transceiver component are connected in sequence, and the view state setting component is connected to the view management component; The view state setting component is used to set the binding relationship between each CAN signal and the binding view state in the CAN view component; The CAN signal transceiver component is used to send or receive CAN signals; The CAN signal processing component is used to receive CAN signals and send signal change notifications to the view management component; The view management component is used to manage the CAN view component according to the signal change notification; The CAN view component is used to update the interface view according to the signal change notification.
7. A view display system according to claim 6, characterized in that: The CAN view component includes a parent CAN view component and several child CAN view components. The parent CAN view component is the end, and each of the child CAN view components is linked layer by layer in sequence to form an inter-layer chain structure.
8. A view display system according to claim 7, characterized in that: The binding view state includes a pre-update view state and a post-update view state corresponding to the parent CAN view component and / or the child CAN view component.
Citation Information
Patent Citations
Control method of display terminal equipment, display terminal equipment and storage medium
CN111405334A