CN117424608B - Button reporting method, device, equipment and storage medium - Google Patents

Button reporting method, device, equipment and storage medium Download PDF

Info

Publication number
CN117424608B
CN117424608B CN202311748241.XA CN202311748241A CN117424608B CN 117424608 B CN117424608 B CN 117424608B CN 202311748241 A CN202311748241 A CN 202311748241A CN 117424608 B CN117424608 B CN 117424608B
Authority
CN
China
Prior art keywords
button
pressing operation
pressing
coding
state
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202311748241.XA
Other languages
Chinese (zh)
Other versions
CN117424608A (en
Inventor
廉诗航
宋俊皓
梁亮
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Zhian New Energy Technology Co ltd
Original Assignee
Shenzhen Zhian New Energy Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Zhian New Energy Technology Co ltd filed Critical Shenzhen Zhian New Energy Technology Co ltd
Priority to CN202311748241.XA priority Critical patent/CN117424608B/en
Publication of CN117424608A publication Critical patent/CN117424608A/en
Application granted granted Critical
Publication of CN117424608B publication Critical patent/CN117424608B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03MCODING; DECODING; CODE CONVERSION IN GENERAL
    • H03M11/00Coding in connection with keyboards or like devices, i.e. coding of the position of operated keys
    • H03M11/02Details
    • H03M11/04Coding of multifunction keys
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/044Recurrent networks, e.g. Hopfield networks
    • G06N3/0442Recurrent networks, e.g. Hopfield networks characterised by memory or gating, e.g. long short-term memory [LSTM] or gated recurrent units [GRU]

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Input From Keyboards Or The Like (AREA)

Abstract

The invention provides a button reporting method, a device, equipment and a storage medium, wherein the method comprises the following steps: determining a button state of the button device in response to a pressing operation for the button device; performing button detection on the pressing operation according to the operation information of the pressing operation to obtain a detection result, and adjusting the pressing operation according to the detection result; coding the button state according to a preset coding rule to obtain a coding result, and sending the coding result to the electric equipment; and controlling the electric equipment to determine and realize the corresponding button function according to the coding result. According to the method, the button function corresponding to the button device on the intelligent lithium battery is directly realized by identifying the pressing process of the button device on the intelligent lithium battery, so that the button detection circuit is prevented from being added in the corresponding electric equipment, and the structural complexity is reduced.

Description

Button reporting method, device, equipment and storage medium
Technical Field
The present invention relates to the field of battery management, and in particular, to a method, an apparatus, a device, and a storage medium for reporting a button.
Background
When using a smart lithium battery, the powered device often has one or more buttons for its own switching or other functions, such as matching with a remote control. Meanwhile, the intelligent lithium battery is also provided with a button for realizing the functions of checking the switch and the state information of the battery, and the intelligent lithium battery is provided with an external communication function, so that the possibility is provided for combining the electric equipment with the button of the intelligent lithium battery. The existing scheme is that a button detection circuit is added in a main controller of electric equipment, a physical button is arranged on an equipment shell and is connected with a circuit in the main controller, so that the switching function of the electric equipment is realized. However, the mode needs to set a physical button which is convenient for the user to operate, the structural complexity is increased, and meanwhile, the design difficulty and cost are greatly increased for the electric equipment with waterproof requirements.
Disclosure of Invention
The invention mainly aims to solve the technical problem that the button detection circuit is added in the main controller of the electric equipment to realize the switching function of the electric equipment in the prior art, and the technical problem has higher structural complexity.
The first aspect of the present invention provides a button reporting method, where the button reporting method is applied to a button reporting system, where the button reporting system includes an intelligent battery and an electric device, and the intelligent battery is configured with a button device, and the button reporting method includes:
Determining a button state of the button device in response to a pressing operation for the button device;
performing button detection on the pressing operation according to the operation information of the pressing operation to obtain a detection result, and adjusting the pressing operation according to the detection result;
coding the button state according to a preset coding rule to obtain a coding result, and sending the coding result to the electric equipment;
and controlling the electric equipment to determine and realize the corresponding button function according to the coding result.
Optionally, in a first implementation manner of the first aspect of the present invention, the determining, in response to a pressing operation on the button device, a button state of the button device includes:
in response to a pressing operation for the button device, acquiring a pressing time corresponding to the pressing operation;
judging whether the pressing time is greater than a preset time threshold;
if not, determining the button state of the button equipment as a first button state;
if yes, determining the button state of the button equipment to be a second button state;
and determining a button state of the button device to be a third button state in response to the end of the pressing operation.
Optionally, in a second implementation manner of the first aspect of the present invention, the encoding the button state according to a preset encoding rule to obtain an encoding result, and sending the encoding result to the electric device includes:
acquiring time stamp information of the pressing operation and pressing times corresponding to the pressing operation, wherein the time stamp information comprises a starting time stamp of the pressing operation and an ending time stamp of ending the pressing operation;
calculating a pressing cycle of the pressing operation according to the time stamp information and the pressing times;
and coding the timestamp information, the pressing period and the button state according to a preset coding rule to obtain a coding result, and sending the coding result to the electric equipment.
Optionally, in a third implementation manner of the first aspect of the present invention, the performing button detection on the pressing operation according to the operation information of the pressing operation to obtain a detection result, and adjusting the pressing operation according to the detection result includes:
performing data preprocessing on the operation information of the pressing operation to obtain processing data;
performing time step division on the processing data according to the pressing period to obtain corresponding time steps, and performing input coding processing on the processing data according to the time steps to obtain corresponding coding sequences;
Inputting the coding sequence into a preset button detection model to obtain a detection result, and adjusting the pressing operation according to the detection result.
Optionally, in a fourth implementation manner of the first aspect of the present invention, the button detection model is composed of a gating circulation unit and a full connection layer; inputting the coding sequence into a preset button detection model, and obtaining a detection result comprises the following steps:
sequentially inputting the coding sequences into the button detection model according to the corresponding time steps;
the time step when the coding sequence is input into the button detection model is used as the current time step;
inputting the coding sequence of the current time step and the hidden state of the last time step into a gating circulation unit, and calculating the hidden state of the current time step through the gating circulation unit;
when the current time step is the last time step, taking the hidden state output by the gating circulating unit as the pressing hidden state corresponding to the pressing operation;
and inputting the pressing hidden state into the full-connection layer to obtain a detection result.
Optionally, in a fifth implementation manner of the first aspect of the present invention, the gating cycle unit includes an update gating unit and a reset gating unit;
The step of inputting the coding sequence of the current time step and the hidden state of the last time step into a gating circulation unit, and calculating the hidden state of the current time step through the gating circulation unit comprises the following steps:
the coding sequence of the current time step and the hidden state of the last time step are respectively input into an updating door blank unit and a resetting door control unit to respectively obtain an updating tensor and a door control tensor;
calculating candidate hidden states from the coding sequence of the current time step and the hidden state of the last time step;
and carrying out combination calculation on the coding sequence of the current time step, the hidden state of the last time step and the candidate hidden state to obtain the hidden state of the current time step.
Optionally, in a sixth implementation manner of the first aspect of the present invention, the adjusting the pressing operation according to the detection result includes:
calculating a press detection error value of the press operation according to the detection result;
judging whether the pressing detection error value is larger than a preset error threshold value or not;
if yes, adjusting the operation information of the pressing operation according to the pressing detection error value.
The second aspect of the present invention provides a button reporting device, where the button reporting device is applied to a button reporting system, where the button reporting system includes an intelligent battery and an electric device, and the intelligent battery is configured with a button device, and the button reporting device includes:
A press response module for determining a button state of the button device in response to a press operation for the button device;
the detection module is used for carrying out button detection on the pressing operation according to the operation information of the pressing operation to obtain a detection result, and adjusting the pressing operation according to the detection result;
the coding module is used for coding the button state according to a preset coding rule to obtain a coding result and sending the coding result to the electric equipment;
and the function realizing module is used for controlling the electric equipment to determine and realize the corresponding button function according to the coding result.
A third aspect of the present invention provides a button reporting device, including: a memory and at least one processor, the memory having instructions stored therein, the memory and the at least one processor being interconnected by a line; and the at least one processor invokes the instructions in the memory to enable the button reporting device to execute the steps of the button reporting method.
A fourth aspect of the present invention provides a computer readable storage medium having instructions stored therein which, when run on a computer, cause the computer to perform the steps of the button reporting method described above.
The button reporting method, the device, the equipment and the storage medium are applied to a button reporting system, wherein the button reporting system comprises an intelligent battery and electric equipment, the intelligent battery is provided with button equipment, and the button state of the button equipment is determined in response to the pressing operation of the button equipment; performing button detection on the pressing operation according to the operation information of the pressing operation to obtain a detection result, and adjusting the pressing operation according to the detection result; coding the button state according to a preset coding rule to obtain a coding result, and sending the coding result to the electric equipment; and controlling the electric equipment to determine and realize the corresponding button function according to the coding result. According to the method, the button function corresponding to the button device on the intelligent lithium battery is directly realized by identifying the pressing process of the button device on the intelligent lithium battery, so that the button detection circuit is prevented from being added in the corresponding electric equipment, and the structural complexity is reduced.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
In order to make the above objects, features and advantages of the present invention more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
FIG. 1 is a schematic diagram of a first embodiment of a button reporting method according to an embodiment of the present invention;
FIG. 2 is a schematic view of an embodiment of a button reporting device according to an embodiment of the present invention;
FIG. 3 is a schematic view of another embodiment of a button reporting device according to an embodiment of the present invention;
fig. 4 is a schematic diagram of an embodiment of a button reporting device according to an embodiment of the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The terms "comprising" and "having" and any variations thereof, as used in the embodiments of the present invention, are intended to cover non-exclusive inclusion. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those listed but may optionally include other steps or elements not listed or inherent to such process, method, article, or apparatus.
For the convenience of understanding the present embodiment, a method for reporting a button disclosed in the present embodiment will be described in detail. As shown in fig. 1, the method for reporting the button is applied to a button reporting system, wherein the button reporting system comprises an intelligent battery and electric equipment, and button equipment is configured on the intelligent battery, and the method comprises the following steps:
101. determining a button state of the button device in response to a pressing operation for the button device;
in one embodiment of the present invention, the determining the button state of the button device in response to the pressing operation for the button device includes: in response to a pressing operation for the button device, acquiring a pressing time corresponding to the pressing operation; judging whether the pressing time is greater than a preset time threshold; if not, determining the button state of the button equipment as a first button state; if yes, determining the button state of the button equipment to be a second button state; and determining a button state of the button device to be a third button state in response to the end of the pressing operation.
Specifically, when the user performs a pressing operation on the button device, a pressing time corresponding to the pressing operation is acquired. Next, it is necessary to determine whether this pressing time is greater than a preset time threshold. If the pressing time is less than or equal to a preset time threshold, determining the button state of the button device as a first button state; otherwise, if the pressing time is greater than the preset time threshold, the button state of the button device is determined to be the second button state. After the user completes the pressing operation, the end of this pressing operation is responded, and the final button state is determined to be the third button state according to the current button state. In this way, in the process of pressing the button device by the user, the change of the button state can be monitored in real time, the final button state is determined after the user finishes the pressing operation, and the corresponding button functions can be determined by encoding according to different button states corresponding to the pressing operation and pressing time among the different button states.
102. Performing button detection on the pressing operation according to the operation information of the pressing operation to obtain a detection result, and adjusting the pressing operation according to the detection result;
in one embodiment of the present invention, the performing button detection on the pressing operation according to the operation information of the pressing operation to obtain a detection result, and adjusting the pressing operation according to the detection result includes:
performing data preprocessing on the operation information of the pressing operation to obtain processing data; performing time step division on the processing data according to the pressing period to obtain corresponding time steps, and performing input coding processing on the processing data according to the time steps to obtain corresponding coding sequences; inputting the coding sequence into a preset button detection model to obtain a detection result, and adjusting the pressing operation according to the detection result.
Specifically, in order to effectively process the collected button data, a preprocessing step is required to obtain processed data, wherein the data preprocessing includes operations such as coordinate normalization and pressure normalization. These preprocessing operations are intended to provide input data with a uniform format and range for subsequent data processing and analysis. Firstly, in the preprocessing process of coordinate normalization, the collected button position information is converted to have a uniform format and range. This may be accomplished by mapping the raw coordinate data onto a specified coordinate system or scale. For example, button position data is mapped to a standardized coordinate space, such as a range between [0, 1 ]. By doing so, consistent representation of button position data on different device or screen sizes can be ensured, facilitating subsequent data processing and comparison. And secondly, in the preprocessing process of pressure normalization, the collected button pressure information is converted, so that the button pressure information has a uniform format and range. This may be achieved by performing a linear or non-linear normalization operation on the raw pressure data. The purpose of normalization is to map pressure data in different ranges to a uniform interval or standard range, such as between [0, 1 ]. This ensures that pressure data collected on different devices or sensors can be effectively compared and analyzed.
Specifically, after data preprocessing, the processing data is divided into time steps according to the pressing period, namely the data is divided according to a certain time interval, and corresponding time steps are obtained. Each time step represents a fixed period of time. Then, according to the time steps, input encoding processing is carried out on the processed data, and the data in each time step is converted into a corresponding encoding sequence. This coding sequence may be a vector, matrix or other form of digital representation. The obtained coding sequence is input into a preset button detection model, and the detection result of the button can be obtained through the learning and reasoning process of the model. The detection result reflects the state of the button in the pressing operation, which may be a pressed, released or other state. By detecting the result, the specific behavior characteristics of the button can be known. And finally, according to the detection result, the pressing operation can be correspondingly adjusted according to the requirement. For example, if the detection result indicates that the button is erroneously recognized as a pressed state, and the user does not actually perform a pressing operation, this false pressing operation may be ignored. By adjusting the pressing operation according to the detection result, the accuracy and the user experience of the system can be improved. In the above procedure, the time step represents each button event in the button sequence. In button data processing, time steps are used to distinguish the order in which different button events occur. Assume a button sequence [ press, release, press ], wherein each button event occurs in a time sequence of press-release-press. In this example, the length of the button sequence is 5, so the time steps are from 1 to 5. By using time steps, each button event can be considered an element in the sequence so that the model can capture the order of the button events and the relationship to each other. At the same time, the time step can also be used to pad or truncate sequences to ensure that all sequences have the same length.
Further, the button detection model consists of a gating circulation unit and a full connection layer; inputting the coding sequence into a preset button detection model, and obtaining a detection result comprises the following steps: sequentially inputting the coding sequences into the button detection model according to the corresponding time steps; the time step when the coding sequence is input into the button detection model is used as the current time step; inputting the coding sequence of the current time step and the hidden state of the last time step into a gating circulation unit, and calculating the hidden state of the current time step through the gating circulation unit; when the current time step is the last time step, taking the hidden state output by the gating circulating unit as the pressing hidden state corresponding to the pressing operation; and inputting the pressing hidden state into the full-connection layer to obtain a detection result.
Specifically, after data preprocessing, features are extracted from the time series data of the buttons, including button status, button duration, pressure changes, and other features of interest such as time differences, statistics, etc., and furthermore, since there may be differences in button duration, it is necessary to fill or truncate the button time series so that all the sequences have the same length. The uniform length may be set according to the longest button sequence length.
Specifically, in the process of data processing by the gating cycle unit, an input sequence is converted into a tensor format as an input of a model. Typically, each time step in the button data represents a feature vector. The features of each time step may be encoded using an embedded layer or a fully connected layer to obtain tensors appropriate for input into the GRU model. The input tensor sequence is taken as the input of the GRU model. The specific process is to convert the key event into tensor format suitable for input to the GRU model. The embedded layer or the fully connected layer may be used to encode key events to yield feature vectors. The encoded feature vectors are arranged in time order to form a tensor representation of the key sequence. Assuming that there are n key events, each event has a feature vector dimension d, then the shape of the input sequence is (n, d). At each time step, the GRU model will receive a feature vector and output a hidden state vector. Depending on the task requirements, the latest output retaining the hidden state vector may be selected after each time step.
Further, the gating cycle unit comprises an updating door empty unit and a resetting gating unit; the step of inputting the coding sequence of the current time step and the hidden state of the last time step into a gating circulation unit, and calculating the hidden state of the current time step through the gating circulation unit comprises the following steps: the coding sequence of the current time step and the hidden state of the last time step are respectively input into an updating door blank unit and a resetting door control unit to respectively obtain an updating tensor and a door control tensor; calculating candidate hidden states from the coding sequence of the current time step and the hidden state of the last time step; and carrying out combination calculation on the coding sequence of the current time step, the hidden state of the last time step and the candidate hidden state to obtain the hidden state of the current time step.
Specifically, in the present invention, the button detection model is composed of a gating circulation unit (GRU) including two gating units: an Update Gate (Update Gate) and a Reset Gate (Reset Gate). Each of them having different functions and roles. The function of the update door is that the update door controls the information retention degree of the hidden state (or the memory state) at the current moment. It determines how much hidden state information from the previous moment should be kept at the current moment. For updating the output value of the gate between 0 and 1 by using a sigmoid function. When the update door approaches 0, it means that the hidden state of the previous moment is completely forgotten; when the update door approaches 1, this means that the hidden state of the previous moment is completely transferred to the current moment. The function of the reset gate is that the reset gate controls the reset degree of the hidden state input at the current moment in the previous moment. It determines how the hidden state at the previous time is combined with the input at the current time. For resetting the output value of the gate between 0 and 1, again using the sigmoid function. When the reset gate approaches 0, this means that the hidden state of the previous moment will be ignored; when approaching 1, this means that the hidden state of the previous moment is fully utilized in combination with the input of the current moment. Through the control of the update gate and the reset gate, the GRU model can be better adapted to different input conditions, so that long-term dependency in a time sequence can be better captured. The output values of the update gate and the reset gate are used to calculate new candidate hidden states and then determine whether to update the current hidden state based on the value of the update gate.
Specifically, the GRU model performs the following operations: calculating an updating gating unit to determine whether to update the hidden state of the current time step; calculating a reset gating unit to determine whether to reset the hidden state of the current time step; calculating a new candidate hidden state according to the combination of the current input and the previous hidden state; and calculating the hidden state of the current time step according to the combination of the reset gating unit, the update gating unit and the new candidate hidden state. In the calculation process, a series of weight matrixes and bias vectors are used, and finally, according to task requirements, the last hidden state of the GRU model can be selectively transferred to a full-connection layer to serve as an output layer, so that labels or probability distribution of button quality can be predicted.
Specifically, the computing update gating unit takes input data at the current moment and a hidden state at the previous moment as inputs, maps the input data x and the hidden state h to a vector through a full connection layer, multiplies the mapped vector by a weight matrix of an update gate, and performs corresponding bias processing. And mapping the result to an output value between 0 and 1 by using a Sigmoid activation function (such as Sigmoid or Hard Sigmoid), and finally obtaining an output value of an update gate to represent the retention degree of the hidden state of the previous moment on the information of the current moment. The computing reset gating unit maps the input data x and the hidden state h to a vector through a full connection layer, multiplies the mapped vector by a weight matrix of a reset gate, and performs corresponding bias processing. And mapping the result to an output value between 0 and 1 by using a sigmoid activation function, and finally obtaining an output value of a reset gate, wherein the output value represents the hiding state of the previous moment and the reset degree input at the current moment. In the GRU, the output values of the two gating units will determine how to process the input at the current time and the hidden state at the previous time, so as to calculate a new candidate hidden state. The calculation of the candidate hidden state takes input data x at the current moment and a hidden state h at the previous moment as inputs, maps the input data x and the hidden state h at the previous moment to a vector through a full connection layer, multiplies the mapped vector by an output value r of a reset gate, carries out corresponding bias processing, and maps a result to an output value between-1 and-1 by using a tanh activation function to obtain the candidate hidden state, and represents the candidate hidden state at the current moment. Finally, according to the output value z of the update gate, whether to update the hidden state at the current moment is determined. If z is close to 0, the hidden state at the previous moment is completely forgotten; if z is close to 1, the hidden state of the previous moment is completely transferred to the current moment. The updated hidden state will be used as input for the next moment.
Further, the adjusting the pressing operation according to the detection result includes: calculating a press detection error value of the press operation according to the detection result; judging whether the pressing detection error value is larger than a preset error threshold value or not; if yes, adjusting the operation information of the pressing operation according to the pressing detection error value.
Specifically, the real-time pressing data is processed and analyzed by using the gating circulation unit model, and a pressing quality detection result is obtained. These results may represent relevant indicators of whether the compression is accurate, whether the compression force is appropriate, whether the compression position is accurate, etc., and in a particular form, such as a confidence score or classification result. And comparing the detection result with the actual pressing condition, and calculating a pressing detection error value. This error value can be calculated by comparing the detected result with the difference of the actual compressions, such as the deviation of the compression time, the difference of the compression force, and the like. And comparing the calculated pressing detection error value with a preset error threshold value. If the error is less than or equal to the threshold, the compression quality may be considered good. If the error is greater than the threshold, a corresponding adjustment is required. Based on the measured press detection error value, the relevant information of the press operation can be adjusted accordingly. For example, if the detected error value is larger, the conditions of insufficient pressing force, deviation of position and the like can be estimated, so that the corresponding pressing force, pressing position or other pressing parameters can be adjusted according to the specific condition of the error value, whether pressing is performed or not can be further determined, and the pressing condition, the pressing state, the pressing time stamp, the pressing period and the like are correspondingly adjusted, so that misoperation is avoided.
103. Coding the button state according to a preset coding rule to obtain a coding result, and sending the coding result to electric equipment;
in one embodiment of the present invention, the encoding the button state according to a preset encoding rule to obtain an encoding result, and sending the encoding result to the electric device includes: acquiring time stamp information of the pressing operation and pressing times corresponding to the pressing operation, wherein the time stamp information comprises a starting time stamp of the pressing operation and an ending time stamp of ending the pressing operation; calculating a pressing cycle of the pressing operation according to the time stamp information and the pressing times; and coding the timestamp information, the pressing period and the button state according to a preset coding rule to obtain a coding result, and sending the coding result to the electric equipment.
Specifically, in order to perform overall processing and transmission of the pressing operation, it is necessary to acquire time stamp information of the pressing operation and the number of pressing times, and calculate a pressing cycle. And then, coding the information according to a preset coding rule, and sending a coding result to the electric equipment. First, it is a critical step to acquire time stamp information of a pressing operation. This includes recording a start time stamp and an end time stamp of the pressing operation. The start time stamp indicates the point in time when the button is pressed, and the end time stamp indicates the point in time when the button is released. By recording these two time stamps, the duration of the pressing operation can be calculated. Secondly, it is also necessary to acquire the number of presses of the pressing operation. The number of presses indicates the number of times the button is pressed, i.e., the number of times the user repeatedly performs the pressing operation. This information may help determine the frequency and intensity with which the user performs the pressing operation. Next, a pressing cycle of a pressing operation may be calculated from the time stamp information and the number of presses. The pressing cycle refers to a time interval between pressing operations, i.e., a time difference between two pressing operations. By calculating the difference in time stamps and dividing by the number of presses, the average of the pressing cycles can be obtained. Then, the time stamp information, the pressing period and the button state are encoded according to a preset encoding rule. The coding mode can be digital coding, binary coding or other forms of coding according to specific requirements. Such encoded information will contain information of the start time stamp, end time stamp and duration of the press operation, the press cycle and the button status. And finally, sending the coding result to the electric equipment to realize the corresponding function. This may be accomplished through wireless communication, a data transfer interface, or other suitable means. By transmitting the coding result to the electric equipment, the control or operation corresponding to the pressing operation can be realized, and the equipment performs corresponding behaviors according to the instruction of the user.
104. And controlling the electric equipment to determine and realize the corresponding button function according to the coding result.
In one embodiment of the present invention, to facilitate the consumer to distinguish button states, the following table 1 convention is made for the encoding format, table 1:
table 1 table of coding formats
The button period value is used for distinguishing the current number of button periods, such as 0-255 cycles, and is incremented after each button period is completed, and is kept unchanged in one button period, and the button state timestamp is used for recording the occurrence time of different actions, which can be a real timestamp or a timestamp in each button period.
Specifically, during the encoding process, a set of encoding rules is first determined for converting the button state into a specific encoding form. The encoding rules may be defined and designed according to actual requirements, such as mapping button period values to a digital range, mapping button states to specific symbols, mapping button state timestamps to a time format, and so forth. And mapping the detected button period value into a specific digital code according to a preset coding rule. For example, a fixed time unit may be specified, the button period value divided by the time unit and rounded, and the result is part of the code. And converting the detected button state timestamp into a specific time format or digital code according to a preset coding rule. The time stamp may be converted to a specific time unit or represented using a specific coding scheme. For example, the time stamp may be converted to a millisecond representation, or a binary coded representation may be used. And combining the mapped button period value, button state and button state time stamp according to the agreed sequence to form a final coding result. The encoded result may be a string of numbers, symbols, or binary codes, where different encoded segments may be distinguished using specific separators. After the electric equipment obtains the coding result, decoding the coding result according to the coding rule to obtain the operation data of the corresponding pressing operation, and determining and realizing the corresponding function according to the operation data and the set mapping relation.
In the present embodiment, by responding to a pressing operation for the button device, a button state of the button device is determined; performing button detection on the pressing operation according to the operation information of the pressing operation to obtain a detection result, and adjusting the pressing operation according to the detection result; coding the button state according to a preset coding rule to obtain a coding result, and sending the coding result to the electric equipment; and controlling the electric equipment to determine and realize the corresponding button function according to the coding result. According to the method, the button function corresponding to the button device on the intelligent lithium battery is directly realized by identifying the pressing process of the button device on the intelligent lithium battery, so that the button detection circuit is prevented from being added in the corresponding electric equipment, and the structural complexity is reduced.
The button reporting method in the embodiment of the present invention is described above, and the button reporting device in the embodiment of the present invention is described below, where the button reporting device is applied to a button reporting system, the button reporting system includes an intelligent battery and an electric device, the intelligent battery is configured with a button device, and referring to fig. 2, one embodiment of the button reporting device in the embodiment of the present invention includes:
A press response module 201 for determining a button state of the button device in response to a press operation for the button device;
the detection module 202 is configured to perform button detection on the pressing operation according to the operation information of the pressing operation, obtain a detection result, and adjust the pressing operation according to the detection result;
the encoding module 203 is configured to encode the button state according to a preset encoding rule, obtain an encoding result, and send the encoding result to the electric device;
and the function realizing module 204 is used for controlling the electric equipment to determine and realize the corresponding button function according to the coding result.
In the embodiment of the invention, the button state of the button device is determined by responding to the pressing operation of the button device; performing button detection on the pressing operation according to the operation information of the pressing operation to obtain a detection result, and adjusting the pressing operation according to the detection result; coding the button state according to a preset coding rule to obtain a coding result, and sending the coding result to the electric equipment; and controlling the electric equipment to determine and realize the corresponding button function according to the coding result. According to the method, the button function corresponding to the button device on the intelligent lithium battery is directly realized by identifying the pressing process of the button device on the intelligent lithium battery, so that the button detection circuit is prevented from being added in the corresponding electric equipment, and the structural complexity is reduced.
Referring to fig. 3, a second embodiment of the button reporting device in the embodiment of the present invention includes:
a press response module 201 for determining a button state of the button device in response to a press operation for the button device;
the detection module 202 is configured to perform button detection on the pressing operation according to the operation information of the pressing operation, obtain a detection result, and adjust the pressing operation according to the detection result;
the encoding module 203 is configured to encode the button state according to a preset encoding rule, obtain an encoding result, and send the encoding result to the electric device;
and the function realizing module 204 is used for controlling the electric equipment to determine and realize the corresponding button function according to the coding result.
In one embodiment of the present invention, the press response module 201 is specifically configured to:
in response to a pressing operation for the button device, acquiring a pressing time corresponding to the pressing operation;
judging whether the pressing time is greater than a preset time threshold;
if not, determining the button state of the button equipment as a first button state;
if yes, determining the button state of the button equipment to be a second button state;
And determining a button state of the button device to be a third button state in response to the end of the pressing operation.
In one embodiment of the present invention, the encoding module 203 is specifically configured to:
acquiring time stamp information of the pressing operation and pressing times corresponding to the pressing operation, wherein the time stamp information comprises a starting time stamp of the pressing operation and an ending time stamp of ending the pressing operation;
calculating a pressing cycle of the pressing operation according to the time stamp information and the pressing times;
and coding the timestamp information, the pressing period and the button state according to a preset coding rule to obtain a coding result, and sending the coding result to the electric equipment.
In one embodiment of the present invention, the detection module 202 includes:
a preprocessing unit 2021, configured to perform data preprocessing on the operation information of the pressing operation, to obtain processed data;
a time step dividing unit 2022, configured to perform time step division on the processing data according to the pressing period to obtain a corresponding time step, and perform input encoding processing on the processing data according to the time step to obtain a corresponding encoding sequence;
An operation adjustment unit 2023, configured to input the code sequence into a preset button detection model, obtain a detection result, and adjust the pressing operation according to the detection result.
In one embodiment of the invention, the button detection model is composed of a gating circulation unit and a full connection layer; the operation adjustment unit 2023 specifically functions to:
sequentially inputting the coding sequences into the button detection model according to the corresponding time steps;
the time step when the coding sequence is input into the button detection model is used as the current time step;
inputting the coding sequence of the current time step and the hidden state of the last time step into a gating circulation unit, and calculating the hidden state of the current time step through the gating circulation unit;
when the current time step is the last time step, taking the hidden state output by the gating circulating unit as the pressing hidden state corresponding to the pressing operation;
and inputting the pressing hidden state into the full-connection layer to obtain a detection result.
In one embodiment of the invention, the gating cycle unit includes an update gating unit and a reset gating unit;
the operation adjustment unit 2023 specifically further functions to:
The coding sequence of the current time step and the hidden state of the last time step are respectively input into an updating door blank unit and a resetting door control unit to respectively obtain an updating tensor and a door control tensor;
calculating candidate hidden states from the coding sequence of the current time step and the hidden state of the last time step;
and carrying out combination calculation on the coding sequence of the current time step, the hidden state of the last time step and the candidate hidden state to obtain the hidden state of the current time step.
In one embodiment of the present invention, the operation adjustment unit 2023 is specifically further configured to:
calculating a press detection error value of the press operation according to the detection result;
judging whether the pressing detection error value is larger than a preset error threshold value or not;
if yes, adjusting the operation information of the pressing operation according to the pressing detection error value.
This embodiment describes in detail specific functions of the respective modules and unit constitution of part of the modules on the basis of the above embodiment, and determines the button state of the button device in response to the pressing operation for the button device by the respective modules and the units in the modules; performing button detection on the pressing operation according to the operation information of the pressing operation to obtain a detection result, and adjusting the pressing operation according to the detection result; coding the button state according to a preset coding rule to obtain a coding result, and sending the coding result to the electric equipment; and controlling the electric equipment to determine and realize the corresponding button function according to the coding result. According to the method, the button function corresponding to the button device on the intelligent lithium battery is directly realized by identifying the pressing process of the button device on the intelligent lithium battery, so that the button detection circuit is prevented from being added in the corresponding electric equipment, and the structural complexity is reduced.
The above-mentioned fig. 2 and fig. 3 describe the middle button reporting device in the embodiment of the present invention in detail from the point of view of the modularized functional entity, and the following describes the button reporting device in the embodiment of the present invention in detail from the point of view of hardware processing.
Fig. 4 is a schematic structural diagram of a button reporting device according to an embodiment of the present invention, where the button reporting device 400 may have a relatively large difference due to different configurations or performances, and may include one or more processors (central processing units, CPU) 410 (e.g., one or more processors) and a memory 420, and one or more storage media 430 (e.g., one or more mass storage devices) storing application programs 433 or data 432. Wherein memory 420 and storage medium 430 may be transitory or persistent storage. The program stored in the storage medium 430 may include one or more modules (not shown), each of which may include a series of instruction operations in the button reporting device 400. Still further, the processor 410 may be configured to communicate with the storage medium 430, and execute a series of instruction operations in the storage medium 430 on the button reporting device 400 to implement the steps of the button reporting method described above.
The button reporting device 400 may also include one or more power supplies 440, one or more wired or wireless network interfaces 450, one or more input/output interfaces 460, and/or one or more operating systems 431, such as Windows Serve, mac OS X, unix, linux, freeBSD, and the like. It will be appreciated by those skilled in the art that the button reporting device structure shown in fig. 4 is not limiting of the button reporting device provided by the present invention and may include more or fewer components than shown, or may combine certain components, or may be a different arrangement of components.
The present invention also provides a computer readable storage medium, which may be a non-volatile computer readable storage medium, or may be a volatile computer readable storage medium, where instructions are stored in the computer readable storage medium, when the instructions are executed on a computer, cause the computer to perform the steps of the button reporting method.
It will be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working process of the system or apparatus and unit described above may refer to the corresponding process in the foregoing method embodiment, which is not repeated herein.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied essentially or in part or all of the technical solution or in part in the form of a software product stored in a storage medium, including instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a read-only memory (ROM), a random access memory (random access memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The above embodiments are only for illustrating the technical solution of the present invention, and not for limiting the same; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims (8)

1. The button reporting method is characterized in that the button reporting method is applied to a button reporting system, the button reporting system comprises an intelligent battery and electric equipment, button equipment is configured on the intelligent battery, and the button reporting method comprises the following steps:
in response to a pressing operation for the button device, acquiring a pressing time corresponding to the pressing operation; judging whether the pressing time is greater than a preset time threshold; if not, determining the button state of the button equipment as a first button state; if yes, determining the button state of the button equipment to be a second button state; determining a button state of the button device as a third button state in response to an end of the pressing operation;
performing button detection on the pressing operation according to the operation information of the pressing operation to obtain a detection result, and adjusting the pressing operation according to the detection result;
acquiring time stamp information of the pressing operation and pressing times corresponding to the pressing operation, wherein the time stamp information comprises a starting time stamp of the pressing operation and an ending time stamp of ending the pressing operation; calculating a pressing cycle of the pressing operation according to the time stamp information and the pressing times; coding the timestamp information, the pressing period and the button state according to a preset coding rule to obtain a coding result, and sending the coding result to the electric equipment;
And controlling the electric equipment to determine and realize the corresponding button function according to the coding result.
2. The button reporting method according to claim 1, wherein the performing button detection on the pressing operation according to the operation information of the pressing operation to obtain a detection result, and adjusting the pressing operation according to the detection result includes:
performing data preprocessing on the operation information of the pressing operation to obtain processing data;
performing time step division on the processing data according to the pressing period to obtain corresponding time steps, and performing input coding processing on the processing data according to the time steps to obtain corresponding coding sequences;
inputting the coding sequence into a preset button detection model to obtain a detection result, and adjusting the pressing operation according to the detection result.
3. The button reporting method of claim 2, wherein the button detection model is composed of a gating circulation unit and a full connection layer; inputting the coding sequence into a preset button detection model, and obtaining a detection result comprises the following steps:
sequentially inputting the coding sequences into the button detection model according to the corresponding time steps;
The time step when the coding sequence is input into the button detection model is used as the current time step;
inputting the coding sequence of the current time step and the hidden state of the last time step into a gating circulation unit, and calculating the hidden state of the current time step through the gating circulation unit;
when the current time step is the last time step, taking the hidden state output by the gating circulating unit as the pressing hidden state corresponding to the pressing operation;
and inputting the pressing hidden state into the full-connection layer to obtain a detection result.
4. The button reporting method of claim 3, wherein the gating cycle unit comprises an update gating unit and a reset gating unit;
the step of inputting the coding sequence of the current time step and the hidden state of the last time step into a gating circulation unit, and calculating the hidden state of the current time step through the gating circulation unit comprises the following steps:
the coding sequence of the current time step and the hidden state of the last time step are respectively input into an updating door blank unit and a resetting door control unit to respectively obtain an updating tensor and a door control tensor;
calculating candidate hidden states from the coding sequence of the current time step and the hidden state of the last time step;
And carrying out combination calculation on the coding sequence of the current time step, the hidden state of the last time step and the candidate hidden state to obtain the hidden state of the current time step.
5. The button reporting method according to claim 1, wherein the adjusting the pressing operation according to the detection result includes:
calculating a press detection error value of the press operation according to the detection result;
judging whether the pressing detection error value is larger than a preset error threshold value or not;
if yes, adjusting the operation information of the pressing operation according to the pressing detection error value.
6. The utility model provides a button reporting device, its characterized in that, button reporting device is applied to button reporting system, button reporting system includes intelligent battery and consumer, be configured with button equipment on the intelligent battery, button reporting device includes:
a pressing response module, configured to respond to a pressing operation for the button device, and obtain a pressing time corresponding to the pressing operation; judging whether the pressing time is greater than a preset time threshold; if not, determining the button state of the button equipment as a first button state; if yes, determining the button state of the button equipment to be a second button state; determining a button state of the button device as a third button state in response to an end of the pressing operation;
The detection module is used for carrying out button detection on the pressing operation according to the operation information of the pressing operation to obtain a detection result, and adjusting the pressing operation according to the detection result;
the encoding module is used for acquiring the time stamp information of the pressing operation and the pressing times corresponding to the pressing operation, wherein the time stamp information comprises a starting time stamp of the pressing operation and an ending time stamp of the ending of the pressing operation; calculating a pressing cycle of the pressing operation according to the time stamp information and the pressing times; coding the timestamp information, the pressing period and the button state according to a preset coding rule to obtain a coding result, and sending the coding result to the electric equipment;
and the function realizing module is used for controlling the electric equipment to determine and realize the corresponding button function according to the coding result.
7. A button reporting device, characterized in that the button reporting device comprises: a memory and at least one processor, the memory having instructions stored therein;
the at least one processor invoking the instructions in the memory to cause the button reporting device to perform the steps of the button reporting method of any one of claims 1-5.
8. A computer readable storage medium having instructions stored thereon, which when executed by a processor, implement the steps of the button reporting method of any one of claims 1-5.
CN202311748241.XA 2023-12-19 2023-12-19 Button reporting method, device, equipment and storage medium Active CN117424608B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311748241.XA CN117424608B (en) 2023-12-19 2023-12-19 Button reporting method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311748241.XA CN117424608B (en) 2023-12-19 2023-12-19 Button reporting method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN117424608A CN117424608A (en) 2024-01-19
CN117424608B true CN117424608B (en) 2024-03-26

Family

ID=89523358

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311748241.XA Active CN117424608B (en) 2023-12-19 2023-12-19 Button reporting method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117424608B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101399450A (en) * 2007-09-30 2009-04-01 联想(北京)有限公司 Apparatus and method for controlling electricity supply to portable device by multiple batteries
CN104802542A (en) * 2015-03-17 2015-07-29 杨利泓 Digital stamping device
KR101681841B1 (en) * 2015-09-02 2016-12-12 삼성물산 주식회사 System and method for controlling of smart button
CN212677333U (en) * 2020-07-17 2021-03-09 上海运久煊智能化弱电工程有限公司 Intelligent sound box with wireless charging function

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101399450A (en) * 2007-09-30 2009-04-01 联想(北京)有限公司 Apparatus and method for controlling electricity supply to portable device by multiple batteries
CN104802542A (en) * 2015-03-17 2015-07-29 杨利泓 Digital stamping device
KR101681841B1 (en) * 2015-09-02 2016-12-12 삼성물산 주식회사 System and method for controlling of smart button
CN212677333U (en) * 2020-07-17 2021-03-09 上海运久煊智能化弱电工程有限公司 Intelligent sound box with wireless charging function

Also Published As

Publication number Publication date
CN117424608A (en) 2024-01-19

Similar Documents

Publication Publication Date Title
CN100470417C (en) Fault diagnostic system and method for under industrial producing process small sample condition
CN108460397B (en) Method and device for analyzing equipment fault type, storage medium and electronic equipment
CN114218403A (en) Fault root cause positioning method, device, equipment and medium based on knowledge graph
CA2761944A1 (en) Systems devices and methods for estimating
CN117040917A (en) Intelligent switch with monitoring and early warning functions
CN111383128A (en) Method and system for monitoring running state of power grid embedded terminal equipment
CN117424608B (en) Button reporting method, device, equipment and storage medium
CN114720764A (en) Harmonic analysis method and system based on real-time monitoring data of electric meter
CN117041017A (en) Intelligent operation and maintenance management method and system for data center
CN110925936A (en) Air conditioner control method and device, computer equipment and storage medium
CN117421638A (en) Load monitoring network model construction method, load monitoring method and system
CN116894210B (en) Electronic device comprising force sensor and data processing method
CN114979267B (en) Semantic communication method and device for multi-service requirements
CN116486341A (en) Training and identifying method and device for human body behavior identification model based on RFID
CN116257885A (en) Private data communication method, system and computer equipment based on federal learning
CN114255219B (en) Symptom identification method and device, electronic equipment and storage medium
CN113076217B (en) Disk fault prediction method based on domestic platform
CN107025462B (en) real-time parallel compression processing method for telemetering data of unmanned aerial vehicle
CN115865458B (en) Network attack behavior detection method, system and terminal based on LSTM and GAT algorithm
CN113626489B (en) Method, system and computer medium for searching sensor data
CN115988100B (en) Gateway management method for intelligent perception of Internet of things of equipment based on multi-protocol self-adaption
CN117784710B (en) Remote state monitoring system and method for numerical control machine tool
CN117631599B (en) Industrial control computer data transmission method and system based on data analysis
CN112101167B (en) Remote sensing image data processing method and device
CN117493821B (en) Method and system for monitoring environment of micro-module machine room

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant