Timed task processing method and device, equipment, medium and program product

By generating and compiling event timers in the open source Hongmeng system, the problem of some versions not supporting timed event processing is solved, the timing task processing capability and user experience are improved, and the support for complex timing business scenarios is achieved.

CN119311108APending Publication Date: 2025-01-14HONGHU WANLIAN (JIANGSU) TECH DEV CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411347850.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-25
Publication Date
2025-01-14

AI Technical Summary

Technical Problem

Some versions of open source Hongmeng do not support timing event processing, resulting in poor user experience and cannot meet the needs of complex timing business scenarios.

Method used

By obtaining the timer thread for the open source Hongmeng target version, generating an event timer, and compiling the timer when the target device's Hongmeng system is started, monitoring the timer call request issued by the application or system service, based on event timing The timing task is initiated by the controller and timing associated parameters.

Benefits of technology

It enhances the timing task processing capabilities of the open source Hongmeng system, solves the problem of poor user experience, improves the user experience, and provides functions such as timing shutdown and restart in versions that do not support timing tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119311108A_ABST
    Figure CN119311108A_ABST
Patent Text Reader

Abstract

The invention discloses a timed task processing method and device, equipment, a medium and a program product. The timed task processing method comprises the following steps: acquiring timer thread creation data for an open source gap target version, and creating data based on the timer thread to generate an event timer; copying the event timer to the target equipment configuration directory, and compiling the event timer under the target equipment configuration directory when the swan-gap system of the target equipment is started; and when a timer calling request sent by an application or a system service is monitored, starting a timing task based on the event timer and the timing correlation parameter. According to the technical scheme provided by the embodiment of the invention, the regular transaction processing function of part of open-source wide-gap versions can be enhanced, and the user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of development boards of an open source Hongmeng system, and in particular to a method, device, equipment, medium and program product for processing scheduled tasks. Background Art

[0002] Currently, some versions of the open source Hongmeng do not support the function of scheduled event processing. The system interface only provides basic shutdown options and does not support the ability to schedule event processing (such as scheduled shutdown, restart, etc.), which cannot meet the actual needs of users.

[0003] For example, the power management in OpenHarmony (Open Source Hongmeng) 3.1Release only provides a simple shutdown interface. It is only suitable for simple business scenarios, such as shutting down by pressing a button or shutting down by pressing a button on the screen, and cannot adapt to actual complex timed business scenarios. Summary of the invention

[0004] The present invention provides a method, device, equipment, medium and program product for processing scheduled tasks to solve the problem that some versions of the open source Hongmeng do not support scheduled event processing and have poor user experience.

[0005] According to one aspect of the present invention, a method for processing a scheduled task is provided, comprising:

[0006] Obtain the timer thread creation data for the open source Hongmeng target version, and generate an event timer based on the timer thread creation data;

[0007] Copy the event timer to the target device configuration directory, and compile the event timer in the target device configuration directory when the Hongmeng system of the target device is started;

[0008] When a timer call request from an application or system service is detected, a timer task is started based on the event timer and timing-related parameters.

[0009] According to another aspect of the present invention, there is provided a device for processing a scheduled task, comprising:

[0010] An event timer generation module, used to obtain the timer thread creation data for the open source Hongmeng target version, and generate an event timer based on the timer thread creation data;

[0011] A copy and compile module, used to copy the event timer to the target device configuration directory, and compile the event timer in the target device configuration directory when the Hongmeng system of the target device is started;

[0012] The scheduled task trigger module is used to start the scheduled task based on the event timer and timing associated parameters when a timer call request issued by an application or system service is detected.

[0013] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0014] at least one processor; and

[0015] a memory communicatively connected to the at least one processor; wherein,

[0016] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the method for processing a scheduled task described in any embodiment of the present invention.

[0017] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the method for processing a timed task described in any embodiment of the present invention when executed.

[0018] According to another aspect of the present invention, a computer program product is provided. When the computer program is executed by a processor, the method for processing a scheduled task according to any embodiment of the present invention is implemented.

