Module awakening method and device, storage medium, camera and program product

Determine the wake -up time by determining the remaining call time of the function module in the camera device and selecting the shortest time module, solving the problem of frequent wake modules in the existing technology, which causes poor energy consumption to reduce the effect. Energy management and equipment stability.

CN119383458AActive Publication Date: 2025-01-28ZHEJIANG DAHUA TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411487353.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-23
Publication Date
2025-01-28
Estimated Expiration
2044-10-23

AI Technical Summary

Technical Problem

In the prior art, in order to reduce the energy consumption of the camera device, it is necessary to determine the maximum common divisor of the execution cycle of multiple functional modules, and the module is awakened by the timer every time, resulting in the timer being small at the maximum common divisor. Frequently wake up the module, resulting in poor energy consumption reduction.

Method used

By determining the remaining call time of each function module when the condition of the awakening time is available, select the shortest functional module as the target function module, and determine the target wake -up time based on the time of the next time the module is called. Send to the hardware timer to control the wake of the module.

Benefits of technology

Effectively reduce the energy consumption of the equipment, improve the stability of the equipment, and ensure that the module is awakened only when the existence is needed, reducing the number of unnecessary awakening times.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119383458A_ABST
    Figure CN119383458A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a module awakening method, which is applied to a target module, a plurality of functional modules are registered in the target module, the plurality of functional modules multiplex the same hardware timer, and the hardware timer is used for awakening the target module to call the functional modules to execute corresponding operations. The method comprises the following steps: under the condition that an awakening time issuing condition is reached, determining the residual calling time of each functional module; based on the residual calling time of each functional module, determining the functional module with the shortest residual calling time from the plurality of functional modules as a target functional module; and determining target wake-up time based on the moment when the target function module is called next time, and issuing the target wake-up time to the hardware timer to indicate the hardware timer to wake up the target module when the target wake-up time is up.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of electronic photography, and in particular, to a module wake-up method, device, storage medium, camera, and program product. Background Art

[0002] In harsh environments, the deployment of camera equipment is crucial for regional monitoring. Since solar panels are needed as the power source for camera equipment, and solar power supply is unstable due to weather constraints, it is necessary to formulate a reasonable strategy to achieve the purpose of reducing equipment energy consumption.

[0003] The energy consumption reduction method in the related art needs to determine the greatest common divisor of the execution cycles of multiple functional modules and instruct the timer to wake up the module every time the greatest common divisor is reached. Therefore, when the greatest common divisor is small, the timer will frequently wake up the module, resulting in poor energy consumption reduction effect. Summary of the invention

[0004] Embodiments of the present invention provide a module wake-up method, device, storage medium, camera and program product to at least solve the problem that the energy consumption reduction method in the related art needs to determine the greatest common divisor of the execution cycles of multiple functional modules and instruct the timer to wake up the module every the greatest common divisor. Therefore, when the greatest common divisor is small, the timer frequently wakes up the module, resulting in poor energy consumption reduction effect.

[0005] According to an embodiment of the present invention, a module wake-up method is provided, which is applied to a target module, wherein a plurality of function modules are registered in the target module, and the plurality of function modules reuse the same hardware timer, and the hardware timer is used to wake up the target module to call the function module to perform corresponding operations. The method comprises: when a wake-up time sending condition is met, determining the remaining call time of each function module, wherein the remaining call time is used to indicate the remaining time between the time when the function module is next called and the current time; based on the remaining call time of each function module, determining the function module with the shortest remaining call time from the plurality of function modules as the target function module; determining the target wake-up time based on the time when the target function module is next called, and sending the target wake-up time to the hardware timer to instruct the hardware timer to wake up the target module when the target wake-up time is reached, wherein after the target module sends the target wake-up time to the hardware timer, the target module enters a dormant state.

[0006] In an exemplary embodiment, after determining the target wake-up time based on the moment when the target functional module is called next time, the method further includes: determining the length of time from the target wake-up time to the current moment; determining the priority of the target functional module when the length of time from the target wake-up time to the current moment meets a predetermined condition; and executing the operation of calling the target functional module based on the priority of the target functional module.

