Method and device for managing state of equipment and related product

By setting the idle state cumulative time and wake-up signal detection mechanism in the electronic device, the device is controlled to enter a dormant state and quickly resume the working state, solving the problems of large power consumption of electronic devices and short response time, and achieving efficient energy management and timely response of the device.

CN120045050APending Publication Date: 2025-05-27NETEASE YOUDAO (HANGZHOU) SMART TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510087962.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-20
Publication Date
2025-05-27

AI Technical Summary

Technical Problem

Electronic devices consume a lot of power in their working state, making it difficult to achieve a balance between timely response and long-term standby time, and the existing solutions are limited in improvement.

Method used

By determining whether the accumulated time of the idle state of the device in the working state reaches the preset time, the device controls the device to enter the sleep state, and exits the sleep state when the wake-up signal is detected, and the operation corresponding to the wake-up signal is performed.

Benefits of technology

It reduces the overall power consumption of the equipment and realizes the timely response of the equipment. It can realize the function of lifting the pen and sweeping the pen, such as the dictionary pen, and balances the contradiction between timely response and long-term standby.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120045050A_ABST
    Figure CN120045050A_ABST
Patent Text Reader

Abstract

The invention discloses a method and a device for managing the state of equipment and a related product. The method comprises the following steps: determining whether the accumulated duration of the idle state of the equipment in a working state reaches a preset duration or not; under the condition that the accumulated duration reaches the preset duration, controlling the equipment to enter a dormant state; when the equipment is in the dormant state, detecting whether a wake-up signal is generated or not in real time; and under the condition that the wake-up signal is detected to be generated, controlling the equipment to exit the dormant state, and executing an operation corresponding to the wake-up signal, so as to realize management of the state of the equipment. Through the method for managing the state of the equipment, the balance between timely response and long-time standby is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure generally relates to the field of energy management technology. More specifically, the present disclosure relates to a solution for managing the state of a device. Background Art

[0002] With the development of technology, electronic devices are becoming more and more portable and more powerful. However, at the same time, due to weight and volume restrictions, the batteries of such electronic devices are also severely limited, and due to the enhancement of functions, the power consumption of electronic devices in the working state will inevitably increase significantly. At the same time, such electronic devices are also required to be able to respond to user needs in a timely manner. For example, a dictionary pen needs to be able to scan as soon as the pen is picked up, that is, when the user wants to query a word in a book, the dictionary pen can complete the image acquisition, text recognition and text translation of the word to be translated without the user having to wait for a long time. However, it takes a long time for electronic devices to start from shutdown to working state, and the user experience is poor, which requires the dictionary pen to maintain a working state for a long time. Taking a 1500mah battery as an example, the current of a traditional dictionary pen in the working state is about 200ma. If it is always in the working state, the battery can only standby for 7.5 hours with a full charge. Here comes the contradiction between timely response and long standby time.

[0003] Common solutions to this contradiction are to increase battery energy density, use hardware with lower power consumption, and improve program algorithms, but the improvements of these methods are relatively limited and do not fundamentally alleviate this contradiction.

[0004] In view of this, there is an urgent need to provide a technical solution for managing the status of a device so as to reduce the overall power consumption of the device and achieve timely response to user needs, such as realizing the "pick-up-and-scan" function of a dictionary pen, and ultimately achieving a balance between timely response and long standby time. Summary of the invention

[0005] In order to at least solve the technical problems mentioned above, the present disclosure proposes a method, an apparatus and a technical solution of related products for managing the status of a device in multiple aspects.

[0006] In a first aspect, the present disclosure provides a method for managing the status of a device, comprising: determining whether the cumulative idle time of the device in a working state reaches a preset time; when the cumulative time reaches the preset time, controlling the device to enter a sleep state; when the device is in the sleep state, detecting in real time whether a wake-up signal is generated; and when it is detected that the wake-up signal is generated, controlling the device to exit the sleep state and perform an operation corresponding to the wake-up signal to manage the status of the device.

[0007] In some embodiments, the working state includes the idle state and the non-idle state; determining whether the cumulative duration of the idle state of the device in the working state reaches a preset duration, includes: determining whether the device is performing effective operation at the current moment; when the device is performing effective operation, determining that the working state of the device at the current moment is a non-idle state; when the device is not performing effective operation, determining that the working state of the device at the current moment is an idle state; updating the cumulative duration according to the working state of the device at the current moment and the working state of the device at the previous moment to obtain an updated cumulative duration; and determining whether the updated cumulative duration reaches the preset duration.

[0008] In some embodiments, the sleep state is a STR sleep state, and controlling the device to enter the sleep state includes: saving current working data of the device into a memory.