[0019] The technical solution of the embodiment of the present invention obtains the timer thread creation data for the open source Hongmeng target version, and generates an event timer based on the timer thread creation data, thereby copying the event timer to the target device configuration directory, and when the Hongmeng system of the target device is started, compiles the event timer in the target device configuration directory, and then when the timer call request issued by the application or system service is detected, the timer task is started based on the event timer and the timing associated parameters. In this solution, when the open source Hongmeng target version does not support the timer task, the native shutdown can be optimized by adding an event timer as the basis of the timer task function, so as to utilize the event timer to enhance the timer task processing capability of some open source Hongmeng systems, solve the problem that some versions of the open source Hongmeng do not support timer event processing and the user experience is poor, and can enhance the function of some open source Hongmeng versions to process timer transactions and improve the user experience.

[0020] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0022] Figure 1 A flowchart of a method for processing a scheduled task provided in Embodiment 1 of the present invention;

[0023] Figure 2 A flowchart of a method for processing a scheduled task provided in Embodiment 2 of the present invention;

[0024] Figure 3 A schematic diagram of the structure of a device for processing scheduled tasks provided in Embodiment 3 of the present invention;

[0025] Figure 4 A schematic diagram of the structure of an electronic device that can be used to implement an embodiment of the present invention is shown. DETAILED DESCRIPTION

[0026] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0027] It should be noted that the term "target" and the like 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. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0028] Embodiment 1

[0029] Figure 1A flowchart of a method for processing a scheduled task provided in Embodiment 1 of the present invention. This embodiment can be applied to enhance the processing of scheduled tasks in some versions of the open source Hongmeng system. The method can be executed by a processing device for scheduled tasks. The processing device for scheduled tasks can be implemented in the form of hardware and / or software. The processing device for scheduled tasks can be configured in an electronic device.

[0030] like Figure 1 As shown, the method includes:

[0031] Step 110: Obtain the timer thread creation data for the open source Hongmeng target version, and generate an event timer based on the timer thread creation data.

[0032] Among them, the open source Hongmeng target version can be an open source Hongmeng version configured on the development board that does not support timed event processing. Exemplarily, the open source Hongmeng target version can include but is not limited to the open source Hongmeng 3.1Release. The timer thread creation data can be data for creating a timer thread under the open source Hongmeng target version. The event timer can be used to provide a timing service.

[0033] In an embodiment of the present invention, it is possible to first determine whether the current version of open source Hongmeng carried by the development board (that is, the open source Hongmeng version configured on the current development board) supports timed event processing. If the current version of open source Hongmeng does not support timed event processing, it is possible to determine that the current version of open source Hongmeng is the open source Hongmeng target version, and then obtain the timer thread creation data configured in the event processor of the open source Hongmeng target version, thereby creating a thread for providing timing services according to the timer thread creation data, that is, generating an event timer.

[0034] Step 120: Copy the event timer to the configuration directory of the target device, and compile the event timer in the configuration directory of the target device when the Hongmeng system of the target device is started.

[0035] The target device configuration directory may be a file directory where the target device stores configuration data. The target device may be a development board installed in the current version of open source Hongmeng.

[0036] In an embodiment of the present invention, the generated event timer can be copied to the target device configuration directory, and the event timer compilation option added by the user can be used to compile the event timer in the target device configuration directory when the Hongmeng system of the target device is started.

[0037] Optionally, the timed event log of the event timer can be recorded to facilitate the user to perform system maintenance.

[0038] Step 130: When a timer call request from an application or system service is detected, a timer task is started based on an event timer and timing-related parameters.

[0039] The timer call request may be a request to call an event timer. The timing-related parameters may be relevant data of a timed task corresponding to the timer call request. Exemplarily, the timing-related parameters may include a user-set timing duration, a task type of a timed task, and an interface for starting an event timer. The timed tasks may include, but are not limited to, timed shutdown and timed restart.

[0040] In an embodiment of the present invention, if a timer call request issued by an application or system service is monitored, the timer call request can be parsed to obtain timing associated parameters, thereby triggering an event timer based on the timing associated parameters, and then starting a timing task when the timing time is reached.

[0041] The technical solution of the embodiment of the present invention obtains the timer thread creation data for the open source Hongmeng target version, and generates an event timer based on the timer thread creation data, thereby copying the event timer to the target device configuration directory, and when the Hongmeng system of the target device is started, compiles the event timer in the target device configuration directory, and then when the timer call request issued by the application or system service is detected, the timer task is started based on the event timer and the timing associated parameters. In this solution, when the open source Hongmeng target version does not support the timer task, the native shutdown can be optimized by adding an event timer as the basis of the timer task function, so as to utilize the event timer to enhance the timer task processing capability of some open source Hongmeng systems, solve the problem that some versions of the open source Hongmeng do not support timer event processing and the user experience is poor, and can enhance the function of some open source Hongmeng versions to process timer transactions and improve the user experience.

[0042] Embodiment 2

[0043] Figure 2 This is a flowchart of a method for processing a scheduled task provided in Example 2 of the present invention. This embodiment is specific based on the above embodiment and provides a specific optional implementation method for obtaining timer thread creation data for the open source Hongmeng target version. Figure 2 As shown, the method includes:

[0044] Step 210: Obtain the current pending events delivered by the event processor under the open source Hongmeng target version.

[0045] Among them, the event handler can be the EventHandler in the open source Hongmeng. The event handler provides the basic ability for communication between open source Hongmeng threads. It can create a new thread through EventRunner (event circulator) and throw the time-consuming operation to the new thread for execution, so as to reasonably handle the time-consuming task without blocking the original thread. The current pending event can be the InnerEvent event currently sent to the event handler.

[0046] In an embodiment of the present invention, the current pending events delivered by the event processor under the open source Hongmeng target version can be obtained.

[0047] Step 220: When it is determined that the current event to be processed is a timer generated event, generate timer thread creation data based on the timer generated event, and generate an event timer based on the timer thread creation data.

[0048] The timer generation event may be an InnerEvent event used to indicate the generation of a timer.

[0049] In the embodiment of the present invention, if it is determined that the current event to be processed is a timer generated event, timer thread creation data corresponding to the timer generated event is generated based on EventRunner, and the event timer is created using the timer thread creation data.

[0050] Step 230: Copy the event timer to the configuration directory of the target device, and compile the event timer in the configuration directory of the target device when the Hongmeng system of the target device is started.

[0051] Step 240: When a timer call request from an application or system service is detected, a timer task is started based on the event timer and timing-related parameters.

[0052] In an optional embodiment of the present invention, before starting a scheduled task based on an event timer and timing associated parameters, it may also include: obtaining the target timing duration configured by the user based on the power management service layer interface, and obtaining the initial power-on duration through the system interface; determining the task type of the scheduled task, and adding the target timing duration and the task type of the scheduled task to the timing associated parameters.

[0053] Among them, the power management service layer interface can be an interface for recording the user-configured timing duration on the system service layer in the open source Hongmeng system. The initial boot duration can be the boot duration maintained from the current boot action of the target device to obtaining the user-configured timing duration. The target timing duration can be the timing duration set by the user. The task type can be the type of scheduled task. The task type can be divided into a type that does not require timing of the device background power supply module, that is, a non-scheduled boot task type, and a type that requires timing of the device background power supply module, that is, a scheduled boot task type.

[0054] In an embodiment of the present invention, the target timing duration configured by the user can be obtained from the power management service layer interface. At the same time, the initial power-on duration can be obtained through the system interface, and the task type of the scheduled task can be determined by parsing the timer call request, so that the target timing duration and the task type of the scheduled task can be added to the timing associated parameters.

[0055] In an optional embodiment of the present invention, starting a scheduled task based on an event timer and timing-related parameters may include: calculating a target setting time based on an initial startup duration and a target timing duration; and when the task type is a non-scheduled startup task type, starting the scheduled task based on an event timer and a target setting time.