[0007] In an exemplary embodiment, when the duration from the target wake-up time to the current moment satisfies a predetermined condition, determining the priority of the target function module includes: when it is determined that the duration from the target wake-up time to the current moment is less than a first preset duration, determining the priority of the target function module; executing the operation of calling the target function module based on the priority of the target function module includes: when the priority of the target function module is a first priority, directly calling the target function module to execute the target operation, wherein the function module with the first priority is a module that allows adjustment of the function execution cycle.

[0008] In an exemplary embodiment, the target wake-up time is sent to the hardware timer to instruct the hardware timer to wake up the target module when the target wake-up time is reached, including: when the priority of the target functional module is the second priority, the target wake-up time is sent to the hardware timer to instruct the hardware timer to wake up the target module when the target wake-up time is reached, wherein the functional module with the second priority is a module that is not allowed to adjust the function execution cycle.

[0009] In an exemplary embodiment, the method further includes: obtaining attribute information of the plurality of functional modules; judging whether to allow adjustment of the function execution cycle of each functional module based on the attribute information of each functional module to obtain a judgment result; and setting the priority of each functional module based on the judgment result.

[0010] In an exemplary embodiment, determining the remaining call time of each of the functional modules includes: determining the remaining call time of each of the functional modules based on the execution cycle of each of the registered functional modules recorded in the target module, and the historical timestamp of each of the functional modules, wherein, if the functional module has been called before, the historical timestamp indicates the time when the functional module was last called, and if the functional module has not been called before, the historical timestamp indicates the registration time of the functional module.

[0011] In an exemplary embodiment, the wake-up time delivery condition includes at least one of the following: the target module completes calling any one of the multiple functional modules; any one of the multiple functional modules successfully registers to the target module.

[0012] In an exemplary embodiment, the method further comprises: when a timestamp synchronization condition is met, calling a plurality of the functional modules to update the historical timestamp of each of the functional modules to the current time.

[0013] In an exemplary embodiment, the timestamp synchronization condition includes at least one of the following: the time length between the current time and the time when any function module included in the plurality of function modules is first called reaches a second preset time length; a timestamp synchronization instruction is received.

[0014] According to another embodiment of the present invention, a module awakening device is provided, which is applied to a target module, wherein a plurality of function modules are registered in the target module, and the plurality of function modules reuse the same hardware timer, and the hardware timer is used to awaken the target module to call the function modules to perform corresponding operations. The device comprises: a first determining module, which is used to determine the remaining calling time of each of the function modules when the awakening time sending condition is met, wherein the remaining calling time is used to indicate the remaining time between the time when the function module is next called and the current time; a second determining module, which is used to determine the function module with the shortest remaining calling time from the plurality of function modules based on the remaining calling time of each of the function modules, as the target function module; and a sending module, which is used to determine the target awakening time based on the time when the target function module is next called, and send the target awakening time to the hardware timer to instruct the hardware timer to wake up the target module when the target awakening time is reached, wherein after the target module sends the target awakening time to the hardware timer, the target module enters a dormant state.

[0015] According to yet another embodiment of the present invention, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of any one of the above method embodiments when run.

[0016] According to another embodiment of the present invention, a camera is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0017] According to yet another embodiment of the present invention, a computer program product is provided. The computer program product includes a computer program. When the computer program is executed by a processor, the steps in any one of the above method embodiments are implemented.

[0018] Through the present invention, when the wake-up time sending condition is met, the target functional module with the shortest remaining calling time is determined, and the time for instructing the hardware timer to wake up the target module is determined based on the time when the target functional module is called next time, so that the target module can be awakened only when there is a function that needs to be executed. The problem of energy consumption reduction method in related technology that it is necessary to determine the greatest common divisor of the execution cycles of multiple functional modules and instruct the timer to wake up the module every greatest common divisor is solved. Therefore, when the greatest common divisor is small, the timer frequently wakes up the module, resulting in a poor energy consumption reduction effect. The energy consumption of the device is effectively reduced and the stability of the device is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 is a hardware structure block diagram of a mobile terminal according to a module wake-up method according to an embodiment of the present invention;

[0020] Figure 2 The process of the module wake-up method according to an embodiment of the present invention is as follows Figure 1 ;

[0021] Figure 3 is a schematic diagram of module distribution according to a module wake-up method according to an embodiment of the present invention;

[0022] Figure 4 The process of the module wake-up method according to an embodiment of the present invention is as follows Figure 2 ;

[0023] Figure 5 The process of the module wake-up method according to an embodiment of the present invention is as follows Figure 3 ;