[0009] In a second aspect, the present disclosure provides an apparatus for managing the status of a device, comprising: a determination module, a control module, a detection module and an execution module; the determination module is configured to determine whether the cumulative idle time of the device in a working state reaches a preset time; the control module is configured to control the device to enter a sleep state when the cumulative time reaches the preset time; the detection module is configured to detect in real time whether a wake-up signal is generated when the device is in the sleep state; the execution module is configured to control the device to exit the sleep state when it is detected that the wake-up signal is generated, and perform an operation corresponding to the wake-up signal, so as to manage the status of the device.

[0010] In a third aspect, the present disclosure provides an electronic device, comprising: a processor; and a memory storing program instructions for managing the state of the device, wherein when the program instructions are executed by the processor, the electronic device executes the method described in any one of the embodiments of the present disclosure.

[0011] In a fourth aspect, the present disclosure provides a computer-readable storage medium storing program instructions for managing the status of a device, wherein when the program instructions are executed by a processor, the method described in any one of the embodiments of the present disclosure is implemented.

[0012] Through the method for managing the state of the device as provided above, in the disclosed embodiment, when the accumulated idle time of the device in the working state reaches the preset time, the device is controlled to enter the sleep state, thereby reducing the overall power consumption of the device, and the device can be restored to the working state faster than shutting down the device; when a wake-up signal is detected, the device is controlled to exit the sleep state and perform the operation corresponding to the wake-up signal, thereby achieving a timely response of the device, and can realize a function such as the "pick up and scan" of a dictionary pen. Therefore, through the method for managing the state of the device, a balance between timely response and long standby time is achieved. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] By reading the following detailed description with reference to the accompanying drawings, the above and other objects, features and advantages of the exemplary embodiments of the present disclosure will become readily understood. In the accompanying drawings, several embodiments of the present disclosure are shown in an exemplary and non-limiting manner, and the same or corresponding reference numerals represent the same or corresponding parts, wherein:

[0014] Figure 1 An exemplary flow chart of a method for managing a state of a device according to an embodiment of the present disclosure is shown;

[0015] Figure 2 An exemplary flow chart showing a method for determining whether the accumulated idle time of a device in a working state reaches a preset time according to an embodiment of the present disclosure;

[0016] Figure 3 An exemplary flow chart of a method for executing an operation corresponding to a wake-up signal according to an embodiment of the present disclosure is shown;

[0017] Figure 4 An exemplary flow chart showing a method for managing a state of a device according to some other embodiments of the present disclosure;

[0018] Figure 5 An exemplary flow chart showing a method for managing a state of a device according to yet other embodiments of the present disclosure;

[0019] Figure 6 An exemplary structural block diagram of an apparatus for managing the state of a device according to an embodiment of the present disclosure is shown;

[0020] Figure 7 An exemplary structural block diagram of an electronic device for managing the status of the device according to an embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0021] The following will be combined with the drawings in the embodiments of the present disclosure to clearly and completely describe the technical solutions in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present disclosure.

[0022] It should be understood that the terms "include" and "comprising" used in the specification and claims of the present disclosure indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or collections thereof.

[0023] It should also be understood that the terms used in this disclosure are only for the purpose of describing specific embodiments and are not intended to limit the disclosure. As used in this disclosure and claims, the singular forms of "a", "an", and "the" are intended to include the plural forms unless the context clearly indicates otherwise. It should also be further understood that the term "and / or" used in this disclosure and claims refers to any combination of one or more of the associated listed items and all possible combinations, including these combinations.

[0024] As used in this specification and claims, the term "if" may be interpreted as "when" or "upon" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" may be interpreted as meaning "upon determination" or "in response to determining" or "upon detection of [described condition or event]" or "in response to detecting [described condition or event]," depending on the context.

[0025] The specific implementation of the present disclosure is described in detail below with reference to the accompanying drawings.

[0026] In the present disclosure, by setting different states for the device and implementing energy management of the device based on the state, a balance between timely response and long standby time of the device can be achieved.

[0027] The device can indicate the current working status of the device through different states. For example, the status of the device can include working state and sleeping state. Working state refers to the state of the device when the device is working normally, and the power consumption of the device is at a normal level. Sleeping state refers to the state in which some functions of the device are suspended or weakened without shutting down the device. At this time, the device reduces the overall power consumption of the device by stopping the operation of some electronic devices, adjusting the working mode of some electronic devices, reducing the power of some electronic devices, etc., and its power consumption is significantly lower than that in the working state.

[0028] The working state can be divided into multiple sub-states, such as non-idle state and idle state. When the device is performing valid operations, the device is in the non-idle state, and when the device is not performing valid operations, the device is in the idle state. Valid operations can be pre-specified, indicating that the device has actual effects on the user.

[0029] When a device has not performed any effective operation for a long time, that is, the device is in an idle state for a long time, it can be considered that the device will continue to have no effective operation for a long period of time. Therefore, a certain mechanism can be used to put the device from a working state to a dormant state, thereby reducing the overall power consumption of the device.

