Signal processing method and device, electronic equipment and storage medium
By judging the user click type and determining the issuance time based on the preset frequency cycle, the setting signal response delay and system stability problems caused by frequent clicks are solved, and the user experience and system stability are improved.
Patent Information
- Application Number
- CN202411353438.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-26
- Publication Date
- 2024-12-13
AI Technical Summary
The prior art, when users frequently click on electronic device controls, leads to delayed response of setting signals, affects system stability, poor user experience, and lacks feedback during continuous clicking.
By determining whether the user click is a subsequent click, if it is a single click or the first click in a continuous click, the setting signal will be sent directly; if it is a subsequent click, the issuance time will be determined based on the preset frequency cycle to avoid continuous quick clicks System overload ensures that users receive feedback.
Reduces the delay in setting signal response, improves user experience, avoids system overload, and ensures system stability and continuity of user interaction.
Smart Images

Figure CN119127037A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of signal processing, and more specifically, to a signal processing method, device, electronic device and storage medium in the field of signal processing. Background Art
[0002] Usually, when a user clicks a control on the display page of an electronic device, the control triggers the corresponding setting signal. The setting signal needs to be transmitted to the middleware through the application layer, and then transmitted to the controller by the middleware, and then sent to the underlying hardware by the controller. There is a certain time difference from when the control is clicked to when the underlying layer responds to the setting signal triggered by the control. Users may frequently operate the same control multiple times to achieve their own control needs.
[0003] In the prior art, there are several methods for processing the setting signal triggered by a user clicking a control: the first method is to detect that a user clicks a control and immediately send the setting signal triggered by the control; the second method is to start a delayed task to delay sending the setting signal triggered by this click when a user clicks a control. During the delay process, each time a user click is detected, the last delayed task is canceled and the delayed task is restarted. When the delayed task is completed, the setting signal triggered by the last user click is sent.
[0004] However, the first prior art will send multiple setting signals when the user frequently operates the same control, which has a negative impact on the stability of the system. The second prior art only sends the setting signal of the last click when the user frequently operates multiple times, and there is no feedback on the user's operations during continuous clicks, resulting in a poor user interaction experience. Moreover, if the user only clicks once in the second prior art, there is a problem of delayed signal sending, which is also likely to lead to a poor user experience. Summary of the invention
[0005] The present application provides a signal processing method, device, electronic device and storage medium, which can reduce the setting signal response delay, so that users can experience faster and more direct feedback, improve the user experience, and avoid system overload or erroneous response caused by continuous and rapid clicks, thereby ensuring system stability.
[0006] In a first aspect, a signal processing method is provided, the method comprising: upon detecting that a user performs a current click on a control, determining whether the current click is a subsequent click; wherein the subsequent click is a click other than the first click in continuous clicks; upon determining that the current click is not a subsequent click, sending a setting signal triggered by the control based on the current click to the underlying hardware; upon determining that the current click is a subsequent click, determining a sending time based on a cycle duration of a preset frequency; determining a setting signal triggered by the control most recently from the sending time as a target setting signal; and sending the target setting signal to the underlying hardware at the sending time.
[0007] In the above technical solution, it is determined whether the current click is a click other than the first click in the continuous click, that is, the subsequent click. When it is determined that the current click is not a subsequent click, the setting signal triggered by the current click is directly sent to the underlying hardware. The current click is not a subsequent click, that is, the current click is a single click or the first click in the continuous click. In this case, the setting signal is directly sent, so that the single click is not delayed and the first click in the continuous click is sent, which reduces the response delay and enables the user to experience faster and more direct feedback. When it is determined that the current click is a subsequent click, according to the sending time determined by the preset frequency, the setting signal triggered by the most recent click control from the sending time is sent to the underlying hardware, so that the setting signal is sent based on the preset frequency during the continuous click process, avoiding system overload or erroneous response caused by continuous fast clicks and frequent sending of setting signals, and ensuring system stability. When clicking continuously, users usually expect feedback. By sending the setting signal at the sending time determined by the preset frequency, user operations can be responded to during the continuous click process, feedback can be provided to the user, and the user's interactive experience is improved.
[0008] In combination with the first aspect, in some possible implementations, when it is detected that the user currently clicks on the control, it is determined whether the current click is a subsequent click, including: taking the moment when the user's current click on the control is detected as the first moment; obtaining the interval duration between the first moment and the second moment; wherein the second moment is the moment when a setting signal is most recently sent to the underlying hardware from the first moment; when the interval duration is less than the cycle duration, determining that the current click is a subsequent click.
[0009] In the above technical solution, by judging whether the current click is within the period of the preset frequency through the interval between the first moment of the current click and the second moment of the last setting signal being sent, it is determined whether the current click is a subsequent click. The difference between a subsequent click and a first click or a single click can be cleverly distinguished, making it easy to directly send the setting signal triggered by the control when the current click is determined to be the first click or a single click, ensuring the timely sending of the setting signal for the first click and the single click, and improving the user experience. When the current click is a subsequent click, the setting signal is sent based on the preset frequency to ensure the stability of the system.
[0010] In combination with the first aspect and the above-mentioned implementation method, in some possible implementation methods, when it is determined that the current click is a subsequent click, the sending time is determined based on the cycle duration of the preset frequency, including: starting timing from the first moment to obtain a first timing duration; when it is determined that the current click is a subsequent click, subtracting the interval duration from the cycle duration to obtain the target duration; and determining the moment when the first timing duration is equal to the target duration as the sending time.
[0011] In the above technical solution, there is a certain interval between the first moment of the user's current click on the control and the second moment of the last sending of the setting signal. When determining the sending time, the interval duration is subtracted from the cycle duration to obtain the target duration from the first moment of the current click to the sending time, and the timing is performed. When the timing duration is equal to the target duration, the sending time is determined. Taking into account the interval duration between the current click and the last sending of the setting signal, the sending time is accurately calculated, the sending frequency is guaranteed to be the preset frequency, and the system stability is further improved.
[0012] In combination with the first aspect and the above-mentioned implementation methods, in some possible implementation methods, the setting signal triggered by the control most recently from the time of issuance is determined as the target setting signal, including: when the first timing duration is less than the target duration, the setting signal triggered by the control is stored in a preset storage space in the order from the trigger time from front to back; when the first timing duration is equal to the target duration, the setting signal last stored in the storage space is determined as the target setting signal.
[0013] In combination with the first aspect and the above-mentioned implementation methods, in some possible implementation methods, when it is detected that the user performs a current click on the control, the method also includes: obtaining the current state of the control; recording the value corresponding to the current state in a predefined cache variable; wherein, when the control is not currently clicked, the value corresponding to the original state of the control is recorded in the cache variable; when it is monitored that the value recorded in the cache variable changes, updating the display state of the control on the display interface based on the current state.
[0014] In the above technical solution, by setting a cache variable, recording the state of the control after each click of the control, and updating the display state of the control on the display interface based on the cache variable, it can be ensured that the actual state of the control is synchronized with its performance on the display interface, so that the display state of the control on the interface can quickly respond to the user's interactive operations, thereby enhancing the responsiveness of the display interface and improving the user's interactive experience.
[0015] In combination with the first aspect and the above-mentioned implementation methods, in some possible implementation methods, the method also includes: if an underlying signal of underlying hardware feedback is received when the state machine corresponding to the control is in a processing state, the underlying signal is ignored, and the state machine is detected whether it is switched to a normal state; wherein the state machine switches to a processing state when detecting a current click of the user on the control, and the underlying signal is used to indicate the actual state of the control; when detecting that the state machine switches to a normal state, a real-time underlying signal of underlying hardware feedback is obtained, and the value recorded in the cache variable is updated based on the real-time underlying signal.
[0016] In the above technical solution, the setting state machine switches to the processing state when the setting signal is triggered, and ignores the underlying signal of the underlying hardware feedback received when the state machine is in the processing state. It can be achieved that when the setting signal is not responded, the value recorded in the cache variable is not updated based on the underlying signal, avoiding the rebound of the control display state, and also avoiding the influence of the disordered feedback signal generated by the underlying hardware on the control state when the control is operated by multiple terminals. Actively obtain the real-time underlying signal when the state machine is in the normal state to achieve the unity of the control state and the actual state of the underlying hardware.
[0017] In combination with the first aspect and the above-mentioned implementation methods, in some possible implementation methods, detecting whether the state machine has switched to the normal state includes: when detecting that the user currently clicks on the control, starting timing to obtain a second timing duration; determining an additional duration between the first moment of the current click and the sending moment; adding the basic delay duration to the additional duration to obtain a target delay duration; and when detecting that the second timing duration is equal to the target delay duration, determining that the state machine has switched to the normal state.
[0018] In the above technical solution, timing starts when it is detected that the user has currently clicked on the control, and the timing duration is obtained. The time difference between the current click and the sending moment is calculated to obtain the additional duration, and the additional duration is added to the basic delay duration to obtain the target delay duration. Based on the target delay duration and the timing duration, it is determined whether the state machine has switched from the processing state to the normal state. When the additional duration between the current click and the sending moment is different, the delay duration of the determined delay task is different. Considering that when the setting signal triggered by the current click is sent based on the preset frequency, there is a time difference between the triggering moment and the sending moment, which may affect the maintenance time of the state machine in the processing state, ensuring that the state machine can be accurately judged from the processing state to the normal state under different circumstances.
[0019] In summary, the present application can cleverly distinguish whether the current click is a subsequent click, the first click, or a single click by comparing the interval between the first moment of the current click and the second moment of the last sending of the setting signal with the period of the preset frequency. When the current click is a single click or the first click in continuous clicks, the setting signal is directly sent, so that a single click is not delayed and the first click in continuous clicks is sent, reducing response delays, allowing users to experience faster and more direct feedback. When it is determined that the current click is a subsequent click, it is sent at the preset frequency to avoid system overload or erroneous response caused by continuous and rapid clicks and frequent sending of setting signals, thereby ensuring system stability. Taking into account the interval between the current click and the last sending of the setting signal, the sending time is accurately calculated, ensuring that the sending frequency is the preset frequency, and further improving system stability. Setting cache variables, recording the state of the control after each click, and updating the display state of the control on the display interface based on the cache variables can ensure that the actual state of the control is synchronized with its performance on the display interface, so that the display state of the control on the interface can quickly respond to user interaction operations, enhance the responsiveness of the display interface, and improve the user's interactive experience. Considering that when the setting signal triggered by the current click is sent based on the preset frequency, the time difference between the triggering moment and the sending moment may affect the maintenance time of the state machine in the processing state, the target delay duration is determined to ensure that the state machine can accurately judge the transition from the processing state to the normal state under different circumstances.
[0020] In a second aspect, a signal processing device is provided, which includes: a judgment module, which is used to judge whether the current click is a subsequent click when detecting that the user is currently clicking on the control; wherein the subsequent click is other clicks in the continuous clicks except the first click; a first sending module, which is used to send the setting signal triggered by the control based on the current click to the underlying hardware when it is determined that the current click is not a subsequent click; a first determination module, which is used to determine the sending time based on the cycle duration of a preset frequency when it is determined that the current click is a subsequent click; a second determination module, which is used to determine the setting signal triggered by the control most recently from the sending time as the target setting signal; and a second sending module, which is used to send the target setting signal to the underlying hardware at the sending time.
[0021] In combination with the second aspect, in some possible implementations, the judgment module is specifically used to take the moment when the user's current click on the control is detected as the first moment; obtain the interval between the first moment and the second moment; wherein the second moment is the moment when the setting signal is most recently sent to the underlying hardware from the first moment; when the interval duration is less than the cycle duration, determine that the current click is a subsequent click.
[0022] In combination with the second aspect and the above-mentioned implementation methods, in some possible implementation methods, the first determination module is specifically used to start timing from a first moment to obtain a first timing duration; when it is determined that the current click is a subsequent click, subtract the interval duration from the cycle duration to obtain the target duration; and determine the moment when the first timing duration is equal to the target duration as the sending moment.
[0023] In combination with the second aspect and the above-mentioned implementation methods, in some possible implementation methods, the second determination module is specifically used to, when the first timing duration is less than the target duration, store the setting signal triggered by the control in a preset storage space in the order from the trigger time from front to back; when the first timing duration is equal to the target duration, determine the setting signal last stored in the storage space as the target setting signal.
[0024] In combination with the second aspect and the above-mentioned implementation methods, in some possible implementation methods, the device also includes: an acquisition module, used to obtain the current state of the control; a recording module, used to record the value corresponding to the current state into a predefined cache variable; wherein, when the control is not currently clicked, the value corresponding to the original state of the control is recorded in the cache variable; an update module, used to update the display state of the control on the display interface based on the current state when it is monitored that the value recorded in the cache variable changes.
[0025] In combination with the second aspect and the above-mentioned implementation methods, in some possible implementation methods, the device also includes: a detection module, which is used to ignore the underlying signal and detect whether the state machine is switched to a normal state if the underlying signal of the underlying hardware feedback is received when the state machine corresponding to the control is in a processing state; wherein the state machine switches to the processing state when detecting the user's current click on the control, and the underlying signal is used to indicate the actual state of the control; an update module, which is also used to obtain the real-time underlying signal of the underlying hardware feedback when detecting that the state machine switches to the normal state, and update the value recorded in the cache variable based on the real-time underlying signal.
[0026] In combination with the second aspect and the above-mentioned implementation methods, in some possible implementation methods, the detection module is specifically used to start timing when detecting that the user currently clicks on the control to obtain a second timing duration; determine the additional duration between the first moment of the current click and the issuance moment; add the basic delay duration to the additional duration to obtain the target delay duration; and when detecting that the second timing duration is equal to the target delay duration, determine that the state machine switches to a normal state.
[0027] In a third aspect, an electronic device is provided, comprising a memory and a processor. The memory is used to store executable program code, and the processor is used to call and run the executable program code from the memory, so that the electronic device executes the method in the first aspect or any possible implementation of the first aspect.
[0028] In a fourth aspect, a computer program product is provided, comprising: a computer program code, which, when executed on a computer, enables the computer to execute the method in the first aspect or any possible implementation of the first aspect.
[0029] In a fifth aspect, a computer-readable storage medium is provided, which stores a computer program code. When the computer program code runs on a computer, the computer executes the method in the above-mentioned first aspect or any possible implementation manner of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 It is a schematic flowchart of a signal processing method provided in an embodiment of the present application.
[0031] Figure 2 It is a flow chart of a signal processing provided in an embodiment of the present application.
[0032] Figure 3 It is a structural schematic diagram of a signal processing device provided in an embodiment of the present application.
[0033] Figure 4It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0034] The technical solution in the present application will be described clearly and in detail below in conjunction with the accompanying drawings. In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B: "and / or" in the text is only a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "multiple" means two or more than two.
[0035] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as suggesting or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features.
[0036] In the prior art, there are several methods for processing the setting signal triggered by a user clicking a control on the display interface of an electronic device: the first method is to detect a click on the control and immediately send the setting signal; the second method is to delay sending the setting signal when a click on the control is detected, and during the delay process, each time a click is detected, the previous delayed task is canceled and the delayed task is restarted, so that only the setting signal of the last click is sent when a quick click is performed.
[0037] However, the first prior art sends multiple setting signals when the user frequently operates the same control, which has a negative impact on the stability of the system. The second prior art only sends the setting signal of the last click when clicking quickly, and there is no feedback on the operation during the continuous clicking process, which has a poor user experience. In addition, if only one click occurs, there is a problem of delayed signal sending, which is also likely to lead to a poor user experience.
[0038] Based on this, the present application proposes a signal processing method, which is applied to electronic devices and can reduce signal response delay, so that users can experience faster and more direct feedback, improve user experience, and avoid system overload or erroneous response caused by continuous and rapid clicks, thereby ensuring system stability.
[0039] The above-mentioned electronic devices can specifically be mobile phones, tablets, computers, vehicles, etc. It is understandable that with the development of technology, the functions of vehicles are increasing, and the control methods of vehicles are also constantly evolving. In order to improve user experience and operational convenience, more and more vehicles are integrating control controls on the vehicle's central control screen. This trend of integration not only makes the operation of the vehicle more intuitive and convenient, but also provides a basis for the intelligence and automation of the vehicle. Users can trigger the setting signal by clicking the controls on the central control screen to control the vehicle to achieve related functions.
[0040] Figure 1 It is a schematic flowchart of a signal processing method provided in an embodiment of the present application.
[0041] For example, Figure 1 As shown, the method 100 includes:
[0042] Step 101, when detecting that the user currently clicks the control, determining whether the current click is a subsequent click;
[0043] Among them, subsequent clicks are other clicks in the continuous clicks except the first click.
[0044] Step 102, when it is determined that the current click is not a subsequent click, a setting signal of the control triggered based on the current click is sent to the underlying hardware;
[0045] Step 103, when it is determined that the current click is a subsequent click, determining the sending time based on the periodic duration of the preset frequency;
[0046] Step 104, determining the setting signal triggered by the control most recently from the sending moment as the target setting signal;
[0047] Step 105: at the time of sending, send the target setting signal to the underlying hardware.
[0048] exist Figure 1In the embodiment shown, it is determined whether the current click is a click other than the first click in the continuous click, that is, the subsequent click. When it is determined that the current click is not a subsequent click, the setting signal triggered by the current click is directly sent to the underlying hardware. The current click is not a subsequent click, that is, the current click is a single click or the first click in the continuous click. In this case, the setting signal is directly sent, so that the single click is not delayed and the first click in the continuous click is sent, which reduces the response delay and enables the user to experience more rapid and direct feedback. When it is determined that the current click is a subsequent click, according to the sending time determined by the preset frequency, the setting signal triggered by the last click control at the sending time is sent to the underlying hardware, so that the setting signal is sent based on the preset frequency during the continuous click process, avoiding system overload or error response caused by continuous fast clicks and frequent sending of setting signals, and ensuring system stability. When clicking continuously, users usually expect feedback. By sending the setting signal at the sending time determined by the preset frequency, user operations can be responded to during the continuous click process, feedback can be provided to the user, and the user's interactive experience is improved.
[0049] Below Figure 1 The specific implementation of each step in the embodiment shown is described as follows:
[0050] In step 101, the control is a soft switch displayed on the display interface of the electronic device for the user to interact with the electronic device, such as a button, a slide bar, a text box, etc. In the embodiment of the present application, the control is a button as an example for description.
[0051] The electronic device may specifically be a tablet, a mobile phone or other electronic device. In some embodiments, the electronic device may also be a vehicle. It is understandable that a central control screen is usually provided in front of the vehicle, and buttons for controlling various functions of the vehicle are integrated on the display interface of the central control screen. Specifically, these buttons may be concentrated in upper-layer applications related to various functions, such as air conditioning setting applications, window setting applications, seat setting applications, etc. The user may display the corresponding buttons for controlling the vehicle to achieve the target function on the display interface of the central control screen by opening the application of the target function.
[0052] In some embodiments, when the electronic device is a vehicle, the vehicle also includes multiple control screens such as a co-pilot screen, an armrest screen, a ceiling screen, and a seatback screen. Buttons controlling the same function may be integrated into the above-mentioned co-pilot screen, armrest screen, ceiling screen, seatback screen, and other control screens.
[0053] When the display screen of the electronic device is capacitive, the user's click action can be detected based on the voltage change when the user touches the display screen. When the display screen of the electronic device is infrared, the user's click action can be detected by detecting the infrared reflection of the user's finger.
[0054] Continuous clicks include the first click and other clicks except the first click, and subsequent clicks refer to other clicks in the continuous clicks except the first click.
[0055] By the interval time between the current click and the last click, it can be determined whether the current click is a subsequent click. Exemplarily, when the interval time between the current click and the last click is less than a preset time, the current click is determined to be a subsequent click.
[0056] When the user clicks on a control, the control triggers a corresponding setting signal, which needs to be sent to the underlying hardware for response to implement the control corresponding to the user's click operation.
[0057] In one possible implementation, when it is detected that the user currently clicks on the control, it is determined whether the current click is a subsequent click, including: taking the moment when the user currently clicks on the control is detected as the first moment; obtaining the interval duration between the first moment and the second moment; wherein the second moment is the moment when a setting signal is most recently sent to the underlying hardware from the first moment; and when the interval duration is less than the cycle duration, determining that the current click is a subsequent click.
[0058] The cycle duration is the time interval between preset frequencies, which can be used to determine whether the current click is a subsequent click.
[0059] When the user clicks on the control, the control will generate a corresponding setting signal. For example, if the control is a button to turn on the air conditioner, when the user clicks on the button, the button triggers the setting signal to turn on the air conditioner. At this time, the setting signal needs to be sent down to the underlying hardware for response to control the air conditioner to turn on. In some embodiments, the underlying hardware can also be referred to as the counterpart.
[0060] The moment when the user's current click operation on the control is detected is recorded as the first moment. Before the user's current click on the control, the user may have clicked the control, causing the setting signal triggered by the control to be sent to the underlying hardware. For example, the electronic device is a vehicle, and the user clicked the button on the central control screen to turn on the air conditioner when driving the vehicle last time. At this time, the moment when the setting signal was sent most recently from the first moment (that is, the last time the setting signal triggered by the control was sent) is determined and recorded as the second moment.
[0061] Subtract the second moment from the first moment to get the interval length between the first moment and the second moment, that is, the interval length between the current click and the most recently sent setting signal. When the interval length is less than the cycle length of the preset frequency, the current click is within a new cycle of the preset frequency, and the current click can be determined to be a subsequent click. It can also be determined that the last sent setting signal may be the first click of continuous clicks, or it may be sent in the previous cycle of the preset frequency. When the interval length is greater than or equal to the cycle length, it can be determined that the interval between the last sent setting signal and the current click is long, and the current click is not within the cycle of the preset frequency, and it can be determined that the current click is not a subsequent click.
[0062] It is understandable that when the current click is the first click of continuous clicks, the last setting signal sent is usually the setting signal sent for a single click or the setting signal sent for the last time after the last continuous clicks, and the interval between the two is usually large, much longer than the cycle duration of the preset frequency. When the current click is a single click, the last setting signal sent is usually the setting signal sent for the last single click or the setting signal sent for the last time after the last continuous clicks, and the interval between the two is usually large, much longer than the cycle duration of the preset frequency. Therefore, the current click is not a subsequent click, including two situations: the current click is a single click and the current click is the first click in continuous clicks.
[0063] In some embodiments, a first timer may be provided in the electronic device, and each time a setting signal is detected to be sent to the underlying hardware, the time in the first timer may be reset to zero and the timer may be started. When a user clicks the control, the duration in the first timer may be obtained to obtain the interval duration.
[0064] In the above method, by judging whether the current click is within the period of the preset frequency through the interval between the first moment of the current click and the second moment of the last setting signal being sent, it is determined whether the current click is a subsequent click. The difference between a subsequent click and a first click or a single click can be cleverly distinguished, making it easy to directly send the setting signal triggered by the control when the current click is determined to be the first click or a single click, ensuring the timely sending of the setting signal for the first click and the single click, and improving the user experience. When the current click is a subsequent click, the setting signal is sent based on the preset frequency to ensure the stability of the system.
[0065] In one possible implementation, when it is detected that the user has currently clicked on the control, the method also includes: obtaining the current state of the control; recording the value corresponding to the current state in a predefined cache variable; wherein, when the control is not currently clicked, the value corresponding to the original state of the control is recorded in the cache variable; and when it is detected that the value recorded in the cache variable has changed, updating the display state of the control on the display interface based on the current state.
[0066] It is understandable that a control may include multiple states, and different states of a control usually correspond to different display states on the display interface. For example, if the control is a button for controlling an air conditioner switch, including two states, on and off, then the display state of the corresponding control on the display interface also includes two states, for example, the display state corresponding to the on state is "turn on the air conditioner", and the display state corresponding to the off state is "turn off the air conditioner".
[0067] The cache variable is a variable defined in advance to record the current state of the control. Each time a user clicks on a control, the current state of the control is recorded in the cache variable. Before the user clicks on the control, the cache variable usually records the original state of the control before it is clicked. When the user clicks on the control, the control switches from the original state to the current state. The current state of the control after the user clicks on the control can be obtained, and the original state recorded in the cache variable is updated to the current state, so that the current state is recorded in the cache variable.
[0068] In some embodiments, different states of a control correspond to different values, and the value corresponding to the acquired state of the control can be recorded in a cache variable.
[0069] For example, as in the above embodiment, the control is a button for controlling the air conditioner to be turned off, including two states: on and off. Before the user currently clicks the control, the state of the control is off, and the value corresponding to the off state is "0", that is, the value recorded in the cache variable at this time is "0". After the user currently clicks the button, the state of the control switches from the off state to the on state, and the value corresponding to the on state is "1". After obtaining that the current state of the control is on, the off state "0" recorded in the cache variable is updated to the on state "1".
[0070] The electronic device may be provided with a program for real-time monitoring of cache variables, for monitoring whether the current state of the control stored in the cache variables has changed. Specifically, when it is monitored that the value recorded in the cache variable has changed compared to before the update, it can be determined that the current state of the control recorded in the cache variable has changed, and the display state of the control in the display interface is updated at this time. Specifically, the display state of the control is updated to a display state corresponding to the current state recorded in the cache variable.
[0071] For example, before the control is currently clicked, the state of the control is closed, the display state of the corresponding control in the display interface is "air conditioning on", and the value recorded in the cache variable is "0". After the control is currently clicked, the state of the control is switched to the open state, the value recorded in the cache variable is updated to "1", and the cache variable is monitored to change. At this time, the display state of the control is updated to the display state "air conditioning off" corresponding to the open state.
[0072] In some embodiments, when there are multiple display interfaces including the same control, when the changes sent by the cache variable are monitored, the display status of the control on the multiple display interfaces needs to be updated accordingly based on the current status of the control recorded in the cache variable to ensure that the display status of the control on all interfaces remains consistent.
[0073] In the above method, by setting a cache variable, recording the state of the control after each click of the control, and updating the display state of the control on the display interface based on the cache variable, it can be ensured that the actual state of the control is synchronized with its performance on the display interface, so that the display state of the control on the interface can quickly respond to the user's interactive operations, thereby enhancing the responsiveness of the display interface and improving the user's interactive experience.
[0074] In step 102, the current click is not a subsequent click, that is, the current click may be the first click in continuous clicks, or the current click may be a single click.
[0075] When it is determined that the current click is the first click or a single click in continuous clicks, the setting signal triggered by the control during the current click can be directly sent to the underlying hardware for response, ensuring that the first click and single click are sent without delay.
[0076] In step 103, when it is determined that the current click is a subsequent click, a setting signal triggered by the control when the control is subsequently clicked may be sent based on a preset frequency.
[0077] Specifically, the sending time of sending the setting signal can be determined based on the period length of the preset frequency, and then the setting signal is sent at the sending time, so as to achieve sending of the setting signal based on the preset frequency.
[0078] Exemplarily, the preset frequency f=2 times / s, then the period length of the preset frequency can be determined as T=1 / f=500ms, and the sending time can be determined based on the period length of 500ms.
[0079] In one possible implementation, when it is determined that the current click is a subsequent click, the sending time is determined based on the cycle duration of a preset frequency, including: starting timing from a first moment to obtain a first timing duration; subtracting the interval duration from the second interval duration to obtain a target duration; and determining the moment when the first timing duration is equal to the target duration as the sending time.
[0080] The electronic device may be provided with a second timer, and when the user detects the first moment of clicking the control, the second timer may be started to start timing to obtain the first timing duration. In some embodiments, before starting the second timer, the timing in the second timer may be reset to zero.
[0081] Determining the current click as a subsequent click indicates that the user has clicked the control at least once before the current click, that is, before the current click, a setting signal has been sent to the underlying hardware. To ensure that the frequency of sending the setting signal is the preset frequency, it is necessary to determine the sending time of this setting signal based on the second moment of the most recent sending of the setting signal, the first moment of detecting the user's current click on the control, and the cycle duration of the preset frequency.
[0082] Specifically, the preset frequency of sending must be met, that is, the interval between the last sending and the current sending must be equal to the cycle time of the preset frequency. If the interval between the second moment of the last sending of the setting signal and the first moment corresponding to the current click is known, the target time from the first moment to the sending moment can be determined by subtracting the interval from the cycle time. Therefore, when the first timing duration is equal to the target duration, it is determined that the sending moment of sending the setting signal has arrived, that is, the moment when the first timing duration is equal to the target duration is determined as the sending moment.
[0083] In the above method, there is a certain interval between the first moment when the user currently clicks the control and the second moment when the setting signal was last sent. When determining the sending time, the interval duration is subtracted from the cycle duration to obtain the target duration from the first moment of the current click to the sending time, and the timing is performed. When the timing duration is equal to the target duration, the sending time is determined. Taking into account the interval duration between the current click and the last sending of the setting signal, the sending time is accurately calculated, the sending frequency is guaranteed to be the preset frequency, and the system stability is further improved.
[0084] In step 104, when the user is currently clicking the control continuously, the user may click the control multiple times before the sending time is reached. At this time, it is necessary to determine the target setting signal to be sent at the sending time from the setting signals triggered by multiple clicks of the control.
[0085] Specifically, the setting signal triggered by the most recent click on the control from the time of issuance may be determined as the target setting signal.
[0086] In one possible implementation, the setting signal triggered by the control most recently from the time of issuance is determined as the target setting signal, including: when the first timing duration is less than the target duration, the setting signal triggered by the control is stored in a preset storage space in the order from the trigger time to the back; when the first timing duration is equal to the target duration, the setting signal last stored in the storage space is determined as the target setting signal.
[0087] When the first timing duration is less than the target duration, it can be determined that the issuing time has not yet arrived, and the setting signal triggered by the user clicking the control during this period can be stored in the preset storage space in the order of triggering time from front to back.
[0088] Specifically, a frequency controller is provided in the electronic device, which is used to set the sending frequency (i.e., the preset frequency) and send the setting signal based on the set sending frequency. The preset storage space is the storage space in the frequency controller, such as a cache. During the period when the first timing duration is less than the target duration, the setting signal triggered by each click of the control by the user is transmitted to the frequency controller. After receiving the setting signal, the frequency controller caches the setting signal to the preset storage space.
[0089] It is understandable that, during the period when the first timing duration is less than the target duration, each time the control triggers a setting signal, it transmits a setting signal to the frequency controller, and the frequency controller stores the setting signal in the preset storage space. In other words, the setting signal is stored according to the triggering time, and the setting signal that is triggered earlier (i.e., the setting signal that is triggered farther from the sending time) is stored earlier, and the setting signal that is triggered closer to the sending time is stored later (i.e., the storage time is newer).
[0090] When the first timing duration is equal to the target duration, it can be determined that the current sending time has arrived. At this time, the setting signal last stored in the storage space is the setting signal triggered by the control most recently from the sending time. The setting signal last stored in the storage space can be determined as the target setting signal.
[0091] In step 105, the determined target setting signal is sent to the underlying hardware at the sending time, so as to send the setting signal based on the preset frequency.
[0092] In some embodiments, after this sending, it is also necessary to reset the first timing duration in the second timer, and after the current click of the user on the control is re-detected, steps 101 to 105 are executed in a loop.
[0093] In the prior art, since the setting controls involve the interaction between different electronic control units, the transmission link is long and involves many program modules. Any problem in any node may cause the setting to fail. In order to reflect whether the setting is invalid, the upper-layer application needs to monitor the feedback signal of the bottom layer after the setting signal is sent. If the bottom-layer hardware does not feedback the bottom-layer signal or the feedback bottom-layer signal does not match the setting signal, the control will rebound to the last display state. If the bottom-layer signal is consistent with the setting signal, the display state of the control is maintained unchanged. Therefore, in the prior art, the display state of the control still has the problem of rebound.
[0094] Based on this, the embodiment of the present application also proposes the following method to solve the problem of the display state rebound of the control in the prior art. Specifically, as shown in the following embodiment:
[0095] In one possible implementation, the method further includes: if an underlying signal is received from the underlying hardware feedback when the state machine corresponding to the control is in the processing state, the underlying signal is ignored, and the state machine is detected to be switched to the normal state; wherein the state machine switches to the processing state when the control triggers the setting signal, and the underlying signal is used to indicate the actual state of the control; when it is detected that the state machine switches to the normal state, the real-time underlying signal from the underlying hardware feedback is obtained, and the value recorded in the cache variable is updated based on the real-time underlying signal.
[0096] The state machine is used to indicate the state of the setting signal, and the state machine includes two states: processing state and normal state. The processing state indicates that the setting signal is triggered and is undergoing certain processing, such as transmission and distribution. The normal state indicates that the current control has not triggered the setting signal, and no setting signal is being processed, that is, the user has not clicked the control.
[0097] When the user's current click on the control is detected, the control triggers the setting signal, and the state machine is switched to the processing state. The state machine maintains the processing state for a preset time. The preset time can be the maximum time for processing the setting signal, which is set to 2s. If the state machine maintains the processing state for 2s, it means that the setting signal is still being processed and the setting signal has not been sent down. At this time, the underlying signal fed back by the underlying hardware is not accurate enough.
[0098] It is understandable that each time the user clicks on a control, the state machine needs to switch to the processing state and maintain it for a preset time. If the state machine is in the processing state and the user clicks on the control again, the state machine needs to maintain the processing state for a preset time from the moment the control is clicked, that is, the time the state machine maintains the processing state will be extended based on the click time.
[0099] In some embodiments, multiple clicks on a control may also be implemented based on controls on different control screens.
[0100] The underlying signal is the signal that the underlying hardware feeds back to the upper-level application through the child thread. The underlying signal is used to indicate the actual state of the underlying hardware. The state of the control corresponds to the state of the underlying hardware, so the underlying signal is also used to indicate the actual state of the control. The underlying signal can be based on the setting signal feedback triggered by the control, the setting signal triggered by the mechanical button or the setting signal feedback triggered by voice, or based on the internal logic feedback.
[0101] When the state machine is in the processing state, if an underlying signal fed back by the underlying hardware is received, it can be determined that the underlying signal received at this time is not accurate enough, and the underlying signal can be ignored to avoid rebound of the display state of the control after updating the cache variable based on the underlying signal.
[0102] After ignoring the underlying signal, it is possible to detect in real time whether the state machine has switched to a normal state. If it is detected that the state machine has switched to a normal state, it can be determined that the setting signal has been sent down for response, and the underlying signal fed back by the underlying hardware is the actual state of the underlying hardware, which also indicates the actual state of the control. At this time, the real-time underlying signal can be actively obtained from the child thread, and the value recorded in the cache variable can be updated based on the real-time underlying signal.
[0103] Specifically, it can be determined whether the actual state of the control indicated by the real-time underlying signal is consistent with the current state of the control recorded in the cache variable. If they are consistent, no update is performed. If they are inconsistent, the state recorded in the cache variable is updated to the actual state indicated by the real-time underlying signal.
[0104] It can be understood that after the state recorded in the cache variable is updated to the actual state indicated by the real-time underlying signal, the change in the value recorded in the cache variable can be monitored. At this time, the electronic device will update the display state of the control on the display interface based on the updated value of the cache variable.
[0105] For example, the actual state of the control indicated by the underlying signal is the on state, the state of the control recorded in the cache variable is the off state "0", and the display state of the control in the display interface is "air conditioning on" corresponding to the off state. The actual state is inconsistent with the state stored in the cache variable, and the cache variable is updated to the actual state indicated by the underlying signal, that is, the on state "1", and the value recorded in the cache variable is monitored to change, and the display state of the control in the display interface is updated to "air conditioning off" corresponding to the on state.
[0106] In the above method, the setting state machine switches to the processing state when the setting signal is triggered, and ignores the underlying signal of the underlying hardware feedback received when the state machine is in the processing state. This can achieve that when the setting signal is not responded, the value recorded in the cache variable is not updated based on the underlying signal, avoiding the rebound of the control display state, and also avoiding the impact of the disordered feedback signal generated by the underlying hardware on the control state when the control is operated by multiple terminals. Actively obtain real-time underlying signals when the state machine is in the normal state to achieve the unity of the control state and the actual state of the underlying hardware.
[0107] In one possible implementation, detecting whether the state machine has switched to a normal state includes: when detecting that the user currently clicks on a control, starting timing to obtain a second timing duration; determining an additional duration between a first moment of the current click and a sending moment; adding the additional duration to a basic delay duration to obtain a target delay duration; and when detecting that the second timing duration is equal to the target delay duration, determining that the state machine has switched to a normal state.
[0108] It is understandable that when the state machine detects the current click of the user on the control, it will switch to the processing state and maintain the processing state for a certain period of time to indicate that the setting signal is undergoing some processing. After the setting signal processing is completed, the state machine will automatically switch to the normal state. Therefore, after detecting the current click of the user on the control, a delay task can be started to determine whether the state machine has switched to the normal state.
[0109] The electronic device also includes a third timer, and starting a delay task specifically includes: when detecting that the user currently clicks the control, starting the third timer from zero to obtain a second timing duration. At the same time, a target delay duration representing the completion of the processing of the setting signal is calculated, and it is determined whether the timing duration reaches the target delay duration to determine whether the delay task is completed.
[0110] Since the frequency controller sends the setting signal based on the preset frequency, there may be a certain delay between the time when the setting signal is triggered and the time when it is sent. The first moment of the current click is the time when the setting signal is triggered. Subtract the first moment from the time of sending to get the delay between the time when the setting signal is triggered and the time when it is sent, that is, the additional duration.
[0111] The basic delay duration is the maximum duration for the state machine to maintain the processing state when the setting signal is normally sent. The basic delay duration is added to the additional duration to obtain the maximum duration for the state machine to maintain the processing state when the setting signal is sent based on the preset frequency.
[0112] When the timing duration is equal to the target delay duration, it is determined that the delay task has been completed and the state machine has switched to the normal state.
[0113] For example, the first time of the current click is T1, the sending time is T2, and the additional time obtained by subtracting T1 from T2 is 200ms, and the basic delay time is 2s, then the target delay time t=2.2s is calculated. When the second timing time is equal to 2.2s, it is determined that the state machine has switched to the normal state.
[0114] It is understandable that the above embodiment is a situation where the user no longer clicks on the control after the current click. If the user clicks on the control again after the current click, the click can be used as the current click, the delayed task started last time is deleted, and a delayed task is restarted based on the current click. That is, the delayed task is started when it is detected that the user currently clicks on the control. During the execution of the target delayed task, if it is detected that the user clicks on the control multiple times, for each click, the delayed task started last time is canceled and the delayed task is restarted. The delay duration of the target delayed task is equal to the basic delay duration plus the duration from the current click to the issuance time. When the delayed task is started, the third timer starts timing from zero. When the timing duration reaches the delay duration, it is determined that the delayed task is completed, and at this time, it is determined that the state of the state machine is switched to the normal state.
[0115] In some embodiments, the method further includes: if an underlying signal is received when the state machine is in a normal state, updating the value recorded in the cache variable based on the underlying signal.
[0116] During the period when the state machine is in the normal state, if the underlying signal fed back by the underlying hardware through the child thread is received, the current state of the control recorded in the cache variable can be updated based on the underlying signal. Specifically, it can be determined whether the actual state indicated by the underlying signal is consistent with the current state recorded in the cache variable. If it is determined to be consistent, it will not be updated. If it is determined to be inconsistent, the state recorded in the cache variable will be updated to the actual state indicated by the underlying signal.
[0117] In some embodiments, before updating the cache variable after receiving the underlying signal, it is also possible to detect whether the state machine has switched to the processing state again. If it is detected that the state machine has switched to the processing state, it is determined that the user has clicked the control again, and the underlying signal is ignored.
[0118] In the above method, when it is detected that the user has clicked the control, the timing starts to obtain the timing duration, the time difference between the current click and the sending moment is calculated to obtain the additional duration, the additional duration is added to the basic delay duration to obtain the target delay duration, and based on the target delay duration and the timing duration, it is judged whether the state machine switches from the processing state to the normal state. When the additional duration between the current click and the sending moment is different, the delay duration of the determined delay task is different. Considering that when the setting signal triggered by the current click is sent based on the preset frequency, there is a time difference between the triggering moment and the sending moment, which may affect the maintenance time of the state machine in the processing state, ensuring that the state machine can be accurately judged from the processing state to the normal state under different circumstances.
[0119] Figure 2 It is a flow chart of a signal processing provided in an embodiment of the present application.
[0120] For example, Figure 2 As shown, the user clicks on the control 201, and the upper-layer application 202 obtains the current state of the control 201 after detecting that the control 201 is clicked, and updates the value of the cache variable UIValue defined in advance by the upper-layer application 202 policy class based on the current state. The upper-layer application 202 monitors in real time whether the value recorded in the cache variable UIValue changes. When it is determined that the value recorded in the cache variable UIValue changes, the setting signal setvalue triggered by the control is sent to the Mode module. Among them, the Mode module controls the display mode of the user interface (User Interface, UI), and the user interface is the display interface in the above embodiment, which can also be called the UI interface. The Mode module sends the setting signal setvalue to the select module, and the select module corresponds to the variable of the display state of the control in the UI interface. The select module selects the corresponding display state variable based on the setting signal setvalue to update the display state of the control in the UI interface.
[0121] After the upper-layer application 202 monitors and detects that the control 201 is clicked, it will also start a target delay task and control the state machine to switch to the processing state. After the upper-layer application 202 completes the above actions, it passes the setting signal triggered by the control to the frequency controller SendFrequencyController 203 through the main thread, and the frequency controller SendFrequencyController 203 performs frequency control and sends the setting signal every 500ms. Specifically, the frequency controller stores the setting signal in the cache according to the trigger time, and each time it reaches the sending time, it obtains the latest setting signal stored in the cache and sends it.
[0122] Sending the setting signal specifically includes: the frequency controller sends the setting signal setvalue to the data source adaptation layer 204 through the main thread, the data source adaptation layer 204 sends the setting signal setvalue to the middleware service adaperSDK 205, and the middleware service adaperSDK 205 sends the setting signal to the underlying hardware, i.e., the counterparty.
[0123] The underlying hardware feeds back the underlying signal to the middleware service adaperSDK 205, and the middleware service adaperSDK205 sends the underlying signal to the data source adaptation layer 204 through a child thread, and the data source adaptation layer 204 sends the underlying signal to the upper-layer application 202. When the state machine is in a normal state, the upper-layer application 202 stores the underlying signal in a predefined receiving value variable receivevalue, and updates the value of the cache variable UIValue based on the underlying signal stored in receivevalue. When the data source adaptation layer 204 sends the underlying signal to the upper-layer application 202, and the upper-layer application 202 determines that the state machine is in a processing state, the upper-layer application 202 ignores the underlying signal and detects whether the delayed task has been completed. When it is determined that the delayed task has been completed, the real-time underlying signal is obtained from the data source adaptation layer 204, and the real-time underlying signal is stored in receivevalue, and the value of the cache variable UIValue is updated based on the underlying signal stored in receivevalue.
[0124] In some embodiments, the upper layer application 202 further includes an enable class, in which the enable module Enable is used to process the enable state of the control to ensure that the control can respond to user operations.
[0125] In summary, the present application can cleverly distinguish whether the current click is a subsequent click, the first click, or a single click by comparing the interval between the first moment of the current click and the second moment of the last sending of the setting signal with the period of the preset frequency. When the current click is a single click or the first click in continuous clicks, the setting signal is directly sent, so that a single click is not delayed and the first click in continuous clicks is sent, reducing response delays, allowing users to experience faster and more direct feedback. When it is determined that the current click is a subsequent click, it is sent at the preset frequency to avoid system overload or erroneous response caused by continuous and rapid clicks and frequent sending of setting signals, thereby ensuring system stability. Taking into account the interval between the current click and the last sending of the setting signal, the sending time is accurately calculated, ensuring that the sending frequency is the preset frequency, and further improving system stability. Setting cache variables, recording the state of the control after each click, and updating the display state of the control on the display interface based on the cache variables can ensure that the actual state of the control is synchronized with its performance on the display interface, so that the display state of the control on the interface can quickly respond to user interaction operations, enhance the responsiveness of the display interface, and improve the user's interactive experience. Considering that when the setting signal triggered by the current click is sent based on the preset frequency, the time difference between the triggering moment and the sending moment may affect the maintenance time of the state machine in the processing state, the target delay duration is determined to ensure that the state machine can accurately judge the transition from the processing state to the normal state under different circumstances.
[0126] Figure 3 It is a structural schematic diagram of a signal processing device provided in an embodiment of the present application.
[0127] For example, Figure 3 As shown, the device 300 includes:
[0128] The judgment module 301 is used to judge whether the current click is a subsequent click when detecting that the user currently clicks on the control; wherein the subsequent click is other clicks in the continuous clicks except the first click;
[0129] The first sending module 302 is used to send a setting signal triggered by the control based on the current click to the underlying hardware when it is determined that the current click is not a subsequent click;
[0130] A first determination module 303, configured to determine a sending time based on a periodic duration of a preset frequency when the current click is determined to be a subsequent click;
[0131] The second determination module 304 is used to determine the setting signal triggered by the control most recently from the sending moment as the target setting signal;
[0132] The second sending module 305 is used to send the target setting signal to the underlying hardware at the sending moment.
[0133] In one possible implementation, the judgment module 301 is specifically used to take the moment when the user's current click on the control is detected as the first moment; obtain the interval between the first moment and the second moment; wherein the second moment is the moment when the setting signal is most recently sent to the underlying hardware from the first moment; and when the interval is less than the cycle, determine that the current click is a subsequent click.
[0134] In one possible implementation, the first determination module 303 is specifically used to start timing from a first moment to obtain a first timing duration; when it is determined that the current click is a subsequent click, subtract the interval duration from the cycle duration to obtain a target duration; and determine the moment when the first timing duration is equal to the target duration as the sending moment.
[0135] In one possible implementation, the second determination module 304 is specifically used to store the setting signal triggered by the control in a preset storage space in the order of trigger time from front to back when the first timing duration is less than the target duration; when the first timing duration is equal to the target duration, the setting signal last stored in the storage space is determined as the target setting signal.
[0136] In a possible implementation, the device also includes: an acquisition module, used to obtain the current state of the control; a recording module, used to record the value corresponding to the current state into a predefined cache variable; wherein, when the control is not currently clicked, the value corresponding to the original state of the control is recorded in the cache variable; an update module, used to update the display state of the control on the display interface based on the current state when it is monitored that the value recorded in the cache variable changes.
[0137] In one possible implementation, the device also includes: a detection module, which is used to ignore the underlying signal and detect whether the state machine has switched to a normal state if it receives an underlying signal fed back by the underlying hardware when the state machine corresponding to the control is in a processing state; wherein the state machine switches to the processing state when detecting the user's current click on the control, and the underlying signal is used to indicate the actual state of the control; an update module, which is also used to obtain the real-time underlying signal fed back by the underlying hardware when detecting that the state machine has switched to a normal state, and update the value recorded in the cache variable based on the real-time underlying signal.
[0138] In one possible implementation, the detection module is specifically used to start timing when detecting that the user currently clicks on the control to obtain a second timing duration; determine the additional duration between the first moment of the current click and the sending moment; add the basic delay duration to the additional duration to obtain a target delay duration; and when detecting that the second timing duration is equal to the target delay duration, determine that the state machine switches to a normal state.
[0139] Figure 4 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application.
[0140] For example, Figure 4 As shown, the electronic device 400 includes: a memory 401 and a processor 402, wherein the memory 401 stores an executable program code 4011, and the processor 402 is used to call and execute the executable program code 4011 to perform a signal processing method.
[0141] In addition, an embodiment of the present application also protects a device, which may include a memory and a processor, wherein the memory stores an executable program code, and the processor is used to call and execute the executable program code to perform a signal processing method provided by an embodiment of the present application.
[0142] In this embodiment, the functional modules of the device can be divided according to the above method example. For example, each functional module can be corresponded, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware. It should be noted that the division of modules in this embodiment is schematic and is only a logical function division. There may be other division methods in actual implementation.
[0143] In the case of dividing each functional module according to each function, the device may further include a judgment module, a first sending module, a first determination module, a second determination module, and a second sending module, etc. It should be noted that all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module, and will not be repeated here.
[0144] It should be understood that the device provided in this embodiment is used to execute the above-mentioned signal processing method, and thus can achieve the same effect as the above-mentioned implementation method.
[0145] In the case of an integrated unit, the device may include a processing module and a storage module. When the device is applied to an electronic device, the processing module may be used to control and manage the actions of the electronic device. The storage module may be used to support the electronic device in executing relevant program codes, etc.
[0146] The processing module may be a processor or a controller, which may implement or execute various exemplary logic blocks, modules and circuits shown in conjunction with the disclosure of the present application. The processor may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of digital signal processing (DSP) and a microprocessor, etc. The storage module may be a memory.
[0147] In addition, the device provided in the embodiments of the present application may specifically be a chip, a component or a module, and the chip may include a connected processor and a memory; wherein the memory is used to store instructions, and when the processor calls and executes the instructions, the chip can execute a signal processing method provided in the above embodiments.
[0148] This embodiment also provides a computer-readable storage medium, in which a computer program code is stored. When the computer program code is executed on a computer, the computer executes the above-mentioned related method steps to implement a signal processing method provided by the above-mentioned embodiment.
[0149] This embodiment further provides a computer program product. When the computer program product is run on a computer, the computer is enabled to execute the above-mentioned related steps to implement a signal processing method provided by the above-mentioned embodiment.
[0150] Among them, the device, computer-readable storage medium, computer program product or chip provided in this embodiment is used to execute the corresponding method provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method provided above, and will not be repeated here.
[0151] Through the description of the above implementation methods, technical personnel in the relevant field can understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0152] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0153] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A signal processing method, characterized in that: The method comprises: When detecting that the user currently clicks the control, determining whether the current click is a subsequent click; wherein the subsequent click is other clicks in the continuous clicks except the first click; In the case where it is determined that the current click is not a subsequent click, sending a setting signal of the control triggered based on the current click to the underlying hardware; When the current click is determined to be a subsequent click, the sending time is determined based on the cycle duration of the preset frequency; Determine the setting signal triggered by the control most recently from the sending moment as the target setting signal; At the sending moment, the target setting signal is sent to the underlying hardware.
2. The method according to claim 1, characterized in that When detecting that the user currently clicks the control, determining whether the current click is a subsequent click includes: The moment when the user currently clicks the control is detected is taken as the first moment; Obtaining the interval between the first moment and the second moment; wherein the second moment is the moment when a setting signal is sent to the underlying hardware most recently from the first moment; When the interval duration is less than the cycle duration, the current click is determined to be a subsequent click.
3. The method according to claim 2, characterized in that In the case where it is determined that the current click is a subsequent click, determining the sending time based on the periodic duration of the preset frequency includes: Starting timing from the first moment to obtain a first timing duration; When it is determined that the current click is a subsequent click, the interval duration is subtracted from the cycle duration to obtain a target duration; The time when the first timing duration is equal to the target duration is determined as the sending time.
4. The method according to claim 3, characterized in that The step of determining the setting signal triggered by the control most recently from the sending moment as the target setting signal includes: When the first timing duration is less than the target duration, the setting signal triggered by the control is stored in a preset storage space in a sequence from the beginning to the end of the triggering time; When the first timing duration is equal to the target duration, the setting signal last stored in the storage space is determined as the target setting signal.
5. The method according to any one of claims 1 to 4, characterized in that: When detecting that the user currently clicks the control, the method further includes: Get the current state of the control; Recording the value corresponding to the current state into a predefined cache variable; wherein, when the control is not currently clicked, the cache variable records the value corresponding to the original state of the control; When a change in the value of the cache variable record is detected, the display state of the control on the display interface is updated based on the current state.
6. The method according to claim 5, characterized in that The method further comprises: If the underlying signal fed back by the underlying hardware is received when the state machine corresponding to the control is in the processing state, the underlying signal is ignored, and it is detected whether the state machine is switched to the normal state; wherein the state machine is switched to the processing state when the user's current click on the control is detected, and the underlying signal is used to indicate the actual state of the control; When it is detected that the state machine switches to the normal state, a real-time underlying signal fed back by the underlying hardware is obtained, and the value recorded in the cache variable is updated based on the real-time underlying signal.
7. The method according to claim 6, characterized in that The detecting whether the state machine is switched to a normal state comprises: When it is detected that the user currently clicks the control, the timing starts and the second timing duration is obtained; Determine the additional time between the first moment of the current click and the sending moment; Add the additional time duration to the basic time delay duration to obtain the target time delay duration; When it is detected that the second timing duration is equal to the target delay duration, it is determined that the state machine is switched to a normal state.
8. A signal processing device, characterized in that: The device comprises: A judgment module, used to judge whether the current click is a subsequent click when detecting that the user currently clicks on the control; wherein the subsequent click is other clicks in the continuous clicks except the first click; A first sending module, configured to send a setting signal of the control triggered based on the current click to the underlying hardware when it is determined that the current click is not a subsequent click; A first determination module, configured to determine a sending time based on a periodic duration of a preset frequency when determining that the current click is a subsequent click; A second determining module, configured to determine the setting signal triggered by the control most recently from the issuing moment as the target setting signal; The second sending module is used to send the target setting signal to the underlying hardware at the sending moment.
9. An electronic device, characterized in that: The electronic device comprises: A memory for storing executable program codes; A processor, configured to call and run the executable program code from the memory, so that the electronic device executes the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Cited By
Mutual exclusion function control method and device, vehicle and storage medium
CN119781324A
A mutual exclusion function control method, device, vehicle and storage medium
CN119781324B