[0024] Figure 6 The process of the module wake-up method according to an embodiment of the present invention is as follows Figure 4 ;

[0025] Figure 7 4 is a structural block diagram of a module awakening device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0026] Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings and in combination with the embodiments.

[0027] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0028] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 FIG. 1 is a hardware structure diagram of a mobile terminal of a module wake-up method according to an embodiment of the present invention. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the mobile terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the mobile terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.

[0029] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the module wake-up method in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories can be connected to the mobile terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0030] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0031] In this embodiment, a module wake-up method running on the above mobile terminal or network architecture is provided. Figure 2 The process of the module wake-up method according to an embodiment of the present invention is as follows Figure 1 ,like Figure 2 As shown, the process includes the following steps:

[0032] Step S202, when the wake-up time delivery condition is met, determining the remaining call time of each of the functional modules, wherein the remaining call time is used to indicate the remaining time between the time when the functional module is next called and the current time;

[0033] Step S204, based on the remaining call time of each of the functional modules, determining a functional module with the shortest remaining call time among the multiple functional modules as a target functional module;

[0034] Step S206, determining a target wake-up time based on the time when the target functional module is called next time, and sending the target wake-up time to the hardware timer to instruct the hardware timer to wake up the target module when the target wake-up time arrives, wherein after sending the target wake-up time to the hardware timer, the target module will enter a sleep state.

[0035] For example, Figure 3 is a schematic diagram of module distribution of a module wake-up method according to an embodiment of the present invention, such as Figure 3As shown, in an optional embodiment, the camera device includes one or more business modules, each of which includes one or more sub-modules (i.e., the target module mentioned above), and each of which includes one or more functional modules. Exemplarily, the multiple functional modules in the target module reuse the timer, and after being awakened, the target module calls the functional module that reaches the reporting time (for example, the target module calls the corresponding interface of the functional module through the callback function corresponding to the functional module), wherein one or more of the functional modules need to report information to the target platform regularly, the timer is integrated in the target module, and the registration information of one or more of the functional modules is recorded in the target module, and the registration information includes: the time of successful registration of the functional module, the reporting period of the functional module, and the timestamp of the most recent report of the functional module. Exemplarily, when the trigger condition is met, the functional module sends a registration request to the target platform for the first time through the corresponding interface in the target module. If the registration is successful, the target module records the time of successful registration. If the registration is unsuccessful, the target module instructs the timer to wake up the target module after the reporting period from the current time to request to register the functional module with the target platform again.

[0036] Through the above steps, when the wake-up time sending conditions are met, the target functional module with the shortest remaining calling time is determined, and the time to instruct the hardware timer to wake up the target module is determined based on the time when the target functional module is called next time, so that the target module can be awakened only when there is a function that needs to be executed. This solves the problem that the energy consumption reduction method in the related art needs to determine the greatest common divisor of the execution cycles of multiple functional modules and instruct the timer to wake up the module every greatest common divisor. Therefore, when the greatest common divisor is small, the timer frequently wakes up the module, resulting in poor energy consumption reduction effect.

[0037] The execution subject of the above steps may be a camera device, other devices or systems that can carry modules and hard timers, etc., but is not limited thereto.

[0038] In an optional embodiment, after determining the target wake-up time based on the moment when the target functional module is called next time, the method further includes: determining the length of time between the target wake-up time and the current moment; determining the priority of the target functional module when the length of time between the target wake-up time and the current moment meets a predetermined condition; and executing the operation of calling the target functional module based on the priority of the target functional module.

[0039] In an optional embodiment, when the duration from the target wake-up time to the current moment satisfies a predetermined condition, determining the priority of the target function module includes: when it is determined that the duration from the target wake-up time to the current moment is less than a first preset duration, determining the priority of the target function module; executing the operation of calling the target function module based on the priority of the target function module includes: when the priority of the target function module is a first priority, directly calling the target function module to execute the target operation, wherein the function module with the first priority is a module that allows adjustment of the function execution cycle.

[0040] In the above steps, the first preset time length includes but is not limited to: 5 minutes, 10 minutes, 20 minutes, etc. The first preset time length can be adjusted according to the different functions of the functional modules and the different application scenarios of the camera equipment where the functional modules are located.