[0030] The device can respond to a wake-up signal when in sleep mode, and when the wake-up signal is triggered, the relevant functions of the device are restored. Compared with the method of saving energy by shutting down the device, this method can quickly restore to a working state. For the pen-and-scan function of the dictionary pen, the device can avoid energy consumption caused by always being in a working state by entering a sleep mode, and can restore the device to a working state more quickly than shutting down the device, and can then perform image capture, text recognition, and text translation on images containing text to be translated, enabling the device to realize the pen-and-scan function and immediately respond to the user's translation needs.

[0031] Figure 1 An exemplary flow chart of a method for managing a status of a device according to an embodiment of the present disclosure is shown.

[0032] like Figure 1 As shown, a method for managing the status of a device includes: determining whether the cumulative idle time of the device in a working state reaches a preset time; when the cumulative time reaches the preset time, controlling the device to enter a sleep state; when the device is in a sleep state, detecting in real time whether a wake-up signal is generated; and when it is detected that a wake-up signal is generated, controlling the device to exit the sleep state and perform an operation corresponding to the wake-up signal to achieve management of the status of the device.

[0033] Specifically, the method 100 for managing the state of a device according to the embodiment of the present disclosure includes the following steps:

[0034] Step S110, determining whether the accumulated idle time of the device in the working state reaches a preset time.

[0035] There is a timer for timing, which is used to measure the accumulated time in the idle state. The timer can be set inside the device, or it can be set outside the device and connected to the device. The timer can be a hardware timer, such as a circuit containing a hardware timer chip, or it can be a software timer, which simulates the timing function through software. When the timer is a software timer, the timing function can be completed by a dedicated process or a dedicated thread in the process, or it can be completed by a part of the code in the process or a part of the code in the thread in the process.

[0036] The timer can be set with one or more preset durations. When the cumulative duration measured by the timer reaches the preset duration, a specific function can be triggered, such as triggering an interrupt or terminating a loop. The preset duration can be achieved by presetting a time period, such as triggering a specific function after 10 minutes; by presetting a time point, such as triggering a specific function at 8:10:25 Beijing time; or by presetting the number of cycles, such as presetting a specific function to be executed after a cycle is executed 10,000 times. At this time, the preset duration is equivalent to the total time after the cycle is executed 10,000 times.

[0037] The format of the data recorded by the timer can be integer data, floating point data, long data, or DateTime data. When the device enters the idle state from a non-idle state, the timer is reset and starts counting. When the device remains in the idle state, the timer continues to accumulate, and at the same time, the cumulative time measured by the timer is compared with the preset time. When the cumulative time measured by the timer is greater than or equal to the preset time for the first time, it is determined that the time the device has been in the idle state has reached the preset time, and a specific operation is performed.

[0038] Step S120, when the accumulated time reaches a preset time, the device is controlled to enter a sleep state.

[0039] When the cumulative idle time of the device reaches the preset time, an interrupt can be triggered or the loop can be ended to control the device to enter the sleep state. In the sleep state, some functions of the device are suspended or weakened to save energy, such as pausing the CPU and reducing the brightness of the LED display. Some functions of the device are executed, such as detecting wake-up signals.

[0040] Step S130: When the device is in a dormant state, detecting in real time whether a wake-up signal is generated.

[0041] Whether a wake-up signal is generated can be detected in real time by polling and / or interruption. For example, in the loop of the program, a wake-up signal detection method is set to determine whether a wake-up signal exists by polling. For another example, the program has a method for responding to a wake-up signal, and when a wake-up signal appears, the wake-up signal response method is triggered.

[0042] Users can trigger a wake-up signal through the device's sensor, such as a button. For example, the device is currently in sleep mode, and the pressing of a button causes a change in the high and low levels of the port connected to the sensor by the device's EC chip (Embedded Controller). When the EC chip determines that the level change reaches a preset condition (for example, a specific input pin of the EC chip changes from a high level to a low level, and then stabilizes at a low level for a preset time after changing to a low level), the level change caused by pressing the button can trigger the EC chip to wake up. If the EC chip can work normally, the EC chip can send a wake-up signal to the device's chipset and adjust various power supply circuits, such as increasing the power supply for other components.

[0043] Step S140, when it is detected that a wake-up signal is generated, the device is controlled to exit the sleep state and an operation corresponding to the wake-up signal is performed to manage the state of the device.

[0044] When a wake-up signal is detected, the device is controlled to exit the sleep state. At this time, the functions that were suspended or weakened in the sleep state are restored in a short time, such as the screen brightness restoration. In addition to making the device enter the working state from the sleep state, the wake-up signal can also have other functions. For example, when the triggering of a button that plays sound is used as a wake-up signal, when the button is triggered, the device will perform the operation of playing sound after entering the working state from the sleep state.

[0045] In the embodiments of the present disclosure, the device has a state-based energy management mechanism to implement energy management of the device according to different states. The energy management mechanism can be based on a state machine. In addition to performing specific operations in a certain state, specific operations can also be performed when a state transition is performed. For example, when the device enters an idle state from a non-idle state, the timer is reset when a state transition occurs; when the device is in an idle state, the timer continues to accumulate, and at the same time, the accumulated time measured by the timer is compared with the preset time.