[0056] The target setting time may be the time when the scheduled task is triggered. For example, assuming that the initial startup time is T1 and the target timing time is T2, the target setting time is the time after (T1+T2) from the startup time, which is equivalent to setting the startup time on demand.

[0057] In an embodiment of the present invention, the sum of the initial power-on duration and the target timing duration can be calculated as the target setting time, and the task type of the scheduled task can be determined. If the task type is a non-scheduled power-on task type, the event timer is started to continuously poll whether the current time is the target setting time, that is, to determine whether the current power-on duration has reached the sum of the initial power-on duration and the target timing duration, and when the timer polling reaches the target setting time, the scheduled task is started.

[0058] In this solution, the boot time is used as a benchmark to calculate the time difference between the scheduled task and the boot time, and then the boot time is continuously obtained according to the system interface until the boot time is equal to the set timing time. This can effectively avoid timing errors and improve timing effects.

[0059] In an optional embodiment of the present invention, starting a scheduled task according to an event timer and a target set time may include: adding a scheduled task callback function and a target set time to an event timer; starting the event timer, and when the event timer monitors that the target set time has been reached, executing the scheduled task callback function to start the scheduled task.

[0060] The timed task callback function is the callback function of the event timer.

[0061] In an embodiment of the present invention, the Add method can be called to add the scheduled task callback function and the target setting time to the event timer, further start the event timer, and start a thread with an execution duration of the target timing duration in the event timer to continuously poll. When the thread monitors that the target setting time has been reached, the scheduled task callback function is executed through the event timer to start the scheduled task.

[0062] In an optional embodiment of the present invention, after determining the task type of the scheduled task and adding the target timing duration and the task type of the scheduled task to the timing associated parameters, it can also include: when the task type is a scheduled startup task type, sending the target timing duration and the target device shutdown time to the hardware timing module; starting the scheduled task according to the target timing duration, the target device shutdown time and the hardware timing module.

[0063] The shutdown time of the target device may be the shutdown time of the target device. The hardware timing module may be a hardware module with a timing function. Exemplarily, the hardware timing module may include but is not limited to an RTC (real-time clock module).

[0064] In an embodiment of the present invention, when it is determined that the task type of the scheduled task is a scheduled startup task type, the target set time and the target device shutdown time can be sent to the hardware timing module, so that the hardware timing module is triggered to start timing through the target device shutdown time. The hardware timing module continues to work, and when the timing duration reaches the target timing duration, the scheduled task is triggered by an interrupt, that is, the target device is triggered to automatically start up.

[0065] In a specific example, the user can call the scheduled startup interface or the scheduled shutdown interface in the power management client (located in the system service layer) through an application or system service to configure the power on and off time of the open source Hongmeng system 3.1Release version.

[0066] If the scheduled task is a shutdown or restart task, after the power management client receives the request to set the target timing duration, it sends the request to the power time setting interface. After receiving the above request to set the power time interface, the power management server first calls the recording power time interface to write the target timing duration into the configuration file. The power management server calls the processing power time interface, and then calculates the target setting time through the calculation power time interface, so as to start an event timer through the timer call request to continuously poll whether the current time reaches the set time. If the set time is reached, the target device is shut down or restarted, otherwise the event timer continues to perform the polling operation. If it is a scheduled startup task, the target timing duration is sent to the RTC module. In the shutdown case, the RTC module will continue to work, and the system power will be turned on when the startup time is reached.

[0067] The workflow of the event timer is as follows: Step 1. The application or system service calls the Start method in the event timer (i.e., the method used to start the thread). When starting the event timer, no parameters are required to start the timing immediately. Step 2. Call the Add method (i.e., the method used to pass data) to add the scheduled task callback and the target timing duration to be processed to the timer. Step 3. A thread is started inside the event timer to continuously poll. If the sum of the initial startup duration and the target timing duration has not passed since the power-on moment, the thread will sleep for a period of time. If the sum of the initial startup duration and the target timing duration has passed since the power-on moment, an EventHandler thread based on the open source Hongmeng is created to send the scheduled task callback to be executed to the event processing queue based on the EventHandler thread and wait for execution.