[0041] Through the above steps, since the time distance between the scheduled execution time and the current time is less than the first scheduled time (i.e., the first preset time mentioned above) and the target functional module is a functional module that allows adjustment of the execution cycle, the functional module can be called preferentially, thereby realizing the alignment operation of the calling time of multiple functional modules, reducing the number of times the target module is awakened and reducing the energy consumption of the device.

[0042] For example, Figure 4 The process of the module wake-up method according to an embodiment of the present invention is as follows Figure 2 ,like Figure 4 As shown, the process includes the following steps:

[0043] Step S402, the target module calculates the first time for sending to the hard timer to instruct the hard timer to wake up the target module next time to call the target function (i.e., the above-mentioned target function module), and the target function is the function whose next execution time is the shortest from the current calculation time among all functions;

[0044] Step S404, the target module determines whether the first time is less than a first predetermined time. If the first time is less than the first predetermined time, step S404 is executed.

[0045] Step S406, the target module determines whether the priority of the target function is PL (ie, the first priority mentioned above), and if the priority of the target function is PL, executes step S408;

[0046] Step S408: the target module calls the target function.

[0047] In the above steps, optionally, when the priority of the target function is PH (i.e., the second priority mentioned above), determine whether there are other functions whose scheduled execution time is less than the first scheduled time from the current time and whose priority is PL length. If there are other functions that meet the above conditions, execute the other functions that meet the above conditions.

[0048] In an optional embodiment, the target wake-up time is sent to the hardware timer to instruct the hardware timer to wake up the target module when the target wake-up time is reached, including: when the priority of the target functional module is the second priority, the target wake-up time is sent to the hardware timer to instruct the hardware timer to wake up the target module when the target wake-up time is reached, wherein the functional module with the second priority is a module that is not allowed to adjust the function execution cycle.

[0049] In an optional embodiment, the method further includes: obtaining attribute information of the plurality of functional modules; judging whether to allow adjustment of the function execution cycle of each functional module based on the attribute information of each functional module to obtain a judgment result; and setting the priority of each functional module based on the judgment result.

[0050] In the above steps, the attribute information includes but is not limited to: system module, functional module. For example, for the system module, it is set as a module whose execution cycle is not adjusted, and for the functional module, it is set as a module whose execution cycle can be adjusted. For example, the module with the first priority level includes but is not limited to: operating system module, etc., and the module with the first priority level includes but is not limited to: sensor module, lens module, image processing module, memory module, display module, interface module, communication module, power module, auxiliary function module, etc.

[0051] In an optional embodiment, determining the remaining calling time of each of the functional modules includes: determining the remaining calling time of each of the functional modules based on the execution cycle of each of the registered functional modules recorded in the target module, and the historical timestamp of each of the functional modules, wherein, if the functional module has been called before, the historical timestamp indicates the time when the functional module was last called, and if the functional module has not been called before, the historical timestamp indicates the registration time of the functional module.

[0052] In an optional embodiment, the wake-up time delivery condition includes at least one of the following: the target module completes calling any one of the multiple functional modules; any one of the multiple functional modules successfully registers to the target module.

[0053] In the above steps, the functional modules include but are not limited to: sensor module, lens module, image processing module, memory module, display module, operating system module, interface module, communication module, power module, auxiliary function module (for example, audio recording module, autofocus module, timer shooting module, scene mode module, etc.), etc. Exemplarily, when the image processing module completes video processing, the target module sends the time of waking up the target module next time to the hard timer. When the image processing module completes video processing, the target module will wake up the target module next time. When the target module is successfully registered with the target module, the target module will send the time of waking up the target module next time to the hard timer.

[0054] In an optional embodiment, the method further comprises: when a timestamp synchronization condition is met, calling a plurality of the functional modules to update the historical timestamp of each of the functional modules to the current time.

[0055] In an optional embodiment, the timestamp synchronization condition includes at least one of the following: the time length between the current time and the time when any functional module included in the multiple functional modules is first called reaches a second preset time length; a timestamp synchronization instruction is received.

[0056] In the above steps, the second preset time length includes but is not limited to: 5 minutes, 20 minutes, 1 hour, 5 hours, 10 hours, 20 hours, etc. The second preset time length can be adjusted according to the different functions of the functional modules and the different application scenarios of the camera equipment where the functional modules are located.