[0046] Therefore, the device achieves a balance between timely response and long standby time. As for the dictionary pen, after the device is turned on, when it is in working state, the dictionary pen device can be used for translation at any time. When it is in sleep state, the power consumption of the device is very low, which can meet the user's needs of scanning with the pen, achieving a balance between timely response and long standby time.

[0047] Figure 2 An exemplary flow chart of a method for determining whether the accumulated idle time of a device in a working state reaches a preset time according to an embodiment of the present disclosure is shown.

[0048] like Figure 2 As shown, in some embodiments, the working state includes an idle state and a non-idle state; determining whether the cumulative duration of the idle state of the device in the working state reaches a preset duration, including: determining whether the device is performing effective operation at the current moment; when the device is performing effective operation, determining that the working state of the device at the current moment is a non-idle state; when the device is not performing effective operation, determining that the working state of the device at the current moment is an idle state; updating the cumulative duration according to the working state of the device at the current moment and the working state of the device at the previous moment to obtain an updated cumulative duration; determining whether the updated cumulative duration reaches the preset duration.

[0049] Specifically, in the embodiment of the present application, the working state can be divided into a non-idle state and an idle state. When the device is in the working state, the device is in the non-idle state or the idle state, and cannot be in these two states at the same time. In the embodiment of the present disclosure, the method 200 for determining whether the accumulated duration of the idle state of the device in the working state reaches a preset duration includes the following steps:

[0050] Step S210, determining whether the device is currently operating effectively.

[0051] Valid operations can be pre-specified to indicate operations that have a practical effect on the user. For example, the operation of clicking a button can be specified as a valid operation. By clicking the button, the device performs a specific function (such as turning on the screen in the off state), which has a practical effect on the user (such as enabling the user to see the system time displayed on the device through the lit screen), thereby meeting the user's needs.

[0052] Here, the effective operation of the device not only refers to the operation performed by the user on the device, but also includes the operation of the device itself. For example, if the user wants to hear the pronunciation of a word, the user can play the sound by clicking a button. Before the button is clicked, the device is in an idle state. When the button is clicked, the device receives the trigger of the button and enters a non-idle state. After the device receives the trigger of the button, it analyzes the function of the button and finds that the device needs to play a sound, so it loads the relevant sound resources. After the sound resources are loaded, the sound starts to play. Although the user only clicks the button at the beginning of this process, since the operations performed by the device itself after the click are all necessary operations for playing the sound, including loading sound resources and playing the sound, these operations of the device itself are also effective operations, and the device does not enter the idle state from the non-idle state after the click is completed. When the sound is played, the device no longer has subsequent effective operations, and the device enters the idle state from the non-idle state.

[0053] Step S220, when the device is effectively operating, determining that the working state of the device at the current moment is a non-idle state; when the device is not effectively operating, determining that the working state of the device at the current moment is an idle state.

[0054] An integer variable can be set to record the working status of the device at the current moment. Initially, the device is in an idle state, and the integer variable is 0. When an operation starts and the operation is a preset valid operation, the integer variable can be increased by 1; and when the operation is completed, the integer variable is reduced by 1. When the integer variable is greater than or equal to 1, it means that the device is performing a valid operation, that is, the working status of the device at the current moment is not idle; when the integer variable is equal to 0, it means that the device is not performing a valid operation, that is, the working status of the device at the current moment is idle. By using an integer variable instead of a single Boolean variable, it is possible to avoid the situation where multiple valid operations are performed at the same time and end at different times, making it difficult to judge the subsequent working status.

[0055] Step S230, updating the accumulated duration according to the working state of the device at the current moment and the working state of the device at the previous moment to obtain an updated accumulated duration.

[0056] As mentioned above, the accumulated duration can be measured by a counter. When the device enters the idle state from a non-idle state, the timer is reset and starts counting. When the device remains in the idle state, the timer continues to accumulate, and at the same time, the accumulated duration measured by the timer is compared with the preset duration. When the accumulated duration measured by the timer is greater than or equal to the preset duration for the first time, it is determined that the accumulated duration of the device being in the idle state has reached the preset duration, and a specific operation is performed.

[0057] Step S240, determining whether the updated accumulated duration reaches a preset duration.

[0058] The accumulated time measured by the timer is compared with the preset time. When the accumulated time measured by the timer is greater than or equal to the preset time for the first time, it is determined that the accumulated time for which the device has been in an idle state has reached the preset time.

[0059] In some embodiments, the sleep state is a STR sleep state, and controlling the device to enter the sleep state includes: saving the current working data of the device into the memory.

[0060] Specifically, the sleep state mentioned above is the STR sleep state, where "STR" refers to "Suspend to RAM". The process of changing from the working state to the sleep state is called Suspend. Correspondingly, the process of changing from the sleep state to the working state is called Resume.

