Switch control system, control method thereof and driving equipment

By introducing the first and second control modules into the point-to-touch switch control system, the switch status signal is used for memory maintenance, and multiple functional items are assigned to the switch, which solves the problem of single function and state signal maintenance, and improves user experience and flexibility sex.

CN119176093APending Publication Date: 2024-12-24SUNGIANT AUTOMOTIVE ELECTRONICS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411521327.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-28
Publication Date
2024-12-24

AI Technical Summary

Technical Problem

The existing touch switch function is single and cannot maintain the switch status signal, affecting the user experience.

Method used

By introducing the first and second control modules into the switch control system, memory retention is performed using the switch status signal, multiple functional items are assigned to the switch, and user-defined functional mode is realized through the function item driving module.

Benefits of technology

The status signal holding function of the switch is realized, which improves the flexibility and versatility of the switch and improves the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119176093A_ABST
    Figure CN119176093A_ABST
Patent Text Reader

Abstract

The invention discloses a switch control system, a control method thereof and driving equipment, and relates to the technical field of automobile control. The control method comprises the following steps: a first control module collects a current level signal of a switch, determines a current value of a first switch state signal according to the current level signal of the switch, and sends the current value of the first switch state signal to a second control module; the second control module updates the numerical value of the second switch state signal according to the current numerical value of the first switch state signal, determines a corresponding function item driving instruction based on the updated numerical value of the second switch state signal, and sends the current function item driving instruction to the first control module; and the first control module drives the function item driving module according to the current function item driving instruction so as to control the switch to execute the corresponding function item. The method can realize the memory keeping function of the switch, endows the switch with a plurality of function items, is convenient for a user to customize and select a function mode, and improves the user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of automobile control technology, and in particular to a switch control system and a control method thereof and a driving device. Background Art

[0002] A touch switch is a common type of switch. By lightly touching the button, the contacts under the button are instantly connected or disconnected, thereby switching the switch. It has the advantages of small size, easy use, high sensitivity, and good reliability, and is widely used in various automotive, electronic, and communication fields. However, the functions performed by existing touch switches are usually relatively simple, and the switch state signal cannot be maintained after the switch is released, which affects the user experience. Summary of the invention

[0003] Purpose of the invention: An embodiment of the present application provides a control method, aiming to overcome the technical problems in the prior art that the switch has a single function and the switch signal cannot be maintained, thus affecting the user experience; another purpose of the embodiment of the present application is to provide a switch control system; the third purpose of the present application is to provide a driving device.

[0004] Technical solution: A control method described in an embodiment of the present application is executed by a switch control system, which at least includes: a first control module, a second control module, a function item driving module and a switch; wherein a first switch state signal is set in the first control module; and a second switch state signal is set in the second control module;

[0005] The method comprises:

[0006] The first control module collects the current level signal of the switch, determines the current value of the first switch state signal according to the current level signal of the switch, and sends the current value of the first switch state signal to the second control module;

[0007] The second control module updates the value of the second switch state signal according to the current value of the first switch state signal, determines the corresponding function item drive instruction based on the updated value of the second switch state signal, and sends the current function item drive instruction to the first control module;

[0008] The first control module drives the function item driving module according to the current function item driving instruction to control the switch to execute the corresponding function item.

[0009] In some embodiments, the determining the corresponding function item driving instruction based on the updated value of the second switch state signal includes:

[0010] Presetting a corresponding relationship between the value of the second switch state signal and the function item driving instruction;

[0011] Obtaining an updated value of the second switch state signal;

[0012] Determine a function item driving instruction corresponding to the value of the second switch state signal.

[0013] In some embodiments, the second control module is further provided with a first counter and a second counter;

[0014] The updating of the value of the second switch state signal according to the current value of the first switch state signal comprises:

[0015] The second control module determines whether a jump occurs according to the current value of the first switch state signal;

[0016] If it is determined that the current value of the first switch state signal changes, obtaining the current first count value of the first counter, the current second count value of the second counter, and the change of the current value of the first switch state signal;

[0017] The value of the second switch state signal is updated according to the jump condition of the current first count value, the current second count value and the current value of the first switch state signal.

[0018] In some embodiments, updating the current value of the second switch state signal according to the current first count value, the current second count value, and the transition of the current value of the first switch state signal includes:

[0019] When the current value of the first switch state signal changes, the current first count value of the first counter is updated according to the current first count value, the change of the current value of the first switch state signal, and the corresponding relationship between the preset first count value and the value change of the first switch state signal;

[0020] updating a second count value of the second counter according to a current second count value of the second counter and an updated current first count value of the first counter;

[0021] The current value of the second switch state signal is updated according to a preset update mechanism and the updated second count value of the second counter.

[0022] In some embodiments, the preset update mechanism includes:

[0023] a correspondence between a preset remainder and a value of the second switch state signal;

[0024] Divide the updated second count value of the second counter by four and take the remainder;

[0025] The current value of the second switch state signal is determined according to the corresponding relationship between the remainder and the value of the second switch state signal.

[0026] In some embodiments, the switch control system further includes a switch indicator light, and the switch indicator light is connected to the first control module;

[0027] The step of determining the corresponding function item driving instruction based on the updated value of the second switch state signal includes:

[0028] The second control module determines the driving instruction of the switch indicator light and sends it to the first control module according to the updated value of the second switch state signal and the corresponding relationship between the preset value of the second switch state signal and the driving instruction of the switch indicator light;

[0029] The first control module drives the switch indicator light to perform a corresponding action according to the driving instruction of the switch indicator light and collects the state signal value after the switch indicator light performs the corresponding action, and sends the state signal value after the switch indicator light performs the corresponding action to the second control module; wherein the corresponding action includes turning on a corresponding color or turning off the switch indicator light;

[0030] The second control module determines whether the value of the switch indicator light state signal correctly corresponds to the drive instruction of the switch indicator light, and if the correspondence is correct, determines the function item drive instruction of the function item drive module according to the drive instruction of the switch indicator light.

[0031] In some embodiments, the control method also includes: when the value of the switch indicator light status signal corresponds incorrectly to the driving instruction of the switch indicator light, the second control module clears the value of the first counter, the value of the second counter and the value of the second switch status signal.

[0032] In some embodiments, determining the current value of the first switch state signal according to the current level signal of the switch includes:

[0033] The current value of the first switch state signal is determined according to the current level signal of the switch and the corresponding relationship between the preset switch level signal and the value of the first switch state signal.

[0034] In some embodiments, determining the current value of the first switch state signal according to the current level signal of the switch and the correspondence between the preset switch level signal and the value of the first switch state signal includes:

[0035] Set the first preset duration and the second preset duration;

[0036] Determine whether the current level signal of the switch has a falling edge, if the current level signal of the switch does not have a falling edge, the current value of the first switch state signal is the first value;

[0037] If the current level signal of the switch has a falling edge, the falling edge timing is started, and when a rising edge appears, the falling edge timing is stopped and the rising edge timing is started;

[0038] If the duration of the falling edge timing is greater than the first preset duration, the current value of the first switch state signal is updated to a third value;

[0039] If the duration of the falling edge timing is less than or equal to the first preset duration, and the duration of the rising edge timing is greater than the second preset duration, the current value of the first switch state signal is updated to the second value;

[0040] If the duration of the falling edge timing is less than or equal to the first preset duration, and when the duration of the rising edge timing is less than or equal to the second preset duration, determine whether a falling edge appears again; if a falling edge appears again, the current value of the first switch state signal is updated to a fourth value; if a falling edge does not appear again, the current value of the first switch state signal is updated to the second value.

[0041] Accordingly, a switch control system described in an embodiment of the present application at least includes: a first control module, a second control module, a function item driving module and a switch; wherein a first switch state signal is provided in the first control module; and a second switch state signal is provided in the second control module;

[0042] The first control module is used to collect the current level signal of the switch, determine the current value of the first switch state signal according to the current level signal of the switch, and send the current value of the first switch state signal to the second control module;

[0043] The second control module is used to update the value of the second switch state signal according to the current value of the first switch state signal, determine the corresponding function item drive instruction based on the updated value of the second switch state signal, and send the current function item drive instruction to the first control module;

[0044] The first control module is further configured to drive the function item driving module according to the current function item driving instruction, so as to control the switch to execute the corresponding function item.

[0045] In some embodiments, a first counter and a second counter are further provided in the second control module; the second control module is further used to determine whether a jump occurs according to the current value of the first switch state signal;

[0046] If it is determined that the current value of the first switch state signal changes, obtaining the current first count value of the first counter, the current second count value of the second counter, and the change of the current value of the first switch state signal;