[0057] In an optional embodiment, illustratively, when the last execution time of all the functional modules (for functional modules that have not been executed, the registration time) is more than 1 hour away from the current time, multiple functional modules are called to update the historical timestamp of each functional module to the current time. The target module receives the timestamp synchronization instruction in a manner including but not limited to: receiving via a wireless connection (e.g., Wi-Fi, Bluetooth, etc.), receiving via infrared, receiving via voice, receiving via a cloud platform installed on a camera device, and the like.

[0058] For example, Figure 5 The process of the module wake-up method according to an embodiment of the present invention is as follows Figure 3 ,like Figure 5 As shown, the process includes the following steps:

[0059] Step S502, the target module determines the shortest operation cycle among the operation cycles of multiple functions (ie, the aforementioned functional modules);

[0060] Step S504, the target module records the most recent running time of each of the multiple functions;

[0061] Step S506, the target module records the time difference between adjacent running times among the multiple most recent running times corresponding to the multiple functions, and calculates the average value of the time difference between a predetermined number of consecutive adjacent running times;

[0062] Step S508, the target module determines whether the ratio of the average value to the shortest operation cycle is less than a threshold value, and if so, executes step S510;

[0063] Step S510: the target module resets time 0, runs all functions, and re-determines the time for indicating the hard timer to wake up the target module next time.

[0064] Through the above steps, since the ratio of the average time difference between adjacent running times to the shortest running cycle is less than the threshold, the running times are aligned by running all functions, thereby avoiding the target module from being frequently awakened in a short time, reducing the number of times the target module is awakened, and reducing the energy consumption of the device.

[0065] In the following, in conjunction with a specific embodiment, the module includes two functions, function A and function B, as an example, the module wake-up method in the present invention is exemplarily described. Figure 6 The process of the module wake-up method according to an embodiment of the present invention is as follows Figure 4 ,like Figure 6 As shown, the process includes the following steps:

[0066] Step S602, function A sends a registration request to the target platform, and registers the execution period T1 corresponding to function A, the timestamp t1 of function A sending the registration request, and the callback function corresponding to function A to the module;

[0067] Step S604, determining whether function A is successfully registered to the target platform, if yes, executing step S608, if no, executing step S606;

[0068] Step S606, the module (i.e., the aforementioned target module) instructs the hard timer to wake up the module at a time T1 away from the current time, and the module calls function A to send a registration request to the target platform again, and if the registration is successful, the registration success time is updated to t1;

[0069] Step S608, function B sends a registration request to the target platform, and registers the execution period T2 corresponding to function B, the timestamp t2 of function B sending the registration request, and the callback function corresponding to function B to the module;

[0070] Step S610, determining whether function B is successfully registered to the target platform, if yes, executing step S614, if no, executing step S612;

[0071] Step S612, the module instructs the hard timer to wake up the module at a time T2 away from the current time, calls function B to send a registration request to the target platform again, and if the registration is successful, updates the registration success time to t2;

[0072] Step S614, the module determines the execution time corresponding to function A according to T1 and t1, and determines the execution time corresponding to function B according to T2 and t2;

[0073] In step S616, the module calculates the function execution time closest to the current time, and instructs the hard timer to wake up the module at the most recent execution time.

[0074] In the above steps, when the module includes multiple functions, if the previous function is successfully registered, the next function is registered. Exemplarily, when the multiple functions include function A, function B, function C, and function D, if function A is successfully registered, function B is registered. Exemplarily, when the module includes multiple functions, if the multiple functions are successfully registered in sequence, the module calculates the function execution time closest to the current time, and instructs the hard timer to wake up the module at the most recent execution time. Exemplarily, the method of determining that the function is successfully registered includes but is not limited to: determining that the function is successfully registered when a response message returned by the target platform is received.

[0075] In step S616, the module includes but is not limited to calculating the function execution time closest to the current time in the following manner: after the function B is successfully registered, the hard timer is turned off, and the time interval t from the next timer wake-up module to the time when timing is started again is calculated by the following formula, where the value of T is the time when the function B is successfully registered,

[0076] t=Min(((t1+T1)-T),((t2+T2)-T));

[0077] After calculating the t, the t1 and t2 are updated to the time when the timing starts again.

[0078] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.