[0061] Energy management mechanism allows some or all modules of the device to be in low power or off state to reduce energy consumption. For example, the Linux kernel provides several sleep states, namely, Suspend to Idle, Standby, Suspend to RAM (STR), and Hibernation (STD). In these states, the degree of device suspension is different, the modules in low power or off state are different, and the power consumption is different. At the same time, the speed of recovery from different sleep states to the working state is also different. For example, when recovering from the "Suspend to RAM" sleep state to the working state, compared with recovering from the "Suspend to Disk" sleep state to the working state, under the same circumstances, the speed of data loading from the memory to the CPU is faster than the speed of data loading from the disk to the CPU, so the speed of recovery to the working state of the latter is slower, but because RAM needs to be refreshed continuously to save data, while the disk does not need to be refreshed, the former will consume more energy in the sleep state.

[0062] When the device is suspended and enters the STR sleep state, the current working data of the device is saved to the memory. For example, the current working data of the device can be saved to DDR SDRAM (double data rate synchronous dynamic random access memory). The current working data of the device includes, but is not limited to, the current working data of the CPU, the current working data of the memory, and the current working data of the IO device. When the device is restored from the STR sleep state to the working state, the saved current working data can be taken out from the memory, so that the device is restored to the state before suspension. The overall time is about 20ms to 50ms, and the device is restored to the working state. From the time the device is shut down to the time the device is in the working state, the startup process takes about 5s.

[0063] When the device enters the STR sleep state, it can be in standby mode for a long time. As for the dictionary pen, when the device is in the STR sleep state, the RAM works in self-refresh mode to reduce memory power consumption, the camera and other hardware are turned off, and the device's operating current can be reduced from 200ma to only 3ma. Taking a 1500mah battery as an example, the device can be in standby mode for 500 hours in the STR sleep state, which is equivalent to 21 days. If the device always keeps working in order to respond to the user's translation needs in a timely manner, it can only be in standby mode for 7.5 hours, and the user needs to charge frequently, which is very inconvenient.

[0064] Figure 3 An exemplary flow chart of a method for executing an operation corresponding to a wake-up signal according to an embodiment of the present disclosure is shown.

[0065] like Figure 3 As shown, in some embodiments, executing an operation corresponding to the wake-up signal includes: determining whether the wake-up signal is a signal generated by a sensor set at a preset position of the device; when the wake-up signal is a signal generated by a pen tip sensor, performing an image scanning operation through the camera of the device.

[0066] Specifically, with respect to the "pick up and scan" function of the dictionary pen, in the embodiment of the present disclosure, the method 300 for executing an operation corresponding to the wake-up signal includes the following steps:

[0067] Step S310, determining whether the wake-up signal is a signal generated by a sensor set at a preset position of the device.

[0068] Taking the dictionary pen as an example, the wake-up signal of the device entering the working state from the sleep state may be directly related to the lift-the-pen-and-scan function, or it may be unrelated to the lift-the-pen-and-scan function. For example, by clicking the switch button of the dictionary pen, the device can also enter the working state from the sleep state, but clicking the button has no direct relationship with the lift-the-pen-and-scan function. Therefore, before executing the operation corresponding to the wake-up signal, it is necessary to judge the wake-up signal. When the wake-up signal is a signal generated by a sensor set in the preset part of the device (for example, a sensor at the pen tip), certain functions are executed; when the wake-up signal is not a signal generated by a sensor set in the preset part of the device, certain functions are executed. It is possible to judge whether the wake-up signal is a signal generated by a sensor set in the preset part of the device by determining the data corresponding to the signal. For example, a wake-up signal type ID is set for each wake-up signal, and the type of wake-up signal is determined by judging the wake-up signal type ID. The preset part of the device may include a pen tip, a grip, and the like.

[0069] Step S320: When the wake-up signal is a signal generated by a sensor, an image scanning operation is performed through a camera of the device.

[0070] The main technical problem solved in the embodiments disclosed herein is the "pick up and scan" function of the dictionary pen. Therefore, one or more sensors can be set at a preset position of the dictionary pen. When the sensor at the preset position generates a signal, and the signal is a wake-up signal, the device can change from a dormant state to a working state in a short time, and the process generally takes only 20ms to 50ms. After the device is in the working state, the camera of the device can perform an image scanning operation and be used to translate the text scanned by the image, so that the device can respond to the user's translation request in a timely manner.

[0071] In some embodiments, the sensor is one or more of a pressure sensor, a distance sensor, and a micro switch.