[0047] The value of the second switch state signal is updated according to the jump condition of the current first count value, the current second count value and the current value of the first switch state signal.

[0048] In some embodiments, the switch control system further includes a switch indicator light; the switch indicator light is connected to the first control module;

[0049] The second control module is further used to determine the driving instruction of the switch indicator light and send it to the first control module according to the updated value of the second switch state signal and the corresponding relationship between the preset value of the second switch state signal and the driving instruction of the switch indicator light;

[0050] The first control module is further used to drive the switch indicator light to perform a corresponding action according to the driving instruction of the switch indicator light and collect the state signal value after the switch indicator light performs the corresponding action, and send the state signal value after the switch indicator light performs the corresponding action to the second control module; wherein the corresponding action includes turning on a corresponding color or turning off the switch indicator light;

[0051] The second control module is also used to determine whether the value of the switch indicator light status signal correctly corresponds to the drive instruction of the switch indicator light, and when the correspondence is correct, determine the function item drive instruction of the function item drive module according to the drive instruction of the switch indicator light.

[0052] Correspondingly, a driving device described in an embodiment of the present application includes the switch control system as described above.

[0053] Beneficial effect: Compared with the prior art, the switch control system and control method and driving device of the embodiment of the present application include: the first control module collects the current level signal of the switch, determines the current value of the first switch state signal according to the current level signal of the switch, and sends the current value of the first switch state signal to the second control module; the second control module updates the value of the second switch state signal according to the current value of the first switch state signal, and determines the corresponding function item drive instruction based on the updated value of the second switch state signal, and sends the current function item drive instruction to the first control module; the first control module drives the function item drive module according to the current function item drive instruction to control the switch to execute the corresponding function item. Through this method, it can be achieved that: by cooperating the first control module with the second control module, and by setting the first switch state signal and the second switch state signal to realize the maintenance of the state signal of the switch, the control of the switch has a memory retention function, and the switch is given multiple function items, so as to facilitate the user to customize the selection of function mode, improve the flexibility and versatility of the switch, and enhance the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0055] Figure 1 is a flow chart of a control method provided in an embodiment of the present application;

[0056] Figure 2 is a flow chart of another control method provided in an embodiment of the present application;

[0057] Figure 3 is a timing diagram of a switch level signal provided in an embodiment of the present application;

[0058] Figure 4 is a flow chart of another control method provided in an embodiment of the present application;

[0059] Figure 5 is a control flow diagram of the first control module provided in an embodiment of the present application;

[0060] Figure 6 is a control flow diagram of the second control module provided in an embodiment of the present application;

[0061] Figure 7 is an overall control flow chart of a switch control system provided in an embodiment of the present application;

[0062] Figure 8 It is a principle structure block diagram of a switch control system provided in an embodiment of the present application;

[0063] Fig. 9 It is a principle structural block diagram of another switch control system provided in an embodiment of the present application.

[0064] Reference numerals:

[0065] 10-first control module; 20-second control module; 30-function item drive module; 40-switch; 50-switch indicator light. DETAILED DESCRIPTION

[0066] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.

[0067] It should be understood that although the terms first, second, etc. may be used herein to describe various components, these components should not be limited by these terms. These terms are used to distinguish one component from another component. Therefore, the first component discussed below can be referred to as the second component without departing from the teachings of the concepts of the present application. As used herein, the term "and / or" includes any one of the associated listed items and all combinations of one or more.

[0068] Those skilled in the art will appreciate that the drawings are only schematic diagrams of example embodiments and may not be to scale. The modules or processes in the drawings are not necessarily required to implement the present application and therefore cannot be used to limit the scope of protection of the present application.

[0069] Figure 1 1 is a flow chart of a control method provided in an embodiment of the present application. The method is executed by a switch control system, which at least includes: a first control module, a second control module, a function item driving module and a switch; wherein a first switch state signal is set in the first control module; and a second switch state signal is set in the second control module.

[0070] The switch and the function item driving module are both connected to the first control module through hard wires, and the first control module communicates with the second control module through a CAN bus.

[0071] Exemplarily, the switch may be a touch switch. The first control module may be a regional controller, and the second control module may be a vehicle domain controller.

[0072] Exemplarily, in the technical solution of this embodiment, the value of the first switch state signal is Button1, and the value of the second switch state signal is Button2 (the same below, no further details), and the first control module is the regional controller, the second control module is the vehicle domain controller, and a touch switch can select three function items (for example, function item 1 is, short press once to execute the next function item; function item 2, long press the switch to return to execute the previous function item; function item 3, short press the switch twice in a row to jump to the function item) as an example for explanation.

[0073] See also Figure 1 , the control method comprises the following steps:

[0074] Step 110: The first control module collects the current level signal of the switch, determines the current value of the first switch state signal according to the current level signal of the switch, and sends the current value of the first switch state signal to the second control module.

[0075] The switch has multiple states, including being pressed and not pressed. The state of the switch being pressed includes being short pressed, long pressed, short pressed once, short pressed twice in succession, short pressed N times in succession, etc.

[0076] The switch is pressed or not pressed, and the pressed state is different, and accordingly, the level signal of the switch is different. Therefore, the level signal of the switch is collected by the regional controller, and different values ​​of the first switch state signal (i.e., the value of Button1) are set for different level signals to obtain the current state of the switch, and the value of the first switch state signal of the switch is sent to the vehicle domain controller, so that the vehicle domain controller can subsequently memorize and retain the state signal of the switch and assign multiple function items to the switch.

[0077] Step 120, the second control module updates the value of the second switch state signal according to the current value of the first switch state signal, determines the corresponding function item drive instruction based on the updated value of the second switch state signal, and sends the current function item drive instruction to the first control module.

[0078] Specifically, the first control module collects the current state signal of the switch in real time, that is, collects the current level signal of the switch, and can identify the current state signal of the switch according to the current level signal of the switch, and obtains the current value of the first switch state signal according to the current level signal of the switch, and sends the current value of the first switch state signal to the second control module. After the second control module receives the current value of the first switch state signal, it updates the value of the second switch state signal according to the current value of the first switch state signal, thereby realizing the memory retention of the state of the switch, increasing the flexibility of the switch use, and improving the user experience. And based on the value of the updated second switch state signal, the current corresponding function item drive instruction is determined, thereby realizing the assignment of multiple function items to the switch, solving the problem that the existing technology has a single switch function and affects the user experience.

[0079] Among them, there is a certain correspondence between the value of the second switch state signal and the function item driving instruction. According to the value of the second switch state signal and the correspondence between the two, the current corresponding function item driving instruction can be determined to drive the corresponding function item, thereby giving the switch multiple functions, facilitating users to customize the selection of function modes and improving user experience.

[0080] Step 130: The first control module drives the function item driving module according to the current function item driving instruction to control the switch to execute the corresponding function item.

[0081] Among them, different function item drive instructions correspond to different function items. There is a one-to-one correspondence between the function item drive instructions and the function items. For example, function item drive instruction 1 corresponds to function item 1, function item drive instruction 2 corresponds to function item 2, function item drive instruction 3 corresponds to function item 3, and function item drive instruction 4 corresponds to function item 4.

[0082] Specifically, the second control module determines the corresponding function item drive instruction according to the value of the updated second switch state signal and sends it to the first control module. The first control module drives the function item drive module according to the received function item drive instruction to control the switch to execute the corresponding function item. Thus, by cooperating with the first control module and the second control module, it is possible to give the switch a variety of different functions.

[0083] Among them, the vehicle domain controller has powerful computing power. Through the vehicle domain controller, it can memorize and maintain the switch status, determine the function item drive instructions, etc., making it easier to process strategies efficiently. For the functions commonly used by users, they can be defined by themselves. To add the functions of the multi-function switch in the future, it only needs to remotely update the software in the vehicle domain controller. At the same time, the regional controller reduces the wiring harness, making the cost more optimized. Therefore, by coordinating the vehicle domain controller with the regional controller, it is possible to memorize and maintain the various states of the switch, and give the switch multiple functions, so that users can customize the selection of functional modes, improve the flexibility and versatility of switch use, enhance user experience, and reduce costs.

[0084] In the technical solution of this embodiment, the working principle of the control method is: Figure 1 First, the first control module collects the current level signal of the switch, determines the current value of the first switch state signal according to the current level signal of the switch, and sends the current value of the first switch state signal to the second control module. Then, the second control module updates the value of the second switch state signal according to the current value of the first switch state signal, determines the corresponding function item drive instruction based on the updated value of the second switch state signal, and sends the current function item drive instruction to the first control module. Finally, the first control module drives the function item drive module according to the current function item drive instruction to control the switch to execute the corresponding function item. It can be seen that by cooperating with the first control module and the second control module, the two modules complement each other and improve the efficiency and reliability of the control strategy operation. And by setting the first switch state signal and the second switch state signal, the current state signal of the switch is maintained, so that the control of the switch has a memory retention function, and the switch is given multiple function items, so that it is convenient for users to customize the selection of function modes, improve the flexibility and versatility of the switch, and enhance the user experience.