[0079] In this embodiment, a module wake-up device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0080] Figure 7 is a structural block diagram of a module awakening device according to an embodiment of the present invention, such as Figure 7 As shown, the device is applied to a target module, in which a plurality of function modules are registered, and the plurality of function modules reuse the same hardware timer, and the hardware timer is used to wake up the target module to call the function module to perform corresponding operations. The device includes: a first determining module 72, which is used to determine the remaining calling time of each of the function modules when the wake-up time sending condition is met, wherein the remaining calling time is used to indicate the remaining time from the moment when the function module is called next to the current moment; a second determining module 74, which is used to determine the function module with the shortest remaining calling time from the plurality of function modules based on the remaining calling time of each of the function modules, as the target function module; a sending module 76, which is used to determine the target wake-up time based on the moment when the target function module is called next, and send the target wake-up time to the hardware timer to instruct the hardware timer to wake up the target module when the target wake-up time is reached, wherein after the target module sends the target wake-up time to the hardware timer, the target module will enter a dormant state.

[0081] In an optional embodiment, the device also includes: a third determination module, used to determine the length of time from the target wake-up time to the current moment after determining the target wake-up time based on the moment when the target function module is called next time; a fourth determination module, used to determine the priority of the target function module when the length of time from the target wake-up time to the current moment meets a predetermined condition; and a first calling module, used to execute the operation of calling the target function module based on the priority of the target function module.

[0082] In an optional embodiment, the fourth determination module includes: a first determination unit, configured to determine the priority of the target function module when the duration from the target wake-up time to the current moment satisfies a predetermined condition, including: determining the priority of the target function module when it is determined that the duration from the target wake-up time to the current moment is less than a first preset duration;

[0083] The first calling module includes: a calling unit, which is used to directly call the target function module to perform the target operation when the priority of the target function module is a first priority, wherein the function module with the first priority is a module that allows adjustment of the function execution cycle.

[0084] In an optional embodiment, the sending module 76 includes: a sending unit, used to send the target wake-up time to the hardware timer when the priority of the target functional module is the second priority, so as to instruct the hardware timer to wake up the target module when the target wake-up time is reached, wherein the functional module with the second priority is a module that is not allowed to adjust the function execution cycle.

[0085] In an optional embodiment, the device also includes: an acquisition module, used to acquire attribute information of multiple functional modules; a judgment module, used to judge whether to allow adjustment of the function execution cycle of each functional module based on the attribute information of each functional module, and obtain a judgment result; and a setting module, used to set the priority of each functional module based on the judgment result.

[0086] In an optional embodiment, the first determination module 72 includes: a second determination unit, used to determine the remaining calling time of each functional module based on the execution cycle of each registered functional module recorded in the target module, and the historical timestamp of each functional module, wherein, if the functional module has been called before, the historical timestamp indicates the time when the functional module was last called, and if the functional module has not been called before, the historical timestamp indicates the registration time of the functional module.

[0087] In an optional embodiment, the wake-up time delivery condition includes at least one of the following: the target module completes calling any one of the multiple functional modules; any one of the multiple functional modules successfully registers to the target module.

[0088] In an optional embodiment, the device method further includes: a calling module, configured to call the plurality of function modules when a timestamp synchronization condition is met, so as to update the historical timestamp of each function module to the current time.

[0089] In an optional embodiment, the timestamp synchronization condition includes at least one of the following: the time length between the current time and the time when any functional module included in the multiple functional modules is first called reaches a second preset time length; a timestamp synchronization instruction is received.

[0090] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.

[0091] An embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.

[0092] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.

[0093] An embodiment of the present invention further provides a camera, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0094] An embodiment of the present invention further provides a computer program product, the computer program product comprising a computer program, and when the computer program is executed by a processor, the steps in any one of the above method embodiments are implemented.

[0095] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.

[0096] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order than here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.

[0097] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A module wake-up method, characterized in that: Applied to a target module, wherein a plurality of functional modules are registered in the target module, and the plurality of functional modules reuse the same hardware timer, and the hardware timer is used to wake up the target module to call the functional module to perform a corresponding operation, the method comprising: When the wake-up time delivery condition is met, determining the remaining call time of each of the functional modules, wherein the remaining call time is used to indicate the remaining time between the next call time of the functional module and the current time; Based on the remaining call time of each of the functional modules, determining a functional module with the shortest remaining call time among the multiple functional modules as a target functional module; A target wake-up time is determined based on the time when the target functional module is called next time, and the target wake-up time is sent to the hardware timer to instruct the hardware timer to wake up the target module when the target wake-up time arrives, wherein after the target module sends the target wake-up time to the hardware timer, the target module enters a sleep state.