[0068] Optionally, when the event timer is working, if the target device restarts, the event timer calculates the target set time and the time difference between the target device and the restart time, so as to control the event timer thread to continuously poll until the target set time is reached. The event timer is controlled by the relative time difference based on the current startup time of the target device, so as to avoid timing errors.

[0069] Based on the open source Hongmeng 3.1release version, the event timer is transplanted so that the event timer is compiled into the open source Hongmeng system as the basis for the scheduled task processing function. The scheduled task processing function is added to the open source Hongmeng 3.1Release version. This solution does not rely on other components. Although it is developed and used in the open source Hongmeng 3.1Release, it can also be easily transplanted to other open source Hongmeng systems. That is, the custom timer implemented based on the EventHandler event processing in the open source Hongmeng enhances the scheduled task processing function of the 3.1Release version. For example, as a scheduled task for scheduled power on and off, a reasonable setting of the power on and off time can allow embedded devices to have a longer battery life to complete more corresponding tasks, and the scheduled power on and off function can reduce the number of manual operations on the equipment, saving labor costs and time costs.

[0070] The technical solution of the embodiment of the present invention obtains the current pending event delivered by the event processor under the open source Hongmeng target version, so that when it is determined that the current pending event is a timer generated event, based on the timer generated event, the timer thread creation data is generated, and the event timer is generated based on the timer thread creation data, and then the event timer is copied to the target device configuration directory, and when the Hongmeng system of the target device is started, the event timer under the target device configuration directory is compiled, and further when the timer call request issued by the application or system service is monitored, the timer task is started based on the event timer and the timing associated parameters. In this solution, when the open source Hongmeng target version does not support scheduled tasks, the native shutdown can be optimized by adding an event timer as the basis of the scheduled task function, so as to enhance the scheduled task processing capability of some open source Hongmeng systems by using the event timer, solve the problem that some versions of the open source Hongmeng do not support scheduled event processing and the user experience is poor, and can enhance the function of scheduled transaction processing of some open source Hongmeng versions and improve the user experience.

[0071] Embodiment 3

[0072] Figure 3 This is a schematic diagram of the structure of a timing task processing device provided by Embodiment 3 of the present invention. Figure 3 As shown, the device comprises:

[0073] An event timer generation module 310 is used to obtain timer thread creation data for the open source Hongmeng target version, and generate an event timer based on the timer thread creation data;

[0074] A copy and compile module 320, used to copy the event timer to the target device configuration directory, and compile the event timer in the target device configuration directory when the Hongmeng system of the target device is started;

[0075] The timer task triggering module 330 is used to start the timer task based on the event timer and the timer-related parameters when a timer call request issued by an application or system service is detected.

[0076] The technical solution of the embodiment of the present invention obtains the timer thread creation data for the open source Hongmeng target version, and generates an event timer based on the timer thread creation data, thereby copying the event timer to the target device configuration directory, and when the Hongmeng system of the target device is started, compiles the event timer in the target device configuration directory, and then when the timer call request issued by the application or system service is detected, the timer task is started based on the event timer and the timing associated parameters. In this solution, when the open source Hongmeng target version does not support the timer task, the native shutdown can be optimized by adding an event timer as the basis of the timer task function, so as to utilize the event timer to enhance the timer task processing capability of some open source Hongmeng systems, solve the problem that some versions of the open source Hongmeng do not support timer event processing and the user experience is poor, and can enhance the function of some open source Hongmeng versions to process timer transactions and improve the user experience.

[0077] Optionally, the event timer generation module 310 is specifically used to obtain the current pending event delivered by the event processor under the open source Hongmeng target version; when it is determined that the current pending event is a timer generated event, the timer thread creation data is generated based on the timer generated event.

[0078] Optionally, the processing device for the scheduled task also includes a parameter acquisition module, which is used to obtain the target timing duration configured by the user based on the power management service layer interface, and obtain the initial power-on duration through the system interface; determine the task type of the scheduled task, and add the target timing duration and the task type of the scheduled task to the timing associated parameters.