[0085] Figure 2 is a flow chart of another control method provided in the embodiment of the present application. Figure 2 , the method comprises the following steps:

[0086] Step 210: The first control module collects the current level signal of the switch, and determines the current value of the first switch state signal according to the current level signal of the switch and the correspondence between the level signal of the preset switch and the value of the first switch state signal, and sends the current value of the first switch state signal to the second control module.

[0087] The current state of the switch is different, and its corresponding level signal is different. Therefore, by setting the value of the corresponding first switch state signal for the different level signals of the switch, it is convenient to memorize and maintain the different states of the switch later. Different switch level signals correspond to different first switch state signal values. Specifically, the first control module collects the current level signal of the switch in real time. Therefore, according to the current level signal of the switch and the corresponding relationship between the level signal of the preset switch and the value of the first switch state signal, the current value of the first switch state signal can be determined.

[0088] In some embodiments, the specific implementation method of determining the current value of the first switch state signal according to the current level signal of the switch and the correspondence between the preset switch level signal and the value of the first switch state signal includes: setting a first preset time length and a second preset time length; judging whether the current level signal of the switch has a falling edge, if the current level signal of the switch does not have a falling edge, the current value of the first switch state signal is the first value. If the current level signal of the switch has a falling edge, start the falling edge timing, and when a rising edge appears, stop the falling edge timing and start the rising edge timing. If the duration T1 of the falling edge timing is greater than the first preset duration Tref1, the current value of the first switch state signal is updated to the third value; if the duration of the falling edge timing is less than or equal to the first preset duration Tref1, and when the duration of the rising edge timing is greater than the second preset duration Tref2, the current value of the first switch state signal is updated to the second value; if the duration T1 of the falling edge timing is less than or equal to the first preset duration Tref1, and when the duration T2 of the rising edge timing is less than or equal to the second preset duration Tref2, it is determined whether a falling edge appears again; if a falling edge appears again, the current value of the first switch state signal is updated to the fourth value; if the falling edge does not appear again, the current value of the first switch state signal is updated to the second value.

[0089] The first preset time length Tref1 is greater than the second preset time length Tref2. The specific values ​​of the first preset time length and the second preset time length can be set according to actual conditions and are not specifically limited here.

[0090] Illustratively, in the technical solution of this embodiment, the first numerical value, the second numerical value, the third numerical value and the fourth numerical value can be replaced by 0X0, 0X1, 0X2 and 0X3, respectively (the same below, no further details).

[0091] Figure 3 is a timing diagram of the switch level signal provided in the embodiment of the present application. Figure 3, the zone controller collects the current level signal of the touch switch through the hard line, and detects whether the current level signal of the switch has a falling edge to determine whether the switch is pressed. If the current level signal of the switch does not have a falling edge, refer to Figure 3 The first time sequence SX1 in the diagram indicates that the current state of the switch is not pressed, and the current value of the first switch state signal Button1=0X0, and the current value of the first switch state signal Button1=0X0 is sent to the vehicle domain controller. When the current level signal of the switch is detected to have a falling edge, the falling edge timing T1 is started. When the level signal of the switch is detected to have a rising edge, the falling edge timing T1 is stopped and the rising edge timing T2 is started. Then it is determined whether the duration T1 of the falling edge exceeds the first preset duration Tref1. When T1>Tref1, refer to Figure 3 The second time sequence SX2 in the diagram indicates that the user has long pressed the switch. The current state of the switch is long pressed. The falling edge timer is cleared to 0, that is, T1 = 0, and the current value of the first switch state signal Button1 = 0X2 is sent to the vehicle domain controller. When T1 ≤ Tref1, it indicates that the user has short pressed the switch. At this time, it is determined whether a falling edge appears again within the time when the duration of the rising edge T2 is less than or equal to the second preset time, that is, within T2 ≤ Tref2. If a falling edge appears again, refer to Figure 3 The third time sequence SX3 in the diagram indicates that the user has pressed the switch twice in succession. The current state of the switch is two consecutive short presses. The rising edge timer is cleared to 0, that is, T2 = 0, and the current value of the first switch state signal Button1 = 0X3 is sent to the vehicle domain controller. If no falling edge occurs within T2 ≤ Tref2, please refer to Figure 3 The fourth timing sequence SX4 in the diagram indicates that the user only short presses the switch once. At this time, the switch is in the state of short press once. At this time, the rising edge timer is cleared to 0, that is, T2=0, and the current value of the first switch state signal Button1=0X1 is sent to the vehicle domain controller.

[0092] Step 220: The second control module determines whether a jump occurs according to the current value of the first switch state signal.

[0093] The current value of the first switch state signal changes, including no change and change. The current value of the first switch state signal changes, including at least Button1 changes from 0X0 to 0X1, Button1 changes from 0X0 to 0X2, and Button1 changes from 0X0 to 0X3. Button1 changes from 0X0 to 0X1, corresponding to the switch being pressed once (i.e., short press once), and the switch executes the next function; Button1 changes from 0X0 to 0X3, corresponding to the switch being pressed twice (i.e., short press twice), and the switch jumps twice.

[0094] Step 230: If it is determined that the current value of the first switch state signal changes, obtain the current first count value of the first counter, the current second count value of the second counter, and the change of the current value of the first switch state signal.

[0095] The second control module is further provided with a first counter and a second counter. The first counter is used to count when the current value of the first switch state signal changes. The second counter is updated according to the change of the first counter.

[0096] Step 240: Update the value of the second switch state signal according to the jump of the current first count value, the current second count value and the current value of the first switch state signal.

[0097] Specifically, by setting the first counter and the second counter in the second control module, and combining the jump of the current value of the first switch state signal, the value of the second switch state signal can be updated, which is beneficial to memorize and maintain the current state of the switch, as well as the subsequent setting and driving of various functional items.

[0098] Step 250: preset a corresponding relationship between the value of the second switch state signal and the function item driving instruction.

[0099] The correspondence between the value of the second switch state signal and the function item drive instruction is a one-to-one correspondence. For example, when the value of the second switch state signal Button2=0X1, it corresponds to function item drive instruction 1; when the value of the second switch state signal Button2=0X2, it corresponds to function item drive instruction 2; when the value of the second switch state signal Button2=0X3, it corresponds to function item drive instruction 3; when the value of the second switch state signal Button2=0X0, it corresponds to function item drive instruction 4.

[0100] Step 260: Obtain the updated value of the second switch state signal.

[0101] Step 270: Determine the function item driving instruction corresponding to the value of the second switch state signal.

[0102] Specifically, after the value of the second switch state signal is updated according to the jump of the current first count value, the current second count value and the current value of the first switch state signal, the function item drive instruction corresponding to the value of the second switch state signal can be determined according to the preset correspondence between the value of the second switch state signal and the function item drive instruction. For example, assuming that the updated value of the second switch state signal Button2=0X1, it can be determined that Button2=0X1 corresponds to function item drive instruction 1; assuming that the updated value of the second switch state signal Button2=0X2, it can be determined that Button2=0X2 corresponds to function item drive instruction 2; assuming that the updated value of the second switch state signal Button2=0X3, it can be determined that Button2=0X3 corresponds to function item drive instruction 3; assuming that the updated value of the second switch state signal Button2=0X0, it can be determined that Button2=0X0 corresponds to function item drive instruction 4.

[0103] Step 280: The first control module drives the function item driving module according to the current function item driving instruction to control the switch to execute the corresponding function item.