[0072] Specifically, the sensor provided at the preset position of the device may be one or more of a pressure sensor, a distance sensor and a micro switch, which may be selected according to the specific application of the device. For example, if the sensor includes a pressure sensor provided at the gripping portion, when the text on the book is collected, the user grips the gripping portion, the pressure sensor of the gripping portion is squeezed, and the pressure sensor senses a pressure exceeding the threshold. At this time, a wake-up signal is generated, the device enters the working state from the dormant state, and the camera of the device performs an image scanning operation to collect image information of the text to be translated. Similarly, if the sensor includes a distance sensor provided at the tip of the pen, the tip of the pen is close to the book, and the distance sensor senses a distance less than the threshold, at this time, a wake-up signal is generated, the device enters the working state from the dormant state, and the camera of the device performs an image scanning operation; or, if the sensor includes a micro switch, the micro switch is clicked, at this time, a wake-up signal is generated, the device enters the working state from the dormant state, and the camera of the device performs an image scanning operation. The present invention is not limited to the type and working principle of the sensor.

[0073] Figure 4 An exemplary flow chart of a method for managing a status of a device according to some other embodiments of the present disclosure is shown.

[0074] like Figure 4 As shown, in some embodiments, after performing an image scanning operation through the camera of the device, the method also includes: acquiring image data from the camera; performing text recognition and text translation on the image data to obtain a translation result; and outputting the translation result in a visual or audible manner, and after the output is completed, continuing to perform an operation to determine whether the cumulative idle time of the device in a working state reaches a preset time.

[0075] Specifically, the main function of the dictionary pen is to obtain image data containing text to be translated through the camera on the dictionary pen as input, and then perform text recognition and text translation on the image data to obtain the translation result of the text corresponding to the image, and inform the user through visual or auditory means.

[0076] The method 400 for managing the status of a device according to the embodiment of the present disclosure further includes the following steps:

[0077] Step S410, acquiring image data from a camera.

[0078] The image is captured by a camera provided on the dictionary pen to obtain image data. The image data can be saved in common image file formats, such as tif format, gif format, jpg format, png format, bayer RAW format, YUYV format, etc. In the present embodiment, the format of the image data is bayer RAW format or YUYV format. When capturing images, the camera may have auxiliary shooting functions, such as autofocus function and white balance function, which can improve the quality of the captured image and the quality of the acquired image data when capturing images.

[0079] Step S420: Perform text recognition and text translation on the image data to obtain a translation result.

[0080] The technology of acquiring image data and performing text recognition to convert printed or handwritten text into machine-readable text is generally called optical character recognition (OCR). The core of OCR technology is to extract text from images and convert it into data that can be processed by computers through image processing and pattern recognition technology.

[0081] As for the background technology of the present disclosure, the dictionary pen collects images containing text to be translated through a camera, obtains the text to be translated, and translates the text. Here, the translation may include translation between different languages, such as translation between Chinese and English, translation between Chinese and Japanese, translation between Chinese and Korean, and translation between the same language, such as translation between simplified Chinese and traditional Chinese.

[0082] The text to be translated can be translated through the built-in translation model of the device to obtain the translation result. It can also be uploaded to the server and then the translation result can be obtained from the server. The translation result can be stored in the device in a digital form.

[0083] Step S430: Output the translation result in a visual or audible manner, and after the output is completed, continue to perform an operation of determining whether the accumulated idle time of the device in the working state reaches a preset time.

[0084] After obtaining the translation result, the translation result can be output to the user in a visual or audible manner to inform the user of the translation result, such as displaying the text of the translation result on an LED screen or playing the sound of the translation result through a speaker. When the above steps are completed, when the device enters the idle state from the non-idle state, the timer is reset. After the state transition occurs, the device is in the idle state, the timer continues to accumulate, and at the same time, the accumulated time measured by the timer is compared with the preset time.

[0085] Figure 5An exemplary flow chart of a method for managing a status of a device according to yet other embodiments of the present disclosure is shown.

[0086] like Figure 5 As shown, in some embodiments, before determining whether the cumulative idle time of the device in a working state reaches a preset time, the method also includes: when a power-on signal is detected, starting the operating system of the device; after the operating system is started, initializing the hardware and software of the device, wherein the hardware includes at least a camera, and the software includes at least image processing software.

[0087] Specifically, the method 500 for managing the status of a device according to the embodiment of the present disclosure further includes the following steps:

[0088] Step S510, when a power-on signal is detected, the operating system of the device is started.

[0089] The user can trigger the power on through the button of the device. The button can be a button with a single function or a button with multiple functions. The function of the button is determined by the time the button is pressed. For electronic devices, it is preferred to trigger the power on through a button with multiple functions. When the button is pressed for a long time (such as 2 seconds), the EC chip (Embedded Controller) of the device and the port connected to the button will change in high and low levels due to the pressing of the button. When the EC chip determines that the level change reaches the preset value (for example, the low level time caused by pressing the button reaches the threshold of 2 seconds, and it is currently in the off state), the level change caused by pressing the button can trigger the EC chip to start. If the EC chip can work normally, the EC chip can send a power on signal to the chipset of the device and start each power supply circuit.

