CN114546509A - Method, device, terminal and storage medium for realizing self-awakening function - Google Patents

Method, device, terminal and storage medium for realizing self-awakening function Download PDF

Info

Publication number
CN114546509A
CN114546509A CN202210190362.6A CN202210190362A CN114546509A CN 114546509 A CN114546509 A CN 114546509A CN 202210190362 A CN202210190362 A CN 202210190362A CN 114546509 A CN114546509 A CN 114546509A
Authority
CN
China
Prior art keywords
state
jump
self
waiting
jumping
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.)
Granted
Application number
CN202210190362.6A
Other languages
Chinese (zh)
Other versions
CN114546509B (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.)
Shijiazhuang Tonghe Electronics Co Ltd
Original Assignee
Shijiazhuang Tonghe Electronics 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 Shijiazhuang Tonghe Electronics Co Ltd filed Critical Shijiazhuang Tonghe Electronics Co Ltd
Priority to CN202210190362.6A priority Critical patent/CN114546509B/en
Publication of CN114546509A publication Critical patent/CN114546509A/en
Application granted granted Critical
Publication of CN114546509B publication Critical patent/CN114546509B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • G06F9/4418Suspend and resume; Hibernate and awake
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02TCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
    • Y02T10/00Road transport of goods or passengers
    • Y02T10/60Other road transportation technologies with climate change mitigation effect
    • Y02T10/70Energy storage systems for electromobility, e.g. batteries

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Power Sources (AREA)

Abstract

The invention provides a method, a device, a terminal and a storage medium for realizing a self-awakening function. The method comprises the following steps: acquiring various running states of the self-awakening function and various conditions corresponding to jumping from a waiting jumping state of the self-awakening function to each running state; determining a state jump table for jumping from the waiting jump state to various operation states according to various conditions corresponding to jumping from the waiting jump state to each operation state; and when the self-awakening function is in a waiting jump state, determining the running state to be jumped according to the current condition of the self-awakening function and a state jump table look-up table, and jumping to the running state to be jumped to realize the function of the self-awakening function corresponding to the running state to be jumped. The invention can simplify the implementation logic of the self-awakening function entering different running states. When the operation mechanism corresponding to a certain operation state is changed, the corresponding operation state in the state jump table is changed, so that debugging and maintenance are facilitated.

Description