[0104] In the technical solution of the embodiment of the present application, the working principle of the control method is: Figure 2First, the first control module collects the current level signal of the switch, and determines the current value of the first switch state signal according to the current level signal of the switch and the corresponding relationship between the preset level signal of the switch and the value of the first switch state signal, and sends the current value of the first switch state signal to the second control module. Then, the second control module determines whether it jumps according to the current value of the first switch state signal. If it is determined that the current value of the first switch state signal jumps, the current first count value of the first counter, the current second count value of the second counter and the jump of the current value of the first switch state signal are obtained. The value of the second switch state signal is updated according to the jump of the current first count value, the current second count value and the current value of the first switch state signal. Secondly, the corresponding relationship between the value of the second switch state signal and the function item driving instruction is preset. The updated value of the second switch state signal is obtained. The function item driving instruction corresponding to the value of the second switch state signal is determined. Finally, the first control module drives the function item driving module according to the current function item driving instruction to control the switch to execute the corresponding function item. It can be seen that by cooperating the first control module with the second control module, the two modules complement each other's advantages, and improve the efficiency and reliability of the control strategy operation. And by setting the first switch state signal, the second switch state signal, the first counter and the second counter, the current state signal of the switch can be memorized and maintained, so that the control of the switch has a memory retention function. And according to the first count value of the first counter, the second count value of the second counter and the jump of the first switch state signal, the value of the second switch state signal is updated to set the function item corresponding to the current state of the switch, so as to give multiple functions to the switch, thereby facilitating the user to customize the selection of function modes, improving the flexibility and versatility of the switch, and enhancing the user experience.

[0105] Figure 4 is a flow chart of another control method provided in the embodiment of the present application. Figure 4 , the control method comprises the following steps:

[0106] Step 301, the first control module collects the current level signal of the switch, and determines the current value of the first switch state signal according to the current level signal of the switch and the correspondence between the level signal of the preset switch and the value of the first switch state signal, and sends the current value of the first switch state signal to the second control module.

[0107] Step 302: The second control module determines whether a jump occurs according to the current value of the first switch state signal.

[0108] Step 303: If it is determined that the current value of the first switch state signal changes, obtain the current first count value of the first counter, the current second count value of the second counter, and the change of the current value of the first switch state signal.

[0109] Step 304, when the current value of the first switch state signal changes, the current first count value of the first counter is updated according to the current first count value, the change of the current value of the first switch state signal, and the correspondence between the preset first count value and the value change of the first switch state signal.

[0110] Exemplarily, in the technical solution of this embodiment, the first count value of the first counter is assumed to be sw1, and the second count value of the second counter is assumed to be sw2 (the same below, which will not be described in detail).

[0111] The correspondence between the first count value and the value jump of the first switch state signal is a one-to-one correspondence. For example, when the value Button1 of the first switch state signal jumps from 0X0 to 0X1, the first count value sw1 of the first counter is increased by 1. When the value Button1 of the first switch state signal jumps from 0X0 to 0X2, the first count value sw1 of the first counter is reduced by 1. When the value Button1 of the first switch state signal jumps from 0X0 to 0X3, the first count value sw1 of the first counter is increased by 2.

[0112] Step 305: Update the second count value of the second counter according to the current second count value of the second counter and the updated current first count value of the first counter.

[0113] The updating formula of the second count value of the second counter is:

[0114] sw2=sw2+sw1;

[0115] The updated value of the second count value of the second counter is the sum of the current second count value of the second counter and the updated first count value.

[0116] Step 306: Update the current value of the second switch state signal according to the preset update mechanism and the updated second count value of the second counter.

[0117] In some embodiments, the preset update mechanism includes: a correspondence between a preset remainder and a numerical value of the second switch state signal; dividing the second count value of the updated second counter by four and taking the remainder; and determining the current numerical value of the second switch state signal based on the correspondence between the remainder and the numerical value of the second switch state signal.

[0118] Among them, the correspondence between the remainder and the value of the second switch state signal is: remainder 0 corresponds to Button2=0X0; remainder 1 corresponds to Button2=0X1; remainder 2 corresponds to Button2=0X2; remainder 3 corresponds to Button2=0X3.

[0119] Specifically, after obtaining the updated first count value and the updated second count value according to the jump condition of the current value Button1 of the first switch state signal, the current first count value and the current second count value, the updated second count value is divided by four and the remainder is taken. The current value Button2 of the second switch state signal can be determined according to the correspondence between the remainder and the value of the second switch state signal. For example, assuming that the jump condition of the current value Button1 of the first switch state signal is from 0X0 to 0X3, the first count value sw of the first counter is added by 2, and the updated first count value can be obtained as 2 (assuming that the initial value of the first count value is 0). Then, according to the current second count value sw2 (assuming it is 1) and the updated first count value 2, the updated second count value can be obtained as 3. Then, the updated second count value 3 is divided by four and the remainder is taken, and the remainder is 3. Then, according to the correspondence between the remainder and the value of the second switch state signal, the current value Button2 of the second switch state signal can be obtained as 0X3.

[0120] Step 307: preset a corresponding relationship between the value of the second switch state signal and the function item driving instruction.

[0121] Step 208: Obtain the updated value of the second switch state signal.

[0122] Step 309: Determine the function item driving instruction corresponding to the value of the second switch state signal.

[0123] Step 310: The second control module determines the driving instruction of the switch indicator light and sends it to the first control module according to the updated value of the second switch state signal and the correspondence between the preset value of the second switch state signal and the driving instruction of the switch indicator light.

[0124] The switch control system further includes a switch indicator light, which is connected to the first control module via a hard line.

[0125] Among them, the correspondence between the value of the second switch state signal and the driving instruction of the switch indicator light is a one-to-one correspondence. For example, when the value of the second switch state signal Button2=0X1, the corresponding driving instruction of the switch indicator light VDC=0X1. When the value of the second switch state signal Button2=0X2, the corresponding driving instruction of the switch indicator light VDC=0X2. When the value of the second switch state signal Button2=0X3, the corresponding driving instruction of the switch indicator light VDC=0X3. When the value of the second switch state signal Button2=0X0, the corresponding driving instruction of the switch indicator light VDC=0X0.

[0126] Step 311, the first control module drives the switch indicator light to perform a corresponding action according to the driving instruction of the switch indicator light and collects the status signal value after the switch indicator light performs the corresponding action, and sends the status signal value after the switch indicator light performs the corresponding action to the second control module; wherein the corresponding action includes turning on the corresponding color or turning off the switch indicator light.

[0127] Among them, there is a one-to-one correspondence between the driving instruction of the switch indicator and the corresponding action. For example, when the driving instruction VDC of the switch indicator is 0X1, the corresponding action is that the switch indicator indicates red. When the driving instruction VDC of the switch indicator is 0X2, the corresponding action is that the switch indicator indicates yellow. When the driving instruction VDC of the switch indicator is 0X3, the corresponding action is that the switch indicator indicates green. When the driving instruction VDC of the switch indicator is 0X0, the corresponding action is that the switch indicator indicates off.

[0128] Among them, the switch indicator light performs different corresponding actions, which correspond to different state signal values. For example, when the corresponding action performed by the switch indicator light is to indicate red, the corresponding state signal value sw3 of the switch indicator light is 0X1. When the corresponding action performed by the switch indicator light is to indicate yellow, the corresponding state signal value sw3 of the switch indicator light is 0X2. When the corresponding action performed by the switch indicator light is to indicate green, the corresponding state signal value sw3 of the switch indicator light is 0X3. When the corresponding action performed by the switch indicator light is to indicate off, the corresponding state signal value sw3 of the switch indicator light is 0X0.

[0129] Step 312: The second control module determines whether the value of the switch indicator light state signal correctly corresponds to the drive instruction of the switch indicator light, and if the correspondence is correct, determines the function item drive instruction of the function item drive module according to the drive instruction of the switch indicator light.

[0130] There is a one-to-one correspondence between the driving instruction of the switch indicator light and the function item driving instruction (or function item) of the function item driving module. For example, when the driving instruction VDC of the switch indicator light is 0X1, it corresponds to the function item driving instruction 1 and function item 1; when the driving instruction VDC of the switch indicator light is 0X2, it corresponds to the function item driving instruction 2 and function item 2; when the driving instruction VDC of the switch indicator light is 0X3, it corresponds to the function item driving instruction 3 and function item 3; when the driving instruction VDC of the switch indicator light is 0X0, it corresponds to the function item driving instruction 4 and function item 4.

[0131] Specifically, the first control module drives the switch indicator to perform a corresponding action according to the driving instruction of the switch indicator, collects the state signal value after the switch indicator performs the corresponding action, and sends the state signal value after the switch indicator performs the corresponding action to the second control module. The second control module determines whether the received switch indicator state signal value corresponds correctly to the driving instruction of the switch indicator according to the received state signal value of the switch indicator, and when the correspondence is correct, determines the function item driving instruction of the function item driving module according to the driving instruction of the switch indicator. For example, assuming that the current value Button2 of the updated second switch state signal is 0X2, the corresponding driving instruction of the switch indicator VDC=0X2, and the corresponding action of the corresponding switch indicator is to indicate yellow. The first control module drives the switch indicator to indicate yellow according to the driving instruction of the switch indicator VDC=0X2, and collects the value of the switch state signal value sw3 corresponding to the switch indicator indicating yellow and sends it to the second control module. The second control module obtains the switch state signal value sw3 and determines whether it corresponds correctly to the driving instruction of the switch indicator, that is, determines whether it is 0X2. If so, it means that the indication of the switch indicator is correct. And according to the driving instruction VDC=0X2 of the switch indicator light, it is determined that the current corresponding function item driving instruction 2 and function item 2. Therefore, by setting the switch indicator light and judging whether the corresponding execution action is correct according to the state signal value of the switch indicator light, it is judged whether the corresponding function item driving instruction and function item are correct, thereby ensuring the accuracy of the execution of each function item, avoiding the occurrence of errors in the execution of the switch function item, thereby improving the reliability of the switch use and the safety of the user.