[0090] When the device is shut down, it can be started by generating a power-on signal. The device is provided with an operating system, which can provide drivers for the hardware of the device and provide underlying functions for the software of the device, such as memory scheduling, storage management, and IO management. When the device is started, the operating system of the boot device is started.

[0091] Step S520: After the operating system is started, the hardware and software of the device are initialized.

[0092] The device includes hardware and software. The hardware includes at least a camera for collecting images, and the software includes at least image processing software for extracting text from images and converting them into data that can be processed by a computer. The software may also include a translation model built into the device for translating text to be translated and obtaining translation results.

[0093] After the operating system is started, the hardware and software of the device are initialized, including hardware startup, such as the startup of camera-related circuits, and software startup, such as the startup of image processing software.

[0094] Figure 6 An exemplary structural block diagram of an apparatus for managing the status of a device according to an embodiment of the present disclosure is shown.

[0095] like Figure 6 As shown, a device for managing the status of a device includes: a determination module, a control module, a detection module and an execution module; the determination module is configured to determine whether the cumulative idle time of the device in a working state reaches a preset time; the control module is configured to control the device to enter a sleep state when the cumulative time reaches a preset time; the detection module is configured to detect in real time whether a wake-up signal is generated when the device is in a sleep state; the execution module is configured to control the device to exit the sleep state when it detects that a wake-up signal is generated, and execute an operation corresponding to the wake-up signal to achieve management of the status of the device.

[0096] Specifically, the device 600 for managing the state of a device may include a determination module 610, a control module 620, a detection module 630, and an execution module 640. The device 600 may be disposed in a device such as a dictionary pen, and is used to manage the state of the device, thereby avoiding energy consumption caused by always being in a working state, and can restore the device to a working state more quickly than shutting down the device.

[0097] The determination module 610 can be used to determine whether the cumulative duration of the idle state of the device in the working state has reached a preset duration. The determination module 610 has a timer for timing, which is used to measure the cumulative duration of the idle state. When the device remains in the idle state, the timer continues to accumulate, and at the same time, the cumulative duration measured by the timer is compared with the preset duration. When the cumulative duration measured by the timer is greater than or equal to the preset duration for the first time, at this time, the determination module 610 determines that the cumulative duration of the device in the idle state has reached the preset duration and performs a specific operation.

[0098] The control module 620 can be used to control the device to enter a dormant state when the accumulated time reaches a preset time. When the accumulated time of the device in the idle state reaches a preset time, the control module 620 can trigger an interrupt or end the cycle to control the device to enter a dormant state.

[0099] The detection module 630 can be used to detect in real time whether a wake-up signal is generated when the device is in a dormant state. In the dormant state, the detection module 630 can detect in real time whether a wake-up signal is generated by polling and / or interruption methods.

[0100] The execution module 640 can be used to control the device to exit the sleep state and perform operations corresponding to the wake-up signal when it is detected that a wake-up signal is generated, so as to manage the status of the device. When it is detected that a wake-up signal is generated, the execution module 640 controls the device to exit the sleep state and enter the working state from the sleep state. At this time, the functions that are suspended or weakened in the sleep state are restored in a short time, such as the CPU resuming work. In addition to enabling the device to enter the working state from the sleep state, the wake-up signal can also have other functions. For example, when the triggering of the button of the dictionary pen's pen-lifting and scanning function is used as a wake-up signal, when the button is triggered, after the device enters the working state from the sleep state, the device's camera performs an image scanning operation, and performs image acquisition on the image containing the text to be translated, and obtains image data for subsequent text recognition and text translation.

[0101] Figure 7 An exemplary structural block diagram of an electronic device for managing the status of the device according to an embodiment of the present disclosure is shown.

[0102] like Figure 7 As shown, an electronic device includes: a processor; and a memory storing program instructions for managing the state of the device. When the program instructions are executed by the processor, the electronic device executes any one of the methods according to the embodiments of the present disclosure.

[0103] Specifically, the electronic device 700 can be implemented as various types of devices, including but not limited to mainframes, personal computers (PCs), mobile devices, etc. The electronic device 700 includes a processor 710 and a memory 720. The processor 710 controls the operation of the electronic device 700 by executing program instructions stored in the memory 720. The processor 710 can be implemented using, but not limited to, a central processing unit (CPU), a graphics processing unit (GPU), an application processor (AP), an artificial intelligence processor chip (IPU), etc. The memory 720 can be used to store various data and instructions processed in the electronic device 700, including a method for managing the state of the device in the embodiment of the present disclosure. The memory 720 may include at least one of a volatile memory or a non-volatile memory. The non-volatile memory may include a read-only memory (ROM), an electrically programmable ROM (EPROM), an electrically erasable programmable ROM (EEPROM), etc. The volatile memory may include a dynamic RAM (DRAM), a static RAM (SRAM), a synchronous DRAM (SDRAM), etc. In addition, the memory 720 may also include at least one of a hard disk drive (HDD), a solid state drive (SSD), a high-density flash memory (CF), a secure digital (SD) card, a micro secure digital (Micro-SD) card, a mini secure digital (Mini-SD) card, an extreme digital (xD) card, a cache, or a memory stick.