Method, device, terminal and storage medium for realizing self-awakening function
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method, an apparatus, a terminal, and a storage medium for implementing a self-wake-up function.
Background
In a power supply System of an electric vehicle such as an electric bus or an electric car, a power supply module and a Battery Management System (BMS) are generally included. When electric vehicle is not used for a long time or is in a flameout state, in order to reduce energy consumption, all live equipment in the electric vehicle generally power off, and in order to guarantee the safety and reliability of the electric vehicle, the BMS is required to run regularly to check whether the whole vehicle system equipment is normal, and then the power module is required to wake up automatically at regular time to supply power to the BMS.
At present, when the self-awakening function of the power module is implemented, because the self-awakening function has many related contents, for example, the related contents include a condition for entering a self-awakening state and an operation mechanism thereof, a condition for closing the self-awakening function and an operation mechanism thereof, a condition for reactivating the self-awakening function and an operation mechanism thereof, and the like, and conditions for different manufacturers to enter different operation states and corresponding operation mechanisms are complicated and variable, the implementation logic of the self-awakening function is complicated, and codes are cumbersome.
Disclosure of Invention
The embodiment of the invention provides a method, a device, a terminal and a storage medium for realizing a self-awakening function, and aims to solve the problems that the existing self-awakening function is complex in realization logic and not beneficial to debugging and maintenance.
In a first aspect, an embodiment of the present invention provides a method for implementing a self-wakeup function, including:
acquiring various running states of a self-awakening function and jumping to various conditions corresponding to each running state from a waiting jump state of the self-awakening function;
determining a state jump table for jumping from the waiting jump state to various operation states according to various conditions corresponding to jumping from the waiting jump state to each operation state;
and when the self-awakening function is in the waiting jump state, determining the running state to be jumped according to the current condition of the self-awakening function and the state jump table look-up table, and jumping to the running state to be jumped to realize the function of the self-awakening function corresponding to the running state to be jumped.
In a possible implementation manner, the obtaining various operation states of the self-wakeup function includes:
obtaining the starting mode, the starting state and the output result of the self-awakening function;
and determining any starting state and any output result corresponding to each starting mode as one running state of the self-awakening function according to the difference of the starting modes, the difference of the starting states and the difference of the output results so as to determine various running states of the self-awakening function.
In a possible implementation manner, the determining, according to each condition corresponding to jumping from the wait-to-jump state to each operation state, a state jump table for jumping from the wait-to-jump state to each operation state includes:
determining a mark code corresponding to jumping from the waiting jumping state to each running state according to each condition corresponding to jumping from the waiting jumping state to each running state;
and determining a state jump table formed by various running states and corresponding mark codes according to the mark codes corresponding to the jump from the waiting jump state to each running state.
In one possible implementation, the flag code includes a condition code and a mask code;
the determining the mark code corresponding to the jump from the waiting jump state to each operation state according to each condition corresponding to the jump from the waiting jump state to each operation state comprises:
determining condition codes corresponding to jumping from the waiting jumping state to each running state according to the state of the condition needing to be detected in the conditions corresponding to jumping from the waiting jumping state to each running state;
and determining the mask code corresponding to the jump from the waiting jump state to each operation state according to the condition which does not need to be detected in the conditions corresponding to the jump from the waiting jump state to each operation state.
In a possible implementation manner, the determining, according to the flag code corresponding to each operation state jumped from the wait-to-jump state, a state jump table formed by various operation states and corresponding flag codes includes:
and determining various running states and a state jump table formed by the corresponding condition codes and the corresponding shielding codes according to the condition codes and the shielding codes corresponding to the various running states jumped from the waiting jump state to each running state.
In a possible implementation manner, the determining the operating state to be skipped according to the current condition of the self-wakeup function and the state skip table look-up table includes:
determining the current condition code to be detected of the self-awakening function according to the state of the current condition of the self-awakening function;
executing and operating, namely performing and operation on the condition codes to be detected and the shielding codes corresponding to a certain running state in the state jump table bit by bit;
comparing the result of the operation with the condition codes corresponding to the corresponding operation states, and determining the corresponding operation states as the operation states to be jumped when the result of the operation is the same as the condition codes corresponding to the corresponding operation states; and when the AND operation result is different from the condition code corresponding to the corresponding running state, skipping to the AND operation step.
In a possible implementation manner, the state jump table further includes a delay time corresponding to each operation state;
after jumping to the operating state to be jumped, the method further comprises the following steps:
and determining whether to exit the operating state to be jumped or not according to the operating mechanism of the operating state to be jumped and the delay time, and jumping to the jump waiting state.
In a second aspect, an embodiment of the present invention provides an apparatus for implementing a self-wakeup function, including:
the acquisition module is used for acquiring various running states of the self-awakening function and jumping to various conditions corresponding to each running state from a waiting jump state of the self-awakening function;
the first processing module is used for determining a state jump table for jumping from the waiting jump state to various operation states according to various conditions corresponding to jumping from the waiting jump state to each operation state;
and the second processing module is used for determining the operating state to be jumped according to the current condition of the self-awakening function and the state jump table look-up table when the self-awakening function is in the jump waiting state, and jumping to the operating state to be jumped to realize the function of the self-awakening function corresponding to the operating state to be jumped.
In a third aspect, an embodiment of the present invention provides a terminal, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of the method according to the first aspect or any possible implementation manner of the first aspect when executing the computer program.
In a fourth aspect, the present invention provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the computer program implements the steps of the method according to the first aspect or any one of the possible implementation manners of the first aspect.
The embodiment of the invention provides a method, a device, a terminal and a storage medium for realizing a self-awakening function, which are characterized in that various running states of the self-awakening function are obtained, and jump is carried out from a waiting jump state of the self-awakening function to each condition corresponding to each running state; determining a state jump table for jumping from the waiting jump state to various operation states according to various conditions corresponding to jumping from the waiting jump state to each operation state; and when the self-awakening function is in a waiting jump state, determining the running state to be jumped according to the current condition of the self-awakening function and a state jump table look-up table, and jumping to the running state to be jumped to realize the function of the self-awakening function corresponding to the running state to be jumped. According to the method for realizing the self-awakening function, the various operation states of the waiting jump state and the self-awakening function are set, and the conditions corresponding to the jump from the waiting jump state to each operation state are converted into the state jump table, so that the jump from the waiting jump state to the operation state to be jumped can be realized according to the current conditions and the state jump table of the self-awakening function, and the realization logic of the self-awakening function entering different operation states is simplified. When the operation mechanism corresponding to a certain operation state is changed, the corresponding operation state in the state jump table is changed, so that debugging and maintenance are facilitated.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a flowchart illustrating an implementation method of a self-wakeup function according to an embodiment of the present invention;
FIG. 2 is a state switching diagram for jumping from a wait-to-jump state to each run state according to an embodiment of the present invention;
FIG. 3 is a flow chart of the operation mechanism of the operation state 2 according to the embodiment of the present invention;
fig. 4 is a schematic structural diagram of an apparatus for implementing a self-wake-up function according to an embodiment of the present invention;
fig. 5 is a schematic diagram of a terminal according to an embodiment of the present invention.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the invention. It will be apparent, however, to one skilled in the art that the present invention may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present invention with unnecessary detail.
To make the objects, technical solutions and advantages of the present invention more apparent, the following description will be made by way of specific embodiments with reference to the accompanying drawings.
The self-wake-up function will be explained first:
wherein, to the module that can possess the function of waking up certainly, under the condition that the function of waking up certainly is opened, basic function of waking up certainly is: after the module enters the sleep state, the sleep time is up, the module automatically exits the sleep state and enters the awakening state. After the module enters the awakening state, a certain condition is reached, and whether the module enters the dormant state again or not is determined. And after entering the dormant state again, after the dormant time is up, entering the awakening state again. The process is circulated, and the whole process module is executed by itself.
The sleep states mentioned above may be: the module is powered off, and no output is provided, and no communication state exists. The wake-up state may be: the module has communication and also has output state.
On the basis, the sleep state may be entered into the sleep state due to other situations besides the simple entry into the sleep state through the wake state. Thus for clarity of description, the sleep states are divided into: self-awakening normal dormancy and self-awakening abnormal dormancy.
For example, depending on customer needs, the self-awakening abnormal sleep may be: in the awakening state, if communication overtime occurs, the self-awakening function is closed, and meanwhile, the self-awakening function enters the dormant state.
For a module with a self-awakening function, the self-awakening function is turned off, that is, the module no longer has the self-awakening function under certain conditions, and the accompanying phenomenon is that the module no longer has states of dormancy, awakening, re-dormancy and re-awakening.
The under-voltage protection is set to a wake-up protection voltage 595.1VDC and a hard-line protection voltage 395.6VDC, for example, according to customer requirements.
When the input voltage of the module is lower than the wake-up protection voltage, the self-wake-up function is turned off, but whether the output is turned off or not is determined by the state at the last moment: if the self-awakening function is in the awakening state or the sleeping state at the last moment, the current state is exited, and the output is closed. If the last time is in the hard-line awakening state, the state of the last time is kept, namely the output is kept when the output exists at the last time, and the output does not exist when the output does not exist at the last time.
When the input voltage of the module is lower than the hard line protection voltage, the self-awakening function is closed and the output is closed.
On the basis, after the self-awakening function of the module is closed, the self-awakening function can be reactivated through some means, namely, the module enters a reactivated self-awakening state. After the self-awakening function is reactivated, the module will have self-awakening capability again. The conditions for reactivating the self-waking function may not be the same for different customer requirements, for example, some manufacturers: the self-awakening function can be reactivated by adding a hard wire and simultaneously turning off the self-awakening function for fault elimination.
From the above description of the self-wake-up function: (1) the condition of entering the self-wake state or the hard-line wake state relates to whether a hard line exists, whether a hard line switch from presence to absence (i.e., the last hard line state, the present hard line state) exists, and the like. (2) The conditions for entering the awake state and the sleep state in the self-awake function, in addition to the above item (1), further include: and if the communication is overtime, whether the received message command is allowed to be awakened is judged. Namely: communication message content, whether timeout occurs, etc. (3) The conditions for turning off the self-awakening function include awakening protection voltage, enabling under-voltage protection and the like. (4) The conditions for reactivating the self-awakening function are similar to those described in the above item (1). It should be noted that the above-described conditions are not limited thereto, because the above-described conditions are only an example of a certain customer requirement, some customer requirements are different from the above, and some customer requirements involve more complicated contents and conditions.
That is, the module with the self-wake-up function is related to more contents, for example, the condition for entering the self-wake-up state and the operation mechanism thereof, the condition for turning off the self-wake-up function and the operation mechanism thereof, the condition for reactivating the self-wake-up function and the operation mechanism thereof, the condition for hard-line wake-up and the operation mechanism thereof, and the like. The above complicated and variable contents and conditions cause the following problems when the self-awakening function of the module is realized:
1. the self-awakening functions required by different clients comprise different operation mechanisms, and the conditions for entering different operation mechanisms are different, so that the self-awakening functions are complex in implementation logic and complex in codes.
2. Current implementations of self-wake functions are not easily modified and maintained when customer needs change.
In order to solve the above problem, referring to fig. 1, it shows an implementation flowchart of an implementation method of a self-wakeup function provided by an embodiment of the present invention, which is detailed as follows:
in step 101, various operation states of the self-awakening function are obtained, and various conditions corresponding to jumping from the waiting jump state of the self-awakening function to each operation state are obtained.
In this embodiment, because the self-awakening function of different customer requirements includes different operation mechanisms and different conditions for entering different operation mechanisms, the self-awakening function and the enabling awakening function can be considered as an integral function module according to the result of the self-awakening function of the customer requirements, different operation mechanisms of the integral function module are arranged in a list one by one, one operation mechanism corresponds to one operation state, a waiting jump state is set on the basis, and the corresponding operation mechanisms in different operation states are realized by jumping from the waiting jump state to different operation states, so that the problem that different operation mechanisms are complex and changeable is solved.
Optionally, obtaining various operating states of the self-wakeup function may include:
the starting mode, starting state and output result of the wake-up function are obtained.
According to the different opening modes, the different opening states and the different output results, any opening state and any output result corresponding to each opening mode are determined as one operation state of the self-awakening function, so that various operation states of the self-awakening function can be determined.
In this embodiment, although the self-wake-up function includes different operating mechanisms and different conditions for entering different operating mechanisms, no matter how complex the conditions are and how complex the processing manner under each condition is, the final result of the self-wake-up function is generally only related to the following contents:
1. whether the module outputs (i.e., whether the module normally outputs voltage, i.e., the output result of the module's self-wake-up function).
2. Whether it relates to the module wake-up mode (i.e., whether the module is self-awakening or hardwired wake-up, i.e., the mode in which the module's self-wake-up function is turned on).
3. Whether the module is in communication with (i.e., sleeping or not sleeping, i.e., the on state of the module's self-wake-up function).
Therefore, for example, starting from the result of the self-awakening function, according to the difference of the on-modes, the difference of the on-states, and the difference of the output results, the self-awakening function of the module can be divided into: operation state 1: self-wake-up with output; operation state 2: self-wake-normal sleep; operating state 3: self-wake-abnormal sleep; operation state 4: closing the self-awakening function abnormally; operation state 5: hard-wired wake-up-with output; the operation state 6: hard line wake-normal no output; an operating state 7; hard-wired wake-exception no output; then from "state 0: the state switching diagram for the wait for jump state "jump to each run state is shown in fig. 2.
The embodiment is only an example of various operation states of the self-awakening function, and is not limited to various operation states of the self-awakening function, and various operation states of the self-awakening function may be determined according to different customer requirements, for example, according to different customer requirements, corresponding operation states may be added, deleted, or modified on the basis of the operation states 1 to 7.
In step 102, a state jump table for jumping from the jump-waiting state to various operation states is determined according to various conditions corresponding to jumping from the jump-waiting state to each operation state.
The conditions for entering the same operation state may be different due to different customer requirements, and even if the conditions are different for a certain fixed customer requirement, the combination of different conditions may also enter the same operation state, which causes the problem that the existing implementation mode of the self-awakening function has complex conditions. Also, switching between different operating states can be complicated due to the complexity of the conditions.
In the step 101, the self-awakening function is divided into a waiting jump state and various operation states, each operation state can be used as an index of an operation mechanism corresponding to the operation state, and the switching logic between the operation states is simplified by using the index type state switching mode. In this embodiment, on the basis of step 101, each condition corresponding to jumping from the wait-to-jump state to each operating state is converted into a state jump table, that is, a complex and changeable state transition expression (i.e., a condition transition process) entering each operating state is transferred into one table, and when a condition changes, the table is modified without modifying the implementation logic of a code, thereby facilitating modification and maintenance.
Illustratively, for a certain customer requirement, the conditions for jumping from the waiting jump state to various running states are arranged in a list, and a state jump table in the form of conditions can be obtained as shown in table 1.
TABLE 1 conditional state jump table
Figure BDA0003524313530000091
In table 1, "-" represents the condition that does not need to be detected, the open state, the open mode and the output result are the final results of the self-awakening function, and the former awakening under-voltage, the enabling under-voltage, the communication timeout, the last hard wire state, the current hard wire state and the communication command are the conditions that lead to the final results. Wherein different combinations of conditions may lead to the same end result. The phenomenon and the operation mechanism of the same final result are the same.
Optionally, determining a state jump table for jumping from the wait jump state to various operation states according to various conditions corresponding to jumping from the wait jump state to each operation state may include:
and determining the mark code corresponding to jumping from the waiting jumping state to each running state according to each condition corresponding to jumping from the waiting jumping state to each running state.
And determining a state jump table formed by various running states and corresponding mark codes according to the mark codes corresponding to the various running states jumped from the waiting jump state to the various running states.
Optionally, the flag code may include a condition code and a mask code.
Determining the flag code corresponding to the jump from the wait-to-jump state to each operation state according to the conditions corresponding to the jump from the wait-to-jump state to each operation state may include:
and determining the condition codes corresponding to the condition codes for jumping from the waiting jump state to each operation state according to the state of the condition needing to be detected in the conditions corresponding to jumping from the waiting jump state to each operation state.
And determining the mask code corresponding to the jump from the waiting jump state to each operation state according to the condition which does not need to be detected in the conditions corresponding to the jump from the waiting jump state to each operation state.
Optionally, determining a state jump table formed by various operating states and corresponding flag codes according to the flag codes corresponding to each operating state jumped from the waiting jump state, where the state jump table may include:
and determining various running states and a state jump table formed by the corresponding condition codes and the corresponding shielding codes according to the condition codes and the shielding codes corresponding to each running state jumped from the waiting jump state.
In connection with table 1, an example of an operating state is given below. Taking the self-awakening normal sleep state as an example, the conditions are expressed by a 16-bit flag code, and the conditions that cause the self-awakening normal sleep are combined as follows:
(1) awakening the undervoltage normally, enabling the undervoltage normally, communicating overtime normally, and last time, wherein the hard wire state is a hard wire, the hard wire state is a non-hard wire, the communication command is forbidden to be valid (1) or forbidden to be invalid (0), and then the binary system corresponding to the condition code is represented as follows: since the communication command may be disabled or disabled, i.e. the communication command is a condition that does not need to be detected, the binary representation of the condition code may be simplified to be 000101 and 000100, and the hexadecimal representation of the condition code is 0x 04. Since the and operation of "1" and "1" is "1" and the and operation of "1" and "0" is "0", the condition that needs to be detected is set to 1 and the condition that does not need to be detected is set to 0 in order to mask the condition that does not need to be detected. Therefore, the binary representation of the mask corresponding to the condition code is: 00111110, the hexadecimal representation of the mask is 0x 3E.
(2) Awakening the undervoltage normally, enabling the undervoltage normally, communicating overtime normally, and last time, wherein the hard wire state is a hardwire-free state, the communication command is forbidden to be effective (1), and then the binary representation of the condition code is as follows: 000001, the hexadecimal representation of the condition code is 0x01, and the binary representation of the mask code is: 00111111, hexadecimal representation of the mask is 0x 3F.
The state jump table in the form of a flag code obtained in this way is shown in table 2:
TABLE 2 state jump table in the form of flag codes
Condition code Shielding code Operating state to be jumped Delay time
0x00 0x3F 1 100
0x01 0x3F 2 30
0x04 0x3E 2 30
0x08 0x0A 3 40
0x30 0x3A 3 40
0x20 0x3A 3 40
0x06 0x37 5 60
0x02 0x37 5 60
0x07 0x37 6 0
0x03 0x37 6 0
0x32 0x3A 7 0
It should be noted that it is not necessary for a condition code and a mask code in table 2 to jump to a run state, and it is possible that multiple condition codes and multiple mask codes jump to the same run state, depending on whether the condition codes and the mask codes can be merged.
In this embodiment, the condition of entering the same operation state is sorted and summarized into one or more condition codes, and the condition codes have shielding codes, so that the condition which does not need to be detected is shielded, and the state jump table can be simpler and clearer.
Optionally, the state jump table may further include a delay time corresponding to each operation state.
The delay time in table 2 is only an example, and may be set according to different customer requirements. The delay time corresponding to each operation state is set in the state jump table, so that the problem of different delay times required by different clients can be solved, the editing of the delay time is facilitated, and the adaptability to different client requirements is improved.
In step 103, when the self-awakening function is in the waiting-to-jump state, the operating state to be jumped is determined according to the current condition of the self-awakening function and the state jump table look-up table, and the operating state to be jumped is jumped to, so that the function of the self-awakening function corresponding to the operating state to be jumped is realized.
Optionally, determining the operating state to be skipped according to the current condition of the self-wakeup function and a table look-up of the state skip table, which may include:
and determining the current condition code to be detected of the self-awakening function according to the current condition state of the self-awakening function.
And executing and operating, namely performing and operation on the condition codes to be detected and the mask codes corresponding to a certain running state in the state jump table bit by bit.
Comparing the result of the operation with the condition codes corresponding to the corresponding operation states, and determining the corresponding operation states as the operation states to be jumped when the result of the operation is the same as the condition codes corresponding to the corresponding operation states; and jumping to the AND operation step when the result of the AND operation is different from the condition code corresponding to the corresponding running state.
Exemplarily, a certain mask code is set to be lamBit, the corresponding condition code is sumFlg, and according to the state of the current condition of the self-awakening function, the current condition code to be detected is determined to be tempFlg, and then according to the judgment: whether the (tempFlg & lamBit) is equal to the corresponding sumFlg can be judged whether the operation state is to be jumped.
For example, referring to table 2, if the binary representation of the current condition code tempFlg to be detected is 00000101, 00000100, 10000101, 10000100, 01000101, 01000100, 11000101, 11000100, that is, the corresponding hexadecimal representation is 0x05, 0x04, 0x85, 0x84, 0x45, 0x44, 0xC5, 0xC4, at this time, the and operation (tempFlg & lamBit) performed with the mask code lamBit0x3E is 0x04, at this time, it can be determined that the operation state 2 is the operation state to be skipped, and the other skipping operation states are not the operation states to be skipped.
After jumping to the running state to be jumped, the method may further include:
and determining whether to exit the operating state to be jumped or not according to the operating mechanism and the delay time of the operating state to be jumped, and jumping to a jump waiting state.
It is worth noting that: and looking up a table according to the current condition and state jump table of the self-awakening function, jumping to the corresponding operating state to be jumped, and determining an output result according to the processing mode of the corresponding condition of the operating state to be jumped. Then, according to the respective operation mechanism of the operation state to be jumped, it can be determined whether to continuously remain in the operation state or exit the operation state, and the jump waiting state entering the state 0 waits for determining a new operation state to be jumped.
Exemplary, operating state 1: the self-wake-with-output operation mechanism may be: the self-wakeup flag is set (i.e., set to 1), and the output flag is set to determine whether to switch back to the wait for jump state of state 0 or continue in the run state 1 waiting for the arrival of the delay time, depending on whether the delay time is reached. Operating state 2: the operation mechanism of self-wake-normal sleep may be: the self-awakening flag is set, the output flag is reset (namely, cleared 0), and the self-awakening flag is used for determining whether the state is switched back to the waiting jump state of the state 0 or the waiting time is continued to arrive in the running state 2 according to whether the delay time is reached, the sleep time is reached or a hard line exists. The operating mechanism of the specific operating state 2 can be taken into account in fig. 3.
The embodiment of the invention obtains various running states of the self-awakening function and jumps to various conditions corresponding to each running state from the waiting jump state of the self-awakening function; determining a state jump table for jumping from the waiting jump state to various operation states according to various conditions corresponding to jumping from the waiting jump state to each operation state; and when the self-awakening function is in the waiting jump state, determining the running state to be jumped according to the current condition of the self-awakening function and a state jump table look-up table, and jumping to the running state to be jumped to realize the function of the self-awakening function corresponding to the running state to be jumped. According to the method for realizing the self-awakening function, the various operation states of the waiting jump state and the self-awakening function are set, and the conditions corresponding to the jump from the waiting jump state to each operation state are converted into the state jump table, so that the jump from the waiting jump state to the operation state to be jumped can be realized according to the current conditions and the state jump table of the self-awakening function, and the realization logic of the self-awakening function entering different operation states is simplified. When the operation mechanism corresponding to a certain operation state is changed, the corresponding operation state in the state jump table is changed, so that debugging and maintenance are facilitated.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.
The following are embodiments of the apparatus of the invention, reference being made to the corresponding method embodiments described above for details which are not described in detail therein.
Fig. 4 is a schematic structural diagram of an apparatus for implementing a self-wakeup function according to an embodiment of the present invention, and for convenience of description, only parts related to the embodiment of the present invention are shown, which are detailed as follows:
as shown in fig. 4, the apparatus for implementing the self-wakeup function includes: an acquisition module 41, a first processing module 42 and a second processing module 43.
An obtaining module 41, configured to obtain various operation states of the self-awakening function, and jump from a wait-to-jump state of the self-awakening function to each condition corresponding to each operation state;
a first processing module 42, configured to determine a state jump table for jumping from the jump-waiting state to each operation state according to each condition corresponding to jumping from the jump-waiting state to each operation state;
and a second processing module 43, configured to determine, when the self-awakening function is in the waiting-to-jump state, an operating state to be jumped according to the current condition of the self-awakening function and the table look-up table of the state jump table, and jump to the operating state to be jumped, so as to implement a function of the self-awakening function corresponding to the operating state to be jumped.
The embodiment of the invention obtains various running states of the self-awakening function and jumps to various conditions corresponding to each running state from the waiting jump state of the self-awakening function; determining a state jump table for jumping from the waiting jump state to various operation states according to various conditions corresponding to jumping from the waiting jump state to each operation state; and when the self-awakening function is in a waiting jump state, determining the running state to be jumped according to the current condition of the self-awakening function and a state jump table look-up table, and jumping to the running state to be jumped to realize the function of the self-awakening function corresponding to the running state to be jumped. According to the method for realizing the self-awakening function, the various operation states of the waiting jump state and the self-awakening function are set, and the conditions corresponding to the jump from the waiting jump state to each operation state are converted into the state jump table, so that the jump from the waiting jump state to the operation state to be jumped can be realized according to the current conditions and the state jump table of the self-awakening function, and the realization logic of the self-awakening function entering different operation states is simplified. When the operation mechanism corresponding to a certain operation state is changed, the corresponding operation state in the state jump table is changed, so that debugging and maintenance are facilitated.
In a possible implementation manner, the obtaining module 41 may be configured to obtain an on mode, an on state, and an output result of the self-wakeup function;
and determining any starting state and any output result corresponding to each starting mode as one running state of the self-awakening function according to the difference of the starting modes, the difference of the starting states and the difference of the output results so as to determine various running states of the self-awakening function.
In a possible implementation manner, the first processing module 42 may be configured to determine, according to respective conditions corresponding to jumping from the wait-to-jump state to each of the operating states, a flag code corresponding to jumping from the wait-to-jump state to each of the operating states; and determining a state jump table formed by various running states and corresponding mark codes according to the mark codes corresponding to the jump from the waiting jump state to each running state.
In one possible implementation, the flag code includes a condition code and a mask code; a first processing module 42, configured to determine, according to a state of a condition that needs to be detected in the respective conditions corresponding to the jump from the jump waiting state to each running state, a condition code corresponding to the jump from the jump waiting state to each running state; and determining the mask code corresponding to the jump from the waiting jump state to each operation state according to the condition which does not need to be detected in the conditions corresponding to the jump from the waiting jump state to each operation state.
In a possible implementation manner, the first processing module 42 may be configured to determine, according to the condition code and the mask code corresponding to the jump from the jump waiting state to each operation state, a state jump table formed by various operation states and the corresponding condition code and mask code.
In a possible implementation manner, the second processing module 43 may be configured to determine, according to a state of a current condition of the self-wakeup function, a current condition code to be detected of the self-wakeup function; executing and operating, namely performing and operation on the condition codes to be detected and the shielding codes corresponding to a certain running state in the state jump table bit by bit; comparing the result of the operation with the condition codes corresponding to the corresponding operation states, and determining the corresponding operation states as the operation states to be jumped when the result of the operation is the same as the condition codes corresponding to the corresponding operation states; and skipping to the AND operation step when the result of the AND operation is different from the condition code corresponding to the corresponding running state.
In a possible implementation manner, the state jump table further includes a delay time corresponding to each operation state; the second processing module 43 may be further configured to determine whether to exit the running state to be skipped and skip to the jump-waiting state according to the running mechanism of the running state to be skipped and the delay time.
Fig. 5 is a schematic diagram of a terminal according to an embodiment of the present invention. As shown in fig. 5, the terminal 5 of this embodiment includes: a processor 50, a memory 51 and a computer program 52 stored in the memory 51 and executable on the processor 50. The processor 50 executes the computer program 52 to implement the steps of the above-mentioned embodiments of the implementation method of the self-wake-up function, such as the steps 101 to 103 shown in fig. 1. Alternatively, the processor 50, when executing the computer program 52, implements the functions of the various modules/units in the above-described apparatus embodiments, such as the functions of the modules 41 to 43 shown in fig. 4.
Illustratively, the computer program 52 may be partitioned into one or more modules/units, which are stored in the memory 51 and executed by the processor 50 to implement the present invention. One or more of the modules/units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution of the computer program 52 in the terminal 5. For example, the computer program 52 may be divided into modules/units 41 to 43 shown in fig. 4.
The terminal 5 may be a desktop computer, a notebook, a palm computer, a cloud server, or other computing devices. The terminal 5 may include, but is not limited to, a processor 50, a memory 51. It will be appreciated by those skilled in the art that fig. 5 is only an example of a terminal 5 and does not constitute a limitation of the terminal 5, and that it may comprise more or less components than those shown, or some components may be combined, or different components, e.g. the terminal may further comprise input output devices, network access devices, buses, etc.
The Processor 50 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 51 may be an internal storage unit of the terminal 5, such as a hard disk or a memory of the terminal 5. The memory 51 may also be an external storage device of the terminal 5, such as a plug-in hard disk provided on the terminal 5, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like. Further, the memory 51 may also include both an internal storage unit of the terminal 5 and an external storage device. The memory 51 is used for storing computer programs and other programs and data required by the terminal. The memory 51 may also be used to temporarily store data that has been output or is to be output.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules, so as to perform all or part of the functions described above. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. For the specific working processes of the units and modules in the system, reference may be made to the corresponding processes in the foregoing method embodiments, which are not described herein again.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus/terminal and method may be implemented in other ways. For example, the above-described apparatus/terminal embodiments are merely illustrative, and for example, a module or a unit may be divided into only one logical function, and may be implemented in other ways, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
Units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit may be implemented in the form of hardware, or may also be implemented in the form of a software functional unit.
The integrated modules/units, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. Based on such understanding, all or part of the flow in the method according to the embodiments of the present invention may also be implemented by a computer program, which may be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method embodiments for implementing the self-wake-up functions may be implemented. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer readable medium may include: any entity or device capable of carrying computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. It should be noted that the computer readable medium may include any suitable increase or decrease as required by legislation and patent practice in the jurisdiction, for example, in some jurisdictions, computer readable media may not include electrical carrier signals and telecommunications signals in accordance with legislation and patent practice.
The above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present 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 solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not depart from the spirit and scope of the embodiments of the present invention, and they should be construed as being included therein.

Claims (10)

1. A method for implementing a self-wake-up function, comprising:
acquiring various running states of a self-awakening function and jumping to various conditions corresponding to each running state from a waiting jump state of the self-awakening function;
determining a state jump table for jumping from the waiting jump state to various operation states according to various conditions corresponding to jumping from the waiting jump state to each operation state;
and when the self-awakening function is in the waiting jump state, determining the running state to be jumped according to the current condition of the self-awakening function and the state jump table look-up table, and jumping to the running state to be jumped to realize the function of the self-awakening function corresponding to the running state to be jumped.
2. The method for implementing the self-awakening function according to claim 1, wherein the obtaining of the various running states of the self-awakening function comprises:
obtaining a starting mode, a starting state and an output result of the self-awakening function;
and determining any one opening state and any one output result corresponding to each opening mode as one operation state of the self-awakening function according to the difference of the opening modes, the difference of the opening states and the difference of the output results so as to determine various operation states of the self-awakening function.
3. The method for implementing the self-awakening function according to claim 1 or 2, wherein the determining the state jump table for jumping from the wait-to-jump state to each operation state according to the respective conditions corresponding to jumping from the wait-to-jump state to each operation state comprises:
determining a mark code corresponding to jumping from the waiting jumping state to each running state according to each condition corresponding to jumping from the waiting jumping state to each running state;
and determining a state jump table formed by various running states and corresponding mark codes according to the mark codes corresponding to the jump from the waiting jump state to each running state.
4. The method for implementing self-awakening function according to claim 3, wherein the flag code comprises a condition code and a mask code;
the determining the mark code corresponding to the jump from the waiting jump state to each operation state according to each condition corresponding to the jump from the waiting jump state to each operation state comprises:
determining condition codes corresponding to jumping from the waiting jumping state to each running state according to the state of the condition needing to be detected in the conditions corresponding to jumping from the waiting jumping state to each running state;
and determining the mask code corresponding to the jump from the waiting jump state to each operation state according to the condition which does not need to be detected in the conditions corresponding to the jump from the waiting jump state to each operation state.
5. The method for implementing self-awakening function according to claim 4, wherein the determining the state jump table formed by the various operation states and the corresponding flag codes according to the flag codes corresponding to the jump from the wait jump state to the each operation state comprises:
and determining various running states and a state jump table formed by the corresponding condition codes and the corresponding shielding codes according to the condition codes and the shielding codes corresponding to the various running states jumped from the waiting jump state to each running state.
6. The method for implementing the self-awakening function according to claim 5, wherein the determining the operating state to be jumped according to the current condition of the self-awakening function and the state jump table look-up table comprises:
determining the current condition code to be detected of the self-awakening function according to the state of the current condition of the self-awakening function;
executing and operating, namely performing and operation on the condition codes to be detected and the shielding codes corresponding to a certain running state in the state jump table bit by bit;
comparing the result of the operation with the condition codes corresponding to the corresponding operation states, and determining the corresponding operation states as the operation states to be jumped when the result of the operation is the same as the condition codes corresponding to the corresponding operation states; and when the AND operation result is different from the condition code corresponding to the corresponding running state, skipping to the AND operation step.
7. The method for implementing self-awakening function according to any one of claims 1-6, wherein the state jump table further comprises a delay time corresponding to each operation state;
after jumping to the operating state to be jumped, the method further comprises the following steps:
and determining whether to exit the operating state to be jumped or not according to the operating mechanism of the operating state to be jumped and the delay time, and jumping to the jump waiting state.
8. An apparatus for implementing a self-wake-up function, comprising:
the acquisition module is used for acquiring various running states of the self-awakening function and jumping to various conditions corresponding to each running state from a waiting jump state of the self-awakening function;
the first processing module is used for determining a state jump table for jumping from the waiting jump state to various running states according to various conditions corresponding to jumping from the waiting jump state to each running state;
and the second processing module is used for determining the operating state to be jumped according to the current condition of the self-awakening function and the state jump table look-up table when the self-awakening function is in the jump waiting state, and jumping to the operating state to be jumped to realize the function of the self-awakening function corresponding to the operating state to be jumped.
9. A terminal, characterized in that it comprises a memory for storing a computer program and a processor for calling and running the computer program stored in the memory, performing the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 7.
CN202210190362.6A 2022-02-28 2022-02-28 Method, device, terminal and storage medium for realizing self-wake-up function Active CN114546509B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210190362.6A CN114546509B (en) 2022-02-28 2022-02-28 Method, device, terminal and storage medium for realizing self-wake-up function

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210190362.6A CN114546509B (en) 2022-02-28 2022-02-28 Method, device, terminal and storage medium for realizing self-wake-up function

Publications (2)

Publication Number Publication Date
CN114546509A true CN114546509A (en) 2022-05-27
CN114546509B CN114546509B (en) 2023-10-10

Family

ID=81661447

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210190362.6A Active CN114546509B (en) 2022-02-28 2022-02-28 Method, device, terminal and storage medium for realizing self-wake-up function

Country Status (1)

Country Link
CN (1) CN114546509B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107277902A (en) * 2017-06-19 2017-10-20 努比亚技术有限公司 Terminal power consumption control method, mobile terminal and computer-readable recording medium
US20190042279A1 (en) * 2018-02-07 2019-02-07 Intel Corporation Low latency boot from zero-power state
CN111391849A (en) * 2020-03-11 2020-07-10 三一机器人科技有限公司 Vehicle control method, device, vehicle and readable storage medium
CN112977160A (en) * 2021-04-06 2021-06-18 广州汽车集团股份有限公司 Battery management method, battery system, vehicle, and computer storage medium
CN113696780A (en) * 2020-05-22 2021-11-26 比亚迪股份有限公司 Self-awakening diagnosis method of battery management system, battery management system and vehicle
CN113961258A (en) * 2021-10-30 2022-01-21 重庆长安汽车股份有限公司 Method and system for recognizing abnormal automobile state based on time sequence transfer and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107277902A (en) * 2017-06-19 2017-10-20 努比亚技术有限公司 Terminal power consumption control method, mobile terminal and computer-readable recording medium
US20190042279A1 (en) * 2018-02-07 2019-02-07 Intel Corporation Low latency boot from zero-power state
CN111391849A (en) * 2020-03-11 2020-07-10 三一机器人科技有限公司 Vehicle control method, device, vehicle and readable storage medium
CN113696780A (en) * 2020-05-22 2021-11-26 比亚迪股份有限公司 Self-awakening diagnosis method of battery management system, battery management system and vehicle
CN112977160A (en) * 2021-04-06 2021-06-18 广州汽车集团股份有限公司 Battery management method, battery system, vehicle, and computer storage medium
CN113961258A (en) * 2021-10-30 2022-01-21 重庆长安汽车股份有限公司 Method and system for recognizing abnormal automobile state based on time sequence transfer and storage medium

Also Published As

Publication number Publication date
CN114546509B (en) 2023-10-10

Similar Documents

Publication Publication Date Title
US9529412B2 (en) System for reducing energy consumption of a device and a method therefor
EP3800763A1 (en) Multi-mode uninterruptible power supply control method, control apparatus and control terminal
CN109995097B (en) Power-on control method, device and system, computer device and storage medium
US20100125743A1 (en) Electronic device for reducing power consumption during off of computer motherboard
CN107911562A (en) A kind of event-prompting method, system and terminal device
CN113459827B (en) Power-on and power-off method of function integrated type motor controller
CN111694677A (en) Message queue management method, device, terminal and computer-readable storage medium
CN113869477B (en) RFID (radio frequency identification) tag chip and chip power consumption control method
CN114546509B (en) Method, device, terminal and storage medium for realizing self-wake-up function
CN104699224A (en) Power-saving control method
CN109996319B (en) Beacon signal processing device
CN114116029B (en) Control method, device, equipment and medium for waking up low power consumption of infrared receiver
CN112421760B (en) Method and device for controlling exciting current of UPS isolation transformer
CN111376245A (en) Steering engine control method and system and robot
CN114442500B (en) Control method, device and equipment of lighting system
CN104699223A (en) Terminal
CN114564242A (en) Method, device, terminal and storage medium for realizing self-awakening function
CN111404121B (en) Power supply under-voltage protection method, system, medium and device
US20210349516A1 (en) Energy saving device and method for saving energy in data center
CN114884724B (en) Cloud server interaction method and device, readable storage medium and terminal equipment
CN113422404B (en) Power supply control method and power supply
CN112803524B (en) Battery charging control method, device and terminal
CN115294736B (en) Alarm message control method, device, terminal equipment and storage medium
CN117134638B (en) Upgrade method, inverter, parallel operation system and readable storage medium
CN116722615A (en) Low-power consumption control method, equipment and storage medium of battery management system

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