[0132] Step 313: The first control module drives the function item driving module according to the current function item driving instruction to control the switch to execute the corresponding function item.

[0133] In some embodiments, the control method of the switch control system also includes: when the value of the switch indicator light status signal corresponds incorrectly to the driving instruction of the switch indicator light, the second control module clears the value of the first counter, the value of the second counter and the value of the second switch status signal.

[0134] Among them, when the value of the switch indicator light status signal corresponds incorrectly to the driving instruction of the switch indicator light, the value of the first counter, the value of the second counter and the value of the second switch status signal are cleared to realize failure protection of the switch, which can ensure the accuracy of each functional item of the switch and the safety of user use.

[0135] Figure 5 is a control flow diagram of the first control module provided in the embodiment of the present application. Figure 5 , the specific implementation process of the regional controller collecting the current level signal of the switch and the status feedback of the switch indicator light is as follows: First, the regional controller collects the current level signal of the touch switch through a hard line to detect whether the switch is pressed, that is, to detect whether the level signal of the switch has a falling edge. When the level signal of the switch does not have a falling edge, it means that the switch is not pressed. At this time, the regional controller sends the current value of the first switch state signal Button1=0X0 to the vehicle domain controller. When the level signal of the switch is detected to have a falling edge, the falling edge timing T1 is started. When the level signal of the switch is detected to have a rising edge, the falling edge timing T1 is stopped, the rising edge timing T2 is started, and it is determined whether T1 exceeds the first preset judgment time Tref1. When T1>Tref1, it means that the user has long pressed the switch, and the current state of the switch is long pressed, then the falling edge timer is cleared to 0, that is, T1 is 0, and the current value of the first switch state signal Button1=0X2 is sent to the vehicle domain controller. When T1≤Tref1, it means that the user short-pressed the switch, and the current state of the switch is short-pressed. At this time, within the second preset time length Tref2 of the judgment time, that is, T2≤Tref2, it is judged whether the falling edge appears again. When the falling edge appears again, it means that the user pressed the switch twice in succession, that is, the current state of the switch is two consecutive short presses. At this time, the rising edge timer is cleared to 0, that is, T2 is 0, and the current value of the first switch state signal Button1=0X3 is sent to the vehicle domain controller. If the falling edge does not appear again within T2≤Tref2, it means that the user only short-pressed the switch once, that is, the current state of the switch is short-pressed once. At this time, the rising edge timer is cleared to 0, and the current value of the first switch state signal Button1=0X1.

[0136] At the same time, the regional controller also receives the driving command of the switch indicator light sent by the vehicle domain controller, and determines whether the driving command of the switch indicator light is the value corresponding to the driving instruction VDC of the switch indicator light. If yes, the corresponding indication state of the switch indicator light is lit according to the driving instruction, and the current state signal value sw3 (0x0: off, 0x1: red, 0x2: yellow, 0x3: green) of the switch indicator light is fed back to the vehicle domain controller. If not, the corresponding function item is executed through hard-wire driving according to the driving instruction VDC, and the current function item state signal is fed back to the vehicle domain controller.

[0137] Figure 6 is a control flow diagram of the second control module provided in the embodiment of the present application. Figure 6 , the logic judgment processing process of the vehicle domain controller is as follows: first, the vehicle domain controller is powered on for initialization, the first count value sw1 of the first counter and the second count value sw2 of the second counter are cleared, the value Button2 of the second switch state signal is restored to the default state, and the current value Button1 of the first switch state signal sent by the regional controller is received. After receiving the current value Button1 of the first switch state signal, it is detected whether Button1 has an edge jump. If an edge jump occurs, the first count value sw1, the second count value sw2 and the current value Button2 of the second switch state signal are updated according to the jump of Button1 (wherein, the second count value sw2 plus the first count value sw1 obtains the updated second count value, the updated second count value is divided by 4 to obtain the remainder, and the value Button2 of the second switch state signal is updated according to the remainder (i.e. remainder 0: 0x0, remainder 1: 0x1, remainder 2: 0x2, remainder 3: 0x3)). And according to the current value Button2 of the updated second switch state signal, the switch indicator light driving instruction VDC (the corresponding color of the switch indicator light turning on driving instruction) is sent to the regional controller. After the switch indicator light driving instruction VDC is sent, it is determined whether the received current switch indicator light state signal value sw3 is correct. If it is correct, the corresponding function item driving instruction is continued to be sent to the regional controller, and the first count value of the first counter is cleared. If it is wrong, the value Button2 of the internal second switch state signal, the first count value of the first counter, and the second count value of the second counter are cleared.

[0138] It should be noted that in the scheme of the embodiment of the present application, a touch switch that can select three function items is used as an example for explanation. The number of function items that a touch switch can select is variable. Therefore, when a touch switch has more function items, many other variations or modifications that conform to the present application can still be directly derived according to the scheme of the present application. For example, if a touch switch can select N function items, when performing a division by four modulo operation based on the second count value of the updated second counter to update the value Button2 of the second switch state signal, the second count value of the second counter needs to be divided by N+1 to obtain the modulo, and correspondingly, the value range of the value Button2 of the second switch state signal is 0x0 to 0xN.

[0139] Figure 7This is an overall control flow chart of a switch control system provided in an embodiment of the present application. For example, taking a touch switch capable of selecting three function items as an example, the overall state machine flow of the touch switch control system includes the following steps:

[0140] Step S1, in the initial state, when the user short presses the switch, the regional controller collects the current level signal of the switch through the hard line, and sends the first switch state signal value Button1 corresponding to the collected short-press switch signal to the vehicle domain controller through the CAN bus through internal judgment. Assume that the vehicle domain controller receives a switch signal sent by the regional controller within a preset sampling period (such as 500ms) and changes to a rising edge once, that is, when the first switch state signal value Button1 is detected to jump from 0x0 to 0x1, the first count value of the first counter is added by 1 (the initial value is 0), and the second count value sw2 of the second counter is updated (sw2=0+sw1=1, initialized sw2=0), and the updated second count value sw2=1 is divided by 4 to obtain the remainder, and the second switch state signal value Button2=0X1 is updated according to the remainder 1, and the switch red indicator light is sent to the regional controller. Drive instruction.

[0141] In particular, assuming that the switch signal is detected to have N rising edge changes within 500ms, the first count value of the first counter is increased by N, N jumps are performed, and the corresponding switch indicator light on drive instruction is sent to the regional controller. For example, when the user short presses the switch twice in succession, the regional controller collects the switch signal through the hard line, and sends the first switch state signal value Button1 corresponding to the collected short press twice switch signal to the vehicle domain controller through the CAN bus through internal judgment. When the vehicle domain controller detects that the first switch state signal value Button1 jumps from 0x0 to 0x3, the first count value of the first counter is increased by 2 (the initial value is 0), 2 jumps are performed, and the second count value sw2 of the second counter is updated (sw2=0+sw1=2, initialized sw2=0), and the updated second count value sw2=2 is divided by 4 to obtain the remainder, and the second switch state signal value Button2=0X2 is updated according to the remainder 2; the corresponding switch yellow indicator light on drive instruction is sent to the regional controller.

[0142] Step S2: After receiving the red indicator light on driving instruction, the regional controller drives the switch indicator light to turn red through the hard line, and feeds back the current switch indicator light state signal value sw3 to the vehicle domain controller through the CAN bus. When the vehicle domain controller receives that the switch indicator light is in the red state, the first counter is cleared to 0.

[0143] Similarly, after receiving the yellow indicator light on drive command, the regional controller drives the switch indicator light to yellow through hard wire, and feeds back the current switch indicator light state signal value sw3 to the vehicle domain controller through the CAN bus. When the vehicle domain controller receives that the switch indicator light is in the yellow state, the first counter is cleared to 0.

[0144] Step S3, the vehicle domain controller sends the corresponding function item 1 drive command 1 to the regional controller through the CAN bus according to the updated second switch state signal value Button2=0X1; after receiving the command, the regional controller executes function item 1 through hard-line driving.