[0104] A computer-readable storage medium stores program instructions for managing the state of a device. When the storage program instructions are executed by a processor, a storage method according to any one of the embodiments of the present disclosure is implemented.

[0105] Specifically, in order to solve the above technical problems, the present embodiment further provides a readable storage medium, on which program instructions are stored. When the program instructions are executed, the above method for managing the status of the device is executed. Other details of the readable storage medium, such as circuit structure, reading method, working principle, encoding method, etc., can be set by those skilled in the art according to common knowledge, and will not be described in detail here. Since the above-mentioned readable storage medium stores the program instructions that can execute the above-mentioned program for managing the status of the device, it can also solve the problem of the difficulty in balancing timely response and long standby in the prior art.

[0106] In the disclosed embodiment, when the accumulated time of the device in the idle state reaches the preset time, the device is controlled to enter the sleep state, thereby reducing the overall power consumption of the device, and the device can be restored to the working state faster than shutting down the device; when a wake-up signal is detected, the device is controlled to exit the sleep state and perform the operation corresponding to the wake-up signal, thereby achieving a timely response of the device, and realizing a function such as the "pick up and scan" function of a dictionary pen. Therefore, by managing the state of the device, a balance between timely response and long standby time is achieved.

[0107] Although multiple embodiments of the present disclosure have been shown and described herein, it will be apparent to those skilled in the art that such embodiments are provided by way of example only. Those skilled in the art may think of many changes, modifications, and alternatives without departing from the thought and spirit of the present disclosure. It should be understood that in the process of practicing the present disclosure, various alternatives to the embodiments of the present disclosure described herein may be adopted. The attached claims are intended to define the scope of protection of the present disclosure, and therefore cover equivalents or alternatives within the scope of these claims.

Claims

1. A method for managing the state of a device, comprising: Determine whether the accumulated idle time of the device in the working state reaches a preset time; When the accumulated time reaches the preset time, controlling the device to enter a dormant state; When the device is in the dormant state, detecting in real time whether a wake-up signal is generated; as well as When it is detected that the wake-up signal is generated, the device is controlled to exit the sleep state, and an operation corresponding to the wake-up signal is performed to manage the state of the device.

2. The method according to claim 1, wherein: The working state includes the idle state and the non-idle state; Determining whether the accumulated idle time of the device in the working state reaches a preset time, including: Determining whether the device is currently operating effectively; When the device is operating effectively, determining that the working state of the device at the current moment is a non-idle state; In the case where the device is not effectively operating, determining that the working state of the device at the current moment is an idle state; updating the accumulated duration according to the working state of the device at the current moment and the working state of the device at the previous moment to obtain an updated accumulated duration; and Determine whether the updated accumulated duration reaches a preset duration.

3. The method according to claim 1, wherein: The sleep state is a STR sleep state, and controlling the device to enter the sleep state includes: saving the current working data of the device into the memory.

4. The method according to claim 3, wherein: Executing an operation corresponding to the wake-up signal includes: Determining whether the wake-up signal is a signal generated by a sensor disposed at a preset position of the device; In a case where the wake-up signal is a signal generated by the sensor, an image scanning operation is performed by a camera of the device.

5. The method according to claim 4, wherein: The sensor is one or more of a pressure sensor, a distance sensor and a micro switch.

6. The method according to claim 4, after performing an image scanning operation by a camera of the device, the method further comprises: Acquire image data from the camera; Performing text recognition and text translation on the image data to obtain a translation result; as well as The translation result is output in a visual or audible manner, and after the output is completed, an operation of determining whether the accumulated idle time of the device in the working state reaches a preset time is continued.

7. The method according to claim 6, before determining whether the accumulated idle time of the device in the working state reaches a preset time, the method further comprises: When a power-on signal is detected, starting the operating system of the device; After the operating system is started, the hardware and software of the device are initialized, wherein the hardware at least includes the camera, and the software at least includes image processing software.

8. An apparatus for managing the state of a device, comprising: Determination module, control module, detection module and execution module; The determination module is configured to determine whether the accumulated idle time of the device in the working state reaches a preset time; The control module is configured to control the device to enter a dormant state when the accumulated duration reaches the preset duration; The detection module is configured to detect in real time whether a wake-up signal is generated when the device is in the sleep state; The execution module is configured to control the device to exit the sleep state and execute an operation corresponding to the wake-up signal when detecting that the wake-up signal is generated, so as to manage the state of the device.

9. An electronic device, comprising: processor; and a memory storing program instructions for managing the state of the device, wherein when the program instructions are executed by the processor, the electronic device executes the method according to any one of claims 1 to 7.

10. A computer-readable storage medium storing program instructions for managing a state of a device, wherein when the program instructions are executed by a processor, the method according to any one of claims 1 to 7 is implemented.