[0079] Optionally, the scheduled task trigger module 330 is specifically used to calculate the target setting time based on the initial power-on duration and the target timing duration; when the task type is a non-scheduled power-on task type, the scheduled task is started according to the event timer and the target setting time.

[0080] Optionally, the scheduled task trigger module 330 is specifically used to add the scheduled task callback function and the target setting time to the event timer; start the event timer, and when the event timer monitors that the target setting time has been reached, execute the scheduled task callback function to start the scheduled task.

[0081] Optionally, the processing device for the scheduled task also includes a scheduled startup module, which is used to send the target timing duration and the target device shutdown time to the hardware timing module when the task type is a scheduled startup task type; and start the scheduled task according to the target timing duration, the target device shutdown time and the hardware timing module.

[0082] The apparatus for processing scheduled tasks provided in the embodiment of the present invention can execute the method for processing scheduled tasks provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0083] Embodiment 4

[0084] Figure 4 A schematic diagram of an electronic device that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0085] like Figure 4 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0086] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0087] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a processing method for a timed task.

[0088] In some embodiments, the processing method of the timed task can be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the processing method of the timed task described above can be performed. Alternatively, in other embodiments, the processor 11 can be configured to execute the processing method of the timed task in any other appropriate manner (for example, by means of firmware).

[0089] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0090] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0091] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0092] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0093] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0094] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of traditional physical hosts and VPS servers, which are difficult to manage and have weak business scalability.

[0095] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0096] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for processing a scheduled task, characterized in that: include: Obtain timer thread creation data for the open source Hongmeng target version, and generate an event timer based on the timer thread creation data; Copy the event timer to the target device configuration directory, and compile the event timer in the target device configuration directory when the Hongmeng system of the target device is started; When a timer call request issued by an application or system service is monitored, a timer task is started based on the event timer and timing associated parameters.

2. The method according to claim 1, characterized in that The obtaining of the timer thread creation data for the open source Hongmeng target version includes: Obtain the current pending events delivered by the event processor under the open source Hongmeng target version; When it is determined that the current event to be processed is a timer generated event, the timer thread creation data is generated based on the timer generated event.

3. The method according to claim 1, characterized in that Before starting the scheduled task based on the event timer and the timing associated parameters, the method further includes: Obtain the target timing duration configured by the user based on the power management service layer interface, and obtain the initial power-on duration through the system interface; The task type of the scheduled task is determined, and the target timing duration and the task type of the scheduled task are added to the timing associated parameters.

4. The method according to claim 3, characterized in that The starting of the timing task based on the event timer and the timing associated parameters includes: Calculating a target setting time according to the initial startup time and the target timing time; When the task type is a non-scheduled startup task type, the scheduled task is started according to the event timer and the target setting time.

5. The method according to claim 4, characterized in that The starting the timed task according to the event timer and the target setting time includes: Adding the scheduled task callback function and the target setting time to the event timer; The event timer is started, and when the event timer monitors that the target setting time has been reached, the timed task callback function is executed to start the timed task.

6. The method according to claim 3, characterized in that After determining the task type of the scheduled task and adding the target timing duration and the task type of the scheduled task to the timing associated parameters, the method further includes: When the task type is a scheduled startup task type, the target timing duration and the target device shutdown time are sent to a hardware timing module; The timing task is started according to the target timing duration, the target device shutdown time and the hardware timing module.

7. A timed task processing device, characterized in that: include: An event timer generation module, used to obtain timer thread creation data for the open source Hongmeng target version, and generate an event timer based on the timer thread creation data; A copy and compile module, used to copy the event timer to the target device configuration directory, and compile the event timer in the target device configuration directory when the Hongmeng system of the target device is started; The timer task triggering module is used to start the timer task based on the event timer and the timer associated parameters when monitoring the timer call request issued by the application or system service.

8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the method for processing a timing task according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the method for processing a timed task according to any one of claims 1 to 6 when the processor executes the instructions.

10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the computer program implements the method for processing a timed task according to any one of claims 1 to 6.