[0145] Similarly, the vehicle domain controller sends the corresponding function item 2 drive command 2 to the regional controller through the CAN bus according to the updated second switch state signal value Button2=0X2; after receiving the command, the regional controller executes function item 2 through hard-line driving.

[0146] Step S4, when the user short presses the switch again, the regional controller collects the current level signal of the switch through the hard line, and sends the first switch state signal value Button1 corresponding to the collected short-press switch signal to the vehicle domain controller through the CAN bus through internal judgment. When the switch signal sent by the regional controller is received within the preset sampling period (such as 500ms) and changes to a rising edge once, that is, when the first switch state signal value Button1 is detected to jump from 0x0 to 0x1, the first count value of the first counter is added by 1 (the initial value is 0), and the second count value sw2 of the second counter is updated (sw2=1+sw1=1, the second count value sw2 of the second counter after short pressing once in step S1 is updated to 1), and the updated second count value sw2=2 is divided by 4 to obtain the remainder, and the second switch state signal value Button2=0X2 is updated according to the remainder 2, and the switch yellow indicator light is sent to the regional controller. Drive instruction.

[0147] In particular, assuming that the switch signal is detected to have N rising edge changes within 500ms, the first count value of the first counter is increased by N, N jumps are performed, and the corresponding switch indicator light on drive instruction is sent to the regional controller. For example, after the user short-presses the switch once again in step S1, when the user short-presses the switch twice in succession, the regional controller collects the switch signal through the hard line, and sends the first switch state signal value Button1 corresponding to the collected short-pressed switch signal to the vehicle domain controller through the CAN bus through internal judgment. When the vehicle domain controller detects that the first switch state signal value Button1 jumps from 0x0 to 0x3, the first count value of the first counter is increased by 2 (the initial value is 0), 2 jumps are performed, and the second count value sw2 of the second counter is updated (sw2=1+sw1=2, the second count value sw2 of the second counter after short-pressing once in step S1 is updated to 1), and the updated second count value sw2=3 is divided by 4 to obtain the remainder, and the second switch state signal value Button2=0X3 is updated according to the remainder 3; and the corresponding switch green indicator light on drive instruction is sent to the regional controller.

[0148] Step S5: After receiving the yellow indicator light on drive instruction, the regional controller drives the switch indicator light to turn yellow through the hard line, and feeds back the current switch indicator light state signal value sw3 to the vehicle domain controller through the CAN bus.

[0149] Similarly, after the regional controller receives the green indicator light start drive command, it drives the switch indicator light to green through the hard line, and feeds back the current switch indicator light status signal value sw3 to the vehicle domain controller through the CAN bus.

[0150] Step S6, the vehicle domain controller sends the corresponding function item 1 drive command 1 to the regional controller through the CAN bus according to the updated second switch state signal value Button2=0X1; after receiving the command, the regional controller executes function item 1 through hard-line driving.

[0151] Similarly, the vehicle domain controller sends the corresponding function item 3 drive command 3 to the regional controller through the CAN bus according to the updated second switch state signal value Button2=0X3; after receiving the command, the regional controller executes function item 3 through hard-line driving.

[0152] Step S7, when the user short presses the switch again, the regional controller collects the current level signal of the switch through the hard line, and sends the first switch state signal value Button1 corresponding to the collected short-press switch signal to the vehicle domain controller through the CAN bus through internal judgment. When the switch signal received from the regional controller undergoes a rising edge change within the preset sampling period (such as 500ms), that is, when the first switch state signal value Button1 is detected to jump from 0x0 to 0x1, the first count value of the first counter is increased by 1 (the initial value is 0), and the second count value sw2 of the second counter is updated (sw2=2+sw1=1, the second count value sw2 of the second counter after short pressing once in step S4 is updated to 2), and the updated second count value sw2=3 is divided by 4 to obtain the remainder, and the second switch state signal value Button2=0X3 is updated according to the remainder 3, and the switch green indicator light is sent to the regional controller. Drive instruction.

[0153] In particular, assuming that the switch signal is detected to have N rising edge changes within 500ms, the first count value of the first counter is increased by N, N jumps are performed, and the corresponding switch indicator light on drive instruction is sent to the regional controller. For example, after the user short presses once in step S4, when the user short presses the switch twice in succession, the regional controller collects the switch signal through the hard line, and sends the first switch state signal value Button1 corresponding to the collected short press twice switch signal to the vehicle domain controller through the CAN bus through internal judgment. When the vehicle domain controller detects that the first switch state signal value Button1 jumps from 0x0 to 0x3, the first count value of the first counter is increased by 2 (the initial value is 0), 2 jumps are performed, and the second count value sw2 of the second counter is updated (sw2=2+sw1=2, the second count value sw2 of the second counter after short pressing once in step S4 is updated to 2), and the updated second count value sw2=4 is divided by 4 to obtain the remainder, and the second switch state signal value Button2=0X0 is updated according to the remainder 0; and the corresponding switch indicator light off instruction is sent to the regional controller.

[0154] Step S8: After receiving the green indicator light on driving instruction, the regional controller drives the switch indicator light to green through hard wire, and feeds back the current switch indicator light state signal value sw3 to the vehicle domain controller through the CAN bus. When the vehicle domain controller receives that the switch indicator light is in the green state, the first counter is cleared to 0.

[0155] Similarly, after receiving the instruction to turn off the indicator light, the regional controller drives the switch to turn off through the hard line, and feeds back the current switch indicator light state signal value sw3 to the vehicle domain controller through the CAN bus. When the vehicle domain controller receives that the switch indicator light is in the off state, the first counter is cleared to 0.

[0156] Step S9, the vehicle domain controller sends the corresponding function item 3 drive command 3 to the regional controller through the CAN bus according to the updated second switch state signal value Button2=0X3; after receiving the command, the regional controller executes function item 3 through hard-line driving.

[0157] Similarly, the vehicle domain controller sends the corresponding function item 4 drive command 4 to the regional controller through the CAN bus according to the updated second switch state signal value Button2=0X0; after receiving the command, the regional controller executes function item 4 through hard-line driving.

[0158] Step S10, when the user short presses the switch again, the regional controller collects the current level signal of the switch through the hard line, and sends the first switch state signal value Button1 corresponding to the collected short-press switch signal to the vehicle domain controller through the CAN bus through internal judgment. When the switch signal sent by the regional controller is received within the preset sampling period (such as 500ms) and changes to a rising edge once, that is, when the first switch state signal value Button1 is detected to jump from 0x0 to 0x1, the first count value of the first counter is increased by 1 (the initial value is 0), and the second count value sw2 of the second counter is updated (sw2=3+sw1=1, the second count value sw2 of the second counter after short pressing once in step S7 is updated to 3), and the updated second count value sw2=4 is divided by 4 to obtain the remainder, and the second switch state signal value Button2=0X0 is updated according to the remainder 0, and the switch indicator light off instruction is sent to the regional controller.

[0159] In particular, assuming that the switch signal is detected to have N rising edge changes within 500ms, the first count value of the first counter is increased by N, N jumps are performed, and the corresponding switch indicator light on drive instruction is sent to the regional controller. For example, after the user short presses once in step S7, when the user short presses the switch twice in succession, the regional controller collects the switch signal through the hard line, and sends the first switch state signal value Button1 corresponding to the collected short press twice switch signal to the vehicle domain controller through the CAN bus through internal judgment. When the vehicle domain controller detects that the first switch state signal value Button1 jumps from 0x0 to 0x3, the first count value of the first counter is increased by 2 (the initial value is 0), 2 jumps are performed, and the second count value sw2 of the second counter is updated (sw2=3+sw1=2, the second count value sw2 of the second counter after short pressing once in step S7 is updated to 3), and the updated second count value sw2=5 is divided by 4 to obtain the remainder, and the second switch state signal value Button2=0X1 is updated according to the remainder 1; and the switch red indicator light on drive instruction is sent to the regional controller.

[0160] Step S11: After receiving the instruction to turn off the indicator light, the regional controller drives the switch to turn off through the hard line, and feeds back the current switch indicator light state signal value sw3 to the vehicle domain controller through the CAN bus. When the vehicle domain controller receives that the switch indicator light is in the off state, the first counter is cleared to 0. The vehicle domain controller sends the corresponding function item 4 drive command 4 to the regional controller through the CAN bus according to the updated second switch state signal value Button2=0X0; after receiving the command, the regional controller executes function item 4 through the hard line drive.