2. The method according to claim 1, characterized in that After determining the target wake-up time based on the time when the target functional module is called next time, the method further includes: Determine the distance between the target wake-up time and the current time; When the time length between the target wake-up time and the current time satisfies a predetermined condition, determining the priority of the target functional module; An operation of calling the target functional module is performed based on the priority of the target functional module.

3. The method according to claim 2, characterized in that In the case where the time length from the target wake-up time to the current moment satisfies a predetermined condition, determining the priority of the target function module includes: in the case where it is determined that the time length from the target wake-up time to the current moment is less than a first preset time length, determining the priority of the target function module; The operation of calling the target function module based on the priority of the target function module includes: when the priority of the target function module is a first priority, directly calling the target function module to execute the target operation, wherein the function module with the first priority is a module that allows adjustment of the function execution cycle.

4. The method according to claim 3, characterized in that Sending the target wake-up time to the hardware timer to instruct the hardware timer to wake up the target module when the target wake-up time arrives includes: When the priority of the target functional module is the second priority, the target wake-up time is sent to the hardware timer to instruct the hardware timer to wake up the target module when the target wake-up time is reached, wherein the functional module with the second priority is a module that is not allowed to adjust the function execution cycle.

5. The method according to claim 3, characterized in that: The method further comprises: Acquire attribute information of a plurality of said functional modules; Based on the attribute information of each of the functional modules, determining whether to allow adjustment of the function execution cycle of each of the functional modules, and obtaining a determination result; The priority of each of the functional modules is set based on the determination result.

6. The method according to claim 1, characterized in that Determining the remaining call time of each of the functional modules includes: Based on the execution cycle of each registered functional module recorded in the target module and the historical timestamp of each functional module, the remaining calling time of each functional module is determined, wherein, if the functional module has been called before, the historical timestamp indicates the time when the functional module was last called, and if the functional module has not been called before, the historical timestamp indicates the registration time of the functional module.

7. The method according to claim 1, characterized in that The wake-up time delivery condition includes at least one of the following: The target module completes calling any one of the plurality of function modules; Any one of the plurality of functional modules is successfully registered with the target module.

8. The method according to claim 1, characterized in that The method further comprises: When the timestamp synchronization condition is met, a plurality of the functional modules are called to update the historical timestamp of each of the functional modules to the current time.

9. The method according to claim 8, characterized in that The timestamp synchronization condition includes at least one of the following: The time length between the current moment and the moment when any function module included in the plurality of function modules is first called reaches a second preset time length; Received a timestamp synchronization instruction.

10. A module awakening device, characterized in that: Applied to a target module, wherein a plurality of functional modules are registered in the target module, and the plurality of functional modules reuse the same hardware timer, and the hardware timer is used to wake up the target module to call the functional module to perform a corresponding operation, the device comprises: A first determination module is used to determine the remaining call time of each of the functional modules when the wake-up time delivery condition is met, wherein the remaining call time is used to indicate the remaining time from the moment when the functional module is next called to the current moment; A second determining module is used to determine, based on the remaining call time of each of the functional modules, a functional module with the shortest remaining call time among the multiple functional modules as a target functional module; A sending module is used to determine a target wake-up time based on the time when the target functional module is called next time, and send the target wake-up time to the hardware timer to instruct the hardware timer to wake up the target module when the target wake-up time arrives, wherein after the target module sends the target wake-up time to the hardware timer, the target module will enter a sleep state.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program implements the steps of the method described in any one of claims 1 to 9 when executed by a processor.

12. A camera comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the method described in any one of claims 1 to 9 are implemented.

13. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method described in any one of claims 1 to 9 are implemented.

Citation Information

Patent Citations

  • Monitoring module for computer operation system

    CN104360913A

  • Timer calling method, device and equipment and computer readable storage medium

    CN112817723A

  • Resource state management method and device, electronic equipment and storage medium

    CN114610578A

  • Method and apparatus for reducing power consumption in mobile terminal

    US20100271176A1

  • Method for controlling process, and electronic device and readable storage medium

    WO2023160205A1