Timer operation method, device, equipment, storage medium and program product
A unified timer operation method for software systems addresses complex timer management by determining and executing timers based on task information, ensuring efficient and synchronized timing processing across threads, processes, and IP address domains, enhancing system performance and ease of use.
Patent Information
- Application Number
- CN202211168263.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-23
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2042-09-23
AI Technical Summary
Complex timer management in software systems with numerous tasks leads to cumbersome processes, confusing message mechanisms, and performance issues due to excessive hardware timers, which affect system performance.
A unified timer operation method that determines the target timer based on task information, using current thread, cross-thread, cross-process, or cross-IP address domain timers, and executes timing processing operations through appropriate message mechanisms, ensuring synchronization and compatibility across different scopes.
Facilitates efficient and convenient timer operation across various scopes without requiring knowledge of the underlying implementation, maintaining system performance by using a unified operation interface.
Smart Images

Figure CN115567140B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technology, and in particular to a timer operation method, device, equipment, storage medium and program product. Background Art
[0002] As software functions become more complex and diverse, more and more timers are needed. Each timer processing flow requires the establishment of a timer trigger source at the bottom layer, the selection of a corresponding synchronization mechanism as a message triggering means based on the functional relationship between the target timed task and the current task, and timer maintenance and management. For software systems involving a large number of tasks and requiring a large number of timers, there is no simple and universal timer operation interface. Timer management will result in cumbersome processes, confusing message mechanisms, and difficulty in maintenance. If too many hardware timers are applied, interrupt resources will affect system performance.
[0003] Therefore, how to better ensure the operation of the timer has become an urgent problem to be solved in the industry. Summary of the invention
[0004] The present invention provides a timer operation method, device, equipment, storage medium and program product, which are used to solve the defect of complex timer management in the prior art.
[0005] The present invention provides a timer operation method, comprising:
[0006] Based on the timer type corresponding to the timed task information, determine the target timer from the N timers in the array queue, wherein the target timer is: a current thread type timer, a cross-thread type timer, a cross-process type timer, or a cross-IP address domain type timer, and N is a positive integer;
[0007] When the trigger time of the target timer is consistent with the current interrupt source beat count, the timing processing operation corresponding to the target timer is executed.
[0008] According to a timer operation method provided by the present invention, executing a timing processing operation corresponding to the target timer includes:
[0009] In the case where the target timer is a timer of the current thread type, the target timing processing operation in the current thread is directly triggered.
[0010] According to a timer operation method provided by the present invention, executing a timing processing operation corresponding to the target timer includes:
[0011] In the case where the target timer is the cross-thread type timer, an inter-thread message mechanism is used to send a message to trigger a timing processing operation in the destination thread; wherein the destination thread is associated with the target timer.
[0012] According to a timer operation method provided by the present invention, executing a timing processing operation corresponding to the target timer includes:
[0013] In the case where the target timer is the cross-process type timer, an inter-process message mechanism is used to trigger a timing processing operation in a destination process, wherein the destination process is associated with the target timer.
[0014] According to a timer operation method provided by the present invention, executing a timing processing operation corresponding to the target timer includes:
[0015] In the case where the target timer is the cross-IP address domain type timer, a socket message is sent to trigger a destination timing processing operation in a destination IP address domain software environment, wherein the destination IP address domain is associated with the target timer.
[0016] According to a timer operation method provided by the present invention,
[0017] Before determining the target timer from the N timers in the array queue based on the timer type corresponding to the timed task information, the method further includes:
[0018] Obtaining registration parameters of the timer, wherein the registration parameters include: the task ID of the task processing unit where the timed task is located, the timer priority, the time length of the timer, and whether the timer runs periodically;
[0019] After completing the registration of the timer based on the registration parameters, the timer is added to the array queue.
[0020] The present invention also provides a timer operation device, comprising:
[0021] A determination module, configured to determine a target timer from N timers in the array queue based on a timer type corresponding to the timer information, wherein the target timer is a current thread type timer, a cross-thread type timer, a cross-process type timer, or a cross-IP address domain type timer, and N is a positive integer;
[0022] The running module is used to execute the timing processing operation corresponding to the target timer when the triggering time of the target timer is consistent with the beat count of the current interrupt source.
[0023] According to a timer operation device provided by the present invention, the operation module is specifically used for:
[0024] In the case where the target timer is a timer of the current thread type, the target timing processing operation in the current thread is directly triggered.
[0025] According to a timer operation device provided by the present invention, the operation module is specifically used for:
[0026] In the case where the target timer is the cross-thread type timer, an inter-thread message mechanism is used to send a message to trigger a timing processing operation in the destination thread; wherein the destination thread is associated with the target timer.
[0027] According to a timer operation device provided by the present invention, the operation module is specifically used for:
[0028] In the case where the target timer is the cross-process type timer, an inter-process message mechanism is used to trigger a timing processing operation in a destination process, wherein the destination process is associated with the target timer.
[0029] According to a timer operation device provided by the present invention, the operation module is specifically used for:
[0030] In the case where the target timer is the cross-IP address domain type timer, a socket message is sent to trigger a destination timing processing operation in a destination IP address domain software environment, wherein the destination IP address domain is associated with the target timer.
[0031] According to a timer operation device provided by the present invention, the device is also used for:
[0032] Obtaining registration parameters of the timer, wherein the registration parameters include: the task ID of the task processing unit where the timed task is located, the timer priority, the time length of the timer, and whether the timer runs periodically;
[0033] After completing the registration of the timer based on the registration parameters, the timer is added to the array queue.
[0034] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, any of the timer operation methods described above is implemented.
[0035] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the timer operation method described in any one of the above is implemented.
[0036] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the timer operation method described above is implemented.
[0037] The timer operation method, device, equipment, storage medium and program product provided by the present invention can trigger various timer processing operations with different scopes by assigning a unique task ID to each timed task, and different task IDs correspond to different scopes of action of timer triggering, and thus correspond to different timer types. In addition to triggering timed processing operations within a thread, it can also trigger timed processing operations across threads, across processes, and across IP address domains. And there is a unified operation interface to achieve compatibility, and it is not necessary to know the complex implementation process of the underlying layer when calling, and it is very convenient to operate the timer. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0039] Figure 1 A schematic diagram of a timer operation method flow chart provided in an embodiment of the present application;
[0040] Figure 2 A schematic diagram of a timer operation device provided in an embodiment of the present application;
[0041] Figure 3 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0042] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are 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 are within the scope of protection of the present invention.
[0043] Figure 1 A schematic diagram of a timer operation method flow chart provided in an embodiment of the present application, such as Figure 1 As shown, including:
[0044] Step 110, based on the timer type corresponding to the timer task information, determine the target timer from the N timers in the array queue, wherein the target timer is: a current thread type timer, a cross-thread type timer, a cross-process type timer or a cross-IP address domain type timer, and N is a positive integer;
[0045] Specifically, the scheduled task information described in the embodiments of the present application may specifically refer to a scheduled task in a multi-tasking software system, which may specifically be a scheduled task from the underlying driver, which establishes interrupt processing based on a fixed-period hardware interrupt source, and triggers a call to the application layer during the driver layer interrupt processing.
[0046] The task processing unit where the timing processing operation described in the embodiment of the present application is located is uniformly assigned a unique running task ID by the software system, and the type of timer required is selected according to the task ID identification triggering the timing processing operation. The task ID is uniformly managed in a standardized manner, and the process of selecting different types of timers according to the task ID identification is automatically completed, and then the target timer is determined from the N timers in the array queue.
[0047] The array queue in the embodiment of the present application is specifically a queue composed of timers after the registration process is completed.
[0048] The target timer described in the embodiments of the present application may be a timer supporting multiple functions, for example: a current thread type timer, a cross-thread type timer, a cross-process type timer or a cross-IP address domain type timer, where N is a positive integer.
[0049] Step 120, when the trigger time of the target timer is consistent with the current interrupt source beat count, execute the timing processing operation corresponding to the target timer.
[0050] Specifically, in the embodiment of the present application, the trigger source of the timer is uniformly the same interrupt source, and different timers are judged by the current terminal source beat technology, which ensures the synchronization of each timer and prevents cumulative timing errors. If the interrupt source is synchronized with a standard clock, such as GPS, the synchronization of cross-board timers can also be guaranteed.
[0051] The counting of the timer is realized based on the hardware interrupt, which ensures that the realized timers have the same source and will not be out of step with each other due to similar errors.
[0052] In the embodiment of the present application, when the trigger time of the target timer is consistent with the beat count of the current interrupt source, it means that the target timer meets the execution condition and the timing processing operation corresponding to the target timer needs to be executed.
[0053] In some optional embodiments, if there are multiple timers whose beat counts are consistent with the current interrupt source at the same time, a timer with a higher priority is selected for execution first.
[0054] In the embodiment of the present application, a unique task ID is assigned to each timed task, and different task IDs correspond to different scopes of action of the timer trigger, and thus correspond to different timer types, which can trigger timed processing operations of various scopes. In addition to triggering timed processing operations within a thread, it can also trigger timed processing operations across threads, across processes, and across IP address domains. And there is a unified operation interface to achieve compatibility, and there is no need to know the complex implementation process of the underlying layer when calling, and it is very convenient to operate the timer.
[0055] Optionally, executing a timing processing operation corresponding to the target timer includes:
[0056] In the case where the target timer is a timer of the current thread type, the target timing processing operation in the current thread is directly triggered.
[0057] Specifically, in an embodiment of the present application, when the target timer is the current thread type timer, it means that the timed task does not need to be processed across threads or processes, and directly triggers the target timing processing operation in the current thread.
[0058] In the embodiment of the present application, the current thread type timer can effectively trigger the timing operation processing within the thread, effectively ensuring the operation of the timer.
[0059] Optionally, executing a timing processing operation corresponding to the target timer includes:
[0060] In the case where the target timer is the cross-thread type timer, an inter-thread message mechanism is used to send a message to trigger a timing processing operation in the destination thread; wherein the destination thread is associated with the target timer.
[0061] Specifically, in an embodiment of the present application, when the target timer is the cross-thread type timer, it means that the task cannot be processed in the local thread and needs to be processed by calling other threads.
[0062] The destination thread described in the embodiment of the present application is a target thread corresponding to a target timer included in registration information during the registration process of the target timer, and the destination thread is associated with the target timer.
[0063] After the target timer meets the triggering condition, the inter-thread message mechanism is used to send a message to trigger the timing processing operation in the destination thread.
[0064] In the embodiment of the present application, through the cross-thread type timer, cross-thread timing operation processing can be effectively performed to effectively ensure the operation of the timer.
[0065] Optionally, executing a timing processing operation corresponding to the target timer includes:
[0066] In the case where the target timer is the cross-process type timer, an inter-process message mechanism is used to trigger a timing processing operation in a destination process, wherein the destination process is associated with the target timer.
[0067] Specifically, in the embodiment of the present application, when the target timer is the cross-process type timer, it means that the task cannot be processed in the local process and needs to call other processes for processing.
[0068] The target process described in the embodiment of the present application is the target process corresponding to the target timer included in the registration information during the registration process of the target timer, and the target process is associated with the target timer.
[0069] After the target timer meets the trigger condition, the inter-process message mechanism is used to send a message to trigger the timing processing operation in the destination process.
[0070] In the embodiment of the present application, through the cross-process type timer, cross-process timing operation processing can be effectively performed to effectively ensure the operation of the timer.
[0071] Optionally, executing a timing processing operation corresponding to the target timer includes:
[0072] In the case where the target timer is the cross-IP address domain type timer, a socket message is sent to trigger a destination timing processing operation in a destination IP address domain software environment, wherein the destination IP address domain is associated with the target timer.
[0073] Specifically, when the target timer is the cross-IP address domain type timer, it means that the task cannot be executed in the local IP address domain and needs to be executed across the IP address domain.
[0074] A socket message may be further sent to trigger a destination timing processing operation in the destination IP address domain software environment.
[0075] In the embodiment of the present application, a cross-IP address domain type timer can be used to effectively support the timing tasks across IP address domains and effectively implement the operation of the timer.
[0076] Optionally, before determining the target timer from the N timers in the array queue based on the timer type corresponding to the timed task information, the method further includes:
[0077] Obtaining registration parameters of the timer, wherein the registration parameters include: the task ID of the task processing unit where the timed task is located, the timer priority, the time length of the timer, and whether the timer runs periodically;
[0078] After completing the registration of the timer based on the registration parameters, the timer is added to the array queue.
[0079] Specifically, in the embodiment of the present application, before the array queue is applied, there is a set of timer registration process, and the timer will appear in the array queue only after the registration is completed. The registration parameters include: the task ID of the task processing unit where the target timing processing operation is located, the priority, the time length of the timer, and whether the timer runs periodically. The registration parameters are written into the array queue element, and the array element also includes the timer validity flag and the timing count.
[0080] In addition to registration management operations, timers also have a set of operation and maintenance operations. The corresponding timer is identified according to the timer identification ID returned when the timer is registered. Maintenance operations include: timer activation or suspension, timer deletion, and modification of timer parameters.
[0081] In the embodiment of the present application, each scheduled task corresponds to a set of task IDs, each task ID is unique, and the timer system automatically selects the corresponding timer trigger message mechanism based on the identified task ID. The timer management task identification process is unified, standardized, and concise.
[0082] Optionally, the timer implemented by the present invention can be controlled by a unified cycle interrupt source to trigger a corresponding timing processing operation, and the trigger mode type can be selected according to the relationship between task IDs. According to the trigger mode type, the timer can be classified into a current thread type timer, an inter-thread type timer, an inter-process type timer, and a cross-IP address domain type timer. The timer system performs the following steps:
[0083] Step S1: In the bottom layer driver, an interrupt process is established based on a fixed period hardware interrupt source, and the driver layer interrupt process triggers a call task to the application layer. All timers involved in the present invention use this period interrupt source.
[0084] Step S2: At the application layer, accept the call triggered by the driver interrupt, maintain an array queue at the application layer, and each element of the array queue corresponds to a timer. When the timer trigger time is consistent with the current interrupt source beat count, the timer with a higher priority is selected for execution first.
[0085] Step S3, following step S2, the timer selects a corresponding sending trigger message mechanism according to four types of timers. There are four types of timers, namely, current thread type timer, inter-thread type timer, inter-process type timer, and cross-IP address domain type timer. The sending trigger message mechanisms corresponding to these four types of timers are respectively directly triggering the destination timing processing operation in the current thread, using the inter-thread message mechanism to send a message to trigger the timing processing operation in the destination thread, using the inter-process message mechanism to trigger the timing processing operation in the destination process, and using sending a socket message to trigger the destination timing processing operation in the destination IP address domain software environment.
[0086] Step S4: After receiving the corresponding timer trigger message, the destination task executes the corresponding timer processing operation.
[0087] In step S3, the task processing unit where the timing processing operation is located is uniformly assigned a unique running task ID by the software system, and the type of timer required for triggering the timing processing operation is selected according to the task ID identification. The task ID is uniformly managed in a standardized manner, and the process of selecting different types of timers according to the task ID identification is completed automatically.
[0088] In step S2, before the array queue is applied, there is a set of timer registration process, and the timer will appear in the array queue only after the registration is completed. The registration parameters include: the task ID of the task processing unit where the target timing processing operation is located, the priority, the time length of the timer, and whether the timer runs periodically. The registration parameters are written into the array queue element, and the array element also includes the timer validity flag and the timing count.
[0089] In addition to registration management operations, timers also have a set of operation and maintenance operations. The corresponding timer is identified according to the timer identification ID returned when the timer is registered. Maintenance operations include: timer activation or suspension, timer deletion, and modification of timer parameters.
[0090] The timer operating device provided by the present invention is described below. The timer operating device described below and the timer operating method described above can be referenced to each other.
[0091] Figure 2 A schematic diagram of a timer operation device provided in an embodiment of the present application is shown in FIG. Figure 2As shown, it includes: a determination module 210 and an operation module 220; wherein the determination module 210 is used to determine the target timer from the N timers in the array queue based on the timer type corresponding to the timing task information, wherein the target timer is: a current thread type timer, a cross-thread type timer, a cross-process type timer or a cross-IP address domain type timer, and N is a positive integer; wherein the operation module 220 is used to execute the timing processing operation corresponding to the target timer when the trigger time of the target timer is consistent with the current interrupt source beat count.
[0092] Optionally, according to a timer operation device provided by the present invention, the operation module is specifically used to:
[0093] In the case where the target timer is a timer of the current thread type, the target timing processing operation in the current thread is directly triggered.
[0094] According to a timer operation device provided by the present invention, the operation module is specifically used for:
[0095] In the case where the target timer is the cross-thread type timer, an inter-thread message mechanism is used to send a message to trigger a timing processing operation in the destination thread; wherein the destination thread is associated with the target timer.
[0096] According to a timer operation device provided by the present invention, the operation module is specifically used for:
[0097] In the case where the target timer is the cross-process type timer, an inter-process message mechanism is used to trigger a timing processing operation in a destination process, wherein the destination process is associated with the target timer.
[0098] According to a timer operation device provided by the present invention, the operation module is specifically used for:
[0099] In the case where the target timer is the cross-IP address domain type timer, a socket message is sent to trigger a destination timing processing operation in a destination IP address domain software environment, wherein the destination IP address domain is associated with the target timer.
[0100] According to a timer operation device provided by the present invention, the device is also used for:
[0101] Obtaining registration parameters of the timer, wherein the registration parameters include: the task ID of the task processing unit where the timed task is located, the timer priority, the time length of the timer, and whether the timer runs periodically;
[0102] After completing the registration of the timer based on the registration parameters, the timer is added to the array queue.
[0103] In the embodiment of the present application, a unique task ID is assigned to each timed task, and different task IDs correspond to different scopes of action of the timer trigger, and thus correspond to different timer types, which can trigger timed processing operations of various scopes. In addition to triggering timed processing operations within a thread, it can also trigger timed processing operations across threads, across processes, and across IP address domains. And there is a unified operation interface to achieve compatibility, and there is no need to know the complex implementation process of the underlying layer when calling, and it is very convenient to operate the timer.
[0104] Figure 3 is a schematic diagram of the structure of the electronic device provided by the present invention, such as Figure 2 As shown, the electronic device may include: a processor 310, a communication interface 320, a memory 330 and a communication bus 340, wherein the processor 310, the communication interface 320 and the memory 330 communicate with each other through the communication bus 340. The processor 310 may call the logic instructions in the memory 330 to execute the timer operation method, the method comprising: based on the timer type corresponding to the timer task information, determining the target timer from the N timers in the array queue, wherein the target timer is: a current thread type timer, a cross-thread type timer, a cross-process type timer or a cross-IP address domain type timer, and N is a positive integer; when the trigger time of the target timer is consistent with the current interrupt source beat count, executing the timing processing operation corresponding to the target timer.
[0105] In addition, the logic instructions in the above-mentioned memory 330 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0106] On the other hand, the present invention also provides a computer program product, which includes a computer program, and the computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the timer operation method provided by the above-mentioned methods, and the method includes: based on the timer type corresponding to the timing task information, determining the target timer from the N timers in the array queue, wherein the target timer is: a current thread type timer, a cross-thread type timer, a cross-process type timer or a cross-IP address domain type timer, and N is a positive integer; when the trigger time of the target timer is consistent with the current interrupt source beat count, executing the timing processing operation corresponding to the target timer.
[0107] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the timer operation method provided by the above-mentioned methods, the method comprising: based on the timer type corresponding to the timing task information, determining a target timer from N timers in an array queue, wherein the target timer is: a current thread type timer, a cross-thread type timer, a cross-process type timer or a cross-IP address domain type timer, and N is a positive integer; when the trigger time of the target timer is consistent with the current interrupt source beat count, executing the timing processing operation corresponding to the target timer.
[0108] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0109] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0110] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A timer operation method, characterized in that: include: Based on the timer type corresponding to the timed task information, determine the target timer from the N timers in the array queue, wherein the target timer is: a current thread type timer, a cross-thread type timer, a cross-process type timer, or a cross-IP address domain type timer, and N is a positive integer; When the trigger time of the target timer is consistent with the current interrupt source beat count, executing the timing processing operation corresponding to the target timer; The step of executing the timing processing operation corresponding to the target timer includes: When the target timer is a timer of the current thread type, directly triggering the target timing processing operation in the current thread; The step of executing the timing processing operation corresponding to the target timer includes: In the case where the target timer is the cross-thread type timer, an inter-thread message mechanism is used to send a message to trigger a timing processing operation in the destination thread; wherein the destination thread is associated with the target timer; The step of executing the timing processing operation corresponding to the target timer includes: In the case where the target timer is the cross-process type timer, an inter-process message mechanism is used to trigger a timing processing operation in a destination process, wherein the destination process is associated with the target timer; The step of executing the timing processing operation corresponding to the target timer includes: In the case where the target timer is the cross-IP address domain type timer, a socket message is sent to trigger a destination timing processing operation in a destination IP address domain software environment, wherein the destination IP address domain is associated with the target timer.
2. The timer operation method according to claim 1, characterized in that: Before determining the target timer from the N timers in the array queue based on the timer type corresponding to the timed task information, the method further includes: Obtaining registration parameters of the timer, wherein the registration parameters include: the task ID of the task processing unit where the timed task is located, the timer priority, the time length of the timer, and whether the timer runs periodically; After completing the registration of the timer based on the registration parameters, the timer is added to the array queue.
3. A timer operation device, characterized in that: include: A determination module, configured to determine a target timer from N timers in the array queue based on a timer type corresponding to the timer information, wherein the target timer is a current thread type timer, a cross-thread type timer, a cross-process type timer, or a cross-IP address domain type timer, and N is a positive integer; An operation module, used for executing a timing processing operation corresponding to the target timer when the trigger time of the target timer is consistent with the beat count of the current interrupt source; Wherein, the device is also used for: When the target timer is a timer of the current thread type, directly triggering the target timing processing operation in the current thread; In the case where the target timer is the cross-thread type timer, an inter-thread message mechanism is used to send a message to trigger a timing processing operation in the destination thread; wherein the destination thread is associated with the target timer; In the case where the target timer is the cross-process type timer, an inter-process message mechanism is used to trigger a timing processing operation in a destination process, wherein the destination process is associated with the target timer; In the case where the target timer is the cross-IP address domain type timer, a socket message is sent to trigger a destination timing processing operation in a destination IP address domain software environment, wherein the destination IP address domain is associated with the target timer.
4. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the timer operation method according to any one of claims 1 to 2 is implemented.
5. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the timer operation method according to any one of claims 1 to 2 is implemented.
6. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the timer operation method according to any one of claims 1 to 2 is implemented.