[0161] Similarly, after the regional controller receives the red indicator light on drive command, it drives the switch indicator light to red through the hard line, and feeds back the current switch indicator light state signal value sw3 to the vehicle domain controller through the CAN bus. When the vehicle domain controller receives that the switch indicator light is in the red state, the first counter is cleared to 0. The vehicle domain controller sends the corresponding function item 1 drive command 1 to the regional controller through the CAN bus according to the updated second switch state signal value Button2=0X1; after receiving the command, the regional controller executes function item 1 through the hard line drive.

[0162] Step S12, when the regional controller executes the driving instruction of turning on the red indicator light of the switch, a fault occurs, the switch indicator light is not turned on or is not in the red state, and the current switch indicator light state is fed back to the vehicle domain controller. At this time, when the switch indicator light state received by the vehicle domain controller is not in the red state, the second switch state signal value Button2 is restored to the initial default state.

[0163] Step S13, when the regional controller executes the driving instruction of the yellow indicator light of the switch, a fault occurs, the switch indicator light is not turned on or is not in the yellow state, and the current switch indicator light state is fed back to the vehicle domain controller. At this time, when the switch indicator light state received by the vehicle domain controller is not in the yellow state, the second switch state signal value Button2 is restored to the initial default state.

[0164] Step S14, when the regional controller executes the driving instruction of the green indicator light of the switch, a fault occurs, the switch indicator light is not turned on or is not in the green state, and the current switch indicator light state is fed back to the vehicle domain controller. At this time, when the switch indicator light state received by the vehicle domain controller is not in the green state, the second switch state signal value Button2 is restored to the initial default state.

[0165] Step S15, when the user long presses the switch, the regional controller collects the current level signal of the switch through the hard line, and sends the collected long-press switch signal to the vehicle domain controller through the CAN bus through internal judgment. When the vehicle domain controller detects that the first switch state signal value Button1 jumps from 0x0 to 0x2, the first count value of the first counter is reduced by 1 (the initial value is 0), and jumps back one function item to jump to the switch indicator light off (assuming that the function item corresponding to the short press twice in step S10, that is, the switch indicator light indicates red).

[0166] Step S16: When the vehicle domain controller detects within 500ms that the switch signal sent by the regional controller has only one rising edge change and is in the 0x1 state for a long time within 500ms, the first count value of the first counter is increased by 1, and a corresponding switch red indicator light driving instruction is sent to the regional controller.

[0167] Step S17: When the vehicle domain controller detects that the switch signal sent by the regional controller has only one rising edge change within 500ms and is in the 0x1 state for a long time within 500ms, the first count value of the first counter is reduced by 1, and a corresponding switch yellow indicator light driving instruction is sent to the regional controller.

[0168] Figure 8 is a principle structure block diagram of a switch control system provided in the embodiment of the present application. Correspondingly, the present application also provides a switch control system, please refer to Figure 8 The switch control system at least includes: a first control module 10, a second control module 20, a function item driving module 30 and a switch 40; wherein the first control module 10 is provided with a first switch state signal; and the second control module 20 is provided with a second switch state signal; wherein the first control module 10 is used to collect the current level signal of the switch 40, and determine the current value of the first switch state signal according to the current level signal of the switch, and send the current value of the first switch state signal to the second control module 20; the second control module 20 is used to update the value of the second switch state signal according to the current value of the first switch state signal, and determine the corresponding function item driving instruction based on the updated value of the second switch state signal, and send the current function item driving instruction to the first control module 10; the first control module 10 is also used to drive the function item driving module according to the current function item driving instruction to control the switch 40 to execute the corresponding function item.

[0169] The technical solution of this embodiment provides a switch control system, which at least includes: a first control module, a second control module, a function item driving module and a switch; wherein the first control module is provided with a first switch state signal; wherein the second control module is provided with a second switch state signal; wherein the first control module is used to collect the current level signal of the switch, and determine the current value of the first switch state signal according to the current level signal of the switch, and send the current value of the first switch state signal to the second control module; the second control module is used to update the value of the second switch state signal according to the current value of the first switch state signal, and determine the corresponding function item driving instruction based on the updated value of the second switch state signal, and send the current function item driving instruction to the first control module; the first control module is also used to drive the function item driving module according to the current function item driving instruction to control the switch to execute the corresponding function item. Through this system, it can be achieved that: by cooperating with the first control module and the second control module, and by setting the first switch state signal and the second switch state signal to realize the maintenance of the state signal of the switch, the control of the switch has a memory retention function, and the switch is given multiple function items, so as to facilitate the user to customize the selection of function mode, improve the flexibility and versatility of the switch, and enhance the user experience.

[0170] In some embodiments, a first counter and a second counter are also provided in the second control module; the second control module is also used to determine whether a jump occurs according to the current value of the first switch state signal; if it is determined that the current value of the first switch state signal has jumped, the current first count value of the first counter, the current second count value of the second counter and the jump of the current value of the first switch state signal are obtained; the value of the second switch state signal is updated according to the jump of the current first count value, the current second count value and the current value of the first switch state signal.

[0171] Fig. 9 This is a principle structure diagram of another switch control system provided in the embodiment of the present application. Fig. 9, the switch control system also includes a switch indicator light 50; the switch indicator light 50 is connected to the first control module 10; the second control module 20 is also used to determine the drive instruction of the switch indicator light 50 and send it to the first control module 10 according to the value of the updated second switch state signal and the correspondence between the preset value of the second switch state signal and the drive instruction of the switch indicator light 50; the first control module 10 is also used to drive the switch indicator light 50 to perform a corresponding action according to the drive instruction of the switch indicator light 50 and collect the state signal value after the switch indicator light 50 performs the corresponding action, and send the state signal value after the switch indicator light performs the corresponding action to the second control module 20; wherein the corresponding action includes turning on the corresponding color or turning off the switch indicator light; the second control module 20 is also used to determine whether the switch indicator light state signal value corresponds correctly to the drive instruction of the switch indicator light, and when the correspondence is correct, determine the function item drive instruction of the function item drive module according to the drive instruction of the switch indicator light.

[0172] The switch indicator light may be a single indicator light that is controlled by a program to display different colors, or a group of indicator lights of different colors. The specific setting may be based on actual conditions and is not specifically limited here.

[0173] In some embodiments, the second control module is also used to preset the correspondence between the value of the second switch state signal and the function item driving instruction; obtain the updated value of the second switch state signal; and determine the function item driving instruction corresponding to the value of the second switch state signal.

[0174] In some embodiments, a first counter and a second counter are also provided in the second control module; the second control module is also used to: determine whether a jump occurs according to the current value of the first switch state signal; if it is determined that the current value of the first switch state signal has jumped, obtain the current first count value of the first counter, the current second count value of the second counter and the jump of the current value of the first switch state signal; update the value of the second switch state signal according to the current first count value, the current second count value and the jump of the current value of the first switch state signal.

[0175] In some embodiments, the second control module is also used for: when the current numerical value of the first switch state signal jumps, updating the current first count value of the first counter according to the current first count value, the jump of the current numerical value of the first switch state signal, and the correspondence between the preset first count value and the numerical jump of the first switch state signal; updating the second count value of the second counter according to the current second count value of the second counter and the updated current first count value of the first counter; updating the current numerical value of the second switch state signal according to the preset update mechanism and the updated second count value of the second counter.

[0176] In some embodiments, the preset update mechanism includes: a correspondence between a preset remainder and a numerical value of the second switch state signal; dividing the second count value of the updated second counter by four and taking the remainder; and determining the current numerical value of the second switch state signal based on the correspondence between the remainder and the numerical value of the second switch state signal.

[0177] In some embodiments, the switch control system further includes a switch indicator light, which is connected to the first control module. The second control module is further used to determine the drive instruction of the switch indicator light and send it to the first control module based on the value of the updated second switch state signal and the correspondence between the preset value of the second switch state signal and the drive instruction of the switch indicator light. The first control module is further used to drive the switch indicator light to perform a corresponding action according to the drive instruction of the switch indicator light and collect the state signal value after the switch indicator light performs the corresponding action, and send the state signal value after the switch indicator light performs the corresponding action to the second control module; wherein the corresponding action includes turning on the corresponding color or turning off the switch indicator light. The second control module is further used to determine whether the value of the switch indicator light state signal correctly corresponds to the drive instruction of the switch indicator light, and when the correspondence is correct, determine the function item drive instruction of the function item drive module according to the drive instruction of the switch indicator light.

[0178] In some embodiments, the second control module is also used to clear the value of the first counter, the value of the second counter and the value of the second switch state signal when the value of the switch indicator light state signal corresponds incorrectly to the driving instruction of the switch indicator light.

[0179] In some embodiments, the first control module is further used to determine the current value of the first switch state signal according to the current level signal of the switch and the corresponding relationship between the preset switch level signal and the value of the first switch state signal.

[0180] In some embodiments, the first control module is also used to determine whether the current level signal of the switch has a falling edge. If the current level signal of the switch does not have a falling edge, the current value of the first switch state signal is 0X0; if the current level signal of the switch has a falling edge, the falling edge timing is started, and when a rising edge appears, the falling edge timing is stopped and the rising edge timing is started; if the duration of the falling edge is greater than the first preset duration, the current value of the first switch state signal is 0X2; if the duration of the falling edge is less than or equal to the first preset duration, and within the duration of the rising edge is less than or equal to the second preset duration, it is determined whether the falling edge appears again; if the falling edge appears again, the current value of the first switch state signal is 0X3; if the falling edge does not appear again, the current value of the first switch state signal is 0X1.

[0181] Correspondingly, an embodiment of the present application further provides a driving device, which includes the switch control system described in any embodiment of the present application.

[0182] The driving device may be a car, an engineering vehicle, etc., and may be specifically configured according to actual conditions, and no specific limitation is made herein.

[0183] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0184] The switch control system, control method and driving device provided in the embodiments of the present application are introduced in detail above, and the principles and implementation methods of the present application are explained by using specific examples. The description of the above embodiments is only used to help understand the technical solution and core idea of ​​the present application. Ordinary technicians in this field should understand that they can still modify the technical solutions recorded in the aforementioned embodiments, or replace some of the technical features therein with equivalents; and these modifications or replacements do not make the essence of the corresponding technical solution deviate from the scope of the technical solution of the embodiments of the present application.

Claims

1. A control method, characterized in that: The switch control system is executed by the switch control system, which at least includes: a first control module, a second control module, a function item driving module and a switch; wherein the first control module is provided with a first switch state signal; the second control module is provided with a second switch state signal; The method comprises: The first control module collects the current level signal of the switch, determines the current value of the first switch state signal according to the current level signal of the switch, and sends the current value of the first switch state signal to the second control module; The second control module updates the value of the second switch state signal according to the current value of the first switch state signal, determines the corresponding function item drive instruction based on the updated value of the second switch state signal, and sends the current function item drive instruction to the first control module; The first control module drives the function item driving module according to the current function item driving instruction to control the switch to execute the corresponding function item.

2. The control method according to claim 1, characterized in that: The determining of the corresponding function item driving instruction based on the updated value of the second switch state signal includes: Presetting a corresponding relationship between the value of the second switch state signal and the function item driving instruction; Obtaining an updated value of the second switch state signal; Determine a function item driving instruction corresponding to the value of the second switch state signal.

3. The control method according to claim 1, characterized in that: The second control module is also provided with a first counter and a second counter; The updating of the value of the second switch state signal according to the current value of the first switch state signal comprises: The second control module determines whether a jump occurs according to the current value of the first switch state signal; If it is determined that the current value of the first switch state signal changes, obtaining the current first count value of the first counter, the current second count value of the second counter, and the change of the current value of the first switch state signal; The value of the second switch state signal is updated according to the jump condition of the current first count value, the current second count value and the current value of the first switch state signal.

4. The control method according to claim 3, characterized in that: The updating of the current value of the second switch state signal according to the jump condition of the current first count value, the current second count value and the current value of the first switch state signal includes: When the current value of the first switch state signal changes, the current first count value of the first counter is updated according to the current first count value, the change of the current value of the first switch state signal, and the corresponding relationship between the preset first count value and the value change of the first switch state signal; updating a second count value of the second counter according to a current second count value of the second counter and an updated current first count value of the first counter; The current value of the second switch state signal is updated according to a preset update mechanism and the updated second count value of the second counter.

5. The control method according to claim 4, characterized in that: The preset update mechanism includes: a correspondence between a preset remainder and a value of the second switch state signal; Divide the updated second count value of the second counter by four and take the remainder; The current value of the second switch state signal is determined according to the corresponding relationship between the remainder and the value of the second switch state signal.

6. The control method according to claim 4, characterized in that: The switch control system further includes a switch indicator light, which is connected to the first control module; The step of determining the corresponding function item driving instruction based on the updated value of the second switch state signal includes: The second control module determines the driving instruction of the switch indicator light and sends it to the first control module according to the updated value of the second switch state signal and the corresponding relationship between the preset value of the second switch state signal and the driving instruction of the switch indicator light; The first control module drives the switch indicator light to perform a corresponding action according to the driving instruction of the switch indicator light and collects the state signal value after the switch indicator light performs the corresponding action, and sends the state signal value after the switch indicator light performs the corresponding action to the second control module; wherein the corresponding action includes turning on a corresponding color or turning off the switch indicator light; The second control module determines whether the value of the switch indicator light state signal correctly corresponds to the drive instruction of the switch indicator light, and if the correspondence is correct, determines the function item drive instruction of the function item drive module according to the drive instruction of the switch indicator light.

7. The control method according to claim 6, characterized in that: Also includes: When the value of the switch indicator light state signal corresponds incorrectly to the driving instruction of the switch indicator light, the second control module clears the value of the first counter, the value of the second counter and the value of the second switch state signal.

8. The control method according to claim 1, characterized in that: Determining the current value of the first switch state signal according to the current level signal of the switch includes: The current value of the first switch state signal is determined according to the current level signal of the switch and the corresponding relationship between the preset switch level signal and the value of the first switch state signal.

9. The control method according to claim 8, characterized in that: Determining the current value of the first switch state signal according to the current level signal of the switch and the corresponding relationship between the preset switch level signal and the value of the first switch state signal includes: Set the first preset duration and the second preset duration; Determine whether the current level signal of the switch has a falling edge, if the current level signal of the switch does not have a falling edge, the current value of the first switch state signal is the first value; If the current level signal of the switch has a falling edge, the falling edge timing is started, and when a rising edge appears, the falling edge timing is stopped and the rising edge timing is started; If the duration of the falling edge timing is greater than the first preset duration, the current value of the first switch state signal is updated to a third value; If the duration of the falling edge timing is less than or equal to the first preset duration, and the duration of the rising edge timing is greater than the second preset duration, the current value of the first switch state signal is updated to the second value; If the duration of the falling edge timing is less than or equal to the first preset duration, and when the duration of the rising edge timing is less than or equal to the second preset duration, determine whether a falling edge appears again; if a falling edge appears again, the current value of the first switch state signal is updated to the fourth value; if a falling edge does not appear again, the current value of the first switch state signal is updated to the second value.

10. A switch control system, characterized in that: At least: A first control module, a second control module, a function item driving module and a switch; wherein a first switch state signal is provided in the first control module; and a second switch state signal is provided in the second control module; The first control module is used to collect the current level signal of the switch, determine the current value of the first switch state signal according to the current level signal of the switch, and send the current value of the first switch state signal to the second control module; The second control module is used to update the value of the second switch state signal according to the current value of the first switch state signal, determine the corresponding function item drive instruction based on the updated value of the second switch state signal, and send the current function item drive instruction to the first control module; The first control module is further configured to drive the function item driving module according to the current function item driving instruction, so as to control the switch to execute the corresponding function item.

11. The switch control system according to claim 10, characterized in that: The second control module is also provided with a first counter and a second counter; the second control module is also used to determine whether a jump occurs according to the current value of the first switch state signal; If it is determined that the current value of the first switch state signal changes, obtaining the current first count value of the first counter, the current second count value of the second counter, and the change of the current value of the first switch state signal; The value of the second switch state signal is updated according to the jump condition of the current first count value, the current second count value and the current value of the first switch state signal.

12. The switch control system according to claim 11, characterized in that: It also includes a switch indicator light; the switch indicator light is connected to the first control module; The second control module is further used to determine the driving instruction of the switch indicator light and send it to the first control module according to the updated value of the second switch state signal and the corresponding relationship between the preset value of the second switch state signal and the driving instruction of the switch indicator light; The first control module is further used to drive the switch indicator light to perform a corresponding action according to the driving instruction of the switch indicator light and collect the state signal value after the switch indicator light performs the corresponding action, and send the state signal value after the switch indicator light performs the corresponding action to the second control module; wherein the corresponding action includes turning on a corresponding color or turning off the switch indicator light; The second control module is also used to determine whether the value of the switch indicator light status signal correctly corresponds to the drive instruction of the switch indicator light, and when the correspondence is correct, determine the function item drive instruction of the function item drive module according to the drive instruction of the switch indicator light.

13. A driving device, characterized in that: Comprising the switch control system according to any one of claims 10-12.